diff --git a/README.md b/README.md index 555da87f..ff135169 100644 --- a/README.md +++ b/README.md @@ -415,6 +415,7 @@ * Meleeing enemy players that are prone pushes 16.67% of the amount when standing * Meleeing enemy players that are already stunned will push them * Ballistic knife projectile pushes enemy players +* Claymores are no longer triggered by enemy players * Stun fx is linked to the player * Stun fx shows in the correct position for projectiles * Stunning enemy players steals 100 points from them diff --git a/scripts/zm/_zm_reimagined.gsc b/scripts/zm/_zm_reimagined.gsc index 7df104c6..1687ba64 100644 --- a/scripts/zm/_zm_reimagined.gsc +++ b/scripts/zm/_zm_reimagined.gsc @@ -19,6 +19,7 @@ #include scripts/zm/replaced/_zm_equipment; #include scripts/zm/replaced/_zm_spawner; #include scripts/zm/replaced/_zm_ai_basic; +#include scripts/zm/replaced/_zm_weap_claymore; main() { @@ -59,6 +60,7 @@ main() replaceFunc(maps/mp/zombies/_zm_equipment::placed_equipment_think, scripts/zm/replaced/_zm_equipment::placed_equipment_think); replaceFunc(maps/mp/zombies/_zm_spawner::head_should_gib, scripts/zm/replaced/_zm_spawner::head_should_gib); replaceFunc(maps/mp/zombies/_zm_ai_basic::inert_wakeup, scripts/zm/replaced/_zm_ai_basic::inert_wakeup); + replaceFunc(maps/mp/zombies/_zm_weap_claymore::claymore_detonation, scripts/zm/replaced/_zm_weap_claymore::claymore_detonation); } init() diff --git a/scripts/zm/replaced/_zm_weap_claymore.gsc b/scripts/zm/replaced/_zm_weap_claymore.gsc new file mode 100644 index 00000000..b36bbf82 --- /dev/null +++ b/scripts/zm/replaced/_zm_weap_claymore.gsc @@ -0,0 +1,60 @@ +#include maps\mp\_utility; +#include common_scripts\utility; +#include maps\mp\zombies\_zm_utility; +#include maps/mp/zombies/_zm_weap_claymore; + +claymore_detonation() +{ + self endon( "death" ); + self waittill_not_moving(); + detonateradius = 96; + damagearea = spawn( "trigger_radius", self.origin + ( 0, 0, 0 - detonateradius ), 4, detonateradius, detonateradius * 2 ); + damagearea setexcludeteamfortrigger( self.team ); + damagearea enablelinkto(); + damagearea linkto( self ); + if ( is_true( self.isonbus ) ) + { + damagearea setmovingplatformenabled( 1 ); + } + self.damagearea = damagearea; + self thread delete_claymores_on_death( self.owner, damagearea ); + self.owner.claymores[ self.owner.claymores.size ] = self; + while ( 1 ) + { + damagearea waittill( "trigger", ent ); + if ( isDefined( self.owner ) && ent == self.owner ) + { + continue; + } + if ( isDefined( ent.pers ) && isDefined( ent.pers[ "team" ] ) && ent.pers[ "team" ] == self.team ) + { + continue; + } + if ( isDefined( ent.pers ) && isDefined( ent.pers[ "team" ] ) && ent.pers[ "team" ] == getOtherTeam( self.team ) ) + { + continue; + } + if ( isDefined( ent.ignore_claymore ) && ent.ignore_claymore ) + { + continue; + } + if ( !ent shouldaffectweaponobject( self ) ) + { + continue; + } + if ( ent damageconetrace( self.origin, self ) > 0 ) + { + self playsound( "wpn_claymore_alert" ); + wait 0.4; + if ( isDefined( self.owner ) ) + { + self detonate( self.owner ); + } + else + { + self detonate( undefined ); + } + return; + } + } +} \ No newline at end of file