Jump to content
  • 0

Shared Zeny between characters?


Question

Posted

Is it possible to make all zeny to be shared between all characters of an account? I understand that zeny is a permanent character variable, but would a source mod be enough to make it shared without changing everything else that uses zeny?

Peopleperson49

10 answers to this question

Recommended Posts

Posted

I have already thought of that and actually done that in the past, but for some reason every once in a while when a character would exit the game using Alt+F4 it would not update the zeny properly. It was just too unreliable. Thanks for the reply.

Peopleperson49

Posted

I have already thought of that and actually done that in the past, but for some reason every once in a while when a character would exit the game using Alt+F4 it would not update the zeny properly. It was just too unreliable. Thanks for the reply.

Peopleperson49

actually...the OnPCLogoutEvent will still trigger when a player logout using ALT+F4....

You can test it by running this script...and view your map-server console after your character logout...

- script Sample -1,{
OnPCLogoutEvent:
debugmes "Zeny Saved : "+Zeny;
end;
}

Posted (edited)

I found Alt+F4 to work 99.99% of the time. Also if for the some reason the server crashes suddenly you lose it. It would add insult to injury to have the server crash, people lose any recent progress, and all their zeny is gone... I tried to get around it before by making it not modify the zeny or #zeny if the amount was 0. So if the server did crash it would maintain there current amount. For example the character haz 1,000z and the server crashes it would not save the #zeny and not set zeny to 0. The #zeny amount it will be 0 and when you log back in it won't meet the >0 requirement keeping the same amount. I hope that made sense, let me know what you think.

OnPCLoginEvent:
set zeny,zeny+#zeny; set #zeny,0;

OnPCLogoutEvent:
set #zeny,#zeny+zeny; set zeny,0;

Peopleperson49

Edit: The other problem I had with it was that the control panel would always show that the character had 0 zeny unless they were logged in. I'm not sure how this ended up in source requests, it was spost to be in source support.

Edited by peopleperson49
Posted

1 way I can think of is

OnPCLogoutEvent:

query_sql "update `char` set zeny = "+ zeny +" where account_id = "+ getcharid(3);

which would save their zeny after they logout

but just like you say something about server crash and possible exploits

/ Min database save intervals (in ms)

// Prevent saving characters faster than at this rate (prevents char-server

// save-load getting too high as character-count increases)

minsave_time: 100

// Apart from the autosave_time, players will also get saved when involved

// in the following (add as needed):

// 1: after every successful trade

// 2: after every vending transaction

// 4: after closing storage/guild storage.

// 8: After hatching/returning to egg a pet.

// 16: After successfully sending a mail with attachment

// 32: After successfully submitting an item for auction

// 64: After successfully get/delete/complete a quest

// NOTE: These settings decrease the chance of dupes/lost items when there's a

// server crash at the expense of increasing the map/char server lag. If your

// server rarely crashes, but experiences interserver lag, you may want to set

// these off.

save_settings: 127

good luck in finding these in source

and use Sql_Query .... its the command used in the source instead query_sql used by eathena script

its too hassle to do this

I don't find this modification has any practical uses

Posted

This is not my mod (I believe it is icescope's since there is a tag in some of the modified areas). Anyways, I prolly found this a long time ago somewhere and saved it (I don't remember). As shown on the diff, it was made for r14109 so it might be outdated. I believe it worked though when I tried it when I first got it.

account_zenychange.diff

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...