|
[codes=jass]function Trig_Spell_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'AHtc' ) ) then
return false
endif
return true
endfunction
function trg_start takes nothing returns nothing
local timer t = GetExpiredTimer()
local unit h = I2U(GetStoredInteger(udg_GC,I2S(H2I(t)),"HERO"))
call DestroyEffect( AddSpecialEffectTarget("Objects\\Spawnmodels\\NightElf\\NECancelDeath\\NECancelDeath.mdl", h, "origin") )
endfunction
function trg_really takes nothing returns nothing
local timer t = CreateTimer()
local unit u = GetTriggerUnit()
call StoreInteger(udg_GC, I2S(h2i(t)), "HERO", h2i(u))
call TimerStart(t,1.0,true, function trg_start)
set t = null
endfunction
function InitTrig_Spell takes nothing returns nothing
set gg_trg_Spell = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Spell, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Spell, Condition( function Trig_Spell_Conditions ) )
endfunction[/codes] |
|