//**************************************************************************************************\\
//Flood Nova Spell by MeLlamoMax\\
//**************************************************************************************************\\
function Trig_FNCast_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A02F'
endfunction
function FN_pulse_effect takes nothing returns nothing
local real angle = 0.0
local real a = (udg_FN_radius/15)
local real ang_inc = (360.00 / a)
local location splash
local effect e
loop
exitwhen angle >= 360.00
set splash = PolarProjectionBJ(udg_FN_target_point, udg_FN_radius, angle)
call AddSpecialEffectLoc("Objects\\Spawnmodels\\Naga\\NagaDeath\\NagaDeath.mdl", splash)
set e = bj_lastCreatedEffect
call DestroyEffect(e)
call RemoveLocation(splash)
set splash = null
set angle = (angle + ang_inc)
endloop
endfunction
function FN_pulse takes nothing returns nothing
local timer t = GetExpiredTimer()
local group targets
local group inMinRange
local real damage
local unit temp_target
set udg_FN_pulses_passed = (udg_FN_pulses_passed + 1)
set udg_FN_radius = (udg_FN_radius + 75.0)
if ( GetUnitCurrentOrder(udg_FN_caster) == String2OrderIdBJ("channel") ) or (udg_FN_pulses_passed <= 3) then
call FN_pulse_effect()
set targets = GetUnitsInRangeOfLocAll((udg_FN_radius + 75), udg_FN_target_point)
set inMinRange = GetUnitsInRangeOfLocAll((udg_FN_radius - 75), udg_FN_target_point)
loop
exitwhen CountUnitsInGroup(inMinRange) == 0
call GroupRemoveUnit(targets, FirstOfGroup(inMinRange))
endloop
set damage = (15.00+(35.00*GetUnitAbilityLevel(udg_FN_caster, 'A20F')))
loop
exitwhen CountUnitsInGroup(targets) == 0
set temp_target = FirstOfGroup(targets)
call UnitDamageTarget(udg_FN_caster, temp_target, damage, true, FALSE, ATTACK_TYPE_MAGIC, DAMAGE_TYPE_NORMAL, null)
call GroupRemoveUnit(targets, temp_target)
endloop
else
call PauseTimer(t)
call DestroyTimer(t)
set t= null
call DestroyGroup(targets)
set targets = null
call DestroyGroup(inMinRange)
set inMinRange = null
call RemoveLocation(udg_FN_target_point)
set udg_FNtarget_point = null
endif
endfunction
function Trig_FNCast_Actions takes nothing returns nothing
local timer t = CreateTimer()
set udg_FN_target_point = GetSpellTargetLoc()
set udg_FN_caster = GetTriggerUnit()
set udg_FN_radius = 0.0
call TimerStart(t, 0.2, true, function FN_pulse)
endfunction
//====================================================================================================
function InitTrig_FNCast takes nothing returns nothing
set gg_trg_FNCast = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_FNCast, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_FNCast, Condition( function Trig_FNCast_Conditions ) )
call TriggerAddAction( gg_trg_FNCast, function Trig_FNCast_Actions )
call Preload("Objects\\Spawnmodels\\Naga\\NagaDeath\\NagaDeath.mdl")
endfunction