Advertisement
FeelTheGhost

Asiong Salonga | Russian Roulette v1.0

Jan 31st, 2012
1,446
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.63 KB | None | 0 0
  1. //========================================================================================
  2. //Title: Asiong Salonga | Russian Roulette
  3. //Version: 1.0
  4. //Author: Ghost
  5. //Created: 12/24/2011
  6. //Released: 12/24/2011
  7. //Compatibility: rAthena | eAthena
  8. //rAthena Topic: http://rathena.org/board/topic/58222-ghosts-scripts/
  9. //Required File: http://www.mediafire.com/?ry9k4uolxlmj4kv
  10. //Reference: http://en.wikipedia.org/wiki/Russian_roulette
  11. //Note: Thanks to Z3R0, Arcenciel, and `KeiKun for helping me on making this script.
  12. //©2011-2012 Ghost
  13. //========================================================================================
  14. izlude,120,96,6, script Asiong Salonga 731,{
  15. //--Configuration
  16. goto Asiong;
  17. OnInit:
  18. set .NPC$, "[Asiong Salonga]"; //What is the NPC name?
  19. set .GMLevel, 90; //What is the minimum gm level to activate the event?
  20. set .GetSkull, 1; //Do you want to get the skulls of the dead after winning? 1: Enabled | 0:Disable
  21. set .Zeny, 0; //How much zeny you want the winner to get? | 0:Disable
  22. setarray .ItemID[0], 7179; //What is the Item ID of the prize? | 0:Disable
  23. setarray .ItemAmount[0],100; //How many pieces of the prize?
  24. setarray .DeathDialog$[0], "Sayonara!", "Hasta la vista, baby!", "Die!"; //What do you want the NPC will say when someone dies?
  25. setarray .AliveDialog$[0], "You lucky bastard!", "Bloody hell!", "Why can't you die!"; //What do you want the NPC will say when someone lives?
  26. end;
  27. //--End
  28. Asiong:
  29. mes .NPC$;
  30. mes "Russian Roulette is a potentially lethal game of chance in which participants place a single round in a revolver, spin the cylinder, place the muzzle against their head and pull the trigger.";
  31. if(.play == 2){ close; }
  32. switch(select("Play:"+((getgmlevel() >= .GMLevel)?"Activate":"")+"")){
  33. case 1:
  34. if((.play == 1) && (.pReg < .maxplayer)){
  35. for(set .@i, 0; .@i < .maxplayer; set .@i, .@i + 1){
  36. if(.playerlist$[.@i] == strcharinfo(0)){
  37. next;
  38. mes .NPC$;
  39. mes "You are already registered!";
  40. close;
  41. }
  42. }
  43. set .playerlist$[.pReg], strcharinfo(0);
  44. set .pReg, .pReg + 1;
  45. announce "["+.pReg+"/"+.maxplayer+"] "+strcharinfo(0)+" is registered.",bc_all;
  46. if(.pReg == .maxplayer){ goto PlayRR; }
  47. close;
  48. }
  49. else if((.pReg == .maxplayer) && (.play == 1)){
  50. next;
  51. mes .NPC$;
  52. mes "No open slot available.";
  53. close;
  54. }
  55. next;
  56. mes .NPC$;
  57. mes "Event has not yet started.";
  58. close;
  59. case 2:
  60. next;
  61. mes .NPC$;
  62. mes "What is the maximum player?";
  63. input .maxplayer;
  64. if(.maxplayer < 2){ dispbottom "Max player must be greater than 1."; close; }
  65. set .maxplayer, .maxplayer;
  66. set .play, 1;
  67. announce "[Russian Roulette] Registration is open. "+.maxplayer+" players needed!",bc_all;
  68. close;
  69. }
  70. close;
  71.  
  72. PlayRR:
  73. close2;
  74. detachrid;
  75. copyarray .copiedplayer$[0], .playerlist$[0], 128;
  76. set .play, 2;
  77. announce "[Russian Roulette] Thrilling trigger pulls are about to start!",bc_all;
  78. announce "Active Player Listing",bc_all,0xFFFFFF;
  79. for(set .@i, 0; .@i < getarraysize(.playerlist$); set .@i, .@i + 1){
  80. set .@j, .@j + 1;
  81. announce ""+.@j+". "+.playerlist$[.@i]+"",bc_all,0xFFFFFF;
  82. sleep2 1000;
  83. }
  84. announce "Do not disconnect. You will be disqualified!",bc_all,0xFFFFFF;
  85. callsub OnSpin;
  86. close;
  87.  
  88. OnSpin:
  89. set .spin, rand(0, .pReg - 1);
  90. attachrid(getcharid(3, .playerlist$[.spin]));
  91. callsub OnCheck;
  92. announce .NPC$ +" The revolver is spinning . . .",bc_all;
  93. sleep2 3000;
  94. announce .NPC$ +" Revolver slowly stopped spinning . . .",bc_all;
  95. sleep2 2000;
  96. announce .NPC$ +" The revolver is pointing to "+ strcharinfo(0) +" . . .",bc_all;
  97. sleep2 3000;
  98. announce .NPC$ +" Pull the trigger now "+ strcharinfo(0),bc_all;
  99. callsub OnCheck;
  100. callsub OnShoot;
  101. sleep2 3000;
  102. callsub OnSpin;
  103. return;
  104.  
  105. OnShoot:
  106. if(rand(1, 3) == 1){
  107. soundeffectall "Revolver.wav", 0;
  108. sleep2 2300;
  109. specialeffect2 669;
  110. specialeffect2 531;
  111. percentheal -100, -100;
  112. deletearray .playerlist$[.spin], 1;
  113. set .pReg, .pReg - 1;
  114. announce "["+.pReg+"/"+.maxplayer+"] "+strcharinfo(0)+" is out!",bc_all,0xFF0000;
  115. announce ""+.NPC$+" "+.deathdialog$[rand(1, getarraysize(.deathdialog))]+"", bc_all,0xFF0000;
  116. } else {
  117. soundeffectall "Revolver.wav", 0;
  118. sleep2 2300;
  119. specialeffect2 675;
  120. specialeffect2 522 + rand(1,14);
  121. announce ""+.NPC$+" "+.alivedialog$[rand(1, getarraysize(.alivedialog))]+"", bc_all,0xFF0000;
  122. } return;
  123.  
  124. OnCheck:
  125. if(.pReg <= 0){
  126. announce .NPC$ +" No winner! They all disappear!",bc_all;
  127. callsub CleanUp;
  128. }
  129. else if((.pReg == 1) && (.maxplayer <= 2) && (getarraysize(.disqualified$))){
  130. announce .NPC$ +" No winner! A player has been disqualified in 2 player mode.",bc_all;
  131. callsub CleanUp;
  132. }
  133. else if((.pReg == 1) && (.maxplayer >= 2)){
  134. announce .NPC$ +" We got a winner! Congratulations "+strcharinfo(0)+"!",bc_all;
  135. if(.GetSkull){
  136. for(set .@i, 0; .@i < .maxplayer; set .@i, .@i + 1){
  137. if(strcharinfo(0) != .copiedplayer$[.@i]){
  138. getnameditem 7420, .copiedplayer$[.@i];
  139. }
  140. }
  141. }
  142. for(set .@i, 0; .@i < getarraysize(.ItemID); set .@i, .@i + 1){
  143. if(.ItemID){ getitem .ItemID[.@i], .ItemAmount[.@i]; }
  144. }
  145. if(.Zeny){ set Zeny, Zeny + .Zeny; }
  146. callsub CleanUp;
  147. } return;
  148.  
  149. OnPCLogoutEvent:
  150. if(.play){
  151. setarray .disqualified$[.@l], strcharinfo(0);
  152. set .@l, .@l + 1;
  153. for(set .@i, 0; .@i < .maxplayer; set .@i, .@i + 1){
  154. if(.playerlist$[.@i] == strcharinfo(0)){
  155. deletearray .playerlist$[.@i], 1;
  156. set .pReg, .pReg - 1;
  157. announce "["+.pReg+"/"+.maxplayer+"] "+strcharinfo(0)+" has disqualified.",bc_all,0xFF0000;
  158. break;
  159. }
  160. }
  161. }
  162. end;
  163.  
  164. //--Clean Variables
  165. CleanUp:
  166. set .play, 0;
  167. set .pReg, 0;
  168. set .maxplayer, 0;
  169. deletearray .playerlist$, 128;
  170. deletearray .copiedplayer$, 128;
  171. deletearray .disqualified$, 128;
  172. end;
  173. //--End
  174. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement