that way the game has a point no matter how many monsters
are done!
-- Idle time events - mobbed by the goblin gang (timestamp on each
- player, periodic checks (config file entry), if (time(NULL) -
- player->idlesince >= maxidletime) then (event())
+- Idle time events - mobbed by the goblin gang
+ X (timestamp on each player, periodic checks (config file entry),
+ X if (time(NULL) - player->idlesince >= maxidletime) then (event())
* Random forest quotes when you search the forest
* Add admin version of the logout command which allows them to logout
anyone
+
* Rejoin the bot if kicked/killed
* Notice on database updates
}
}
else if (!player_fight(user))
+ {
+ // Place fun stuff here :)
+ int randnum = 1 + rand() % 100; // 1-100
+
+ 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;
+
+ 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 "\
+ "of knife wielding thugs.");
+ GSN2("The thugs beat you into utter submission "\
+ "and steal %d gold from you!", stolen);
+ user->stats->gold -= stolen;
+ }
+
+
+ // Always log out the user
logout(user);
+ }
}
void do_reset(char *u)
{
int port;
long int lport;
- struct servent *serv;
char *errpos;
- /* First try to read it from /etc/services */
- serv = getservbyname(service, proto);
- if (serv != NULL)
- port = serv->s_port;
- else { /* Not in services, maybe a number? */
lport = strtol(service,&errpos,0);
if ( (errpos[0] != 0) || (lport < 1) || (lport > 65535) )
return -1; /* Invalid port address */
+
port = htons(lport);
- }
+
return port;
}
perror("Could not turn into a daemon");
exit(2);
}
-
init_masters();
load_gs_dbase();