Приветствую всех опытных джассеров! Обращаюсь к вам, наверное, с нетрудным вопросом. Я попытался в хеш-таблице повесить на ID таймера эффект. По истечении таймера эффект нужно убрать, но он не убирается!
Код даю ниже:
Code
function Trig_SandStorm_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A000'
endfunction
function SandStormEffectRemove takes nothing returns nothing
local timer t = GetExpiredTimer()
local effect e = LoadEffectHandle(udg_SandHeroHashtable,GetHandleId(t),1)
call DestroyEffect(e)
call DestroyTimer(t)
set e = null
set t = null
endfunction
function Trig_SandStorm_Actions takes nothing returns nothing
local unit caster = GetSpellAbilityUnit()
local timer st = CreateTimer() // Spell Timer
local timer et = CreateTimer() // Effect Timer
local effect e = AddSpecialEffectTarget("war3mapImported\\SandTornado.mdx",caster,"origin")
call SaveEffectHandle(udg_SandHeroHashtable,GetHandleId(et),1,e)
call SaveUnitHandle(udg_SandHeroHashtable,GetHandleId(st),2,caster)
call TimerStart(et,udg_SandStormDur[GetUnitAbilityLevel(caster,'A000')],false,function SandStormEffectRemove)
set et = null
set caster = null
set st = null
endfunction
//===========================================================================
function InitTrig_SandStorm takes nothing returns nothing
set gg_trg_SandStorm = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(gg_trg_SandStorm,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(gg_trg_SandStorm,Condition(function Trig_SandStorm_Conditions))
call TriggerAddAction(gg_trg_SandStorm,function Trig_SandStorm_Actions)
endfunction
st я потом ещё юзать собрался, но меня интересует именно почему не удаляется эффект.