function Trig_Horizontal_Gate1_Conditions takes nothing returns boolean
if (not (GetUnitTypeId(GetTriggerUnit())=='h022')) then
return false
endif
if (not (GetSpellAbilityId()=='A01Q')) then
return false
endif
return true
endfunction
function Trig_Horizontal_Gate1_Actions takes nothing returns nothing
call StopSpellFromCasting(GetSpellAbilityUnit())
call ReplaceUnitAdvanced(GetSpellAbilityUnit(),'h023',bj_UNIT_STATE_METHOD_RELATIVE)
call SetUnitAnimation(GetLastReplacedUnitBJ(),"Death Alternate")
call SelectUnitAddForPlayer(GetLastReplacedUnitBJ(),GetOwningPlayer(GetSpellAbilityUnit()))
endfunction
function InitTrig_Horizontal_Gate1 takes nothing returns nothing
set gg_trg_Horizontal_Gate1=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(gg_trg_Horizontal_Gate1,EVENT_PLAYER_UNIT_SPELL_CAST)
call TriggerAddCondition(gg_trg_Horizontal_Gate1,Condition(function Trig_Horizontal_Gate1_Conditions))
call TriggerAddAction(gg_trg_Horizontal_Gate1,function Trig_Horizontal_Gate1_Actions)
endfunction