diff --git a/README.md b/README.md index f92fac52..0e52defc 100644 --- a/README.md +++ b/README.md @@ -146,10 +146,11 @@ ### Ballistic Knife * Added model and anims from Black Ops 2 Multiplayer * Increased melee time from 0.5 seconds to 0.7 seconds -* Projectiles are no longer picked up by other players +* Projectiles are no longer destroyed when other players walk over them +* Projectiles are no longer destroyed when purchasing a melee wallbuy +* Projectiles get destroyed by lava * Projectiles can be picked up while the weapon is not reloaded * Projectiles can be picked up while the player is not on the ground -* Projectiles get destroyed by lava ### Chicom CQB * Unupgraded: decreased clip ammo from 40 to 36 diff --git a/scripts/zm/_zm_reimagined.gsc b/scripts/zm/_zm_reimagined.gsc index 19b0104e..ed0e3c0c 100644 --- a/scripts/zm/_zm_reimagined.gsc +++ b/scripts/zm/_zm_reimagined.gsc @@ -111,6 +111,7 @@ main() replaceFunc(maps\mp\zombies\_zm_melee_weapon::give_melee_weapon, scripts\zm\replaced\_zm_melee_weapon::give_melee_weapon); replaceFunc(maps\mp\zombies\_zm_weap_ballistic_knife::init, scripts\zm\replaced\_zm_weap_ballistic_knife::init); replaceFunc(maps\mp\zombies\_zm_weap_ballistic_knife::watch_use_trigger, scripts\zm\replaced\_zm_weap_ballistic_knife::watch_use_trigger); + replaceFunc(maps\mp\zombies\_zm_weap_ballistic_knife::pick_up, scripts\zm\replaced\_zm_weap_ballistic_knife::pick_up); replaceFunc(maps\mp\zombies\_zm_weap_claymore::claymore_detonation, scripts\zm\replaced\_zm_weap_claymore::claymore_detonation); replaceFunc(maps\mp\zombies\_zm_weap_claymore::claymore_setup, scripts\zm\replaced\_zm_weap_claymore::claymore_setup); replaceFunc(maps\mp\zombies\_zm_weap_cymbal_monkey::player_handle_cymbal_monkey, scripts\zm\replaced\_zm_weap_cymbal_monkey::player_handle_cymbal_monkey); diff --git a/scripts/zm/replaced/_zm_melee_weapon.gsc b/scripts/zm/replaced/_zm_melee_weapon.gsc index 871da140..bf0fc19c 100644 --- a/scripts/zm/replaced/_zm_melee_weapon.gsc +++ b/scripts/zm/replaced/_zm_melee_weapon.gsc @@ -129,7 +129,6 @@ change_melee_weapon(weapon_name, current_weapon) old_ballistic = primary_weapon; ballistic_ammo_clip = self getWeaponAmmoClip(primary_weapon); ballistic_ammo_stock = self getWeaponAmmoStock(primary_weapon); - self notify("zmb_lost_knife"); self takeweapon(primary_weapon); unacquire_weapon_toggle(primary_weapon); @@ -167,7 +166,8 @@ change_melee_weapon(weapon_name, current_weapon) self giveweapon(new_ballistic, 0); } - self giveMaxAmmo(new_ballistic); + self setweaponammoclip(new_ballistic, ballistic_ammo_clip); + self setweaponammostock(new_ballistic, ballistic_ammo_stock); self seteverhadweaponall(1); } diff --git a/scripts/zm/replaced/_zm_weap_ballistic_knife.gsc b/scripts/zm/replaced/_zm_weap_ballistic_knife.gsc index 0ef33873..334957d2 100644 --- a/scripts/zm/replaced/_zm_weap_ballistic_knife.gsc +++ b/scripts/zm/replaced/_zm_weap_ballistic_knife.gsc @@ -141,4 +141,44 @@ watch_use_trigger(trigger, model, callback, weapon, playersoundonuse, npcsoundon player thread [[callback]](weapon, model, trigger); return; } +} + +pick_up( weapon, model, trigger ) +{ + if (!self hasweapon(weapon)) + { + foreach (primary in self getweaponslistprimaries()) + { + if (issubstr(primary, "knife_ballistic")) + { + weapon = primary; + break; + } + } + } + + current_weapon = self getcurrentweapon(); + + if ( current_weapon != weapon ) + { + clip_ammo = self getweaponammoclip( weapon ); + + if ( !clip_ammo ) + self setweaponammoclip( weapon, 1 ); + else + { + new_ammo_stock = self getweaponammostock( weapon ) + 1; + self setweaponammostock( weapon, new_ammo_stock ); + } + } + else + { + new_ammo_stock = self getweaponammostock( weapon ) + 1; + self setweaponammostock( weapon, new_ammo_stock ); + } + + self maps\mp\zombies\_zm_stats::increment_client_stat( "ballistic_knives_pickedup" ); + self maps\mp\zombies\_zm_stats::increment_player_stat( "ballistic_knives_pickedup" ); + model destroy_ent(); + trigger destroy_ent(); } \ No newline at end of file