It never gets past the bolded part, why?
Code:
function Trig_RAM_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A024' ) ) then
return false
endif
return true
endfunction
function Trig_RAM_Actions takes nothing returns nothing
local unit Caster = GetSpellAbilityUnit()
local location CasterPosition = GetUnitLoc(Caster)
local location TargetPoint = GetSpellTargetLoc()
local real Distance = DistanceBetweenPoints(CasterPosition, TargetPoint)
local real Angle = AngleBetweenPoints(CasterPosition, TargetPoint)
local real N = 0.00
local location MoveToPoint
local real MaxDamage
local timer t = CreateTimer()
call PauseUnit(Caster, true )
call SetUnitPathing( Caster, false )
loop
[B]call TimerStart(t, 0.03, false, null)
loop
exitwhen TimerGetRemaining(t) == 0
endloop[/B]
set N = (N + 20.00 )
set CasterPosition = GetUnitLoc(Caster)
set MoveToPoint = PolarProjectionBJ(CasterPosition, 20.00, Angle)
call SetUnitPositionLoc( Caster, MoveToPoint )
call DisplayTextToForce( GetPlayersAll(), R2S(N) + " " + R2S(Distance))
exitwhen N > Distance or IsUnitDeadBJ(Caster) == true
call TriggerSleepAction(0.01)
endloop
call RemoveLocation(MoveToPoint)
call RemoveLocation(CasterPosition)
call DestroyTimer(t)
if N > Distance or IsUnitDeadBJ(Caster) == true then
call PauseUnit(Caster, false )
call SetUnitPathing(Caster, true )
set Caster = null
call RemoveLocation(MoveToPoint)
set MaxDamage = 0.00
else
endif
endfunction
//===========================================================================
function InitTrig_RAM takes nothing returns nothing
set gg_trg_RAM = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_RAM, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_RAM, Condition( function Trig_RAM_Conditions ) )
call TriggerAddAction( gg_trg_RAM, function Trig_RAM_Actions )
endfunction