Need help with trigger: spawn and respawn

TheDarkBoy

New Member
Reaction score
3
Hi, i need help with spawning and respawning creeps. I need to make the trigger so that when a creep dies, a new one of same type spawns 30 seconds after. Any suggestions?
 

Faust

You can change this now in User CP.
Reaction score
123
JASS:
function Trig_Revive_them_creeps_Conditions takes nothing returns boolean
    if ( not ( IsUnitType(GetTriggerUnit(), UNIT_TYPE_STRUCTURE) == false ) ) then
        return false
    endif
    if ( not ( IsUnitType(GetTriggerUnit(), UNIT_TYPE_HERO) == false ) ) then
        return false
    endif
    return true
endfunction

function Trig_Revive_them_creeps_Actions takes nothing returns nothing
    local real x = GetUnitX(GetTriggerUnit())
    local real y = GetUnitY(GetTriggerUnit())
    local integer ID = GetUnitTypeId(GetTriggerUnit())
    local player owner = GetOwningPlayer(GetTriggerUnit())
    call TriggerSleepAction( 30.00 )
    call CreateUnit(owner, ID, x, y, bj_UNIT_FACING )
endfunction

//===========================================================================
function InitTrig_Revive_them_creeps takes nothing returns nothing
    set gg_trg_Revive_them_creeps = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Revive_them_creeps, EVENT_PLAYER_UNIT_DEATH )
    call TriggerAddCondition( gg_trg_Revive_them_creeps, Condition( function Trig_Revive_them_creeps_Conditions ) )
    call TriggerAddAction( gg_trg_Revive_them_creeps, function Trig_Revive_them_creeps_Actions )
endfunction

I think it would work o_O
 

LightChaosma

New Member
Reaction score
60
Code:
Untitled Trigger 001
    Events
        Unit - A unit Dies
    Conditions
    Actions
        Wait 30.00 seconds
        Set unittype = (Unit-type of (Triggering unit))
        Unit - Create 1 unittype for Player 9 (Gray) at point facing (Random angle) degrees


not sure wether triggerig unit is kept 30 seconds... if it is, this should work
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top