viewing paste Badge Exchange | 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
prontera,155,177,6  script  Badge Exchange  725,{
    mes "[Badge Exchange]";
    mes "I can exchange your badges for Cash Points.";
    mes "Which would you like to exchange?";
    next;
    set .@i, select(.Menu$)-1;
    mes "[Badge Exchange]";
    setarray .@j, .Items[.@i*2], .Items[.@i*2+1], countitem(.Items[.@i*2]);
    if (.@j[2]) {
        mes "You have "+.@j[2]+"x "+getitemname(.@j[0])+".";
        mes "They are worth "+.@j[1]+" Cash Points each.";
        mes "How many would you like to exchange?";
        next;
        input .@k,0,.@j[2];
        mes "[Badge Exchange]";
        if (.@k) {
            delitem .@j[0],.@k;
            set #CASHPOINTS, #CASHPOINTS+(.@k*.@j[1]);
            mes "Traded "+.@k+"x "+getitemname(.@j[0])+".";
            dispbottom "Total Cash Points: "+#CASHPOINTS;
        }
        else mes "Okay, come back later.";
        close;
    }
    mes "You don't have any "+getitemname(.@j[0])+".";
    close;
 
OnInit:
    // Format: ItemID,Points,ItemID2,Points2,...
    setarray .Items[0],7829,1,7828,1;
    set .Menu$,"";
    for(set .@i,0; .@i<getarraysize(.Items); set .@i,.@i+2)
        set .Menu$, .Menu$+getitemname(.Items[.@i])+":";
    end;
}
Viewed 780 times, submitted by Guest.