prontera,150,170,0 script Coin Exchange 4_F_KAFRA5,{
mes(.npc_name$);
mes("What do you want to exchange for 1 Gold Coin?");
.@selection1 = select(.menu_option1$, .menu_option2$, .menu_option3$);
mesclear();
mes(.npc_name$);
if (countitem(Silver_Coin) < 1) {
mes("You need at least 1 Silver Coin.");
close();
}
switch (.@selection1) {
case 1:
if (Zeny < 500) {
mes("You need at least 500z.");
close();
}
break;
case 2:
if (#CASHPOINTS < 10) {
mes("You need at least 10 Cash Points.");
close();
}
break;
case 3:
if (countitem(Poring_Coin) < 1) {
mes("You need at least 1 Poring Coin.");
close();
}
break;
}
mes("Are you sure?");
.@selection2 = select("Yes", "No");
mesclear();
mes(.npc_name$);
if (.@selection2 == 2) {
mes("Okay, see you.");
close();
}
delitem(Silver_Coin, 1);
switch (.@selection1) {
case 1: // 20% success chance.
.@failed = (rand(10000) < 8000) ? 1 : 0;
Zeny -= 500;
break;
case 2: // 50% success chance.
.@failed = (rand(10000) < 5000) ? 1 : 0;
#CASHPOINTS -= 10;
break;
case 3: // 90% success chance.
.@failed = (rand(10000) < 1000) ? 1 : 0;
delitem(Poring_Coin, 1);
break;
}
if (.@failed == 1) {
mes("Sorry, you had no luck.");
} else {
mes("You're a lucky person and obtain 1 Gold Coin.");
getitem(Gold_Coin, 1);
}
close();
OnInit:
.npc_name$ = "[" + strnpcinfo(NPC_NAME_VISIBLE) + "]";
.menu_option1$ = "1 Silver Coin + 500z (20% chance)";
.menu_option2$ = "1 Silver Coin + 10 Cash Points (50% chance)";
.menu_option3$ = "1 Silver Coin + 1 Poring Coin (90% chance)";
end;
}
prontera,150,170,0 script Coin Exchange 4_F_KAFRA5,{
mes(.npc_name$);
mes("What do you want to exchange for 1 Gold Coin?");
.@selection1 = select(.menu_option1$, .menu_option2$, .menu_option3$);
mesclear();
mes(.npc_name$);
if (countitem(Silver_Coin) < 1) {
mes("You need at least 1 Silver Coin.");
close();
}
switch (.@selection1) {
case 1:
if (Zeny < 500) {
mes("You need at least 500z.");
close();
}
break;
case 2:
if (#CASHPOINTS < 10) {
mes("You need at least 10 Cash Points.");
close();
}
break;
case 3:
if (countitem(Poring_Coin) < 1) {
mes("You need at least 1 Poring Coin.");
close();
}
break;
}
mes("Are you sure?");
.@selection2 = select("Yes", "No");
mesclear();
mes(.npc_name$);
if (.@selection2 == 2) {
mes("Okay, see you.");
close();
}
delitem(Silver_Coin, 1);
switch (.@selection1) {
case 1: // 20% success chance.
.@failed = (rand(10000) < 8000) ? 1 : 0;
Zeny -= 500;
break;
case 2: // 50% success chance.
.@failed = (rand(10000) < 5000) ? 1 : 0;
#CASHPOINTS -= 10;
break;
case 3: // 90% success chance.
.@failed = (rand(10000) < 1000) ? 1 : 0;
delitem(Poring_Coin, 1);
break;
}
if (.@failed == 1) {
mes("Sorry, you had no luck.");
} else {
mes("You're a lucky person and obtain 1 Gold Coin.");
getitem(Gold_Coin, 1);
}
close();
OnInit:
.npc_name$ = "[" + strnpcinfo(NPC_NAME_VISIBLE) + "]";
.menu_option1$ = "1 Silver Coin + 500z (20% chance)";
.menu_option2$ = "1 Silver Coin + 10 Cash Points (50% chance)";
.menu_option3$ = "1 Silver Coin + 1 Poring Coin (90% chance)";
end;
}