LibMapData-1.0

API / library

r11

lib:ConvertFromWorldPoint(x, y)

API to convert from the world poistion in yars to the world map scale

Parameters

x
the world map x point in yards
y
in the world map yard point

Return value

x,y in world map frame scale


lib:ConvertToWorldPoint(mapfile, x, y)

API to convert an x,y (yards) in a given zone up to the world map

Parameters

mapfile
x
in yards
y
in yards

Return value

the x,y point in world map yards


lib:DecodeLoc(id, location)

API to decode a location num

Parameters

id
location
id

Return value

x,y,level


lib:Distance(mapfile, floor, srcX, srcY, dstX, dstY)

API to calc the distance between 2 locations within the same mapfile

Parameters

mapfile
or area_id
floor
to use
srcX
starting x
srcY
starting y
dstX
destination x
dstY
destination y

Return value

distance, xdelta, ydelta where distance is the total distance, xdelta is the delta of the x values and ydelta is the detla of y values all in yards


lib:DistanceAndDirection(mapfile, floor, targetX, targetY)

API to get distance and direction to a target in the same map

Parameters

mapfile
to use
floor
targetX
coords
targetY
coords

Return value

distance,angle where distance is yards and angle is radians


lib:DistanceWithinContinent(srcMap, srcFloor, srcX, srcY, dstMap, dstFloor, dstX, dstY)

API to calc the distance between 2 locations across map files

Parameters

srcMap
or area_id
srcFloor
to use
srcX
starting x
srcY
starting y
dstMap
destination map file
dstFloor
destination floor
dstX
destination x
dstY
destination y

Return value

distance, xdelta, ydelta where distance is the total distance, xdelta is the delta of the x values and ydelta is the detla of y values all in yards


lib:EncodeLoc(x, y, level)

API to encode a location in game

Parameters

x
y
level

Return value

encoded location number


lib:GetAllMapIDs(storage)

API to list all zones

Parameters

storage

Return value

a table of zones


lib:GetContinentFromMap(mapfile, the)

API to get the continent for a given map

Parameters

mapfile
the
map file or id to check

Return value

the in-game continent index


lib:GetDungeons(storage)

API to list dungeons

Parameters

storage

Return value

a table containing the dungeon area ids


lib:GetMapLowerRight(mapfile, floor)

API to get the lower right x,y of a given map

Parameters

mapfile
you wish to interrogate or area id from GetCurrentMapAreaID()
floor
optional floor you wish to examine

Return value

x,y or the lower right corner or 0,0 if no data exists. Will add a message to the DEFAULT_CHAT_FRAME

Usage

local x,y = lib:MapLowerRight(GetMapInfo(),GetCurrentMapDungeonLevel())


lib:GetMapUpperLeft(mapfile, floor)

API to get the upper left x,y of a given map

Parameters

mapfile
you wish to interrogate or area id from GetCurrentMapAreaID()
floor
optional floor you wish to examine

Return value

x,y or the upper left corner or 0,0 if no data exists. Will add a message to the DEFAULT_CHAT_FRAME

Usage

local x,y = lib:MapUpperLeft(GetMapInfo(),GetCurrentMapDungeonLevel())


lib:GetRaids(storage)

API to list raids

Parameters

storage

Return value

a table containing the raid area ids


lib:GetZonesForContinent(continent, storage, Continent)

API to list zones by continent

Parameters

continent
storage
Continent
index

Return value

a table containing the zone area ids


lib:IsContinentMap(mapfile)

API to determine is a map is a continent

Parameters

mapfile
or area id to check

Return value

true if a continent


lib:MapArea(mapfile, floor)

API to get the width,height of a given map

Parameters

mapfile
you wish to interrogate or area id from GetCurrentMapAreaID()
floor
optional floor you wish to examine

Return value

width,height in yards or 0,0 if no data exists. Will add a message to the DEFAULT_CHAT_FRAME

Usage

local w,h = lib:MapArea(GetMapInfo(),GetCurrentMapDungeonLevel())


lib:MapAreaId(mapfile)

API to get area id for a given map file

Parameters

mapfile
to check

Return value

area_id or 0 if the map doesnt exist

Usage

