I was making a knockback spell... Its not complete yet. But, the problem is when i compile it, it shows syntax error.
I know this is not a perfect knock back but i can't test it due to the error.
JASS:
function Trig_Untitled_Trigger_003_Conditions takes nothing returns boolean
if (udg_pb == 1) then
return true
endif
return false
endfunction
function Trig_Untitled_Trigger_003_Actions takes nothing returns nothing
local real y1
local real x2 = GetUnitX(udg_unit)
local real y2 = GetUnitX(udg_unit)
local real d = 500
local real x1 = (Cos(udg_m * bj_DEGTORAD) * d)
set x2 = x2 + 1
set y2 = y2 + (udg_m*x1)
SetUnitX(udg_unit, x2)
SetUnitY(udg_unit, y2)
if (x2>=x1) then
set udg_pb = 0
endif
endfunction
//===========================================================================
function InitTrig_Untitled_Trigger_003 takes nothing returns nothing
set gg_trg_Untitled_Trigger_003 = CreateTrigger( )
call TriggerRegisterTimerEventPeriodic( gg_trg_Untitled_Trigger_003, 0.05 )
call TriggerAddCondition( gg_trg_Untitled_Trigger_003, Condition( function Trig_Untitled_Trigger_003_Conditions ) )
call TriggerAddAction( gg_trg_Untitled_Trigger_003, function Trig_Untitled_Trigger_003_Actions )
endfunction
I know this is not a perfect knock back but i can't test it due to the error.