kafra_bank.txt 3.8 KB

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