## 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) g_peaceAndLove was causing a crash when damage was inflicted by the environment... also modified the parameters slightly g_peaceAndLove : bitflag to disable all damage from weapons. 1 - disable damage 2 - print a message (g_peaceMsg) to the inflictor 4 - play a sound (g_peaceSnd) to the inflictor (needs g_tyranny enabled) 8 - issue a warning after g_peaceDmg damage inflicted (needs shrubbot enabled), if g_peaceDmg <=50, it will behave as if g_peaceDmg was 51 16 - reflect inflicted damage 32 - instagib inflictor (flag 16 has priority over this one, so g_peaceAndLove 48 has the same effect as g_peaceAndLove 16) g_peaceMsg : see g_peaceAndLove, default "^1Cease fire ! Cease Fire !" g_peaceSnd : see g_peaceAndLove, default "sound/chat/allies/26b.wav" ("Hold your fire" sound from etmain) g_peaceDmg : see g_peaceAndLove, default 300 ------------------------- MODIFICATION STARTS HERE src\game\g_combat.c (line 2031) **** REPLACE // do the damage if( take ) { if(g_peaceAndLove.integer>0 && targ->s.eType == ET_PLAYER && targ->client) { if(!(g_peaceAndLove.integer & PCR_PEACE_NODMG)) targ->health -= take; if(g_peaceAndLove.integer & PCR_PEACE_WARN && g_peaceDmg.integer>50 && g_shrubbot.string[0]) { if(attacker->client->sess.damage_given > g_peaceDmg.integer) { trap_SendConsoleCommand(EXEC_APPEND, va("!warn %i g_peaceAndLove : ^1cease fire now\n", attacker->s.number)); attacker->client->sess.damage_given=0; attacker->client->lastPCRPeace_action=level.time+2000; } } if(attacker->client->lastPCRPeace_actions.number, va("cp \"%s\"",g_peaceMsg.string)); // see #define CPx(x, y) trap_SendServerCommand(x, y) if(g_peaceAndLove.integer & PCR_PEACE_SND && g_tyranny.integer>0 && g_peaceSnd.string[0]) { //G_AddEvent(attacker, EV_GENERAL_SOUND, G_SoundIndex(g_peaceSnd.string)); //G_Printf("playing sound to %i - %i\n", attacker->s.number, attacker->s.teamNum); trap_SendConsoleCommand(EXEC_APPEND, va("playsound %i %s", attacker->s.number, g_peaceSnd.string)); } attacker->client->lastPCRPeace_action=level.time+2000; } if(g_peaceAndLove.integer & PCR_PEACE_REFLECT) { attacker->health -= take; if (attacker->health <=0){ attacker->deathType = MOD_REFLECTED_FF; if (attacker->die){ attacker->enemy = attacker; attacker->die(attacker, attacker, attacker, take, MOD_REFLECTED_FF); } } } if(g_peaceAndLove.integer & PCR_PEACE_GIB && g_tyranny.integer>0 && g_shrubbot.string[0]) { //trap_SendConsoleCommand(EXEC_APPEND, va("!gib %i\n", attacker->s.number)); attacker->health = GIB_HEALTH - 1; AP(va("cpm \"%s ^7was gibbed for breaking ROE.\"", attacker->client->pers.netname)); limbo(attacker, qtrue); } } else targ->health -= take; **** WITH // do the damage if( take ) { if(g_peaceAndLove.integer>0 && targ->s.eType == ET_PLAYER && targ->client && attacker->s.eType == ET_PLAYER && attacker->client) { if(!(g_peaceAndLove.integer & PCR_PEACE_NODMG)) targ->health -= take; if(g_peaceAndLove.integer & PCR_PEACE_WARN && g_shrubbot.string[0]) { if(attacker->client->sess.damage_given > g_peaceDmg.integer && attacker->client->sess.damage_given > 50) { trap_SendConsoleCommand(EXEC_APPEND, va("!warn %i g_peaceAndLove : ^1cease fire now\n", attacker->s.number)); attacker->client->sess.damage_given=0; attacker->client->lastPCRPeace_action=level.time+2000; } } if(attacker->client->lastPCRPeace_actions.number, va("cp \"%s\"",g_peaceMsg.string)); // see #define CPx(x, y) trap_SendServerCommand(x, y) if(g_peaceAndLove.integer & PCR_PEACE_SND && g_tyranny.integer>0 && g_peaceSnd.string[0]) { //G_AddEvent(attacker, EV_GENERAL_SOUND, G_SoundIndex(g_peaceSnd.string)); //G_Printf("playing sound to %i - %i\n", attacker->s.number, attacker->s.teamNum); trap_SendConsoleCommand(EXEC_APPEND, va("playsound %i %s", attacker->s.number, g_peaceSnd.string)); } attacker->client->lastPCRPeace_action=level.time+2000; } if(g_peaceAndLove.integer & PCR_PEACE_REFLECT) { attacker->health -= take; if (attacker->health <=0){ attacker->deathType = MOD_REFLECTED_FF; if (attacker->die){ attacker->enemy = attacker; attacker->die(attacker, attacker, attacker, take, MOD_REFLECTED_FF); } } } else if(g_peaceAndLove.integer & PCR_PEACE_GIB && attacker->health>0) { //trap_SendConsoleCommand(EXEC_APPEND, va("!gib %i\n", attacker->s.number)); attacker->health = GIB_HEALTH - 1; AP(va("cpm \"%s ^9was gibbed for ^hROE violation^9.\"", attacker->client->pers.netname)); limbo(attacker, qtrue); } } else targ->health -= take;