aid = lib:MapAreaId(GetMapInfo())


lib:MapFloors(mapfile)

API to get the number of floors of a given map

Parameters

mapfile
the mapfile you wish to check or area id from GetCurrentMapAreaID()

Return value

number of floors or 0 if no floors exist

Usage

floors = lib:MapFloors(GetMapInfo())


lib:MapLocalize(mapfile)

API to get localized name of a given map file

Parameters

mapfile
or area id to check, note area id is more accurate

Return value

the localized map name or nil

Usage

lname = lib:MapLocalized(GetMapInfo())


lib:PointToYards(mapfile, floor, x, y)

API to convert coords to yards

Parameters

mapfile
or area_id
floor
x
coord
y
coord

Return value

x,y as yards


lib:YardsToPoint(mapfile, floor, x, y)

API to convert from yards to a point

Parameters

mapfile
or area_id
floor
x
coord in yards
y
coord in yards

Return value

x,y as a fractional point


lib:ZoneChanged(force)

API to force a zone change check calling this method will fire a callback

Parameters

force

Return value

void


Table of contents

  1. 1 lib:ConvertFromWorldPoint(x, y)
    1. 1.1 Parameters
    2. 1.2 Return value
  2. 2 lib:ConvertToWorldPoint(mapfile, x, y)
    1. 2.1 Parameters
    2. 2.2 Return value
  3. 3 lib:DecodeLoc(id, location)
    1. 3.1 Parameters
    2. 3.2 Return value
  4. 4 lib:Distance(mapfile, floor, srcX, srcY, dstX, dstY)
    1. 4.1 Parameters
    2. 4.2 Return value
  5. 5 lib:DistanceAndDirection(mapfile, floor, targetX, targetY)
    1. 5.1 Parameters
    2. 5.2 Return value
  6. 6 lib:DistanceWithinContinent(srcMap, srcFloor, srcX, srcY, dstMap, dstFloor, dstX, dstY)
    1. 6.1 Parameters
    2. 6.2 Return value
  7. 7 lib:EncodeLoc(x, y, level)
    1. 7.1 Parameters
    2. 7.2 Return value
  8. 8 lib:GetAllMapIDs(storage)
    1. 8.1 Parameters
    2. 8.2 Return value
  9. 9 lib:GetContinentFromMap(mapfile, the)
    1. 9.1 Parameters
    2. 9.2 Return value
  10. 10 lib:GetDungeons(storage)
    1. 10.1 Parameters
    2. 10.2 Return value
  11. 11 lib:GetMapLowerRight(mapfile, floor)
    1. 11.1 Parameters
    2. 11.2 Return value
    3. 11.3 Usage
  12. 12 lib:GetMapUpperLeft(mapfile, floor)
    1. 12.1 Parameters
    2. 12.2 Return value
    3. 12.3 Usage
  13. 13 lib:GetRaids(storage)
    1. 13.1 Parameters
    2. 13.2 Return value
  14. 14 lib:GetZonesForContinent(continent, storage, Continent)
    1. 14.1 Parameters
    2. 14.2 Return value
  15. 15 lib:IsContinentMap(mapfile)
    1. 15.1 Parameters
    2. 15.2 Return value
  16. 16 lib:MapArea(mapfile, floor)
    1. 16.1 Parameters
    2. 16.2 Return value
    3. 16.3 Usage
  17. 17 lib:MapAreaId(mapfile)
    1. 17.1 Parameters
    2. 17.2 Return value
    3. 17.3 Usage
  18. 18 lib:MapFloors(mapfile)
    1. 18.1 Parameters
    2. 18.2 Return value
    3. 18.3 Usage
  19. 19 lib:MapLocalize(mapfile)
    1. 19.1 Parameters
    2. 19.2 Return value
    3. 19.3 Usage
  20. 20 lib:PointToYards(mapfile, floor, x, y)
    1. 20.1 Parameters
    2. 20.2 Return value
  21. 21 lib:YardsToPoint(mapfile, floor, x, y)
    1. 21.1 Parameters
    2. 21.2 Return value
  22. 22 lib:ZoneChanged(force)
    1. 22.1 Parameters
    2. 22.2 Return value

Facts

Date created
Oct 23, 2012