Rooms

From SphereWiki
Revision as of 03:40, 20 July 2013 by Ben (talk | contribs) (Properties and Functions)
Jump to: navigation, search

Within regions you can also define rooms, which are basically 'sub-regions' that exist inside the area which may represent buildings within a town or a boss room within a dungeon. Accessing rooms in scripts can be accomplished using the ROOM reference from a character, item or map point object, or the ROOM.room_id reference from the server object. The following table details the various properties of the room object in SphereServer:


Properties and Functions

Here is a list of all room properties and functions. If a function is marked as readable then it can return a value when used as <KEY>. Click on the name for more detailed information such as usage and examples. The properties from the room definition can also be accessed from the room object. If an attempt is made to execute (not read) a command that does not exist on the room, then the command will be called on all sectors that touch the room area.

Name Read/Write Description
ALLCLIENTS command W Executes command on all clients inside the room boundaries.
CLIENTS R Gets the total number of clients that are inside the sectors that touch the room.
EVENTS +/-regiontype_defname RW Gets a list of attached room events, or adds or removes a room event to or from the room.
ISEVENT.regiontype_defname R Returns 1 if the room has a specified room event attached.
MAP R Gets the map that the room exists on.
RECT R Gets the number of rectangles that this room is made from.
RECT.n R Gets the nth rectangle that this room is made from.
UID R Gets the room's unique ID in the world.