2019-09-13 19:34:03 +00:00
|
|
|
// Taco Overrides Script
|
|
|
|
|
//
|
|
|
|
|
// Various Overrides
|
2019-02-04 22:50:31 +00:00
|
|
|
//
|
|
|
|
|
|
2020-07-26 18:41:21 +00:00
|
|
|
// Global water viscosity
|
|
|
|
|
$globalviscosity = 3;
|
|
|
|
|
|
2019-02-04 22:50:31 +00:00
|
|
|
package TacoOverrides
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
//Issue with the start grenade throw was very soft and bumped it up a tad
|
|
|
|
|
function serverCmdEndThrowCount(%client, %data)
|
|
|
|
|
{
|
|
|
|
|
if(%client.player.throwStart == 5)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
// ---------------------------------------------------------------
|
|
|
|
|
// z0dd - ZOD, 8/6/02. New throw str features
|
|
|
|
|
%throwStrength = (getSimTime() - %client.player.throwStart) / 150;
|
2021-01-04 18:01:00 +00:00
|
|
|
if(%throwStrength > $maxThrowStr)
|
|
|
|
|
%throwStrength = $maxThrowStr;
|
2019-02-04 22:50:31 +00:00
|
|
|
else if(%throwStrength < 0.5)
|
|
|
|
|
%throwStrength = 0.5;
|
|
|
|
|
// ---------------------------------------------------------------
|
2021-01-04 18:01:00 +00:00
|
|
|
|
2019-02-04 22:50:31 +00:00
|
|
|
%throwScale = %throwStrength / 2;
|
|
|
|
|
%client.player.throwStrength = %throwScale;
|
|
|
|
|
|
2021-04-13 16:31:23 +00:00
|
|
|
%client.player.throwStart = 2; //was 0
|
2019-02-04 22:50:31 +00:00
|
|
|
}
|
|
|
|
|
|
2019-02-13 19:54:13 +00:00
|
|
|
//Tank UE code by Keen
|
|
|
|
|
//To fix tank UE by transporting the tank far away so nothing bumps into it causing a UE
|
|
|
|
|
function VehicleData::onDestroyed(%data, %obj, %prevState)
|
|
|
|
|
{
|
|
|
|
|
if(%obj.lastDamagedBy)
|
|
|
|
|
{
|
|
|
|
|
%destroyer = %obj.lastDamagedBy;
|
|
|
|
|
game.vehicleDestroyed(%obj, %destroyer);
|
|
|
|
|
//error("vehicleDestroyed( "@ %obj @", "@ %destroyer @")");
|
|
|
|
|
}
|
2021-01-04 18:01:00 +00:00
|
|
|
|
2019-02-13 19:54:13 +00:00
|
|
|
radiusVehicleExplosion(%data, %obj);
|
2021-01-04 18:01:00 +00:00
|
|
|
|
2019-02-13 19:54:13 +00:00
|
|
|
if(%obj.turretObject)
|
|
|
|
|
if(%obj.turretObject.getControllingClient())
|
|
|
|
|
%obj.turretObject.getDataBlock().playerDismount(%obj.turretObject);
|
2021-01-04 18:01:00 +00:00
|
|
|
|
2019-02-13 19:54:13 +00:00
|
|
|
for(%i = 0; %i < %obj.getDatablock().numMountPoints; %i++)
|
|
|
|
|
{
|
|
|
|
|
if (%obj.getMountNodeObject(%i)) {
|
|
|
|
|
%flingee = %obj.getMountNodeObject(%i);
|
|
|
|
|
%flingee.getDataBlock().doDismount(%flingee, true);
|
|
|
|
|
%xVel = 250.0 - (getRandom() * 500.0);
|
|
|
|
|
%yVel = 250.0 - (getRandom() * 500.0);
|
|
|
|
|
%zVel = (getRandom() * 100.0) + 50.0;
|
|
|
|
|
%flingVel = %xVel @ " " @ %yVel @ " " @ %zVel;
|
|
|
|
|
%flingee.applyImpulse(%flingee.getTransform(), %flingVel);
|
|
|
|
|
echo("got player..." @ %flingee.getClassName());
|
2021-01-04 18:01:00 +00:00
|
|
|
%flingee.damage(0, %obj.getPosition(), 0.4, $DamageType::Crash);
|
2019-02-13 19:54:13 +00:00
|
|
|
}
|
|
|
|
|
}
|
2021-01-04 18:01:00 +00:00
|
|
|
|
2019-02-23 22:11:39 +00:00
|
|
|
// From AntiLou.vl2
|
|
|
|
|
// Info: MPB just destroyed. Change the variable
|
|
|
|
|
if(%data.getName() $= "MobileBaseVehicle") // If the vehicle is the MPB, change %obj.station.isDestroyed to 1
|
|
|
|
|
%obj.station.isDestroyed = 1;
|
2019-02-13 19:54:13 +00:00
|
|
|
|
|
|
|
|
%data.deleteAllMounted(%obj);
|
|
|
|
|
// -----------------------------------------------------------------------------------------
|
|
|
|
|
// z0dd - ZOD - Czar, 6/24/02. Move this vehicle out of the way so nothing collides with it.
|
2019-03-23 16:52:04 +00:00
|
|
|
if(%data.getName() $="AssaultVehicle")
|
2019-02-13 19:54:13 +00:00
|
|
|
{
|
2019-02-23 22:11:39 +00:00
|
|
|
// %obj.setFrozenState(true);
|
2019-04-07 20:13:18 +00:00
|
|
|
%obj.schedule(500, "delete"); //was 2000
|
2019-02-13 19:54:13 +00:00
|
|
|
//%data.schedule(500, 'onAvoidCollisions', %obj);
|
2021-01-04 18:01:00 +00:00
|
|
|
|
2019-02-23 22:11:39 +00:00
|
|
|
//Transfer the vehicle far away
|
2025-01-25 19:58:19 +00:00
|
|
|
%obj.schedule(128, "setPosition", vectorAdd(%obj.getPosition(), "40 -27 10000")); //Lowered: was 500
|
2019-03-23 16:52:04 +00:00
|
|
|
}
|
|
|
|
|
else if(%data.getName() $="BomberFlyer" || %data.getName() $="MobileBaseVehicle")
|
|
|
|
|
{
|
|
|
|
|
// %obj.setFrozenState(true);
|
|
|
|
|
%obj.schedule(2000, "delete"); //was 2000
|
|
|
|
|
//%data.schedule(500, 'onAvoidCollisions', %obj);
|
2021-01-04 18:01:00 +00:00
|
|
|
|
2019-03-23 16:52:04 +00:00
|
|
|
//Transfer the vehicle far away
|
2025-01-25 19:58:19 +00:00
|
|
|
%obj.schedule(128, "setPosition", vectorAdd(%obj.getPosition(), "40 -27 10000")); //Lowered: was 500
|
2019-02-13 19:54:13 +00:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2021-01-04 18:01:00 +00:00
|
|
|
%obj.setFrozenState(true);
|
2019-03-23 16:52:04 +00:00
|
|
|
%obj.schedule(500, "delete"); //was 500
|
2019-02-13 19:54:13 +00:00
|
|
|
}
|
|
|
|
|
// -----------------------------------------------------------------------------------------
|
|
|
|
|
}
|
|
|
|
|
|
2020-04-07 00:45:09 +00:00
|
|
|
// stationTrigger::onEnterTrigger(%data, %obj, %colObj)
|
|
|
|
|
// Info: If the MPB is destroyed, don't allow players to use the inv
|
2021-01-04 18:01:00 +00:00
|
|
|
function stationTrigger::onEnterTrigger(%data, %obj, %colObj)
|
2020-04-07 00:45:09 +00:00
|
|
|
{
|
|
|
|
|
//make sure it's a player object, and that that object is still alive
|
|
|
|
|
if(%colObj.getDataBlock().className !$= "Armor" || %colObj.getState() $= "Dead")
|
|
|
|
|
return;
|
|
|
|
|
|
2021-01-04 18:01:00 +00:00
|
|
|
// z0dd - ZOD, 7/13/02 Part of hack to keep people from mounting
|
2020-04-07 00:45:09 +00:00
|
|
|
// vehicles in disallowed armors.
|
|
|
|
|
if(%obj.station.getDataBlock().getName() !$= "StationVehicle")
|
|
|
|
|
%colObj.client.inInv = true;
|
|
|
|
|
|
|
|
|
|
%colObj.inStation = true;
|
|
|
|
|
commandToClient(%colObj.client,'setStationKeys', true);
|
|
|
|
|
if(Game.stationOnEnterTrigger(%data, %obj, %colObj))
|
|
|
|
|
{
|
|
|
|
|
//verify station.team is team associated and isn't on player's team
|
|
|
|
|
if((%obj.mainObj.team != %colObj.client.team) && (%obj.mainObj.team != 0))
|
|
|
|
|
{
|
|
|
|
|
//%obj.station.playAudio(2, StationAccessDeniedSound);
|
|
|
|
|
messageClient(%colObj.client, 'msgStationDenied', '\c2Access Denied -- Wrong team.~wfx/powered/station_denied.wav');
|
|
|
|
|
}
|
|
|
|
|
else if(%obj.disableObj.isDisabled())
|
|
|
|
|
{
|
|
|
|
|
messageClient(%colObj.client, 'msgStationDisabled', '\c2Station is disabled.');
|
|
|
|
|
}
|
|
|
|
|
else if(!%obj.mainObj.isPowered())
|
|
|
|
|
{
|
|
|
|
|
messageClient(%colObj.client, 'msgStationNoPower', '\c2Station is not powered.');
|
|
|
|
|
}
|
|
|
|
|
else if(%obj.station.notDeployed)
|
|
|
|
|
{
|
|
|
|
|
messageClient(%colObj.client, 'msgStationNotDeployed', '\c2Station is not deployed.');
|
|
|
|
|
}
|
|
|
|
|
else if(%obj.station.isDestroyed)
|
|
|
|
|
{
|
|
|
|
|
messageClient(%colObj.client, 'msgStationDestroyed', '\c2Station is destroyed.');
|
|
|
|
|
}
|
|
|
|
|
else if(%obj.station.triggeredBy $= "")
|
|
|
|
|
{
|
|
|
|
|
if(%obj.station.getDataBlock().setPlayersPosition(%obj.station, %obj, %colObj))
|
|
|
|
|
{
|
|
|
|
|
messageClient(%colObj.client, 'CloseHud', "", 'inventoryScreen');
|
|
|
|
|
commandToClient(%colObj.client, 'TogglePlayHuds', true);
|
|
|
|
|
%obj.station.triggeredBy = %colObj;
|
|
|
|
|
%obj.station.getDataBlock().stationTriggered(%obj.station, 1);
|
|
|
|
|
%colObj.station = %obj.station;
|
|
|
|
|
%colObj.lastWeapon = ( %colObj.getMountedImage($WeaponSlot) == 0 ) ? "" : %colObj.getMountedImage($WeaponSlot).item;
|
|
|
|
|
%colObj.unmountImage($WeaponSlot);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2019-04-07 20:13:18 +00:00
|
|
|
//OG Blaster Buff
|
2021-04-08 14:26:42 +00:00
|
|
|
function Armor::damageObject(%data, %targetObject, %sourceObject, %position, %amount, %damageType, %momVec, %mineSC)
|
|
|
|
|
{
|
2021-04-13 16:31:23 +00:00
|
|
|
//Takes 11 blaster shots to kill a heavy, 13 normal.
|
2022-05-03 20:58:03 +00:00
|
|
|
if(%targetObject.client.armor $= "Heavy" && %damageType $= $DamageType::Blaster && !$Host::TournamentMode) //Free-for-all only
|
2021-04-13 16:31:23 +00:00
|
|
|
%amount *= 1.15;
|
2021-01-04 18:01:00 +00:00
|
|
|
|
2021-04-08 14:26:42 +00:00
|
|
|
Parent::damageObject(%data, %targetObject, %sourceObject, %position, %amount, %damageType, %momVec, %mineSC);
|
|
|
|
|
}
|
2019-04-07 20:13:18 +00:00
|
|
|
|
2020-07-26 18:41:21 +00:00
|
|
|
// Global water viscosity
|
|
|
|
|
function DefaultGame::missionLoadDone(%game)
|
|
|
|
|
{
|
|
|
|
|
parent::missionLoadDone(%game);
|
2021-01-04 18:01:00 +00:00
|
|
|
|
2021-03-27 20:07:10 +00:00
|
|
|
InitContainerRadiusSearch("0 0 0", 2048, $TypeMasks::WaterObjectType);
|
|
|
|
|
while ((%itemObj = containerSearchNext()) != 0)
|
2020-07-26 18:41:21 +00:00
|
|
|
{
|
2021-03-27 20:07:10 +00:00
|
|
|
if(%itemObj.getClassName() $= "WaterBlock")
|
|
|
|
|
%itemObj.viscosity = $globalviscosity;
|
2020-09-13 23:25:37 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Temp Fix for Asset nameTag Strings
|
|
|
|
|
function GameBaseData::onAdd(%data, %obj)
|
|
|
|
|
{
|
|
|
|
|
if(%data.targetTypeTag !$= "")
|
|
|
|
|
{
|
|
|
|
|
// use the name given to the object in the mission file
|
2020-09-14 17:28:15 +00:00
|
|
|
if(%obj.nameTag !$= "" && strpos(%obj.nameTag,"\x01") == -1)
|
|
|
|
|
{
|
|
|
|
|
%obj.nameTag = addTaggedString(%obj.nameTag);
|
|
|
|
|
%nameTag = %obj.nameTag;
|
|
|
|
|
}
|
|
|
|
|
else if(%data.targetNameTag !$= "")
|
2020-09-13 23:25:37 +00:00
|
|
|
%nameTag = %data.targetNameTag;
|
2020-09-14 17:28:15 +00:00
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if(%obj.name !$= "")
|
|
|
|
|
%nameTag = %obj.nameTag = addTaggedString(%obj.name);
|
2021-01-04 18:01:00 +00:00
|
|
|
else
|
2020-09-14 17:28:15 +00:00
|
|
|
%nameTag = %obj.nameTag = addTaggedString("Base"); // fail safe so it shows up on cc
|
|
|
|
|
}
|
2020-09-13 23:25:37 +00:00
|
|
|
%obj.target = createTarget(%obj, %nameTag, "", "", %data.targetTypeTag, 0, 0);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
%obj.target = -1;
|
2020-07-26 18:41:21 +00:00
|
|
|
}
|
|
|
|
|
|
2020-11-29 16:30:18 +00:00
|
|
|
// Throw Spam fix
|
|
|
|
|
function serverCmdThrow(%client, %data)
|
|
|
|
|
{
|
2021-01-04 18:14:22 +00:00
|
|
|
if(%client.tossLock)
|
|
|
|
|
{
|
|
|
|
|
if(getSimTime() - %client.tossLockTime < 30000)
|
|
|
|
|
return;
|
|
|
|
|
else
|
|
|
|
|
%client.tossLock = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(getSimTime() - %client.tossTime < 128)
|
2021-01-05 18:13:19 +00:00
|
|
|
{
|
2021-01-04 18:14:22 +00:00
|
|
|
%client.tossCounter++;
|
|
|
|
|
if(%client.tossCounter > 30)
|
2021-01-04 18:01:00 +00:00
|
|
|
{
|
2021-01-04 18:14:22 +00:00
|
|
|
if(%client.tossLockWarning)
|
|
|
|
|
{
|
|
|
|
|
echo(%client.nameBase SPC "was Banned for exceeding" SPC %client.tossCounter SPC "Toss Limit.");
|
|
|
|
|
messageAll('msgAll',"\c3" @ %client.namebase SPC "is attempting to lag the server!");
|
|
|
|
|
messageClient(%client, 'onClientBanned', "");
|
|
|
|
|
messageAllExcept( %client, -1, 'MsgClientDrop', "", %client.name, %client );
|
|
|
|
|
if(isObject(%client.player))
|
|
|
|
|
%client.player.scriptKill(0);
|
|
|
|
|
if (isObject(%client))
|
|
|
|
|
{
|
|
|
|
|
%client.setDisconnectReason("Item Spew scripts are not allowed on this server." );
|
|
|
|
|
%client.schedule(700, "delete");
|
|
|
|
|
}
|
|
|
|
|
BanList::add(%client.guid, %client.getAddress(), $Host::BanTime);
|
|
|
|
|
}
|
2021-01-04 18:01:00 +00:00
|
|
|
else
|
2021-01-04 18:14:22 +00:00
|
|
|
{
|
|
|
|
|
echo(%client.nameBase SPC "throwing items has been temporarily suspended for exceeding" SPC %client.tossCounter SPC "throw limit.");
|
|
|
|
|
centerprint(%client, "You are recieving this warning for throw spamming items.\nContinuing to use throw spew scripts will result in a ban.", 10, 2);
|
|
|
|
|
messageClient(%client, '', "Throwing items has been temporarily suspended.");
|
|
|
|
|
%client.tossLockTime = getSimTime();
|
|
|
|
|
%client.tossLockWarning = 1;
|
|
|
|
|
}
|
2021-01-04 18:23:39 +00:00
|
|
|
%client.tossLock = 1;
|
|
|
|
|
return;
|
2021-01-04 18:01:00 +00:00
|
|
|
}
|
2021-01-05 18:13:19 +00:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
%client.tossCounter = 0;
|
2021-01-04 18:01:00 +00:00
|
|
|
|
2021-01-05 18:13:19 +00:00
|
|
|
parent::serverCmdThrow(%client, %data);
|
|
|
|
|
%client.tossTime = getSimTime();
|
2020-11-29 16:30:18 +00:00
|
|
|
}
|
|
|
|
|
|
2021-02-09 16:13:08 +00:00
|
|
|
//Vehicle Respawn bug fix - Respawn schedules carrying into map changes
|
|
|
|
|
function VehicleData::respawn(%data, %marker)
|
|
|
|
|
{
|
|
|
|
|
if($MatchStarted + $missionRunning == 2 && isObject(%marker))
|
|
|
|
|
{
|
|
|
|
|
%mask = $TypeMasks::PlayerObjectType | $TypeMasks::VehicleObjectType | $TypeMasks::TurretObjectType;
|
|
|
|
|
InitContainerRadiusSearch(%marker.getWorldBoxCenter(), %data.checkRadius, %mask);
|
2021-03-27 20:07:10 +00:00
|
|
|
if(containerSearchNext() == 0)
|
2021-02-09 16:13:08 +00:00
|
|
|
{
|
|
|
|
|
%newObj = %data.create(%marker.curTeam, %marker);
|
|
|
|
|
%newObj.startFade(1000, 0, false);
|
|
|
|
|
%newObj.setTransform(%marker.getTransform());
|
|
|
|
|
|
|
|
|
|
setTargetSensorGroup(%newObj.target, %newObj.team);
|
|
|
|
|
MissionCleanup.add(%newObj);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
%marker.schedule = %data.schedule(3000, "respawn", %marker);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function VehicleData::createPositionMarker(%data, %obj)
|
|
|
|
|
{
|
|
|
|
|
%marker = new Trigger(PosMarker)
|
|
|
|
|
{
|
|
|
|
|
dataBlock = markerTrigger;
|
|
|
|
|
mountable = %obj.mountable;
|
|
|
|
|
disableMove = %obj.disableMove;
|
|
|
|
|
resetPos = %obj.resetPos;
|
|
|
|
|
data = %obj.getDataBlock().getName();
|
|
|
|
|
deployed = %obj.deployed;
|
|
|
|
|
curTeam = %obj.team;
|
|
|
|
|
respawnTime = %obj.respawnTime;
|
2021-03-27 20:07:10 +00:00
|
|
|
};
|
2021-02-09 16:13:08 +00:00
|
|
|
%marker.setTransform(%obj.getTransform());
|
|
|
|
|
MissionCleanup.add(%marker);
|
|
|
|
|
return %marker;
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-13 16:31:23 +00:00
|
|
|
//Conc Throw (Almost Normal Grenades) 1500 Normal
|
2023-01-14 21:21:23 +00:00
|
|
|
// function ConcussionGrenadeThrown::onThrow(%this, %gren)
|
|
|
|
|
// {
|
|
|
|
|
// AIGrenadeThrown(%gren);
|
|
|
|
|
// %gren.detThread = schedule(1800, %gren, "detonateGrenade", %gren); // Was 2000
|
|
|
|
|
// }
|
2021-04-13 16:31:23 +00:00
|
|
|
|
2022-05-21 18:04:09 +00:00
|
|
|
//Attack LOS Sky Fix
|
|
|
|
|
function serverCmdSendTaskToClient(%client, %targetClient, %fromCmdMap)
|
|
|
|
|
{
|
2022-05-22 15:26:14 +00:00
|
|
|
%obj = getTargetObject(%client.getTargetId());
|
|
|
|
|
if(isObject(%obj))
|
|
|
|
|
{
|
|
|
|
|
if(%obj.getClassName() $= "Player" && !%client.player.ccActive)
|
|
|
|
|
{
|
|
|
|
|
%vec = %client.player.getMuzzleVector(0);
|
|
|
|
|
%vec2 = vectorNormalize(vectorSub(%obj.getWorldBoxCenter(), %client.player.getMuzzlePoint(%slot)));
|
|
|
|
|
%dot = vectorDot(%vec, %vec2);
|
|
|
|
|
if(%dot < 0.9)
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-05-21 18:04:09 +00:00
|
|
|
|
2022-05-22 15:26:14 +00:00
|
|
|
parent::serverCmdSendTaskToClient(%client, %targetClient, %fromCmdMap);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function serverCmdScopeCommanderMap(%client, %scope)
|
|
|
|
|
{
|
|
|
|
|
parent::serverCmdScopeCommanderMap(%client, %scope);
|
|
|
|
|
%client.player.ccActive = %scope;
|
2022-05-21 18:04:09 +00:00
|
|
|
}
|
|
|
|
|
|
2022-05-30 16:51:04 +00:00
|
|
|
//Mortar Throw Reload Fix
|
2023-03-04 22:36:39 +00:00
|
|
|
// function ShapeBase::throwWeapon(%this)
|
|
|
|
|
// {
|
|
|
|
|
// if((%this.getMountedImage($WeaponSlot).getName() $= "MortarImage" || %this.getMountedImage($WeaponSlot).getName() $= "MissileLauncherImage" || %this.getMountedImage($WeaponSlot).getName() $= "ShockLanceImage") &&
|
|
|
|
|
// (%this.getImageState($WeaponSlot) $= "Reload" || %this.getImageState($WeaponSlot) $= "Fire")){
|
|
|
|
|
// return;
|
|
|
|
|
// }
|
2022-05-30 16:51:04 +00:00
|
|
|
|
2023-03-04 22:36:39 +00:00
|
|
|
// parent::throwWeapon(%this);
|
|
|
|
|
// }
|
2022-05-30 16:51:04 +00:00
|
|
|
|
2022-12-24 18:48:33 +00:00
|
|
|
|
|
|
|
|
// Added object check
|
|
|
|
|
function VehicleData::damageObject(%data, %targetObject, %sourceObject, %position, %amount, %damageType, %momVec, %theClient, %proj)
|
|
|
|
|
{
|
|
|
|
|
if(%proj !$= "")
|
|
|
|
|
{
|
|
|
|
|
if(%amount > 0 && %targetObject.lastDamageProj !$= %proj)
|
|
|
|
|
{
|
|
|
|
|
%targetObject.lastDamageProj = %proj;
|
|
|
|
|
%targetObject.lastDamageAmount = %amount;
|
|
|
|
|
}
|
|
|
|
|
else if(%targetObject.lastDamageAmount < %amount)
|
|
|
|
|
%amount = %amount - %targetObject.lastDamageAmount;
|
|
|
|
|
else
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// check for team damage
|
|
|
|
|
//%sourceClient = %sourceObject ? %sourceObject.getOwnerClient() : 0;
|
|
|
|
|
%sourceClient = isObject(%sourceObject) ? %sourceObject.getOwnerClient() : 0; //Object Check
|
|
|
|
|
%targetTeam = getTargetSensorGroup(%targetObject.getTarget());
|
|
|
|
|
|
|
|
|
|
if(%sourceClient)
|
|
|
|
|
%sourceTeam = %sourceClient.getSensorGroup();
|
|
|
|
|
else if(isObject(%sourceObject) && %sourceObject.getClassName() $= "Turret")
|
|
|
|
|
{
|
|
|
|
|
%sourceTeam = getTargetSensorGroup(%sourceObject.getTarget());
|
|
|
|
|
%sourceClient = %sourceObject.getControllingClient(); // z0dd - ZOD, 6/10/02. Play a sound to client when they hit a vehicle with a controlled turret
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
%sourceTeam = %sourceObject ? getTargetSensorGroup(%sourceObject.getTarget()) : -1;
|
|
|
|
|
// Client is allready defined and this spams console - ZOD
|
|
|
|
|
//%sourceClient = %sourceObject.getControllingClient(); // z0dd - ZOD, 6/10/02. Play a sound to client when they hit a vehicle from a vehicle
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// vehicles no longer obey team damage -JR
|
|
|
|
|
// if(!$teamDamage && (%targetTeam == %sourceTeam) && %targetObject.getDamagePercent() > 0.5)
|
|
|
|
|
// return;
|
|
|
|
|
//but we do want to track the destroyer
|
|
|
|
|
if(%sourceObject)
|
|
|
|
|
{
|
|
|
|
|
%targetObject.lastDamagedBy = %sourceObject;
|
|
|
|
|
%targetObject.lastDamageType = %damageType;
|
|
|
|
|
}
|
2023-01-14 21:21:23 +00:00
|
|
|
else
|
2022-12-24 18:48:33 +00:00
|
|
|
%targetObject.lastDamagedBy = 0;
|
|
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------------
|
|
|
|
|
// z0dd - ZOD, 6/10/02. Play a sound to client when they hit a vehicle
|
|
|
|
|
if(%sourceClient && %sourceClient.vehicleHitSound)
|
|
|
|
|
{
|
|
|
|
|
if(%targetTeam != %sourceTeam)
|
|
|
|
|
{
|
|
|
|
|
if ((%damageType > 0 && %damageType < 11) ||
|
|
|
|
|
(%damageType == 13) ||
|
|
|
|
|
(%damageType > 15 && %damageType < 24) ||
|
|
|
|
|
(%damageType > 25 && %damageType < 32))
|
|
|
|
|
{
|
|
|
|
|
messageClient(%sourceClient, 'MsgClientHit', %sourceClient.vehicleHitWav);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// ----------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
// Scale damage type & include shield calculations...
|
|
|
|
|
if (%data.isShielded)
|
|
|
|
|
%amount = %data.checkShields(%targetObject, %position, %amount, %damageType);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%damageScale = %data.damageScale[%damageType];
|
|
|
|
|
if(%damageScale !$= "")
|
|
|
|
|
%amount *= %damageScale;
|
2023-01-14 21:21:23 +00:00
|
|
|
|
2022-12-24 18:48:33 +00:00
|
|
|
if(%amount != 0)
|
|
|
|
|
%targetObject.applyDamage(%amount);
|
2023-01-14 21:21:23 +00:00
|
|
|
|
2022-12-24 18:48:33 +00:00
|
|
|
if(%targetObject.getDamageState() $= "Destroyed" )
|
|
|
|
|
{
|
|
|
|
|
if( %momVec !$= "")
|
|
|
|
|
%targetObject.setMomentumVector(%momVec);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2019-02-04 22:50:31 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// Prevent package from being activated if it is already
|
|
|
|
|
if (!isActivePackage(TacoOverrides))
|
2021-01-04 18:01:00 +00:00
|
|
|
activatePackage(TacoOverrides);
|
2022-07-19 11:56:19 +00:00
|
|
|
|
|
|
|
|
//Flag explosion fix
|
2022-08-03 10:30:07 +00:00
|
|
|
// function Item::applyImpulse(%this, %position, %impulseVec)
|
|
|
|
|
// {
|
|
|
|
|
// %data = %this.getDatablock();
|
|
|
|
|
// %x = getWord(%impulseVec, 0) / %data.mass;
|
|
|
|
|
// %y = getWord(%impulseVec, 1) / %data.mass;
|
|
|
|
|
// %z = getWord(%impulseVec, 2) / %data.mass;
|
|
|
|
|
// %vel = %x SPC %y SPC %z;
|
|
|
|
|
// %this.setVelocity(vectorAdd(%this.getVelocity(), %vel));
|
|
|
|
|
// }
|