]> jfr.im git - irc/gameservirc.git/commitdiff
Added a couple timeout events
authorkainazzzo <redacted>
Mon, 26 Apr 2004 04:47:20 +0000 (04:47 +0000)
committerkainazzzo <redacted>
Mon, 26 Apr 2004 04:47:20 +0000 (04:47 +0000)
git-svn-id: https://svn.code.sf.net/p/gameservirc/code/trunk@177 bc333340-6410-0410-a689-9d09f3c113fa

gameserv/Changes
gameserv/gameserv.cpp
gameserv/tcpclient.cpp

index 0eec12252aa7a7ea55a78beb4010a25753f32b5c..53cf46350b45a75de649052a4325e44998e85eef 100644 (file)
@@ -1,3 +1,6 @@
+Version 1.2.2
+* Added a few timeout events if you're not in a fight - kain
+
 Version 1.2.1
 * Included a crontab script in all new distros now - kain
 * Added a new flag that tells wether a person is playing instead of
index dedff6306d0821a1f6f8365246237b5be081c3a2..99d3c5efdc53f9a9e9c7c447c724e981c22a91f0 100644 (file)
@@ -2990,13 +2990,14 @@ void timeOutEvent(Player *p)
     {
        // Place fun stuff here :)
        int randnum = 1 + rand() % 100; // 1-100
+       #define GSN(s) notice(s_GameServ, nick, s)
+       #define GSN2(s, f) notice(s_GameServ, nick, s, f)
 
         if (randnum < 50)
         {
-           #define GSN(s) notice(s_GameServ, nick, s)
-           #define GSN2(s, f) notice(s_GameServ, nick, s, f)
-           int stolen = ((35 + rand() % 66)/100) * user->stats->gold;
-
+           // 35-100% of your gold goes pffft - kain
+           int stolen = (35 + (rand() % 66)) * user->stats->gold / 100;
+           
            GSN("You stop for a moment to rest on the "\
             "street corner. All of a sudden, you "\
             "are ambushed from all sides by a hoarde "\
@@ -3005,6 +3006,26 @@ void timeOutEvent(Player *p)
            "and steal %d gold from you!", stolen);
            user->stats->gold -= stolen;
        }
+       else if (randnum >= 50 && randnum < 75)
+       {
+           // 25-65% of your gold goes pffft - kain
+           int stolen = (25 + (rand() % 41)) * user->stats->gold / 100;
+           GSN("While dilly dallying around, you lose "\
+           "your sense of time. Little did you know, "\
+           "but thieves lifted your gold while you "\
+           "weren't watching.");
+           GSN2("Better luck next time... you lose %d gold", stolen);
+           user->stats->gold -= stolen;
+       }
+       else if (randnum >= 75)
+       {
+           // 25-75% of your gold goes pffft - kain
+           int stolen = (25 + (rand() % 51)) * user->stats->gold / 100;
+           GSN("Good grief! A gaggle of gooey green ghostlike "\
+               "goblins grabbed your gold!");
+           GSN2("They stole %d gold from you!", stolen);
+           user->stats->gold -= stolen;
+       }
 
 
        // Always log out the user
index 5aa65b3320b829135167730ab8ab6b54e3c1edf4..9530fca66a39a503cacc21dc132e84ac5f182835 100644 (file)
@@ -37,7 +37,7 @@ using std::cerr;
 using std::endl;
 
 char *PACKAGE = "GameServ";
-char *VERSION = "1.2.0 +devel";
+char *VERSION = "1.2.1 +devel";
 
 int sock;
 int day;
@@ -366,10 +366,10 @@ int main(int argc, char *argv[])
            }
       #if defined(P10)
        } else if (stricmp(cmd, "Q") == 0) {
-           unsigned long hv = sHASH((unsigned char *) source);
+//         unsigned long hv = sHASH((unsigned char *) source);
       #else
        } else if (stricmp(cmd, "QUIT") == 0) {
-           unsigned long hv = iHASH((unsigned char *) source);
+//         unsigned long hv = iHASH((unsigned char *) source);
       #endif
            aClient *quitter;
            char z = source[0];