// ===== eAthena Script =======================================
// = The 3rd Bank of Prontera
// ===== By: ==================================================
// = coder & Cruxiaer
// ===== Current Version: =====================================
// = 2.00
// ===== Compatible With: =====================================
// = eAthena 1.x
// ===== Description: =========================================
// = A bank which has a 1% interest hourly income by default
// = Counter will not reset before it reaches an hour by default
// ===== How to use: ==========================================
// Change @maxOnOff to turn maximum interest income on or off
// For example:
// set @maxOnOff, "0"; = maximum interest income control is off
// set @maxOnOff, "1"; = maximum interest income control is on
//
// Change @max to setup your Bank's maximum interest income at one time
// For example:
// set @max, "1000000"; = maximum interest income at one time is 1mil zeny
// set @max, "100000"; = maximum interest income at one time is 100k zeny
// Change @var3 to setup your Bank's interest %
// For example:
// set @var3, "1000"; = 0.1% of interest rate
// set @var3, "100"; = 1% of interest rate
// set @var3, "10"; = 10% of interest rate
//
// Change these variables and setup your Bank's interest on an hourly or daily basis & counter resets
// To change counter reset settings, change @var1 :
// set @var1, "0" = counter reset is not prevented
// set @var1, "3600" = prevent counter reset before it reaches 1 hour
// set @var1, "86400" = prevent counter reset before it reaches 1 day
// set @var1, "604800" = prevent counter reset before it reaches 1 week
//
// To change interest income rate, change @var2 :
// set @var2, "3600"; = interest hourly income
// set @var2, "86400"; = interest daily income
// set @var2, "604800"; = interest weekly income
//
// ===== Credits: =============================================
// Lupus for his 2nd Bank of Prontera, which my idea was based on
// ===== Changelog: ===========================================
// 1.01a - Removed unnecessary lines, added comments
// 1.02 -- Added logmes on 164 and 195
// 1.03 -- Replaced interest numbers with variables, removed more unnecessary lines
// 1.04 -- Added more variables for easier editting
// 1.04a - Had no income when @maxOnOff is set to 1, fixed
// 1.05 -- Optimised the script, removed unnecessary labels
// 1.05a - Fixed always open new account problem
// 2.00 -- Percent on percent interest instead of accumulative percentage
//
prontera,164,177,2 script 3rd B.o.P.::3rdbank 833,{
set @timeNow, gettimetick(2);
set @tick, (@timeNow - #3rdbank_last);
set @var1, "3600"; // prevent counter reset, value cannot be larger than @var2, 0-Disabled
set @var2, "3600"; // interest income rate
set @var3, "100"; // interest rate
set @maxOnOff, "0"; // 0-Off, 1-On
set @max, "100000"; // maximum interest income even if interest is accumulated
mes "[Maness]";
mes strcharinfo(0)+", welcome to the Third Bank of Prontera!";
if (#3rdbank_last==0) {
set @tick, 0;
next;
goto NO_ACCOUNT;
} else if (@tick < 60) {
mes "Your last visit was ^336688" + @tick + " seconds^000000 ago."; //will display time in seconds if last visit was less than a minute ago
next;
goto TASK;
} else if (@tick < 3600) {
mes "Your last visit was ^336688" + (@tick / 60) + " minutes^000000 ago."; //will display time in minutes if last visit was less than an hour ago
next;
goto TASK;
} else {
mes "Your last visit was ^336688" + (@tick / 3600) + " hours^000000 ago."; // will display time in hours if last visit is more than 60 minutes
next;
goto TASK;
}
next;
W_INTEREST:
if (@tick < @var1) { // prevent counter reset before seconds reaches @var1
set @int, 0;
goto WITHDRAW;
} else {
next;
}
set @rate, (@tick / @var2);
set @3rdbank, #3rdbank;
set @int, @3rdbank;
for( set .@i, 0; .@i < @rate; set .@i, .@i +1 ) {
set @3rdbank, @3rdbank + (@3rdbank/@var3);
}
set @int, @3rdbank - @int;
if (@maxOnOff>0) {
if (@int>@max) set @int,@max; //maximum interest income at one time, disabled by default
set #3rdbank, #3rdbank + @int;
set #3rdbank_last, gettimetick(2);
} else {
set #3rdbank, #3rdbank + @int;
set #3rdbank_last, gettimetick(2);
}
{
mes "[Maness]";
mes "^000000Interest received: ^336688" + @int;
if (@tick < 60) {
mes "^000000Your last visit was ^336688" + @tick + " seconds^000000 ago."; //will display time in seconds if last visit was less than a minute ago
} else if (@tick < 3600) {
mes "^000000Your last visit was ^336688" + (@tick / 60) + " minutes^000000 ago."; //will display time in minutes if last visit was less than an hour ago
} else {
mes "^000000Your last visit was ^336688" + (@tick / 3600) + " hours^000000 ago."; // will display time in hours if last visit is more than 60 minutes
}
mes "^000000Your account: ^336688" + #3rdbank;
set #3rdbank_last, gettimetick(2);
next;
goto WITHDRAW;
}
D_INTEREST:
if (@tick < @var1) { // prevent counter reset before seconds reaches @var1
set @int, 0;
goto DEPOSIT;
} else {
next;
}
set @rate, (@tick / @var2);
set @3rdbank, #3rdbank;
set @int, @3rdbank;
for( set .@i, 0; .@i < @rate; set .@i, .@i +1 ) {
set @3rdbank, @3rdbank + (@3rdbank/@var3);
}
set @int, @3rdbank - @int;
if (@maxOnOff>0) {
if (@int>@max) set @int,@max; //maximum interest income at one time, disabled by default
set #3rdbank, #3rdbank + @int;
set #3rdbank_last, gettimetick(2);
} else {
set #3rdbank, #3rdbank + @int;
set #3rdbank_last, gettimetick(2);
}
{
mes "[Maness]";
mes "^000000Interest received: ^336688" + @int;
if (@tick < 60) {
mes "^000000Your last visit was ^336688" + @tick + " seconds^000000 ago."; //will display time in seconds if last visit was less than a minute ago
} else if (@tick < 3600) {
mes "^000000Your last visit was ^336688" + (@tick / 60) + " minutes^000000 ago."; //will display time in minutes if last visit was less than an hour ago
} else {
mes "^000000Your last visit was ^336688" + (@tick / 3600) + " hours^000000 ago."; // will display time in hours if last visit is more than 60 minutes
}
mes "^000000Your account: ^336688" + #3rdbank;
set #3rdbank_last, gettimetick(2);
next;
goto DEPOSIT;
}
NO_ACCOUNT:
mes "[Maness]";
mes "We offer an interest rate of";
mes "^3366881% every hour.";
mes "^000000We could open you an account.";
next;
if(select("Open an account:Quit") == 1){
set #3rdbank_last, gettimetick(2);
goto TASK;
} else {
goto EXIT;
}
TASK:
mes "[Maness]";
mes "Your account: ^336688" + #3rdbank + "^000000 zeny.";
mes "What would you like to do?";
next;
menu "-Deposit money",D_INTEREST,"-Withdraw money",W_INTEREST,"-Quit",EXIT;
WITHDRAW:
mes "[Maness]";
mes "Please, tell me how much zeny you would like to withdraw.";
mes "Your account: ^336688" + #3rdbank + "^000000 zeny.";
next;
switch(input(@input, 0, #3rdbank)){
if (@input<1) {
goto CANCEL;
} else if (@input>#3rdbank) {
set @input, #3rdbank;
set Zeny, Zeny+@input;
set #3rdbank,#3rdbank - @input;
mes"[Maness]";
mes "You've made a deposit of ^336688" + @input + "z^000000.";
mes "Thank you for using our services.";
// log interest income, withdrawn zeny and final acocunt
logmes "3rdbank Interest: " + @int +"z, Withdrawn: "+ @input +"z, Final: "+ #3rdbank +"z";
close;
goto EXIT;
} else {
set Zeny, Zeny+@input;
set #3rdbank,#3rdbank - @input;
mes"[Maness]";
mes "You have withdrawn ^336688" + @input + "z^000000.";
mes "Thank you for using our services.";
// log interest income, withdrawn zeny and final acocunt
logmes "3rdbank Interest: " + @int +"z, Withdrawn: "+ @input +"z, Final: "+ #3rdbank +"z";
close;
goto EXIT;
}
}
DEPOSIT:
mes "[Maness]";
mes "Please, tell me how much zeny you would like to deposit.";
mes "Maximum ^33668810,000,000 ^000000zeny per transaction only.";
next;
switch(input(@input, 0, 1000000000)){
if (@input<1) {
goto CANCEL;
} else if (@input>zeny) {
set @input, Zeny;
set Zeny, Zeny-@input;
set #3rdbank,#3rdbank + @input;
mes"[Maness]";
mes "You've made a deposit of ^336688" + @input + "z^000000.";
mes "Thank you for using our services.";
// log interest income, deposited zeny and final acocunt
logmes "3rdbank Interest: " + @int +"z, Deposited: "+ @input +"z, Final: "+ #3rdbank +"z";
close;
goto EXIT;
} else {
set Zeny, Zeny-@input;
set #3rdbank,#3rdbank + @input;
mes"[Maness]";
mes "You've made a deposit of ^336688" + @input + "z^000000.";
mes "Thank you for using our services.";
// log interest income, deposited zeny and final acocunt
logmes "3rdbank Interest: " + @int +"z, Deposited: "+ @input +"z, Final: "+ #3rdbank +"z";
close;
goto EXIT;
}
}
CANCEL:
mes "[Maness]";
mes "Thank you for using our services.";
close;
EXIT:
close;
}
geffen,125,73,3 duplicate(3rdbank) Banker#2-1 833
izlude,145,107,1 duplicate(3rdbank) Banker#3-1 833
morocc,147,84,7 duplicate(3rdbank) Banker#4-1 833
Edited by Emistry Please use [CODEBOX] or Attachments for long contents.
Question
MukkiesftKies
I think the bank should set the password that can not be opened by other people.
Such as requiring a password set by the owner bank account when want to open a bank.
Original script from eathena :
http://www.eathena.w...pic=263051&st=0
Edited by EmistryPlease use [CODEBOX] or Attachments for long contents.
Link to comment
Share on other sites
1 answer to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.