#1400 Mob Tutorial Example 1310 - Quest Offer~ 0 g 100 ~ * we don't want him to tell this to mobs. vnum -1 is reserved for players. if %actor.vnum% == -1 * only greet players coming from the south. if %direction% == south *wait 1 second, always give the player time before you start sending text. wait 1 sec say Can you help me, %actor.name%? wait 1 sec say An apprehensive ogre has something of mine. wait 1 sec say If you slay him I'll give you all the coins I can spare. wait 1 sec say Please, bring me the apprehension he has stolen. wait 2 sec emote looks to the east. end end ~ #1401 Mob Tutorial Example 1311 - Kill ogre~ 0 f 100 ~ say you got the best of me %actor.name%. * load some apprehension %load% obj 1300 * reload the mob for the next questor %load% mob 1311 ~ #1402 Mob Tutorial Example 1310 - Give/Quest Completion~ 0 j 100 ~ * check if this was indeed the right object if %object.vnum% == 1300 wait 1 sec say Thank you, %actor.name% %send% %actor% %self.name% gives you a gold piece. %echoaround% %actor% %actor.name% is rewarded for his valor. nop %actor.gold(1)% wait 5 sec %purge% %object% else * this wasn't the right object - don't accept it say I don't want that - bring me back my apprehension. return 0 end ~ #1403 Mob Tutorial Example 1311 - Ogre Load~ 0 n 100 ~ wait 3 sec say I'm back. Did you really think you could kill me so easily? ~ #1404 Mob Tutorial Example 2 1312 - Guard Greet~ 0 g 100 ~ if (%direction% == south) wait 1 sec emote snaps to attention as you approach. wait 1 sec say Admittance to the city is 10 coins. end ~ #1405 Mob Tutorial Example 2 1312 - Guard Bribe 10~ 0 m 10 ~ wait 1 sec unlock gate wait 1 sec open gate wait 10 sec close gate wait 1 sec lock gate ~ #1406 Mob Tutorial Example 2 1312 - Guard Bribe < 10~ 0 m 1 ~ wait 1 sec say This is not enough! wait 1 sec give %amount% coins %actor.name% ~ #1407 Mob Tutorial Example 2 1312 - Guard Close Gate~ 0 e 0 The gate is opened from~ wait 5 sec close gate wait 1 sec lock gate ~ #1408 Mob Tutorial Example 2 1312 - Guard Close Gate~ 0 e 0 leaves north.~ wait 1 sec close gate wait 1 sec lock gate ~ #1409 Mob Quest Tutorial Example 1317 - Quest starter~ 0 g 100 ~ if (%direction% == south) if %actor.varexists(solved_example_quest_zone_14)% wait 1 sec say you have already completed this quest. halt else wait 1 sec say Hello, %actor.name%. Could you find me the magic eight ball? say Please say yes, %actor.name%. end end ~ #1410 Mob Quest Tutorial Example 1317 - Quest accepted~ 0 d 1 yes~ if %actor.varexists(solved_example_quest_zone_14)% halt else wait 1 sec say Perfect, %actor.name%. I'll make this easy. It is to the east. wait 3 sec say I'd go get it myself, but I'm lazy and you need the exercise. wait 1 sec end ~ #1411 Mob Quest Tutorial Example 1317 - Quest completion~ 0 j 100 ~ if %actor.varexists(solved_example_quest_zone_14)% halt end * wait 1 sec if (%object.vnum% == 1394) dance wait 1 sec say Thank you, %actor.name%. nop %actor.exp(50)% nop %actor.gold(50)% say finally, now I can get some answers. wait 1 sec emote shakes the magic eight ball vigorously. wait 1 sec emote does not seem too pleased with his answer. set solved_example_quest_zone_14 1 remote solved_example_quest_zone_14 %actor.id% %purge% %object% else say I don't want that! junk %object.name% end ~ #1412 Room Quest Tutorial Example 1441 - Load eightball on entry.~ 2 g 100 ~ wait 2 sec %echoaround% %actor.name% A magic eight ball drops from the sky striking %actor.name% on the head. %send% %actor% A magic eight ball drops from the sky striking you on the head. %load% obj 1394 %damage% %actor% %random.5% ~ #1413 Obj Command Restorative Comfy Bed Sleep - 1401~ 1 c 100 sl~ * does not work for level 32 and above. if %mud.mudcommand% == sleep && bed /= %arg% %force% %actor% sleep set laying_in_comfy_bed_14 1 remote laying_in_comfy_bed_14 %actor.id% end ~ #1414 Obj Random Restorative Comfy Bed - 1401~ 1 b 100 ~ if %random.char% set actor %random.char% if %actor.varexists(laying_in_comfy_bed_14)% %damage% %actor% -10 %echo% %actor.name% seems refreshed from sleeping in the comfy bed. end end ~ #1415 Obj Command Restorative Comfy Bed Wake - 1401~ 1 c 100 wa~ * does not work for level 32 and above. if %cmd.mudcommand% == wake %force% %actor% wake rdelete laying_in_comfy_bed_14 %actor.id% end ~ #1416 Magic Eight Ball Check - 1321~ 0 q 100 ~ * Check to see if the person is not carrying the magic eight ball if !%actor.has_item(1394)% * They are not carrying it. So stop them and give them one. * Return 0 ignores their command to go west. They stay in the room. return 0 wait 1 sec say You forgot your magic eight ball. Take this one. * Loads the object to the actors inventory. %load% obj 1394 %actor% %send% %actor% %self.name% gives you the magic eight ball. end ~ #1450 Room Global Random Example~ 2 ab 100 ~ * Fires wether a player is in the room or not. %echo% The trigger fires now! ~ #1451 Room Random Example~ 2 b 100 ~ * Fires only when a player is in the room. %echo% The trigger fires now! * Example by Snowlock * %echo% The pungent fumes burn your lungs! * set target_char %self.people% * while %target_char% * set tmp_target %target_char.next_in_room% * %damage% %target_char% 3 * set target_char %tmp_target% * done ~ #1452 Room Command Example~ 2 c 100 l~ * does not work for level 32 and above. if %cmd.mudcommand% == look && test /= %arg% %echo% The trigger works! %force% %actor% applaud else %send% %actor% Look at what? end * Portal example with arguments: enter * if portal /= %arg% * %send %actor% You enter the portal. * %echoaround %actor.name% %actor.name% bravely steps into the portal. * %teleport% %actor% 3001 * %force% %actor% look * %echoaround% %actor% %actor.name% steps through a portal. * else * %send% %actor% Enter what?! * end ~ #1453 Room Speech Example~ 2 d 100 test~ %echo% The trigger fires now! ~ #1454 Room Zone Reset Example~ 2 f 100 ~ %echo% The trigger fires now! ~ #1455 Room Enter Example~ 2 g 100 ~ %echo% The trigger fires now! ~ #1456 Room Drop Example~ 2 h 100 ~ %echo% %actor.name% tries to drop object type: %object.type% if (%object.type% == TRA) %echo% No Littering! return 0 end ~ #1457 Room Cast Example~ 2 p 100 ~ %echo% %actor.name% tried to cast spellnumber: %spell%: %spellname% on %vict.name% %obj.name%. return 0 ~ #1458 Room Leave Example~ 2 q 100 ~ %echo% %actor.name% tries to leave to the %direction%. return 0 ~ #1459 Room Door Example~ 2 r 100 ~ if %cmd% == open %echoaround% %actor% As %actor.name% tries to %cmd% the door to the %direction% a bucket of water dumps on his head. %send% %actor% Splash!! %send% %actor% A bucket of water drops on top of your head as you open the door. %damage% %actor% 10 %echo% The door slams shut again. detach 1459 %self.id% return 0 end ~ #1460 Mob Global Random Example~ 0 ab 100 ~ say The trigger fires now! ~ #1461 Mob Random Example~ 0 b 100 ~ * No Script * This I just threw in because it is a random trig and does not normally have an actor. set actor %random.char% * wait 1 sec say Hey! You don't belong here! emote mumbles, 'Now what was that spell...' wait 1 sec switch %random.3% case 1 dg_cast 'harm' %actor% break case 2 dg_cast 'magic missle' %actor% break default say That wasn't right... mecho A failed spell backfires on the mage! mdamage %self% 10 break done ~ #1462 Mob Command Example~ 0 c 100 test~ * does not work for level 32 and above. say The trigger fires now! say triggered by %actor.name% ~ #1463 Mob Speech Example~ 0 d 0 test~ say speech: %speech% say car: %speech.car% say cdr: %speech.cdr% eval text %speech.car% say %text% ~ #1464 Mob Action Example~ 0 e 0 has entered the game.~ eval inroom %self.room% %zoneecho% %inroom.vnum% %self.name% shouts, 'HELP!! Someone please rescue me!!' ~ #1465 Mob Death Example~ 0 f 100 ~ %echo% %self.name% curses %actor.name% before drawing %self.hisher% final breath. ~ #1466 Mob Greet Example~ 0 g 100 ~ * To make a trigger fire only on players use: if %actor.vnum% == -1 say Hello, and welcome, %actor.name% end * Check what direction they came from. if %direction% say Hello, %actor.name%, how are things to the %direction%? else * If the character popped in (word of recall, etc) this will be hit say Where did YOU come from, %actor.name%? end ~ #1467 Mob Greet-All Example~ 0 h 100 ~ say Hello, and welcome, %actor.name% ~ #1468 Mob Entry Example~ 0 i 100 ~ * 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% == 1233) say I, %self.name%, declare this room Rumble's. end ~ #1469 Mob Receive Example~ 0 j 100 ~ if (%object.vnum% == 1300) %purge% %object% say thanks! nop %actor.gold(1)% else say I don't want that! return 0 end ~ #1470 Mob Fight Example~ 0 k 100 ~ 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 ~ #1471 Mob Hitprcnt Example~ 0 l 50 ~ 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 ~ #1472 Mob Bribe Example~ 0 m 1 ~ say thank you, step inside. wait 2 sec %echoaround% %actor% %self.name% pushes %actor.name% through a concealed door. %send% %actor% %self.name% helps you through a concealed door. %teleport% %actor% 1300 ~ #1473 Mob Load Example~ 0 n 100 ~ switch %random.5% case 1 %load% obj 3010 wield dagger break case 2 %load% obj 3011 wield sword break case 3 %load% obj 3012 wield club break case 4 %load% obj 3013 wield mace break case 5 %load% obj 3014 wield sword break default * this should be here, even if it's never reached break done ~ #1474 Mob Memory Example Part 1~ 0 g 100 ~ * This must be set by another trigger first before the mem trigger can be used. mremember %actor.name% say I'll remember you now, %actor.name% ~ #1475 Mob Memory Example Part 2~ 0 o 100 ~ wait 4 s poke %actor.name% say i've seen you before, %actor.name%. mforget %actor.name% ~ #1476 Mob Cast Example~ 0 p 100 ~ if (%spellname%==magic missile) %echo% %self.name% is protected by a shield spell negating %actor.name%s Magic Missile. return 0 else %echo% %self.name%s shield spell doesn't protect %self.himher% from %actor.name%s magic. return 1 end ~ #1477 Mob Leave Example~ 0 q 100 ~ if (%actor.level% > 10) say You may not leave here, %actor.name%. %send% %actor.name% %self.name% prevents you from leaving the room. %echoaround% %actor.name% As %actor.name% tries to leave the room, %self.name% stops %actor.himher%. return 0 end ~ #1478 Mob Door Example~ 0 r 100 ~ say %actor.name% do not try to %cmd% the door to the %direction% again. Or else! return 0 ~ #1479 Obj Global Random Example~ 1 ab 100 ~ %echo% The trigger fires now! ~ #1480 Obj Random Example~ 1 b 100 ~ %echo% The trigger fires now! eval actor %self.worn_by% if !%actor% halt endif %send% %actor% Ichiban's blade thirsts for blood. ~ #1481 Obj Command Example~ 1 c 7 open~ * Numeric Arg: 7 means obj can be worn, carried, or in room. * does not work for level 32 and above. if ("%arg%" == "closet") %load% mob 1307 else %send% %actor% Open What? end ~ #1482 Obj Timer Example~ 1 f 100 ~ * %echo% The trigger fires now! * otimer 3 %echo% The ice cream melts away. %purge% %self% ~ #1483 Obj Get Example~ 1 g 100 ~ if (%actor.level% < 31) %transform% 1398 return 0 else %echo% You hear, 'Please put me down, %actor.name%' end ~ #1484 Obj Drop Example~ 1 h 100 ~ if (%actor.level% < 31) return 0 end ~ #1485 Obj Give Example~ 1 0 100 ~ if (%actor.level% < 31) return 0 end ~ #1486 Obj Wear Example~ 1 j 100 ~ if (%actor.str% < 17) return 0 end %send% %actor% send to actor. %echoaround% %actor% %actor.name% echoaround actor %damage% %actor% 100 ~ #1487 Obj Remove Example~ 1 l 90 ~ return 0 ~ #1488 Obj Load Example~ 1 n 100 ~ %echo% %self.name% appears out of nowhere. ~ #1489 Obj Leave Example~ 1 q 100 ~ %echo% My trigger commandlist is not complete! ~ #1490 Nested If Example~ 0 q 100 ~ * In this nested if example anyone leaving north will be checked for passage. if %direction% == NORTH * If it is a male over 18 let them pass. if %actor.sex% == MALE if %actor.age% > 18 say Welcome. else say let me see your ID. return 0 end * If a female over 18 or less than 18 but charisma above 16 let them pass. elseif %actor.sex% == FEMALE if %actor.age% > 18 say welcome. else if %actor.cha% > 16 say don't tell anyone I let you in. else say let me see your ID. return 0 end end * Don't let nuetrals pass elseif %actor.sex% == NUETRAL say what the heck are you? return 0 end end ~ $~