detach Examples: detach 34 %self.id% set room %self.room% detach 100 %room.id% detach This detaches a trigger from the thing specified. Detaching a trigger means it will no longer work until the mob or object is purged and reloaded. This means that if a room gets a trigger detached, it will stay that way until the next reboot, or until an ATTACH command is issued. If issued without any arguments, it will detach the currently running trigger from the currently running thing. In other words, if a snake is in the middle of executing trigger #159, and the command DETACH is executed, 159 will detach from the snake, the trigger will stop running, and will not be allowed to run again. ********************************************* #attach Examples: attach 2168 %self.id% This command attaches a trigger to the specified thing's ID. From then on, the thing will trigger on that event. If it is a mob or obj, this will last until it is purged, and if it is a room, it will last until the next reboot, or until a DETACH statement is issued. This command is great for multi-layer quests, where you wouldn't want, for example, a mob to react to being given a sword, until a player says something special. In these types of quests, you might want to add two lines to each script, the first line attaching the next trigger, and the second line detaching the current trigger. Remember that detaching a trigger causes it to stop executing, so it must be done in THAT specific order! ************** #if Examples: if %actor.room% == 121 say You are in my room! elseif %actor.room% == 144 say You are in my brother's room! else say Your location is fine with me. end This commands executes a conditional statement. You may use elseif's and else's, and the entire block of code must be closed with end. ******************************************* #dg_set Example: dg_set %actor% nomove on dg_set %actor% move off dg_set %actor% position mortally wounded dg_set %actor% position sprawled This is a way to set specific variables on a mobile. FIELD VALUE nomove on or off Prevents the mobile from moving around. This should only be temporary, to keep the mobile in one place until he finishes executing his script. position position name Changes the position of the victim. Valid names are floating, standing, sitting, resting, sleeping, stunned, incapacitated, mortally wounded, or sprawled. Both PCs and NPCs. longdesc long descript Changes the long description of the mob. default 'default' changes it back to what it normally is. shortdesc short descript Changes the short description of the mob. default 'default' changes it back to what it normally is. superaggr on or off Makes the mob super aggressive, meaning S_AGGR and AGGR bits are set. nosteal on or off Makes it impossible to steal from a mob, or use suggest against it. level number Changes the mob to level specified. Can be any number from 1 to 100. class class name Sets the mob's class. hit number Sets the mob's hit points. lag number Number of seconds to lag the player. Only useable on PCs. ******************************************* #dg_door [value] This is a multi-purpose function, used to control opening/closing/ locking/unlocking doors, or even their existence. You may also set the key value for a direction, or connect/unconnect a room to the direction. Basically, anything you can do in the Directions menu in REDIT can be done with this command. In the first argument, you can either put a room vnum, or %actor% which specifies the actor's room. For the remaining arguments, we'll use room vnum 11 and direction north. 1. dg_door 11 north purge Completely purges the door and exit. 2. dg_door 11 north description Changes the direction description (what you see when you type look north) to . 3. dg_door 11 north state This changes the state of the door, such as opening, closing, or making the door hidden. State is a list of any of the following: isdoor = Is a door. close = Door is closed. lock = Door is locked. open = Door is opened. unlock = Door is unlocked. pickproof = Door is pickproof. ehidden = Exit direction (what you see when you type 'look north') becomes hidden. dhidden = Actual door is hidden until it is opened. You may precede any of these with ! to reverse it. Thus, !ehidden makes the exit visible again, and !isdoor completely removes the door. All of these commands may be strung in a list, to combine them. For example: dg_door 11 north state isdoor close lock or dg_door 11 north state close !ehidden !lock 4. dg_door 11 north key The door north will only be unlocked with key vnum. 5. dg_door 11 north name List of names one can refer to the door as. For example: dg_door 11 north name door steel gate 6. dg_door 11 north room Room vnum that this direction leads into. ******************************************* #dg_call [victim] Examples: dg_call 5401 . %actor.fighting% dg_call 1679 12 dg_call 120 * %actor.fighting% This allows a mob/obj/room to call all mobs with the vnum specified to hunt down and possibly destroy the victim. The zone vnum is used to specify from which zone to pluck the mobs from; if it is . it will use the zone the trigger is executing in, and if it is *, it will summon every mob of that vnum in the game. If the victim's name is omitted, then this MUST be a mobile trigger, because the trigger will use whoever the mobile is currently fighting as the victim. ******************************************* #dg_purgemobs Example: dg_purgemobs . dg_purgemobs 37 This purges all mobs within the specified zone, completely destroying them and all items they carry. ******************************************* #dg_cast <'spell name'> [level] Examples: dg_cast 'magic missile' %actor.name% dg_cast 'blindness' vampire 52 This allows either a mob/obj/room to cast a spell upon a person. Notice that if it's a self_only casting spell and the caster is a room or an object, the spell will fail. The optional number is the level at which to cast the spell, from 1 to 101. Thus, if the spell is an "aggressive" spell, and you want to ensure that it always works against a mortal, you would put level 101. ************************************************** #dg_affect Examples: dg_affect %actor.name% str 3 10 This temporarily modifies the applies of the target, much the same way as an object or a spell would. Valid values for apply type are: str, dex, int, wis, con, cha, age, weight, height, maxmana, maxhit, maxmove, ac, hitroll, damroll, save_para, save_rod, save_petri, save_all, save_spell The value is how much to increase it or decrease it, and the duration is the amount of ticks the change will remain on the target. ************************************************ #locate %locate.char( [room vnum])% %locate.obj( [room vnum])% %locate.room()% Examples: if %locate.char(Mocirne 1700)% set char %locate.char(1711)% set obj %locate.obj(112 12)% if %locate.obj(14)% set room %locate.room(610)% This useful command returns a character, object, or room for use in a trigger. It will return the ID number of the character/obj/room, so you can use it to either find out if it exists: if %locate.obj(114)% say Object with vnum 114 is located in this room! end Or, you can set a variable to it to be used later: set room %locate.room(16)% mgoto %room% say I'm in room 16 now! For the character and object searches, if the subfield (the part in parentheses), has an optional room vnum separated by a space, it will search only in that specific room. If this is omitted, it will look only in the room the trigger is executing in, and if there is a '*', it will look throughout the entire world: if %locate.obj(16 2706)% say There is an object with vnum 16 in room 2706! elseif %locate.char(Melvin 114)% say Melvin is in room 114. elseif %locate.obj(8401 *)% say The object with vnum 8401 is somewhere in the world. end ****************************** #trigger %variable% This command forces an obj/room/mob to execute a trigger without an event actually triggering it. It is useful in situations where you can't do anything using normal game commands to trigger something. One example is yelling to trigger a room to do something. Rooms don't listen to yells, and thus it would be impossible to cause it to trigger on this. The TRIGGER command helps with this. First, create a trigger with type Auto Trigger on the obj/room/mob. Put whatever you want it do when triggered in the script. Next, edit the trigger of the "source". In the example in the preceding paragraph, source is the person yelling, and the room is what has the Auto Trigger on it. On the "source", add this line: trigger %variable% where %variable% could be %actor%, %obj%, %self%, or anything returned from the %locate% field above. The trig vnum is the Auto Trigger vnum to execute. Example: Room with Vnum 149 has the following Auto Trigger (trigger vnum 1701): > wecho Testing. Edit a mob trigger, put this into the script: yell Room #149, execute your trigger! trigger %locate.room(149)% 1701 ************* #people %people.vnum% Example: say There are %people.112% characters in room 112. 'vnum' is a room vnum, this returns the number of people in room 112. Anyone who is WizInvis at any level is not counted. ************ #time %time.hour% %time.day% %time.month% %time.year% Returns the hour, day number, month number, or year, respectively. ************* #random %random.char% Returns a random character in the room. %random.char(mob vnum)% Returns a random character, whose vnum is given, in the world. %random.char(pc)% %random.char(npc)% Returns a random character, either a pc or npc, in the room. %random.room% Returns a random room in the zone where the trigger is taking place. %random.5% Returns a random number from 1 to 5, including 1 and 5. %random.7 13% Returns a random number from 7 to 13, including 7 and 13. Obviously, these are all just examples, you may put any numbers you wish instead. ********************************** #remote This command allows one mob/obj/room to share a variable with another mob/obj/room. Say for instance, a room sets the variable of someone who enters to %person%. Then, it wants a mob somewhere far away to start hunting this player. Since the mob has no way of knowing who this player is (what the player's ID number is), it can't hunt him. Thus, the room will share its %person% variable with the mob's, such as the following code: (Room's Code) 1. set person %actor% (Person who entered is now %person%) 2. set mob %locate.char(1200 *)% (Searches the game for the mob with vnum 1200, and sets him to %mob%) 3. remote person %mob% (Shares its %person% variable with the mob, so the mob can now reference the player with it) 4. wat %mob.room% wforce %mob% mhunt %person% (Actually not that complex when broken down: at the mob's room, the first room forces the mob to start mhunting the player referenced by %person%. ******* $Mob ******* #MASOUND Echoes the message to all the rooms surrounding the mobile's room. #MZONEECHO Echoes the message to everyone within the specified zone. If '.' is used, the zone will be the zone the mob is currently in. This will NOT echo the message to the room the mob is in. Examples: mzoneecho 42 This is a message to zone 42! mzoneecho . Here is a message to everyone in my zone. #MLOAD [drop] Loads the object or mob vnum specified. If the mob is loading an object, and the 'drop' parameter is specified, the mobile will load the object in the room. Otherwise, the mobile loads it into its inventory. Examples: mload obj 715 mload obj 1148 drop mload mob 112 #MAT Executes the command in the specified target's room. Target can either be a room vnumber, or a mobile, player, or object name. Example: mat fountain fill canteen mat 2800 mload obj 214 #MECHOAROUND Prints the message to everyone in the room except for the victim. Example: mechoaround %actor% Look at this guy and laugh, everyone! #MECHO Echoes the message to everyone in the room. #MFORCE Forces the victim to perform the command. If 'room' is specified, forces everyone in the room to perform the command. Example: mforce %actor% remove all #MFORGET Remove victim from the mob's memory list. This is NOT the same memory as in the game, where the mob attacks the player if it sees him or her again. This is a trigger memory, where you can use a Greet Memory Mtrigger or an Entry Memory Mtrigger to do something when their remembered player walks in. Using the MFORGET commands removes the player from this list, but NOT from the normal in-game memory list! #MREMEMBER Adds the victim to the mob's memory list, as described above. The command is what the mob will do when the player enters. Remember, the mob will also execute any entry memory or greet memory triggers when it sees the victim, as well. Example: mremember %actor% talk %actor.name% I remember you! #MGOTO Mob goes to the target above, which can be a room vnum, or a mob or an object name, or %actor%, %object%, or %room% variables. Examples: mgoto 127 mgoto %actor.name% mgoto Charles mgoto %actor% mgoto sword mgoto %object% #MHUNT [seconds between hunt] The mobile starts hunting either a character name, or a room vnum. The optional seconds is how many seconds will elapse between each movement. They must be between 2 and 20, and divisible by 2. Use the Hunt Mtrigger to specify what to do when the mobile reaches his destination. Examples: mhunt 1280 mhunt demon 12 #MJUNK The mobile will either junk the specified object, or everything it is carrying AND wearing if 'all' is specified. 'Object' will be exactly what you would type with the normal JUNK command, or it can have the %object% variable passed to it if it's a single object. Example: mjunk sword mjunk all.dagger mjunk 2.raft mjunk all mjunk %object% #MPURGE [target] Mpurge used alone will purge all mobiles and objects in the room. Mpurge used with a target name will purge any object or mobile with that name. Examples: mpurge mpurge %actor% mpurge fountain #MSEND Sends message to the victim. Example: msend %actor% Hello there. msend skar I will kill you someday! #MTELEPORT Teleports the victim or the object (or everyone in the room if 'all' is specified), to the target. The target can be a room vnum, a character name, or an object name. Examples: mteleport all 102 mteleport %actor% grizzly mteleport %object% %actor% mteleport sally fountain #MTRANSFORM [+] Transforms the mob into a new mob with the specified vnum. If '+' is specified before the vnum, the mob will take on the new mob's hp's/mana/movement points. Examples: mtransform +126 (Transforms into mob 126 with the new mob's hps/move/mana). mtransform 17 (Transforms into mob 17, keeping its original hps/move/mana). Notice this command will always copy over the new mob's exp, because the original mob's stats such as damroll/hitroll/str... will be copied over as well. #MAWARD With the command a mobile, object, or room could award questpoints to the target. This isn't to be abused for the most extreme quests should have around 10 points and the easiest about 1 point. You can also use this to remove quest points from someone this will make it easy to make a quest shop for things such as spell or other services. Examples: maward %actor% 8 maward %actor% -4 When you are taking quest points away it will only remove points from the target but when giving quest points it will divide them amoung the targets group so if there were two people in the group it the first example would give 6 quest points to the actor and 6 to the group member. if there were four group members it would give 4 to each member and so on. if you are giving points it cannot divide below 1 point each. ******* $OBJ ******* #OJUNK Use this command to force an object to junk something that it contains. Obviously, therefore, the object must be a container. The object will either junk the specified object, or everything it is containing if 'all' is specified. 'Object' will be exactly what you would type with the normal JUNK command, or it can have the %object% variable passed to it if it's a single object. Example: ojunk sword ojunk all.dagger ojunk 2.amulet ojunk all ojunk %object% *