Skip to content
View in the app

A better way to browse. Learn more.

WRobot

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[WOTLK] Get World Coordinates From Map Coords

Featured Replies

Hello guys,

i wanted to ask how i can get World Coords from Map Coords + Zone?
i just found the Lua Function: GetWorldLocFromMapPos but it was introduced with patch 5.0.4 or so, so does not work with 3.3.5a.

Do someone have any idea?

Thanks

 //https://www.ownedcore.com/forums/world-of-warcraft/world-of-warcraft-bots-programs/wow-memory-editing/382790-zones-coordinates-world-zone-coordinates.html
        //somehow (ObjectManager.Me.Position.Y - x1) / (x2 - x1) is the character's on-map X position (notice the Y)
        //reversing that formula, you can get playerX (world position) based on all y values, it's utterly confusing and makes no sense to me
        private Vector3 CalculateMapCoords(string luaUnit)
        {
            float mapX = Lua.LuaDoString<float>($@"
                local x, y = GetPlayerMapPosition('{luaUnit}');
                return x;
            ");
            float mapY = Lua.LuaDoString<float>(@"
                local x, y = GetPlayerMapPosition('{luaUnit}');
                return y;
            ");

            return CalculateFromMapPosition(mapX, mapY);
        }

        private Vector3 CalculateFromMapPosition(float mapX, float mapY)
        {
            var x1 = 2041.67f;
            var x2 = 895.833f;
            var y1 = 1627.08f;
            var y2 = 862.5f;

            var playerX = -mapY * y1 + mapY * y2 + y1;
            var playerY = -mapX * x1 + mapX * x2 + x1;
            
            return new Vector3(playerX, playerY, PathFinder.GetZPosition(new Vector3(playerX, playerY, 100)));
        }

Coordinates in there are hardcoded for warsong gulch. It's up to you to adjust this 

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.