]> jfr.im git - irc/gameservirc.git/blobdiff - gameserv/gameserv.cpp
Added a new forest event (finding potions) 2% chance 20% chance for each potion after...
[irc/gameservirc.git] / gameserv / gameserv.cpp
index 5d9b56b1b5f7e8c61e91ca57d04cfd3de6695da2..fbe8ded0ad05bed0f1798580d369fb22f9aaf822 100644 (file)
@@ -579,6 +579,8 @@ char *strtok(char *str, const char *delim)
 void do_list(char *u)
 {
     aClient *user;
+    char *cmd = strtok(NULL, " ");
+
     if (!(user = find(u)))
     {
        log("Fatal Error: Couldn't find %s in the client list", u);
@@ -594,25 +596,29 @@ void do_list(char *u)
 
     ListNode<aClient> *temp;
     bool header = false;
+
   for (unsigned long x = 0; x < U_TABLE_SIZE; x++)
   {
     temp = players[x].First();
     if (!players[x].isEmpty())
     {
-       if (!header)
-       {
-           notice(s_GameServ, u, "People Playing:");
-           header = true;
-       }
        while(temp)
        {
-           #ifdef P10
-           notice(s_GameServ, u, "IRC: %s     Game: %s", temp->getData()->getRealNick(), 
-                  temp->getData()->stats->name);
-           #else
-           notice(s_GameServ, u, "IRC: %s     Game: %s", temp->getData()->getNick(), 
-                  temp->getData()->stats->name);
-           #endif
+           if (!cmd || is_playing(temp->getData()))
+           {
+               if (!header)
+               {
+                   notice(s_GameServ, u, "Players:");
+                   header = true;
+               }
+               #ifdef P10
+               notice(s_GameServ, u, "IRC: %s     Game: %s", temp->getData()->getRealNick(), 
+                       temp->getData()->stats->name);
+               #else
+               notice(s_GameServ, u, "IRC: %s     Game: %s", temp->getData()->getNick(), 
+                       temp->getData()->stats->name);
+               #endif
+           }
 
            temp = temp->Next();
        }
@@ -2733,17 +2739,17 @@ void do_dragon(char *u)
        notice(s_GameServ, u, "You're dead. Wait until tomorrow to see your master!");
        return;
     }
-    else if (user->stats->level < 12)
+    else if (user->stats->level < REALLEVELS)
     {
        notice(s_GameServ, u, "You fool! Only those strong enough "\
                "to vanquish any foe should DARE fight the dragon!");
        notice(s_GameServ, u, "To put it in terms you can understand: "\
-               "You are too weak. You must be Level 12!");
+               "You are too weak. You must be Level %d!", REALLEVELS);
+       return;
     }
 
     updateTS(user->stats);
 
-    char *cmd = strtok(NULL, " ");
     Player *p = user->stats;
     p->fight = new Monster(boss);
     notice(s_GameServ, u, "You approach the dragon's lair cautiously.");
@@ -2751,7 +2757,7 @@ void do_dragon(char *u)
        "deep, red fog rolls in. The air is filled with the "\
        "heated mist of deadly fire from beyond the cave "\
        "entrance.");
-    notice(s_GameServ, u, "You adjust your %s, tighten your grip on "\ 
+    notice(s_GameServ, u, "You adjust your %s, tighten your grip on "\
        "your %s, and venture into the hot, dark cave. "\
        "You are surprised at the angle of descent as you climb "\
        "lower and lower, deeper into the dragon's den.");
@@ -2762,7 +2768,7 @@ void do_dragon(char *u)
     notice(s_GameServ, u, "Just then you notice the eye begin to "\
        "glare orange! The tooth is moving... but it is still too "\
        "dark for you to make out.... THE DRAGON! You see it!");
-    display_monsters(u);
+    display_monster(u);
 }
 
 void do_master(char *u)
@@ -2847,9 +2853,10 @@ void do_master(char *u)
            case 11:
                need = 20000000;
                break;
-           case 12:
+
+           case REALLEVELS:
                need = p->exp + 1;
-               notice(s_GameServ, u, "You are at level 12. You are the master. What's left? The DRAGON!");
+               notice(s_GameServ, u, "You are at level %d. You are the master. What's left? The DRAGON!", REALLEVELS);
                return;
                break;
            default: