tophattingson

The "Trader max money in silver" setting does not work

Recommended Posts

I've spent way too long investigating this issue myself, and have decided it's likely a straight up bug.

 

Trader set to max money 1s and initial money 1s. The initial money part works. The max money part does not. As soon as traders replenish, they end up with 50s + whatever they had remaining from the starting 1s. Additionally, this money appears out of nowhere instead of coming from the King's Coffers (although I've not investigated whether this is the intended functionality in WU anyway).

 

I've tested this both with summoned "Salesmen" and Traders created from contract. Same happens for both. I've tested selling them items, buying items from them and doing nothing at all with them, and it still happens. I've not tested what happens if you set the max to any other number. Traders placement is set to be disabled in the feature manager.

Share this post


Link to post
Share on other sites
                if (myshop.getOwnerId() == -10L) {
                    final Shop kingsMoney = Economy.getEconomy().getKingsShop();
                    if (kingsMoney.getMoney() > 0L) {
                        int value = 0;
                        value = (int)(kingsMoney.getMoney() / Shop.getNumTraders());
                        if (!Servers.localServer.HOMESERVER) {
                            value *= (int)(1.0f + Zones.getPercentLandForKingdom(this.getKingdomId()) / 100.0f);
                            value *= (int)(1.0f + Items.getBattleCampControl(this.getKingdomId()) / 10.0f);
                        }
                        if (value > 0 && myshop != null && myshop.getMoney() < Servers.localServer.getTraderMaxIrons() && (myshop.getSellRatio() > 0.1f || Server.getInstance().isPS()) && (Server.getInstance().isPS() || Servers.localServer.id != 15 || kingsMoney.getMoney() > 2000000L)) {
                            myshop.setMoney(myshop.getMoney() + value);
                            kingsMoney.setMoney(kingsMoney.getMoney() - value);
                        }
                    }
                }

 

This is the relevant part of the code.

 

First of all is that max setting does not affect how much money a trader can get in one go, but rather it sets the limit that will stop traders getting money if they go above it. I don't know if that's intended or a bug.

 

9 hours ago, tophattingson said:

Additionally, this money appears out of nowhere instead of coming from the King's Coffers

 

This doesn't seem to be the case looking at the code, unless there is something elsewhere that prevents kingsMoney.setMoney(...) from working

----

Added: There is a "Money pool in silver" setting - if it's non-zero the kingdom coffers will be reset to that value on each restart. Maybe you're seeing that?

Edited by bdew

Share this post


Link to post
Share on other sites

The max setting being designed to only stop the trader receiving money when it's already exceeded the limit is definitely going to be a big problem. If the kingdom coffers system works I could use that as the means of limiting trader replenishment...

 

Additionally, if I understood the code here correctly, the amount replenished will be divided by the number of traders that exist on the server? Maybe? It's a bit odd but I can't identify how in this code the amount replenished (value) comes out to 50s, unless it's counting the king's coffers themselves as a trader, so kingsmoney 100s / (1 trader + 1 king) = 50s.

 

&& (Server.getInstance().isPS() || Servers.localServer.id != 15 || 

Can you describe what these variables refer to?

 

Quote

Added: There is a "Money pool in silver" setting - if it's non-zero the kingdom coffers will be reset to that value on each restart. Maybe you're seeing that?

 

 

We saw the kingdom coffers remain at 100s even when the trader was just given 50s. Then when I deleted that trader, it obviously went up to 150s in total.

 

I'll reset it back to 100s later and keep an eye on our current trader to test this behaviour further, and get back to you with more comprehensive results on that.

Edited by tophattingson

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now