Page 1 of 3

Can this script be used?

Posted: 10 Mar 2008, 16:54
by Landon
blank.gat,132,217,5 script Banker 109,{
set @cost,0;
mes "[Banker]";
mes "Welcome to the First Bank of The Mana World. How can I help you today?";
next;
menu "I'd like to make a deposit.",Ldeposit,"I'd like to make a withdrawl.",Lwithdrawl,"What's my current balance?",Lbalance,"Cancel",Lcancel;

Ldeposit:
mes "[Banker]";
mes "Very well... How much would you like to deposit? The maximum you can deposit at once is 999,999 gold.";
next;
if (@cost > 0) goto Ldepocost;
goto Ldepocont;

Ldepocost:
mes "[Banker]";
mes "Oh and don't forget there is a " + @cost + " gold charge on all transactions.";
next;
goto Ldepocont;

Ldepocont:
input @deposit;
if (@deposit < 1) goto Lrealamount;
if (@deposit > gold) goto Lneedgold;
if (@deposit > (gold - @cost)) goto Lneedgold2;
set gold,gold - @deposit;
set gold,gold - @cost;
set #bankstorage,#bankstorage + @deposit;
mes "[Banker]";
mes "Thank you very much... Your gold is in good hands.";
close;

Lwithdrawl:
mes "[Banker]";
mes "Very well... How much would you like to withdraw? The maximum you can withdraw at one time is 999,999 gold";
next;
if (@cost > 0) goto Lwithcost;
goto Lwithcont;

Lwithcost:
mes "[Banker]";
mes "Oh and don't forget there is a " + @cost + " gold charge on all transactions.";
next;
goto Lwithcont;

Lwithcont:
input @withdrawl;
if (@withdrawl < 1) goto Lrealamount;
if (@withdrawl > #bankstorage) goto Lneedgold3;
if ((@cost > gold) && ((gold + @withdrawl) > @cost)) goto Lcostask;
if (@cost > gold) goto Lneedzeny2;
goto Lwithcont2;

Lcostask:
mes "[Banker]";
mes "You don't have the gold for the transaction fee right now. Would you like me to take the fee directly from your withdrawl?";
next;
menu "Yes please.",Lwithtake,"No thank you.",Lcancel;

Lwithtake:
mes "[Banker]";
mes "Ok then.";
set @withdrawl,@withdrawl - @cost;
set #bankstorage,#bankstorage - @cost;
set @cost,0;
next;
goto Lwithcont2;

Lwithcont2:
set gold,gold - @cost;
set gold,gold + @withdrawl;
set #bankstorage,#bankstorage - @withdrawl;
mes "[Banker]";
mes "There's your gold. Have a good day.";
close;

Lbalance:
mes "[Banker]";
mes "Hmmmm lemme check the paper work.";
next;
mes "*Rustle, Rustle*";
next;
mes "[Banker]";
mes "You currently have " + #bankstorage + " gold in your account.";
close;

Lrealamount:
mes "[Banker]";
mes "Don't play jokes with me please. Next time ask for a real amount.";
close;

Lneedzeny:
mes "[Banker]";
mes "You don't have enough gold to make that deposit.";
close;

Lneedzeny2:
mes "[Banker]";
mes "You don't have enough gold to cover the transaction fee.";
close;

Lneedzeny3:
mes "[Banker]";
mes "You don't have enough gold in your account.";
close;

Lcancel:
mes "[Banker]";
mes "Very well... come again soon.";
close;
}

Re: Can this script be used?

Posted: 10 Mar 2008, 17:09
by GonzoDark
Landon wrote:blank.gat,132,217,5 script Banker 109,{
set @cost,0;
mes "[Banker]";
mes "Welcome to the First Bank of The Mana World. How can I help you today?";
next;
menu "I'd like to make a deposit.",Ldeposit,"I'd like to make a withdrawl.",Lwithdrawl,"What's my current balance?",Lbalance,"Cancel",Lcancel;

Ldeposit:
mes "[Banker]";
mes "Very well... How much would you like to deposit? The maximum you can deposit at once is 999,999 gold.";
next;
if (@cost > 0) goto Ldepocost;
goto Ldepocont;

Ldepocost:
mes "[Banker]";
mes "Oh and don't forget there is a " + @cost + " gold charge on all transactions.";
next;
goto Ldepocont;

Ldepocont:
input @deposit;
if (@deposit < 1) goto Lrealamount;
if (@deposit > gold) goto Lneedgold;
if (@deposit > (gold - @cost)) goto Lneedgold2;
set gold,gold - @deposit;
set gold,gold - @cost;
set #bankstorage,#bankstorage + @deposit;
mes "[Banker]";
mes "Thank you very much... Your gold is in good hands.";
close;

Lwithdrawl:
mes "[Banker]";
mes "Very well... How much would you like to withdraw? The maximum you can withdraw at one time is 999,999 gold";
next;
if (@cost > 0) goto Lwithcost;
goto Lwithcont;

Lwithcost:
mes "[Banker]";
mes "Oh and don't forget there is a " + @cost + " gold charge on all transactions.";
next;
goto Lwithcont;

Lwithcont:
input @withdrawl;
if (@withdrawl < 1) goto Lrealamount;
if (@withdrawl > #bankstorage) goto Lneedgold3;
if ((@cost > gold) && ((gold + @withdrawl) > @cost)) goto Lcostask;
if (@cost > gold) goto Lneedzeny2;
goto Lwithcont2;

Lcostask:
mes "[Banker]";
mes "You don't have the gold for the transaction fee right now. Would you like me to take the fee directly from your withdrawl?";
next;
menu "Yes please.",Lwithtake,"No thank you.",Lcancel;

Lwithtake:
mes "[Banker]";
mes "Ok then.";
set @withdrawl,@withdrawl - @cost;
set #bankstorage,#bankstorage - @cost;
set @cost,0;
next;
goto Lwithcont2;

Lwithcont2:
set gold,gold - @cost;
set gold,gold + @withdrawl;
set #bankstorage,#bankstorage - @withdrawl;
mes "[Banker]";
mes "There's your gold. Have a good day.";
close;

Lbalance:
mes "[Banker]";
mes "Hmmmm lemme check the paper work.";
next;
mes "*Rustle, Rustle*";
next;
mes "[Banker]";
mes "You currently have " + #bankstorage + " gold in your account.";
close;

Lrealamount:
mes "[Banker]";
mes "Don't play jokes with me please. Next time ask for a real amount.";
close;

Lneedzeny:
mes "[Banker]";
mes "You don't have enough gold to make that deposit.";
close;

Lneedzeny2:
mes "[Banker]";
mes "You don't have enough gold to cover the transaction fee.";
close;

Lneedzeny3:
mes "[Banker]";
mes "You don't have enough gold in your account.";
close;

Lcancel:
mes "[Banker]";
mes "Very well... come again soon.";
close;
}
I really hope it can be used! - don't know about the fee, but it's fine with me.

Can you make a "deposit item" code also? (that would be great!)

Great to see that someone finally makes the bank become a reality!

// GonzoDark

Re: Can this script be used?

Posted: 10 Mar 2008, 17:11
by Crush
1. Did you test the script?

2. What reason do you have to store your money on the bank instead of on your character?

Re: Can this script be used?

Posted: 10 Mar 2008, 17:19
by GonzoDark
Crush wrote:1. Did you test the script?

2. What reason do you have to store your money on the bank instead of on your character?
I would also be really happy to deposit items, insted of only money, but I think it is a great start!

// GonzoDark

Re: Can this script be used?

Posted: 10 Mar 2008, 17:20
by Landon
It's just a generic banker script, no I have not tested it, It could possibly be altered to store items instead of gold.

I am not much of a programmer, I am still learning. If anyone thinks something can be done with, please by all means take the script modify and have implemented.

Re: Can this script be used?

Posted: 10 Mar 2008, 17:46
by Sertraline
Very nice work, Landon, best of luck to you with this. One question: why the 999,999 withdraw/deposit limit?

Re: Can this script be used?

Posted: 10 Mar 2008, 17:49
by Crush
You programmed it without testing it? I see where this is leading...

Re: Can this script be used?

Posted: 10 Mar 2008, 17:56
by Matt
Crush wrote:1. Did you test the script?

2. What reason do you have to store your money on the bank instead of on your character?

Well you could buy arrows for example. You can't if you have some millions of zeny

Re: Can this script be used?

Posted: 10 Mar 2008, 17:57
by Landon
Ok I tested it and it will need some work, I play around with it.

Re: Can this script be used?

Posted: 11 Mar 2008, 14:43
by zick
I can't tell but that looks like the eAthena scripting language which will not be used on the new server (or so I've heard).

Re: Can this script be used?

Posted: 11 Mar 2008, 15:21
by Jaxad0127
zick wrote:I can't tell but that looks like the eAthena scripting language which will not be used on the new server (or so I've heard).
It won't. LUA is being used instead.

