Re: [CODE] Rent & Quit help needed

From: Derek L. Karnes (dkarnes@mystech.com)
Date: 10/30/96


Amy & Ryan Biggs wrote:
> 
> I am looking to change the rent/quit system in the following way:
> 
> Players can either quit or rent, both are similar.  Rent will only work in
> an inn.  Quit works anywhere.  If you quit outside of an inn, you CANNOT
> heal after coming back an hour later.  If you do, it will be like renting,
> and act normal.  Obviously, I need to put in a check to see if the player
> is in an inn, and if they are, instead sent to the rent code, otherwise,
> just do a regular quit.  Renting will cost only 1 gp per day, no matter
> what you have.
> 
> What I need help with is how to make it so that the mud can differentiate
> between an inn and a non-inn room, and how to switch to the approproiate
> code.  I also need to know how to get the 'heal' code to know if they quit
> in the right location.  In addition, how do I change it so that it always
> charges the same
> amount.

To see if they rented in a room, check their load room when they come into the game
(in interpreter.c nanny() CON_MENU case 1:) and see if it matches any in a list of
all the inn rooms(which you'll have to hardcode to make this easiest.. although i
guess you could make it dynamic by checking if the load_room has a mob with a special
function, and if it does, is the special a receptionist.).

cost of renting is set in objsave.c crash_load();

'heal' code is in store_to_char() in db.c.. where it checks for if !POISONed just add
the same check_if_in_inn function you wrote for above.

-Derek Karnes
--
                                    \ | /
                        \  /---------------------\  /
                       --    dkarnes@mystech.com    --
                   --    Serapis, Imp of Dark Pawns    --
                       --    knight.ufp.org 4000    --    
                      --    Open for Beta testing    --    
                        /  \---------------------/  \
                                    / | \
+-----------------------------------------------------------+
| Ensure that you have read the CircleMUD Mailing List FAQ: |
|   http://cspo.queensu.ca/~fletcher/Circle/list_faq.html   |
+-----------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/18/00 PST