//--------------------------------------
// Plasma Fireball
//--------------------------------------

//--------------------------------------------------------------------------
// Force-Feedback Effects
//--------------------------------------
datablock EffectProfile(PlasmaSwitchEffect)
{
   effectname = "weapons/plasma_rifle_activate";
   minDistance = 2.5;
};

datablock EffectProfile(PlasmaFireEffect)
{
   effectname = "weapons/plasma_fire";
   minDistance = 10.0;
};

datablock EffectProfile(PlasmaDryFireEffect)
{
   effectname = "weapons/plasma_dryfire";
   minDistance = 2.5;
};

datablock EffectProfile(PlasmaIdleEffect)
{
   effectname = "weapons/plasma_rifle_idle";
   minDistance = 2.5;
};

datablock EffectProfile(PlasmaReloadEffect)
{
   effectname = "weapons/plasma_rifle_reload";
   minDistance = 2.5;
};

datablock EffectProfile(PlasmaExpEffect)
{
   effectname = "explosions/explosion.xpl10";
   minDistance = 10;
   maxDistance = 25;
};

//--------------------------------------------------------------------------
// Sounds
//--------------------------------------
datablock AudioProfile(PlasmaSwitchSound)
{
   filename    = "fx/weapons/plasma_rifle_activate.wav";
   description = AudioClosest3d;
   preload = true;
   effect = PlasmaSwitchEffect;
};

datablock AudioProfile(PlasmaFireSound)
{
   filename    = "fx/weapons/plasma_rifle_fire.wav";
   description = AudioDefault3d;
   preload = true;
   effect = PlasmaFireEffect;
};

datablock AudioProfile(PlasmaIdleSound)
{
   filename    = "fx/weapons/plasma_rifle_idle.wav";
   description = ClosestLooping3d;
   preload = true;
   //effect = PlasmaIdleEffect;
};

datablock AudioProfile(PlasmaReloadSound)
{
   filename    = "fx/weapons/plasma_rifle_reload.wav";
   description = Audioclosest3d;
   preload = true;
   effect = PlasmaReloadEffect;
};

datablock AudioProfile(mp5ExpSound)
{
   filename    = "fx/weapons/mortar_explode_UW.wav";
   description = AudioBIGExplosion3d;
   preload = true;
   effect = PlasmaExpEffect;
};

datablock AudioProfile(PlasmaProjectileSound)
{
   filename    = "fx/weapons/plasma_rifle_projectile.WAV";
   description = ProjectileLooping3d;
   preload = true;
};

datablock AudioProfile(PlasmaDryFireSound)
{
   filename    = "fx/weapons/plasma_dryfire.wav";
   description = AudioClose3d;
   preload = true;
   effect = PlasmaDryFireEffect;
};

datablock AudioProfile(PlasmaFireWetSound)
{
   filename    = "fx/weapons/plasma_fizzle.wav";
   description = AudioClose3d;
   preload = true;
};
//----------------------------------------------------------------------------
// Explosion smoke particles
//----------------------------------------------------------------------------

datablock ParticleData(mp5ExplosionSmoke)
{
   dragCoeffiecient     = 10.0;
   gravityCoefficient   = 0.0;
   inheritedVelFactor   = 1.0;

   lifetimeMS           = 8000;
   lifetimeVarianceMS   = 0;

   textureName          = "particleTest";

   useInvAlpha =  true;
   spinRandomMin = -10.0;
   spinRandomMax =  10.0;

   textureName = "special/Smoke/smoke_007";

   colors[0]     = "0 0 0";
   colors[1]     = "0 0 0";
   colors[2]     = "0 0 0";
   sizes[0]      = 10.0;
   sizes[1]      = 10.0;
   sizes[2]      = 10.0;
   times[0]      = 0.0;
   times[1]      = 0.5;
   times[2]      = 1.0;

};

datablock ParticleEmitterData(mp5ExplosionSmokeEmitter)
{
   ejectionOffset = 10;
   ejectionPeriodMS = 0;
   periodVarianceMS = 0;
   phi      = 360;

   ejectionVelocity = 100.0;
   velocityVariance = 0.0;

   thetaMin         = 1.0;
   thetaMax         = 1.0;

   lifetimeMS       = 8000;

   particles = "mp5ExplosionSmoke";
};

