Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2018
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.12 KB | None | 0 0
  1. ForceRequiredAddOn("Weapon_Gun");
  2. datablock AudioProfile(swol_torchIgniteSound)
  3. {
  4. filename = "./torchIgnite.wav";
  5. description = AudioClosest3d;
  6. preload = true;
  7. };
  8. datablock AudioProfile(swol_torchEndSound)
  9. {
  10. filename = "./torchEnd.wav";
  11. description = AudioClosest3d;
  12. preload = true;
  13. };
  14. datablock AudioProfile(swol_torchLoopSound)
  15. {
  16. filename = "./torchLoop.wav";
  17. description = AudioClosestLooping3d;
  18. preload = true;
  19. };
  20.  
  21. datablock ParticleData(TorchHitParticle)
  22. {
  23. dragCoefficient = 2;
  24. gravityCoefficient = 1.0;
  25. inheritedVelFactor = 0.2;
  26. constantAcceleration = 0.0;
  27. spinRandomMin = -90;
  28. spinRandomMax = 90;
  29. lifetimeMS = 500;
  30. lifetimeVarianceMS = 300;
  31. textureName = "base/data/particles/dot";
  32. colors[0] = "0.0 0.9 0.0 0.7";
  33. colors[1] = "0.0 0.4 0.0 0.1";
  34. sizes[0] = 0.2;
  35. sizes[1] = 0.02;
  36. times[0] = 0.0;
  37. times[1] = 1.0;
  38.  
  39. };
  40.  
  41. datablock ParticleEmitterData(TorchHitEmitter)
  42. {
  43. ejectionPeriodMS = 7;
  44. periodVarianceMS = 1;
  45. ejectionVelocity = 3;
  46. velocityVariance = 2.0;
  47. ejectionOffset = 0.0;
  48. thetaMin = 0;
  49. thetaMax = 60;
  50. phiReferenceVel = 0;
  51. phiVariance = 360;
  52. overrideAdvance = false;
  53. particles = "TorchHitParticle";
  54.  
  55. uiName = "Torch Fire";
  56. };
  57.  
  58. datablock ExplosionData(TorchExplosion)
  59. {
  60. explosionShape = "base/data/shapes/empty.dts";
  61. lifeTimeMS = 500;
  62.  
  63. soundProfile = swordHitSound;
  64.  
  65. particleEmitter = TorchHitEmitter;
  66. particleDensity = 15;
  67. particleRadius = 0.2;
  68.  
  69. faceViewer = true;
  70. explosionScale = "1 1 1";
  71.  
  72. shakeCamera = true;
  73. camShakeFreq = "1.0 1.0 1.0";
  74. camShakeAmp = "20.0 25.0 10.0";
  75. camShakeDuration = 0.1;
  76. camShakeRadius = 8.0;
  77.  
  78. // impulseRadius = 2;
  79. // impulseForce = 1500;
  80.  
  81. // damageRadius = 0.01;
  82. // radiusDamage = 0.01;
  83. };
  84.  
  85.  
  86. datablock fxLightData(swol_torchLight)
  87. {
  88. LightOn = true;
  89. radius = 6;
  90. brightness = 9;
  91. color = "0.8 0.7 0.4 1";
  92.  
  93.  
  94. FlareOn = false;
  95. // FlareTP = true;
  96. // Flarebitmap = "base/lighting/corona";
  97. // FlareColor = "1 1 1";
  98. // ConstantSizeOn = false;
  99. // ConstantSize = 1;
  100. // NearSize = 3;
  101. // FarSize = 0.5;
  102. // NearDistance = 10.0;
  103. // FarDistance = 30.0;
  104. // FadeTime = 0.1;
  105. // BlendMode = 0;
  106.  
  107. AnimColor = false;
  108. AnimBrightness = true;
  109. AnimOffsets = false;
  110. AnimRotation = false;
  111. LinkFlare = false;
  112. LinkFlareSize = false;
  113. MinColor = "1 1 0";
  114. MaxColor = "0 0 1";
  115. MinBrightness = 0.0;
  116. MaxBrightness = 5.0;
  117. MinRadius = 0.1;
  118. MaxRadius = 10;
  119. StartOffset = "-5 0 0";
  120. EndOffset = "5 0 0";
  121. MinRotation = 0;
  122. MaxRotation = 359;
  123.  
  124. SingleColorKeys = false;
  125. RedKeys = "AWTCFAH";
  126. GreenKeys = "AWTCFAH";
  127. BlueKeys = "AWTCFAH";
  128.  
  129. BrightnessKeys = "DEDEDFGF";
  130. RadiusKeys = "AZAAAAA";
  131. OffsetKeys = "AZAAAAA";
  132. RotationKeys = "AZAAAAA";
  133.  
  134. ColorTime = 1.0;
  135. BrightnessTime = 1.0;
  136. RadiusTime = 1.0;
  137. OffsetTime = 1.0;
  138. RotationTime = 1.0;
  139.  
  140. LerpColor = false;
  141. LerpBrightness = false;
  142. LerpRadius = false;
  143. LerpOffset = false;
  144. LerpRotation = false;
  145. };
  146.  
  147. datablock ParticleData(swol_torchFireParticle)
  148. {
  149. dragCoefficient = 1;
  150. gravityCoefficient = -1.2;
  151. inheritedVelFactor = 0;
  152. constantAcceleration = 0;
  153. lifetimeMS = 400;
  154. lifetimeVarianceMS = 200;
  155. textureName = "base/data/particles/cloud";
  156. spinSpeed = 0;
  157. spinRandomMin = -20;
  158. spinRandomMax = 20;
  159. colors[0] = "1 1 0.25 0.4";
  160. colors[1] = "1 0.7 0.25 0.8";
  161. colors[2] = "1 0 0 0";
  162. sizes[0] = 0.1;
  163. sizes[1] = 0.35;
  164. sizes[2] = 0.2;
  165. times[1] = 0.3;
  166. times[2] = 1;
  167. useInvAlpha = true;
  168. };
  169. datablock ParticleEmitterData(swol_torchFireEmitter)
  170. {
  171. ejectionPeriodMS = 4;
  172. periodVarianceMS = 0;
  173. velocityVariance = 0;
  174. ejectionVelocity = 0;
  175. ejectionOffset = 0.11;
  176. thetaMin = 0;
  177. thetaMax = 180;
  178. phiReferenceVel = 0;
  179. phiVariance = 360;
  180. overrideAdvance = false;
  181. lifetimeMS = 0;
  182. particles = swol_torchFireParticle;
  183. uiName = "Torch Fire";
  184. };
  185. datablock ParticleData(swol_torchSmokeParticle)
  186. {
  187. dragCoefficient = 2;
  188. gravityCoefficient = -0.8;
  189. inheritedVelFactor = 0;
  190. constantAcceleration = 0;
  191. lifetimeMS = 400;
  192. lifetimeVarianceMS = 200;
  193. textureName = "base/data/particles/cloud";
  194. spinSpeed = 0;
  195. spinRandomMin = -20;
  196. spinRandomMax = 20;
  197. colors[0] = "0.4 0.4 0.4 0.2";
  198. colors[1] = "0.6 0.5 0.3 0.3";
  199. colors[2] = "0.3 0.3 0.3 0";
  200. sizes[0] = 0.1;
  201. sizes[1] = 0.35;
  202. sizes[2] = 0.2;
  203. times[1] = 0.3;
  204. times[2] = 1;
  205. useInvAlpha = true;
  206. };
  207. datablock ParticleEmitterData(swol_torchSmokeEmitter)
  208. {
  209. ejectionPeriodMS = 4;
  210. periodVarianceMS = 0;
  211. velocityVariance = 0.4;
  212. ejectionVelocity = 0;
  213. ejectionOffset = 0.11;
  214. thetaMin = 0;
  215. thetaMax = 180;
  216. phiReferenceVel = 0;
  217. phiVariance = 360;
  218. overrideAdvance = false;
  219. lifetimeMS = 0;
  220. particles = swol_torchSmokeParticle;
  221.  
  222. uiName = "Torch Smoke";
  223. };
  224.  
  225. //projectile
  226. AddDamageType("TorchHit", '<bitmap:add-ons/Bot_BugMod1/CI_Torch> %1', '%2 <bitmap:add-ons/Bot_BugMod1/CI_Torch> %1',0.75,1);
  227. datablock ProjectileData(TorchProjectile)
  228. {
  229. directDamage = 10;
  230. directDamageType = $DamageType::TorchHit;
  231. radiusDamageType = $DamageType::TorchHit;
  232. explosion = TorchExplosion;
  233.  
  234. impactImpulse = 0;
  235. verticalImpulse = 0; //200
  236.  
  237.  
  238. muzzleVelocity = 70;
  239. velInheritFactor = 1;
  240.  
  241. armingDelay = 0;
  242. lifetime = 80;
  243. fadeDelay = 70;
  244. bounceElasticity = 0;
  245. bounceFriction = 0;
  246. isBallistic = false;
  247. gravityMod = 0.0;
  248.  
  249. hasLight = false;
  250. lightRadius = 3.0;
  251. lightColor = "0 0 0.5";
  252.  
  253. uiName = "Torch Fire";
  254.  
  255. //Fire stuff
  256. Fire = 1;
  257. FireSound = 1;
  258. FireImage = FireStatusPlayerImage;
  259. FireChance = 100; //Chance to Fire victim (100 for always)
  260. FireType = "TorchFire"; //Example: "TorchFire", used for immunity checks and curing of specific Fires
  261. FireDamage = 10; //Do you need an example here? >_>
  262. FireMinHealth = 0; //Fire stops when it reaches this amount of health. (0 to kill :D)
  263. FirePulseDelay = 1000; //Delay between pulses
  264. FireMaxPulses = 4; //Maximum amount of pulses
  265. FireOverwrite = 2;
  266. };
  267.  
  268.  
  269.  
  270. //////////
  271. // item //
  272. //////////
  273. datablock ItemData(torchItem)
  274. {
  275. category = "Weapon"; // Mission editor category
  276. className = "Weapon"; // For inventory system
  277.  
  278. // Basic Item Properties
  279. shapeFile = "./Torch.dts";
  280. mass = 1;
  281. density = 0.2;
  282. elasticity = 0.2;
  283. friction = 0.6;
  284. emap = true;
  285.  
  286. //gui stuff
  287. uiName = "Torch";
  288. iconName = "./icon_torch";
  289. doColorShift = true;
  290. colorShiftColor = "0.471 0.471 0.471 1.000";
  291.  
  292. // Dynamic properties defined by the scripts
  293. image = swol_torchImage;
  294. canDrop = true;
  295. };
  296.  
  297.  
  298. datablock shapeBaseImageData(swol_torchImage)
  299. {
  300. className = "WeaponImage";
  301. shapeFile = "./torch.dts";
  302. emap = true;
  303. mountPoint = 0;
  304. offset = "0 0 0";
  305. item = "";
  306.  
  307. doColorShift = true;
  308. colorShiftColor = "0.37 0.25 0.1 1";
  309. melee = true;
  310. armReady = true;
  311.  
  312. eyeOffset = "0.7 1.4 -0.8";
  313. eyeOffset = "";
  314. rotation = "0 0 0 180";
  315. eyeRotation = "0 0 0 0";
  316.  
  317.  
  318. stateTimeoutValue[0] = 0.1;
  319. stateTransitionOnTimeout[0] = "Ignite";
  320.  
  321. stateName[1] = "Ignite";
  322. stateScript[1] = "onIgnite";
  323. stateTimeoutValue[1] = 0.2;
  324. stateEmitter[1] = gunFlashEmitter;
  325. stateEmitterTime[1] = 0.1;
  326. stateTransitionOnTimeout[1] = "FireA";
  327.  
  328.  
  329.  
  330. stateName[2] = "FireA";
  331. stateTimeoutValue[3] = 1000;
  332. stateEmitter[2] = swol_torchFireEmitter;
  333. stateEmitterTime[2] = 10000;
  334. stateTransitionOnTimeout[3] = "FireB";
  335.  
  336.  
  337.  
  338. stateName[3] = "FireB";
  339. stateTimeoutValue[3] = 0.01;
  340. stateEmitter[3] = swol_torchFireEmitter;
  341. stateEmitterTime[3] = 1000;
  342. stateTransitionOnTimeout[3] = "FireA";
  343.  
  344.  
  345. };
  346. datablock shapeBaseImageData(swol_torchImageEnd)
  347. {
  348. className = "WeaponImage";
  349. shapeFile = "./torch.dts";
  350. emap = true;
  351. mountPoint = 0;
  352. offset = "-0.008 0.01 -0.13";
  353. item = "";
  354.  
  355.  
  356. doColorShift = true;
  357. colorShiftColor = "0.37 0.25 0.1 1";
  358.  
  359. armReady = true;
  360.  
  361. eyeOffset = "0.7 1.4 -0.8";
  362. eyeOffset = "";
  363. rotation = "0 0 0 180";
  364. eyeRotation = "0 0 0 0";
  365.  
  366. stateName[0] = "Ready";
  367. stateTimeoutValue[0] = 0.1;
  368. stateTransitionOnTimeout[0] = "FireA";
  369.  
  370. stateName[2] = "FireA";
  371. stateTimeoutValue[3] = 1.2;
  372. stateEmitter[2] = swol_torchSmokeEmitter;
  373. stateEmitterTime[2] = 1.2;
  374. stateTransitionOnTimeout[2] = "Done";
  375.  
  376. stateName[3] = "Done";
  377. };
  378.  
  379.  
  380.  
  381. function swol_torchImage::onIgnite(%db,%pl,%slot)
  382. {
  383. serverPlay3D(swol_torchIgniteSound,%pl.getPosition());
  384. %pl.playThread(3,plant);
  385. %pl.startTorchSched = %db.schedule(150,mountLight,%pl,%slot);
  386. }
  387. function swol_torchImage::mountLight(%db,%pl,%slot)
  388. {
  389. %pl.light = new fxLight()
  390. {
  391. datablock = swol_torchLight;
  392. };
  393. missionCleanup.add(%pl.light);
  394. %pl.light.setTransform(%pl.getPosition());
  395. %pl.light.attachToObject(%pl);
  396. %pl.light.player = %pl;
  397. %pl.playAudio(2,swol_torchLoopSound);
  398. }
  399. //function swol_torchImage::putOutTorch(%db,%pl,%slot)
  400. //{
  401. //if(isObject(%pl.light))
  402. //{
  403. //%pl.light.delete();
  404. //%pl.playAudio(2,swol_torchEndSound);
  405. //%pl.schedule(0,mountImage,swol_torchImageEnd,0);
  406. //%db.schedule(1800,unMountEnd,%pl,%slot);
  407. //%pl.playThread(3,plant);
  408. //}
  409. //else
  410. //{
  411. //cancel(%pl.startTorchSched);
  412. //}
  413. //}
  414. function swol_torchImage::unMountEnd(%db,%pl,%slot)
  415. {
  416. if(%im = %pl.getMountedImage(0))
  417. {
  418. if(%im == nameToId(swol_torchImageEnd))
  419. {
  420. %pl.unMountImage(0);
  421. %pl.playThread(0,root);
  422. if(%im = %pl.getMountedImage(0))
  423. {
  424. if(%im.armReady)
  425. {
  426. %pl.playThread(0,armReadyRight);
  427. }
  428. }
  429. }
  430. }
  431. }
  432. function swol_torchImage::unMountCheck(%db,%pl,%slot)
  433. {
  434. if(!isObject(%pl.getMountedImage(0)))
  435. %pl.playThread(0,armReadyRight);
  436. }
  437. function swol_torchImageEnd::unMountCheck(%db,%pl,%slot)
  438. {
  439. if(!isObject(%pl.getMountedImage(0)))
  440. %pl.playThread(0,armReadyRight);
  441. }
  442. function swol_torchImage::onUnMount(%db,%pl,%slot)
  443. {
  444. if(isObject(%pl.light))
  445. {
  446. %pl.light.delete();
  447. %pl.playAudio(2,swol_torchEndSound);
  448. }
  449. else
  450. {
  451. cancel(%pl.startTorchSched);
  452. }
  453. %pl.lastTorchTime = getSimTime();
  454.  
  455. }
  456.  
  457. function servercmdlight(%a, %b){}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement