## ETPub PCR alpha hacks (etpub_pcr_ah) ## (C) 2006-2007 PatheticCockroach.com ## This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 License ## Derivative works may only be done if they are distributed with their source code. ## ## The original etpub_pcr_ah source and binaries can be found around http://www.patheticcockroach.com/etserver/etpub_pcr.php ## ## Note : ETPub PCR alpha hacks are just small modifications for ETPub (http://www.etpub.org) Changed the behavior of !lol !lol : FLAG : x g_tyranny : yes USAGE : !lol [name|slot|all] DESCRIPTION : Grenades drop from a specified player or all players. Works on self if no arg provided. ------------------------- MODIFICATION STARTS HERE src\game\g_shrubbot.c (line 73) **** REPLACE {"lol", G_shrubbot_lol, 'x', SCMDF_TYRANNY, "grenades drop from a specified player or all players", "(^hname|slot#^7)"}, **** WITH {"lol", G_shrubbot_lol, 'x', SCMDF_TYRANNY, "grenades drop from a specified player or all players", "[^3name|slot#|all^7]"}, src\game\g_shrubbot.c (line 3361) **** REPLACE qboolean G_shrubbot_lol(gentity_t *ent, int skiparg) { int pids[MAX_CLIENTS]; char name[MAX_NAME_LENGTH], err[MAX_STRING_CHARS], numNades[4]; gentity_t *vic; qboolean doAll = qfalse; int pcount, nades = 0, count = 0; if(Q_SayArgc() < 2+skiparg) doAll = qtrue; else if(Q_SayArgc() >= 3+skiparg) { Q_SayArgv( 2+skiparg, numNades, sizeof( numNades ) ); nades = atoi( numNades ); if( nades < 1 ) nades = 1; else if( nades > SHRUBBOT_MAX_LOL_NADES ) nades = SHRUBBOT_MAX_LOL_NADES; } Q_SayArgv( 1+skiparg, name, sizeof( name ) ); if( !Q_stricmp( name, "-1" ) || doAll ) { int it; for( it = 0; it < level.numConnectedClients; it++ ) { vic = g_entities + level.sortedClients[it]; if( !_shrubbot_admin_higher(ent, vic) || _shrubbot_immutable(ent, vic) || !(vic->client->sess.sessionTeam == TEAM_AXIS || vic->client->sess.sessionTeam == TEAM_ALLIES)) continue; if( nades ) G_createClusterNade( vic, nades ); else G_createClusterNade( vic, 1 ); count++; } AP(va("chat \"^/lol: ^7%d players lol\'d\" -1", count)); return qtrue; } pcount = ClientNumbersFromString(name, pids); if(pcount > 1) { int it; for( it = 0; it < pcount; it++) { vic = &g_entities[pids[it]]; if(!_shrubbot_admin_higher(ent, vic)) { SPC(va("^/lol: ^7sorry, but %s^7 has a higher " "admin level than you do", vic->client->pers.netname)); continue; } if(_shrubbot_immutable(ent, vic)) { SPC("^/lol: ^7sorry, but your intended victim is immune to shrubbot commands"); continue; } if(!(vic->client->sess.sessionTeam == TEAM_AXIS || vic->client->sess.sessionTeam == TEAM_ALLIES)) { SPC(va("^/lol: ^7%s^7 must be on a " "team to be lol\'d", vic->client->pers.netname)); continue; } if( nades ) G_createClusterNade( vic, nades ); else G_createClusterNade( vic, 8 ); AP(va("chat \"^/lol: ^7%s\" -1", vic->client->pers.netname)); } return qtrue; } else if( pcount < 1 ) { G_MatchOnePlayer(pids, err, sizeof(err)); SPC(va("^/lol: ^7%s", err)); return qfalse; } vic = &g_entities[pids[0]]; if(!_shrubbot_admin_higher(ent, vic)) { SPC("^/lol: ^7sorry, but your intended victim has a higher " "admin level than you do"); return qfalse; } if(_shrubbot_immutable(ent, vic)) { SPC("^/lol: ^7sorry, but your intended victim is immune to shrubbot commands"); return qfalse; } if(!(vic->client->sess.sessionTeam == TEAM_AXIS || vic->client->sess.sessionTeam == TEAM_ALLIES)) { SPC("^/lol: ^7player must be on a team to be lol'd"); return qfalse; } if( nades ) G_createClusterNade( vic, nades ); else G_createClusterNade( vic, 8 ); AP(va("chat \"^/lol: ^7%s\" -1", vic->client->pers.netname)); return qtrue; } **** WITH qboolean G_shrubbot_lol(gentity_t *ent, int skiparg) { int pids[MAX_CLIENTS]; char name[MAX_NAME_LENGTH], err[MAX_STRING_CHARS], numNades[4]; gentity_t *vic; int pcount, nades = 0, count = 0; if(Q_SayArgc() < 2+skiparg) { if(!ent) { SPC("lol: you are on the console"); return qfalse; } vic=ent; } else if(Q_SayArgc() >= 3+skiparg) { Q_SayArgv( 2+skiparg, numNades, sizeof( numNades ) ); nades = atoi( numNades ); if( nades < 1 ) nades = 1; else if( nades > SHRUBBOT_MAX_LOL_NADES ) nades = SHRUBBOT_MAX_LOL_NADES; } Q_SayArgv( 1+skiparg, name, sizeof( name ) ); if( !Q_stricmp( name, "all" ) ) { int it; for( it = 0; it < level.numConnectedClients; it++ ) { vic = g_entities + level.sortedClients[it]; if( !_shrubbot_admin_higher(ent, vic) || _shrubbot_immutable(ent, vic) || !(vic->client->sess.sessionTeam == TEAM_AXIS || vic->client->sess.sessionTeam == TEAM_ALLIES)) continue; if( nades ) G_createClusterNade( vic, nades ); else G_createClusterNade( vic, 1 ); count++; } AP(va("chat \"^/lol: ^7%d players lol\'d\" -1", count)); return qtrue; } pcount = ClientNumbersFromString(name, pids); if(pcount > 1) { int it; for( it = 0; it < pcount; it++) { vic = &g_entities[pids[it]]; if(!_shrubbot_admin_higher(ent, vic)) { SPC(va("^/lol: ^7sorry, but %s^7 has a higher " "admin level than you do", vic->client->pers.netname)); continue; } if(_shrubbot_immutable(ent, vic)) { SPC("^/lol: ^7sorry, but your intended victim is immune to shrubbot commands"); continue; } if(!(vic->client->sess.sessionTeam == TEAM_AXIS || vic->client->sess.sessionTeam == TEAM_ALLIES)) { SPC(va("^/lol: ^7%s^7 must be on a " "team to be lol\'d", vic->client->pers.netname)); continue; } if( nades ) G_createClusterNade( vic, nades ); else G_createClusterNade( vic, 8 ); AP(va("chat \"^/lol: ^7%s\" -1", vic->client->pers.netname)); } return qtrue; } else if( pcount < 1 ) { G_MatchOnePlayer(pids, err, sizeof(err)); SPC(va("^/lol: ^7%s", err)); return qfalse; } vic = &g_entities[pids[0]]; if(!_shrubbot_admin_higher(ent, vic)) { SPC("^/lol: ^7sorry, but your intended victim has a higher " "admin level than you do"); return qfalse; } if(_shrubbot_immutable(ent, vic)) { SPC("^/lol: ^7sorry, but your intended victim is immune to shrubbot commands"); return qfalse; } if(!(vic->client->sess.sessionTeam == TEAM_AXIS || vic->client->sess.sessionTeam == TEAM_ALLIES)) { SPC("^/lol: ^7player must be on a team to be lol'd"); return qfalse; } if( nades ) G_createClusterNade( vic, nades ); else G_createClusterNade( vic, 8 ); AP(va("chat \"^/lol: ^7%s\" -1", vic->client->pers.netname)); return qtrue; }