Initial Commit

This commit is contained in:
Robert Fritzen 2014-02-26 13:54:04 -06:00
commit bd51490b14
316 changed files with 150033 additions and 0 deletions

View file

@ -0,0 +1,226 @@
datablock AudioProfile(PistolFireSound)
{
filename = "fx/vehicles/tank_chaingun.wav";
description = AudioDefault3d;
preload = true;
};
//--------------------------------------------------------------------------
// Projectile
//--------------------------------------------------------------------------
datablock TracerProjectileData(coltBullet) {
doDynamicClientHits = true;
directDamage = 0.15; // z0dd - ZOD, 9-27-02. Was 0.0825
directDamageType = $DamageType::pistol;
explosion = "ChaingunExplosion";
splash = ChaingunSplash;
HeadMultiplier = 1.5;
LegsMultiplier = 0.5;
ImageSource = "PistolImage";
kickBackStrength = 5.0;
sound = ChaingunProjectile;
//dryVelocity = 425.0;
dryVelocity = 2000.0; // z0dd - ZOD, 8-12-02. Was 425.0
wetVelocity = 1750.0;
velInheritFactor = 0.0;
fizzleTimeMS = 3000;
lifetimeMS = 3000;
explodeOnDeath = false;
reflectOnWaterImpactAngle = 0.0;
explodeOnWaterImpact = false;
deflectionOnWaterImpact = 0.0;
fizzleUnderwaterMS = 3000;
tracerLength = 25.0;
tracerAlpha = false;
tracerMinPixels = 6;
tracerColor = 211.0/255.0 @ " " @ 215.0/255.0 @ " " @ 120.0/255.0 @ " 0.75";
tracerTex[0] = "special/tracer00";
tracerTex[1] = "special/tracercross";
tracerWidth = 0.09;
crossSize = 0.20;
crossViewAng = 0.990;
renderCross = true;
decalData[0] = ChaingunDecal1;
decalData[1] = ChaingunDecal2;
decalData[2] = ChaingunDecal3;
decalData[3] = ChaingunDecal4;
decalData[4] = ChaingunDecal5;
decalData[5] = ChaingunDecal6;
};
datablock ItemData(pistolAmmo)
{
className = Ammo;
catagory = "Ammo";
shapeFile = "ammo_chaingun.dts";
mass = 1;
elasticity = 0.2;
friction = 0.6;
pickupRadius = 2;
pickUpName = "some .77mm bullets";
computeCRC = true;
};
datablock ItemData(pistol) {
className = Weapon;
catagory = "Spawn Items";
shapeFile = "weapon_energy_vehicle.dts";
image = pistolImage;
mass = 2;
elasticity = 0.2;
friction = 0.6;
pickupRadius = 2;
pickUpName = "a Colt Pistol";
};
datablock ShapeBaseImageData(PistolImage)
{
className = WeaponImage;
shapeFile = "weapon_energy_vehicle.dts";
item = pistol;
offset = "0 0 0";
rotation = "0 1 0 180";
mass = 4;
ammo = pistolAmmo;
projectile = coltbullet;
projectileType = tracerProjectile;
projectileSpread = 10.0 / 1000.0;
//ClipStuff
ClipName = "ColtClip";
ClipPickupName["ColtClip"] = "Some .77MM Clips";
ShowsClipInHud = 0;
ClipReloadTime = 2;
ClipReturn = 10;
InitialClips = 950;
HellClipCount = 10;
//
//Challenges
HasChallenges = 1;
ChallengeCt = 9;
Challenge[1] = "Coltee\t25\t100\tGrip";
Challenge[2] = "Coltist\t50\t150\tLaser";
Challenge[3] = "Colt Expert\t100\t250\tSilencer";
Challenge[4] = "Colt Master\t250\t500\tExcessive Duality";
Challenge[5] = "Colt God\t500\t1000\tHSBullets";
Challenge[6] = "Colt Bronze Commendation\t1000\t10000\tNone";
Challenge[7] = "Colt Silver Commendation\t2500\t25000\tNone";
Challenge[8] = "Colt Gold Commendation\t5000\t50000\tNone";
Challenge[9] = "Colt Titan Commendation\t15000\t75000\tNone";
Upgrade[1] = "Grip";
Upgrade[2] = "Laser";
Upgrade[3] = "Silencer";
Upgrade[4] = "Excessive Duality";
Upgrade[5] = "HSBullets";
GunName = "Colt Pistol";
//
stateName[0] = "Activate";
stateTransitionOnTimeout[0] = "ActivateReady";
stateTimeoutValue[0] = 0.5;
stateSequence[0] = "Activate";
stateSound[0] = PlasmaSwitchSound;
stateName[1] = "ActivateReady";
stateTransitionOnLoaded[1] = "Ready";
stateTransitionOnNoAmmo[1] = "NoAmmo";
stateName[2] = "Ready";
stateTransitionOnNoAmmo[2] = "NoAmmo";
stateTransitionOnTriggerDown[2] = "Fire";
stateName[3] = "Fire";
stateTransitionOnTimeout[3] = "Reload";
stateTimeoutValue[3] = 0.1;
stateFire[3] = true;
stateEmitter[3] = "GunFireEffectEmitter";
stateEmitterNode[3] = "muzzlepoint1";
stateEmitterTime[3] = 1;
stateRecoil[3] = LightRecoil;
stateAllowImageChange[3] = false;
stateScript[3] = "onFire";
stateEmitterTime[3] = 0.2;
//stateSound[3] = PistolFireSound;
stateName[4] = "Reload";
stateTransitionOnNoAmmo[4] = "NoAmmo";
stateTransitionOnTimeout[4] = "Ready";
stateTimeoutValue[4] = 0.1;
stateAllowImageChange[4] = false;
stateSequence[4] = "Reload";
stateName[5] = "NoAmmo";
stateTransitionOnAmmo[5] = "Reload";
stateSequence[5] = "NoAmmo";
stateTransitionOnTriggerDown[5] = "DryFire";
stateName[6] = "DryFire";
stateSound[6] = ChaingunDryFireSound;
stateTimeoutValue[6] = 1.5;
stateTransitionOnTimeout[6] = "NoAmmo";
};
datablock ShapeBaseImageData(PistolImage2) : PistolImage {
offset = "-0.5 0 0";
};
function PistolImage::onMount(%this,%obj,%slot) {
Parent::onMount(%this, %obj, %slot);
if(%obj.client.UpgradeOn("Excessive Duality", %this.getName())) {
%obj.mountImage(PistolImage2, 5);
}
}
function PistolImage::onUnmount(%this,%obj,%slot) {
%obj.unmountImage(5);
Parent::onUnmount(%this, %obj, %slot);
}
function PistolImage::onFire(%data, %obj, %slot) {
%p = Parent::onFire(%data, %obj, %slot);
if(%obj.client.UpgradeOn("Silencer", %data.getName())) {
//zero sound :p
}
else if(%obj.client.UpgradeOn("Excessive Duality", %data.getName())) {
schedule(200, 0, "FirePistolShot", %data, %obj, %slot);
ServerPlay3d(PistolFireSound, %obj.getPosition());
}
else {
ServerPlay3d(PistolFireSound, %obj.getPosition());
}
}
function FirePistolShot(%data, %obj, %slot) {
serverPlay3d("PistolFireSound", %obj.getPosition());
%vector = %obj.getMuzzleVector(%slot);
%mp = %obj.getMuzzlePoint(%slot);
%x = (getRandom() - 0.5) * 2 * 3.1415926 * %data.projectileSpread;
%y = (getRandom() - 0.5) * 2 * 3.1415926 * %data.projectileSpread;
%z = (getRandom() - 0.5) * 2 * 3.1415926 * %data.projectileSpread;
%mat = MatrixCreateFromEuler(%x @ " " @ %y @ " " @ %z);
%newvector = MatrixMulVector(%mat, %vector);
%p = new (%data.projectileType)() {
dataBlock = %data.projectile;
initialDirection = %newvector;
initialPosition = %mp;
sourceObject = %obj;
damageFactor = 1;
sourceSlot = %slot;
};
%p.ImageSource = "PistolImage";
%p.WeaponImageSource = "PistolImage";
}

View file

@ -0,0 +1,204 @@
//--------------------------------------------------------------------------
// Projectile
//--------------------------------------------------------------------------
datablock TracerProjectileData(CHawkBullet) {
doDynamicClientHits = true;
directDamage = 0.23; //reduced 0.5
directDamageType = $DamageType::Hawk; //obviously change this
explosion = "BlasterExplosion";
splash = ChaingunSplash;
sound = ShrikeBlasterProjectileSound;
dryVelocity = 425.0;
wetVelocity = 100.0;
velInheritFactor = 1.0;
fizzleTimeMS = 1000;
lifetimeMS = 1000;
explodeOnDeath = false;
reflectOnWaterImpactAngle = 0.0;
explodeOnWaterImpact = false;
deflectionOnWaterImpact = 0.0;
fizzleUnderwaterMS = 3000;
ImageSource = "CrimsonHawkImage";
tracerLength = 45.0;
tracerAlpha = false;
tracerMinPixels = 6;
tracerColor = "1.0 0.0 0.0 1.0";
tracerTex[0] = "special/shrikeBolt";
tracerTex[1] = "special/shrikeBoltCross";
tracerWidth = 0.55;
crossSize = 0.99;
crossViewAng = 0.990;
renderCross = true;
};
datablock ItemData(CrimsonHawkAmmo)
{
className = Ammo;
catagory = "Ammo";
shapeFile = "ammo_chaingun.dts";
mass = 1;
elasticity = 0.2;
friction = 0.6;
pickupRadius = 2;
pickUpName = "some .77mm bullets";
computeCRC = true;
};
datablock ItemData(CrimsonHawk) {
className = Weapon;
catagory = "Spawn Items";
shapeFile = "weapon_energy_vehicle.dts";
image = CrimsonHawkImage;
mass = 2;
elasticity = 0.2;
friction = 0.6;
pickupRadius = 2;
pickUpName = "a CrimsonHawk Pistol";
};
datablock ShapeBaseImageData(CrimsonHawkImage)
{
className = WeaponImage;
shapeFile = "weapon_energy_vehicle.dts";
item = CrimsonHawk;
offset = "0 0 0";
rotation = "0 1 0 180";
mass = 4;
ammo = CrimsonHawkAmmo;
projectile = CHawkBullet;
projectileType = tracerProjectile;
projectileSpread = 5.0 / 1000.0;
//ClipStuff
ClipName = "CrimsonHawkClip";
ClipPickupName["CrimsonHawkClip"] = "Some .77MM Clips";
ShowsClipInHud = 0;
ClipReloadTime = 4;
ClipReturn = 15;
InitialClips = 950;
HellClipCount = 10;
//
RankRequire = $TWM2::RankRequire["CrimsonHawk"];
PrestigeRequire = 5;
//Challenges
HasChallenges = 1;
ChallengeCt = 9;
Challenge[1] = "Crimson Hawk Novice\t25\t100\tNone";
Challenge[2] = "Crimson Hawk Hunter\t50\t150\tGrip";
Challenge[3] = "Crimson Hawk Expert\t100\t250\tLaser";
Challenge[4] = "Crimson Hawk Master\t250\t500\tSilencer";
Challenge[5] = "Crimson Hawk God\t500\t1000\tNone";
Challenge[6] = "Crimson Hawk Bronze Commendation\t2500\t10000\tNone";
Challenge[7] = "Crimson Hawk Silver Commendation\t7500\t25000\tNone";
Challenge[8] = "Crimson Hawk Gold Commendation\t25000\t50000\tNone";
Challenge[9] = "Crimson Hawk Titan Commendation\t50000\t75000\tNone";
Upgrade[1] = "Grip";
Upgrade[2] = "Laser";
Upgrade[3] = "Silencer";
GunName = "Crimson Hawk";
//
stateName[0] = "Activate";
stateTransitionOnTimeout[0] = "ActivateReady";
stateTimeoutValue[0] = 0.5;
stateSequence[0] = "Activate";
stateSound[0] = PlasmaSwitchSound;
stateName[1] = "ActivateReady";
stateTransitionOnLoaded[1] = "Ready";
stateTransitionOnNoAmmo[1] = "NoAmmo";
stateName[2] = "Ready";
stateTransitionOnNoAmmo[2] = "NoAmmo";
stateTransitionOnTriggerDown[2] = "Fire";
stateName[3] = "Fire";
stateTransitionOnTimeout[3] = "Fire2";
stateTimeoutValue[3] = 0.1;
stateFire[3] = true;
stateRecoil[3] = LightRecoil;
stateAllowImageChange[3] = false;
stateScript[3] = "onFire";
stateEmitterTime[3] = 0.1;
stateName[4] = "Fire2";
stateTransitionOnTimeout[4] = "Fire3";
stateTimeoutValue[4] = 0.1;
stateFire[4] = true;
stateRecoil[4] = LightRecoil;
stateAllowImageChange[4] = false;
stateScript[4] = "onFire";
stateEmitterTime[4] = 0.1;
stateName[5] = "Fire3";
stateTransitionOnTimeout[5] = "Fire4";
stateTimeoutValue[5] = 0.1;
stateFire[5] = true;
stateRecoil[5] = LightRecoil;
stateAllowImageChange[5] = false;
stateScript[5] = "onFire";
stateEmitterTime[5] = 0.1;
stateName[6] = "Fire4";
stateTransitionOnTimeout[6] = "Fire5";
stateTimeoutValue[6] = 0.1;
stateFire[6] = true;
stateRecoil[6] = LightRecoil;
stateAllowImageChange[6] = false;
stateScript[6] = "onFire";
stateEmitterTime[6] = 0.1;
stateName[7] = "Fire5";
stateTransitionOnTimeout[7] = "Reload";
stateTimeoutValue[7] = 0.1;
stateFire[7] = true;
stateRecoil[7] = LightRecoil;
stateAllowImageChange[7] = false;
stateScript[7] = "onFire";
stateEmitterTime[7] = 0.1;
//stateSound[3] = PistolFireSound;
stateName[8] = "Reload";
stateTransitionOnNoAmmo[8] = "NoAmmo";
stateTransitionOnTimeout[8] = "Ready";
stateTimeoutValue[8] = 0.1;
stateAllowImageChange[8] = false;
stateSequence[8] = "Reload";
stateName[9] = "NoAmmo";
stateTransitionOnAmmo[9] = "Reload";
stateSequence[9] = "NoAmmo";
stateTransitionOnTriggerDown[9] = "DryFire";
stateName[10] = "DryFire";
stateSound[10] = ChaingunDryFireSound;
stateTimeoutValue[10] = 1.5;
stateTransitionOnTimeout[10] = "NoAmmo";
};
function CrimsonHawkImage::onMount(%this,%obj,%slot) {
Parent::onMount(%this, %obj, %slot);
}
function CrimsonHawkImage::onFire(%data, %obj, %slot) {
%p = Parent::onFire(%data, %obj, %slot);
if(%obj.client.UpgradeOn("Silencer", %data.getName())) {
//zero sound :p
}
else {
ServerPlay3d(PistolFireSound, %obj.getPosition());
}
}

View file

@ -0,0 +1,192 @@
datablock AudioProfile(DeagleFireSound) {
filename = "fx/weapons/cg_hard4.wav";
description = AudioDefault3d;
preload = true;
};
datablock TracerProjectileData(DeagleBullet)
{
doDynamicClientHits = true;
directDamage = 0.3; //reduced .6
directDamageType = $DamageType::deserteagle;
explosion = "ChaingunExplosion";
splash = ChaingunSplash;
kickBackStrength = 5.0;
sound = ChaingunProjectile;
ImageSource = "DeagleImage";
//dryVelocity = 425.0;
dryVelocity = 2000.0; // z0dd - ZOD, 8-12-02. Was 425.0
wetVelocity = 1750.0;
velInheritFactor = 0.0;
fizzleTimeMS = 3000;
lifetimeMS = 3000;
explodeOnDeath = false;
reflectOnWaterImpactAngle = 0.0;
explodeOnWaterImpact = false;
deflectionOnWaterImpact = 0.0;
fizzleUnderwaterMS = 3000;
tracerLength = 25.0;
tracerAlpha = false;
tracerMinPixels = 6;
tracerColor = 211.0/255.0 @ " " @ 215.0/255.0 @ " " @ 120.0/255.0 @ " 0.75";
tracerTex[0] = "special/tracer00";
tracerTex[1] = "special/tracercross";
tracerWidth = 0.09;
crossSize = 0.20;
crossViewAng = 0.990;
renderCross = true;
decalData[0] = ChaingunDecal1;
decalData[1] = ChaingunDecal2;
decalData[2] = ChaingunDecal3;
decalData[3] = ChaingunDecal4;
decalData[4] = ChaingunDecal5;
decalData[5] = ChaingunDecal6;
};
datablock ShapeBaseImageData(DeagleImage2)
{
className = WeaponImage;
shapeFile = "weapon_sniper.dts";
offset = "0 0 0"; // L/R - F/B - T/B
rotation = "0 0 0 0"; // L/R - F/B - T/B
emap = true;
};
datablock ItemData(DeagleAmmo)
{
className = Ammo;
catagory = "Ammo";
shapeFile = "ammo_chaingun.dts";
mass = 1;
elasticity = 0.2;
friction = 0.6;
pickupRadius = 2;
pickUpName = "some 4mm bullets";
computeCRC = true;
};
datablock ItemData(Deagle)
{
className = Weapon;
catagory = "Spawn Items";
shapeFile = "weapon_energy_vehicle.dts";
image = DeagleImage;
mass = 2;
elasticity = 0.2;
friction = 0.6;
pickupRadius = 2;
pickUpName = "a Desert Eagle";
};
datablock ShapeBaseImageData(DeagleImage) {
className = WeaponImage;
shapeFile = "weapon_energy_vehicle.dts";
item = Deagle;
offset = "0 0 0";
rotation = "0 1 0 180";
mass = 6;
ammo = DeagleAmmo;
projectile = DeagleBullet;
projectileType = tracerProjectile;
ProjectileSpread = 6.0 / 1000.0; //2.5 spread added
//ClipStuff
ClipName = "DesertEagleClip";
ClipPickupName["DesertEagleClip"] = "Some 4MM Clips";
ShowsClipInHud = 0;
ClipReloadTime = 5;
ClipReturn = 7;
InitialClips = 950;
//
//Challenges
HasChallenges = 1;
ChallengeCt = 9;
Challenge[1] = "Eagle Trainee\t25\t100\tNone";
Challenge[2] = "Eagle Recruit\t50\t150\tNone";
Challenge[3] = "Eagle Expert\t100\t250\tLaser";
Challenge[4] = "Eagle Master\t250\t500\tSilencer";
Challenge[5] = "Eagle Legend\t500\t1000\tScope";
Challenge[6] = "Eagle Bronze Commendation\t1000\t10000\tNone";
Challenge[7] = "Eagle Silver Commendation\t2500\t25000\tNone";
Challenge[8] = "Eagle Gold Commendation\t5000\t50000\tNone";
Challenge[9] = "Eagle Titan Commendation\t15000\t75000\tNone";
Upgrade[1] = "Laser";
Upgrade[2] = "Silencer";
Upgrade[3] = "Scope";
GunName = "Desert Eagle Pistol";
//
RankRequire = $TWM2::RankRequire["DesertEagle"];
stateName[0] = "Activate";
stateTransitionOnTimeout[0] = "ActivateReady";
stateTimeoutValue[0] = 0.5;
stateSequence[0] = "Activate";
stateSound[0] = PlasmaSwitchSound;
stateName[1] = "ActivateReady";
stateTransitionOnLoaded[1] = "Ready";
stateTransitionOnNoAmmo[1] = "NoAmmo";
stateName[2] = "Ready";
stateTransitionOnNoAmmo[2] = "NoAmmo";
stateTransitionOnTriggerDown[2] = "Fire";
stateName[3] = "Fire";
stateTransitionOnTimeout[3] = "Reload";
stateTimeoutValue[3] = 0.1;
stateFire[3] = true;
stateRecoil[3] = LightRecoil;
stateAllowImageChange[3] = false;
stateScript[3] = "onFire";
stateEmitterTime[3] = 0.2;
//stateSound[3] = DeagleFireSound;
stateName[4] = "Reload";
stateTransitionOnNoAmmo[4] = "NoAmmo";
stateTransitionOnTimeout[4] = "Ready";
stateTimeoutValue[4] = 0.1;
stateAllowImageChange[4] = false;
stateSequence[4] = "Reload";
stateName[5] = "NoAmmo";
stateTransitionOnAmmo[5] = "Reload";
stateSequence[5] = "NoAmmo";
stateTransitionOnTriggerDown[5] = "DryFire";
stateName[6] = "DryFire";
stateSound[6] = ChaingunDryFireSound;
stateTimeoutValue[6] = 1.5;
stateTransitionOnTimeout[6] = "NoAmmo";
};
function DeagleImage::onMount(%this,%obj,%slot) {
Parent::onMount(%this, %obj, %slot);
%obj.mountImage(DeagleImage2, 5);
}
function DeagleImage::onUnmount(%this,%obj,%slot) {
Parent::onUnmount(%this, %obj, %slot);
%obj.unmountImage(5);
}
function DeagleImage::onFire(%data,%obj,%slot) {
%p = Parent::onFire(%data,%obj,%slot);
if(%obj.client.UpgradeOn("Silencer", %data.getName())) {
//zero sound :p
}
else {
ServerPlay3d(DeagleFireSound, %obj.getPosition());
}
}

View file

