Home

[Package Index | Mudlib Index | Effect Index]

File /d/guilds/merchants/std/stall.c

The inheritable player stall object. This is the object that gets inherited when a player run stall is created.

Features provided include: A feedback system so that the player can give their opinions on the player-merchant concept. An evauluation book, so that players can value items before they sell them. A showcase (stallbox.c) to put items in so they can show other players them without risk of theft.

Future features may include: Facilities for metalwork, seamstressing and leatherworking. Advertising using the cryer and a commerce channel.

To use this stall, inherit "/std/stall", and include the line set_location( string ) ensuring that the string in question doesn't clash with any other stalls.

See /d/guilds/merchants/stalls/Ankh/cockbill.c for an example.

At least half the credit for this file goes to Raffi for her ideas, descriptions and support. All I did was code it :)

Written by Terano

Change history

  • 10 January 1998 -- Terano
    Rewrote it so it looked a lot neater, removed a few unneeded function calls, and added a few new features.

Inherits

This class inherits the following classes /std/room.c

Includes

This class includes the following files /include/merchant.h

Method index

  • add_cheater(string)
    This function adds a player who has been cheating, so they can no longer use the stall.
  • do_scrawl(int, int, int, mixed *)
    do_scrawl handles the command 'scrawl', if the player scrawls on board, it lets them write a message on the board object cloned in create() using the language of their choice.
  • do_sign(int, int, int, mixed *)
    do_sign is called from the sign command given in init.
  • do_sign_out(int)
    Signs the player out.
  • lang_dependent_setup()
  • load_cheat_file()
    Reads *abusers from MASTER_SAVE_FILE.
  • make_report(string)
    make_report() checks the length of the report submitted when they signed out, if its long enough it calls do_sign_out( 1 ) to sign out the player, otherwise it informs the player that the report isnt long enough, and offers them the opportunity to do it again, or sign out anyway by calling do_sign_out( 0 ).
  • make_sign(string)
    make_sign uses query_current_language to get the players current language, then uses set_read_mess( message, language ) to write the message on the board.
  • query_cheat_list()
    This function gives a list of the current people who cant use the stall
  • remove_cheater(object)
    This function is for when they redeem themselves and can use the stall again.
  • save_cheat_file()
    Writes the array *abusers to MASTER_SAVE_FILE so that it can be retrieved later.
  • set_language(string)

Public Functions

These are functions that everyone can access.

.

    add_cheater
    void add_cheater(string cheater)
    

    This function adds a player who has been cheating, so they can no longer use the stall.
      do_scrawl
      int do_scrawl(int a,
                    int b,
                    int c,
                    mixed * args)
      

      do_scrawl handles the command 'scrawl', if the player scrawls on board, it lets them write a message on the board object cloned in create() using the language of their choice. It does this using the make_sign function.
        do_sign
        int do_sign(int a,
                    int b,
                    int c,
                    mixed * args)
        

        do_sign is called from the sign command given in init.

        It does the following:

        Sign In: Checks that the player isnt a member of *abusers, if they are send them on their way. Checks if they have used the stall in the last hour, if so it stops them signing in. Checks that they havent already signed in, if so it stops them. Checks that no one else is signed in, if so it stops them. Otherwise tell everyone in the room that they sign in, log it and set occupied to the player.

        Sign Out: Check if the player is actually signed into the stall and if so call the report writing function.

          lang_dependent_setup
          void lang_dependent_setup()
          
            make_report
            int make_report(string report)
            

            make_report() checks the length of the report submitted when they signed out, if its long enough it calls do_sign_out( 1 ) to sign out the player, otherwise it informs the player that the report isnt long enough, and offers them the opportunity to do it again, or sign out anyway by calling do_sign_out( 0 ). The report is written using unguarded( (: writefile() :) ).
              make_sign
              int make_sign(string signtxt)
              

              make_sign uses query_current_language to get the players current language, then uses set_read_mess( message, language ) to write the message on the board.
                query_cheat_list
                string * query_cheat_list()
                

                This function gives a list of the current people who cant use the stall
                  remove_cheater
                  void remove_cheater(object redeemed)
                  

                  This function is for when they redeem themselves and can use the stall again.
                    set_language
                    void set_language(string l)
                    

                    Protected Functions

                    These are functions that only objects inheriting the class can access.

                      do_sign_out
                      void do_sign_out(int flag)
                      

                      Signs the player out. If the flag is set to 1, it means they wrote a report and should get the xp reward, otherwise it notes that they didnt write a report and signs them out anyway.
                        load_cheat_file
                        void load_cheat_file()
                        

                        Reads *abusers from MASTER_SAVE_FILE.
                          save_cheat_file
                          void save_cheat_file()
                          

                          Writes the array *abusers to MASTER_SAVE_FILE so that it can be retrieved later.
Valid HTML 4.01 Transitional
Valid CSS!
Read More