new Area()
Properties:
Name | Type | Description |
---|---|---|
bundle |
string | Bundle this area comes from |
name |
string | |
title |
string | |
script |
string | A custom script for this item |
map |
Map | a Map object keyed by the floor z-index, each floor is an array with [x][y] indexes for coordinates. |
rooms |
Map.<string, Room> | Map of room id to Room |
npcs |
Set.<Npc> | Active NPCs that originate from this area. Note: this is NPCs that originate from this area. An NPC may not actually be in this area at any given moment. |
info |
Object | Area configuration |
lastRespawnTick |
Number | milliseconds since last respawn tick. See |
Extends
Members
-
areaPath
-
Get ranvier-root-relative path to this area
-
floors
-
Get an ordered list of floors in this area's map
Methods
-
addNpc(npc)
-
Parameters:
Name Type Description npc
Npc -
addRoom(room)
-
Parameters:
Name Type Description room
Room Fires:
-
addRoomToMap(room)
-
Parameters:
Name Type Description room
Room Throws:
Error
-
getBroadcastTargets() → {Array.<Broadcastable>}
-
Get all possible broadcast targets within an area. This includes all npcs, players, rooms, and the area itself
Returns:
Array.<Broadcastable> -
getRoomAtCoordinates(x, y, z) → {Room|boolean}
-
find a room at the given coordinates for this area
Parameters:
Name Type Description x
number y
number z
number -
getRoomById(id) → {Room|undefined}
-
Parameters:
Name Type Description id
string Room id
-
removeNpc(npc)
-
Removes an NPC from the area. NOTE: This must manually remove the NPC from its room as well
Parameters:
Name Type Description npc
Npc -
removeRoom(room)
-
Parameters:
Name Type Description room
Room Fires:
-
update(state)
-
This method is automatically called every N milliseconds where N is defined in the
setInterval
call toGameState.AreaMAnager.tickAll
in theranvier
executable. It, in turn, will fire theupdateTick
event on all its rooms and npcsParameters:
Name Type Description state
GameState Fires: