JS-ROOM
The Room object represents rooms.
Class Methods:
at( number ) Returns a reference to the room at the specified number.
Properties:
inRoom Returns a reference to itself. inRoomNumber The room number of this room. inZone Zone object that this room is in (see JS-ZONE). inWorld World object that this room is in (see JS-WORLD). vnum The room number of this room. db The database object for this room (see JS-DB) shortDesc The name of this room. longDesc The description of this room. sector The sector type of this room (see SECTOR-TYPES). controller Who is this room's controller? (see JS-CONTROLLER)
Methods:
isActive() Returns true if the room is active. isAura() Returns false isMobile() Returns false isObj() Returns false isRoom() Returns true isControlledByPC() Returns true if this room is under the control of a PC. like() See JS-LIKE. hasChars() Returns true if the room has mobiles or players in it. hasPlayers() Returns true if the room has players in it. cast() Casts a spell. See JS-ELEMENT-CAST. damage() Does damage. See JS-ELEMENT-DAMAGE. msg( string ) Sends a message to characters in this room. See JS-MSG for more information. amsg( string ) Sends a message to characters in this room. See JS-MSG for more information. hasFlag( f ) Returns true if the room has the specified room flag (see ROOM-FLAGS). This method supports cardinalities -- see JS-CARDINALITY. setFlag( f, v ) Sets the room flag "f" to the value "v" which should evaluate to true or false. dir( d ) Returns the room object that the exit in the specified direction leads to. getExitRoom( d ) Returns the room that the specified direction leads to. setExitRoom( d,r ) Sets the room that the specified direction leads to. Use a room number of -1 to remove an exit. You can also specify the optional 'reverse' option to set the reverse direction as well. hasExitFlag( d,f ) Returns true if the direction specified by 'd' has the specified flag 'f' (see EXITFLAGS). This method supports cardinalities -- see JS-CARDINALITY. Example: inRoom.hasExitFlag( 'n', 'any', 'locked', 'closed' ); setExitFlag(d,f,v) Sets the exit flag "f" for the direction 'd' to the value 'v' which should evaluate to true or false. Example: inRoom.setExitFlag( 'n', 'locked', true ); You can also optionally specify a fourth 'reverse' parameter which will cause the flag to be set in the reverse exit as well. inRoom.setExitFlag( 'n', 'locked', true, 'reverse' ); getExitDesc( d ) Sets the exit description for direction d. setExitDesc( d,s ) Sets the exit description for direction d to sn. waterLevel() Returns a number between 1 (100% water) and 0 (0% water) based upon how much water is in the room. hasChar( v ) Returns true if a mobile by the specified vnum is in the room. This method supports cardinalities -- see JS-CARDINALITY. hasObj( v ) Returns true if an object by the specified vnum is in the room. This method supports cardinalities -- see JS-CARDINALITY. findPath( t, d ) This method returns an array containing the directions to take to get from the current room to the target t (which can be a room, object, mobile, or room number). The optional argument d specifies the number of rooms to search. By default 100 rooms will be searched. This method will return null if the target cannot be reached. Try not to use this function too frequently as it involves a lot of searching. findChar( v ) Finds and returns a mobile by the specified vnum in the room. findObj( v ) Finds and returns an object by the specified vnum in the room. randomRoom() This returns a room at random. See JS-RANDOM-ROOM. randomChar() This returns a character in this room at random or null if the room is empty of characters. See JS-RANDOM-CHAR. randomObj() This returns an object in this room at random or null if the room has no objects. visitChars( f ) Applies the passed in function or array to all of the chars in this room. See JS-ROOM-VISIT for more information. visitPlayers( f ) Applies the passed in function or array to all of the players in this room. See JS-ROOM-VISIT for more information. visitObjs( f ) Applies the passed in function or array to all of the objects in this room. See JS-VISIT for more information. If the first argument is a vnum, then only objects with that vnum will be visited. toString() Returns the name of the room. valueOf() Returns the name of the room. hasAura( n ) Returns true if the room has this aura. This method supports cardinalities -- JS-CARDINALITY. addAura() See JS-ELEMENT. removeAura() See JS-ELEMENT. addAuraCat() See JS-ELEMENT. removeAuraCat() See JS-ELEMENT.