11# Room Specific Functions
22
33- [ Room Specific Functions] ( #room-specific-functions )
4+ - [ CreateEmptyRoomInstances(quantity int) \[\] int] ( #createemptyroominstancesquantity-int-int )
45 - [ CreateInstancesFromRoomIds(RoomIds \[ int, int...\] ) Object ] ( #createinstancesfromroomidsroomids-int-int-object- )
56 - [ CreateInstancesFromZone(zoneName string) Object ] ( #createinstancesfromzonezonename-string-object- )
67 - [ GetRoom(roomId int) RoomObject ] ( #getroomroomid-int-roomobject- )
78 - [ RoomObject.RoomId() int] ( #roomobjectroomid-int )
89 - [ RoomObject.SendText(msg string\[ , excludeUserIds int\] )] ( #roomobjectsendtextmsg-string-excludeuserids-int )
10+ - [ RoomObject.SendTextToExits(msg string, isQuiet bool\[ , excludeUserIds int\] )] ( #roomobjectsendtexttoexitsmsg-string-isquiet-bool-excludeuserids-int )
911 - [ RoomObject.SetTempData(key string, value any)] ( #roomobjectsettempdatakey-string-value-any )
1012 - [ RoomObject.GetTempData(key string) any] ( #roomobjectgettempdatakey-string-any )
1113 - [ RoomObject.SetPermData(key string, value any)] ( #roomobjectsetpermdatakey-string-value-any )
1214 - [ RoomObject.GetPermData(key string) any] ( #roomobjectgetpermdatakey-string-any )
1315 - [ RoomObject.GetItems() \[\] ItemObject] ( #roomobjectgetitems-itemobject )
1416 - [ RoomObject.DestroyItem(itm ScriptItem) ] ( #roomobjectdestroyitemitm-scriptitem- )
1517 - [ RoomObject.SpawnItem(itemId int, inStash bool) \[\] ItemObject] ( #roomobjectspawnitemitemid-int-instash-bool-itemobject )
16- - [ RoomObject.GetMob(mobId int) Actor] ( #roomobjectgetmobmobid-int-actor )
18+ - [ RoomObject.GetMob(mobId int \[ , createIfMissing bool \] ) Actor] ( #roomobjectgetmobmobid-int--createifmissing-bool -actor )
1719 - [ RoomObject.GetMobs(\[ mobId int\] ) \[\] Actor] ( #roomobjectgetmobsmobid-int-actor )
1820 - [ RoomObject.GetPlayers() \[\] Actor] ( #roomobjectgetplayers-actor )
1921 - [ RoomObject.GetAllActors() \[\] Actor] ( #roomobjectgetallactors-actor )
2325 - [ RoomObject.HasQuest(questId string \[ ,partyUserId int\] ) \[\] int] ( #roomobjecthasquestquestid-string-partyuserid-int-int )
2426 - [ RoomObject.MissingQuest(questId string \[ ,partyUserId int\] ) \[\] int] ( #roomobjectmissingquestquestid-string-partyuserid-int-int )
2527 - [ RoomObject.SpawnMob(mobId int) Actor] ( #roomobjectspawnmobmobid-int-actor )
26- - [ RoomObject.AddTemporaryExit(exitNameSimple string, exitNameFancy string, exitRoomId int, expiresTimeString string] ( #roomobjectaddtemporaryexitexitnamesimple-string-exitnamefancy-string-exitroomid-int-expirestimestring-string )
27- - [ RoomObject.RemoveTemporaryExit(exitNameSimple string, exitNameFancy string, exitRoomId int] ( #roomobjectremovetemporaryexitexitnamesimple-string-exitnamefancy-string-exitroomid-int )
28+ - [ RoomObject.AddTemporaryExit(exitNameSimple string, exitNameFancy string, exitRoomId int, expiresTimeString string) bool ] ( #roomobjectaddtemporaryexitexitnamesimple-string-exitnamefancy-string-exitroomid-int-expirestimestring-string-bool )
29+ - [ RoomObject.RemoveTemporaryExit(exitNameSimple string, exitNameFancy string, exitRoomId int) bool ] ( #roomobjectremovetemporaryexitexitnamesimple-string-exitnamefancy-string-exitroomid-int-bool )
2830 - [ RoomObject.HasMutator(mutName string) bool] ( #roomobjecthasmutatormutname-string-bool )
2931 - [ RoomObject.AddMutator(mutName string)] ( #roomobjectaddmutatormutname-string )
3032 - [ RoomObject.RemoveMutator(mutName string)] ( #roomobjectremovemutatormutname-string )
3133 - [ RoomObject.IsEphemeral() bool] ( #roomobjectisephemeral-bool )
3234 - [ RoomObject.RoomIdSource() int] ( #roomobjectroomidsource-int )
33- - [ RoomObject.RepeatSpawnItem(itemId int, roundInterval int \[ , containerName\] ] ( #roomobjectrepeatspawnitemitemid-int-roundinterval-int--containername )
35+ - [ RoomObject.RepeatSpawnItem(itemId int, roundInterval int \[ , containerName\] ) bool ] ( #roomobjectrepeatspawnitemitemid-int-roundinterval-int--containername-bool )
3436 - [ RoomObject.SetLocked(exitName string, lockIt bool)] ( #roomobjectsetlockedexitname-string-lockit-bool )
3537 - [ RoomObject.IsLocked(exitName string) bool] ( #roomobjectislockedexitname-string-bool )
3638
39+ ## [ CreateEmptyRoomInstances(quantity int) [ ] int] ( /internal/scripting/room_func.go )
40+ Creates a specified number of empty ephemeral room instances.
41+
42+ | Argument | Explanation |
43+ | --- | --- |
44+ | quantity | Number of empty rooms to create |
45+
3746## [ CreateInstancesFromRoomIds(RoomIds [ int, int...] ) Object ] ( /internal/scripting/room_func.go )
3847Returns an Object with key/value pairs of ` ProvidedRoomId ` =>` NewRoomId `
3948Creates ephemeral instances of the RoomId's provided.
@@ -66,6 +75,15 @@ Sends a message to everyone in the room.
6675| msg | the message to send |
6776| excludeUserIds | One or more comma separated userIds to exclude from receiving the message. |
6877
78+ ## [ RoomObject.SendTextToExits(msg string, isQuiet bool[ , excludeUserIds int] )] ( /internal/scripting/room_func.go )
79+ Sends a message to all rooms with an exit leading to this room.
80+
81+ | Argument | Explanation |
82+ | --- | --- |
83+ | msg | the message to send |
84+ | isQuiet | If true, only those with superior "hearing" will see it. |
85+ | excludeUserIds | One or more comma separated userIds to exclude from receiving the message. |
86+
6987## [ RoomObject.SetTempData(key string, value any)] ( /internal/scripting/room_func.go )
7088Sets temporary data for the room (Lasts until the room is unloaded from memory).
7189
@@ -112,7 +130,7 @@ _Note: See [/scripting/docs/FUNCTIONS_ITEMS.md](FUNCTIONS_ITEMS.md) for details
112130## [ RoomObject.DestroyItem(itm ScriptItem) ] ( /internal/scripting/room_func.go )
113131Destroy an item from the ground.
114132
115- ## [ RoomObject.SpawnItem(itemId int, inStash bool) [ ] ItemObject ] ( /internal/scripting/room_func.go )
133+ ## [ RoomObject.SpawnItem(itemId int, inStash bool)] ( /internal/scripting/room_func.go )
116134Spawns an item in the room.
117135
118136| Argument | Explanation |
@@ -121,12 +139,13 @@ Spawns an item in the room.
121139| inStash | If true, spawns stashed instead of visible. |
122140
123141
124- ## [ RoomObject.GetMob(mobId int) Actor] ( /internal/scripting/room_func.go )
142+ ## [ RoomObject.GetMob(mobId int [ , createIfMissing bool ] ) Actor] ( /internal/scripting/room_func.go )
125143Returns the first mob that matches the provided MobId type (Note: NOT MOB INSTANCE ID!)
126144
127145| Argument | Explanation |
128146| --- | --- |
129147| mobId | MobId to match. |
148+ | createIfMissing (optional) | If true, will spawn the mob if not found. |
130149
131150## [ RoomObject.GetMobs([ mobId int] ) [ ] Actor] ( /internal/scripting/room_func.go )
132151Returns an array of mob ` Actor ` s in the room.
@@ -186,7 +205,7 @@ _Note: This could be useful for situations where you want to allow a whole party
186205| partyUserId (optional) | Only check the specified user and their party |
187206
188207## [ RoomObject.MissingQuest(questId string [ ,partyUserId int] ) [ ] int] ( /internal/scripting/room_func.go )
189- Returns an array of userId's in the romo who DON'T have the questId. If partyyUserId is supplied, only checks the user and their party specified.
208+ Returns an array of userId's in the room who DON'T have the questId. If partyUserId is supplied, only checks the user and their party specified.
190209
191210_ Note: This could be useful for situations where you want to disallow a whole party access to an area even if only one of them is missing the quest._
192211
@@ -202,7 +221,7 @@ Creates a new instance of MobId,and returns the `Actor` of the mob.
202221| --- | --- |
203222| mobId | The ID if the mob type to spawn. NOT THE INSTANCE ID. |
204223
205- ## [ RoomObject.AddTemporaryExit(exitNameSimple string, exitNameFancy string, exitRoomId int, expiresTimeString string] ( /internal/scripting/room_func.go )
224+ ## [ RoomObject.AddTemporaryExit(exitNameSimple string, exitNameFancy string, exitRoomId int, expiresTimeString string) bool ] ( /internal/scripting/room_func.go )
206225Adds a temporary exit to the room for the specified amount of time.
207226
208227| Argument | Explanation |
@@ -212,7 +231,7 @@ Adds a temporary exit to the room for the specified amount of time.
212231| exitRoomId | The roomId the exit should lead to. |
213232| expiresTimeString | Time string (1 day, 1 real day, 4 hours, etc) before it vanishes. |
214233
215- ## [ RoomObject.RemoveTemporaryExit(exitNameSimple string, exitNameFancy string, exitRoomId int] ( /internal/scripting/room_func.go )
234+ ## [ RoomObject.RemoveTemporaryExit(exitNameSimple string, exitNameFancy string, exitRoomId int) bool ] ( /internal/scripting/room_func.go )
216235Removes a temporary exit
217236
218237_ Note: all 3 parameters much match an existing temporary exit for it to be removed._
@@ -243,7 +262,7 @@ _Note: If the mutator already exists this is ignored._
243262## [ RoomObject.RemoveMutator(mutName string)] ( /internal/scripting/room_func.go )
244263Removes a mutator from a room.
245264
246- _ Note: This only expires it. It may be a mutator that respawns, in which case this doens 't really completely remove it._
265+ _ Note: This only expires it. It may be a mutator that respawns, in which case this doesn 't really completely remove it._
247266
248267| Argument | Explanation |
249268| --- | --- |
@@ -252,20 +271,14 @@ _Note: This only expires it. It may be a mutator that respawns, in which case th
252271## [ RoomObject.IsEphemeral() bool] ( /internal/scripting/room_func.go )
253272Returns true if the room is an Ephemeral Copy of a room.
254273
255- _ Note: This only expires it. It may be a mutator that respawns, in which case this doens't really completely remove it._
256-
257- | Argument | Explanation |
258- | --- | --- |
259- | mutName | the MutatorId of the mutator. |
260-
261274## [ RoomObject.RoomIdSource() int] ( /internal/scripting/room_func.go )
262275Returns the source RoomId if this room is an ephemeral copy, otherwise just the normal RoomId
263276
264277
265- ## [ RoomObject.RepeatSpawnItem(itemId int, roundInterval int [ , containerName]] ( /internal/scripting/room_func.go )
266- Removes a temporary exit
278+ ## [ RoomObject.RepeatSpawnItem(itemId int, roundInterval int [ , containerName] ) bool ] ( /internal/scripting/room_func.go )
279+ Sets up automatic item respawning in the room.
267280
268- _ Note: all 3 parameters much match an existing temporary exit for it to be removed ._
281+ _ Note: The item will respawn after the specified interval when removed from the room ._
269282
270283| Argument | Explanation |
271284| --- | --- |
0 commit comments