Re: Can this script be used?

Posted: 11 Mar 2008, 22:42
by Landon
It is an eathena script, but the new game is not finished yet; why not enjoy something while it is there?

Re: Can this script be used?

Posted: 11 Mar 2008, 23:55
by GonzoDark
Landon wrote:It is an eathena script, but the new game is not finished yet; why not enjoy something while it is there?
Did you make any progress on making it work??

// GonzoDark

Re: Can this script be used?

Posted: 12 Mar 2008, 13:17
by Landon
Some what, It will take me a while just started learning scripting couple weeks ago, Item storage may be beyond me. I am reading all kinds of stuff and learning. I am working on a gold and storage bank primarily a gold bank right now, I think I might have a script that would allow for pre-set interest rate where you can gain X amount of interest per every thousand gold there is. I am testing that script right now and am running into mild difficulties, It causes all character movement to freeze; but I am sure I will figure that part out soon.
GonzoDark wrote:
Landon wrote:It is an eathena script, but the new game is not finished yet; why not enjoy something while it is there?
Did you make any progress on making it work??

// GonzoDark
GonzoDark wrote:
Landon wrote:It is an eathena script, but the new game is not finished yet; why not enjoy something while it is there?
Did you make any progress on making it work??

// GonzoDark

Re: Can this script be used?

Posted: 14 Mar 2008, 20:48
by lost_soul
I have been thinking about how to go about implementing a Bank in the new server, and the only advantage to placing your money in a Bank were to be if you earned interest on your deposit. I think that you would have to pretty much treat money deposited like Certificate of Deposit's (CD's), with interest compounded weekly (a reasonable time??), and with automatic rollover. If you withdrew your fund's before the term was over, you would forfeit the interest earned. (I have grandiose ideas for a TMW mini-economy and stock market based upon players trade, the Bank idea is only one of such ideas I have)

just my 2 cents,
although I can only imagine the question's that would arise! You would have the make the player read a contract agreement, and make them check a box that they understand the terms, lol

cheers,
Lost