home » builders » builder's lessons » greet prog

Greet programs

A greet program is activated when a PC walks into the room. You can set the percentage chance of the program activating. Note that the mobile must be able to see the PC in order to activate. For instance if the room is dark, and the mobile cannot see in the dark the program will not activate.

The following prog is from Danilo in Waterdeep (when there was a mob Danilo).

>greet_prog 100~
if sex($n) == 2 
  mpechoat $n You have entered an all male domain! 
  mpechoat $n $I gives you an astonished look. 
  mpechoaround $n $I stares in amazement at $N. 
  mpechoat $n $I takes you gently by the arm and escorts you to to door. 
  mpechoaround $n $I escorts $n to the door. 
  sayto $n I am sorry my dear, but this is not
  sayto $n the place for a Lady such as yourself. 
  mptransfer $n 8061 
  if sex($n) == 1 
    sayto $n Welcome Sir, what can we do for you?
    sayto $n Would you like to buy some of my fine wares?
    sayto $n Well I surely don't know what you 
	sayto $n are but you are not welcome here. 
    mpechoat $n The guards come to escort you away. 
    mpechoaround $n The guards come to escort $N away.
    mptransfer $n 8001 
    say Well I sure don't know what IT was! 

This program activates EVERY time a PC walks in. Danilo then checks the sex of the player. 1 = Male and 2 = Female. If the PC is female there is a series of echos at and around the player before they are transfered to outside the shop. If they are male Danilo offers to serve them. If they are neutral (yes it does happen occasionally with spells like change sex) they are transferred to the southern gates of Waterdeep.

Note the use of $I. This will take the mobiles short descripton and out put it. It is quicker and easier than typing the mobile's short description. And if the short description was to change for some reason, then the program will remain accurate. $N was also used in the mpechoarounds, so that it echos the adjective if the character is ungreeted.

The following is part of a prog on a Waterdeep Soldier.

>greet_prog 40~
if iswanted($n)
  yell I have found a criminal.  Its $N!
  mpechoat $n The soldier grabs you and drags you off to the dungeon.
  say You shall pay for your crimes $N.
  mptransfer $n 8115
  mpecho $n is dragged off to the dungeon.
  mpgoto 8199

This program only activates 40 percent of the time. The soldier makes a check for if the character is wanted by the justice system, yells that they have found the character and then transfers the character to the dungeon in Waterdeep. Note that in using $N it means they will not yell out the players name UNLESS it is known by other players. If they don't know the player they should see the players adjective.

You can also specify a direction in greet progs. This is the direction that the PC has arrived from.

>greet_prog 100 south~ 
mpechoat $n You arrived from the south. 
mpechoaround $n $N arrived from the south.