bank_kafra.txt 4.0 KB

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