## ETPub PCR alpha hacks (etpub_pcr_ah) ## (C) 2006-2007 PatheticCockroach.com ## This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 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) Added more stuff to the side logbox (g_noobtips flag 2)... We'll have to change the cvar name some day too... About killing messages : g_obituary HAS TO be set to 1 for the messages to be displayed in the side logbox ------------------------- MODIFICATION STARTS HERE src\cgame\bg_public.h (line 134) **** REPLACE // PatheticCockroach - personal logbox #define PCRBOX_MINE_ARMING 1 #define PCRBOX_MINE_ARMED 2 #define PCRBOX_MINE_DEFUSING 3 #define PCRBOX_MINE_DEFUSED 4 #define PCRBOX_TRIPMINE_DEFUSING 5 #define PCRBOX_DYNO_NOARM 10 #define PCRBOX_DYNO_ARMING 11 #define PCRBOX_DYNO_ARMED 12 #define PCRBOX_DYNO_DEFUSING 13 #define PCRBOX_CONSTRUCTING 20 #define PCRBOX_SATCHEL_DISARMING 25 #define PCRBOX_SATCHEL_DISARMED 26 #define PCRBOX_SS_LOST 30 **** WITH // PatheticCockroach - personal logbox #define PCRBOX_MINE_ARMING 1 #define PCRBOX_MINE_ARMED 2 #define PCRBOX_MINE_DEFUSING 3 #define PCRBOX_MINE_DEFUSED 4 #define PCRBOX_MINE_NOARM 5 #define PCRBOX_TRIPMINE_DEFUSING 6 #define PCRBOX_DYNO_NOARM 10 #define PCRBOX_DYNO_ARMING 11 #define PCRBOX_DYNO_ARMED 12 #define PCRBOX_DYNO_DEFUSING 13 #define PCRBOX_DYNO_SET 14 #define PCRBOX_CONSTRUCTING 20 #define PCRBOX_SATCHEL_DISARMING 25 #define PCRBOX_SATCHEL_DISARMED 26 #define PCRBOX_SS_LOST 30 #define PCRBOX_FIRST_AIDING 31 #define PCRBOX_REVIVED_BY 32 #define PCRBOX_REVIVED_SB 33 #define PCRBOX_SWITCH_CLASS 34 src\game\g_cmds.c (line 4476) **** REPLACE if(traceEnt->firstAidHealing == 0) { CPx(ent->s.number, "cp \"Performing first aid\" 1"); } **** WITH if(traceEnt->firstAidHealing == 0) { G_PCRLogoBoxPrint(ent->s.number, PCRBOX_FIRST_AIDING); //CPx(ent->s.number, "cp \"Performing first aid\" 1"); } (line 4330) **** REPLACE if(BODY_VALUE(deadguy) == 0) { CPx(stealer->s.number, "cp \"Switching Classes\" 1"); } **** WITH if(BODY_VALUE(deadguy) == 0) { G_PCRLogoBoxPrint(stealer->s.number, PCRBOX_SWITCH_CLASS); } src\game\g_weapon.c (line 552) **** REPLACE trap_SendServerCommand( traceEnt-g_entities, va("cp \"You have been revived by [lof]%s[lon] [lof]%s!\n\"", ent->client->sess.sessionTeam == TEAM_ALLIES ? rankNames_Allies[ ent->client->sess.rank ] : rankNames_Axis[ ent->client->sess.rank ], ent->client->pers.netname) ); **** WITH if(g_noobTips.integer & NOOBTIPS_SIDED) { trap_SendServerCommand( traceEnt-g_entities, va("pcrc %i \"%s\"", PCRBOX_REVIVED_BY, ent->client->pers.netname) ); // PCR : ...and tell the reviver too trap_SendServerCommand( ent-g_entities, va("pcrc %i \"%s\"", PCRBOX_REVIVED_SB, traceEnt->client->pers.netname) ); } else trap_SendServerCommand( traceEnt-g_entities, va("cp \"You have been revived by [lof]%s[lon] [lof]%s!\n\"", ent->client->sess.sessionTeam == TEAM_ALLIES ? rankNames_Allies[ ent->client->sess.rank ] : rankNames_Axis[ ent->client->sess.rank ], ent->client->pers.netname) ); (line 1746) **** REPLACE trap_SendServerCommand(ent-g_entities, "cp \"Landmine cannot be armed here...\" 1"); **** WITH G_PCRLogoBoxPrint(ent-g_entities, PCRBOX_MINE_NOARM); src\game\g_missile.c (line 1963) **** REPLACE trap_SendServerCommand( self-g_entities, "cp \"Dynamite is set, but NOT armed!\""); **** WITH G_PCRLogoBoxPrint(self-g_entities, PCRBOX_DYNO_SET); src\game\cg_event.c (line 253) **** REPLACE if (message) { message = CG_TranslateString( message ); finalMsg = va("%s %s.", targetName, message); if ( (cg_obituary.integer % 2) == 1 ) { CG_AddToTeamChat( finalMsg, -1 ); CG_Printf("%s\n", finalMsg); } else { CG_AddPMItem( PM_DEATH, finalMsg, deathShader ); } return; } // check for kill messages from the current clientNum if( attacker == cg.snap->ps.clientNum ) { char *s; if ( ci->team == ca->team ) { if (mod == MOD_SWAP_PLACES) { s = va("%s %s", CG_TranslateString( "You swapped places with" ), targetName ); } else { s = va("%s %s", CG_TranslateString( "You killed ^1TEAMMATE^7" ), targetName ); } } else { s = va("%s %s", CG_TranslateString( "You killed" ), targetName ); } CG_PriorityCenterPrint( s, CP_DEFAULTHEIGHT, BIGCHAR_WIDTH * 0.6, 1 ); // print the text message as well } // check for double client messages if ( !ca ) { strcpy( attackerName, "noname" ); } else { Q_strncpyz( attackerName, ca->name, sizeof(attackerName) - 2); strcat( attackerName, S_COLOR_WHITE ); // check for kill messages about the current clientNum if ( target == cg.snap->ps.clientNum ) { Q_strncpyz( cg.killerName, attackerName, sizeof( cg.killerName ) ); } } **** WITH if (message) { message = CG_TranslateString( message ); finalMsg = va("%s %s.", targetName, message); if ( (cg_obituary.integer % 2) == 1 ) { CG_AddToTeamChat( finalMsg, -1 ); CG_Printf("%s\n", finalMsg); } else { CG_AddPMItem( PM_DEATH, finalMsg, deathShader ); } if ( target == cg.snap->ps.clientNum ) CG_FillPCRLogBox("You killed yourself"); return; } // check for kill messages from the current clientNum if( attacker == cg.snap->ps.clientNum ) { char *s; if ( ci->team == ca->team ) { if (mod == MOD_SWAP_PLACES) { s = va("%s %s", CG_TranslateString( "You swapped places with" ), targetName ); } else { s = va("%s %s", CG_TranslateString( "You killed ^1TEAMMATE^7" ), targetName ); } } else { s = va("%s %s", CG_TranslateString( "You killed" ), targetName ); } //CG_PriorityCenterPrint( s, CP_DEFAULTHEIGHT, BIGCHAR_WIDTH * 0.6, 1 ); CG_FillPCRLogBox(s); // print the text message as well } // check for double client messages if ( !ca ) { strcpy( attackerName, "noname" ); } else { Q_strncpyz( attackerName, ca->name, sizeof(attackerName) - 2); strcat( attackerName, S_COLOR_WHITE ); // check for kill messages about the current clientNum if ( target == cg.snap->ps.clientNum ) { Q_strncpyz( cg.killerName, attackerName, sizeof( cg.killerName ) ); } } if( target == cg.snap->ps.clientNum ) { if( !ca ) CG_FillPCRLogBox("You died"); else CG_FillPCRLogBox(va("You were killed by %s", attackerName)); } src\cgame\cg_servercmds.c (line 2474) **** AFTER case PCRBOX_SATCHEL_DISARMED: CG_FillPCRLogBox("Satchel charge disarmed"); break; case PCRBOX_SS_LOST: CG_FillPCRLogBox("You lost your spawn protection"); break; **** ADD case PCRBOX_FIRST_AIDING: CG_FillPCRLogBox("Performing first aid..."); break; case PCRBOX_SWITCH_CLASS: CG_FillPCRLogBox("Switching classes..."); break; case PCRBOX_MINE_NOARM: CG_FillPCRLogBox("Landmine can't be armed here"); break; case PCRBOX_DYNO_SET: CG_FillPCRLogBox("Dynamite placed"); break; (line 2431) **** REPLACE if(args>=3) name=CG_TranslateString(CG_Argv(2)); **** WITH if(args>=3) { name=CG_TranslateString(CG_Argv(2)); switch(cmd) { case PCRBOX_REVIVED_BY: CG_FillPCRLogBox(va("You've been revived by %s",name)); break; case PCRBOX_REVIVED_SB: CG_FillPCRLogBox(va("You revived %s",name)); break; default: CG_FillPCRLogBox("^1ERROR : ^3unknown PCRBOX identifier"); return; } return; } src\game\g_utils.c (line 1408) **** AFTER case PCRBOX_SS_LOST: text="You lost your spawn protection"; break; **** ADD case PCRBOX_FIRST_AIDING: text="Performing first aid..."; break; case PCRBOX_SWITCH_CLASS: text="Switching Classes"; break; case PCRBOX_MINE_NOARM: text="Landmine cannot be armed here..."; break; case PCRBOX_DYNO_SET: text="Dynamite is set, but NOT armed!"; break; ------------------------- PERSONAL NOTES else if( !ca && target == cg.snap->ps.clientNum ) { CG_FillPCRLogBox("You earned a Darwin Award"); }