]> jfr.im git - irc/gameservirc.git/commitdiff
Added a tavern where you can buy potions for later use.
authorkainazzzo <redacted>
Tue, 25 Nov 2003 18:31:03 +0000 (18:31 +0000)
committerkainazzzo <redacted>
Tue, 25 Nov 2003 18:31:03 +0000 (18:31 +0000)
git-svn-id: https://svn.code.sf.net/p/gameservirc/code/trunk@71 bc333340-6410-0410-a689-9d09f3c113fa

gameserv/Changes
gameserv/TODO
gameserv/gameserv.cpp
gameserv/helpfiles/help
gameserv/helpfiles/tavern [new file with mode: 0644]

index c89fbb66893605f311cb3051bcb19ec08f392bff..768bebe11c9dbd1d362991cc645c03df2c2c4e09 100644 (file)
@@ -1,60 +1,81 @@
+Version 1.1.6
+* Made some cosmetic changes to this file.
+* Added an inventory class Pouch which allows players to carry around
+    things such as potions and such.
+
 Version 1.1.5
-* Added a missing help file admin_commands. It was written before, but somehow was deleted.
+* Added a missing help file admin_commands. It was written before, but 
+    somehow was deleted.
 * Admins can now identify as any user without having the correct password.
 * Fixed a bug that allowed for two nicknames to identify for the same player.
-* Added a forestfights directive to the config file so admins can set the default daily forest 
-    fights.
-* Added a die directive to the config file that will not let you start GameServ if it is present.
+* Added a forestfights directive to the config file so admins can set the 
+    default daily forest fights.
+* Added a die directive to the config file that will not let you start 
+    GameServ if it is present.
 * Inputted monsters for Level 6. Six more levels left unfinished.
-* Changed confloadtime directive to welcomedelay directive in the config file. This made more sense.
-* Added an updateperiod directive to the config file. This represents the period (in seconds) for
-    updating the player data file. Every time the gameserv server gets a message it will check to
-    see if "updateperiod" seconds or more have elapsed since the last update.
+* Changed confloadtime directive to welcomedelay directive in the config file.
+    This made more sense.
+* Added an updateperiod directive to the config file. This represents the 
+    period (in seconds) for updating the player data file. Every time the 
+    gameserv server gets a message it will check to see if "updateperiod" 
+    seconds or more have elapsed since the last update.
+
 Version 1.1.4
-* Fixed the welcome msg sending "ICK" instead of the nickname of a new aclient. (Thank you wcampbel)
-* Load now has an optional parameter "monsters" which will force a load of the monsterdata
-    file. This is useful for changing monsters on-the-fly.
-* Added a load_monsters function that loads from a preconfigured monsters.dat file instead of
-    hard coding the monsters into the array. Users can now change the monster configuration
-    around.
+* Fixed the welcome msg sending "ICK" instead of the nickname of a new 
+    aclient. (Thank you wcampbel)
+* Load now has an optional parameter "monsters" which will force a load of the
+    monsterdata file. This is useful for changing monsters on-the-fly.
+* Added a load_monsters function that loads from a preconfigured monsters.dat
+    file instead of hard coding the monsters into the array. Users can now 
+    change the monster configuration around without knowing C/C++.
 * Added a new directive to the config file: confloadtime
-    this represents the delay (in seconds) until GameServ sends a welcome message to incoming
-    clients.
-* Added the welcome message to the config file. See gameserv.example.conf for more info on how to
-    use the variable as a formatted string.
+    this represents the delay (in seconds) until GameServ sends a welcome 
+    message to incoming clients.
+* Added the welcome message to the config file. See gameserv.example.conf
+    for more info on how to use the variable as a formatted string.
+
 Version 1.1.3
-* Removed a lot of extra list searches by changing all of the boolean functions to take
-    aClient as a parameter instead of a nickname string.
-* Added an is_alive boolean function. Players must now wait until the next day to play again.
-* Saving the player->flags integer to the players.dat file. Old databases will not work.
-    QUICK FIX: put a 0 to the left of the encrypted passwords for all player entries so the
-       database can load properly. Look in flags.h for a description of the way flags work.
+* Removed a lot of extra list searches by changing all of the boolean 
+    functions to take aClient as a parameter instead of a nickname string.
+* Added an is_alive boolean function. Players must now wait until the next 
+    day to play again.
+* Saving the player->flags integer to the players.dat file. Old databases 
+    will not work. 
+    QUICK FIX: put a 0 to the left of the encrypted passwords for all player 
+    entries so the database can load properly. Look in flags.h for a 
+    description of the way flags work.
+
 Version 1.1.2
 * Added a /version reply
 * Fixed the Makefile to include configscript.cpp
