Jump to content
  • 0
guihleao

Cashpoints in Multiple Servers

Question

Hello everyone, I need help setting the Cash Points for multiple servers. I have 3 map and char servers that use 1 login-server. How can I make all of these 3 map-servers read the same #CASHPOINTS variable?

 

Thanks in advance! 

Edited by guihleao

Share this post


Link to post
Share on other sites

10 answers to this question

Recommended Posts

  • 0

Okay, but that's in a script. I meant by the whole cash system. I believe I have to change the pc.c file, so that the Cash Shop and the command @cash read the new ## variable. I'm not sure if I should change only this file...

 

For example,

 

In pc.c

 

// Cash shop	sd->cashPoints = pc_readaccountreg(sd,script->add_str("#CASHPOINTS"));	sd->kafraPoints = pc_readaccountreg(sd,script->add_str("#KAFRAPOINTS"));

I think I should change to:

 

// Cash shop	sd->cashPoints = pc_readaccountreg(sd,script->add_str("##CASHPOINTS"));	sd->kafraPoints = pc_readaccountreg(sd,script->add_str("##KAFRAPOINTS"));

But I also think I need to change the " pc_readaccountreg" to read the global account, also there are some other modifications in this file I'd need to do.

 

Am I right or just tripping? 

 

Thanks!

Edited by guihleao

Share this post


Link to post
Share on other sites
  • 0
"##"     - A permanent global account variable stored by the login server.            The only difference you will note from normal # variables is            when you have multiple char-servers connected to the same            login-server. The # variables are unique to each char-server,            while the ## variables are shared by all these char-servers. 

Share this post


Link to post
Share on other sites
  • 0

Oh thanks! But how can I apply it to the cash system? For example, when I use the @cash command, or when I sell items through the Cash Shop... Does it need a source modification or do we have a setting somewhere?

Edited by guihleao

Share this post


Link to post
Share on other sites
  • 0
/* custom npc trader */prontera,153,152,1	trader	TestCustom2	4_F_EDEN_OFFICER,{	OnInit:	tradertype(NST_CUSTOM);	sellitem Red_Potion,2;	end;/* allows currency to be ##CASHPOINTS */OnCountFunds:	setcurrency( ##CASHPOINTS );	end;/* receives @price (total cost) */OnPayFunds:	if( ##CASHPOINTS < @points )		end;	##CASHPOINTS -= @points;	purchaseok();	end;}

https://github.com/HerculesWS/Hercules/blob/master/doc/sample/npc_trader_sample.txt

Share this post


Link to post
Share on other sites
  • 0

pc_readaccountreg2

Although it's for sake of readability

Borh function calls the same thing and shouldn't matter..

Share this post


Link to post
Share on other sites
  • 0

pc_readaccountreg2

Although it's for sake of readability

Borh function calls the same thing and shouldn't matter..

 

So I can just change it to ##CASHPOINTS ?

Share this post


Link to post
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.   Restore formatting

  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.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.