# 1 "/home/gameserv/gameserv//"
aClient.o: aClient.cpp aClient.h options.h player.h extern.h level.h \
- list.h listnode.h config.h
+ list.h listnode.h config.h item.h
# 1 "/home/gameserv/gameserv//"
config.o: config.cpp extern.h player.h level.h list.h listnode.h \
- aClient.h options.h config.h flags.h
+ aClient.h options.h config.h item.h flags.h
# 1 "/home/gameserv/gameserv//"
c_forest.o: c_forest.cpp sockhelp.h aClient.h options.h player.h list.h \
- listnode.h extern.h level.h config.h flags.h
+ listnode.h extern.h level.h config.h item.h flags.h
# 1 "/home/gameserv/gameserv//"
do_attack.o: do_attack.cpp aClient.h options.h player.h extern.h level.h \
- list.h listnode.h config.h flags.h item.h
+ list.h listnode.h config.h item.h flags.h
# 1 "/home/gameserv/gameserv//"
gameserv.o: gameserv.cpp aClient.h options.h player.h config.h extern.h \
- level.h list.h listnode.h pouch.h flags.h sockhelp.h item.h
+ level.h list.h listnode.h item.h pouch.h flags.h sockhelp.h
# 1 "/home/gameserv/gameserv//"
hash.o: hash.cpp extern.h player.h level.h list.h listnode.h aClient.h \
- options.h config.h
+ options.h config.h item.h
# 1 "/home/gameserv/gameserv//"
item.o: item.cpp item.h level.h list.h listnode.h aClient.h options.h \
player.h extern.h config.h
player.h extern.h config.h
# 1 "/home/gameserv/gameserv//"
log.o: log.cpp extern.h player.h level.h list.h listnode.h aClient.h \
- options.h config.h
+ options.h config.h item.h
# 1 "/home/gameserv/gameserv//"
news.o: news.cpp extern.h player.h level.h list.h listnode.h aClient.h \
- options.h config.h
+ options.h config.h item.h
# 1 "/home/gameserv/gameserv//"
pouch.o: pouch.cpp extern.h player.h level.h list.h listnode.h aClient.h \
- options.h config.h pouch.h item.h
+ options.h config.h item.h pouch.h
# 1 "/home/gameserv/gameserv//"
player.o: player.cpp item.h level.h list.h listnode.h aClient.h options.h \
player.h pouch.h extern.h config.h flags.h
# 1 "/home/gameserv/gameserv//"
sockhelp.o: sockhelp.cpp sockhelp.h extern.h player.h level.h list.h \
- listnode.h aClient.h options.h config.h
+ listnode.h aClient.h options.h config.h item.h
# 1 "/home/gameserv/gameserv//"
tcpclient.o: tcpclient.cpp sockhelp.h options.h list.h listnode.h \
- aClient.h player.h extern.h level.h config.h flags.h
+ aClient.h player.h extern.h level.h config.h item.h flags.h
# 1 "/home/gameserv/gameserv//"
devel.o: devel.cpp options.h list.h listnode.h aClient.h player.h \
- extern.h level.h config.h flags.h item.h pouch.h
+ extern.h level.h config.h item.h flags.h pouch.h
-#include "sockhelp.h"
#include "aClient.h"
-#include "list.h"
+#include <cctype>
#include "extern.h"
#include "flags.h"
-#include <cctype>
+#include "item.h"
+#include "list.h"
+#include "pouch.h"
+#include "sockhelp.h"
void do_forest(char *u);
Monster *getNewMonster(Monster *m);
notice(s_GameServ, u, "You search the forest for something to kill...");
- // 88% of forest searching turns up a monster
- if (eventnum >= 12)
+ // 89% of forest searching turns up a monster
+ if (eventnum >= 11)
{
p->fight = new Monster(levels[p->level - 1].randomMonster());
notice(s_GameServ, u, "You have found \ 2%s\ 2!", p->fight->name.c_str());
p->master = NULL; // Just to make sure
display_monster(u);
}
- /*
- else if (eventnum < 12 && eventnum >= 10) // 2% for finding potions
+ else if (eventnum < 11 && eventnum >= 10) // 1% for finding potions
{
+ list<tavernItem>::iterator temp_tavernitem;
+
notice(s_GameServ, u, "Fortune smiles upon thee!");
- eventnum = 1 + rand() % 4;
- switch(eventnum)
- {
- case 1:
- notice(s_GameServ, u,
- "You have found an HP Potion!");
- p->inventory.incHP();
- break;
- case 2:
- notice(s_GameServ, u,
- "You have found a Strength Potion!");
- p->inventory.incStrength();
- break;
- case 3:
- notice(s_GameServ, u,
- "You have found a Defense Potion!");
- p->inventory.incDefense();
- break;
- case 4:
- notice(s_GameServ, u,
- "You have found a Healing Potion!");
- p->inventory.incHealing();
- break;
- }
+ eventnum = rand() % tavern.size();
+ temp_tavernitem = tavern.begin();
+ for (int x = 0;x < eventnum;x++)
+ {
+ temp_tavernitem++;
+ }
+ notice(s_GameServ, u, "You have found a %s", (*temp_tavernitem).getItem()->getName().c_str());
+ p->inventory->addItem((*temp_tavernitem).getItem());
}
- */
else if (eventnum < 10 && eventnum >= 5) // 5% for the fountain
{
if (p->hp < p->maxhp)