|
[codes=jass]
function Trig_gamecache_TimerFunc takes nothing returns nothing
local integer iu = GetStoredInteger(udg_GC, I2S(h2i(GetExpiredTimer())), "DamagedUnit")
call UnitDamageTarget(i2u(GetStoredInteger(udg_GC, I2S(h2i(GetExpiredTimer())), "Caster")), i2u(iu), 10.0, true, true, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_LIGHTNING, WEAPON_TYPE_WHOKNOWS)
if GetUnitAbilityLevel(i2u(iu), 'BHtc') <= 0 then
call FlushStoredMission(udg_GC, I2S(h2i(GetExpiredTimer())))
call FlushStoredInteger(udg_GC, I2S(iu), "ThunderClapTimer")
call DestroyTimer(GetExpiredTimer())
endif
endfunction
function Trig_gamecache_FilterFunc takes nothing returns boolean
if GetUnitAbilityLevel(GetFilterUnit(), 'BHtc') > 0 and not HaveStoredInteger(udg_GC, I2S(h2i(GetFilterUnit())), "ThunderClapTimer") then
set bj_lastStartedTimer = CreateTimer()
call StoreInteger(udg_GC, I2S(h2i(GetFilterUnit())), "ThunderClapTimer", h2i(bj_lastStartedTimer))
call StoreInteger(udg_GC, I2S(h2i(bj_lastStartedTimer)), "DamagedUnit", h2i(GetFilterUnit()))
call StoreInteger(udg_GC, I2S(h2i(bj_lastStartedTimer)), "Caster", h2i(GetTriggerUnit()))
call TimerStart(bj_lastStartedTimer,1.0,true, function Trig_gamecache_TimerFunc)
endif
return false
endfunction
function Trig_gamecache_Conditions takes nothing returns boolean
if GetSpellAbilityId() == 'AHtc' then
call GroupEnumUnitsInRange(udg_TC_Group, GetUnitX(GetTriggerUnit()), GetUnitY(GetTriggerUnit()),400, Condition(function Trig_gamecache_FilterFunc))
endif
return false
endfunction
function InitTrig_gamecache takes nothing returns nothing
set gg_trg_gamecache = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(gg_trg_gamecache, EVENT_PLAYER_UNIT_SPELL_FINISH)
call TriggerAddCondition(gg_trg_gamecache, Condition(function Trig_gamecache_Conditions))
endfunction
[/codes]
其中这一段
[codes=jass]
if GetUnitAbilityLevel(GetFilterUnit(), 'BHtc') > 0 and not HaveStoredInteger(udg_GC, I2S(h2i(GetFilterUnit())), "ThunderClapTimer")
[/codes]
选取单位'BHtc'技能等级大于0 并且选取单位没有被绑定特定计时器
AND后面的都好理解 这个'BHtc'是个什么技能啊? 判断选取单位这个技能等级大于0 到底有什么意义 |
|