WoW:API GetUnitSpeed

From AddOn Studio
Revision as of 22:50, 21 November 2008 by WoWWiki>Hillie
Jump to navigation Jump to search

This is a work in progress...

When the unit is not moving this returns 0
When the unit is on a moving object such as a boat that's moving this returns 0
When the unit is running at 100% (running on foot with no speed increase enhancements) this returns 7
When the unit is running at 175% (Death Knight home city) this returns 12.25
When the unit is running at 200% (Epic Mount) this returns 14

7 * 1.75 = 12.25 so apparently 7 = 100%, for example:

s = string.format("%d", (GetUnitSpeed("Player") / 7) * 100);

will put the speed in % into the variable s.