scope ItemCheese initializer Init
globals
private constant string CheeseSpellOrder = "web"
private constant integer CheeseSpellID = 'A01K'
private boolean justUsed = false
endglobals
private function Conditions takes nothing returns boolean
return ( GetSpellAbilityId() == CheeseSpellID )
endfunction
private function Actions takes nothing returns nothing
if (justUsed == false) then
call UnitResetCooldown(GetTriggerUnit())
set justUsed = true
call IssueImmediateOrder(GetTriggerUnit(), CheeseSpellOrder)
else
set justUsed = false
endif
endfunction
private function Init takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( t, Condition( function Conditions ) )
call TriggerAddAction( t, function Actions )
set t = null
endfunction
endscope // ItemCheese