- Joined
- Aug 4, 2012
- Messages
- 1,021
http://www.hiveworkshop.com/forums/...-zinc-238822/?prev=search=respawn&d=list&r=20
What I want:
1. Revive hero with the timer (4 * hero level)
2. Respawn Neutral Creeps (Specified Force) with the timer of 60 seconds
Here's my code:
What I want:
1. Revive hero with the timer (4 * hero level)
2. Respawn Neutral Creeps (Specified Force) with the timer of 60 seconds
Here's my code:
JASS:
scope Revive initializer Timer
function Go takes nothing returns nothing
call RespawnSystem.registerEx(GetEnumUnit(), I2R(GetHeroLevel(GetEnumUnit())) * 4, "", GetOwningPlayer(GetEnumUnit()))
call DisplayTextToPlayer(Player(0), 10, 10, R2S(I2R(GetHeroLevel(GetEnumUnit())) * 4))
endfunction
function Detect takes nothing returns nothing
call ForGroupBJ(GetUnitsInRectAll(GetPlayableMapRect()), function Go)
endfunction
function Timer takes nothing returns nothing
local trigger THIS = CreateTrigger()
call TriggerRegisterTimerEventSingle(THIS, 1.00)
call TriggerAddAction(THIS, function Detect)
endfunction
endscope