function Trig_FS_Attack_Conditions takes nothing returns boolean
return(GetSpellAbilityId()=='A004')
endfunction
function Trig_FS_Attack_Actions takes nothing returns nothing
local unit caster = GetTriggerUnit()
local real casterX = GetUnitX(caster)
local real casterY = GetUnitY(caster)
local unit starget = GetSpellTargetUnit()
local real stargetX = GetUnitX(starget)
local real stargetY = GetUnitY(starget)
local unit u
local real uX
local real uY
local real a = bj_RADTODEG * Atan2(stargetY - casterY, stargetX -casterX)
local real b = 60.00
local real c
local group g = CreateGroup()
local real facing = GetUnitFacing(caster)
local integer p = GetPlayerId(GetTriggerPlayer())
local unit dum
call GroupEnumUnitsInRange( g, casterX, casterY, 800.00,null)
set u = FirstOfGroup(g)
//Create Effect Starts
set dum = CreateUnit(Player(p),'h006',casterX,casterY,facing)
call UnitApplyTimedLife(dum,'BHwe',1.)
call IssueTargetOrderById(dum,852580,starget)
//Create Effect Ends
loop
exitwhen u == null
set u = FirstOfGroup(g)
set uX = GetUnitX(u)
set uY = GetUnitY(u)
set c = bj_RADTODEG * Atan2(uY - casterY, uX -casterX)
if CosBJ(( a- c )) > CosBJ(b) then
if IsUnitEnemy(u, Player(p)) and GetWidgetLife(u) > 0.405 then
call UnitDamageTarget(caster,u,8,true,false,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_DEMOLITION,null)
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Human\\Banish\\BanishTarget.mdl",u,"overhead"))
endif
endif
call GroupRemoveUnit(g,u)
endloop
set caster = null
set starget = null
set g = null
set dum = null
endfunction
function InitTrig_FS_Attack takes nothing returns nothing
set gg_trg_FS_Attack=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(gg_trg_FS_Attack,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(gg_trg_FS_Attack,Condition(function Trig_FS_Attack_Conditions))
call TriggerAddAction(gg_trg_FS_Attack,function Trig_FS_Attack_Actions)
endfunction