Advertisement
ArcheKruz

ACS Stuff

Aug 18th, 2014
247
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.04 KB | None | 0 0
  1. // Definitions
  2.  
  3. #define WORLD_OPEN 640
  4. #define PLAYER_ENTER 641
  5. #define PLAYER_RETURN 642
  6. #define PLAYER_RESPAWN 643
  7. #define MODE_CHECK 650
  8.  
  9. #define SET_WEAPONID 800
  10. #define CALL_RECOV_RATIO 820
  11. #define RECOIL_GENERIC 840
  12. #define RECOIL_SSG 841
  13. #Define RECOIL_DSG 842
  14.  
  15. #define MESSAGE_WEAPON 880
  16.  
  17. #define PLAYER_MAX 64
  18.  
  19. // Semi-Global Values
  20.  
  21. int WeaponID[PLAYER_MAX];
  22.  
  23. // Semi-Global Arrays
  24.  
  25. int StoredWeaponMessages[8][4][5] =
  26. {
  27. {
  28. { "Millitary Knife", "", "", "", "", },
  29. { "Axe", "Sledgehammer", "", "", "", },
  30. { "Bonecrackah 'P-LAH' Chainsaw", "", "", "", "Macuahuitl", },
  31. { "", "", "", "", "", },
  32. },
  33. {
  34. { "Dual Shofield .45 Colts","SOP 308 Pistol", "", "", "", },
  35. { "HK-417 DMR", "", "", "", "", },
  36. { "'RAPTOR' Sniper Rifle", "", "", "", "Atlatl", },
  37. { "", "", "", "", "", },
  38. },
  39. {
  40. { "12-Gauge Shotgun", "", "", "", "", },
  41. { "Double-Barreled Coach Gun", "", "", "", "Seismic Projector",},
  42. { "AA-12 Shotgun", "Power Shotgun","", "", "", },
  43. { "", "", "", "", "", },
  44. },
  45. {
  46. { "M29 Assault Rifle", "", "", "", "", },
  47. { "M1-A2 Thompson SMG", "", "", "", "Vorpal Driver",},
  48. { "XM-214-A Minigun", "", "", "", "", },
  49. { "", "", "", "", "", },
  50. },
  51. {
  52. { "M79 Grenade launcher", "", "", "", "", },
  53. { "MkIII Grenade Launcher", "XPML21 Rocket Launcher", "", "", "", },
  54. { "C-4 Demolition Charge", "", "", "", "Phoenix Firebolt", },
  55. { "", "", "", "", "", },
  56. },
  57. {
  58. { "", "", "", "", "", },
  59. { "XOP Flamethrower", "", "", "", "", },
  60. { "", "", "", "", "Enxeiridion Epiktetou",},
  61. { "XIA-B6 Pyro Cannon", "", "", "", "", },
  62. },
  63. {
  64. { "", "", "", "", "", },
  65. { "XL2 Lasergun", "", "", "", "Aqua Shredder",},
  66. { "XAMPL-32 'Tiamat'", "", "", "", "", },
  67. { "XM-BFG 'Ghost Buster'", "", "", "", "", },
  68. },
  69. {
  70. { "", "", "", "", "", },
  71. { "", "", "", "", "", },
  72. { "AS-24 'Devastator'", "", "", "", "", },
  73. { "SBC Cannon", "", "", "", "Codex Deorum", },
  74. }
  75. };
  76.  
  77. int RecoilRecoveryRatios[8][4][5] =
  78. {
  79. {
  80. { 1.0,1.0,1.0,1.0,1.0,}, //Slot 1
  81. { 1.0,1.0,1.0,1.0,1.0,},
  82. { 1.0,1.0,1.0,1.0,1.0,},
  83. { 1.0,1.0,1.0,1.0,1.0,},
  84. },
  85. {
  86. { 1.0,1.0,1.0,1.0,1.0,}, //Slot 2
  87. { 1.0,1.0,1.0,1.0,1.0,},
  88. { 1.0,1.0,1.0,1.0,1.0,},
  89. { 1.0,1.0,1.0,1.0,1.0,},
  90. },
  91. {
  92. { 1.0,1.0,1.0,1.0,1.0,}, //Slot 3
  93. { 0.8,1.0,1.0,1.0,1.0,},
  94. { 1.0,1.0,1.0,1.0,1.0,},
  95. { 1.0,1.0,1.0,1.0,1.0,},
  96. },
  97. {
  98. { 1.0,1.0,1.0,1.0,1.0,}, //Slot 4
  99. { 1.0,1.0,1.0,1.0,1.0,},
  100. { 1.0,1.0,1.0,1.0,1.0,},
  101. { 1.0,1.0,1.0,1.0,1.0,},
  102. },
  103. {
  104. { 1.0,1.0,1.0,1.0,1.0,}, //Slot 5
  105. { 1.0,1.0,1.0,1.0,1.0,},
  106. { 1.0,1.0,1.0,1.0,1.0,},
  107. { 1.0,1.0,1.0,1.0,1.0,},
  108. },
  109. {
  110. { 1.0,1.0,1.0,1.0,1.0,}, //Slot 6
  111. { 1.0,1.0,1.0,1.0,1.0,},
  112. { 1.0,1.0,1.0,1.0,1.0,},
  113. { 1.0,1.0,1.0,1.0,1.0,},
  114. },
  115. {
  116. { 1.0,1.0,1.0,1.0,1.0,}, //Slot 7
  117. { 1.0,1.0,1.0,1.0,1.0,},
  118. { 1.0,1.0,1.0,1.0,1.0,},
  119. { 1.0,1.0,1.0,1.0,1.0,},
  120. },
  121. {
  122. { 1.0,1.0,1.0,1.0,1.0,}, //Slot 8
  123. { 1.0,1.0,1.0,1.0,1.0,},
  124. { 1.0,1.0,1.0,1.0,1.0,},
  125. { 1.0,1.0,1.0,1.0,1.0,},
  126. }
  127. };
  128.  
  129. script SET_WEAPONID (int x)
  130. {
  131. WeaponID[PlayerNumber()] = x;
  132.  
  133. // Hudmessage(s:"PlayerID : ", i:WeaponID[PlayerNumber()];
  134. // HUDMSG_FADEOUT,1,CR_WHITE,0.5,0.9,1.0,1.0);
  135. }
  136.  
  137. script CALL_RECOV_RATIO (void)
  138. {
  139. int SlotNumber = (WeaponID[PlayerNumber()] / 100) - 1;
  140. int TierNumber = ((WeaponID[PlayerNumber()] % 100) / 10) - 1;
  141. int VarNumber = (WeaponID[PlayerNumber()] % 10) - 1;
  142. SetResultValue(RecoilRecoveryRatios[SlotNumber][TierNumber][VarNumber]);
  143. }
  144.  
  145. script RECOIL_GENERIC (int Amplitude, int TransLength, int DecayLength) clientside
  146. {
  147. int RecPitch = (Amplitude * 128) + Random(-64,64);
  148. int SubPitch = 0;
  149. int ModPitch = 0;
  150. int PTDivisor = RecPitch * 2 / (TransLength * (TransLength + 1));
  151. int PTMod = RecPitch * 2 % (TransLength * (TransLength + 1));
  152. int DecRecov = ACS_ExecuteWithResult(820);
  153. int DecPitch = (RecPitch * DecRecov) >> 16;
  154. int PRDivisor = DecPitch / (DecayLength * (DecayLength + 1));
  155. int PRMod = DecPitch % (DecayLength * (DecayLength + 1));
  156. // int ActualDecay = 0;
  157. // int ActualPitch = 0;
  158.  
  159. for (int a = 0; a < TransLength; a++) // Recoil Transient
  160. {
  161. ModPitch += (PTMod * (TransLength - a));
  162. SubPitch = ModPitch / (TransLength * (TransLength + 1));
  163. ModPitch = ModPitch % (TransLength * (TransLength + 1));
  164. SetActorPitch(0, GetActorPitch(0) - (PTDivisor * (TransLength - a) + SubPitch));
  165. // ActualPitch += (PTDivisor * (TransLength - a) + SubPitch);
  166. SubPitch = 0;
  167. Delay(1);
  168. }
  169. Delay(1);
  170. for (int b = 0; b < DecayLength; b++) // Recovery.
  171. {
  172. ModPitch += (PRMod * (b + 1));
  173. SubPitch = ModPitch / (DecayLength * (DecayLength + 1));
  174. ModPitch = ModPitch % (DecayLength * (DecayLength + 1));
  175. SetActorPitch(0, GetActorPitch(0) + (PRDivisor * (b + 1) + SubPitch));
  176. // ActualDecay += (PRDivisor * (b + 1) + SubPitch);
  177. SubPitch = 0;
  178. Delay(1);
  179. }
  180. for (int c = 0; c < DecayLength; c++)
  181. {
  182. ModPitch += (PRMod * (DecayLength - c));
  183. SubPitch = ModPitch / (DecayLength * (DecayLength + 1));
  184. ModPitch = ModPitch % (DecayLength * (DecayLength + 1));
  185. SetActorPitch(0, GetActorPitch(0) + (PRDivisor * (DecayLength - c) + SubPitch));
  186. // ActualDecay += (PRDivisor * (DecayLength - c) + SubPitch);
  187. SubPitch = 0;
  188. Delay(1);
  189. }
  190.  
  191. // Hudmessage(s:"Recoil : ", i:RecPitch, s:" (", i:ActualPitch, s:") , Decay : ", i:DecPitch, s:" (", i:ActualDecay, s:")";
  192. // HUDMSG_FADEOUT,1,CR_WHITE,0.5,0.9,1.0,1.0);
  193. }
  194.  
  195. script RECOIL_SSG (void) clientside // Single Shotgun Recoil
  196. {
  197. int f = Random(0,512);
  198. int g = Random(0,512);
  199. int h = Random(0,512);
  200. int i = Random(-72,72);
  201. int j = Random(-72,72);
  202. int k = Random(-72,72);
  203. int RecPitch = f + g + h;
  204. int RecSway = i + j + k;
  205. int SubPitch = 0;
  206. int SubSway = 0;
  207. int ModPitch = 0;
  208. int ModSway = 0;
  209. int PTDivisor = RecPitch / 6;
  210. int STDivisor = RecSway / 6;
  211. int PTMod = RecPitch % 6;
  212. int STMod = RecSway % 6;
  213. int PRDivisor = RecPitch / 72;
  214. int SRDivisor = RecSway / 72;
  215. int PRMod = RecPitch % 72;
  216. int SRMod = RecSway % 72;
  217.  
  218. Radius_Quake(3,4,0,2,0);
  219. for (int m = 0; m < 3; m++) // Recoil Transient
  220. {
  221. ModPitch += (PTMod * (3 - m));
  222. SubPitch = ModPitch / 12;
  223. ModPitch = ModPitch % 12;
  224. ModSway += (STMod * (3 - m));
  225. SubSway = ModSway / 12;
  226. ModSway = ModSway % 12;
  227. SetActorPitch(0, GetActorPitch(0) - (PTDivisor * (3 - m) + SubPitch));
  228. SetActorAngle(0, GetActorAngle(0) - (STDivisor * (3 - m) + SubSway));
  229. SubPitch = 0;
  230. SubSway = 0;
  231. Delay(1);
  232. }
  233. Delay(1);
  234. for (int r = 0; r < 8; r++) // Recovery.
  235. {
  236. ModPitch += (PRMod * (r + 1));
  237. SubPitch = ModPitch / 72;
  238. ModPitch = ModPitch % 72;
  239. ModSway += (SRMod * (r + 1));
  240. SubSway = ModSway / 72;
  241. ModSway = ModSway % 72;
  242. SetActorPitch(0, GetActorPitch(0) + (PRDivisor * (r + 1) + SubPitch));
  243. SetActorAngle(0, GetActorAngle(0) + (SRDivisor * (r + 1) + SubSway));
  244. SubPitch = 0;
  245. SubSway = 0;
  246. Delay(1);
  247. }
  248. for (int s = 0; s < 8; s++)
  249. {
  250. ModPitch += (PRMod * (8 - s));
  251. SubPitch = ModPitch / 72;
  252. ModPitch = ModPitch % 72;
  253. ModSway += (SRMod * (8 - s));
  254. SubSway = ModSway / 72;
  255. ModSway = ModSway % 72;
  256. SetActorPitch(0, GetActorPitch(0) + (PRDivisor * (8 - s) + SubPitch));
  257. SetActorAngle(0, GetActorAngle(0) + (SRDivisor * (8 - s) + SubSway));
  258. SubPitch = 0;
  259. SubSway = 0;
  260. Delay(1);
  261. }
  262. }
  263.  
  264. script RECOIL_DSG (int NumShots) clientside
  265. {
  266. switch (NumShots)
  267. {
  268. case 1:
  269. ACS_ExecuteAlways(840,0,8,2,4);
  270. Radius_Quake(3,3,0,2,0);
  271. break;
  272. case 2:
  273. ACS_ExecuteAlways(840,0,13,3,5);
  274. Radius_Quake(5,4,0,3,0);
  275. break;
  276. }
  277.  
  278. int a = Random((-48 + (-48 * NumShots)),(48 + (48 * NumShots)));
  279. int b = Random((-48 + (-48 * NumShots)),(48 + (48 * NumShots)));
  280. int c = Random((-48 + (-48 * NumShots)),(48 + (48 * NumShots)));
  281. int TotalSway = a + b + c;
  282. int ModSway = 0;
  283. int SubSway = 0;
  284. int STDivisor = TotalSway / (3 * NumShots);
  285. int STMod = TotalSway % (3 * NumShots);
  286. int SRDivisor = TotalSway / (10 + (10 * NumShots));
  287. int SRMod = TotalSway % (10 + (10 * NumShots));
  288.  
  289. for (int m = 0; m < (1 + NumShots); m++)
  290. {
  291. ModSway += (STMod * ((1 + NumShots) - m));
  292. SubSway = ModSway / (3 * NumShots);
  293. ModSway = ModSway % (3 * NumShots);
  294. SetActorAngle(0, GetActorAngle(0) - (STDivisor * ((1 + NumShots) - m) + SubSway) );
  295. SubSway = 0;
  296. Delay(1);
  297. }
  298. Delay(1);
  299. for (int r = 0; r < (3 + NumShots); r++)
  300. {
  301. ModSway += (SRMod * (r + 1));
  302. SubSway = ModSway / (10 + (10 * NumShots));
  303. ModSway = ModSway % (10 + (10 * NumShots));
  304. SetActorAngle(0, GetActorAngle(0) + (STDivisor * (r + 1) + SubSway) );
  305. SubSway = 0;
  306. Delay(1);
  307. }
  308. for (int s = 0; s < (3 + NumShots); s++)
  309. {
  310. ModSway += (SRMod * ((3 + NumShots) - s));
  311. SubSway = ModSway / (10 + (10 * NumShots));
  312. ModSway = ModSway % (10 + (10 * NumShots));
  313. SetActorAngle(0, GetActorAngle(0) - (STDivisor * ((3 + NumShots) - m) + SubSway) );
  314. SubSway = 0;
  315. Delay(1);
  316. }
  317. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement