function smmPlay3d(%sound, %pos) {
	%count = ClientGroup.getCount();
	for (%i = 0; %i < %count; %i++) {
		%client = ClientGroup.getObject(%i);

		if (%client != %this.client || %client != %sourceObject.client) {
			%client.play3D(%sound, %pos);
		}
	}
}

GunProjectile.specialDamageType = "bullet";
automaticPistolProjectile.specialDamageType = "bullet";
automaticRifleProjectile.specialDamageType = "bullet";
carbineSMGProjectile.specialDamageType = "bullet";
assaultRifleProjectile.specialDamageType = "bullet";
combatRifleProjectile.specialDamageType = "bullet";
servicePistolProjectile.specialDamageType = "bullet";
serviceRifleProjectile.specialDamageType = "bullet";
sniperRifleProjectile.specialDamageType = "bullet";
revolverProjectile.specialDamageType = "bullet";
gamePistolProjectile.specialDamageType = "bullet";
doubleShotgunProjectile.specialDamageType = "bullet";
fieldRifleProjectile.specialDamageType = "bullet";
huntingMagnumProjectile.specialDamageType = "bullet";
huntingRifleProjectile.specialDamageType = "bullet";
huntingShotgunProjectile.specialDamageType = "bullet";
leverRifleProjectile.specialDamageType = "bullet";
leverShotgunProjectile.specialDamageType = "bullet";
machinePistolProjectile.specialDamageType = "bullet";
marksmanRifleProjectile.specialDamageType = "bullet";
pairedShotgunProjectile.specialDamageType = "bullet";
riotShotgunProjectile.specialDamageType = "bullet";
singleShotgunProjectile.specialDamageType = "bullet";

meleeCaneImage.specialDamageType = "blunt";
meleeKnifeImage.specialDamageType = "sharp";
meleePanImage.specialDamageType = "blunt";
meleeUmbrellaImage.specialDamageType = "blunt";
meleeWrenchImage.specialDamageType = "blunt";
meleeCaneImage.specialDamageType = "blunt";

package ReplacePackage {
	function Player::playPain(%this) {
		if (%this.client.smmGender) {
			%sound = FemalePainSound @ getRandom(1, 4);
		}
		else {
			%sound = MalePainSound @ getRandom(1, 4);
		}

		if (isObject(%sound)) {
			serverPlay3D(%sound, %this.getHackPosition());
		}
	}

	function Player::playDeathCry(%this) {
		if (%this.lastDamageType == $DamageType::Fall)
		{
			return;
		}

		if (%this.client.smmGender) {
			%sound = FemaleDeathSound @ getRandom(1, 4);
		}
		else {
			%sound = MaleDeathSound @ getRandom(1, 4);
		}

		if (isObject(%sound)) {
			serverPlay3D(%sound, %this.getHackPosition());
		}
	}

	function JumpSound::onAdd(%this) {
		Parent::onAdd(%this);
		%this.fileName = $SMM::Path @ "res/sounds/jump.wav";
	}

	function TaserProjectile::damage(%this, %obj, %col, %fade, %pos, %normal) {
		%client = %col.client;
		%col.specialDamageType = "taser";
		Parent::damage(%this, %obj, %col, %fade, %pos, %normal);

		if (isObject(%client.corpse) && !%client.corpse.isUnconscious) {
			%client.corpse.isUnconscious = true;
			%client.corpse.corpseDamageLevel = 0;

			%client.corpse.reviveCorpseTimer(45);
		}
	}
	function automaticPistolImage::onFire(%this, %obj, %slot) {
		parent::onFire(%this, %obj, %slot);
		smmPlay3d(smmGunDistantSound1, %obj.getMuzzlePoint(0));
	}
	function automaticRifleImage::onFire(%this, %obj, %slot) {
		parent::onFire(%this, %obj, %slot);
		smmPlay3d(smmGunDistantSound1, %obj.getMuzzlePoint(0));
	}
	function carbineSMGImage::onFire(%this, %obj, %slot) {
		parent::onFire(%this, %obj, %slot);
		smmPlay3d(smmGunDistantSound1, %obj.getMuzzlePoint(0));
	}
	function assaultRifleImage::onFire(%this, %obj, %slot) {
		parent::onFire(%this, %obj, %slot);
		smmPlay3d(smmGunDistantSound1, %obj.getMuzzlePoint(0));
	}
	function combatRifleImage::onFire(%this, %obj, %slot) {
		parent::onFire(%this, %obj, %slot);
		smmPlay3d(smmGunDistantSound1, %obj.getMuzzlePoint(0));
	}
	function servicePistolImage::onFire(%this, %obj, %slot) {
		parent::onFire(%this, %obj, %slot);
		smmPlay3d(smmGunDistantSound1, %obj.getMuzzlePoint(0));
	}
	function serviceRifleImage::onFire(%this, %obj, %slot) {
		parent::onFire(%this, %obj, %slot);
		smmPlay3d(smmGunDistantSound1, %obj.getMuzzlePoint(0));
	}
	function sniperRifleImage::onFire(%this, %obj, %slot) {
		parent::onFire(%this, %obj, %slot);
		smmPlay3d(smmGunDistantSound1, %obj.getMuzzlePoint(0));
	}
	function revolverImage::onFire(%this, %obj, %slot) {
		parent::onFire(%this, %obj, %slot);
		smmPlay3d(smmGunDistantSound1, %obj.getMuzzlePoint(0));
	}
	function gamePistolImage::onFire(%this, %obj, %slot) {
		parent::onFire(%this, %obj, %slot);
		smmPlay3d(smmGunDistantSound1, %obj.getMuzzlePoint(0));
	}
	function sniperRifleImage::onFire(%this, %obj, %slot) {
		parent::onFire(%this, %obj, %slot);
		smmPlay3d(smmGunDistantSound1, %obj.getMuzzlePoint(0));
	}
};

activatePackage("ReplacePackage");