function EffectedUnits takes nothing returns boolean
if GetUnitState(GetFilterUnit(), UNIT_STATE_LIFE) <= 0 then
return false
elseif IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(GetTriggerUnit())) == true then
return true
endif
return false
endfunction
function DamageUnits takes nothing returns nothing
call UnitDamageTarget(GetTriggerUnit(), GetEnumUnit(), udg_damage, true, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL, WEAPON_TYPE_WHOKNOWS)
endfunction
function Trig_Spell_Actions takes nothing returns nothing
local integer i = 0
local group g = CreateGroup()
local real damage = I2R(( 10 * GetHeroInt(GetTriggerUnit(), true) ))
if GetSpellAbilityId() == 'AHtc' then
loop
exitwhen i == 5
call GroupEnumUnitsInRange(g, GetUnitX(GetTriggerUnit()), GetUnitY(GetTriggerUnit()), 250, Condition(function EffectedUnits))
set udg_damage = damage
call ForGroup(g, function DamageUnits)
call GroupClear(g)
call DestroyEffect( AddSpecialEffect("Abilities\\Spells\\Human\\Thunderclap\\ThunderClapCaster.mdl", GetUnitX(GetTriggerUnit()), GetUnitY(GetTriggerUnit())))
call TriggerSleepAction( 1. )
set i = i + 1
endloop
call DestroyGroup(g)
set g = null
endif
endfunction
//===========================================================================
function InitTrig_Spell takes nothing returns nothing
local trigger t = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddAction( t, function Trig_Spell_Actions )
endfunction