rock5 wrote:There are a few things that could affect your speed and therefore your jumping distance. The main one is if you're mounted. Maybe you could check if your mounted and change the jump distance.
Yeah well I though of adding:
Code: Select all
if( dist<=self.Speed and self.Jump == true ) then
instead
since Speed would be in Units/sec and jump time is aprox. 1sec Speed = dist
But I would have to include a speed update based on buff (mount,food,pot,etc) base speed is 50, then multiply by bonus so
Code: Select all
player.Speed = 50*(1+bonus/100) --bonus in %
a second option would be to determine the speed based on a calculation but that would be somewhat inacurate like in here:
Code: Select all
function speed()
local X=player.X
local Z=player.Z
local timed=os.time()
local speed
while true do
player:update()
printf("Speed: %f\n",distance(X,Z,player.X,player.Z)/(os.time()-timed))
speed = distance(X,Z,player.X,player.Z)/(os.time()-timed);
player:update()
X=player.X
Z=player.Z
timed=os.time()
yrest(1000)
end
end
But it this this most useful while not on a mount and probably in specific situations