kafra_bank.txt 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. //===== eAthena Script =======================================
  2. //= 2nd Bank of Prontera ( with daily 0.01% income! )
  3. //===== By: ==================================================
  4. //= Lupus (1.0)
  5. //===== Current Version: =====================================
  6. //= 1.0
  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. prontera.gat,131,190,1 script Bank Clerk 112,{
  18. cutin "kafra_06",2;
  19. mes"[Manya]";
  20. mes strcharinfo(0)+", welcome to the 2nd Bank of Prontera!";
  21. set @kb_int,(gettime(6)*31)+gettime(5); //today's number
  22. set @income,0;
  23. //calculate %
  24. if (#kafrabank<=0 || #kb_int>=@kb_int) goto L_NoIncomeToday;
  25. set @income,(#kafrabank/1000)*(@kb_int-#kb_int); //@income == % of the summ
  26. L_NoIncomeToday:
  27. set #kb_int,@kb_int; //reset days timer
  28. if(#kafrabank==0) mes "We could open you an account.";
  29. if(@income>0) mes "Today's income ^135445" + @income + "^000000 zeny.";
  30. set #kafrabank,#kafrabank+@income;
  31. if(#kafrabank>0) mes "Your account: ^135445" + #kafrabank + "^000000 zeny.";
  32. mes "What would you like?";
  33. next;
  34. if(#kafrabank==0) menu "-Open a bank account",-,"-Quit",B_EXIT2;
  35. if(#kafrabank>0) menu "-Deposit money",-,"-Withdraw money",M_WITHDRAW,"-Quit",B_EXIT2;
  36. mes"[Manya]";
  37. mes "Please, tell me how much zeny you would like to deposit.";
  38. next;
  39. input @kafrabank;
  40. if(@kafrabank<1000) goto L_LESS_1000;
  41. if(@kafrabank>1000000) goto L_TOO_BIG_AMOUNT;
  42. if(@kafrabank>zeny) goto L_NOT_ENOUGH;
  43. set zeny,zeny-@kafrabank;
  44. set #kafrabank,#kafrabank+@kafrabank;
  45. mes"[Manya]";
  46. mes "You've made a deposit of ^135445" + @kafrabank + "z^000000.";
  47. goto B_EXIT;
  48. M_WITHDRAW:
  49. if(#kafrabank==0) goto L_ZERO_ACCOUNT;
  50. mes"[Manya]";
  51. mes "Your account: ^135445" + #kafrabank + "^000000 zeny.";
  52. mes "How much zeny would you like to withdraw?";
  53. next;
  54. input @kafrabank;
  55. if(@kafrabank<1) goto B_EXIT2;
  56. if(@kafrabank>1000000) goto L_TOO_BIG_AMOUNT;
  57. if(@kafrabank>#kafrabank) goto L_NOT_ENOUGH;
  58. set #kafrabank,#kafrabank-@kafrabank;
  59. set zeny,zeny+@kafrabank;
  60. mes"[Manya]";
  61. mes "Here is your ^135445" + @kafrabank + "z^000000, put your sign here...";
  62. goto B_EXIT;
  63. L_NOT_ENOUGH:
  64. mes"[Manya]";
  65. mes "You don't have enough zeny for this operation.";
  66. next;
  67. goto B_EXIT2;
  68. L_ZERO_ACCOUNT:
  69. mes"[Manya]";
  70. mes "You don't have any zeny on your account!";
  71. next;
  72. goto B_EXIT2;
  73. L_TOO_BIG_AMOUNT:
  74. mes"[Manya]";
  75. mes "Sorry. The maximum deposit you can make on a time is 1,000,000 zeny.";
  76. next;
  77. goto B_EXIT2;
  78. L_LESS_1000:
  79. mes"[Manya]";
  80. mes "We're sorry, the minimum amount of zeny you can deposit is 1,000 zeny.";
  81. next;
  82. goto B_EXIT2;
  83. B_EXIT:
  84. mes "Very well... Come again soon!";
  85. next;
  86. B_EXIT2:
  87. mes"[Manya]";
  88. mes "Thank you for using our Bank Service. We hope to see you again soon.";
  89. cutin "kafra_06",255;
  90. close;
  91. }