hey, i'm working on an ability which makes a bunch of warstomps around the casting unit, i have a script written which works except for that it creates and removes the dummy units fine, but they dont cast the spell. Basically it creates a bunch of dummies around the triggering hero which then use an actually war stomp ability. I tested a dummy individually and it works fine with war stomp spell. Why wont they cast it when the whole spell runs? heres the script
JASS:
function Trig_Melee_Initialization_Copy_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 039;A000039; ) ) then
return false
endif
return true
endfunction
function Trig_Melee_Initialization_Copy_Actions takes nothing returns nothing
local integer i
local unit u
set i = 1
loop
exitwhen i > 6
call CreateNUnitsAtLoc( 1, 039;h000039;, GetOwningPlayer(GetTriggerUnit()), GetRandomLocInRect(RectFromCenterSizeBJ(GetUnitLoc(GetTriggerUnit()), 600.00, 600.00)), bj_UNIT_FACING )
set u = GetLastCreatedUnit()
call TriggerSleepAction( 0.4 )
call IssueImmediateOrderBJ( u, "A001" )
call TriggerSleepAction(2.0)
call RemoveUnit(u)
set i = i + 1
endloop
endfunction
//===========================================================================
function InitTrig_Melee_Initialization_Copy takes nothing returns nothing
set gg_trg_Melee_Initialization_Copy = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Melee_Initialization_Copy, EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( gg_trg_Melee_Initialization_Copy, Condition( function Trig_Melee_Initialization_Copy_Conditions ) )
call TriggerAddAction( gg_trg_Melee_Initialization_Copy, function Trig_Melee_Initialization_Copy_Actions )
endfunction