-* Added a join message when people connect to the IRCD. The message is set on a delay
-    so that on the initial nick burst, the services do not send everyone the message.
-* Changed the admin commands from a simple password interface to a more sophisticated flags 
-    approach. Now you have to identify with the administrator password once, and your flags
-    indicate that you are an admin for all commands.
-* Full help files available corrected form for the new administrator type commands.
+* Added a join message when people connect to the IRCD. The message is set 
+    on a delay so that on the initial nick burst, the services do not send
+    everyone the message.
+* Changed the admin commands from a simple password interface to a more 
+    sophisticated flags approach. Now you have to identify with the 
+    administrator password once, and your flags indicate that you are an 
+    admin for all commands.
+* Full help files available in corrected form for the new administrator type
+    commands.
 
 Version 1.1.1
 * Added some admin features.
     - Refresh
 * Added help menu functionality for all commands.
-* Fixed the register command so it notified the client that registration was successful.
-* Changed the master command so that you didn't have to fight your master if you
-    had enough experience. There is now a question/fight subcommand set for the master
-    command.
-* Tweaked the masters a bit. Basically, they were too tough. Once a player had enough
-    experience, they had no chance against their master until they got the next two
-    weapons up. This made the next level too easy. Past level 1 still needs tweaking.
+* Fixed the register command so it notified the client that registration
+    was successful.
+* Changed the master command so that you didn't have to fight your master
+    if you had enough experience. There is now a question/fight subcommand
+    set for the master command.
+* Tweaked the masters a bit. Basically, they were too tough. Once a player
+    had enough experience, they had no chance against their master until
+    they got the next two weapons up. This made the next level too easy. 
+    Past level 1 still needs tweaking.
 * Added functionality for bahamut IRCD 
 
 Version 1.1.0
-* Added autoconf functionality to the gameserv package. Does not compile correctly on
-    SunOS without tweaking.
+* Added autoconf functionality to the gameserv package. Does not compile
+    correctly on SunOS without tweaking.
 * Fixed the game so that players stats reset at midnight UTC + 8 hours.
     time(NULL) - (time(NULL) % 86400) + 3600 * 8
 * Added a contrib directory with a user submitted patch for hybrid ircd.
index 9c875e11a3336a719393ee8ee20128779b8ffcfb..67d87fe35e3144a6160f38c1e4e5bd5cc7c18df1 100644 (file)
@@ -10,7 +10,7 @@ X = Finsihed
 * Town square shouts. Array of 10 strings that gets rotated
     * Choose how many strings to rotate in the config file
 
-* Tavern where you can buy potions and powerups
+- Tavern where you can buy potions and powerups
 
 - Forest events
     X Wishing well
index a47639714811df8a3c024745b10aaa6d420be308..c569cdc834cd77790338bf67dfced3bd35b73b5a 100644 (file)
@@ -100,6 +100,7 @@ void do_reset(char *u);
 void do_run(char *u);
 void do_stats(char *u);
 void do_store(char *u);
+void do_tavern(char *u);
 void see_master(char *u);
 
 void showstats(const char *u, const char *nick);
@@ -176,6 +177,8 @@ void gameserv(char *source, char *buf)
        do_admin(source);
     } else if (stricmp(cmd, "REFRESH") == 0) {
        do_refresh(source);
+    } else if (stricmp(cmd, "TAVERN") == 0) {
+       do_tavern(source);
     } else if (stricmp(cmd, "PRINT") == 0) {
        cout << "Printing Clients List: " << endl;
        clients.print();
@@ -2876,6 +2879,101 @@ void do_store(char *u)
     }
 }
 
