Why wont the unit cast the spell

Fir3l0rD

New Member
Reaction score
1
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() == 'A000' ) ) 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, 'h000', 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
 
Do the dummy units have the spell? Do they have the mana to cast it? Also you should remove the location leak, it's good practice.
 
JASS:
        call IssueImmediateOrderBJ( u, "A001" )


try replacing A001 with the order string. for instance: "thunderclap"

i'll try it, and yes the dummy units have the mana etc, thats what i tried to say in the first post, guess my wording wasnt that great =p. anyways i'll try the order string thingy. would it be the spell name itself or what its called ingame?

Thanks, that seemed to fix it, i just need to tweak it so it looks good
 
General chit-chat
Help Users

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top