viewing paste topic/4516- simple exchanger | Athena

Posted on the
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
// 674,Mithril_Coin
// 13517,Yggdrasilberry_Box
// 7227,TCG_Card
// 100 coins + 15 berry ticket <-> 1 TCG
 
prontera,144,168,6  script  TCG Exchanger   117,{
    mes "[TCG Exchanger]";
    mes "Hello there.";
    mes "I can change your Berry Tickets and YourRO Points to TCG or TCG to Premium Tickets and YourRO Points";
    mes "Which do you need?";
    next;
    menu "Berry to Ticket",t_trade, "Ticket to Berry",b_trade, "I dont need anything",-;
    mes "[TCG Exchanger]";
    mes "Very well, have a nice day.";
    close;
t_trade:
    if ( countitem(674) < 100 ) goto t_fail; // Mithril_Coin
    if ( countitem(13517) < 15 ) goto t_fail; // Yggdrasilberry_Box
    delitem 674, 100;
    delitem 13517, 15;
    mes "[TCG Exchanger]";
    mes "Ok, here's Your ^0000FFPremium Ticket^000000.";
    getitem 7227, 1; // TCG_Card
    close;
t_fail:
    mes "[TCG Exchanger]";
    mes "I'm terribly sorry, but you do not have enough berry for this ticket.";
    next;
    mes "[TCG Exchanger]";
    mes "Please come back when you have the correct ammount.";
    close;
b_trade:
    if ( countitem(7227) < 1 ) goto b_fail; // TCG_Card
    if ( !checkweight(674,100,13517,15) ) goto t_OverWeight; // 100 Mithril_Coin & 15 Yggdrasilberry_Box
    delitem 7227,1;
    mes "[TCG Exchanger]";
    mes "Ok, here's Your ^0000FF300 Yggdrasil Berry^000000.";
    getitem 674,100;
    getitem 13517,15;
    close;
b_fail:
    mes "[TCG Exchanger]";
    mes "It seems you don't have that ticket.";
    close;
t_OverWeight:
    mes "[TCG Exchanger]";
    mes "It seems you are overweight.";
    close;
}
Viewed 1219 times, submitted by AnnieRuru.