+void do_tavern(char *u)
+{
+    char *cmd = strtok(NULL, " ");
+    long int price;
+
+    aClient *user;
+    Player *p;
+    if (!(user = find(u)))
+    {
+       notice(s_GameServ, u, "Fatal Error. See a %S admin for help");
+       return;
+    }
+    else if (!is_playing(user))
+    {
+       notice(s_GameServ, u, "You must be playing to go to the Tavern");
+       return;
+    }
+    p = user->stats;
+    if (!cmd)
+    {
+       notice(s_GameServ, u, "Welcome to Boot Liquors Mystic Apothecary");
+       notice(s_GameServ, u, "Your commands:");
+       notice(s_GameServ, u, "/msg %S TAVERN {LIST | BUY} [NUMBER]");
+       notice(s_GameServ, u, "What'll it be?");
+    }
+    else if (stricmp(cmd, "LIST") == 0)
+    {
+       notice(s_GameServ, u, "Here is a list of what we have to offer:");
+       notice(s_GameServ, u, "1. Healing Potions for %ld Gold", 1000 * p->level + (p->exp / 10));
+       notice(s_GameServ, u, "2. Strength Potions for %ld Gold", 2050 * p->level + (p->exp / 10));
+       notice(s_GameServ, u, "3. Defense Potions for %ld Gold", 2000 * p->level + (p->exp / 10));
+       notice(s_GameServ, u, "To buy a potion, type /msg %S TAVERN BUY #");
+       notice(s_GameServ, u, "Example: /msg %S TAVERN BUY 1 buys a healing potion!");
+       notice(s_GameServ, u, "By something will ya!");
+    }
+    else if (stricmp(cmd, "BUY") == 0)
+    {
+       char *chnum = strtok(NULL, " ");
+       int num = stringtoint(chnum);
+
+       if (!chnum)
+       {
+           notice(s_GameServ, u, "SYNTAX: TAVERN BUY #");
+           notice(s_GameServ, u, "Example: /msg %S TAVERN BUY 1");
+           return;
+       }
+       if (num < 1 || num > 3)
+       {
+           notice(s_GameServ, u, "Invalid Choice!");
+           notice(s_GameServ, u, "Here is a list of what we have to offer:");
+           notice(s_GameServ, u, "1. Healing Potions for %ld Gold", 1000 * p->level + (p->exp / 10));
+           notice(s_GameServ, u, "2. Strength Potions for %ld Gold", 2050 * p->level + (p->exp / 10));
+           notice(s_GameServ, u, "3. Defense Potions for %ld Gold", 2000 * p->level + (p->exp / 10));
+           notice(s_GameServ, u, "To buy a potion, type /msg %S TAVERN BUY #");
+           notice(s_GameServ, u, "Example: /msg %S TAVERN BUY 1 buys a healing potion!");
+       }
+       switch(num)
+       {
+           case 1:
+               price = (1000 * p->level) + (p->exp / 10);
+               if (p->gold >= price)
+               {
+                   notice(s_GameServ, u, "One healing potion coming right up!");
+                   p->inventory.incHealing();
+               } 
+               else
+                   notice(s_GameServ, u, "You don't have enough gold!");
+               break;
+           case 2:
+               price = (2050 * p->level) + (p->exp / 10);
+               if (p->gold >= price)
+               {
+                   notice(s_GameServ, u, "One strength boost coming right up!");
+                   p->inventory.incStrength();
+               }
+               else
+                   notice(s_GameServ, u, "You don't have enough gold!");
+               break;
+           case 3:
+               price = (2000 * p->level) + (p->exp / 10);
+               if (p->gold >= price)
+               {
+                   notice(s_GameServ, u, "One defense boost coming right up!");
+                   p->inventory.incDefense();
+               }
+               else
+                   notice(s_GameServ, u, "You don't have enough gold!");
+               break;
+           default:
+               notice(s_GameServ, u, "Logical Error. See a %S admin for help!");
+               break;
+       }
+    }
+}
+
 void do_bank(char *u)
 {
     char *cmd = strtok(NULL, " ");
index fc72d2b48f739eacfcdd816c34264f9c294f51f9..d62be33768de488fb67771772111a17d174f6da9 100644 (file)
@@ -16,5 +16,6 @@ Here are the basic commands available to everyone:
     \ 2SEARCH\ 2          \1fSearch the forest for a monster to kill\1f
     \ 2STATS\ 2           \1fGet a stats listing of you or another player in the realm\1f
     \ 2STORE\ 2           \1fBuy and Sell weapons and armor\1f
+    \ 2TAVERN\ 2          \1fBuy and Sell Potions\1f
 
 Further help on individual commands can be accessed by typing /msg %S \ 2HELP\ 2 \ 2\1fcommand\1f\ 2
diff --git a/gameserv/helpfiles/tavern b/gameserv/helpfiles/tavern
new file mode 100644 (file)
index 0000000..6d898b7
--- /dev/null
@@ -0,0 +1,9 @@
+This command allows you to buy potions from Boot Liquors Mystical Apothecary.
+The potions can be used throughout the game for things such as strength
+boosts and healing.
+
+To get a more detailed instruction and a funny intro, type /msg %S TAVERN alone.
+SYNTAX: \ 2TAVERN\ 2 [LIST | BUY {NUMBER}]
+Example: /msg %S \ 2TAVERN\ 2
+Example: /msg %S \ 2TAVERN\ 2 \ 2\1flist\1f\ 2
+Example: /msg %S \ 2TAVERN\ 2 \ 2\1fbuy\1f\ 2 \ 21\ 2