description: [Basic] Active the skill from a far distance casuing the unit to run *2 faster toward the targeted unit, when reached 200 meters the unit teleports 100 meter (let say..) back facing the enemy at the other side causing damage to the unit.
ok, so i've started with Firebolt (I don't know why :S) and made it complitly empty skill, and made everything with jass.
// = are checking points for me..
call SetUnitPositionLoc( ??? ) - i have no idea how to get the unit to the exact coordinates i want (100 meter back facing after the enemy).
Main problem: the function DistanceBetweenPoints(Loc A, Loc B) is not working right!
Test i did: The unit runs to the target after activating, it reaches to the enemy, and distance is like 500 or 400! how can that be? and if theres another way to do that using different function.
Thank you in advance.
Edit:
Ok i got the DistanceBetweenPoints(Loc A, Loc B) problem i had, i clearly thought 200 meters has to be alot in the game when 200 meters is almost next to the opponent.
So the only problem is: how can i tell the unit teleport 100 meter back facing after the enemy?!
ok, so i've started with Firebolt (I don't know why :S) and made it complitly empty skill, and made everything with jass.
JASS:
function Trig_Assaulter_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local unit tu = GetSpellTargetUnit()
local real dist = DistanceBetweenPoints(GetUnitLoc(tu), GetUnitLoc(u))
local real uspeed = GetUnitDefaultMoveSpeed(u)
local effect ef1 = AddSpecialEffectLocBJ( GetUnitLoc(u),"Abilities\\Spells\\Human\\Thunderclap\\ThunderClapCaster.mdl" )
call IssueTargetOrder( u, "move", tu )
call SetUnitMoveSpeed( u, uspeed*2.0)
//call DisplayTextToForce( GetPlayersAll(), "Unit move speed equal to: " + R2S(uspeed*2.0) )
loop
exitwhen dist <= 200.0
//call DisplayTextToForce( GetPlayersAll(), "In loop." )
set dist = DistanceBetweenPoints(GetUnitLoc(tu), GetUnitLoc(u))
call TriggerSleepAction( 1 )
// call DisplayTextToForce( GetPlayersAll(), "Dist equal - " + R2S(dist) )
endloop
call SetUnitMoveSpeed( u, uspeed)
//call DisplayTextToForce( GetPlayersAll(), "out of loop." )
call SetUnitPositionLoc( ??? )
set ef1 = AddSpecialEffectTargetUnitBJ( "origin",tu, "Objects\\Spawnmodels\\Human\\HumanBlood\\HumanBloodFootman.mdl" )
call DestroyEffectBJ( ef1 )
endfunction
// = are checking points for me..
call SetUnitPositionLoc( ??? ) - i have no idea how to get the unit to the exact coordinates i want (100 meter back facing after the enemy).
Main problem: the function DistanceBetweenPoints(Loc A, Loc B) is not working right!
Test i did: The unit runs to the target after activating, it reaches to the enemy, and distance is like 500 or 400! how can that be? and if theres another way to do that using different function.
Thank you in advance.
Edit:
Ok i got the DistanceBetweenPoints(Loc A, Loc B) problem i had, i clearly thought 200 meters has to be alot in the game when 200 meters is almost next to the opponent.
So the only problem is: how can i tell the unit teleport 100 meter back facing after the enemy?!