function Trig_Fast_Cut_Conditions takes nothing returns boolean
return Spell=='A0AX'
endfunction
function Trig_Fast_Cut_Actions3 takes nothing returns nothing
local timer t=GetExpiredTimer()
local integer i=GetHandleId(t)
set bj_lastCreatedUnit=GetRecycledUnit(Player(PLAYER_NEUTRAL_PASSIVE),'h013',LoadReal(udg_Wait,i,1)+600*Cos(LoadReal(udg_Wait,i,3)),LoadReal(udg_Wait,i,2)+600*Sin(LoadReal(udg_Wait,i,3)),LoadReal(udg_Wait,i,3))
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Culling Cleave Silver.mdx",bj_lastCreatedUnit,"origin"))
call RecycleUnitDelayed(bj_lastCreatedUnit,0.27)
call ReleaseTimer(t)
call FlushChildHashtable(udg_Wait,i)
set t=null
endfunction
function Trig_Fast_Cut_Actions2 takes nothing returns nothing
local timer t=GetExpiredTimer()
local integer i=GetHandleId(t)
set bj_lastCreatedUnit=GetRecycledUnit(Player(PLAYER_NEUTRAL_PASSIVE),'h013',LoadReal(udg_Wait,i,1)+300*Cos(LoadReal(udg_Wait,i,3)),LoadReal(udg_Wait,i,2)+300*Sin(LoadReal(udg_Wait,i,3)),LoadReal(udg_Wait,i,3))
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Culling Cleave Silver.mdx",bj_lastCreatedUnit,"origin"))
call RecycleUnitDelayed(bj_lastCreatedUnit,0.27)
call TimerStart(t,0.03,false,function Trig_Fast_Cut_Actions3)
set t=null
endfunction
function Trig_Fast_Cut_Actions takes nothing returns nothing
local unit u
local group g=CreateGroup()
local real damage
local real x=GetUnitX(Caster)
local real y=GetUnitY(Caster)
local real face=AngleBetweenCoords(x,y,GetSpellTargetX(),GetSpellTargetY())
local player p=GetOwningPlayer(Caster)
local timer t=NewTimer()
local integer i=GetHandleId(t)
if Spell=='A0AX' then
set damage=40+50*Level
set Level=Level+2
endif
call GroupEnumUnitsInRange(g,x-100*Cos(face),y-100*Sin(face),800,null)
loop
set u=FirstOfGroup(g)
exitwhen u==null
if RAbsBJ(AngleBetweenCoords(x,y,GetUnitX(u),GetUnitY(u))-face)<=bj_PI/5 and IsUnitEnemy(u,p) and not IsUnitType(u,UNIT_TYPE_STRUCTURE) and not IsUnitType(u,UNIT_TYPE_MAGIC_IMMUNE) and not IsUnitType(u,UNIT_TYPE_MECHANICAL) then
call UnitDamageTarget(Caster,u,damage,true,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_SONIC,WEAPON_TYPE_WHOKNOWS)
set bj_lastCreatedUnit=GetRecycledUnit(p,'n018',GetUnitX(u),GetUnitY(u),bj_UNIT_FACING)
call SetUnitAbilityLevel(bj_lastCreatedUnit,'A07L',Level)
call IssueTargetOrder(bj_lastCreatedUnit,"slow",u)
call RecycleUnitDelayed(bj_lastCreatedUnit,0.27)
endif
call GroupRemoveUnit(g,u)
endloop
call DestroyGroup(g)
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Culling Cleave Silver.mdx",Caster,"origin"))
call SaveReal(udg_Wait,i,1,x)
call SaveReal(udg_Wait,i,2,y)
call SaveReal(udg_Wait,i,3,face)
call TimerStart(t,0.03,false,function Trig_Fast_Cut_Actions2)
set g=null
set p=null
endfunction
//===========================================================================
function InitTrig_Fast_Cut takes nothing returns nothing
set gg_trg_Fast_Cut=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(gg_trg_Fast_Cut,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(gg_trg_Fast_Cut,Condition(function Trig_Fast_Cut_Conditions))
call TriggerAddAction(gg_trg_Fast_Cut,function Trig_Fast_Cut_Actions)
endfunction