Jump to content
  • 0

Zeny in separate table


Radian

Question


  • Group:  Members
  • Topic Count:  162
  • Topics Per Day:  0.05
  • Content Count:  1546
  • Reputation:   192
  • Joined:  07/23/14
  • Last Seen:  

Can i request a banking script that will be save in a separate table

Account ID | Account Type | Current Zeny | Total Withdrawal Zeny

Player must open an account first before they can deposit/withdraw zeny.

Payment for registration will depend what account type they want.

Types of account : 

  1. Basic Account : Fee 1,000,000 (Player can only deposit up to 100m zeny per day and withdraw 10m per day.) this applies to their whole account.
  2. Premium Account : Fee 5,000,000 (Deposit up to 1b zeny per day and withdraw 100m per day) this applies to their whole account.
  3. Wicked Account : Fee 10,000,000 (Deposit up to 5b zeny per day and withdraw 1b per day) this applies to their whole account.

Player can only have 2b max zeny in their characters pocket. just like this images

Untitled.png.02ef2a0925573a77ae1447cc43f1118c.png

 

Link to comment
Share on other sites

10 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

that's the fun part why I did that
did you noticed 705,032,704 + Your current Zeny = MAX_ZENY ?

hmm ... maybe I should split it out and tell the players why the value shrink instead ? hmm ....

 

http://upaste.me/2c6e4982211843700
yeah not that hard

Edited by AnnieRuru
Link to comment
Share on other sites

  • 1

  • Group:  Members
  • Topic Count:  78
  • Topics Per Day:  0.03
  • Content Count:  431
  • Reputation:   164
  • Joined:  12/12/17
  • Last Seen:  

https://github.com/pajodex/ScriptCollections/blob/master/super_bank.txt

Try my version.

Spoiler

You can deposit up to 5B - meaning, its is not limited to 2.1B

 

Edited by pajodex
  • Like 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  162
  • Topics Per Day:  0.05
  • Content Count:  1546
  • Reputation:   192
  • Joined:  07/23/14
  • Last Seen:  

bump

Link to comment
Share on other sites

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2345
  • Joined:  10/28/11
  • Last Seen:  

you can try this.

https://pastebin.com/1KQSeydF

  • Love 2
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  162
  • Topics Per Day:  0.05
  • Content Count:  1546
  • Reputation:   192
  • Joined:  07/23/14
  • Last Seen:  

8 hours ago, Emistry said:

you can try this.

https://pastebin.com/1KQSeydF

Thank you for making this script. Emistry /thx

 

Edit: I noticed something when selecting the Premium account, the bank name shows Basic Account instead of Premium.

Untitled.png.c235053df0381bb3f537ea1a126b7771.png

Edited by Radian
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

okay, my turn too xD

http://upaste.me/5e274982184279fcd

Emistry script is total failure ...
yes the script engine has a limit of 2.1b, but SQL can calculate the value more than that
so its possible to make this script entirely with strings , and let the SQL do the calculation

pajodex ... not bad
a very obvious bug on a few lines with the SELECT syntax

line 84
if( query_sql("SELECT `daily_deposit` FROM `s_bank` WHERE `daily_deposit`<="+.@amount+" AND `account_id`="+getcharid(3))) {

line 110
if( query_sql("SELECT `daily_withdraw` FROM `s_bank` WHERE `daily_withdraw`<="+.@amount+" AND `account_id`="+getcharid(3))) {

line 114
if( query_sql("SELECT `zeny` FROM `s_bank` WHERE `zeny`<="+.@amount+" AND `account_id`="+getcharid(3))) {

which caused my test server to spam these error

[Warning]: script:query_sql: Too many columns, discarding last 1 columns.
[Debug]: Source (NPC): Super Banker at prontera (150,185)

ok explanation ...

.@nb = query_sql( "SELECT 5", .@value );

the .@nb is 1, .@value is 5
.@nb is equal to 1 is because it return 1 row of data
you have did the pvp ladder script which return number of rows of the highest pvp points ... you should know what this means

so the if ( query_sql("... means if the SQL does fetch the data successfully ...
usually meant to check if the player has the data inside the table or not

you can either add a .@dummy variable for it ... or change the line into

line 84
query_sql "SELECT `daily_deposit` < "+ .@amount +" FROM `s_bank` WHERE `account_id` = "+ getcharid(3), .@condition;
if ( .@condition == true ) {

 

 

and my script ... I let the script engine do all the calculations XD
there is no need to have a calculator in front of my computer to know 7,463,562 + X = 2,000,000,000
my script just let the *input script command calculate whats the best value to input in

		query_sql "select "+ .bank_with$[.@t] +" - "+ .@withdraw$, .@limit$;
		input .@num, 0, min( atoi( .@limit$ ), atoi( .@zeny$ ), MAX_ZENY - Zeny );

either the withdraw limit, the Zeny in the bank, or the maximum zeny you can hold ... the *input command do that automatically

Edited by AnnieRuru
  • Love 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  162
  • Topics Per Day:  0.05
  • Content Count:  1546
  • Reputation:   192
  • Joined:  07/23/14
  • Last Seen:  

@AnnieRuru I've tested the script and when depositing an amount of 874,097,555 and it shows 705,032,704 zeny

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  162
  • Topics Per Day:  0.05
  • Content Count:  1546
  • Reputation:   192
  • Joined:  07/23/14
  • Last Seen:  

Can I request one more thing about this script?

Like for example a player that have a Basic account can upgrade into Premium or Wicked account.

Basic Account -> Premium Account or Wicked Account
Premium Account -> Wicked Account

fee can be optional pay using the zeny you have inside your account or pay from your characters zeny.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  162
  • Topics Per Day:  0.05
  • Content Count:  1546
  • Reputation:   192
  • Joined:  07/23/14
  • Last Seen:  

On 5/22/2018 at 3:45 PM, AnnieRuru said:

I dont know how to explain this one but every other day when the limit is reset i can deposit any amount without limitation.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...