bank.txt 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. //===== rAthena Script =======================================
  2. //= Banker Script
  3. //===== By: ==================================================
  4. //= Syrus22 (1.0)
  5. //===== Current Version: =====================================
  6. //= 2.0
  7. //===== Compatible With: =====================================
  8. //= rAthena Project
  9. //===== Description: =========================================
  10. //= An account wide Banker to store Zeny
  11. //===== Additional Comments: =================================
  12. //= Syrus22 - There's an optional transaction fee at the top of
  13. //= the script. To use it simply change the first set command
  14. //= to set the cost variable to whatever you want the fee to be.
  15. //= Version 2.0: Optimized and brought the script up to standard. [Jguy]
  16. //============================================================
  17. prontera,132,217,5 script Banker 109,{
  18. set @cost,500;
  19. mes "[Banker]";
  20. mes "Welcome to the First Bank of Prontera. How can I help you today?";
  21. next;
  22. switch(select("I'd like to make a deposit.:I'd like to make a withdrawl.:What's my current balance?:Cancel")) {
  23. case 1:
  24. mes "[Banker]";
  25. mes "Very well... How much would you like to deposit? The maximum you can deposit at once is 999,999 Zeny.";
  26. next;
  27. if (@cost > 0) {
  28. mes "[Banker]";
  29. mes "Oh, and do realize there is a " +@cost + " Zeny charge on all transactions!";
  30. next;
  31. }
  32. input @deposit;
  33. if (@deposit < 1) {
  34. mes "Make sure you ask me to deposit a real amount.";
  35. close;
  36. }
  37. else if (@deposit > Zeny) {
  38. mes "It does not appear like you have the amount of zeny you're trying to deposit!";
  39. close;
  40. }
  41. else if (@deposit > (Zeny - @cost)) {
  42. mes "You need " + @cost + " Zeny to cover the transaction fee!";
  43. close;
  44. }
  45. else {
  46. set Zeny,Zeny - @deposit;
  47. set Zeny,Zeny - @cost;
  48. set #bankstorage,#bankstorage + @deposit;
  49. mes "[Banker]";
  50. mes "Thank you very much... Your zeny is in good hands.";
  51. close;
  52. }
  53. case 2:
  54. mes "[Banker]";
  55. mes "Very well... How much would you like to withdraw? The maximum you can withdraw at one time is 999,999 Zeny";
  56. next;
  57. if (@cost > 0) {
  58. mes "[Banker]";
  59. mes "Oh, and do realize there is a " +@cost + " Zeny charge on all transactions!";
  60. next;
  61. }
  62. input @withdrawl;
  63. if (@withdrawl < 1) {
  64. mes "Please don't play games. I need a real amount to withdraw.";
  65. close;
  66. }
  67. else if (@withdrawl > #bankstorage) {
  68. mes "You only have ^00FF00" + callfunc("F_InsertComma",#bankstorage) +"^000000 zeny in your account!";
  69. close;
  70. }
  71. else if ((@cost > Zeny) && ((Zeny + @withdrawl) > @cost)) {
  72. mes "[Banker]";
  73. mes "You don't have the Zeny for the transaction fee right now. Would you like me to take the fee directly from your withdrawl?";
  74. next;
  75. switch(select("Yes please.:No, Thanks")){
  76. case 1:
  77. mes "[Banker]";
  78. mes "Removing " + @cost + " from your withdrawl to cover the deposit fee...";
  79. set @withdrawl,@withdrawl - @cost;
  80. set #bankstorage,#bankstorage - @cost;
  81. set @cost,0;
  82. next;
  83. set Zeny,Zeny - @cost;
  84. set Zeny,Zeny + @withdrawl;
  85. set #bankstorage,#bankstorage - @withdrawl;
  86. mes "[Banker]";
  87. mes "There's your Zeny. Have a good day.";
  88. close;
  89. case 2:
  90. mes "[Banker]";
  91. mes "Very well... come again soon.";
  92. close;
  93. }
  94. }
  95. else {
  96. set Zeny,Zeny - @cost;
  97. set Zeny,Zeny + @withdrawl;
  98. set #bankstorage,#bankstorage - @withdrawl;
  99. mes "[Banker]";
  100. mes "There's your Zeny. Have a good day.";
  101. close;
  102. }
  103. case 3:
  104. mes "[Banker]";
  105. mes "Hmmmm... let me check some paper work.";
  106. next;
  107. mes "*Rustle, Rustle*";
  108. next;
  109. mes "[Banker]";
  110. mes "You currently have " + callfunc("F_InsertComma",#bankstorage) + " Zeny in your account.";
  111. close;
  112. case 4:
  113. mes "[Banker]";
  114. mes "Very well... come again soon.";
  115. close;
  116. }
  117. }