Warcraft III resources & community, 2003–2006 · archived

Fast Hero Revive

not rated
Submitted by k_c_1_0_2Triggers0 downloads
A fast hero revive script I use in my spell maps.

Source

function Trig_Revive_Conditions takes nothing returns boolean
    return IsUnitType(GetDyingUnit(), UNIT_TYPE_HERO) == true
endfunction

function Trig_Revive_Actions takes nothing returns nothing
    local unit D = GetDyingUnit()
    local real X = GetUnitX(D)
    local real Y = GetUnitY(D)
    call ReviveHero(D, X, Y, false)
    set D = null
endfunction

//===========================================================================
function InitTrig_Revive takes nothing returns nothing
    set gg_trg_Revive = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Revive, EVENT_PLAYER_UNIT_DEATH )
    call TriggerAddCondition( gg_trg_Revive, Condition( function Trig_Revive_Conditions ) )
    call TriggerAddAction( gg_trg_Revive, function Trig_Revive_Actions )
endfunction

Comments

7
EWW. *bump from the past* missed that == true. Murder it. Now :P
I just made them for my spell testings and I thought I should upload them. If you don't like them, don't comment please.
triggering unit does not leak, but i really don't see the use for this...
what about IsIntDivisible? :lol:

and of course triggering unit doesnt leak :?
Oh k_c_1_0_2 please,
stop uploading these.

lol, i didn't nkow i'm a poet! :D:D:D
So its faster to just use triggering unit? I thought that leaked.
hmm, some more fixing :D

function Trig_Revive_Conditions takes nothing returns boolean
    return IsUnitType(GetTriggerUnit(), UNIT_TYPE_HERO) == true
endfunction
 
function Trig_Revive_Actions takes nothing returns nothing
    call ReviveHero(GetTriggerUnit()), GetUnitY(GetTriggerUnit()), GetUnitX(GetTriggerUnit()), false)
endfunction
 
//===========================================================================
function InitTrig_Revive takes nothing returns nothing
    set gg_trg_Revive = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Revive, EVENT_PLAYER_UNIT_DEATH )
    call TriggerAddCondition( gg_trg_Revive, Condition( function Trig_Revive_Conditions ) )
    call TriggerAddAction( gg_trg_Revive, function Trig_Revive_Actions )
endfunction