]> jfr.im git - irc/gameservirc.git/blobdiff - gameserv/c_forest.cpp
Added a help file for the set command
[irc/gameservirc.git] / gameserv / c_forest.cpp
index b72586d090ea1a3ca6a5e21f11503a0b3c63c8e2..86ddcb46df07a77040b36cd205f9b07d6597b90c 100644 (file)
@@ -73,7 +73,7 @@ void do_forest(char *u)
            if (eventnum >= 12)
            {
                p->fight = new Monster(levels[p->level - 1].randomMonster());
-               notice(s_GameServ, u, "You have found \ 2%s\ 2!", p->fight->name.getString());
+               notice(s_GameServ, u, "You have found \ 2%s\ 2!", p->fight->name.c_str());
                if (p->fight->hp < p->fight->maxhp)
                    p->fight->hp = p->fight->maxhp;
 
@@ -85,30 +85,29 @@ void do_forest(char *u)
            {
                notice(s_GameServ, u, "Fortune smiles upon thee!");
 
-               eventnum = 1 + rand() % 4000;
-               if (eventnum < 1000)
+               eventnum = 1 + rand() % 4;
+               switch(eventnum)
                {
-                   notice(s_GameServ, u,
+                   case 1:
+                       notice(s_GameServ, u,
                        "You have found an HP Potion!");
-                   p->inventory.incHP();
-               }
-               else if (eventnum < 2000)
-               {       
-                   notice(s_GameServ, u,
+                       p->inventory.incHP();
+                       break;
+                   case 2:
+                       notice(s_GameServ, u,
                        "You have found a Strength Potion!");
-                   p->inventory.incStrength();
-               }
-               else if (eventnum < 3000)
-               {
-                   notice(s_GameServ, u,
+                       p->inventory.incStrength();
+                       break;
+                   case 3:
+                       notice(s_GameServ, u,
                        "You have found a Defense Potion!");
-                   p->inventory.incDefense();
-               }
-               else
-               {
-                   notice(s_GameServ, u,
+                       p->inventory.incDefense();
+                       break;
+                   case 4:
+                       notice(s_GameServ, u,
                        "You have found a Healing Potion!");
-                   p->inventory.incHealing();
+                       p->inventory.incHealing();
+                       break;
                }
            }
            else if (eventnum < 10 && eventnum >= 5) // 5% for the fountain
@@ -150,13 +149,13 @@ void do_forest(char *u)
                }
                else if (eventnum < 3)
                {
-                   newstats = (rand() % 1000) * (p->level + (rand() % 10));
+                   newstats = levels[p->level - 1].getStrength().random();
                    notice(s_GameServ, u, "A SACK WITH %ld GOLD!", newstats);
                    p->gold += newstats;
                }
                else
                {
-                   newstats = (rand() % 100) * (p->level + rand() % 10);
+                   newstats = levels[p->level - 1].getExp().random();
                    notice(s_GameServ, u, "Time seems to stand still for a moment.");
                    notice(s_GameServ, u, " %ld EXTRA EXPERIENCE POINTS", newstats);
                    p->exp += newstats;
@@ -178,7 +177,6 @@ Monster *getNewMonster(Monster *m)
 
     Monster *newguy;
     newguy = new Monster;
-
     newguy->name = m->name;
     newguy->weapon = m->weapon;
     newguy->death = m->death;