Quote:
Originally Posted by stickray
Well when iam in FatalStrike and i Melee Attack a Target, TQ Shifts me to a position, well ShiftTarget doesnt deal with that problem right? Cause it doesnt make a difference if i use ShiftTarget or not, the returned X.Y coords are not legit.
When iam not in FatalStrike and i Jump around and Attack my LastServerX.Y C.XY stats are always matching.
|
Not tested but this calculation should work for fatal strike movement coords.
Code:
public static Coord ThisIsFsISwearz(Client C, Mob M)
{
Coord To = Handler.MakeCoord(M.X, M.Y);
if (Math.Abs(M.X - C.X) > 0)
To.X--;
else if (Math.Abs(M.X - C.X) < 0)
To.X++;
if (Math.Abs(M.Y - C.Y) > 0)
To.Y--;
else if (Math.Abs(M.Y - C.Y) < 0)
To.Y++;
return To;
}
What I'm attempting for my super basic test bot (yes, I got bored and was messing with proxy coding again)
This was for melee... so it won't apply to you for fatal strike... just an idea of how to do it.
First try moving towards mob... if that doesn't work (is out of range or invalid coord) try moving infront of monster... if that doesn't work (is out of range or invaldi coord) simply move ontop of monster.
I'd then run a sanity check to confirm the location you are moving to is within range and then attack.
Code:
Coord To = Calculations.ThisIsFsISwearz(C, M);
if (!Program.DmapHandler.Maps[C.StaticMap].Check(To.X, To.Y) || Distance(C.X, C.Y, To.X, To.Y) > 2)
To = Calculations.ShiftTarget(M);
if (!Program.DmapHandler.Maps[C.StaticMap].Check(To.X, To.Y) || Distance(C.X, C.Y, To.X, To.Y) > 2)
To = MakeCoord(M.X, M.Y);