globals
constant integer ORDER_slowoff = 852077
constant integer ORDER_slowon = 852076
endglobals
struct onAutoCast extends array
static method onCast takes nothing returns boolean
local integer o = GetIssuedOrderId()
if ( o == ORDER_slowon ) then
// stuff
elseif ( o == ORDER_slowoff ) then
// stuff
endif
return false
endmethod
static method onInit takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_ISSUED_ORDER)
call TriggerAddCondition(t, Condition(function thistype.onCast))
set t = null
endmethod
endstruct