rathena/npc/re/other/kachua_key.txt
2022-11-28 16:53:49 +01:00

73 lines
3.0 KiB
Plaintext

//===== rAthena Script =======================================
//= Dynamic NPC: Kachua's Secret Box
//===== Description: =========================================
//- [Official conversion]
//= Kachua's Secret Box is a Gachapon NPC.
//= It lets the player exchange a Kachua's Secret Key for a random item.
//= It also gives a Kachua's Mileage Coupon for each pull.
//===== Changelogs: ==========================================
//= 1.0 First version. [secretdataz]
//============================================================
sec_in02,126,178,3 script Kachua's Secret Box#bm 4_TREASURE_BOX,{
.@key$ = "K_Secret_Key";
mes "A Secret Box where no one knows what's inside.";
mes "^4d4dffYou can open this box by consuming <ITEM>[Kachua's Secret Key]<INFO>23919</INFO></ITEM>.^000000";
next;
switch(select("^4d4dffOpen the box 1 time (1 Kachua's Secret Key)^000000","^4d4dffOpen the box 10 times (10 Kachua's Secret Keys)^000000")) {
case 1:
mes "^FF0000[Notice]^000000";
mes "^FF0000Exchange one random item with one Kachua's Secret Key.^000000";
mes "^FF0000The item exchanged above cannot be withdrawn, nor can it be exchanged to Kachua's Secret Key.^000000";
next;
if(select("Keep going.","Stop conversation.") == 2) {
mes "You have decided not to open the Box.";
close;
} else if (countitem(.@key$) < 1) {
mes "Not enough <ITEM>[Kachua Secret Key]<INFO>23919</INFO></ITEM>.";
close;
} else {
if (checkweight(1201,1) == 0 || ((MaxWeight - Weight) * 100 / MaxWeight) < 10) {
mes "^4d4dffPlease make sure you have enough space in your inventory.^000000";
close;
}
delitem(.@key$, 1);
getgroupitem(IG_MAIN_LUCKY_BOX); // TODO: change to consumeitem "Main_Lucky_Box" when consumeitem is fixed
mes "Kachua's Secret Box was opened!";
mes "Were you lucky?";
specialeffect2 EF_VALLENTINE;
close;
}
case 2:
mes "^FF0000[Notice]^000000";
mes "^FF0000Exchange 10 random item with 10 Kachua's Secret Key.^000000";
mes "^FF0000The items exchanged above cannot be withdrawn, nor can it be exchanged to Kachua's Secret Key.^000000";
next;
if(select("Keep going.","Stop conversation.") == 2) {
mes "You have decided not to open the Box.";
close;
} else if (countitem(.@key$) < 10) {
mes "You do not have enough <ITEM>[Kachua Secret Key]<INFO>23919</INFO></ITEM>.";
close;
} else {
for (.@i = 1; .@i <= 10; ++.@i) {
progressbar "4d4dff",2;
if (checkweight(1201,1) == 0 || ((MaxWeight - Weight) * 100 / MaxWeight) < 10) {
mes "^4d4dffPlease make sure you have enough space in your inventory.^000000";
close;
}
if (countitem(.@key$) < 1) { // Custom check, just in case
close;
}
delitem(.@key$, 1);
getgroupitem(IG_MAIN_LUCKY_BOX); // TODO: change to consumeitem "Main_Lucky_Box" when consumeitem is fixed
dispbottom "Kachua's Secret Box was opened " + .@i + " times. Another one is being opened.",0xFFFFFF;
specialeffect2 EF_VALLENTINE;
}
mes "Kachua's Secret Box was opened 10 times!";
mes "Were you lucky?";
close;
}
}
}