diff --git a/db/re/item_db_usable.yml b/db/re/item_db_usable.yml index 1aa9b3e555..49e289ec0f 100644 --- a/db/re/item_db_usable.yml +++ b/db/re/item_db_usable.yml @@ -58679,7 +58679,7 @@ Body: - Id: 23919 AegisName: K_Secret_Key Name: Kachua's Secret Key - Type: Usable + Type: Delayconsume Trade: NoDrop: true NoTrade: true @@ -58689,7 +58689,7 @@ Body: NoMail: true NoAuction: true Script: | - /* callfunc "F_Kachua_Key"; */ + duplicate_dynamic("Kachua's Secret Box#bm"); - Id: 23921 AegisName: Season_Evt_Reward Name: Event Reward Box diff --git a/db/re/item_group_db.yml b/db/re/item_group_db.yml index 039bf2cd15..264b908cd3 100644 --- a/db/re/item_group_db.yml +++ b/db/re/item_group_db.yml @@ -48211,3 +48211,19 @@ Body: - Item: Trans_Scroll_Gazeti - Item: Trans_Scroll_Kobold_Archer - Item: Trans_Scroll_Necromancer + - Group: KACHUA_SECRET_BOX + SubGroups: + - SubGroup: 0 + List: + - Item: Cachua_Coupon + - SubGroup: 1 + List: + - Item: Red_Potion + Rate: 4 + - Item: Yellow_Potion + Rate: 3 + - Item: White_Potion + Rate: 2 + - Item: Blue_Potion + Rate: 1 + Announced: true diff --git a/npc/re/other/kachua_key.txt b/npc/re/other/kachua_key.txt new file mode 100644 index 0000000000..d16c457306 --- /dev/null +++ b/npc/re/other/kachua_key.txt @@ -0,0 +1,71 @@ +//===== 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,{ + mes "A Secret Box where no one knows what's inside."; + mes "^4d4dffYou can open this box by consuming [Kachua's Secret Key]23919.^000000"; + next; + switch(select("^4d4dffOpen the box 1 time (1 Kachua Secret Key)^000000","^4d4dffOpen the box 10 times (10 Kachua 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("K_Secret_Key") < 1) { + mes "Not enough [Kachua Secret Key]23919."; + 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("K_Secret_Key", 1); + getgroupitem(IG_KACHUA_SECRET_BOX); + mes "Kachua's Secret Box is 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("K_Secret_Key") < 10) { + mes "Not enough [Kachua Secret Key]23919."; + 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("K_Secret_Key") < 1) { // Custom check, just in case + close; + } + delitem("K_Secret_Key", 1); + getgroupitem(IG_KACHUA_SECRET_BOX); + dispbottom "Kachua's Secret Box opened " + .@i + " times. It's kept opening.",0xFFFFFF; + specialeffect2 EF_VALLENTINE; + } + mes "Kachua's Secret Box is opened 10 times!"; + mes "Were you lucky?"; + close; + } + } +} diff --git a/npc/re/scripts_athena.conf b/npc/re/scripts_athena.conf index 73d4735f6d..33545a4d6e 100644 --- a/npc/re/scripts_athena.conf +++ b/npc/re/scripts_athena.conf @@ -174,6 +174,7 @@ npc: npc/re/other/resetskill.txt npc: npc/re/other/stone_change.txt npc: npc/re/other/turbo_track.txt npc: npc/re/other/CashShop_Functions.txt +npc: npc/re/other/kachua_key.txt // --------------------------- Quests --------------------------- // - Eden Group ------------------------------------------------- diff --git a/src/map/itemdb.hpp b/src/map/itemdb.hpp index 7cc04dc6b5..1af93e6574 100644 --- a/src/map/itemdb.hpp +++ b/src/map/itemdb.hpp @@ -1740,6 +1740,7 @@ enum e_random_item_group { IG_COSTUMEMILEAGE_PACKAGE3, IG_COMP_TRANS_SCROLL, IG_MINUS_STATUS_BOX, + IG_KACHUA_SECRET_BOX, IG_MAX, }; diff --git a/src/map/script_constants.hpp b/src/map/script_constants.hpp index c0e79a600d..f82b0d5df4 100644 --- a/src/map/script_constants.hpp +++ b/src/map/script_constants.hpp @@ -6538,6 +6538,7 @@ export_constant(IG_COSTUMEMILEAGE_PACKAGE3); export_constant(IG_COMP_TRANS_SCROLL); export_constant(IG_MINUS_STATUS_BOX); + export_constant(IG_KACHUA_SECRET_BOX); /* unit stop walking */ export_constant(USW_NONE);