kachua_key.txt 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. //===== rAthena Script =======================================
  2. //= Dynamic NPC: Kachua's Secret Box
  3. //===== Description: =========================================
  4. //- [Official conversion]
  5. //= Kachua's Secret Box is a Gachapon NPC.
  6. //= It lets the player exchange a Kachua's Secret Key for a random item.
  7. //= It also gives a Kachua's Mileage Coupon for each pull.
  8. //===== Changelogs: ==========================================
  9. //= 1.0 First version. [secretdataz]
  10. //============================================================
  11. sec_in02,126,178,3 script Kachua's Secret Box#bm 4_TREASURE_BOX,{
  12. .@key$ = "K_Secret_Key";
  13. .@keyname$ = getitemname( .@key$ );
  14. .@box$ = "Main_Lucky_Box";
  15. .@boxname$ = getitemname( .@box$ );
  16. mes "A Secret Box where no one knows what's inside.";
  17. mes "^4d4dffYou can open this box by consuming " + mesitemlink( .@key$ ) + ".^000000";
  18. next;
  19. switch(select("^4d4dffOpen the box 1 time (1 " + .@keyname$ + ")^000000","^4d4dffOpen the box 10 times (10 " + .@keyname$ + "s)^000000")) {
  20. case 1:
  21. mes "^FF0000[Notice]^000000";
  22. mes "^FF0000Exchange one random item with one " + .@keyname$ + ".^000000";
  23. mes "^FF0000The item exchanged above cannot be withdrawn, nor can it be exchanged to " + .@keyname$ + ".^000000";
  24. next;
  25. if(select("Keep going.","Stop conversation.") == 2) {
  26. mes "You have decided not to open the Box.";
  27. close;
  28. } else if (countitem(.@key$) < 1) {
  29. mes "Not enough " + mesitemlink( .@key$ ) + ".";
  30. close;
  31. } else {
  32. if (checkweight(1201,1) == 0 || ((MaxWeight - Weight) * 100 / MaxWeight) < 10) {
  33. mes "^4d4dffPlease make sure you have enough space in your inventory.^000000";
  34. close;
  35. }
  36. delitem(.@key$, 1);
  37. consumeitem(.@box$);
  38. mes .@boxname$ + " was opened!";
  39. mes "Were you lucky?";
  40. specialeffect2 EF_VALLENTINE;
  41. close;
  42. }
  43. case 2:
  44. mes "^FF0000[Notice]^000000";
  45. mes "^FF0000Exchange 10 random items with 10 " + .@keyname$ + "s.^000000";
  46. mes "^FF0000The items exchanged above cannot be withdrawn, nor can it be exchanged to " + .@keyname$ + ".^000000";
  47. next;
  48. if(select("Keep going.","Stop conversation.") == 2) {
  49. mes "You have decided not to open the Box.";
  50. close;
  51. } else if (countitem(.@key$) < 10) {
  52. mes "You do not have enough " + mesitemlink( .@key$ ) + ".";
  53. close;
  54. } else {
  55. for (.@i = 1; .@i <= 10; ++.@i) {
  56. progressbar "4d4dff",2;
  57. if (checkweight(1201,1) == 0 || ((MaxWeight - Weight) * 100 / MaxWeight) < 10) {
  58. mes "^4d4dffPlease make sure you have enough space in your inventory.^000000";
  59. close;
  60. }
  61. if (countitem(.@key$) < 1) { // Custom check, just in case
  62. close;
  63. }
  64. delitem(.@key$, 1);
  65. consumeitem(.@box$);
  66. dispbottom .@boxname$ + " was opened " + .@i + " times. Another one is being opened.",0xFFFFFF;
  67. specialeffect2 EF_VALLENTINE;
  68. }
  69. mes .@boxname$ + " was opened 10 times!";
  70. mes "Were you lucky?";
  71. close;
  72. }
  73. }
  74. }