SphereCommunity
[ITEM/FUNCTION] Account Gold Bank - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: Script Submissions (/Forum-Script-Submissions)
+--- Thread: [ITEM/FUNCTION] Account Gold Bank (/Thread-ITEM-FUNCTION-Account-Gold-Bank)

Pages: 1 2


[ITEM/FUNCTION] Account Gold Bank - pointhz - 09-04-2015 02:32 AM

Hello everyone,

This script is about an Account Gold Bank and its primary goal is allowing players to transfer gold between their account characters without having to log off.

Adding a "i_account_gold_bank" will spawn the chest seen in the picture below. Double-clicking in it will display the Account Gold Bank Menu.

This is not scripted as an item for any special reason besides me not wanting players to access it everywhere in the world. You are free to force the menu to be opened through the function "accountgoldbank" by adding it to an NPC or just through a command. It's up to you, it should work exactly the same.

[Image: image.jpg]

So, as you can see in the above picture, the menu has a few options and information.

It tells you the total amount of gold you have in your account (in ALL your characters) and to which character belongs the Gold Bank you are currently checking.

Besides the total amount of gold you have in your account, it also shows you, inside the Chest picture, the amount of gold the character you are checking has.

As for the above picture, I have 41.986 total gold pieces spread in all my account characters, the current bank I'm checking is from the character "Char Two" and that character has 21.986 gold pieces.

Typing the amount of gold you want to "Transfer to" or "Transfer From" in the white box inside the Chest picture and then clicking in the respective blue button will either transfer gold from the character you are currently playing with to the character you've selected or the other way around.

Additionally to the explained above, if instead of clicking in one of the blue buttons to "Transfer to" or "Transfer from" the amount of gold you typed, you click in the "New Cheque" button, you will be given a cheque of the gold amount you typed and the gold amount will be removed from the character you are currently checking.

For example, I'm with Char 1 and go to Char 2 "bank" and create a 500k cheque. Char 1 will be given the 500k worth cheque and the 500k gold will be removed from Char 2.

Clicking "Cash Cheque" and targetting the desired cheque will remove the cheque and add the gold to the character you are currently checking.

For example, I'm with Char 1 and go to Char 2 "bank" and cash a 500k cheque. Cheque will be removed from Char 1 and Char 2 will be given the 500k gold pieces.

You can cash cheques directly into the character you are currently logged in with too.

The cheque script is included too.

Gold will always be created at the character's bankbox, but it doesn't need to be in there in order to be removed (Because I'm using the GOLD function. This may also cause gold to be a mess at your bankbox).

Think I'm not forgetting anything. Any question just ask.


RE: [ITEM/FUNCTION] Account Gold Bank - Extreme - 09-04-2015 03:13 AM

Nice. I had made something similar, but to share items between chars on the same account.
It basically is a shared container which can be accessed by any char, just dclick on it.


RE: [ITEM/FUNCTION] Account Gold Bank - escribano - 09-06-2015 07:23 AM

I really dont understood why to create this...

If You want to "share" the gold between the chars of the account.. Why dont share the complete bank between the chars??

I've made it for my shard, the entire script have 22 lines (including the [EOF]) and it is one of the most easy scripts to be done i ever made....

You really need to make this check system?


RE: [ITEM/FUNCTION] Account Gold Bank - pointhz - 09-06-2015 03:28 PM

Share your script then, if you havent yet mate Tongue

Probably it is as easy as you say and I dont know about it.

Btw,I guess EOF isnt needed anymore.


RE: [ITEM/FUNCTION] Account Gold Bank - escribano - 09-08-2015 03:00 AM

For several reasons, i'll never share a private script from my shard... in other words: i am here to help people do their job, not to do it... i hate script copiers!

I can guide you trough the steps to make the script if you want, so if you want my help your script should be something like this:

1) An function that will be triggered on every login
2) In this function, store the actual BANK-UID (uid from layer 29) an "variable" outside the loop (section 3)
3) Make a loop through all characters on the account
4) Send each item in each bank box to the BANK-ID stored before the loop (you can save the item position in this way the bank will be organized)

Too easy no?

Note: I know about the [EOF], but as sphere have some issues with backward compatibility... i prefer still use Smile


RE: [ITEM/FUNCTION] Account Gold Bank - pointhz - 09-08-2015 03:22 AM

That's well thought and easy indeed, but what I was aiming to achieve in here was allowing a character to access another character bank to transfer gold to and from without having to logout/login several times, and not have all characters sharing the same bank account xD The container is too small imo to be used by several chars.


RE: [ITEM/FUNCTION] Account Gold Bank - escribano - 09-08-2015 03:35 AM

hummmm, why don't you tell before?? Big Grin

You can do an dialog, that could be opened after the client says "bank". This dialog will show all the characters of the account and let the player "open" any bank container using an button.

Your script shold be something like this:
Code:
[DIALOG d_bank_list]
...
...
...
FOR x 1 <eval <account.chars>>
BUTTON .... <local.x> // The button ID shoud be the account counter
DTEXT .....
ENDFOR

[DIALOG d_bank_list BUTTON]
ON=1 5 // From char 1 to 5
var.account = <argn> // This is the Button clicked
TRY UID.<account.char.<eval <var.account>>.uid>.findlayer.29.open
return 1


Smile

Note: you can change the bank size... also you can do some script to let the player "improve" its bank box, leting the player store more itens inside the bank.


RE: [ITEM/FUNCTION] Account Gold Bank - pointhz - 09-08-2015 03:46 AM

I had tried that already TRY UID.<account.char.<eval <var.account>>.uid>.findlayer.29.open but it doesn't work Sad It says "he has X stones in his bankbox" but the bank box doesnt show up.

I can always force all items from a character bank to be transferred temporarily to a container and then send them back when they are no longer in use. Guess ill go that path. Is there any trigger to check when a chest is closed?


RE: [ITEM/FUNCTION] Account Gold Bank - escribano - 09-08-2015 03:48 AM

Woops.. my fault! I forgot to tell: you have to change the container type to t_container before open and back to t_eq_bank_box after close.

Thats why i decided to share the entire bank box with all chars from the same account.. it's easier, faster and more elegant then create thousends of lines to create pretty dialogs!

i've done the same with the runebook Smile


RE: [ITEM/FUNCTION] Account Gold Bank - pointhz - 09-08-2015 04:37 AM

[FUNCTION test]
TRY UID.<SRC.ACCOUNT.CHAR.0.UID>.FINDLAYER.layer_bankbox.TYPE=t_container
TRY UID.<SRC.ACCOUNT.CHAR.0.UID>.FINDLAYER.layer_bankbox.open
TRY UID.<SRC.ACCOUNT.CHAR.0.UID>.FINDLAYER.layer_bankbox.type=t_eq_bank_box

Sorry for all the trouble, but shouldn't this work? If I use this in Char 0 it works, coz the bank belongs to that char, but on others chars it doesnt open