@ -0,0 +1,280 @@
//--------------------------------------------------------------------------
// Grapling Hook
// Function Credits: Xenolith
//--------------------------------------------------------------------------
//--------------------------------------
// Rifle and item...
//--------------------------------------
datablock TargetProjectileData(GrappleRope) {
directDamage = 0.0;
hasDamageRadius = false;
indirectDamage = 0.0;
damageRadius = 0.0;
velInheritFactor = 1.0;
maxRifleRange = 1000;
beamColor = "0.0 0.1 0.0";
startBeamWidth = 0.20;
pulseBeamWidth = 0.15;
beamFlareAngle = 3.0;
minFlareSize = 0.0;
maxFlareSize = 400.0;
pulseSpeed = 6.0;
pulseLength = 0.150;
textureName[0] = "special/nonlingradient";
textureName[1] = "special/flare";
textureName[2] = "special/pulse";
textureName[3] = "special/expFlare";
beacon = true;
};
datablock SeekerProjectileData(GrappleShot) {
casingShapeName = "weapon_missile_casement.dts";
projectileShapeName = "weapon_missile_projectile.dts";
directDamage = 0.0;
radiusDamageType = $DamageType::RPG;
kickBackStrength = 3500;
explosion = "BlasterExplosion";
splash = MissileSplash;
velInheritFactor = 1.0; // to compensate for slow starting velocity, this value
// is cranked up to full so the missile doesn't start
// out behind the player when the player is moving
// very quickly - bramage
lifetimeMS = 500; // z0dd - ZOD, 4/14/02. Was 6000
muzzleVelocity = 250.0;
maxVelocity = 350.0; // z0dd - ZOD, 4/14/02. Was 80.0
turningSpeed = 54.0;
acceleration = 50.0;
explodeOnDeath = false;
proximityRadius = 3;
sound = MissileProjectileSound;
hasLight = true;
lightRadius = 3.0;
lightColor = "0.2 0.05 0";
useFlechette = true;
flechetteDelayMs = 10;
casingDeb = FlechetteDebris;
explodeOnWaterImpact = true;
};
datablock ItemData(GrappleHook) {
className = Weapon;
catagory = "Spawn Items";
shapeFile = "weapon_targeting.dts";
image = GrappleHookImage;
mass = 1;
elasticity = 0.2;
friction = 0.6;
pickupRadius = 2;
pickUpName = "a grapling hook";
computeCRC = true;
};
datablock ShapeBaseImageData(GrappleHookImage) {
className = WeaponImage;
shapeFile = "weapon_targeting.dts";
item = GrappleHook;
offset = "0 0 0";
projectile = GrappleShot;
projectileType = SeekerProjectile;
usesEnergy = true;
minEnergy = 3;
stateName[0] = "Activate";
stateTransitionOnTimeout[0] = "ActivateReady";
stateTimeoutValue[0] = 0.5;
stateSequence[0] = "Activate";
stateSound[0] = ChaingunSwitchSound;
stateName[1] = "ActivateReady";
stateTransitionOnLoaded[1] = "Ready";
stateTransitionOnNoAmmo[1] = "NoAmmo";
stateName[2] = "Ready";
stateTransitionOnNoAmmo[2] = "NoAmmo";
stateTransitionOnTriggerDown[2] = "Fire";
stateName[3] = "Fire";
stateTransitionOnTimeout[3] = "Reload";
stateTimeoutValue[3] = 0.5;
stateFire[3] = true;
stateAllowImageChange[3] = false;
stateSequence[3] = "Fire";
stateScript[3] = "onFire";
stateName[4] = "Reload";
stateTransitionOnNoAmmo[4] = "NoAmmo";
stateTransitionOnTimeout[4] = "Ready";
stateSound[4] = MortarReloadSound;
stateEjectShell[4] = true;
stateAllowImageChange[4] = false;
stateSequence[4] = "Reload";
stateScript[4] = "onReload";
stateName[5] = "NoAmmo";
stateTransitionOnAmmo[5] = "Reload";
stateSequence[5] = "NoAmmo";
stateTransitionOnTriggerDown[5] = "DryFire";
stateName[6] = "DryFire";
stateTimeoutValue[6] = 0.3;
stateSound[6] = ChaingunDryFireSound;
stateTransitionOnTimeout[6] = "Ready";
};
function GrappleHookImage::onFire(%data, %obj, %slot) {
if($TWM::PlayingWarTower) {
%obj.client.beamer = 0;
if(isObject(%obj.beamproj)) {
%obj.beamproj.schedule(100, "delete");
}
messageClient(%obj.client, 'MsgBeamerStatus', "\c5Cannot Grapple in this game mode.~wfx/weapons/ELF_underwater.wav");
return;
}
if($TWM2::PlayingSabo) {
if(%obj == Game.bomb.Carrier) {
%obj.client.beamer = 0;
if(isObject(%obj.beamproj)) {
%obj.beamproj.schedule(100, "delete");
}
messageClient(%obj.client, 'MsgBeamerStatus', "\c5Cannot Grapple With The Bomb.~wfx/weapons/ELF_underwater.wav");
return;
}
}
if(%obj.client.beamer == 1) {
%obj.client.beamer = 0;
if(isObject(%obj.beamproj)) {
%obj.beamproj.schedule(100, "delete");
}
messageClient(%obj.client, 'MsgBeamerStatus', '~wfx/weapons/ELF_underwater.wav');
}
else {
%p = Parent::OnFire(%data, %obj, %slot);
}
}
function GrappleShot::onExplode(%data, %proj, %pos, %mod) {
%obj = %proj.sourceObject;
%continue = 0;
if (%obj.client.beamer == 0 || %obj.client.beamer $= "") {
%obj.client.beamer = 1;
messageClient(%obj.client, 'MsgBeamerStatus', '~wfx/weapons/cg_metal2.wav');
%theight = getTerrainHeight(%pos);
%maxHeight = %tHeight + 75;
if(getWord(%pos, 2) > %maxHeight) {
%TargetSearchMask = $AllObjMask;
InitContainerRadiusSearch(%pos, 1, %TargetSearchMask); //small distance
while ((%potentialTarget = ContainerSearchNext()) != 0){
if (%potentialTarget.getPosition() != %pos) {
%continue = 1;
}
}
if(!%continue) {
messageClient(%obj.client, 'MsgBeamerStatus', '~wfx/weapons/ELF_underwater.wav');
messageClient(%obj.client, 'MsgBeamerStatus', "Grapples cannot fire this high.");
return;
}
}
beamerOn(%data, %obj, %pos);
}
}
//Functions By: Xenolith
//Modified to suit my needs
function beamerOn(%data, %obj, %hit) {
%beamtime = 100;
if(isObject(%obj.beamproj)) {
%obj.beamproj.schedule(%beamtime, "delete");
}
if (%obj.client.beamer != 1) {
return;
}
%obj.setHeat(1.0); //max out the heat signature
%hitobj = getWord(%hit, 0);
%hitpos = getWord(%hit, 0) @ " " @ getWord(%hit, 1) @ " " @ getWord(%hit, 2);
%xhit = getword(%hitpos, 0);
%yhit = getword(%hitpos, 1);
%zhit = getword(%hitpos, 2);
%xobj = getword(%obj.position, 0);
%yobj = getword(%obj.position, 1);
%zobj = getword(%obj.position, 2);
%x = %xhit - %xobj;
%y = %yhit - %yobj;
%z = %zhit - %zobj;
%displacement = %x @ " " @ %y @ " " @ %z;
%x = getword(%displacement, 0);
%y = getword(%displacement, 1);
%z = getword(%displacement, 2);
%distance = mSqrt(%x * %x + %y * %y + %z * %z);
%x = %x / %distance;
%y = %y / %distance;
%z = %z / %distance;
%displacement = %x @ " " @ %y @ " " @ %z;
if (%distance < 5 || %obj.client.beamer == 0) {
%obj.client.beamer = 0;
messageClient(%obj.client, 'MsgBeamerStatus', '~wfx/weapons/ELF_underwater.wav');
if(isObject(%obj.beamproj)) {
%obj.beamproj.schedule(%beamtime, "delete");
}
%velocity = VectorScale(%displacement, 5);
%obj.setVelocity(%velocity);
return;
}
%z = %z + 0.25;
%fix = %x @ " " @ %y @ " " @ %z;
if (%distance < 55) {
%velocity = VectorScale(%fix, (%distance * 2));
}
else {
%velocity = VectorScale(%fix, 110); //was 500
}
%obj.setVelocity(%velocity);
%muzzlePos = %obj.getMuzzlePoint(0);
%obj.beamproj = new (TargetProjectile)() {
dataBlock = GrappleRope;
initialDirection = %displacement;
initialPosition = %muzzlePos;
damageFactor = 0;
sourceSlot = 0; //%slot
fadeTime = 0.2;
};
schedule(%beamtime, 0, "beamerOn", %data, %obj, %hit);
}
function GrappleHookImage::onUnmount(%this, %obj, %slot) {
Parent::onUnmount(%this, %obj, %slot);
if(isObject(%obj.lastProjectile)) {
%obj.lastProjectile.delete();
}
if(%obj.client.beamer == 1) {
%obj.client.beamer = 0;
if(isObject(%obj.beamproj)) {
%obj.beamproj.schedule(100, "delete");
}
messageClient(%obj.client, 'MsgBeamerStatus', '~wfx/weapons/ELF_underwater.wav');
}
}