//----------------------------------------------------------------------------
// Explosion smoke particles2
//----------------------------------------------------------------------------

datablock ParticleData(mp5ExplosionSmoke2)
{
   dragCoeffiecient     = 0.3;
   gravityCoefficient   = 00.1;
   inheritedVelFactor   = 0.025;

   lifetimeMS           = 8000;
   lifetimeVarianceMS   = 0;

   textureName          = "particleTest";

   useInvAlpha =  true;
   spinRandomMin = -10.0;
   spinRandomMax =  10.0;

   textureName = "special/Smoke/bigSmoke";

   colors[0]     = "0.6 0.5 0.4 1.0";
   colors[1]     = "0.4 0.3 0.2 0.5";
   colors[2]     = "0.2 0.2 0.1 0.0";
   sizes[0]      = 1.0;
   sizes[1]      = 2.0;
   sizes[2]      = 3.0;
   times[0]      = 1;
   times[1]      = 2;
   times[2]      = 3;
};

datablock ParticleEmitterData(mp5ExplosionSmokeEmitter2)
{
   ejectionOffset = 1000.0;
   ejectionPeriodMS = 100;
   periodVarianceMS = 0;

   ejectionVelocity = -200.0;
   velocityVariance = 0.25;

   thetaMin         = 0.0;
   thetaMax         = 180.0;

   lifetimeMS       = 8000;

   particles = "mp5ExplosionSmoke2";
};

//----------------------------------------------------------------------------
// Explosion smoke particles3
//----------------------------------------------------------------------------

datablock ParticleData(mp5ExplosionSmoke3)
{
   dragCoeffiecient     = 0;
   gravityCoefficient   = 0;
   inheritedVelFactor   = 0;

   lifetimeMS           = 8000;
   lifetimeVarianceMS   = 0;

   textureName          = "particleTest";

   useInvAlpha =  true;
   spinRandomMin = -100.0;
   spinRandomMax =  100.0;

   animateTexture = true;
   framesPerSec = 11;

   animTexName[00]       = "special/Smoke/smoke_001";
   animTexName[01]       = "special/Smoke/smoke_002";
   animTexName[02]       = "special/Smoke/smoke_003";
   animTexName[03]       = "special/Smoke/smoke_004";
   animTexName[04]       = "special/Smoke/smoke_005";
   animTexName[05]       = "special/Smoke/smoke_006";
   animTexName[06]       = "special/Smoke/smoke_007";
   animTexName[07]       = "special/Smoke/smoke_008";
   animTexName[08]       = "special/Smoke/smoke_009";
   animTexName[09]       = "special/Smoke/smoke_010";
   animTexName[10]       = "special/Smoke/smoke_011";
   animTexName[11]       = "special/Smoke/smoke_012";


   colors[0]     = "1.0 0.7 0.5 1.0";
   colors[1]     = "1.0 0.5 0.2 1.0";
   colors[2]     = "1.0 0.25 0.1 1.0";
   colors[3]     = "0.6 0.7 0.4 1.0";
   sizes[0]      = 5.0;
   sizes[1]      = 4.0;
   sizes[2]      = 3.0;
   sizes[3]      = 2.0;
   times[0]      = 0.0;
   times[1]      = 0.2;
   times[2]      = 0.5;
   times[3]      = 1.0;
};
datablock ParticleEmitterData(mp5ExplosionSmokeEmitter3)
{
   ejectionOffset = 0;
   ejectionPeriodMS = 1000;
   periodVarianceMS = 0;

   ejectionVelocity = 50.0;
   velocityVariance = 10;
   //acceleration = -7.0;
   
   thetaMin         = 0.0;
   thetaMax         = 180.0;

   lifetimeMS       = 8770;

   particles = "mp5ExplosionSmoke3";
};
//---------------------------------------------------------------------------
// Shockwaves
//---------------------------------------------------------------------------
datablock ShockwaveData(mp5Shockwave)
{
   width = 100.0;
   numSegments = 40;
   numVertSegments = 6;
   velocity = 25;
   acceleration = -7.0;
   lifetimeMS = 8770;
   height = 0.0;
   verticalCurve = 1;
      is2D = true;

   texture[0] = "special/cloaktexture";
   texture[1] = "special/grainy";
   texWrap = 1.0;

   times[0] = 0.0;
   times[1] = 0.5;
   times[2] = 1.0;

   colors[0] = "1 0 0";
   colors[1] = "0.5 0 0.5";
   colors[2] = "0 0 1";

   mapToTerrain = false;
   orientToNormal = false;
   renderBottom = true;
};
//////////////////////////////
//////////////////////////////
datablock ShockwaveData(mp5Shockwave2)
{
width = 35.0;
numSegments = 32;
numVertSegments = 20;//was 6
velocity = 20;
acceleration = 3.0;
lifetimeMS = 1000;
height = 2.0;
verticalCurve = 0.5;
is2D = false;

texture[0] = "special/shockwave5";
texture[1] = "special/gradient";
texWrap = 6.0;

times[0] = 0.0;
times[1] = 0.5;
times[2] = 1.0;

colors[0]     = "0.1 0.3 1.0 1.0";
colors[1]     = "0.1 0.3 1.0 1.0";
colors[2]     = "0.0 0.0 0.0 0.0";

mapToTerrain = false;
orientToNormal = false;
renderBottom = true;
};
//--------------------------------------------------------------------------
// Explosion
//--------------------------------------
datablock ParticleData(mp5ExplosionParticle)
{
   dragCoefficient      = 2;
   gravityCoefficient   = 0.2;
   inheritedVelFactor   = 0.2;
   constantAcceleration = 0.0;
   lifetimeMS           = 75;
   lifetimeVarianceMS   = 15;
   textureName          = "particleTest";
   colors[0]     = "0.56 0.36 0.26 1.0";
   colors[1]     = "0.56 0.36 0.26 0.0";
   sizes[0]      = 30;
   sizes[1]      = 40;
};

datablock ParticleEmitterData(mp5ExplosionEmitter)
{
   ejectionPeriodMS = 7;
   periodVarianceMS = 0;
   ejectionVelocity = 5;
   velocityVariance = 1.0;
   ejectionOffset   = 0.0;
   thetaMin         = 0;
   thetaMax         = 60;
   phiReferenceVel  = 0;
   phiVariance      = 360;
   overrideAdvances = false;
   particles = "mp5ExplosionParticle";
};

datablock ExplosionData(mp5BoltExplosion)
{
   explosionShape = "Disc_explosion.dts";
   playSpeed = 0.2;
   faceViewer           = true;
   
   shockwave[0] = mp5Shockwave;
   shockwaveOnTerrain = false;
   faceViewer           = true;


   emitter[0] = mp5ExplosionSmokeEmitter2;
   sizes[0] = "10.0 10.0 10.0";
   times[0]      = 00.0;
   lifetimeMS = 9000;
   delayMS = 0;

   offset = 0.0;


};


datablock ExplosionData(mp5BoltExplosion2)
{
   explosionShape = "mortar_explosion.dts";
   scale = 10;
   playSpeed = 1;
   faceViewer = true;
   
   shockwave[0] = mp5Shockwave2;
   shockwaveOnTerrain = true;
   //faceViewer           = true;

   emitter[0] = mp5ExplosionSmokeEmitter3;
   sizes[0] = "2 2 2";
   times[0]      = 0.0;

   lifetimeMS = 90000;
   delayMS = 0;

   offset = 0.0;
};
//--------------------------------------------------------------------------
// Splash
//--------------------------------------------------------------------------
datablock ParticleData(mp5Mist)
{
   dragCoefficient      = 2.0;
   gravityCoefficient   = -0.05;
   inheritedVelFactor   = 0.0;
   constantAcceleration = 0.0;
   lifetimeMS           = 400;
   lifetimeVarianceMS   = 100;
   useInvAlpha          = false;
   spinRandomMin        = -90.0;
   spinRandomMax        = 500.0;
   textureName          = "particleTest";
   colors[0]     = "0.7 0.8 1.0 1.0";
   colors[1]     = "0.7 0.8 1.0 0.5";
   colors[2]     = "0.7 0.8 1.0 0.0";
   sizes[0]      = 0.5;
   sizes[1]      = 0.5;
   sizes[2]      = 0.8;
   times[0]      = 0.0;
   times[1]      = 0.5;
   times[2]      = 1.0;
};

datablock ParticleEmitterData(mp5MistEmitter)
{
   ejectionPeriodMS = 5;
   periodVarianceMS = 0;
   ejectionVelocity = 3.0;
   velocityVariance = 2.0;
   ejectionOffset   = 0.0;
   thetaMin         = 85;
   thetaMax         = 85;
   phiReferenceVel  = 0;
   phiVariance      = 360;
   overrideAdvances = false;
   lifetimeMS       = 250;
   particles = "mp5Mist";
};

datablock ParticleData( mp5SplashParticle2 )
{

   dragCoeffiecient     = 0.4;
   gravityCoefficient   = -0.03;   // rises slowly
   inheritedVelFactor   = 0.025;

   lifetimeMS           = 600;
   lifetimeVarianceMS   = 300;

   textureName          = "particleTest";

   useInvAlpha =  false;
   spinRandomMin = -200.0;
   spinRandomMax =  200.0;


   colors[0]     = "0.7 0.8 1.0 1.0";
   colors[1]     = "0.7 0.8 1.0 0.5";
   colors[2]     = "0.7 0.8 1.0 0.0";
   sizes[0]      = 0.5;
   sizes[1]      = 1.0;
   sizes[2]      = 2.0;
   times[0]      = 0.0;
   times[1]      = 0.5;
   times[2]      = 1.0;
};

datablock ParticleEmitterData( mp5SplashEmitter2 )
{
   ejectionPeriodMS = 25;
   ejectionOffset = 0.2;
   periodVarianceMS = 0;
   ejectionVelocity = 2.25;
   velocityVariance = 0.50;
   thetaMin         = 0.0;
   thetaMax         = 30.0;
   lifetimeMS       = 250;

   particles = "mp5SplashParticle2";
};


datablock ParticleData( mp5SplashParticle )
{
   dragCoefficient      = 1;
   gravityCoefficient   = 0.2;
   inheritedVelFactor   = 0.2;
   constantAcceleration = -0.0;
   lifetimeMS           = 600;
   lifetimeVarianceMS   = 0;
   textureName          = "special/droplet";
   colors[0]     = "0.7 0.8 1.0 1.0";
   colors[1]     = "0.7 0.8 1.0 0.5";
   colors[2]     = "0.7 0.8 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( mp5SplashEmitter )
{
   ejectionPeriodMS = 1;
   periodVarianceMS = 0;
   ejectionVelocity = 3;
   velocityVariance = 1.0;
   ejectionOffset   = 0.0;
   thetaMin         = 60;
   thetaMax         = 80;
   phiReferenceVel  = 0;
   phiVariance      = 360;
   overrideAdvances = false;
   orientParticles  = true;
   lifetimeMS       = 100;
   particles = "mp5SplashParticle";
};


datablock SplashData(mp5Splash)
{
   numSegments = 15;
   ejectionFreq = 0.0001;
   ejectionAngle = 45;
   ringLifetime = 0.5;
   lifetimeMS = 400;
   velocity = 5.0;
   startRadius = 0.0;
   acceleration = -3.0;
   texWrap = 5.0;

   texture = "special/water2";

   emitter[0] = mp5SplashEmitter;
   emitter[1] = mp5SplashEmitter2;
   emitter[2] = mp5MistEmitter;

   colors[0] = "0.7 0.8 1.0 0.0";
   colors[1] = "0.7 0.8 1.0 1.0";
   colors[2] = "0.7 0.8 1.0 0.0";
   colors[3] = "0.7 0.8 1.0 0.0";
   times[0] = 0.0;
   times[1] = 0.4;
   times[2] = 0.8;
   times[3] = 1.0;
};

//--------------------------------------------------------------------------
// Projectile
//--------------------------------------
datablock ParticleData(mp5SmokeParticle)
{
   dragCoeffiecient     = 0.0;
   gravityCoefficient   = -0.2;   // rises slowly
   inheritedVelFactor   = 0.00;

   lifetimeMS           = 1000;  // lasts 2 second
   lifetimeVarianceMS   = 1050;   // ...more or less

   textureName          = "special/droplet";

   useInvAlpha = true;
   spinRandomMin = -30.0;
   spinRandomMax = 30.0;

   colors[0]     = "0.9 0.9 0.9 1.0";
   colors[1]     = "0.6 0.6 0.6 1.0";
   colors[2]     = "0.4 0.4 0.4 0.0";

   sizes[0]      = 2;
   sizes[1]      = 6;
   sizes[2]      = 18;

   times[0]      = 0.0;
   times[1]      = 0.2;
   times[2]      = 1.0;
};

datablock ParticleEmitterData(mp5SmokeEmitter)
{
   ejectionPeriodMS = 15;
   periodVarianceMS = 5;

   ejectionVelocity = 1.25;
   velocityVariance = 0.50;

   thetaMin         = 0.0;
   thetaMax         = 90.0;

   particles = "mp5SmokeParticle";
};



//--------------------------------------------------------------------------
// Particle Effects
//--------------------------------------
datablock ParticleData(mp5Particle)
{
   dragCoeffiecient     = 0;
   gravityCoefficient   = 0;
   inheritedVelFactor   = 0;

   lifetimeMS           = 1400;
   lifetimeVarianceMS   = 20;

   textureName          = "particleTest";

   useInvAlpha = false;
   spinRandomMin = -100.0;
   spinRandomMax = 100.0;

   animateTexture = true;
   framesPerSec = 15;

   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]     = "1.0 0.7 0.5 1.0";
   colors[1]     = "1.0 0.5 0.2 1.0";
   colors[2]     = "1.0 0.25 0.1 1.0";
   colors[3]     = "0.6 0.7 0.4 1.0";
   sizes[0]      = 5.0;
   sizes[1]      = 4.0;
   sizes[2]      = 3.0;
   sizes[3]      = 2.0;
   times[0]      = 0.0;
   times[1]      = 0.2;
   times[2]      = 0.5;
   times[3]      = 1.0;

};

datablock ParticleEmitterData(mp5Emitter)
{
   ejectionPeriodMS = 10;
   periodVarianceMS = 0;

   ejectionVelocity = 1.5;
   velocityVariance = 0.3;

   thetaMin         = 0.0;
   thetaMax         = 30.0;

   particles[0] = "mp5Particle";

};

//--------------------------------------------------------------------------
// Projectile
//--------------------------------------

datablock LinearProjectileData(Mp5Bullet)
{
projectileShapeName = "plasmabolt.dts"; // disc.dts
scale               = "7.0 7.0 7.0";
emitterDelay = -1;

baseEmitter = mp5Emitter;


hasdirectDamage = true;
directDamage = 0.8;
hasDamageRadius = true;
indirectDamage = 0.2;
damageRadius = 200.0;
radiusDamageType = $DamageType::Emp;
kickBackStrength = -1000000;
sound = PlasmaProjectileSound;
explosion = "mp5BoltExplosion";
underwaterExplosion = "mp5BoltExplosion";
dryVelocity = 60;
wetVelocity = 40;
velInheritFactor = 0.5;
fizzleTimeMS = 3000;
lifetimeMS = 5000;
explodeOnDeath = true;
reflectOnWaterImpactAngle = 15.0;
explodeOnWaterImpact = false;
deflectionOnWaterImpact = 0.6;
fizzleUnderwaterMS = 5000;

hasLight = true;
lightRadius = 15.0;
lightColor = "1 1 0.5";

};

///////////////////////////
////////2//////////////////
///////////////////////////
datablock LinearProjectileData(Mp5Bullet2)
{
projectileShapeName = "plasmabolt.dts"; // disc.dts
scale               = "1.0 1.0 1.0";
emitterDelay = -1;

//baseEmitter = mp5Emitter;


hasdirectDamage = true;
directDamage = 0.2;
hasDamageRadius = true;
indirectDamage = 0.2;
damageRadius = 500.0;
radiusDamageType = $DamageType::Plasma;
kickBackStrength = -1000;
explosion = "mp5BoltExplosion2";
underwaterExplosion = "mp5BoltExplosion2";
dryVelocity = 0;
wetVelocity = 0;
velInheritFactor = 0;
fizzleTimeMS = 9000;
lifetimeMS = 8200;
explodeOnDeath = true;
};
datablock LinearProjectileData(Mp5Bullet3)
{
projectileShapeName = "plasmabolt.dts"; // disc.dts
scale               = "1.0 1.0 1.0";
emitterDelay = -1;

//baseEmitter = mp5Emitter;


hasdirectDamage = true;
directDamage = 0.03;
hasDamageRadius = true;
indirectDamage = 0.03;
damageRadius = 200.0;
radiusDamageType = $DamageType::Plasma;
kickBackStrength = -1000;
explosion = "mp5BoltExplosion2";
underwaterExplosion = "mp5BoltExplosion2";
dryVelocity = 0;
wetVelocity = 0;
velInheritFactor = 0;
fizzleTimeMS = 2000;
lifetimeMS = 1000;
explodeOnDeath = true;
};

datablock LinearProjectileData(Mp5Bullet4)
{
projectileShapeName = "plasmabolt.dts"; // disc.dts
scale               = "1.0 1.0 1.0";
emitterDelay = -1;

//baseEmitter = mp5Emitter;


hasdirectDamage = true;
directDamage = 0.03;
hasDamageRadius = true;
indirectDamage = 0.03;
damageRadius = 200.0;
radiusDamageType = $DamageType::Plasma;
kickBackStrength = -1000;
explosion = "mp5BoltExplosion2";
underwaterExplosion = "mp5BoltExplosion2";
dryVelocity = 0;
wetVelocity = 0;
velInheritFactor = 0;
fizzleTimeMS = 2000;
lifetimeMS = 1000;
explodeOnDeath = true;
};
//--------------------------------------------------------------------------
// Weapon
//--------------------------------------
datablock ItemData(mp5)
{
   className = Weapon;
   catagory = "Spawn Items";
   shapeFile = "weapon_plasma.dts";
   image = mp5Image;
   mass = 1;
   elasticity = 0.2;
   friction = 0.6;
   pickupRadius = 2;
   pickUpName = "meteor launcher";


};

datablock ShapeBaseImageData(mp5Image)
{
   className = WeaponImage;
   shapeFile = "weapon_plasma.dts";
   item = mp5;
   offset = "0 0 0";
   usesEnergy = true;
   fireEnergy = 15;
   minEnergy = 17;

   projectile = Mp5Bullet;
   projectileType = LinearProjectile;



   stateName[0] = "Activate";
   stateTransitionOnTimeout[0] = "ActivateReady";
   stateTimeoutValue[0] = 0.9;
   stateSequence[0] = "Activate";
   stateSound[0] = PlasmaSwitchSound;

   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.9;
   stateFire[3] = true;
   stateRecoil[3] = LightRecoil;
   stateAllowImageChange[3] = false;
   stateScript[3] = "onFire";
   stateEmitterTime[3] = 0.9;
   stateSound[3] = PlasmaFireSound;

   stateName[4] = "Reload";
   stateTransitionOnNoAmmo[4] = "NoAmmo";
   stateTransitionOnTimeout[4] = "Ready";
   stateTimeoutValue[4] = 0.9;
   stateAllowImageChange[4] = false;
   stateSequence[4] = "Reload";
   stateSound[4] = PlasmaReloadSound;

   stateName[5] = "NoAmmo";
   stateTransitionOnAmmo[5] = "Reload";
   stateSequence[5] = "NoAmmo";
   stateTransitionOnTriggerDown[5] = "DryFire";

   stateName[6]       = "DryFire";
   stateSound[6]      = PlasmaDryFireSound;
   stateTimeoutValue[6]        = 0.9;
   stateTransitionOnTimeout[6] = "NoAmmo";
   
   stateName[7]       = "WetFire";
   stateSound[7]      = PlasmaFireWetSound;
   stateTimeoutValue[7]        = 0.9;
   stateTransitionOnTimeout[7] = "Ready";
   
   stateName[8]               = "CheckWet";
   stateTransitionOnWet[8]    = "WetFire";
   stateTransitionOnNotWet[8] = "Fire"; 
};



function mp5Image::onmount(%this, %obj, %slot)
{
      %message = "meteor launcher";
      CommandToClient(%obj.client, 'BottomPrint', %message, 2, 1 );
}

function Mp5Bullet::onExplode(%data, %proj, %pos, %mod)
{
for(%i = 0; %i < 1; %i++)
      {
      %vector = "0 0 0";
      %Q = new (LinearProjectile)()
      {
         dataBlock        = Mp5Bullet2;
         initialDirection = %vector;
         initialPosition  = %pos;
         sourceObject     = %proj.sourceObject;
         sourceSlot       = 1;
         vehicleObject    = 0;
     };

      MissionCleanup.add(%Q);
     }
    Parent::onExplode(%data, %proj, %pos, %mod);

}
function Mp5Bullet2::onExplode(%data, %proj, %pos, %mod)
{
   for(%i=0; %i<3 ;%i++)
   {
      %vector2 = "0 0 0";
      %Q = new (LinearProjectile)()
      {
         dataBlock        = Mp5Bullet3;
         initialDirection = %vector2;
         initialPosition  = %pos;
         sourceObject     = %proj.sourceObject;
         sourceSlot       = 1;
         vehicleObject    = 0;
     };
      %projectileSpread = 2.88;
      %vector = "0 0 -1";
      %x = (getRandom() + 0.5) * 2 * 3.1415926 * %projectileSpread;
      %y = (getRandom() + 0.5) * 2 * 3.1415926 * %projectileSpread;
      %z = (getRandom() + 0.5) * 2 * 3.1415926 * %projectileSpread;
      %mat = MatrixCreateFromEuler(%x @ " " @ %z);
      %vector = MatrixMulVector(%mat, %vector);

      %p = new  SeekerProjectile()
       {
         dataBlock        = TransformerMissile;
         initialDirection = %vector;
         initialPosition  = %pos;
       };
      //MissionCleanup.add(%p);
      MissionCleanup.add(%Q,%p);
     }

   Parent::onExplode(%data, %proj, %pos, %mod);
}
function Mp5Bullet3::onExplode(%data, %proj, %pos, %mod)
{
   for(%i=0; %i<1 ;%i++)
   {
      %vector2 = "0 0 0";
      %Q = new (LinearProjectile)()
      {
         dataBlock        = Mp5Bullet4;
         initialDirection = %vector2;
         initialPosition  = %pos;
         sourceObject     = %proj.sourceObject;
         sourceSlot       = 1;
         vehicleObject    = 0;
     };
      %projectileSpread = 2.88;
      %vector = "0 0 -1";
      %x = (getRandom() + 0.5) * 2 * 3.1415926 * %projectileSpread;
      %y = (getRandom() + 0.5) * 2 * 3.1415926 * %projectileSpread;
      %z = (getRandom() + 0.5) * 2 * 3.1415926 * %projectileSpread;
      %mat = MatrixCreateFromEuler(%x @ " " @ %z);
      %vector = MatrixMulVector(%mat, %vector);

      %p = new  SeekerProjectile()
       {
         dataBlock        = TransformerMissile;
         initialDirection = %vector;
         initialPosition  = %pos;
       };
      //MissionCleanup.add(%p);
      MissionCleanup.add(%Q,%p);
     }

   Parent::onExplode(%data, %proj, %pos, %mod);
}
function Mp5Bullet4::onExplode(%data, %proj, %pos, %mod)
{

   for(%i=0; %i<1 ;%i++)
   {
      %projectileSpread = 2.88;
      %vector = "0 0 -1";
      %x = (getRandom() + 0.5) * 2 * 3.1415926 * %projectileSpread;
      %y = (getRandom() + 0.5) * 2 * 3.1415926 * %projectileSpread;
      %z = (getRandom() + 0.5) * 2 * 3.1415926 * %projectileSpread;
      %mat = MatrixCreateFromEuler(%x @ " " @ %z);
      %vector = MatrixMulVector(%mat, %vector);

      %p = new  SeekerProjectile()
       {
         dataBlock        = TransformerMissile;
         initialDirection = %vector;
         initialPosition  = %pos;
       };
      MissionCleanup.add(%p);
     }

   Parent::onExplode(%data, %proj, %pos, %mod);
}

