function Trig_revive_Actions takes nothing returns nothing
local location position
local integer unitcode
local player owner
set position = GetUnitLoc(GetDyingUnit())
set unitcode = GetUnitTypeId(GetDyingUnit())
set owner = GetOwningPlayer(GetDyingUnit())
call TriggerSleepAction(120.00)
call CreateUnitAtLoc( owner, unitcode, position, bj_UNIT_FACING )
call RemoveLocation(position)
endfunction
//===========================================================================
function InitTrig_revive takes nothing returns nothing
set gg_trg_revive = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_revive, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddAction( gg_trg_revive, function Trig_revive_Actions )
endfunction
Yeah it's strange, I can't access those handles 'Position of (Dying Unit)' and 'Unit-Type of (Dying Unit)' after the corpse disappeared in GUI. With this script it works.
LOL, you think I didn't try it? Yes, I did, and it works fine for me (even if many different creeps die and are revived later)
Edit: Just for you I tested the trigger below again, 20 creeps (2 murlocs, 7 gnolls, 9 trolls, 2 murloc hunters), wait time 30 secs...
Killed them with a powerful hero several times via super-flamestrike and simple attacking, after 4 mins I stopped, waiting for everyone to revive, counted the different creeps and...here we go: 2 murlocs, 7 gnolls, 9 trolls, 2 murloc hunters
btw, don't wanna say your JASS-trigger is bad, it's very good, but it also works this way
Öhm, no, it's quite easy and the trigger works fine for any wait time and any number and type of creeps (an example for a creep revive trigger)
CreepRevive Events Unit - A unit Dies Conditions (Owner of (Dying unit)) Equal to Neutral Hostile Actions Wait - [Any Wait Time] Unit - Create 1 (Unit-type of (Dying unit)) for Neutral Hostile at (Position of (Dying unit)) facing [Any area or so, that's unimportant])
@ Yu_Yevon: With heroes yes, but with normal units it doesn't work, you have to save the position, player and unit-type in a variable first. In GUI (withouth local vars) it's pretty complex.