p->master = NULL; // Just to make sure
display_monster(u);
}
- else if (eventnum < 12 && eventnum >= 5) // 7% for the fountain
+ else if (eventnum < 12 && eventnum >= 10) // 2% for finding potions
+ {
+ 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;
+ }
+ }
+ else if (eventnum < 10 && eventnum >= 5) // 5% for the fountain
{
if (p->hp < p->maxhp)
{
notice(s_GameServ, u, "Too bad you're broke. Guess you won't be having any wishes answered today.");
return;
}
+ long newstats;
notice(s_GameServ, u, "You throw one of your gold pieces into the well and it vanishes into a puff of white smoke.");
notice(s_GameServ, u, "In an instant, the puff of smoke materializes into a gnome.");
notice(s_GameServ, u, "The gnome is holding something in his hand motioning for you to come closer.");
// 2% for each wishing well chance except for forest fights
if (eventnum < 1) // forest fights
{
- notice(s_GameServ, u, "EXTRA FOREST FIGHTS!!");
- p->forest_fights += (rand() % 11) + 5;
+ newstats = (rand() % 11) + 5;
+ notice(s_GameServ, u, "%ld EXTRA FOREST FIGHTS!!",
+ newstats);
+ p->forest_fights += newstats;
}
else if (eventnum < 3)
{
- notice(s_GameServ, u, "A SACK OF GOLD!");
- p->gold += (rand() % 1000) * (p->level + (rand() % 10));
+ newstats = (rand() % 1000) * (p->level + (rand() % 10));
+ notice(s_GameServ, u, "A SACK WITH %ld GOLD!", newstats);
+ p->gold += newstats;
}
else
{
+ newstats = (rand() % 100) * (p->level + rand() % 10);
notice(s_GameServ, u, "Time seems to stand still for a moment.");
- notice(s_GameServ, u, "EXTRA EXPERIENCE POINTS");
- p->exp += (rand() % 100) * (p->level + rand() % 10);
+ notice(s_GameServ, u, " %ld EXTRA EXPERIENCE POINTS", newstats);
+ p->exp += newstats;
}
}
}