Jump to content
  • 0

Shared Zeny between characters?


Peopleperson49

Question


  • Group:  Members
  • Topic Count:  218
  • Topics Per Day:  0.05
  • Content Count:  1180
  • Reputation:   141
  • Joined:  01/27/12
  • Last Seen:  

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

Link to comment
Share on other sites

10 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  30
  • Topics Per Day:  0.01
  • Content Count:  782
  • Reputation:   82
  • Joined:  01/01/12
  • Last Seen:  

What came to my mind is OnPCLogin, OnPCLogOut set Zeny to #Zeny and everytime when zeny changes, save into #Zeny.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  218
  • Topics Per Day:  0.05
  • Content Count:  1180
  • Reputation:   141
  • Joined:  01/27/12
  • Last Seen:  

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

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  30
  • Topics Per Day:  0.01
  • Content Count:  782
  • Reputation:   82
  • Joined:  01/01/12
  • Last Seen:  

Saving #Zeny every seconds sound unreliable too, maybe a source mod :P

Edit: Turn Zeny works like #CASHPOINTS variable in src.

Edited by darristan
Link to comment
Share on other sites


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

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;
}

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  30
  • Topics Per Day:  0.01
  • Content Count:  782
  • Reputation:   82
  • Joined:  01/01/12
  • Last Seen:  

Not sure what kind of exploit will came :P

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  218
  • Topics Per Day:  0.05
  • Content Count:  1180
  • Reputation:   141
  • Joined:  01/27/12
  • Last Seen:  

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
Link to comment
Share on other sites


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

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

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  218
  • Topics Per Day:  0.05
  • Content Count:  1180
  • Reputation:   141
  • Joined:  01/27/12
  • Last Seen:  

I have already used the above script to share zeny in the past, I just wanted a more reliable way to do it. Thanks for your input.

Peopleperson49

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  20
  • Topics Per Day:  0.00
  • Content Count:  243
  • Reputation:   206
  • Joined:  11/28/11
  • Last Seen:  

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

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  218
  • Topics Per Day:  0.05
  • Content Count:  1180
  • Reputation:   141
  • Joined:  01/27/12
  • Last Seen:  

Thanks Xantara I will give it a try.

Peopleperson49

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...