- Joined
- Jan 2, 2016
- Messages
- 472
JASS:
function TimerExpires takes nothing returns nothing
local timer t = GetExpiredTimer()
local integer idx = LoadInteger(udg_int_table, GetHandleId(t), 0)
call BJDebugMsg("Running TimerExpires")
call CreateUnitAtLoc(Player(PLAYER_NEUTRAL_AGGRESSIVE),GetUnitTypeId(LoadUnitHandle(udg_ghash,GetHandleId(t), 0)), udg_neutral_hostile_pos[idx] , 0)
call PauseTimer(t)
call DestroyTimer(t)
set t = null
endfunction
function DelayedRespawn takes integer idx returns nothing
local timer t = CreateTimer()
call SaveUnitHandle( udg_ghash, GetHandleId(t), 0, GetTriggerUnit())
call SaveInteger( udg_int_table, GetHandleId(t), 0, idx)
call TimerStart(t,3,false,function TimerExpires)
call BJDebugMsg("Running DelayedRespawn")
set t = null
endfunction
-
Events
-
Unit - A unit dies
-
-
Conditions
-
((Triggering Unit) belongs to an ally of Neutral Hostile) equal to True
-
-
Actions
-
Custom script: call GetItemPool() // you can ignore this
-
For each (Integer A) from 1 to neutral_unit_idx, do (Actions)
-
Loop - Actions
-
If (All conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Triggering Unit) equal to neutral_hostile_unit[(Integer A)]
-
-
Then - Actions
-
Custom script: call DelayedRespawn(bj_forLoopAIndex)
-
-
Else - Actions
-
-
-
-
Both triggers run, although the unit is not created.I'm new to jass so i might not be doing something right.