viewing paste Mithril Coin Exchanger | Athena

Posted on the | Last edited on
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 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
prontera,150,150,5      script  ExchangeAgent   99,{
 
set .@itemid,674; //Exchange/Receive item (Mithril Coin = 674)
set .@name$,"[Exchange Agent]"; //npc dialogue name
set .@cost,100000000; //cost per mithril coin & zeny received when redeeming
 
mes .@name$;
mes "Hi, and welcome to my Exchange Shop.";
mes "What can I do you for?";
switch(select("Zeny into Mithril Coins:Mithril Coins into Zeny:Exit")){
        case 1:
                mes .@name$;
                mes "Hello, I can give you 1 Mithril Coin for 100'000'000 Zeny.";
                mes "Would you like to continue?";
        if(select("Yes:No")==2) close;
        if(Zeny < 100000000) close; //If less than 100m close
        next;
                mes .@name$;
                mes "Please input how many coins you'd like to purchase.";
                mes "Input 0 to cancel.";
        input .@input;
        set .@calc,.@cost*.@input;
        if(.@input == 0) close;
        if(.@calc > Zeny) close;
        next;
                mes .@name$;
                mes "You wish to exchange "+.@calc+" Zeny to "+.@input+" Mithril Coins?";
        if(select("Yes:No")==2) close;
        next;
                mes .@name$;
                mes "Processing Transfer..";
        sleep2 500;
        set Zeny,Zeny-.@calc;
        getitem .@itemid,.@input;
        sleep2 500;
                mes "Process Completed.";
        close;
        case 2:
                if(countitem(674) < 1) close; //check if no mithril coin it closes, why bother with other crap..
                mes .@name$;
                mes "How many would you like to turn into Zeny again?";
                mes "Press 0 to cancel.";
        input .@input;
        if(.@input == 0) close;
        set .@calc,Zeny + (.@input * .@cost); //Calculates if more than 2b
        if(.@input > countitem(.@itemid)) close;
        if(.@calc > 2000000000) close;
        next;
                mes .@name$;
                mes "You wish to turn "+.@input+" Mithril Coins into Zeny?";
        if(select("Yes:No")==2) close;
        next;
                mes .@name$;
                mes "Please wait.";
                mes "Processing..";
        next;
                mes .@name$;
                mes "Please wait.";
                mes "Processing...";
        sleep2 1000;
        delitem .@itemid,.@input; //Deletes item
        set .@zeny,.@input*.@cost; //calculates amount to be received
        set Zeny,Zeny + .@zeny;
        sleep2 500;
                mes "...";
        sleep2 500;
                mes "Transaction Completed.";
        close;
        case 3:
        close; //not going to bother with text here..
}
}
Viewed 666 times, submitted by Streusel.