viewing paste Billion Banker | Text

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 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96
//===== rAthena Script =======================================
//= The Billion Banker
//===== By: ==================================================
//= Joseph
//===== Current Version: =====================================
//= 1.0
//===== Compatible With: =====================================
//= rAthena, 3ceam, eAthena
//===== Description: =========================================
//= Withdraw and deposit large amount of Zeny
//===== Additional Comments: =================================
//= 1.0 - Released!
//============================================================
prontera,139,182,5  script  Banker  833,{
 
    function    FailMessage;
    function    Transaction;
 
    // == Configurations =========================================
    set .@mz, 1000000000;   // Server Max Zeny (Default: 1000000000)
    set .@n$, "[Banker]";   // NPC Name
    // ===========================================================
    
    mes .@n$;
    mes "Greetings!";
    mes "How can I help you?";
    mes " ";
    mes "Balance: " + #savings;
    set .@menu$, "Withdraw:Deposit";
    set .@j, select ( .@menu$ ) - 1;
    setarray .@menu$, "Withdraw", "Deposit";    
    next;
    mes .@n$;
    mes "How much would you like to " + .@menu$[.@j] + "?";
    input .@amt,0,.@mz;
    if ( .@amt == 0 )
    {
        next;
        mes .@n$;
        mes "^FF0000Invalid input...^000000";
        close;
    }
    next;
    mes .@n$;
    mes .@menu$[.@j] + ": " + .@amt;
    mes " ";
    mes (.@j!=2)?"Would you like to proceed?":"Thank you!";
    if ( select ( "Yes:No" ) == 2 ) close;
    next;
    mes .@n$;
    if ( FailMessage(.@j,.@amt,.@mz) != "" )
    {
        mes "^FF0000" +@msg$+ "^000000";
        set @msg$, "";
        close;
    }
    Transaction(.@j,.@amt);
    mes .@menu$[.@j] + " successful!";
    close;
 
    function    FailMessage {
    
        switch (getarg(0))
        {
            Case 0: // Withdraw
                if ( getarg(2) < (Zeny + getarg(1)) ) set @msg$, "You can't hold that much Zeny.";
                if ( #savings < getarg(1) ) set @msg$, "You have insufficient amount of Zeny in your bank account.";
                break;
                
            Case 1: // Deposit
                if ( Zeny < getarg(1) ) set @msg$, "You have insufficient amount of Zeny on hand.";
                break;
        }
        return @msg$;
    
    }
    
    function    Transaction {
    
        switch (getarg(0))
        {
            Case 0: // Withdraw
                set Zeny, Zeny + getarg(1);
                set #savings, #savings - getarg(1);
                break;
                
            Case 1: // Deposit
                set Zeny, Zeny - getarg(1);
                set #savings, #savings + getarg(1);
                break;
        }
        return;
        
    }
    
}
Viewed 1218 times, submitted by Guest.