|
function Trig_Tu_Ci_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A06K' ) ) then
return false
endif
return true
endfunction
function tuci takes nothing returns nothing
local unit u = GetUnit(H2Tx(GetTriggeringTrigger()),"tc_u")
local real r = GetReal(H2Tx(GetTriggeringTrigger()),"tc_r")
local real r2
local location p = GetUnitLoc(u)
local location p2 = PolarProjectionBJ(p, 50.00, r)
local location p3
local integer i = GetInteger(H2Tx(GetTriggeringTrigger()),"tc_i")
local real r3
call EnumDestructablesInCircleBJ( 192.00, p2, function KillDestructableEnum )
call SetUnitPositionLoc( u, p2 )
set p3 = GetUnitLoc(u)
set i = i + 1
call SetInteger(H2Tx(GetTriggeringTrigger()),"tc_i",i)
set r3 = DistanceBetweenPoints(p3, p2)
call AddSpecialEffectTargetUnitBJ( "origin", u, "Abilities\\Weapons\\AncientProtectorMissile\\AncientProtectorMissile.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
if (GetBooleanOr(i>17,r3>8)) then
call FastFlush(H2Tx(GetTriggeringTrigger()))
call DestroyTriggerEx(GetTriggeringTrigger())
else
endif
call RemoveLocation (p)
call RemoveLocation (p2)
call RemoveLocation (p3)
set p = null
set p3 = null
set p2 = null
set u = null
endfunction
function Trig_Tu_Ci_Actions takes nothing returns nothing
local unit u = GetSpellTargetUnit()
local trigger t = CreateTrigger()
local unit u2 = GetTriggerUnit()
local location p = GetUnitLoc(u)
local location p2 = GetUnitLoc(u2)
local real r = AngleBetweenPoints(p2, p)
call SetUnit(H2Tx(t),"tc_u",u)
call SetReal(H2Tx(t),"tc_r",r)
call SetInteger(H2Tx(t),"tc_i",0)
call TriggerRegisterTimerEventPeriodic(t,0.04)
call TriggerAddAction(t,function tuci)
set t = null
call RemoveLocation(p)
call RemoveLocation(p2)
set p = null
set p2 = null
set u = null
set u2 = null
endfunction |
|