library test initializer init
globals
private hashtable ht = InitHashtable()
private integer effectCount = 0
endglobals
function ASE_h takes string n, real x, real y returns effect
set effectCount = effectCount + 1
return null
endfunction
function ASEL_h takes string n, location loc returns effect
set effectCount = effectCount + 1
return null
endfunction
function ASELBJ_h takes location loc, string n returns effect
set effectCount = effectCount + 1
return null
endfunction
function ASET_h takes string n, widget w, string a returns effect
set effectCount = effectCount + 1
return null
endfunction
function ASETUBJ_h takes string n, widget w, string a returns effect
set effectCount = effectCount + 1
return null
endfunction
function de takes effect e returns nothing
if LoadInteger(ht, GetHandleId(e), 0) != 1 then
set effectCount = effectCount - 1
call SaveInteger(ht, GetHandleId(e), 0, 1)
endif
endfunction
hook AddSpecialEffect ASE_h
hook AddSpecialEffectLoc ASEL_h
hook AddSpecialEffectLocBJ ASELBJ_h
hook AddSpecialEffectTarget ASET_h
hook AddSpecialEffectTargetUnitBJ ASETUBJ_h
hook DestroyEffect de
hook DestroyEffectBJ de
function display takes nothing returns boolean
call BJDebugMsg(I2S(effectCount))
return false
endfunction
function init takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterPlayerChatEvent(t, Player(0), "-", true)
call TriggerAddCondition(t, Condition(function display))
set t = null
endfunction
endlibrary