Each map (instance, transport, continent) has its own cartesian coordinate system.
To place a new entity it is easiest to position yourself where it should be spawned and use the .gps
command.
This position information is expressed through the following fields per database table. Some fields may be omitted. (e.g. z and o are omitted for Quest PoI as they are shapes on a 2D map)
Field | Description | Comment |
---|---|---|
x | Vertical Axis |
S <= 0 <= N |
y | Horizontal Axis |
E <= 0 <= W |
z | Height | below x/y plane <= 0 <= above x/y plane |
o | Orientation |
0 <= o <= 2π |
m | Map ID the coordinates refer to | may be implied / optional |
Orientation is stored as radian, increasing counterclockwise around the z-axis.
Position | Radian | Decimal |
---|---|---|
North | 0 / 2π |
6.28319 |
West | 0.5π |
1.57080 |
South | π |
3.14159 |
East | 1.5π |
4.71239 |
World Position should not be confused with zone coordinates used by client addons or Aowow (0 – 100). Zone coordinates are calculated from WorldMapArea.dbc data and largely irrelevant from a server point of view.
WorldMapArea.dbc - describes the WorldPos boundaries of each area map viewed in-game.
WorldMapArea.dbc
+-----+-------+--------+------------------+---------+----------+----------+-----------+
| ID | MapID | AreaID | AreaName | LocLeft | LocRight | LocTop | LocBottom |
+-----+-------+--------+------------------+---------+----------+----------+-----------+
| 27 | 0 | 1 | DunMorogh | 1802.08 | -3122.92 | -3877.08 | -7160.42 |
+-----+-------+--------+------------------+---------+----------+----------+-----------+
world.creature
+------+------+-------------+-----+------------+------------+
| guid | id | name | map | position_x | position_y |
+------+------+-------------+-----+------------+------------+
| 206 | 1226 | Maxan Anvol | 0 | -5590.56 | -529.657 |
+------+------+-------------+-----+------------+------------+
areaX = ((position_y - left) / (right - left)) * 100
areaY = ((position_x - top) / (bottom - top)) * 100
areaX = 47.3 = ((-5590.56 - 1802.08) / (-3122.92 - 1802.08)) * 100
areaY = 52.2 = ((-529.657 + 3877.08) / (-7160.42 + 3877.08)) * 100