View file

@ -0,0 +1,163 @@
datablock ItemData(LD06SavagerAmmo) {
className = Ammo;
catagory = "Ammo";
shapeFile = "ammo_chaingun.dts";
mass = 1;
elasticity = 0.2;
friction = 0.6;
pickupRadius = 2;
pickUpName = "some LD06Savager rounds";
computeCRC = true;
};
//--------------------------------------------------------------------------
// Weapon
//--------------------------------------
datablock ShapeBaseImageData(LD06SavagerImage) {
className = WeaponImage;
shapeFile = "weapon_plasma.dts";
item = LD06Savager;
ammo = LD06SavagerAmmo;
projectile = Wp400Pellet;
projectileType = TracerProjectile;
emap = true;
mass = 20;
casing = ShellDebris;
shellExitDir = "0.5 0.0 1.0"; // L/R - F/B - T/B
shellExitOffset = "0.15 -0.51 -0.1"; // L/R - F/B - T/B
shellExitVariance = 10.0;
shellVelocity = 4.0;
//ClipStuff
ClipName = "LD06SavagerClip";
ClipPickupName["LD06SavagerClip"] = "some LD06Savager Clip Boxes";
ShowsClipInHud = 0;
ClipReloadTime = 5;
ClipReturn = 10;
InitialClips = 999;
HellClipCount = 7;
//
HasChallenges = 1;
ChallengeCt = 8;
Challenge[1] = "LD06 Killer\t50\t100\tNone";
Challenge[2] = "LD06 Expert\t100\t250\tNone";
Challenge[3] = "LD06 Master\t250\t500\tNone";
Challenge[4] = "LD06 God\t500\t1000\tSilencer";
Challenge[5] = "LD06 Bronze Commendation\t1000\t10000\tNone";
Challenge[6] = "LD06 Silver Commendation\t2500\t25000\tNone";
Challenge[7] = "LD06 Gold Commendation\t5000\t50000\tNone";
Challenge[8] = "LD06 Titan Commendation\t15000\t75000\tNone";
Upgrade[1] = "Silencer";
GunName = "LD06 Savager";
MedalRequire = 1;
projectileSpread = 10.0 / 1000.0;
stateName[0] = "Activate";
stateTransitionOnTimeout[0] = "ActivateReady";
stateTimeoutValue[0] = 0.3;
stateSequence[0] = "Activate";
stateSound[0] = ChaingunSwitchSound;
stateName[1] = "ActivateReady";
stateTransitionOnLoaded[1] = "Ready";
stateTransitionOnNoAmmo[1] = "NoAmmo";
stateName[2] = "Ready";
stateTransitionOnNoAmmo[2] = "NoAmmo";
stateTransitionOnTriggerDown[2] = "CheckWet";
stateName[3] = "Fire";
stateTransitionOnTimeout[3] = "Reload";
stateTimeoutValue[3] = 0.0001;
stateFire[3] = true;
stateEjectShell[3] = true;
stateRecoil[3] = LightRecoil;
stateAllowImageChange[3] = false;
stateScript[3] = "onFire";
stateSound[3] = SniperFireSound;
stateName[4] = "Reload";
stateTransitionOnNoAmmo[4] = "NoAmmo";
stateTransitionOnTimeout[4] = "Ready";
stateTimeoutValue[4] = 0.6;
stateAllowImageChange[4] = false;
stateSequence[4] = "Reload";
stateName[5] = "NoAmmo";
stateTransitionOnAmmo[5] = "Reload";
stateSequence[5] = "NoAmmo";
stateTransitionOnTriggerDown[5] = "DryFire";
stateName[6] = "DryFire";
stateSound[6] = ChaingunDryFireSound;
stateTimeoutValue[6] = 1.0;
stateTransitionOnTimeout[6] = "NoAmmo";
stateName[7] = "WetFire";
stateSound[7] = ChaingunDryFireSound;
stateTimeoutValue[7] = 1.0;
stateTransitionOnTimeout[7] = "Ready";
stateName[8] = "CheckWet";
stateTransitionOnWet[8] = "WetFire";
stateTransitionOnNotWet[8] = "Fire";
};
datablock ItemData(LD06Savager)
{
className = Weapon;
catagory = "Spawn Items";
shapeFile = "weapon_plasma.dts";
image = LD06SavagerImage;
mass = 1.0;
elasticity = 0.2;
friction = 0.6;
pickupRadius = 2;
pickUpName = "a LD06Savager";
computeCRC = true;
emap = true;
};
function LD06SavagerImage::onMount(%this,%obj,%slot) {
Parent::onMount(%this, %obj, %slot);
}
function LD06SavagerImage::onFire(%data,%obj,%slot) {
%obj.applyKick(-250);
%obj.decInventory(%data.ammo,1);
serverPlay3D(ShotgunFireSound, %obj.getPosition());
%vector = %obj.getMuzzleVector(%slot);
%mp = %obj.getMuzzlePoint(%slot);
for (%i=0; %i < 5; %i++) {
%x = (getRandom() - 0.5) * 2 * 3.1415926 * %data.projectileSpread;
%y = (getRandom() - 0.5) * 2 * 3.1415926 * %data.projectileSpread;
%z = (getRandom() - 0.5) * 2 * 3.1415926 * %data.projectileSpread;
%mat = MatrixCreateFromEuler(%x @ " " @ %y @ " " @ %z);
%newvector = MatrixMulVector(%mat, %vector);
%p = new (%data.projectileType)() {
dataBlock = %data.projectile;
initialDirection = %newvector;
initialPosition = %mp;
sourceObject = %obj;
damageFactor = 1;
sourceSlot = %slot;
};
%p.WeaponImageSource = %data.getName();
%p.ImageSource = "LD06SavagerImage";
}
if(%obj.inv[LD06SavagerAmmo] == 0) { //Added Phantom139, TWM2
AttemptReload(%data, %obj, %slot);
}
}

View file

