View Single Post
11-12-11, 01:39 PM   #4
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,325
If you have absolute coordinates, you don't need MapID. You're also using a bunch of unneeded trig functions.

PHP Code:
function getDistance($x1,$y1,$z1,$x2,$y2,$z2,$speed)
    return 
sqrt(pow($x1-$x2,2)+pow($y1-$y2,2)+pow($z1-$z2,2))/$speed;
end 
Note: $speed needs to be in the same units as the coordinates, this means since the absolute coordinates of a map are measured in yards, $speed needs to match it too. For 100% speed, this would be a value of 7.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)

Last edited by SDPhantom : 11-12-11 at 01:46 PM.
  Reply With Quote