Cashpoints in Multiple Servers

guihleao

New member
Messages
15
Points
0
Github
guihleao
Emulator
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! 

 
Last edited by a moderator:
Code:
"##"     - 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. 
 
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?

 
Last edited by a moderator:
/* 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

 
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!

 
Last edited by a moderator:
pc_readaccountreg2

Although it's for sake of readability

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

 
Back
Top