kafra_bank.txt 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. //===== eAthena Script =======================================
  2. //= 2nd Bank of Prontera ( with daily 0.01% income! )
  3. //===== By: ==================================================
  4. //= Lupus (1.0)
  5. //===== Current Version: =====================================
  6. //= 1.1
  7. //===== Compatible With: =====================================
  8. //= eAthena 1.x
  9. //===== Description: =========================================
  10. //= A bank which has an interest %
  11. //===== Additional Comments: =================================
  12. // Look for this formula and setup your Bank daily % interest
  13. // #kafrabank/1000 = 0.1% of interest per day
  14. // #kafrabank/100 = 1% of interest per day
  15. // #kafrabank/10 = 10% of interest per day
  16. //
  17. // 1.1 Added log of bank operation -> logmes "some info";
  18. //============================================================
  19. prontera.gat,131,190,1 script Bank Clerk 833,{
  20. mes"[Maniss]";
  21. mes strcharinfo(0)+", welcome to the 2nd Bank of Prontera!";
  22. set @kb_int,(gettime(6)*31)+gettime(5); //today's number
  23. set @income,0;
  24. //calculate %
  25. if (#kafrabank<=0 || #kb_int>=@kb_int) goto L_NoIncomeToday;
  26. set @income,(#kafrabank/1000)*(@kb_int-#kb_int); //@income == % of the summ
  27. L_NoIncomeToday:
  28. set #kb_int,@kb_int; //reset days timer
  29. if(#kafrabank==0) mes "We could open you an account.";
  30. if(@income>0) mes "Today's income: ^135445" + @income + "^000000 zeny.";
  31. set #kafrabank,#kafrabank+@income;
  32. if(#kafrabank>0) mes "Your account: ^135445" + #kafrabank + "^000000 zeny.";
  33. mes "What would you like?";
  34. next;
  35. if(#kafrabank==0) menu "-Open a bank account",-,"-Quit",B_EXIT2;
  36. if(#kafrabank>0) menu "-Deposit money",-,"-Withdraw money",M_WITHDRAW,"-Quit",B_EXIT2;
  37. mes"[Maniss]";
  38. mes "Please, tell me how much zeny you would like to deposit.";
  39. next;
  40. input @kafrabank;
  41. if(@kafrabank<1000) goto L_LESS_1000;
  42. if(@kafrabank>10000000) goto L_TOO_BIG_AMOUNT;
  43. if(@kafrabank>zeny) goto L_NOT_ENOUGH;
  44. set zeny,zeny-@kafrabank;
  45. set #kafrabank,#kafrabank+@kafrabank;
  46. mes"[Maniss]";
  47. mes "You've made a deposit of ^135445" + @kafrabank + "z^000000.";
  48. //we log these zeny operations into the log db
  49. logmes "Bank %: " + @income +"z, Deposit: "+ @kafrabank +"z, Final: "+ #kafrabank +"z";
  50. goto B_EXIT;
  51. M_WITHDRAW:
  52. if(#kafrabank==0) goto L_ZERO_ACCOUNT;
  53. mes"[Maniss]";
  54. mes "Your account: ^135445" + #kafrabank + "^000000 zeny.";
  55. mes "How much zeny would you like to withdraw?";
  56. next;
  57. input @kafrabank;
  58. if(@kafrabank<1) goto B_EXIT2;
  59. if(@kafrabank>10000000) goto L_TOO_BIG_AMOUNT;
  60. if(@kafrabank>#kafrabank) goto L_NOT_ENOUGH;
  61. set #kafrabank,#kafrabank-@kafrabank;
  62. set zeny,zeny+@kafrabank;
  63. mes"[Maniss]";
  64. mes "Here is your ^135445" + @kafrabank + "z^000000, put your sign here...";
  65. //we log these zeny operations into the log db
  66. logmes "Bank %: " + @income +"z, Withdraw: "+ @kafrabank +"z, Final: "+ #kafrabank +"z";
  67. goto B_EXIT;
  68. L_NOT_ENOUGH:
  69. mes"[Maniss]";
  70. mes "You don't have enough zeny for this operation.";
  71. next;
  72. goto B_EXIT2;
  73. L_ZERO_ACCOUNT:
  74. mes"[Maniss]";
  75. mes "You don't have any zeny on your account!";
  76. next;
  77. goto B_EXIT2;
  78. L_TOO_BIG_AMOUNT:
  79. mes"[Maniss]";
  80. mes "Sorry. The maximum deposit you can make on a time is 10,000,000 zeny.";
  81. next;
  82. goto B_EXIT2;
  83. L_LESS_1000:
  84. mes"[Maniss]";
  85. mes "We're sorry, the minimum amount of zeny you can deposit is 1,000 zeny.";
  86. next;
  87. goto B_EXIT2;
  88. B_EXIT:
  89. mes "Very well... Come again soon!";
  90. next;
  91. B_EXIT2:
  92. mes"[Maniss]";
  93. mes "Thank you for using our Bank Service. We hope to see you again soon.";
  94. close;
  95. }
  96. geffen.gat,125,73,3 duplicate(bankg) Bank Clerk#2 833
  97. izlude.gat,145,107,1 duplicate(bankg) Bank Clerk#3 833
  98. morocc.gat,147,84,7 duplicate(bankg) Bank Clerk#4 833