|
global s
// User-defined
location udg_TempLoc = null
group udg_TC_Group = null
integer udg_TC_LoopInt = 0
group udg_LocalGroup = null
integer udg_LocalInt = 0
gamecache udg_GC = null
// Generated
trigger gg_trg_gamacacheInit = null
trigger gg_trg_Trg1 = null
trigger gg_trg_Trg2 = null
trigger gg_trg_gamecache = null
endglobals
function h2i takes handle h returns integer
return h
return 0
endfunction
function i2u takes integer i returns unit
return i
return null
endfunction
function s2i takes string s returns integer
return s
return 0
endfunction
function i2s takes integer i returns string
return i
return null
endfunction
function Trig_gamacacheInit_Actions takes nothing returns nothing
call InitGameCacheBJ( "MapName.w3v" )
set udg_GC = GetLastCreatedGameCacheBJ()
endfunction
function InitTrig_gamacacheInit takes nothing returns nothing
set gg_trg_gamacacheInit = CreateTrigger( )
call TriggerAddAction( gg_trg_gamacacheInit, function Trig_gamacacheInit_Actions )
endfunction
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
函数GroupEnumUnitsInRange是干什么的?选取一定范围内的单位做动作??udg_TC_Group没见到他赋值呢?函数HaveStoredInteger的作用是??‘BHtc’没见到这个技能啊!
FlushStoredMission是删除一个类别么??
FlushStoredInteger是删除一个类别下的文件里的整数??
演示来源http://bbs.islga.org/read-htm-tid-3791.html
这是演示地图
|
|