API/library

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, mapLevel)

API to encode a location in game

Parameters

x
y
level
mapLevel

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



Comments

Posts Quoted:
Reply
Clear All Quotes