@ -0,0 +1,197 @@
//--------------------------------------------------------------------------
// Projectile
//--------------------------------------------------------------------------
datablock TracerProjectileData(m93Bullet) {
doDynamicClientHits = true;
directDamage = 0.22; // reduced .26
directDamageType = $DamageType::m93;
explosion = "ChaingunExplosion";
splash = ChaingunSplash;
HeadMultiplier = 1.5;
LegsMultiplier = 0.5;
kickBackStrength = 5.0;
sound = ChaingunProjectile;
ImageSource = "m93Image";
//dryVelocity = 425.0;
dryVelocity = 2000.0; // z0dd - ZOD, 8-12-02. Was 425.0
wetVelocity = 1750.0;
velInheritFactor = 0.0;
fizzleTimeMS = 3000;
lifetimeMS = 3000;
explodeOnDeath = false;
reflectOnWaterImpactAngle = 0.0;
explodeOnWaterImpact = false;
deflectionOnWaterImpact = 0.0;
fizzleUnderwaterMS = 3000;
tracerLength = 25.0;
tracerAlpha = false;
tracerMinPixels = 6;
tracerColor = 211.0/255.0 @ " " @ 215.0/255.0 @ " " @ 120.0/255.0 @ " 0.75";
tracerTex[0] = "special/tracer00";
tracerTex[1] = "special/tracercross";
tracerWidth = 0.09;
crossSize = 0.20;
crossViewAng = 0.990;
renderCross = true;
decalData[0] = ChaingunDecal1;
decalData[1] = ChaingunDecal2;
decalData[2] = ChaingunDecal3;
decalData[3] = ChaingunDecal4;
decalData[4] = ChaingunDecal5;
decalData[5] = ChaingunDecal6;
};
datablock ItemData(m93Ammo)
{
className = Ammo;
catagory = "Ammo";
shapeFile = "ammo_chaingun.dts";
mass = 1;
elasticity = 0.2;
friction = 0.6;
pickupRadius = 2;
pickUpName = "some .77mm bullets";
computeCRC = true;
};
datablock ItemData(m93) {
className = Weapon;
catagory = "Spawn Items";
shapeFile = "weapon_energy_vehicle.dts";
image = m93Image;
mass = 2;
elasticity = 0.2;
friction = 0.6;
pickupRadius = 2;
pickUpName = "a m93 Pistol";
};
datablock ShapeBaseImageData(m93Image)
{
className = WeaponImage;
shapeFile = "weapon_energy_vehicle.dts";
item = m93;
offset = "0 0 0";
rotation = "0 1 0 180";
mass = 4;
ammo = m93Ammo;
projectile = m93bullet;
projectileType = tracerProjectile;
projectileSpread = 6.0 / 1000.0;
//ClipStuff
ClipName = "m93Clip";
ClipPickupName["m93Clip"] = "Some .77MM Clips";
ShowsClipInHud = 0;
ClipReloadTime = 4;
ClipReturn = 15;
InitialClips = 950;
HellClipCount = 10;
//
RankRequire = $TWM2::RankRequire["ALSWP"];
PrestigeRequire = 2;
//Challenges
HasChallenges = 1;
ChallengeCt = 9;
Challenge[1] = "m93 Novice\t25\t100\tNone";
Challenge[2] = "m93 Hunter\t50\t150\tGrip";
Challenge[3] = "m93 Expert\t100\t250\tLaser";
Challenge[4] = "m93 Master\t250\t500\tSilencer";
Challenge[5] = "m93 God\t500\t1000\tHSBullets";
Challenge[6] = "m93 Bronze Commendation\t1000\t10000\tNone";
Challenge[7] = "m93 Silver Commendation\t2500\t25000\tNone";
Challenge[8] = "m93 Gold Commendation\t5000\t50000\tNone";
Challenge[9] = "m93 Titan Commendation\t15000\t75000\tNone";
Upgrade[1] = "Grip";
Upgrade[2] = "Laser";
Upgrade[3] = "Silencer";
Upgrade[4] = "HSBullets";
GunName = "M93 Pistol";
//
stateName[0] = "Activate";
stateTransitionOnTimeout[0] = "ActivateReady";
stateTimeoutValue[0] = 0.5;
stateSequence[0] = "Activate";
stateSound[0] = PlasmaSwitchSound;
stateName[1] = "ActivateReady";
stateTransitionOnLoaded[1] = "Ready";
stateTransitionOnNoAmmo[1] = "NoAmmo";
stateName[2] = "Ready";
stateTransitionOnNoAmmo[2] = "NoAmmo";
stateTransitionOnTriggerDown[2] = "Fire";
stateName[3] = "Fire";
stateTransitionOnTimeout[3] = "Fire2";
stateTimeoutValue[3] = 0.1;
stateFire[3] = true;
stateRecoil[3] = LightRecoil;
stateAllowImageChange[3] = false;
stateScript[3] = "onFire";
stateEmitterTime[3] = 0.1;
stateName[4] = "Fire2";
stateTransitionOnTimeout[4] = "Fire3";
stateTimeoutValue[4] = 0.1;
stateFire[4] = true;
stateRecoil[4] = LightRecoil;
stateAllowImageChange[4] = false;
stateScript[4] = "onFire";
stateEmitterTime[4] = 0.1;
stateName[5] = "Fire3";
stateTransitionOnTimeout[5] = "Reload";
stateTimeoutValue[5] = 0.1;
stateFire[5] = true;
stateRecoil[5] = LightRecoil;
stateAllowImageChange[5] = false;
stateScript[5] = "onFire";
stateEmitterTime[5] = 0.1;
//stateSound[3] = PistolFireSound;
stateName[6] = "Reload";
stateTransitionOnNoAmmo[6] = "NoAmmo";
stateTransitionOnTimeout[6] = "Ready";
stateTimeoutValue[6] = 0.1;
stateAllowImageChange[6] = false;
stateSequence[6] = "Reload";
stateName[7] = "NoAmmo";
stateTransitionOnAmmo[7] = "Reload";
stateSequence[7] = "NoAmmo";
stateTransitionOnTriggerDown[7] = "DryFire";
stateName[8] = "DryFire";
stateSound[8] = ChaingunDryFireSound;
stateTimeoutValue[8] = 1.5;
stateTransitionOnTimeout[8] = "NoAmmo";
};
function m93Image::onMount(%this,%obj,%slot) {
Parent::onMount(%this, %obj, %slot);
}
function m93Image::onFire(%data, %obj, %slot) {
%p = Parent::onFire(%data, %obj, %slot);
if(%obj.client.UpgradeOn("Silencer", %data.getName())) {
//zero sound :p
}
else {
ServerPlay3d(PistolFireSound, %obj.getPosition());
}
}

View file

