Advertisement
Guest User

rtd plugin

a guest
Oct 30th, 2012
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.21 KB | None | 0 0
  1. //Roll The Dice server plugin by lorgan
  2. //RM port by Arctic
  3.  
  4. global.canRoll = true;
  5. global.effects = 22;
  6. global.effect[0] = " Exploded!";
  7. global.effect[1] = " Turned into a timebomb! Detonation in 10 seconds!"
  8. global.effect[2] = " froze for 10 seconds!";
  9. global.effect[3] = " Lost health!"
  10. global.effect[4] = " can't jump for 20 seconds!";
  11. global.effect[5] = " has less gravity for 20 seconds!";
  12. global.effect[6] = " has infinite ammo for 10 seconds!";
  13. global.effect[7] = " became invincible for 10 seconds!";
  14. global.effect[8] = " has instakill for 10 seconds!";
  15. global.effect[9] = " can fly for 20 seconds!"
  16. global.effect[10] = " has hyperspeed for 10 seconds!"
  17. global.effect[11] = " healed!";
  18. global.effect[12] = " became confused for 20 seconds!"
  19. global.effect[13] = " Talks about his feelings for 20 seconds!";
  20. global.effect[14] = " lost ammo!";
  21. global.effect[15] = " got full ammo";
  22. global.effect[16] = " got rocketed!";
  23. global.effect[17] = " is poisoned for 10 seconds!";
  24. global.effect[18] = " has instant refire for 10 seconds!";
  25. global.effect[19] = " has health regen for 20 seconds!";
  26. global.effect[20] = " released the spies! All autoguns are sapped!";
  27. global.effect[21] = " is a disguised spy! Kill him before he kills you!";
  28.  
  29. object_event_add(PlayerControl,ev_create,0,"
  30. alarm[0] = 300;
  31. ");
  32. object_event_add(PlayerControl,ev_alarm,0,"
  33. if global.isHost {
  34. if !instance_exists(NoticeO) {
  35. SendChat('This server is running an RTD plugin. Taunt to roll.',global.eventBuffer);
  36.  
  37. alarm[0] = 30*5*60;
  38. } else alarm[0] = 7;
  39. }
  40. ");
  41.  
  42. object_event_add(Player,ev_create,0,"iCanRoll = true;");
  43. object_event_add(Player,ev_alarm,10,"iCanRoll = true;");
  44.  
  45. object_event_add(Character,ev_create,0,"
  46. effect = noone;
  47. ");
  48. object_event_add(Character,ev_destroy,0,"
  49. if global.isHost {
  50. if effect != noone {
  51. SendChat(player.name + ' died wile using RTD!',global.eventBuffer);
  52.  
  53. global.canRoll = true;
  54. }
  55. }
  56. ");
  57. object_event_add(Character,ev_step,ev_step_normal,"
  58. if global.isHost {
  59. if effect != noone {
  60. switch(effect) {
  61. case 1:
  62. RTDtimer -= 1;
  63. if RTDtimer mod 30 == 0 && RTDtimer <= 90 {
  64. SendChat('Detonation in '+string(RTDtimer/30) ,global.eventBuffer);
  65.  
  66. }
  67. if RTDtimer <= 0 {
  68. global.canRoll = true;
  69. effect = noone;
  70. with(Character) {
  71. if point_distance(x,y,other.x,other.y) < 64 {
  72. if team != other.team or id == other.id {
  73. lastDamageDealer = other.player;
  74. lastDamageSource = FINISHED_OFF_GIB;
  75. hp = -999;
  76. }
  77. }
  78. }
  79. }
  80. break;
  81. case 2:
  82. RTDtimer -= 1;
  83. if RTDtimer <= 0 {
  84. effect = noone;
  85. global.canRoll = true;
  86. SendChat(player.name + ' is no longer frozen.' ,global.eventBuffer);
  87.  
  88.  
  89. runPower = runBkp;
  90. jumpStrength = 8;
  91. }
  92. break;
  93. case 4:
  94. RTDtimer -= 1;
  95. if RTDtimer <= 0 {
  96. effect = noone;
  97. global.canRoll = true;
  98. SendChat(player.name + ' can jump again.' ,global.eventBuffer);
  99.  
  100. jumpStrength = 8;
  101. }
  102. break;
  103. case 5:
  104. if(place_free(x,y+1)) vspeed -= 0.3;
  105. RTDtimer -= 1;
  106. if RTDtimer <= 0 {
  107. effect = noone;
  108. global.canRoll = true;
  109. SendChat(player.name + ' has normal gravity again.' ,global.eventBuffer);
  110.  
  111. }
  112. break;
  113. case 6:
  114. currentWeapon.ammoCount = currentWeapon.maxAmmo;
  115. RTDtimer -= 1;
  116. if RTDtimer <= 0 {
  117. effect = noone;
  118. global.canRoll = true;
  119. SendChat(player.name + ' has normal ammo again.' ,global.eventBuffer);
  120.  
  121. }
  122. break;
  123. case 7:
  124. hp = 255;
  125. RTDtimer -= 1;
  126. if RTDtimer <= 0 {
  127. effect = noone;
  128. global.canRoll = true;
  129. SendChat(player.name + ' is no longer invincible.' ,global.eventBuffer);
  130.  
  131. hp = hpBkp;
  132. }
  133. break;
  134. case 8:
  135. with(Character) if lastDamageDealer == other.player && timeUnscathed <= 1 hp = -999;
  136. RTDtimer -= 1;
  137. if RTDtimer <= 0 {
  138. effect = noone;
  139. global.canRoll = true;
  140. SendChat(player.name + ' no longer has instakill.' ,global.eventBuffer);
  141.  
  142. }
  143. break;
  144. case 9:
  145. doublejumpUsed = false;
  146. RTDtimer -= 1;
  147. if RTDtimer <= 0 {
  148. effect = noone;
  149. global.canRoll = true;
  150. SendChat(player.name + ' can no longer fly.' ,global.eventBuffer);
  151.  
  152. if player.class != CLASS_SCOUT canDoublejump = false;
  153. }
  154. break;
  155. case 10:
  156. RTDtimer -= 1;
  157. runPower = 4;
  158. if RTDtimer <= 0 {
  159. effect = noone;
  160. global.canRoll = true;
  161. SendChat(player.name + ' no longer has hyperspeed.' ,global.eventBuffer);
  162.  
  163. runPower = runBkp;
  164. }
  165. break;
  166. case 12:
  167. RTDtimer -= 1;
  168. if(!taunting && !omnomnomnom) {
  169. if((keyState|pressedKeys) & $40 and hspeed > -runPower * controlFactor / (baseFriction - 1))
  170. hspeed += runPower*controlFactor*2;
  171.  
  172. if((keyState|pressedKeys) & $20 and hspeed < runPower * controlFactor / (baseFriction - 1))
  173. hspeed -= runPower*controlFactor*2;
  174. }
  175. if RTDtimer <= 0 {
  176. effect = noone;
  177. global.canRoll = true;
  178. SendChat(player.name + ' is no longer confused.' ,global.eventBuffer);
  179.  
  180. }
  181. break;
  182. case 17:
  183. RTDtimer -= 1;
  184. hp -= 0.2;
  185. if RTDtimer <= 0 {
  186. effect = noone;
  187. global.canRoll = true;
  188. SendChat(player.name + ' is no longer poisoned.' ,global.eventBuffer);
  189.  
  190. }
  191. break;
  192. case 18:
  193. RTDtimer -= 1;
  194. if player.class != CLASS_PYRO && player.class != CLASS_HEAVY
  195. if currentWeapon.refireTime > 5 currentWeapon.refireTime = 5;
  196. if RTDtimer <= 0 {
  197. effect = noone;
  198. global.canRoll = true;
  199. SendChat(player.name + ' no longer has instant reload.' ,global.eventBuffer);
  200.  
  201. }
  202. break;
  203. case 19:
  204. RTDtimer -= 1;
  205. if hp < maxHp hp += 0.2;
  206. if RTDtimer <= 0 {
  207. effect = noone;
  208. global.canRoll = true;
  209. SendChat(player.name + ' no longer has health regen.' ,global.eventBuffer);
  210.  
  211. }
  212. break;
  213. case 13:
  214. RTDtimer -= 1;
  215. if RTDtimer mod 7 == 0 {
  216. var feeling;
  217. feeling = floor(random(7))
  218. write_ubyte(global.eventBuffer, CHAT_BUBBLE);
  219. write_ubyte(global.eventBuffer, ds_list_find_index(global.players,player));
  220. write_ubyte(global.eventBuffer, 22+feeling);
  221. setChatBubble(player, 22+feeling);
  222. }
  223. if RTDtimer <= 0 {
  224. effect = noone;
  225. global.canRoll = true;
  226. SendChat(player.name + ' has calmed down.' ,global.eventBuffer);
  227.  
  228. }
  229. break;
  230. default:
  231. effect = noone;
  232. }
  233. }
  234. if taunting {
  235. if tauntindex == 0 or tauntindex == tauntlength {
  236. if player.iCanRoll && global.canRoll {
  237. effect = floor(random(global.effects));
  238. SendChat(player.name + global.effect[effect],global.eventBuffer);
  239.  
  240. player.iCanRoll = false;
  241. player.alarm[10] = 30*60;
  242.  
  243. switch(effect) {
  244. case 0:
  245. effect = noone;
  246. with(Character) {
  247. if point_distance(x,y,other.x,other.y) < 64 {
  248. if team != other.team or id == other.id {
  249. lastDamageDealer = other.player;
  250. lastDamageSource = FINISHED_OFF_GIB;
  251. hp = -999;
  252. }
  253. }
  254. }
  255. break;
  256. case 1:
  257. case 6:
  258. case 8:
  259. case 17:
  260. case 18:
  261. global.canRoll = false;
  262. RTDtimer = 10*30;
  263. break;
  264. case 2:
  265. global.canRoll = false;
  266. RTDtimer = 10*30;
  267. runBkp = runPower;
  268. runPower = 0;
  269. jumpStrength = 0;
  270. break;
  271. case 3:
  272. hp = 1;
  273. effect = noone;
  274. break;
  275. case 4:
  276. global.canRoll = false;
  277. RTDtimer = 20*30;
  278. jumpStrength = 0;
  279. break;
  280. case 5:
  281. case 12:
  282. case 13:
  283. case 19:
  284. case 22:
  285. global.canRoll = false;
  286. RTDtimer = 20*30;
  287. break;
  288. break;
  289. case 7:
  290. global.canRoll = false;
  291. RTDtimer = 10*30;
  292. hpBkp = hp;
  293. break;
  294. case 9:
  295. global.canRoll = false;
  296. RTDtimer = 20*30;
  297. canDoublejump = true;
  298. break;
  299. case 10:
  300. global.canRoll = false;
  301. RTDtimer = 10*30;
  302. runBkp = runPower;
  303. runPower = 4;
  304. break;
  305. case 11:
  306. effect = noone;
  307. hp = maxHp;
  308. case 14:
  309. effect = noone;
  310. currentWeapon.ammoCount = 0;
  311. currentWeapon.alarm[5] = 50;
  312. break;
  313. case 15:
  314. effect = noone;
  315. currentWeapon.ammoCount = currentWeapon.maxAmmo;
  316. currentWeapon.alarm[5] = -1;
  317. break;
  318. case 16:
  319. effect = noone;
  320. vspeed = -15;
  321. moveStatus = 1;
  322. break;
  323. case 20:
  324. effect = noone;
  325. with(Sentry) {
  326. if hp > 25 hp = 25;
  327. else hp = -999;
  328. built = 0;
  329. }
  330. break;
  331. case 21:
  332. if team == TEAM_RED team = TEAM_BLUE;
  333. else team = TEAM_RED;
  334. break;
  335. }
  336. } else {
  337. write_ubyte(global.eventBuffer, CHAT_BUBBLE);
  338. write_ubyte(global.eventBuffer, ds_list_find_index(global.players,player));
  339. write_ubyte(global.eventBuffer, 44);
  340.  
  341. setChatBubble(player, 44);
  342. }
  343. }
  344. }
  345. }
  346. ");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement