Capuche

Cmd_Banker

May 8th, 2013
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.48 KB | None | 0 0
  1. //===== rAthena Script =======================================
  2. //= Cmd Banker
  3. //===== By: ==================================================
  4. //= Capuche
  5. //===== Current Version: =====================================
  6. //= 1.0
  7. //===== Compatible With: =====================================
  8. //= rAthena SVN
  9. //===== Description: =========================================
  10. //= Works like a banker.
  11. //- @bn : display the amount of zeny in bank in a message
  12. //- @withdrawlbn <value> : withdrawl an amount of zeny
  13. //- @depositbn <value> : deposit an amount of zeny
  14. //============================================================
  15.  
  16. - script atcmd_bank -1,{
  17. OnInit:
  18. bindatcmd("bn","atcmd_bank::Onbn");
  19. bindatcmd("withdrawlbn","atcmd_bank::Ontradebn");
  20. bindatcmd("depositbn","atcmd_bank::Ondeposit");
  21. end;
  22.  
  23. Onbn:
  24. message strcharinfo(0),"You currently have " + #bankstorage + " Zeny in your account.";
  25. end;
  26.  
  27. Ontradebn:
  28. if( atoi(.@atcmd_parameters$[0]) < 1 )
  29. message strcharinfo(0),"Please don't play games. I need a real amount to withdraw.";
  30. else if( atoi(.@atcmd_parameters$[0]) > #bankstorage )
  31. message strcharinfo(0),"I show you only have ^00FF00" + #bankstorage +"^000000 zeny in your account!";
  32. else {
  33. set Zeny,Zeny + atoi(.@atcmd_parameters$[0]);
  34. set #bankstorage,#bankstorage - atoi(.@atcmd_parameters$[0]);
  35. message strcharinfo(0),"There's your Zeny. Have a good day.";
  36. message strcharinfo(0), "############## Withdrawl: " +.@atcmd_parameters$[0]+ " Zeny ##############";
  37. message strcharinfo(0), "####### You have now " +#bankstorage+ " Zeny in Bank #######"; }
  38. end;
  39.  
  40. Ondeposit:
  41. if( atoi(.@atcmd_parameters$[0]) < 1 )
  42. message strcharinfo(0),"Make sure you ask me to deposit a real amount.";
  43. else if( atoi(.@atcmd_parameters$[0]) > Zeny )
  44. message strcharinfo(0),"It does not appear like you have the amount of zeny you're trying to deposit!";
  45. else if( atoi(.@atcmd_parameters$[0]) + #bankstorage > 2000000000 ) {
  46. message strcharinfo(0),"Sorry, Bank Storage is full.";
  47. message strcharinfo(0), "####### You have " +#bankstorage+ " Zeny in Bank #######"; }
  48. else {
  49. set Zeny,Zeny - atoi(.@atcmd_parameters$[0]);
  50. set #bankstorage,#bankstorage + atoi(.@atcmd_parameters$[0]);
  51. message strcharinfo(0),"Thank you very much... Your zeny is in good hands.";
  52. message strcharinfo(0), "############## Deposit: " +.@atcmd_parameters$[0]+ " Zeny ##############";
  53. message strcharinfo(0), "####### You have now " +#bankstorage+ " Zeny in Bank #######"; }
  54. end;
  55. }
Add Comment
Please, Sign In to add comment