• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • ✅ HD Level Design Contest #1 POLL is now OPEN! Check out the stunning visuals of the final entries. 🔗Click here to cast your vote!

Creep Respawner

Status
Not open for further replies.
Level 5
Joined
Oct 30, 2007
Messages
91
Can anyone make me a creep respawning system that lets creeps respawn after they are kill at the point they die at at a certain time after their deaths. Like the one in dota, hate to use that reference >.>
 
Level 5
Joined
Oct 30, 2007
Messages
91
Is there anyone that isn't in vjass? Srry if i wasn't clear but i would prefer the system in gui. And i know the map says it has gui but the system itself is in vjass, so i can't use it =_=. Thx anyways =]
 
here you have (just copy this in a new trigger, and name the trigger Respawn01)
JASS:
function Trig_Respawn01_Conditions takes nothing returns boolean
    if ( not ( GetOwningPlayer(GetDyingUnit()) == Player(PLAYER_NEUTRAL_AGGRESSIVE) ) ) then
        return false
    endif
    return true
endfunction

function Trig_Respawn01_Actions takes nothing returns nothing
    local unit u = GetDyingUnit()
    local location l = GetUnitLoc(u)
    local real facing = GetUnitFacing(u)
    call TriggerSleepAction( 70.00 )    //This is the wait time.
    call CreateNUnitsAtLoc( 1, GetUnitTypeId(u), Player(PLAYER_NEUTRAL_AGGRESSIVE), l, facing )
    call RemoveLocation(l)
endfunction

//===========================================================================
function InitTrig_Respawn01 takes nothing returns nothing
    set gg_trg_Respawn01 = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Respawn01, EVENT_PLAYER_UNIT_DEATH )
    call TriggerAddCondition( gg_trg_Respawn01, Condition( function Trig_Respawn01_Conditions ) )
    call TriggerAddAction( gg_trg_Respawn01, function Trig_Respawn01_Actions )
endfunction
 
Level 2
Joined
Jun 25, 2009
Messages
19
JASS:
function Trig_Respawn01_Conditions takes nothing returns boolean
    if ( not ( GetOwningPlayer(GetDyingUnit()) == Player(11) ) ) then
        return false
    endif
    return true
endfunction

function Trig_Respawn01_Actions takes nothing returns nothing
    local unit u = GetDyingUnit()
    local location l = GetUnitLoc(u)
    local real facing = GetUnitFacing(u)
    call TriggerSleepAction( 70.00 )    //This is the wait time.
    call CreateNUnitsAtLoc( 1, GetUnitTypeId(u), Player(11), l, facing )
    call RemoveLocation(l)
endfunction

//===========================================================================
function InitTrig_Respawn01 takes nothing returns nothing
    set gg_trg_Respawn01 = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Respawn01, EVENT_PLAYER_UNIT_DEATH )
    call TriggerAddCondition( gg_trg_Respawn01, Condition( function Trig_Respawn01_Conditions ) )
    call TriggerAddAction( gg_trg_Respawn01, function Trig_Respawn01_Actions )
endfunction
 
Last edited:
Level 5
Joined
Oct 30, 2007
Messages
91
It doesn't work, can you help?
JASS:
function Trig_Respawn01_Conditions takes nothing returns boolean
    if ( not ( GetOwningPlayer(GetDyingUnit()) == Player(11) ) ) then
        return false
    endif
    return true
endfunction

function Trig_Respawn01_Actions takes nothing returns nothing
    local unit u = GetDyingUnit()
    local location l = GetUnitLoc(u)
    local real facing = GetUnitFacing(u)
    call TriggerSleepAction( 5.00 ) //This is the wait time.
    call CreateNUnitsAtLoc( 1, GetUnitTypeId(u), Player(11), l, facing )
    call RemoveLocation(l)
endfunction

//===========================================================================
function InitTrig_Respawn01 takes nothing returns nothing
    set gg_trg_Respawn01 = CreateTrigger( )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Respawn01, EVENT_PLAYER_UNIT_DEATH )
    call TriggerAddCondition( gg_trg_Respawn01, Condition( function Trig_Respawn01_Conditions ) )
    call TriggerAddAction( gg_trg_Respawn01, function Trig_Respawn01_Actions )
endfunction
 
Level 5
Joined
Oct 30, 2007
Messages
91
Wow thx, i understood most of the jass but it just wouldnt work =_= But a gui system would b gr8 =) rep for all that helped! Actually it works but the wait doesn't exceed 60 seconds =_=
 
Last edited:
Status
Not open for further replies.
Top