// Spell ID //
constant function Stomp_ID takes nothing returns integer
return 'A007'
endfunction
// Damage //
constant function Stomp_Damage takes nothing returns real
return 200.
endfunction
// Area of Effect //
constant function Stomp_Area takes nothing returns real
return 150.
endfunction
// Caster Effect //
constant function Stomp_Caster_Effect takes nothing returns string
return "Abilities\\Spells\\Orc\\WarStomp\\WarStompCaster.mdl"
endfunction
// Target Effect //
constant function Stomp_Target_Effect takes nothing returns string
return "Abilities\\Weapons\\AncientProtectorMissile\\AncientProtectorMissile.mdl"
endfunction
// Filter //
function EnemyFilter takes nothing returns boolean
return IsPlayerEnemy( GetOwningPlayer( GetFilterUnit() ), GetOwningPlayer( GetTriggerUnit() ) ) == true
endfunction
// Spell Condition //
function Trig_Stomp_Conditions takes nothing returns boolean
return GetSpellAbilityId() == Stomp_ID()
endfunction
function Trig_Stomp_Actions takes nothing returns nothing
local unit caster = GetTriggerUnit()
local real x = GetUnitX( caster )
local real y = GetUnitY( caster )
local real X
local real Y
local group g
local unit u
//
call DestroyEffect( AddSpecialEffect( Stomp_Caster_Effect() , x , y ) )
//
call GroupEnumUnitsInRange( g , x , y , Stomp_Area() , Condition( function EnemyFilter ) )
loop
set u = FirstOfGroup( g )
exitwhen u == null
if GetUnitState( u , UNIT_STATE_LIFE ) > 0 then
set X = GetUnitX( u )
set Y = GetUnitY( u )
call DestroyEffect(AddSpecialEffect( Stomp_Target_Effect() , X , Y ) )
call UnitDamageTarget( caster , u , Stomp_Damage() , true , false , ATTACK_TYPE_CHAOS , DAMAGE_TYPE_NORMAL , WEAPON_TYPE_WHOKNOWS )
endif
call GroupRemoveUnit( g , u )
set u = null
endloop
call DestroyGroup( g )
//Actions//
set caster = null
set g = null
endfunction
function AntiLeaker takes nothing returns boolean
return true
endfunction
//===========================================================================
function InitTrig_Stomp takes nothing returns nothing
local trigger t = CreateTrigger( )
local filterfunc f = Filter(function AntiLeaker)
local integer i = 0
loop
call TriggerRegisterPlayerUnitEvent(t, Player(i), EVENT_PLAYER_UNIT_SPELL_EFFECT, f)
set i = i + 1
exitwhen i == 16
endloop
call TriggerAddCondition(t, Condition( function Trig_Stomp_Conditions ) )
call TriggerAddAction(t, function Trig_Stomp_Actions )
call DestroyFilter(f)
set f = null
set t = null
endfunction