@ -0,0 +1,247 @@
// Pulse Phaser Weapon
datablock AudioProfile(PPWFireSound)
{
filename = "fx/powered/turret_outdoor_fire.wav";
description = AudioDefault3d;
preload = true;
};
datablock LinearFlareProjectileData(phaserBolt) {
directDamage = 0.2; //reduced 0.45
directDamageType = $DamageType::Phaser;
explosion = "BlasterExplosion";
kickBackStrength = 0.0;
dryVelocity = 120.0;
wetVelocity = 40.0;
velInheritFactor = 0.5;
fizzleTimeMS = 2000;
lifetimeMS = 3000;
explodeOnDeath = false;
reflectOnWaterImpactAngle = 0.0;
explodeOnWaterImpact = false;
deflectionOnWaterImpact = 0.0;
fizzleUnderwaterMS = 3000;
ImageSource = "PulsePhaserImage";
numFlares = 20;
size = 0.10;
flareColor = "0 1 0";
flareModTexture = "flaremod";
flareBaseTexture = "flarebase";
sound = BlasterProjectileSound;
hasLight = true;
lightRadius = 3.0;
lightColor = "1 1 1";
};
datablock LinearFlareProjectileData(TrevorPhaserBolt) {
directDamage = 0.21; //reduced .485
directDamageType = $DamageType::Phaser;
explosion = "BlasterExplosion";
kickBackStrength = 0.0;
dryVelocity = 120.0;
wetVelocity = 40.0;
velInheritFactor = 0.5;
fizzleTimeMS = 2000;
lifetimeMS = 3000;
explodeOnDeath = false;
reflectOnWaterImpactAngle = 0.0;
explodeOnWaterImpact = false;
deflectionOnWaterImpact = 0.0;
fizzleUnderwaterMS = 3000;
ImageSource = "PulsePhaserImage";
numFlares = 20;
size = 0.10;
flareColor = "0.5 0.1 0.9";
flareModTexture = "flaremod";
flareBaseTexture = "flarebase";
sound = BlasterProjectileSound;
hasLight = true;
lightRadius = 3.0;
lightColor = "1 1 1";
};
datablock ShapeBaseImageData(PulsePhaserImage) {
className = WeaponImage;
shapeFile = "weapon_energy.dts";
item = PulsePhaser;
projectile = phaserBolt;
projectileType = LinearFlareProjectile;
HasChallenges = 1;
ChallengeCt = 10;
Challenge[1] = "Phaser Killer\t50\t100\tNone";
Challenge[2] = "Phaser Hunter\t150\t250\tNone";
Challenge[3] = "Phaser Expert\t250\t500\tLaser";
Challenge[4] = "Phaser Master\t500\t1000\tTriple Burst";
Challenge[5] = "Phaser God\t1000\t2000\tShotgun";
Challenge[6] = "Phaser Legend\t1500\t5000\tPhaser Blades";
Challenge[7] = "Phaser Bronze Commendation\t3000\t10000\tNone";
Challenge[8] = "Phaser Silver Commendation\t6000\t25000\tNone";
Challenge[9] = "Phaser Gold Commendation\t12500\t50000\tNone";
Challenge[10] = "Phaser Titan Commendation\t35000\t75000\tNone";
Upgrade[1] = "Laser";
Upgrade[2] = "Triple Burst";
Upgrade[3] = "Shotgun";
Upgrade[4] = "Phaser Blades";
GunName = "ES-77 Pulse Phaser";
RankRequire = $TWM2::RankRequire["PulsePhaser"];
usesEnergy = true;
fireEnergy = 4;
minEnergy = 4;
stateName[0] = "Activate";
stateTransitionOnTimeout[0] = "ActivateReady";
stateTimeoutValue[0] = 0.5;
stateSequence[0] = "Activate";
stateSound[0] = BlasterSwitchSound;
stateName[1] = "ActivateReady";
stateTransitionOnLoaded[1] = "Ready";
stateTransitionOnNoAmmo[1] = "NoAmmo";
stateName[2] = "Ready";
stateTransitionOnNoAmmo[2] = "NoAmmo";
stateTransitionOnTriggerDown[2] = "Fire";
stateName[3] = "Fire";
stateTransitionOnTimeout[3] = "Reload";
stateTimeoutValue[3] = 0.3;
stateFire[3] = true;
stateRecoil[3] = NoRecoil;
stateAllowImageChange[3] = false;
stateSequence[3] = "Fire";
stateSound[3] = PPWFireSound;
stateScript[3] = "onFire";
stateName[4] = "Reload";
stateTransitionOnNoAmmo[4] = "NoAmmo";
stateTransitionOnTimeout[4] = "Ready";
stateAllowImageChange[4] = false;
stateSequence[4] = "Reload";
stateName[5] = "NoAmmo";
stateTransitionOnAmmo[5] = "Reload";
stateSequence[5] = "NoAmmo";
stateTransitionOnTriggerDown[5] = "DryFire";
stateName[6] = "DryFire";
stateTimeoutValue[6] = 0.3;
stateSound[6] = BlasterDryFireSound;
stateTransitionOnTimeout[6] = "Ready";
};
datablock ItemData(PulsePhaser) {
className = Weapon;
catagory = "Spawn Items";
shapeFile = "weapon_energy.dts";
image = PulsePhaserImage;
mass = 1;
elasticity = 0.2;
friction = 0.6;
pickupRadius = 2;
pickUpName = "a Pulse Phaser";
};
datablock ShapeBaseImageData(Phaser2Image) : PulsePhaserImage {
shapeFile = "weapon_ELF.dts";
offset = "0 0.3 0.2";
rotation = "0 1 0 180";
};
datablock ShapeBaseImageData(Phaser3Image) : PulsePhaserImage {
shapeFile = "weapon_ELF.dts";
offset = "0 .5 0";
};
function PulsePhaserImage::onMount(%this, %obj, %slot) {
Parent::onMount(%this, %obj, %slot);
if(%obj.client.UpgradeOn("Phaser Blades", %this.getName())) {
%obj.mountImage(Phaser2Image, 5);
%obj.mountImage(Phaser3Image, 6);
}
}
function PulsePhaserImage::onUnmount(%this,%obj,%slot) {
%obj.unmountImage(5);
%obj.unmountImage(6);
Parent::onUnmount(%this, %obj, %slot);
}
function PulsePhaserImage::onFire(%data,%obj,%slot) {
if(%obj.cannotFire) {
return;
}
%vector = %obj.getMuzzleVector(%slot);
%mp = %obj.getMuzzlePoint(%slot);
if(%obj.client.UpgradeOn("Triple Burst", %data.getName())) {
%p1 = Parent::OnFire(%data, %obj, %slot);
%p2 = Schedule(100, 0, "spawnprojectile", %data.Projectile, %data.ProjectileType,
vectorAdd(%obj.getPosition(), "-.45 0 1.4"), %vector, %obj);
%p2.WeaponImageSource = "PulsePhaserImage";
schedule(100, 0, "ServerPlay3D", "PPWFireSound", %obj.getPosition());
%p3 = Schedule(250, 0, "spawnprojectile", %data.Projectile, %data.ProjectileType,
vectorAdd(%obj.getPosition(), "-.45 0 1.4"), %vector, %obj);
%p3.WeaponImageSource = "PulsePhaserImage";
schedule(250, 0, "ServerPlay3D", "PPWFireSound", %obj.getPosition());
ResetFireRestrict(%obj, 1);
schedule(1350, 0, "ResetFireRestrict", %obj, 0);
}
else if(%obj.client.UpgradeOn("Shotgun", %data.getName())) {
for (%i=0; %i < 3; %i++) {
%x = (getRandom() - 0.5) * 2 * 3.1415926 * (11/1000);
%y = (getRandom() - 0.5) * 2 * 3.1415926 * (11/1000);
%z = (getRandom() - 0.5) * 2 * 3.1415926 * (11/1000);
%mat = MatrixCreateFromEuler(%x @ " " @ %y @ " " @ %z);
%newvector = MatrixMulVector(%mat, %vector);
%p = new (%data.projectileType)() {
dataBlock = %data.projectile;
initialDirection = %newvector;
initialPosition = %mp;
sourceObject = %obj;
damageFactor = 1;
sourceSlot = %slot;
};
%p.WeaponImageSource = "PulsePhaserImage";
}
ResetFireRestrict(%obj, 1);
schedule(1200, 0, "ResetFireRestrict", %obj, 0);
}
else if(%obj.client.UpgradeOn("Phaser Blades", %data.getName())) {
serverPlay3D("BomberTurretFireSound", %obj.getPosition());
%p = new (%data.projectileType)() {
dataBlock = TrevorPhaserBolt;
initialDirection = %vector;
initialPosition = %mp;
sourceObject = %obj;
damageFactor = 1;
sourceSlot = %slot;
};
%p.WeaponImageSource = "PulsePhaserImage";
}
else {
%p = Parent::OnFire(%data,%obj,%slot);
}
}
function ResetFireRestrict(%plyr, %onOff) {
%plyr.cannotFire = %onOff;
}

View file

