Apply suggestions from code review

Co-authored-by: Lemongrass3110 <lemongrass@kstp.at>
This commit is contained in:
Jittapan Pluemsumran 2022-11-08 23:47:57 +07:00 committed by Atemo
parent c069b2d0f1
commit e76ef51793

View File

@ -16,9 +16,9 @@ sec_in02,126,178,3 script Kachua's Secret Box#bm 4_TREASURE_BOX,{
switch(select("^4d4dffOpen the box 1 time (1 Kachua Secret Key)^000000","^4d4dffOpen the box 10 times (10 Kachua Secret Keys)^000000")) { switch(select("^4d4dffOpen the box 1 time (1 Kachua Secret Key)^000000","^4d4dffOpen the box 10 times (10 Kachua Secret Keys)^000000")) {
case 1: case 1:
mes "^FF0000[Notice]^000000"; mes "^FF0000[Notice]^000000";
mes "^FF0000Exchange one random item with one Kachua's Secret Key.^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"; mes "^FF0000The item exchanged above cannot be withdrawn, nor can it be exchanged to Kachua's Secret Key.^000000";
next; next;
if(select("Keep going.","Stop conversation.") == 2) { if(select("Keep going.","Stop conversation.") == 2) {
mes "You have decided not to open the Box."; mes "You have decided not to open the Box.";
close; close;
@ -32,21 +32,21 @@ sec_in02,126,178,3 script Kachua's Secret Box#bm 4_TREASURE_BOX,{
} }
delitem("K_Secret_Key", 1); delitem("K_Secret_Key", 1);
getgroupitem(IG_KACHUA_SECRET_BOX); getgroupitem(IG_KACHUA_SECRET_BOX);
mes "Kachua's Secret Box is opened!"; mes "Kachua's Secret Box was opened!";
mes "Were you lucky?"; mes "Were you lucky?";
specialeffect2 EF_VALLENTINE; specialeffect2 EF_VALLENTINE;
close; close;
} }
case 2: case 2:
mes "^FF0000[Notice]^000000"; mes "^FF0000[Notice]^000000";
mes "^FF0000Exchange 10 random item with 10 Kachua's Secret Key.^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"; mes "^FF0000The items exchanged above cannot be withdrawn, nor can it be exchanged to Kachua's Secret Key.^000000";
next; next;
if(select("Keep going.","Stop conversation.") == 2) { if(select("Keep going.","Stop conversation.") == 2) {
mes "You have decided not to open the Box."; mes "You have decided not to open the Box.";
close; close;
} else if (countitem("K_Secret_Key") < 10) { } else if (countitem("K_Secret_Key") < 10) {
mes "Not enough <ITEM>[Kachua Secret Key]<INFO>23919</INFO></ITEM>."; mes "You do not have enough <ITEM>[Kachua Secret Key]<INFO>23919</INFO></ITEM>.";
close; close;
} else { } else {
for (.@i = 1; .@i <= 10; ++.@i) { for (.@i = 1; .@i <= 10; ++.@i) {
@ -60,10 +60,10 @@ sec_in02,126,178,3 script Kachua's Secret Box#bm 4_TREASURE_BOX,{
} }
delitem("K_Secret_Key", 1); delitem("K_Secret_Key", 1);
getgroupitem(IG_KACHUA_SECRET_BOX); getgroupitem(IG_KACHUA_SECRET_BOX);
dispbottom "Kachua's Secret Box opened " + .@i + " times. It's kept opening.",0xFFFFFF; dispbottom "Kachua's Secret Box was opened " + .@i + " times. It's kept opening.",0xFFFFFF;
specialeffect2 EF_VALLENTINE; specialeffect2 EF_VALLENTINE;
} }
mes "Kachua's Secret Box is opened 10 times!"; mes "Kachua's Secret Box was opened 10 times!";
mes "Were you lucky?"; mes "Were you lucky?";
close; close;
} }