I'm trying to make a spell which is based on immolation and when it's activated, it shoots a starfall-bolt every second to a random enemy in 400 aoe around you. The problem is, it doesn't do anything, any JASS-er wants to help me?
JASS:
function Filter1 takes nothing returns boolean
return ( IsUnitDeadBJ(GetFilterUnit()) == false )
endfunction
function Filter2 takes nothing returns boolean
return ( IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(GetTriggerUnit())) == true )
endfunction
function Filter3 takes nothing returns boolean
return GetBooleanAnd( Filter1(), Filter2() )
endfunction
function ImmolateActions takes nothing returns nothing
local unit C = GetTriggerUnit()
local group G = CreateGroup()
local location CL
local unit T
local effect E
loop
exitwhen UnitHasBuffBJ(C, 'BEia') == false
set CL = GetUnitLoc(C)
set G = GetUnitsInRangeOfLocMatching(400.00, CL), Condition(function Filter3))
set T = GroupPickRandomUnit(G)
call UnitDamageTargetBJ( C, T, 10.00, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
set E = AddSpecialEffectLoc("Abilities\\Spells\\NightElf\\Starfall\\StarfallTarget.mdl", GetUnitLoc(T))
set T = null
set G = null
set CL = null
set E = null
call TriggerSleepAction(1.00)
endloop
set C = null
set G = null
set T = null
set CL = null
set E = null
endfunction
//=================================================================
function InitTrig_Untitled_Trigger_002 takes nothing returns nothing
set gg_trg_Untitled_Trigger_002 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Untitled_Trigger_002, EVENT_PLAYER_UNIT_SPELL_FINISH )
call TriggerAddAction( gg_trg_Untitled_Trigger_002, function ImmolateActions)
endfunction
Last edited by a moderator: