Advertisement
Guest User

Untitled

a guest
Sep 2nd, 2016
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.88 KB | None | 0 0
  1. //########## Ballistic Vest
  2.  
  3. //### Items
  4.  
  5. datablock ItemData(gn_HardLeatherArmor)
  6. {
  7. uiName = "Hard Leather";
  8. iconName = "./icon_HArmor";
  9. image = gn_HardLeatherArmorImage;
  10. category = "Tools";
  11. className = "Weapon";
  12. shapeFile = "./hardleatherarmor.dts";
  13. mass = 1;
  14. density = 0.2;
  15. elasticity = 0;
  16. friction = 0.6;
  17. emap = true;
  18. doColorShift = true;
  19. colorShiftColor = "1 1 1 1";
  20. canDrop = true;
  21. };
  22.  
  23. //### Item Image
  24.  
  25. datablock shapeBaseImageData(gn_HardLeatherArmorImage)
  26. {
  27. shapeFile = "./hardleatherarmor.dts";
  28. emap = true;
  29. mountPoint = 0;
  30. className = "WeaponImage";
  31. item = gn_HardLeatherArmor;
  32. melee = false;
  33. doReaction = false;
  34. armReady = false;
  35. doColorShift = true;
  36. colorShiftColor = "1 1 1 1";
  37.  
  38. stateName[0] = "Activate";
  39. stateTimeoutValue[0] = 0.1;
  40. stateTransitionOnTimeout[0] = "Ready";
  41. stateSound[0] = weaponSwitchSound;
  42.  
  43. stateName[1] = "Ready";
  44. stateTransitionOnTriggerDown[1] = "Fire";
  45. stateAllowImageChange[1] = true;
  46.  
  47. stateName[2] = "Fire";
  48. stateTransitionOnTriggerUp[2] = "Ready";
  49. stateTimeoutValue[2] = "0.2";
  50. stateFire[2] = true;
  51. stateAllowImageChange[2] = true;
  52. stateScript[2] = "onFire";
  53. };
  54.  
  55. datablock ShapeBaseImageData(gn_HardLeatherArmorMountedimage)
  56. {
  57. shapeFile = "./hardleatherarmor.dts";
  58. emap = true;
  59. mountPoint = 7;
  60. offset = "0 0.03 0.63";
  61. eyeOffset = "0 0 10";
  62. rotation = eulerToMatrix("0 0 0");
  63. scale = "1 1 1";
  64. correctMuzzleVector = true;
  65. doColorShift = false;
  66. colorShiftColor = "1 1 1 1";
  67.  
  68. stateName[0] = "Activate";
  69. stateTimeoutValue[0] = 0.1;
  70. stateTransitionOnTimeout[0] = "Idle";
  71. stateSound[0] = weaponSwitchSound;
  72.  
  73. stateName[1] = "Idle";
  74. stateAllowImageChange[1] = true;
  75. };
  76.  
  77. //### Functions
  78.  
  79. function gn_HardLeatherArmorImage::onFire(%this,%obj,%slot)
  80. {
  81. %client = %obj.client;
  82. %player = %obj;
  83. if(isObject(%player))
  84. {
  85. if(%player.getMountedImage(1) $= nametoID(gn_HardLeatherArmorMountedimage)) %player.unmountImage(1);
  86. else
  87. {
  88. %player.unmountImage(1);
  89. %player.mountImage(gn_HardLeatherArmorMountedimage,1);
  90. }
  91. }
  92. }
  93.  
  94. function gn_HardLeatherArmorMountedimage::onMount(%this,%obj,%slot)
  95. { %obj.hideNode(armor); messageClient(%obj.client,"","\c3You put on the \c7Hardened Leather Armor\c3 (\c2+10%\c3 Body Protection)!");
  96. setMaxForwardSpeed(17);
  97. setMaxBackwardSpeed(17);
  98. setMaxSideSpeed(17);
  99. setMaxCrouchForwardSpeed(17);
  100. setMaxCrouchBackwardSpeed(17);
  101. setMaxCrouchSideSpeed(17);
  102.  
  103. }
  104. function gn_HardLeatherArmorMountedimage::onUnMount(%this,%obj,%slot)
  105. { messageClient(%obj.client,"","\c3You took off the \c7Hardened Leather Armor\c3 (\c0-10%\c3 Body Protection)!");
  106. setMaxForwardSpeed(17);
  107. setMaxBackwardSpeed(17);
  108. setMaxSideSpeed(17);
  109. setMaxCrouchForwardSpeed(17);
  110. setMaxCrouchBackwardSpeed(17);
  111. setMaxCrouchSideSpeed(17);
  112.  
  113. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement