Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ForceRequiredAddOn("Weapon_Gun");
- datablock AudioProfile(swol_torchIgniteSound)
- {
- filename = "./torchIgnite.wav";
- description = AudioClosest3d;
- preload = true;
- };
- datablock AudioProfile(swol_torchEndSound)
- {
- filename = "./torchEnd.wav";
- description = AudioClosest3d;
- preload = true;
- };
- datablock AudioProfile(swol_torchLoopSound)
- {
- filename = "./torchLoop.wav";
- description = AudioClosestLooping3d;
- preload = true;
- };
- datablock ParticleData(TorchHitParticle)
- {
- dragCoefficient = 2;
- gravityCoefficient = 1.0;
- inheritedVelFactor = 0.2;
- constantAcceleration = 0.0;
- spinRandomMin = -90;
- spinRandomMax = 90;
- lifetimeMS = 500;
- lifetimeVarianceMS = 300;
- textureName = "base/data/particles/dot";
- colors[0] = "0.0 0.9 0.0 0.7";
- colors[1] = "0.0 0.4 0.0 0.1";
- sizes[0] = 0.2;
- sizes[1] = 0.02;
- times[0] = 0.0;
- times[1] = 1.0;
- };
- datablock ParticleEmitterData(TorchHitEmitter)
- {
- ejectionPeriodMS = 7;
- periodVarianceMS = 1;
- ejectionVelocity = 3;
- velocityVariance = 2.0;
- ejectionOffset = 0.0;
- thetaMin = 0;
- thetaMax = 60;
- phiReferenceVel = 0;
- phiVariance = 360;
- overrideAdvance = false;
- particles = "TorchHitParticle";
- uiName = "Torch Fire";
- };
- datablock ExplosionData(TorchExplosion)
- {
- explosionShape = "base/data/shapes/empty.dts";
- lifeTimeMS = 500;
- soundProfile = swordHitSound;
- particleEmitter = TorchHitEmitter;
- particleDensity = 15;
- particleRadius = 0.2;
- faceViewer = true;
- explosionScale = "1 1 1";
- shakeCamera = true;
- camShakeFreq = "1.0 1.0 1.0";
- camShakeAmp = "20.0 25.0 10.0";
- camShakeDuration = 0.1;
- camShakeRadius = 8.0;
- // impulseRadius = 2;
- // impulseForce = 1500;
- // damageRadius = 0.01;
- // radiusDamage = 0.01;
- };
- datablock fxLightData(swol_torchLight)
- {
- LightOn = true;
- radius = 6;
- brightness = 9;
- color = "0.8 0.7 0.4 1";
- FlareOn = false;
- // FlareTP = true;
- // Flarebitmap = "base/lighting/corona";
- // FlareColor = "1 1 1";
- // ConstantSizeOn = false;
- // ConstantSize = 1;
- // NearSize = 3;
- // FarSize = 0.5;
- // NearDistance = 10.0;
- // FarDistance = 30.0;
- // FadeTime = 0.1;
- // BlendMode = 0;
- AnimColor = false;
- AnimBrightness = true;
- AnimOffsets = false;
- AnimRotation = false;
- LinkFlare = false;
- LinkFlareSize = false;
- MinColor = "1 1 0";
- MaxColor = "0 0 1";
- MinBrightness = 0.0;
- MaxBrightness = 5.0;
- MinRadius = 0.1;
- MaxRadius = 10;
- StartOffset = "-5 0 0";
- EndOffset = "5 0 0";
- MinRotation = 0;
- MaxRotation = 359;
- SingleColorKeys = false;
- RedKeys = "AWTCFAH";
- GreenKeys = "AWTCFAH";
- BlueKeys = "AWTCFAH";
- BrightnessKeys = "DEDEDFGF";
- RadiusKeys = "AZAAAAA";
- OffsetKeys = "AZAAAAA";
- RotationKeys = "AZAAAAA";
- ColorTime = 1.0;
- BrightnessTime = 1.0;
- RadiusTime = 1.0;
- OffsetTime = 1.0;
- RotationTime = 1.0;
- LerpColor = false;
- LerpBrightness = false;
- LerpRadius = false;
- LerpOffset = false;
- LerpRotation = false;
- };
- datablock ParticleData(swol_torchFireParticle)
- {
- dragCoefficient = 1;
- gravityCoefficient = -1.2;
- inheritedVelFactor = 0;
- constantAcceleration = 0;
- lifetimeMS = 400;
- lifetimeVarianceMS = 200;
- textureName = "base/data/particles/cloud";
- spinSpeed = 0;
- spinRandomMin = -20;
- spinRandomMax = 20;
- colors[0] = "1 1 0.25 0.4";
- colors[1] = "1 0.7 0.25 0.8";
- colors[2] = "1 0 0 0";
- sizes[0] = 0.1;
- sizes[1] = 0.35;
- sizes[2] = 0.2;
- times[1] = 0.3;
- times[2] = 1;
- useInvAlpha = true;
- };
- datablock ParticleEmitterData(swol_torchFireEmitter)
- {
- ejectionPeriodMS = 4;
- periodVarianceMS = 0;
- velocityVariance = 0;
- ejectionVelocity = 0;
- ejectionOffset = 0.11;
- thetaMin = 0;
- thetaMax = 180;
- phiReferenceVel = 0;
- phiVariance = 360;
- overrideAdvance = false;
- lifetimeMS = 0;
- particles = swol_torchFireParticle;
- uiName = "Torch Fire";
- };
- datablock ParticleData(swol_torchSmokeParticle)
- {
- dragCoefficient = 2;
- gravityCoefficient = -0.8;
- inheritedVelFactor = 0;
- constantAcceleration = 0;
- lifetimeMS = 400;
- lifetimeVarianceMS = 200;
- textureName = "base/data/particles/cloud";
- spinSpeed = 0;
- spinRandomMin = -20;
- spinRandomMax = 20;
- colors[0] = "0.4 0.4 0.4 0.2";
- colors[1] = "0.6 0.5 0.3 0.3";
- colors[2] = "0.3 0.3 0.3 0";
- sizes[0] = 0.1;
- sizes[1] = 0.35;
- sizes[2] = 0.2;
- times[1] = 0.3;
- times[2] = 1;
- useInvAlpha = true;
- };
- datablock ParticleEmitterData(swol_torchSmokeEmitter)
- {
- ejectionPeriodMS = 4;
- periodVarianceMS = 0;
- velocityVariance = 0.4;
- ejectionVelocity = 0;
- ejectionOffset = 0.11;
- thetaMin = 0;
- thetaMax = 180;
- phiReferenceVel = 0;
- phiVariance = 360;
- overrideAdvance = false;
- lifetimeMS = 0;
- particles = swol_torchSmokeParticle;
- uiName = "Torch Smoke";
- };
- //projectile
- AddDamageType("TorchHit", '<bitmap:add-ons/Bot_BugMod1/CI_Torch> %1', '%2 <bitmap:add-ons/Bot_BugMod1/CI_Torch> %1',0.75,1);
- datablock ProjectileData(TorchProjectile)
- {
- directDamage = 10;
- directDamageType = $DamageType::TorchHit;
- radiusDamageType = $DamageType::TorchHit;
- explosion = TorchExplosion;
- impactImpulse = 0;
- verticalImpulse = 0; //200
- muzzleVelocity = 70;
- velInheritFactor = 1;
- armingDelay = 0;
- lifetime = 80;
- fadeDelay = 70;
- bounceElasticity = 0;
- bounceFriction = 0;
- isBallistic = false;
- gravityMod = 0.0;
- hasLight = false;
- lightRadius = 3.0;
- lightColor = "0 0 0.5";
- uiName = "Torch Fire";
- //Fire stuff
- Fire = 1;
- FireSound = 1;
- FireImage = FireStatusPlayerImage;
- FireChance = 100; //Chance to Fire victim (100 for always)
- FireType = "TorchFire"; //Example: "TorchFire", used for immunity checks and curing of specific Fires
- FireDamage = 10; //Do you need an example here? >_>
- FireMinHealth = 0; //Fire stops when it reaches this amount of health. (0 to kill :D)
- FirePulseDelay = 1000; //Delay between pulses
- FireMaxPulses = 4; //Maximum amount of pulses
- FireOverwrite = 2;
- };
- //////////
- // item //
- //////////
- datablock ItemData(torchItem)
- {
- category = "Weapon"; // Mission editor category
- className = "Weapon"; // For inventory system
- // Basic Item Properties
- shapeFile = "./Torch.dts";
- mass = 1;
- density = 0.2;
- elasticity = 0.2;
- friction = 0.6;
- emap = true;
- //gui stuff
- uiName = "Torch";
- iconName = "./icon_torch";
- doColorShift = true;
- colorShiftColor = "0.471 0.471 0.471 1.000";
- // Dynamic properties defined by the scripts
- image = swol_torchImage;
- canDrop = true;
- };
- datablock shapeBaseImageData(swol_torchImage)
- {
- className = "WeaponImage";
- shapeFile = "./torch.dts";
- emap = true;
- mountPoint = 0;
- offset = "0 0 0";
- item = "";
- doColorShift = true;
- colorShiftColor = "0.37 0.25 0.1 1";
- melee = true;
- armReady = true;
- eyeOffset = "0.7 1.4 -0.8";
- eyeOffset = "";
- rotation = "0 0 0 180";
- eyeRotation = "0 0 0 0";
- stateTimeoutValue[0] = 0.1;
- stateTransitionOnTimeout[0] = "Ignite";
- stateName[1] = "Ignite";
- stateScript[1] = "onIgnite";
- stateTimeoutValue[1] = 0.2;
- stateEmitter[1] = gunFlashEmitter;
- stateEmitterTime[1] = 0.1;
- stateTransitionOnTimeout[1] = "FireA";
- stateName[2] = "FireA";
- stateTimeoutValue[3] = 1000;
- stateEmitter[2] = swol_torchFireEmitter;
- stateEmitterTime[2] = 10000;
- stateTransitionOnTimeout[3] = "FireB";
- stateName[3] = "FireB";
- stateTimeoutValue[3] = 0.01;
- stateEmitter[3] = swol_torchFireEmitter;
- stateEmitterTime[3] = 1000;
- stateTransitionOnTimeout[3] = "FireA";
- };
- datablock shapeBaseImageData(swol_torchImageEnd)
- {
- className = "WeaponImage";
- shapeFile = "./torch.dts";
- emap = true;
- mountPoint = 0;
- offset = "-0.008 0.01 -0.13";
- item = "";
- doColorShift = true;
- colorShiftColor = "0.37 0.25 0.1 1";
- armReady = true;
- eyeOffset = "0.7 1.4 -0.8";
- eyeOffset = "";
- rotation = "0 0 0 180";
- eyeRotation = "0 0 0 0";
- stateName[0] = "Ready";
- stateTimeoutValue[0] = 0.1;
- stateTransitionOnTimeout[0] = "FireA";
- stateName[2] = "FireA";
- stateTimeoutValue[3] = 1.2;
- stateEmitter[2] = swol_torchSmokeEmitter;
- stateEmitterTime[2] = 1.2;
- stateTransitionOnTimeout[2] = "Done";
- stateName[3] = "Done";
- };
- function swol_torchImage::onIgnite(%db,%pl,%slot)
- {
- serverPlay3D(swol_torchIgniteSound,%pl.getPosition());
- %pl.playThread(3,plant);
- %pl.startTorchSched = %db.schedule(150,mountLight,%pl,%slot);
- }
- function swol_torchImage::mountLight(%db,%pl,%slot)
- {
- %pl.light = new fxLight()
- {
- datablock = swol_torchLight;
- };
- missionCleanup.add(%pl.light);
- %pl.light.setTransform(%pl.getPosition());
- %pl.light.attachToObject(%pl);
- %pl.light.player = %pl;
- %pl.playAudio(2,swol_torchLoopSound);
- }
- //function swol_torchImage::putOutTorch(%db,%pl,%slot)
- //{
- //if(isObject(%pl.light))
- //{
- //%pl.light.delete();
- //%pl.playAudio(2,swol_torchEndSound);
- //%pl.schedule(0,mountImage,swol_torchImageEnd,0);
- //%db.schedule(1800,unMountEnd,%pl,%slot);
- //%pl.playThread(3,plant);
- //}
- //else
- //{
- //cancel(%pl.startTorchSched);
- //}
- //}
- function swol_torchImage::unMountEnd(%db,%pl,%slot)
- {
- if(%im = %pl.getMountedImage(0))
- {
- if(%im == nameToId(swol_torchImageEnd))
- {
- %pl.unMountImage(0);
- %pl.playThread(0,root);
- if(%im = %pl.getMountedImage(0))
- {
- if(%im.armReady)
- {
- %pl.playThread(0,armReadyRight);
- }
- }
- }
- }
- }
- function swol_torchImage::unMountCheck(%db,%pl,%slot)
- {
- if(!isObject(%pl.getMountedImage(0)))
- %pl.playThread(0,armReadyRight);
- }
- function swol_torchImageEnd::unMountCheck(%db,%pl,%slot)
- {
- if(!isObject(%pl.getMountedImage(0)))
- %pl.playThread(0,armReadyRight);
- }
- function swol_torchImage::onUnMount(%db,%pl,%slot)
- {
- if(isObject(%pl.light))
- {
- %pl.light.delete();
- %pl.playAudio(2,swol_torchEndSound);
- }
- else
- {
- cancel(%pl.startTorchSched);
- }
- %pl.lastTorchTime = getSimTime();
- }
- function servercmdlight(%a, %b){}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement