home » builders » builder's lessons » tavern programs

Tavern programs

Simple method using quest bits in the area

Many of the taverns and inns around the kingdoms offer a room for the night for a few copper or silver. To follow is the programs on the inn keeps and tavern guards in Waterdeep. Further down is a more complicated method, the one that is employed by the Lucky Drunk Tavern in Waterdeep.

First of all a basic inn setup needs to have two rooms for this to work. Any more than two rooms will make for different programs.

Make an Innkeeper in your tavern. They can of course also be a shop and sell ale and food and other bits and pieces.

#8041
innkeeper~
an innkeeper~
An innkeeper stands behind the bar here.
~
Dressed in a plain white shirt and pants, he wipes down the bar.
~
U 25 CLASS_FIGHTERS RACE_HUMAN SEX_MALE POS_STANDING DEITY_NONE
ACT_SENTINEL|ACT_NOSHOVE|ACT_CITIZEN
0
ARMOR_TYPE_BANDED MATERIAL_BRASS
d15+15 700
13 13 13 18 13 18 13
0 0 0 0 0
LANG_COMMON|LANG_DWARVEN
LANG_COMMON|LANG_DWARVEN
RIS_NONE RIS_NONE RIS_NONE
>greet_prog 50~
sayto $n So what will it be? A hearty meal? An ale?
sayto $n Or for 3 copper you can get a bed for the night.
~
>bribe_prog 3~
sayto $n Go on up.  Our mattresses are made of nice soft feathers.
sayto $n Sleep well.
mpmset $n quest 15 1 1
mpforce $n up
mpjunk coins
~
>intercept_prog sleep~
sayto $n What ye be thinking you can sleep down here like a drunk?
sayto $n Either pay 3 copper for a room or be off with ye!
~
|

This innkeeper has a 50% chance of telling the PC that he has rooms for rent. They cost 3 copper. When he is given the copper, he sets a quest bit up on the PC and forces them up. Make sure you junk the coins. He also makes sure that no one sleeps in his tavern main room.

Now make a guard to put in the bedroom.

#8047
tavern inn guard~
a tavern guard~
A tavern guard is here making sure you have paid.
~
He looks pretty mean.  His job is to make sure that all who try to sleep
in the rooms above the inn have paid their way.
~
U 45 CLASS_FIGHTERS RACE_HUMAN SEX_MALE POS_STANDING DEITY_NONE
ACT_SENTINEL|ACT_NOSHOVE|ACT_CITIZEN
0
ARMOR_TYPE_BANDED MATERIAL_BRASS
d15+15 800
13 13 13 18 13 18 13
0 0 0 0 0
LANG_COMMON
LANG_COMMON
RIS_NONE RIS_NONE RIS_NONE
>greet_prog 100~
if quest(15,1,$n) == 0
  sayto $n Hey you cant come up here without paying!
  sayto $n Go down and pay your copper before trying to sleep up here.
  mpforce $n down
else
  if quest(15,1,$n) ==1
    sayto $n Sleep well.
    mpmset $n quest 15 1 0
  endif
endif
~
|

This guard checks for quest bits. If they are not set to having paid he kicks the player out. I put the same guard in all the taverns in a city. So if you force them in a direction you need to make sure that your bedroom is in the same direction in the Taverns. If they have paid he sets their bits back to 0 so the next time they want to rent a room they have to repay.

Simple method checking Waterdeep quest bits

If you want to save quest bits in your area, you can actually use the quest bits in Waterdeeps area by doing the following. In fact I fully encourage you to do so.

#8041
innkeeper~
an innkeeper~
An innkeeper stands behind the bar here.
~
Dressed in a plain white shirt and pants, he wipes down the bar.
~
U 25 CLASS_FIGHTERS RACE_HUMAN SEX_MALE POS_STANDING DEITY_NONE
ACT_SENTINEL|ACT_NOSHOVE|ACT_CITIZEN
0
ARMOR_TYPE_BANDED MATERIAL_BRASS
d15+15 700
13 13 13 18 13 18 13
0 0 0 0 0
LANG_COMMON|LANG_DWARVEN
LANG_COMMON|LANG_DWARVEN
RIS_NONE RIS_NONE RIS_NONE
>greet_prog 50~
sayto $n So what will it be? A hearty meal? An ale?
sayto $n Or for 3 copper you can get a bed for the night.
~
>bribe_prog 3~
sayto $n Go on up.  Our mattresses are made of nice soft feathers.
sayto $n Sleep well.
mpmset $n questr 8000 15 1 1
mpforce $n up
mpjunk coins
~
>intercept_prog sleep~
sayto $n What ye be thinking you can sleep down here like a drunk?
sayto $n Either pay 3 copper for a room or be off with ye!
~
|
#8047
tavern inn guard~
a tavern guard~
A tavern guard is here making sure you have paid.
~
He looks pretty mean.  His job is to make sure that all who try to sleep
in the rooms above the inn have paid their way.
~
U 45 CLASS_FIGHTERS RACE_HUMAN SEX_MALE POS_STANDING DEITY_NONE
ACT_SENTINEL|ACT_NOSHOVE|ACT_CITIZEN
0
ARMOR_TYPE_BANDED MATERIAL_BRASS
d15+15 800
13 13 13 18 13 18 13
0 0 0 0 0
LANG_COMMON
LANG_COMMON
RIS_NONE RIS_NONE RIS_NONE
>greet_prog 100~
if questr(8000,15,1,$n) == 0
  sayto $n Hey you cant come up here without paying!
  sayto $n Go down and pay your copper before trying to sleep up here.
  mpforce $n down
