function SoulWaveCon takes nothing returns boolean
return GetSpellAbilityId() == 'A0A4'
endfunction
function SoulWaveAct takes nothing returns nothing
local unit cas = GetTriggerUnit()
local location casloc = GetUnitLoc(cas)
local location tarloc = GetSpellTargetLoc()
local integer lvl = GetUnitAbilityLevel(cas,'A0A4')
local real dis = DistanceBetweenPoints(casloc,tarloc)
local integer point = R2I(dis/250)
local real angle = AngleBetweenPoints(casloc,tarloc)
local location dumpoint
local unit dummy
if point < 1 then
set point = 1
else
endif
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = point
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
set dumpoint = PolarProjectionBJ(casloc,I2R(bj_forLoopAIndex*250),angle)
call CreateUnitAtLoc(GetOwningPlayer(cas),'h01A',dumpoint,0.00)
set dummy = GetLastCreatedUnit()
call UnitApplyTimedLife(dummy,'BTLF',1.0)
call UnitAddAbility(dummy,'A0A3')
call SetUnitAbilityLevel(dummy,'A0A3',lvl)
call IssueImmediateOrder( dummy,"howlofterror")
[COLOR="#FF0000"][B]call DestroyEffect(AddSpecialEffect("Abilities\Spells\Other\HowlOfTerror\HowlCaster.mdl",GetLocationX(dumpoint),GetLocationY(dumpoint)))[/B][/COLOR] [I]call AddSpecialEffectLocBJ(dumpoint,"Abilities\\Spells\\Other\HowlOfTerror\\HowlCaster.mdl")
call DestroyEffectBJ(GetLastCreatedEffectBJ())[/I]
set dummy = null
call RemoveLocation(dumpoint)
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
call RemoveLocation(casloc)
call RemoveLocation(tarloc)
[COLOR="#0000FF"]set dumpoint = null
set casloc = null
set tarloc = null
set cas = null
[/COLOR]
endfunction
//===========================================================================
function InitTrig_Soul_Wave takes nothing returns nothing
local trigger SoulWave = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( SoulWave, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( SoulWave, Condition( function SoulWaveCon ) )
call TriggerAddAction( SoulWave, function SoulWaveAct )
endfunction