Sign in to follow this  
Saicotic

Spirit Templar Limits

Recommended Posts

Is there a mod or maybe a setting I missed where I can set the maximum amount of spirit templars? I thought I had seen something like that but I guess due to old age I can not seem to remember where or exactly what I was read about it.

Share this post


Link to post
Share on other sites

You might have seen my mod (fix guards) that un-borks a database error that leads to infinitely spawning spirit templars/shadows. It doesn't affect the normal game limits, and i don't think there's a mod for that right now.

 

What do you want to limit and how?

Share this post


Link to post
Share on other sites

Ah sorry, what I mean is to set the maximum limit a settlement may hire. Right now with current settings. It is 20 templars and they really are not needed.

 

I would like to set it to a lower max limit for the whole server.

  • Like 3

Share this post


Link to post
Share on other sites

A solution to limit the templars would be very awesome. Each week i jump from deed to deed to look how much templars are hired on the new deeds. I have a limit in the rules (max 10) but as we all know, not all players are reading rules and thats why i find often deeds with 30,40 templars.

Its very hard than for my team to look for the mayors to reduce the templars.

 

Eject

Edited by Eject

Share this post


Link to post
Share on other sites

You can set max value in com/wurmonline/server/villages/GuardPlan.class  -  maxGuards = 1;

But only new deeds will not be able to set the number of guards more than max. Fix for old deeds:

		int maxguards = 1;
            	Village[] villages = Villages.getVillages();
            	for (int i = 0; i < villages.length; i++) {
            		int gnumber = villages[i].plan.getNumHiredGuards();
            		if (gnumber > maxguards) {
            			villages[i].plan.updateGuardPlan(villages[i].plan.type, villages[i].plan.moneyLeft, maxguards);
                  		Guard[] guards = villages[i].getGuards();
                  		if(guards.length > maxguards)
            				for (int i2 = 0; i2 < guards.length - maxguards; i2++) {
            					if (guards[i2].getCreature() != null)
            						guards[i2].getCreature().destroy();
            				}
            		}
            	}

 

  • Like 2

Share this post


Link to post
Share on other sites
On 2/3/2017 at 6:00 AM, Scadouge said:

You can set max value in com/wurmonline/server/villages/GuardPlan.class  -  maxGuards = 1;

But only new deeds will not be able to set the number of guards more than max. Fix for old deeds:


		int maxguards = 1;
            	Village[] villages = Villages.getVillages();
            	for (int i = 0; i < villages.length; i++) {
            		int gnumber = villages[i].plan.getNumHiredGuards();
            		if (gnumber > maxguards) {
            			villages[i].plan.updateGuardPlan(villages[i].plan.type, villages[i].plan.moneyLeft, maxguards);
                  		Guard[] guards = villages[i].getGuards();
                  		if(guards.length > maxguards)
            				for (int i2 = 0; i2 < guards.length - maxguards; i2++) {
            					if (guards[i2].getCreature() != null)
            						guards[i2].getCreature().destroy();
            				}
            		}
            	}

 

Where would I add this in the class file? I was able to easily change the number of guards for new deeds(tested fine) but the old deed fix I cannot get to compile.

 

Edit: Got it to compile, but, It still does not properly work in game to remove the templars. I am guessing I did not place it in the code correctly still

 

Edited by Governor

Share this post


Link to post
Share on other sites
15 hours ago, Eject said:

 

have you tested it with a new deed?

 

yes

The new limit works fine, it just  will not get rid of the excess templar's from existing deeds with more than the set amount

Edited by Governor

Share this post


Link to post
Share on other sites

In wurmzones.db / Guardplan are the spirit templars stored, maybe you can fix that manual

Edited by Eject

Share this post


Link to post
Share on other sites

I dont have any village file in the folder.. 

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
Sign in to follow this