### Command Trigger Example Source: https://www.tbamud.com/Oasis_DG_pages/contents/wld_trig_ex This example illustrates a command trigger that sends a message when a player types 'hop'. Note that this functionality may not work for administrators. It's intended for room assignments. ```OasisOLC Script Trigger Intended Assignment: Rooms Trigger Type: Command , Numeric Arg: 100, Arg list: hop Commands: %echo% The trigger fires now! ``` -------------------------------- ### Global Trigger Example Source: https://www.tbamud.com/Oasis_DG_pages/contents/wld_trig_ex This example demonstrates a global trigger that sends a message to the room every 13 seconds, irrespective of player presence. It is intended for room assignments and uses a numeric argument. ```OasisOLC Script Trigger Intended Assignment: Rooms Trigger Type: Global Random , Numeric Arg: 100, Arg list: Commands: %echo% The trigger fires now! ``` -------------------------------- ### Get Trigger Example in OasisOLC Source: https://www.tbamud.com/Oasis_DG_pages/contents/obj_trig_ex This example demonstrates a 'Get' trigger that fires if someone attempts to pick up the object. It prevents players below immortal level (51) from picking up the item. ```OasisOLC Trigger Intended Assignment: Objects Trigger Type: Get , Numeric Arg: 100, Arg list: Commands: if (%actor.level% < 51) return 0 end ``` -------------------------------- ### Load Trigger Example in OasisOLC Source: https://www.tbamud.com/Oasis_DG_pages/contents/obj_trig_ex This example shows a 'Load' trigger that sends a message to the room when the object is created. It uses the '%self.name%' variable to display the object's name. ```OasisOLC Trigger Intended Assignment: Objects Trigger Type: Load , Numeric Arg: 100, Arg list: Commands: %echo% %self.name% appears out of nothing - *SpRoInG* ``` -------------------------------- ### Enter Trigger Example Source: https://www.tbamud.com/Oasis_DG_pages/contents/wld_trig_ex This example demonstrates an 'Enter' trigger that prevents players above level 10 from entering a room. If the actor's level is greater than 10, a message is displayed, and the entry is blocked by returning 0. It's intended for room assignments. ```OasisOLC Script Trigger Intended Assignment: Rooms Trigger Type: Enter , Numeric Arg: 100, Arg list: Commands: if (%actor.level% > 10) %send% %actor% You're too old to enter here. return 0 end ``` -------------------------------- ### Global Trigger Example in OasisOLC Source: https://www.tbamud.com/Oasis_DG_pages/contents/obj_trig_ex This example demonstrates a global trigger that sends a message to the room every 13 seconds, irrespective of player presence. It's intended for objects and uses a numeric argument of 100. ```OasisOLC Trigger Intended Assignment: Objects Trigger Type: Global Random , Numeric Arg: 100, Arg list: Commands: %echo% The trigger fires now! ``` -------------------------------- ### Wear Trigger Example in OasisOLC Source: https://www.tbamud.com/Oasis_DG_pages/contents/obj_trig_ex This example shows a 'Wear' trigger that makes the item unwearable by players with low strength (below 17). ```OasisOLC Trigger Intended Assignment: Objects Trigger Type: Wear , Numeric Arg: 100, Arg list: Commands: if (%actor.str% < 17) return 0 end ``` -------------------------------- ### Speech Trigger Example Source: https://www.tbamud.com/Oasis_DG_pages/contents/wld_trig_ex This example demonstrates a speech trigger that activates when the exact phrase 'test ing hop jump' is spoken. The numeric argument controls the sensitivity; a value of 1 would trigger on individual words or partial phrases. It's intended for room assignments. ```OasisOLC Script Trigger Intended Assignment: Rooms Trigger Type: Speech , Numeric Arg: 0, Arg list: test ing hop jump Commands: %echo% The trigger fires now! ``` -------------------------------- ### Greet Trigger Example Source: https://www.tbamud.com/Oasis_DG_pages/contents/mob_trig_ex This trigger greets a person entering the room, provided the mobile can see them. It uses the %actor.name% variable for personalization. Intended for Mobiles. ```OasisOLC Script Trigger Intended Assignment: Mobiles Trigger Type: Greet , Numeric Arg: 100, Arg list: Commands: say Hello, and welcome, %actor.name% ``` -------------------------------- ### Hitprcnt Trigger Example Source: https://www.tbamud.com/Oasis_DG_pages/contents/mob_trig_ex Illustrates the HitPrcnt trigger, used for mobs to call for help when their hitpoints drop below a certain percentage. This example makes a mob call for help when below 80% hitpoints and prevents repeated shouting using a flag. ```dgscript Trigger Intended Assignment: Mobiles Trigger Type: HitPrcnt , Numeric Arg: 80, Arg list: Commands: context %self.id% if (%have_shouted%) return 0 halt else %echo% %self.name% shouts 'HELP! I'm under ATTACK! HELP!' set have_shouted 1 global have_shouted end ``` -------------------------------- ### Drop Trigger Example in OasisOLC Source: https://www.tbamud.com/Oasis_DG_pages/contents/obj_trig_ex This example shows a 'Drop' trigger that fires if someone attempts to drop the object. It prevents players below immortal level (51) from dropping the item. ```OasisOLC Trigger Intended Assignment: Objects Trigger Type: Drop , Numeric Arg: 100, Arg list: Commands: if (%actor.level% < 51) return 0 end ``` -------------------------------- ### Give Trigger Example in OasisOLC Source: https://www.tbamud.com/Oasis_DG_pages/contents/obj_trig_ex This example demonstrates a 'Give' trigger that blocks any attempt by a mortal player to give the item away. It prevents players below immortal level (51) from giving the item. ```OasisOLC Trigger Intended Assignment: Objects Trigger Type: Give , Numeric Arg: 100, Arg list: Commands: if (%actor.level% < 51) return 0 end ``` -------------------------------- ### Random Trigger Example Source: https://www.tbamud.com/Oasis_DG_pages/contents/wld_trig_ex This example shows a random trigger that sends a message to the room every 13 seconds, but only when a player is present. It's designed for room assignments and uses a numeric argument. ```OasisOLC Script Trigger Intended Assignment: Rooms Trigger Type: Random , Numeric Arg: 100, Arg list: Commands: %echo% The trigger fires now! ``` -------------------------------- ### Greet-All Trigger Example Source: https://www.tbamud.com/Oasis_DG_pages/contents/mob_trig_ex Similar to the Greet trigger, but activates even if the mobile cannot see the entering character. It personalizes the greeting using %actor.name%. Intended for Mobiles. ```OasisOLC Script Trigger Intended Assignment: Mobiles Trigger Type: Greet-All , Numeric Arg: 100, Arg list: Commands: say Hello, and welcome, %actor.name% ``` -------------------------------- ### Fight Trigger Example Source: https://www.tbamud.com/Oasis_DG_pages/contents/mob_trig_ex Demonstrates the Fight trigger, which activates on mob hits. It can be used to make a mob say something or cast spells. The example shows a mob saying 'trigger hit!' and another casting 'magic missile' every second round. ```dgscript Trigger Intended Assignment: Mobiles Trigger Type: Fight , Numeric Arg: 100, Arg list: Commands: say trigger hit! Trigger Intended Assignment: Mobiles Trigger Type: Fight , Numeric Arg: 100, Arg list: Commands: context %self.id% if (%already_fighting%) wait 10 unset already_fighting else dg_cast 'magic missile' %actor.name% set already_fighting 1 global already_fighting end ``` -------------------------------- ### Entry Trigger Example Source: https://www.tbamud.com/Oasis_DG_pages/contents/mob_trig_ex This trigger activates when a mobile enters a new room. It includes conditional logic to execute a message only if the mobile enters room 3021 (a pub). It uses %self.room% and %inroom.vnum% variables. ```OasisOLC Script Trigger Intended Assignment: Mobiles Trigger Type: Entry , Numeric Arg: 100, Arg list: Commands: * first find the room the mob is in and put the value in %inroom% eval inroom %self.room% * then check on the rooms vnum if (%inroom.vnum% == 3021) %echo% 'Give me beer! NOW!', %self.name% shouts, as he enters the pub. end ``` -------------------------------- ### Bribe Trigger Example Source: https://www.tbamud.com/Oasis_DG_pages/contents/mob_trig_ex Shows a Bribe trigger that allows a player to pay a specified amount to be teleported. If the amount is not met, it functions as a normal 'give' command. The example uses a bribe of 2000 to teleport the player. ```dgscript Trigger Intended Assignment: Mobiles Trigger Type: Bribe, Numeric Arg: 2000, Arg list: Commands: say thank you, step inside. wait 2 %echoaround% %actor% %self.name% pushes %actor.name% through a concealed door. %send% %actor% %self.name% helps you through a concealed door. %teleport% %actor% 3001 ``` -------------------------------- ### Global Load Trigger Example Source: https://www.tbamud.com/Oasis_DG_pages/contents/mob_trig_ex Demonstrates the Global Load trigger, used with a global trigger to make mobs load specific objects. This example loads object number 4037 (a hammer) and wields it, allowing for varied mob equipment. ```dgscript Trigger Intended Assignment: Mobiles Trigger Type: Global Load , Numeric Arg: 50, Arg list: Commands: mload obj 4037 wield hammer ``` -------------------------------- ### Memory and Greet Trigger Examples Source: https://www.tbamud.com/Oasis_DG_pages/contents/mob_trig_ex Illustrates the Memory and Greet triggers. The Greet trigger uses 'mremember' to record actors, while the Memory trigger uses 'mforget' to remove them. This allows mobs to remember and forget characters they encounter. ```dgscript Trigger Intended Assignment: Mobiles Trigger Type: Greet , Numeric Arg: 100, Arg list: Commands: mremember %actor.name% say I'll remember you now, %actor.name% Trigger Intended Assignment: Mobiles Trigger Type: Memory , Numeric Arg: 100, Arg list: Commands: wait 4 s poke %actor.name% say i've seen you before, %actor.name%. mforget %actor.name% ``` -------------------------------- ### Command Trigger Example Source: https://www.tbamud.com/Oasis_DG_pages/contents/mob_trig_ex This trigger fires when a player types 'hop' in the room. Note that this functionality may not work for administrators. It's intended for Mobiles with 'hop' as the argument list. ```OasisOLC Script Trigger Intended Assignment: Mobiles Trigger Type: Command , Numeric Arg: 100, Arg list: hop Commands: %echo% The trigger fires now! ``` -------------------------------- ### Random Trigger Example in OasisOLC Source: https://www.tbamud.com/Oasis_DG_pages/contents/obj_trig_ex This example shows a random trigger that sends a message to the room every 13 seconds, but only when a player is present. It's intended for objects and uses a numeric argument of 100. ```OasisOLC Trigger Intended Assignment: Objects Trigger Type: Random , Numeric Arg: 100, Arg list: Commands: %echo% The trigger fires now! ``` -------------------------------- ### Switch Statement Example Source: https://www.tbamud.com/Oasis_DG_pages/contents/script_commands The switch statement evaluates an expression and executes commands associated with the first matching case. If no case matches, the default case is used. The block is terminated by 'done'. ```MUD Script switch (expression) case 1 // commands break case 2 emote booms out loudly, 'Heigh Ho! Heigh Ho! It\'s home from work we go!' break case 3 emote tries to sing falsetto, but his voice doesn\'t agree. break default sing break done ``` -------------------------------- ### Command Trigger Example in OasisOLC Source: https://www.tbamud.com/Oasis_DG_pages/contents/obj_trig_ex This example demonstrates a command trigger that sends a message when a player uses the 'laugh' command in the room where the object is located. It works for objects on the floor or being worn, with a numeric argument of 5. Note: This does not work for gods. ```OasisOLC Trigger Intended Assignment: Objects Trigger Type: Command , Numeric Arg: 5, Arg list: laugh Commands: %echo% The trigger fires now! ``` -------------------------------- ### Timer Trigger Example in OasisOLC Source: https://www.tbamud.com/Oasis_DG_pages/contents/obj_trig_ex This example shows a timer trigger that fires when the attached object's timer runs out. It sends a message and resets the timer. The numeric argument is 100, and the timer is set to 3 seconds. ```OasisOLC Trigger Intended Assignment: Objects Trigger Type: Timer , Numeric Arg: 100, Arg list: Commands: %echo% The trigger fires now! otimer 3 ``` -------------------------------- ### Switch-Case Statement Example Source: https://www.tbamud.com/Oasis_DG_pages/contents/script_commands The 'switch' statement provides a way to execute different code blocks based on the value of an expression. It is used with 'case' statements to define specific conditions. ```oasis-dg Usage: switch expression ``` ```oasis-dg eval line %random.4% switch %line% case 1 emote sings a merry song about someone named Fulbert and Beatrice. ``` -------------------------------- ### Drop Trigger Example Source: https://www.tbamud.com/Oasis_DG_pages/contents/wld_trig_ex This example shows a 'Drop' trigger that prevents players from dropping items of type 'TRASH'. If the dropped object's type matches 'TRASH', a 'No Littering!' message is displayed, and the drop action is cancelled by returning 0. It's intended for room assignments. ```OasisOLC Script Trigger Intended Assignment: Rooms Trigger Type: Drop , Numeric Arg: 100, Arg list: Commands: if (%object.type% == TRASH) %echo% No Littering! return 0 end ``` -------------------------------- ### Zone Reset Trigger Example Source: https://www.tbamud.com/Oasis_DG_pages/contents/wld_trig_ex This example shows a zone reset trigger that removes a north-facing door from room 4067 every time the zone resets. It also displays a message indicating the action. It's intended for room assignments. ```OasisOLC Script Trigger Intended Assignment: Rooms Trigger Type: Zone reset , Numeric Arg: 100, Arg list: Commands: wdoor 4067 north purge 0 wecho As if by magic all the tapestries rise to their previous positions. ``` -------------------------------- ### Teleport Actor and Force Look Script Source: https://www.tbamud.com/Oasis_DG_pages/contents/wld_com_ex This script teleports the actor to a specified location (3001) and then forces them to 'look' to see the description of the new room. It includes a brief atmospheric message before the teleportation. The script is triggered on room entry. ```Tbamud Script Trigger Intended Assignment: Rooms Trigger Type: Enter , Numeric Arg: 100, Arg list: None Commands: wait 1 s %echo% A powerful force drags you down. %teleport% %actor% 3001 %force% %actor% look ``` -------------------------------- ### Item Drop Reward/Punishment (MUD Script) Source: https://www.tbamud.com/Oasis_DG_pages/contents/wld_com_ex This 'drop' trigger assigns rewards or punishments based on the cost of the dropped item. It calculates a 'worth' value and uses a switch statement to cast different spells or purge the item accordingly. ```MUD Script %send% %actor% As you drop the %object.shortdesc%, a loud humming starts to come from the walls. wait 1 eval worth %object.cost% / 100 switch %worth% case 0 %send% %actor% Your offering was NOT sufficient. dg_cast 'magic missile' %actor% break case 1 %send% %actor% Your offering was just sufficient. dg_cast 'cure light' %actor% dg_cast 'clot minor' %actor% %purge% %object% break case 2 %send% %actor% Your offering was sufficient. dg_cast 'refresh' %actor% %purge% %object% break default %send% %actor% Your offering was as it must be. dg_cast 'invisibility' %actor% %purge% %object% break done ``` -------------------------------- ### Randomly Purge Players in Zone (MUD Script) Source: https://www.tbamud.com/Oasis_DG_pages/contents/wld_com_ex This script randomly purges players within a zone, executing only 5% of the time when players are present. It iterates through players, checking if their vnum is not -1 and a random chance condition is met before purging them. ```MUD Script eval target %self.people% while %target% eval tmp_target %target.next_in_room% if %target.vnum% != -1 && %random.2% != 1 %echo% The gods destroy %target.name% purge %target% end eval target %tmp_target% done ``` -------------------------------- ### Script Editor Trigger List Example Source: https://www.tbamud.com/Oasis_DG_pages/contents/script_menu Illustrates how triggers are listed within the script editor, including their numerical ID and a descriptive name. It also explains trigger priority and handling of mismatched types. ```plaintext Script Editor Trigger List: 1) [1201] No recall ``` -------------------------------- ### Speech Trigger Example Source: https://www.tbamud.com/Oasis_DG_pages/contents/mob_trig_ex This trigger fires when the exact sentence 'test ing hop jump' is spoken in the room. A numeric argument of 1 would trigger on partial matches. Intended for Mobiles. ```OasisOLC Script Trigger Intended Assignment: Mobiles Trigger Type: Speech , Numeric Arg: 100, Arg list: test ing hop jump Commands: %echo% The trigger fires now! ``` -------------------------------- ### Ambient Zone Sound Effect (MUD Script) Source: https://www.tbamud.com/Oasis_DG_pages/contents/wld_com_ex This random trigger plays an ambient sound effect within the zone every 20 seconds, as long as players are present. It uses '%asound%' to broadcast a chilling howl message. ```MUD Script %asound% You hear a blood chilling howl from near by" wait 20 s ``` -------------------------------- ### Purge Mobs in Room Script Source: https://www.tbamud.com/Oasis_DG_pages/contents/wld_com_ex This script checks for the presence of mobs in a room and, if any are found, gives each a 50% chance of being destroyed. The specific command used for this action is '%purge%'. This script is intended for room triggers. ```Tbamud Script Trigger Intended Assignment: Rooms Trigger Type: Enter , Numeric Arg: 100, Arg list: None Commands: %purge% ``` -------------------------------- ### Action Trigger Example Source: https://www.tbamud.com/Oasis_DG_pages/contents/mob_trig_ex This trigger fires when the 'vis' command is used, making a character visible in the room. It allows access to variables like %actor.name% and can utilize the act() function for various screen outputs. Intended for Mobiles. ```OasisOLC Script Trigger Intended Assignment: Mobiles Trigger Type: Act , Numeric Arg: 0, Arg list: slowly fades into existence. Commands: %echo% The trigger fires now! %echo% triggered by %actor.name% ``` -------------------------------- ### Random Trigger Example Source: https://www.tbamud.com/Oasis_DG_pages/contents/mob_trig_ex This trigger fires every 13 seconds when a player is present in the room. It's intended for Mobiles and uses a Random type with a numeric argument of 100. ```OasisOLC Script Trigger Intended Assignment: Mobiles Trigger Type: Random , Numeric Arg: 100, Arg list: None Commands: %echo% The trigger fires now! ``` -------------------------------- ### Death Trigger Example Source: https://www.tbamud.com/Oasis_DG_pages/contents/mob_trig_ex This script allows a mobile to move slightly before its final breath. It's triggered upon the mobile's death and uses variables like %self.name% and %actor.name%. ```OasisOLC Script Trigger Intended Assignment: Mobiles Trigger Type: Death , Numeric Arg: 100, Arg list: Commands: %echo% %self.name% curses %actor.name% before drawing the final breath. ``` -------------------------------- ### Global Random Trigger Example Source: https://www.tbamud.com/Oasis_DG_pages/contents/mob_trig_ex This trigger fires every 13 seconds regardless of player presence in the room. It's intended for Mobiles and uses a Global Random type with a numeric argument of 100. ```OasisOLC Script Trigger Intended Assignment: Mobiles Trigger Type: Global Random , Numeric Arg: 100, Arg list: None Commands: %echo% The trigger fires now! ``` -------------------------------- ### Extract Command Usage and Example Source: https://www.tbamud.com/Oasis_DG_pages/contents/script_commands The 'extract' command places a specific word from a source text into a variable. It takes the destination variable name, the word number to extract, and the source text as arguments. The destination variable name should not be enclosed in '%' signs. ```oasis-dg Usage: extract to-variable word-number from-text ``` ```oasis-dg extract testvar1 1 %speech% extract testvar2 2 %speech% extract testvar3 3 %speech% extract testvar4 4 %speech% say do you mean %testvar4% %testvar3% %testvar2% %testvar1% ? ``` -------------------------------- ### Leave Trigger Example Source: https://www.tbamud.com/Oasis_DG_pages/contents/mob_trig_ex Details the Leave trigger, which activates when a player attempts to leave a specific room (guards room). It prevents players below level 10 from leaving, blocking actions like summon, portal, recall, or killing the mob. ```dgscript Trigger Intended Assignment: Mobiles Trigger Type: Leave , Numeric Arg: 100, Arg list: Commands: if (%actor.level% > 10) say You may not leave here, %actor.name%. %send% %actor% %self.name% prevents you from leaving the room. %echoaround% %actor% As %actor.name% tries to leave the room, %self.name% stops %actor.himher%. return 0 end ``` -------------------------------- ### Remove Trigger Example in OasisOLC Source: https://www.tbamud.com/Oasis_DG_pages/contents/obj_trig_ex This example demonstrates a 'Remove' trigger that acts as a curse when the item is worn. The numeric argument of 99 allows for a slight chance of escape. ```OasisOLC Trigger Intended Assignment: Objects Trigger Type: Drop , Numeric Arg: 99, Arg list: Commands: return 0 ``` -------------------------------- ### Object Command: %asound% Source: https://www.tbamud.com/Oasis_DG_pages/contents/object_commands Sends a message to all surrounding rooms, effectively broadcasting sound to adjacent areas. ```OasisOLC Script %asound% message ``` -------------------------------- ### Teleport if Tome Not Held (MUD Script) Source: https://www.tbamud.com/Oasis_DG_pages/contents/wld_com_ex This 'enter' trigger teleports the actor to room 9101 if they are not holding an item with vnum 9112 (the 'tome'). It checks the actor's held item, provides feedback messages, and uses 'halt' to prevent teleportation if the tome is present. ```MUD Script %send% %actor% As you fly over the chasm you feel a tingling sensation throughout your body. wait 1 eval tome %actor.eq(hold)% if %tome.vnum% == 9112 %send% %actor% Your %tome.shortdesc% vibrates and grows warm to the touch. %send% %actor% A very strong gust of wind blows, but you are unaffected. halt end %send% %actor% A huge gust of wind blows and you are swept away like a feather! %teleport% %actor% 9101 %force% %actor% look ``` -------------------------------- ### Describe Teleportation Scene Script Source: https://www.tbamud.com/Oasis_DG_pages/contents/wld_com_ex This script creates a dramatic scene involving darkness engulfing an actor, followed by their teleportation and subsequent recovery. It uses '%echo%' for descriptive text and '%echoaround%' to show the actor's perspective, culminating in a '%teleport%' command. The script is triggered on room entry. ```Tbamud Script Trigger Intended Assignment: Rooms Trigger Type: Enter , Numeric Arg: 100, Arg list: None Commands: wait 4 s %echo% Suddenly, a black trickle appears in the snowy white. Another trickle branches %echo% off from it. The small streams divide, and each one expands. They form into %echo% circles, and slowly fill the circles with blackened darkness. The great ocean %echo% of darkness rages and storms, struggling against the white force. It slowly, %echo% slowly expands, covering the pure force. wait 3 s %echo% Only a small circle of purity is left... the darkness rages around it, and %echo% slowly covers it, completely this time. wait 3 s %echo% Done. There is no sign for the pure gleam which ruled this space before. wait 4 s %echoaround% %actor% The darkness trickles on %actor.name%'s leg, slowly covering it. %echoaround% %actor% It slowly expands upwards, towards %actor.hisher%'s face... %echoaround% %actor% %actor.name% Sends a dreadful scream into the air, as the darkness %echoaround% %actor% completely covers %actor.hisher%. wait 1 s %send% %actor% The darkness trickles on your leg, expanding, and heading towards your face! %send% %actor% The darkness slowly covers your face, choking you. wait 1 s %teleport% %actor% 17406 %send% %actor% Suddenly, the darkness completely uncovers you, leaving you gaping for air. wait 1 s %force% %actor% look ``` -------------------------------- ### Object Command: %load% Source: https://www.tbamud.com/Oasis_DG_pages/contents/object_commands Loads a specified object or mobile into the game based on its vnum. Requires type ('obj' or 'mob') and vnum. ```OasisOLC Script %load% vnum ``` -------------------------------- ### Eliminate Player with 'mkill' Command Source: https://www.tbamud.com/Oasis_DG_pages/contents/mob_com_ex The 'mkill' command is used to eliminate a player character. The example demonstrates a trigger that waits for a player to enter a specific area and then uses 'mkill' to eliminate them if they do not leave within a set time. This command is intended for use with mobiles. ```mudscript if (%actor.vnum% == -1) wait 2 sec say Welcome to my parlor said the spider to the fly! wait 2 sec say of course, that spider is a friend of mine! wait 2 sec cackle wait 2 sec mkill %actor% end ``` -------------------------------- ### Atmospheric Zone Messages (MUD Script) Source: https://www.tbamud.com/Oasis_DG_pages/contents/wld_com_ex This global random trigger sends atmospheric messages to the zone every 20 seconds, provided players are present. It uses a switch statement based on a random number to select one of several pre-defined messages. ```MUD Script eval line %random.6% switch %line% case 1 wait 20 s %zoneecho% %self.vnum% A cold wind sweeps through from the north. break case 2 wait 20 s %zoneecho% %self.vnum% Thunder rumbles in the distance. break case 3 wait 20 s %zoneecho% %self.vnum% You hear a strange sound. break case 4 wait 20 s %zoneecho% %self.vnum% You feel something brush against your foot. break case 5 wait 20 s %zoneecho% %self.vnum% A cold wind sweeps through from the north. break default wait 20 s %zoneecho% %self.vnum% A chilly breeze from the north sends shivers through you. break done ``` -------------------------------- ### Get Character Level Source: https://www.tbamud.com/Oasis_DG_pages/contents/variables Retrieves the current level of the character. ```text %char.level% ``` -------------------------------- ### Get Character Race Source: https://www.tbamud.com/Oasis_DG_pages/contents/variables Retrieves the character's race as a string. ```text %char.race% ``` -------------------------------- ### Get Character Skill Percentage Source: https://www.tbamud.com/Oasis_DG_pages/contents/variables Retrieves the percentage of learnedness for a specified skill. ```text %char.skill()% ``` -------------------------------- ### Detach Command Example Source: https://www.tbamud.com/Oasis_DG_pages/contents/script_commands The 'detach' command is used to remove a trigger from a specified target. It is the opposite of the 'attach' command. ```oasis-dg detach 3000 %self.id% ``` -------------------------------- ### Load Multiple Mobs Script Source: https://www.tbamud.com/Oasis_DG_pages/contents/wld_com_ex This script loads three instances of a specific mob (vnum 13542), described as an aggressive marsh tentacle. It includes a preceding atmospheric message. The script is triggered on room entry and uses the '%load%' command for each mob instance. ```Tbamud Script Trigger Intended Assignment: Rooms Trigger Type: Enter , Numeric Arg: 100, Arg list: None Commands: wait 1 s %echo% Tentacles reach out from the fog, trying to fight you! %load% mob 13542 %load% mob 13542 %load% mob 13542 ``` -------------------------------- ### Get Character Sex Source: https://www.tbamud.com/Oasis_DG_pages/contents/variables Retrieves the character's sex as a string, which can be MALE, FEMALE, or NEUTRAL. ```text %char.sex% ``` -------------------------------- ### Get Character Name Source: https://www.tbamud.com/Oasis_DG_pages/contents/variables Retrieves the character's name. For non-player characters (mobs), this is the short description. ```text %char.name% ``` -------------------------------- ### Get Character Room Source: https://www.tbamud.com/Oasis_DG_pages/contents/variables Retrieves a variable for the room the character is currently in. Older versions returned a room vnum. ```text %char.room% ``` -------------------------------- ### Room Commands API Source: https://www.tbamud.com/Oasis_DG_pages/contents/room_commands This section details the various commands available for manipulating rooms within the game environment. ```APIDOC ## %damage% Room Command ### Description Causes amount points of damage to victim. The amount can be negative, to create a healing effect. ### Method Not Applicable (Script Command) ### Endpoint Not Applicable (Script Command) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ``` %damage% ``` ### Response #### Success Response (200) None (Command execution) #### Response Example None ``` ```APIDOC ## %door% Room Command ### Description Used for adding, deleting, and modifying doors in room #vnum. Direction determines which door is being changed. If the door does not exist first, a new door will be created. ### Method Not Applicable (Script Command) ### Endpoint Not Applicable (Script Command) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ``` %door% [value] ``` ### Response #### Success Response (200) None (Command execution) #### Response Example None ### Fields for %door% - **purge**: Remove the exit in the direction specified - no value needed - **description**: value will become the new exit description - **flags**: value will be the new door flags bitvector - **key**: value is the vnum of the key to the door in this direction - **name**: value is the name of the door in the specified direction - **room**: value is the vnum of the room this direction leads to ``` ```APIDOC ## %echo% Room Command ### Description Sends a message to all non-sleeping characters in the same room that this script is executing in. ### Method Not Applicable (Script Command) ### Endpoint Not Applicable (Script Command) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ``` %echo% ``` ### Response #### Success Response (200) None (Command execution) #### Response Example None ``` ```APIDOC ## %echoaround% Room Command ### Description Sends a message to all characters in the room with victim, except victim. ### Method Not Applicable (Script Command) ### Endpoint Not Applicable (Script Command) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ``` %echoaround% ``` ### Response #### Success Response (200) None (Command execution) #### Response Example None ``` ```APIDOC ## %force% Room Command ### Description Forces the victim to perform a particular command. Cannot be made to force immortals. ### Method Not Applicable (Script Command) ### Endpoint Not Applicable (Script Command) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ``` %force% ``` ### Response #### Success Response (200) None (Command execution) #### Response Example None ``` ```APIDOC ## %load% Room Command ### Description Loads the specified object or mobile. ### Method Not Applicable (Script Command) ### Endpoint Not Applicable (Script Command) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ``` %load% ``` ### Response #### Success Response (200) None (Command execution) #### Response Example None ``` ```APIDOC ## %purge% Room Command ### Description Removes victim from the game. May not be used on players. ### Method Not Applicable (Script Command) ### Endpoint Not Applicable (Script Command) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ``` %purge% ``` ### Response #### Success Response (200) None (Command execution) #### Response Example None ``` ```APIDOC ## %send% Room Command ### Description Sends a message to the victim. ### Method Not Applicable (Script Command) ### Endpoint Not Applicable (Script Command) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ``` %send% ``` ### Response #### Success Response (200) None (Command execution) #### Response Example None ``` ```APIDOC ## %zoneecho% Room Command ### Description Echoes a message to the zone. ### Method Not Applicable (Script Command) ### Endpoint Not Applicable (Script Command) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ``` %zoneecho% ``` ### Response #### Success Response (200) None (Command execution) #### Response Example None ``` ```APIDOC ## %teleport% Room Command ### Description Teleports the victim to the target location. The victim does not need to be in the same room as the mob. If the victim is 'all', all characters in the room will be teleported to the target room. No messages are generated by this command. ### Method Not Applicable (Script Command) ### Endpoint Not Applicable (Script Command) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ``` %teleport% ``` ### Response #### Success Response (200) None (Command execution) #### Response Example None ``` ```APIDOC ## dg_cast Command ### Description Allows the holder of a trigger to cast spells. Spells will work for rooms and objects, as well as mobiles. ### Method Not Applicable (Script Command) ### Endpoint Not Applicable (Script Command) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ``` dg_cast '' [target] ``` ### Response #### Success Response (200) None (Command execution) #### Response Example None ``` ```APIDOC ## %asound% Room Command ### Description Sends a message to all surrounding rooms. ### Method Not Applicable (Script Command) ### Endpoint Not Applicable (Script Command) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ``` %asound% ``` ### Response #### Success Response (200) None (Command execution) #### Response Example None ``` -------------------------------- ### Get Character ID Source: https://www.tbamud.com/Oasis_DG_pages/contents/variables Retrieves the unique identifier for a character. This is primarily an internal value but can be useful for unique identification. ```text %char.id% ``` -------------------------------- ### Dwarven Player East Command Teleport (MUD Script) Source: https://www.tbamud.com/Oasis_DG_pages/contents/wld_com_ex This command trigger allows only dwarven players to use the 'e' or 'east' command to teleport to room 4011. It sends messages to the actor and others in the room, then forces a 'look' action. Returns 1 if successful, 0 otherwise. ```MUD Script if (%cmd%==e || %cmd%==east%) if (%actor.race%==dwarf) %send% %actor% The door vanishes as if it was never there, and you step through. %echoaround% %actor% As %actor.name% steps through the doorway, the door disappears for an instant. %teleport% %actor% 4011 %echoaround% %actor% %actor.name% has arrived. %force% %actor% look return 1 else return 0 end end ``` -------------------------------- ### Get Character Master Source: https://www.tbamud.com/Oasis_DG_pages/contents/variables Retrieves a variable for the master of the character, or an empty return if the character has no master (i.e., is not following anyone). ```text %char.master% ``` -------------------------------- ### Get Character Object Pronoun Source: https://www.tbamud.com/Oasis_DG_pages/contents/variables Returns the appropriate object pronoun ('him', 'her', or 'it') based on the character's gender. ```text %char.himher% ``` -------------------------------- ### Object Command: %zoneecho% Source: https://www.tbamud.com/Oasis_DG_pages/contents/object_commands Broadcasts a message to all rooms within the same zone. Requires a room vnum and the message content. ```OasisOLC Script %zoneecho% message ``` -------------------------------- ### Get Character Gender Pronoun Source: https://www.tbamud.com/Oasis_DG_pages/contents/variables Returns the appropriate gender pronoun ('he', 'she', or 'it') based on the character's gender. ```text %char.heshe% ``` -------------------------------- ### Get Next Character in Room Source: https://www.tbamud.com/Oasis_DG_pages/contents/variables Retrieves a variable for the next character in the same room. Returns empty if this character is the last one in the room. ```text %char.next_in_room% ``` -------------------------------- ### Object Command: %force% Source: https://www.tbamud.com/Oasis_DG_pages/contents/object_commands Forces a victim to execute a specific command. Cannot be used to force immortals. Requires victim and command as arguments. ```OasisOLC Script %force% victim command ``` -------------------------------- ### Mob Echo Message on Item Receive Source: https://www.tbamud.com/Oasis_DG_pages/contents/mob_com_ex This mobile trigger sends a message to all non-sleeping characters in the vicinity when a mob receives an item. It announces that '%actor.name%' gave '%object.name%' to '%self.name%'. ```mudscript %echo% A hush goes through the gathered people as %actor.name% give %object.name% to %self.name% ``` -------------------------------- ### Checking for Object Containment Source: https://www.tbamud.com/Oasis_DG_pages/contents/variables Provides examples of how to check if an object contains another item based on its vnum or name. This function only checks the top layer of the container. ```mudlet %obj.has_in()% %obj.has_in()% ```