else
  if quest(8000,15,1,$n) ==1
    sayto $n Sleep well.
    mpmset $n questr 8000 15 1 0
  endif
endif
~
|

Note the use of questr to check quest bits in vnum block 8000 which is Waterdeep.

More complicated Lucky Drunk Method

The Lucky Drunk method 2 seperate vnum keys, one for each room. Make sure that each room has a different cost, because you will need to use bribe progs of different values to make this work.

Also, you do not want PC's running around with keys outside of the area. So you need to get them to return it when they are done. One way would be to put a "deposit" on the key, they get some money back when they return the key to the innkeeper. Another, and something you could do as well, would be to have a guard demand the key returned before allowing them to leave the inn area. You could use quest bits to check this as well. You may need to make your area unable to be recalled out of or disallow the use of transport spells. If you did this, it would need to be IC.

Here are some samples of progs from the lucky drunk.

>speech_prog optional stocked dry bar~
sayto $n The luxury suites and honeymoon suite each have an optional stocked
sayto $n dry bar. For 10 platinum I will have your dry bar stocked.
~
>bribe_prog 5000~
sayto $n Okay. I will have your dry bar stocked. Enjoy.
smile $n
mpmset $n quest 0 1 1
mpjunk coins
~

The mobile has offered choices to the PC, and then has speech_progs that activate when the PC makes their choice of room.

Also a check can be made to make sure the PC does not already have a key in his or her possession. See below.

>intercept_prog buy~
if actorhasobjnum(9826)
 sayto $n You already have a key.
 sayto $n Give it to me if you want
 sayto $n another one.
else
 if actorhasobjnum(9827)
   sayto $n You already have a key.
   sayto $n Give it to me if you want
   sayto $n another one.
 else
   if actorhasobjnum(9828)
     sayto $n You already have a key.
     sayto $n Give it to me if you want
     sayto $n another one.
   else
     if actorhasobjnum(9829)
       sayto $n You already have a key.
      sayto $n Give it to me if you want
      sayto $n another one.
     else
       mpunintercept
     endif
   endif
 endif
endif
~

And don't forget progs to make sure $n does not leave with the key.

>intercept_prog south~
if inroom($i) == 9800
  if actorhasobjnum(9826)
   sayto $n Hey there.
   sayto $n You cannot leave with a room key.
   sayto $n Give it back to me please.
  else
    if actorhasobjnum(9827)
      sayto $n Hey there.
      sayto $n You cannot leave with a room key.
      sayto $n Give it back to me please.
    else
      if actorhasobjnum(9828)
        sayto $n Hey there.
        sayto $n You cannot leave with a room key.
        sayto $n Give it back to me please.
      else
        if actorhasobjnum(9829)
          sayto $n Hey there.
          sayto $n You cannot leave with a room key.
          sayto $n Give it back to me please.
        else
          mpunintercept
        endif
      endif
    endif
  endif
else
  mpunintercept
endif
~

Now the above method will not work if $n has the key in their pack. So to overcome this, Caius flagged his keys as type inventory which prevents the PC from putting them into their pack. This has been pretty effective at stopping PCs from leaving the area with the keys. Caius also made pertinant areas in his area no recall to stop them recalling with the key.

#9827
economy key~
{70}an economy key~
{70}A plain key lies on the ground here.~
~
ITEM_TYPE_KEY
FLAG_INVENTORY
CAN_WEAR_TAKE|CAN_WEAR_HOLD
QUALITY_AVERAGE MATERIAL_IRON COND_SUPERB SIZE_MEDIUM
0 0 0 0 0 0
E
economy key~
{70}It's a plain iron key with a long thin barrel. On both sides the
key is marked, "Lucky Drunk".
~