Shit Code only works on first cast
Someone tell me why this code only works on first cast
Someone tell me why this code only works on first cast
JASS:
scope BloodsTrick initializer init
globals
private xecast cast
endglobals
private function Cond takes nothing returns boolean
return GetSpellAbilityId() == 039;A0HG039;
endfunction
private function Act takes nothing returns nothing
local unit u = GetTriggerUnit()
set cast.owningplayer = GetOwningPlayer(u)
call cast.castOnTarget(puppeteers[GetPlayerId(GetOwningPlayer(u))].puppet)
set u = null
endfunction
private function init takes nothing returns nothing
local trigger trig = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(trig, EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(trig, Condition(function Cond))
call TriggerAddAction(trig, function Act)
set cast = xecast.create()
set cast.abilityid = 039;A0HH039;
set cast.orderid = 852274
endfunction
endscope