Advertisement
Guest User

Untitled

a guest
Oct 1st, 2020
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.05 KB | None | 0 0
  1. /*
  2. create table gold_room_ranking (
  3. char_id int primary key,
  4. gold_point int,
  5. key(`gold_point`)
  6. ) engine = innodb;
  7. */
  8. prontera,165,155,3 script Gold Room#tst 1_F_MARIA,{
  9. mes "[ ^C6A518Gold Room Assistant^000000 ]";
  10. mes "Whats up,basic people! I know you";
  11. mes "want to become rich! Well i have a";
  12. mes "place where you can find a very";
  13. mes "rare Birds";
  14. next;
  15. mes "[ ^C6A518Gold Room Assistant^000000 ]";
  16. mes "And if you kill those birds you";
  17. mes "will gain a random amounth of Gold";
  18. mes "Points or GP and you can TRADE it";
  19. mes "into real GOLD!";
  20. next;
  21. mes "[ ^C6A518Gold Room Assistant^000000 ]";
  22. mes "But there is something you should";
  23. mes "know... There are guardians that";
  24. mes "lurking around the map and they are strong!!";
  25. mes "^FF0000All of your points will lose when you die!^000000";
  26. next;
  27. switch(select("~ Enter to Gold Room:~ Convert My Gold Points:~ Gold Room Ranking:~My Ranking:~ Cancel")) {
  28. case 1:
  29. mes "[ ^C6A518Gold Room Assistant^000000 ]";
  30. mes "Sorry to disturb you,but I need to";
  31. mes "check if you're a bot.";
  32. mes "Please type the correct captcha:";
  33. mes "FEE: ^FF0000"+ F_InsertComma(.zeny) +" Zeny^000000";
  34. for (.@i = 0; .@i < .strLen; ++.@i)
  35. .@str$ += charat(.charSet$, rand(0, getstrlen(.charSet$)));
  36. mes "Captcha: ^C6A518"+ .@str$ +"^000000";
  37. next;
  38. input .@txt$;
  39. if (.@txt$ != .@str$) {
  40. mes "You have not inputted Correct.";
  41. mes "Captcha";
  42. next;
  43. atcommand "@kick "+ strcharinfo(0);
  44. end;
  45. }
  46. if (Zeny < .zeny) {
  47. mes "Sorry, but you can't enter the room.";
  48. close;
  49. }
  50. Zeny -= .zeny;
  51. warp "ordeal_1-2",151,154;
  52. end;
  53. case 2:
  54. if (!goldPoint) {
  55. mes "[ ^C6A518Gold Room Assistant^000000 ]";
  56. mes "Sorry, you don't have any Gold Points!";
  57. dispbottom "Gold Points: 0";
  58. close;
  59. }
  60. next;
  61. select "Exchange Points";
  62. mes "[ ^C6A518Gold Room Assistant^000000 ]";
  63. mes "You got "+ goldPoint +" Gold Point.";
  64. mes "How many points do you want to";
  65. mes "exchange in Gold?";
  66. mes " ";
  67. mes "Each points are equivalent to ^FF00001^000000 Gold. ";
  68. next;
  69. if (input(.@gpoint, 0, 30000))
  70. close;
  71. if (.@gpoint > goldPoint) {
  72. mes "[ ^C6A518Gold Room Assistant^000000 ]";
  73. mes "Sorry, you don't have any Gold Points!";
  74. close;
  75. }
  76. mes "[ ^C6A518Gold Room Assistant^000000 ]";
  77. mes "Gained ^FF0000"+ .@gpoint +"^000000 x Gold.";
  78. if (!checkweight("Gold", goldPoint)) {
  79. mes "[ ^C6A518Gold Room Assistant^000000 ]";
  80. mes "Sorry, you can't carry these gold bars.";
  81. close;
  82. }
  83. getitem "Gold", .@gpoint;
  84. goldPoint -= .@gpoint;
  85. close;
  86. case 3:
  87. .@nb = query_sql("select char_id as aaa, (select name from `char` where char_id = aaa), gold_point from gold_room_ranking where gold_point > 0 order by 3 desc limit 10", .@cid, .@name$, .@ppk);
  88. if (!.@nb) {
  89. mes "[ ^C6A518Gold Room Assistant^000000 ]";
  90. mes "No ranking yet";
  91. close;
  92. }
  93. for (.@i = 0; .@i < .@nb; ++.@i)
  94. mes "[ ^C6A518Gold Room Assistant^000000 ]";
  95. mes (.@i +1)+". "+ .@name$[.@i] +" - "+ .@ppk[.@i] +" Kills";
  96. close;
  97. case 4:
  98. .@nb = query_sql("select char_id as aaa, (select name from `char` where char_id = aaa), gold_point from gold_room_ranking where gold_point > 0 order by 3 desc limit 10", .@cid, .@name$, .@ppk);
  99. if (!.@nb) {
  100. mes "[ ^C6A518Gold Room Assistant^000000 ]";
  101. mes "No ranking yet";
  102. close;
  103. }
  104. for (.@i = 0; .@i < .@nb; ++.@i)
  105. mes "[ ^C6A518Gold Room Assistant^000000 ]";
  106. mes "You have "+ .@ppk[.@i] +" Kills";
  107. close;
  108. default:
  109. mes "[ ^C6A518Gold Room Assistant^000000 ]";
  110. mes "Goodbye~";
  111. close;
  112. }
  113. end;
  114.  
  115. OnInit:
  116. .charSet$ = "0123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNOPQRSTUVWXYZ";
  117. .strLen = 4; // Sets how many characters for the generated confirmation code.
  118. .zeny = 200000; // Entrance FEE for the room
  119. monster "ordeal_1-2", 0,0, "Golden Peco", 1369, 500, strnpcinfo(0)+"::OnKilled";
  120. end;
  121.  
  122. OnKilled:
  123. .@ppk = rand(1,3); // Points per kill
  124. goldPoint += .@ppk;
  125. dispbottom "You've earned "+ .@ppk +" Gold Point(s).[ Total:"+ goldPoint +" ]";
  126. monster "ordeal_1-2", 0,0, "Golden Peco", 1369, 1, strnpcinfo(0)+"::OnKilled";
  127. query_sql "insert into gold_room_ranking values ( "+ getcharid(0) +", "+ .@ppk +") on duplicate key update gold_point = gold_point +"+ .@ppk;
  128. end;
  129.  
  130. OnPCDieEvent:
  131. if (strcharinfo(PC_MAP) == "ordeal_1-2") {
  132. goldPoint = 0;
  133. dispbottom "Sorry, but all of the Gold Points you have earned has vanished.";
  134. }
  135. end;
  136. }
  137.  
  138. ordeal_1-2,153,154,4 script Exit 1_F_MARIA,{
  139. mes "[ ^C6A518Goldy^000000 ]";
  140. mes "Go back to Main Town?";
  141. if (select("Yes:No") == 2) close;
  142. warp "SavePoint",0,0;
  143. end;
  144. }
  145.  
  146. //============Spawns=================
  147.  
  148. ordeal_1-2,0,0,0,0 monster Sword Guardian 1829,10,0,0,0
  149. ordeal_1-2,0,0,0,0 monster Sword Guardian 1829,10,0,0,0
  150.  
  151. ordeal_1-2 mapflag nobranch
  152. ordeal_1-2 mapflag noloot
  153. ordeal_1-2 mapflag noexp
  154. ordeal_1-2 mapflag nodrop
  155. ordeal_1-2 mapflag noskill
  156. ordeal_1-2 mapflag novending
  157. ordeal_1-2 mapflag noreturn
  158. ordeal_1-2 mapflag nowarp
  159. ordeal_1-2 mapflag nowarpto
  160. ordeal_1-2 mapflag nomemo
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement