I can get these units to spawn, but they will not cast their spell.
Nuetral Hostile has a full visibility of the map modifier, the spells casting range is 1500
They spawn, get removed, but don't cast the spell.
I'm pretty much trying to make a bunch of units cast flamestrike near the caster.
Any help or insight is appreciated.
Nuetral Hostile has a full visibility of the map modifier, the spells casting range is 1500
They spawn, get removed, but don't cast the spell.
I'm pretty much trying to make a bunch of units cast flamestrike near the caster.
Any help or insight is appreciated.
JASS:
function PFC takes nothing returns boolean
return GetSpellAbilityId() == 'A016'
endfunction
function removal takes nothing returns nothing
call RemoveUnit(GetEnumUnit())
endfunction
function PFA takes nothing returns nothing
local unit u = GetSpellAbilityUnit()
local unit z
local integer i = GetUnitAbilityLevel(u, 'A016')
local real x = GetUnitX(u)
local real y = GetUnitY(u)
local group g
local integer c = 8
call PlaySoundOnUnitBJ( gg_snd_KaelWarcry1, 100, u )
set z = CreateUnit(Player(12), 'nanb',x,y, 0)
call SetUnitVertexColor(z, 0, 0, 0, 0)
call SetUnitAbilityLevel(z,'ANsf',i)
call GroupAddUnit(g,z)
call IssuePointOrder(z,"flamestrike", x, y)
loop
exitwhen c == 0
set z = CreateUnit(Player(12), 'nanb',x,y, 0)
call SetUnitVertexColor(z, 0, 0, 0, 0)
call SetUnitAbilityLevel(z,'ANsf',i)
call GroupAddUnit(g,z)
call IssuePointOrder(z,"flamestrike", GetRandomReal(-600,600)+x, GetRandomReal(-600,600)+y)
set c = c - 1
endloop
call TriggerSleepAction(4)
call ForGroupBJ(g, function removal)
call DestroyGroup(g)
set g = null
set z = null
set u = null
endfunction
//===========================================================================
function InitTrig_Pyro_FlamingRet takes nothing returns nothing
set gg_trg_Pyro_FlamingRet = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Pyro_FlamingRet, EVENT_PLAYER_UNIT_SPELL_CHANNEL )
call TriggerAddCondition( gg_trg_Pyro_FlamingRet, Condition( function PFC ) )
call TriggerAddAction( gg_trg_Pyro_FlamingRet, function PFA )
endfunction