Help

BEHAVIOR-EXAMPLES-2

For immortals

How to create a cave-in.

Say you want to create a cave-in if a non-cleric player tries to move north. But you also want the cave-in to stop if the player wears a special magic item (for example, a robe). This is how you would do it: (Bolded Text is what you type).

1. First, you create the room, obviously, and the exit.

2. Then you type the following, which checks to see if the player is a cleric:

 > rb room stopifnot dir n class cl .
Enter your behavior parameters now.
dir n class cl
] <all>
] A strange voice yells, "You are not a cleric!  Die, scum!"
] <spawn> 1000 1
] <spawn> 1001 2
] <spawn> 1002 20
] <spawn> 1003 40
] <spawn> 1004 50
] /s

Saving.

This sequence will start a series of events which will close the exit and start the cave-in.

3.  This behavior closes the passageway so there'll be no escape.
 > rb room closesesame custom 1000 n .
Enter your behavior parameters now.
custom 1000 n
] <all>
] A grinding noise is heard as the passage to the north is closed.
] /s

Saving.

4. This behavior tells the player what's happening.
 > rb room message custom 1001 .
Enter your behavior parameters now.
custom 1001
] <all>
] The room starts to shake, and rocks begin to tumble on your head.
] /s

Saving.

5. This behavior is the first of the damagers.
 > rb room damager custom 1002 blunt 5d20+50 .
Enter your behavior parameters now.
custom 1002 blunt 5d20+50
] <all>
] Dust begins to obscure your vision as rocks fall down on you from
] all sides.
] /s

Saving.

6. This is the second and more powerful of the damagers.
> rb room damager blunt 10d50+150 .
Enter your behavior parameters now.
blunt 10d50+150
] <all>
] There is no where to hide!  The rocks continue to rain down
] on you.
] /s

Saving.

7. Now you have a choice. You can either end their misery right here, or you can have the 2nd damager continue forever. To have it continue forever, you would add "spawn 1003 30" to #6, and get rid of the "spawn 1004" from #2. But if you want to be nice, you can end the cave-in (which is what this example is designed for). Note, be careful if you have the custom event 1003 spawn itself. This WILL continue forever until the mud is rebooted. Try to have a way to stop it. Anyway, you can continue:

 > rb room opensesame custom 1004 n .
Enter your behavior parameters now.
custom 1004 n
] <all>
] As quickly as it began, the cave-in stops.  The passage north
] once again opens.
] /s

Saving.

8. Now say you want the cave-in to end if they use the magic device that would stop the cave-in and open the real passageway. You would type: ** This will end the cave-in and spawn the opensesame. ** > rb room message use wand . Enter your behavior parameters now.

use wand
] <all>
] ^n waves the wand, and the cave-in magically stops.
] <unspawn> 1000
] <unspawn> 1001
] <unspawn> 1002
] <unspawn> 1003
] <unspawn> 1004
] <spawn> 1005
] /s

Saving.

> rb room opensesame custom 1005 ne .
Enter your behavior parameters now.
custom 1005 ne
] <all>
] A grinding noise is heard as a passage to the northeast
is revealed.
] /s

Saving.

9. And ta-da! You're done!