@ -0,0 +1,286 @@
//--------------------------------------------------------------------------
// Shock Lance
//
//
//--------------------------------------------------------------------------
datablock AudioProfile(ShockLanceSwitchSound)
{
filename = "fx/weapons/shocklance_activate.wav";
description = AudioClosest3d;
preload = true;
};
//--------------------------------------------------------------------------
// Explosion
//--------------------------------------
datablock AudioProfile(ShockLanceHitSound)
{
filename = "fx/weapons/shocklance_fire.WAV";
description = AudioClose3d;
preload = true;
};
datablock AudioProfile(ShockLanceReloadSound)
{
filename = "fx/weapons/shocklance_reload.WAV";
description = AudioClosest3d;
preload = true;
};
datablock AudioProfile(ShockLanceDryFireSound)
{
filename = "fx/weapons/shocklance_dryfire.WAV";
description = AudioClose3d;
preload = true;
};
datablock AudioProfile(ShockLanceMissSound)
{
filename = "fx/weapons/shocklance_miss.WAV";
description = AudioExplosion3d;
preload = true;
};
//--------------------------------------------------------------------------
// Particle data
//--------------------------------------------------------------------------
datablock ParticleData(ShockParticle)
{
dragCoeffiecient = 0.0;
gravityCoefficient = -0.0;
inheritedVelFactor = 0.0;
lifetimeMS = 1000;
lifetimeVarianceMS = 0;
textureName = "particleTest";
useInvAlpha = false;
spinRandomMin = -100.0;
spinRandomMax = 100.0;
numParts = 50;
animateTexture = true;
framesPerSec = 26;
animTexName[00] = "special/Explosion/exp_0002";
animTexName[01] = "special/Explosion/exp_0004";
animTexName[02] = "special/Explosion/exp_0006";
animTexName[03] = "special/Explosion/exp_0008";
animTexName[04] = "special/Explosion/exp_0010";
animTexName[05] = "special/Explosion/exp_0012";
animTexName[06] = "special/Explosion/exp_0014";
animTexName[07] = "special/Explosion/exp_0016";
animTexName[08] = "special/Explosion/exp_0018";
animTexName[09] = "special/Explosion/exp_0020";
animTexName[10] = "special/Explosion/exp_0022";
animTexName[11] = "special/Explosion/exp_0024";
animTexName[12] = "special/Explosion/exp_0026";
animTexName[13] = "special/Explosion/exp_0028";
animTexName[14] = "special/Explosion/exp_0030";
animTexName[15] = "special/Explosion/exp_0032";
animTexName[16] = "special/Explosion/exp_0034";
animTexName[17] = "special/Explosion/exp_0036";
animTexName[18] = "special/Explosion/exp_0038";
animTexName[19] = "special/Explosion/exp_0040";
animTexName[20] = "special/Explosion/exp_0042";
animTexName[21] = "special/Explosion/exp_0044";
animTexName[22] = "special/Explosion/exp_0046";
animTexName[23] = "special/Explosion/exp_0048";
animTexName[24] = "special/Explosion/exp_0050";
animTexName[25] = "special/Explosion/exp_0052";
colors[0] = "0.5 0.5 1.0 1.0";
colors[1] = "0.5 0.5 1.0 0.5";
colors[2] = "0.25 0.25 1.0 0.0";
sizes[0] = 0.5;
sizes[1] = 0.5;
sizes[2] = 0.5;
times[0] = 0.0;
times[1] = 0.5;
times[2] = 1.0;
};
datablock ParticleEmitterData(ShockParticleEmitter)
{
ejectionPeriodMS = 1;
periodVarianceMS = 0;
ejectionVelocity = 0.25;
velocityVariance = 0.0;
thetaMin = 0.0;
thetaMax = 30.0;
particles = "ShockParticle";
};
//--------------------------------------------------------------------------
// Shockwave
//--------------------------------------------------------------------------
datablock ShockwaveData( ShocklanceHit )
{
width = 0.5;
numSegments = 20;
numVertSegments = 1;
velocity = 0.25;
acceleration = 1.0;
lifetimeMS = 600;
height = 0.1;
verticalCurve = 0.5;
mapToTerrain = false;
renderBottom = false;
orientToNormal = true;
texture[0] = "special/shocklanceHit";
texture[1] = "special/gradient";
texWrap = 3.0;
times[0] = 0.0;
times[1] = 0.5;
times[2] = 1.0;
colors[0] = "1.0 1.0 1.0 1.0";
colors[1] = "1.0 1.0 1.0 0.5";
colors[2] = "1.0 1.0 1.0 0.0";
};
//--------------------------------------
// Projectile
//--------------------------------------
datablock ShockLanceProjectileData(BasicShocker)
{
directDamage = 0.45;
radiusDamageType = $DamageType::ShockLance;
kickBackStrength = 2600; // z0dd - ZOD, 3/30/02. More lance kick. was 2500
velInheritFactor = 0;
sound = "";
zapDuration = 1.0;
impulse = 1800;
boltLength = 16.0; // z0dd - ZOD, 3/30/02. was 14.0
extension = 16.0; // script variable indicating distance you can shock people from. // z0dd - ZOD, 3/30/02. Was 14.0
lightningFreq = 25.0;
lightningDensity = 3.0;
lightningAmp = 0.25;
lightningWidth = 0.05;
ImageSource = "ShockLanceImage";
shockwave = ShocklanceHit;
boltSpeed[0] = 2.0;
boltSpeed[1] = -0.5;
texWrap[0] = 1.5;
texWrap[1] = 1.5;
startWidth[0] = 0.3;
endWidth[0] = 0.6;
startWidth[1] = 0.3;
endWidth[1] = 0.6;
texture[0] = "special/shockLightning01";
texture[1] = "special/shockLightning02";
texture[2] = "special/shockLightning03";
texture[3] = "special/ELFBeam";
emitter[0] = ShockParticleEmitter;
};
//--------------------------------------
// Rifle and item...
//--------------------------------------
datablock ItemData(ShockLance)
{
className = Weapon;
catagory = "Spawn Items";
shapeFile = "weapon_shocklance.dts";
image = ShockLanceImage;
mass = 1;
elasticity = 0.2;
friction = 0.6;
pickupRadius = 2;
pickUpName = "a shocklance";
computeCRC = true;
emap = true;
};
datablock ShapeBaseImageData(ShockLanceImage)
{
classname = WeaponImage;
shapeFile = "weapon_shocklance.dts";
item = ShockLance;
offset = "0 0 0";
emap = true;
projectile = BasicShocker;
RankRequire = 0;
HasChallenges = 1;
ChallengeCt = 7;
Challenge[1] = "Shocklance Expert\t50\t100\tNone";
Challenge[2] = "Shocklance Master\t500\t1000\tNone";
Challenge[3] = "Shocklance God\t1000\t2000\tNone";
Challenge[4] = "Shocklance Bronze Commendation\t2500\t10000\tNone";
Challenge[5] = "Shocklance Silver Commendation\t5000\t25000\tNone";
Challenge[6] = "Shocklance Gold Commendation\t10000\t50000\tNone";
Challenge[7] = "Shocklance Titan Commendation\t25000\t75000\tNone";
GunName = "X-81 Shocklance";
usesEnergy = true;
missEnergy = 0;
hitEnergy = 3; // z0dd - ZOD, 8/20/02. Was 15.
minEnergy = 3; // z0dd - ZOD, 8/20/02. Was 15. // needs to change to be datablock's energy drain for a hit
stateName[0] = "Activate";
stateTransitionOnTimeout[0] = "ActivateReady";
stateSound[0] = ShockLanceSwitchSound;
stateTimeoutValue[0] = 0.5;
stateSequence[0] = "Activate";
stateName[1] = "ActivateReady";
stateTransitionOnLoaded[1] = "Ready";
stateTransitionOnNoAmmo[1] = "NoAmmo";
stateName[2] = "Ready";
stateTransitionOnNoAmmo[2] = "NoAmmo";
stateTransitionOnTriggerDown[2] = "CheckWet";
stateName[3] = "Fire";
stateTransitionOnTimeout[3] = "Reload";
stateTimeoutValue[3] = 0.5;
stateFire[3] = true;
stateAllowImageChange[3] = false;
stateSequence[3] = "Fire";
stateScript[3] = "onFire";
stateSound[3] = ShockLanceDryFireSound;
stateName[4] = "Reload";
stateTransitionOnNoAmmo[4] = "NoAmmo";
stateTransitionOnTimeout[4] = "Ready";
stateTimeoutValue[4] = 2.0;
stateAllowImageChange[4] = false;
stateSequence[4] = "Reload";
stateSound[4] = ShockLanceReloadSound;
stateName[5] = "NoAmmo";
stateTransitionOnAmmo[5] = "Ready";
stateName[6] = "DryFire";
stateSound[6] = ShockLanceDryFireSound;
stateTimeoutValue[6] = 1.0;
stateTransitionOnTimeout[6] = "Ready";
stateName[7] = "CheckWet";
stateTransitionOnWet[7] = "DryFire";
stateTransitionOnNotWet[7] = "Fire";
};