Advertisement
Guest User

Untitled

a guest
Jul 21st, 2017
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.64 KB | None | 0 0
  1. //===== eAthena Script =======================================
  2. //= Lottery Script
  3. //===== By: ==================================================
  4. //= Masao
  5. //===== Current Version: =====================================
  6. //= 1.0
  7. //===== Compatible With: =====================================
  8. //= Any eAthena Version
  9. //===== Description: =========================================
  10. //= An Slot Machine like Lottery.
  11. //===== Additional Comments: =================================
  12. //= Version 1.0 if there are any Bugs please let me know.
  13. //============================================================
  14. maintown,194,232,4 script Mr.Krabs 807,{
  15.  
  16. set .@n$,"[Mr.Crabs]";
  17.  
  18. setarray @scratch_price,12117,// Lord of Death Prize: Wind Ele. Converter 10ea
  19. 11502,// Lady Tanee Prize: Light Blue Potion 10ea
  20. 12999,// Dracula Prize: Dead Branch Box 1ea
  21. 969,// Orc Hero Prize: Gold 1ea
  22. 12116,// WhiteSmith Howard Prize: Earth Ele. Converter 10ea
  23. 13517,// Orc Lord Prize: Yggdrassil Box 1ea
  24. 7619,// Amon Ra Prize: Enriched Elunium 5ea
  25. 7620,// Osiris Prize: Enriched Oridecon 5ea
  26. 12028,// Phreeoni Prize: Box of Thunder 10ea
  27. 13973,// Dark Snake Lord Prize: Poison Bottle Box 1ea
  28. 14533,// Baphomet Prize: Field Manual 100% 1ea
  29. 12103,// Golden Thiefbug Prize: Bloody Branch 1ea
  30. 12210,// Dark Lord Prize: Bubble Gum 1ea
  31. 12246; // Thanatos Prize: Mystical Card Album 1ea
  32. setarray @scratch_amount,10,
  33. 10,
  34. 1,
  35. 1,
  36. 10,
  37. 1,
  38. 5,
  39. 5,
  40. 10,
  41. 1,
  42. 1,
  43. 1,
  44. 1,
  45. 1;
  46. setarray @scratch_sign$,"LoD",
  47. "LaT",
  48. "Dra",
  49. "OrH",
  50. "WSH",
  51. "OrL",
  52. "AmR",
  53. "Osi",
  54. "Phr",
  55. "DSL",
  56. "Bap",
  57. "GTB",
  58. "DaL",
  59. "Tha";
  60. setarray @scratch_chance,1500, // LoD: 15,0%
  61. 2000, // LaT: 20,0%
  62. 1050, // Dra: 10,5%
  63. 500, // OrH: 5,0%
  64. 1500, // WSH: 15,0%
  65. 500, // OrL: 5,0%
  66. 100, // AmR: 1,0%
  67. 100, // Osi: 1,0%
  68. 1500, // Phr: 15,0%
  69. 1000, // DSL: 10,0%
  70. 100, // Bap: 1,0%
  71. 99, // GTB: 0,99%
  72. 50, // DaL: 0,5%
  73. 1; // Tha: 0,01%
  74.  
  75. for(set .@a,0; .@a < getarraysize(@scratch_chance); set .@a,.@a+1)
  76. {
  77. for(set .@b,.@a+1; .@b < getarraysize(@scratch_chance); set .@b,.@b+1)
  78. {
  79. set @scratch_chance[.@a],@scratch_chance[.@a]+@scratch_chance[.@b];
  80. }
  81. }
  82.  
  83. cleararray @slot$,"",9;
  84. set .@payment,20000;
  85.  
  86. function Slotbelegung;
  87. function checkRow;
  88.  
  89. set @menu,0;
  90.  
  91. while(@menu!=1)
  92. {
  93. mes .@n$;
  94. mes "Hello "+strcharinfo(0)+",";
  95. mes "would you like to have an lottery ticket?";
  96. mes "It costs you only "+.@payment+" zeny";
  97. mes "^FF0000The Jackpot is an Mystical Card Album!^000000";
  98. next;
  99. if(select("Give me one ^^:How do i win?:No, thank you.") > 1)
  100. {
  101. if(@menu&1)
  102. {
  103. next;
  104. mes .@n$;
  105. mes "Ok, have a nice day <3";
  106. close;
  107. }
  108. else
  109. {
  110. next;
  111. mes .@n$;
  112. mes "You need 3x the same Symbol.";
  113. mes "The Symbols have to be in one Row.";
  114. mes "And it doesn't matter if the Symbols are horizontal,";
  115. mes "vertical or diagonal in a row.";
  116. next;
  117. mes .@n$;
  118. mes "Symbol List:";
  119. mes "[LoD] Wind Elemental Converter 10ea";
  120. mes "[LaT] Light Blue Potion 10ea";
  121. mes "[Dra] Dead Branch Box 1ea";
  122. mes "[OrH] Gold 1ea";
  123. mes "[WSH] Earth Elemental Converter 10ea";
  124. mes "[OrL] Yggdrasil Box 1ea";
  125. mes "[AmR] Enriched Elunium 5ea";
  126. mes "[Osi] Enriched Oridecon 5ea";
  127. mes "[Phr] Box of Thunder 10ea";
  128. mes "[DSL] Poison Bottle Box 1ea";
  129. mes "[Bap] Field Manual 100% 1ea";
  130. mes "[GTB] Bloody Branch 1ea";
  131. mes "[DaL] Bubble Gum 1ea";
  132. mes "[Tha] Mystical Card Album 1ea";
  133. next;
  134. }
  135. }
  136. }
  137. setarray .@row1,0,1,2;
  138. setarray .@row2,0,3,6;
  139. setarray .@row3,0,4,8;
  140. setarray .@row4,1,4,7;
  141. setarray .@row5,6,4,2;
  142. setarray .@row6,2,5,8;
  143. setarray .@row7,3,4,5;
  144. setarray .@row8,6,7,8;
  145.  
  146. set .@slots,8;
  147.  
  148. if(Zeny < .@payment)
  149. {
  150. mes .@n$;
  151. mes "I'm sorry but you do not have enough Zeny to play~";
  152. close;
  153. }
  154. set Zeny,Zeny-.@payment;
  155. mes .@n$;
  156. mes "Here you go my Friend <3";
  157. for(set .@a,0;; set .@a,.@a+1)
  158. {
  159. mes "["+@slot$[0]+"] ["+@slot$[1]+"] ["+@slot$[2]+"]";
  160. mes "["+@slot$[3]+"] ["+@slot$[4]+"] ["+@slot$[5]+"]";
  161. mes "["+@slot$[6]+"] ["+@slot$[7]+"] ["+@slot$[8]+"]";
  162. next;
  163. if(.@a > 8) break;
  164. Slotbelegung(.@a);
  165. }
  166.  
  167. for(set .@a,0; .@a < .@slots; set .@a,.@a+1)
  168. {
  169. set .@win,.@win+checkRow(getd(".@row"+(.@a+1)+"[0]"),getd(".@row"+(.@a+1)+"[1]"),getd(".@row"+(.@a+1)+"[2]"));
  170. }
  171. if (.@win)
  172. {
  173. next;
  174. mes .@n$;
  175. mes "Congratulations you've won!";
  176. mes "Have Fun with your Price and see you next time <3";
  177. close;
  178. }
  179. mes .@n$;
  180. mes "Sorry, but you didn't win this time~";
  181. close;
  182.  
  183. function Slotbelegung {
  184. set .@rand,rand(1,10000);
  185. for(set .@b,0; .@b < getarraysize(@scratch_sign$)-1; set .@b,.@b+1)
  186. {
  187. if(@scratch_chance[(getarraysize(@scratch_sign$)-1-.@b)] >= .@rand) break;
  188. }
  189. set @slot$[getarg(0)],@scratch_sign$[(getarraysize(@scratch_sign$)-1-.@b)];
  190. }
  191.  
  192. function checkRow {
  193. function Win;
  194. if(@slot$[getarg(0)] == @slot$[getarg(1)] && @slot$[getarg(0)] == @slot$[getarg(2)])
  195. {
  196. Win(@slot$[getarg(0)]);
  197. return 1;
  198. }
  199. return 0;
  200. }
  201.  
  202. function Win {
  203. for(set .@c,0; .@c < getarraysize(@scratch_sign$); set .@c,.@c+1)
  204. {
  205. if(getarg(0) == @scratch_sign$[.@c])
  206. {
  207. mes "You've got 3 ["+@scratch_sign$[.@c]+"]!";
  208. getitem @scratch_price[.@c],@scratch_amount[.@c];
  209. if(@scratch_price[.@c] == 12246)
  210. {
  211. logmes "The Player "+strcharinfo(0)+" won an Mystical Card Album at the Lottery!";
  212. announce "The Player "+strcharinfo(0)+" won an Mystical Card Album at the Lottery!",bc_all;
  213. }
  214. }
  215. }
  216. }
  217.  
  218. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement