From caf3bc747093bb087fbced02550c3984a583a44e Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Mon, 30 Dec 2024 17:49:19 -0600 Subject: [PATCH] remove option for 10 and 20 man banes based on trees in nation --- src/engine/objects/Contract.java | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/engine/objects/Contract.java b/src/engine/objects/Contract.java index 5d8e39fd..a4529ce7 100644 --- a/src/engine/objects/Contract.java +++ b/src/engine/objects/Contract.java @@ -203,6 +203,8 @@ public class Contract extends AbstractGameObject { int updateBaneTime = 0; int updateBaneDay = 0; int updateBaneCap = 0; + + int treesInNation = 0; if(building != null) { City city = ZoneManager.getCityAtLocation(npc.loc); @@ -214,6 +216,11 @@ public class Contract extends AbstractGameObject { if(!GuildStatusController.isInnerCouncil(pc.getGuildStatus()) && !GuildStatusController.isGuildLeader(pc.getGuildStatus())){ return vd; } + for(Guild sub : city.getGuild().getNation().getSubGuildList()){ + if(sub.getOwnedCity() != null){ + treesInNation += 1; + } + } } } if(bane == null){ @@ -223,6 +230,7 @@ public class Contract extends AbstractGameObject { vd.getOptions().clear(); return vd; } + DateTime placement = bane.getPlacementDate(); switch(optionId){ default: @@ -277,11 +285,15 @@ public class Contract extends AbstractGameObject { vd.getOptions().add(timeOption5); break; case 798: // set bane cap - MenuOption capOption1 = new MenuOption(7981, "10 Maximum Players", 7981); - vd.getOptions().add(capOption1); + if(treesInNation < 6) { + MenuOption capOption1 = new MenuOption(7981, "10 Maximum Players", 7981); + vd.getOptions().add(capOption1); + } - MenuOption capOption2 = new MenuOption(7982, "20 Maximum Players", 7982); - vd.getOptions().add(capOption2); + if(treesInNation < 11) { + MenuOption capOption2 = new MenuOption(7982, "20 Maximum Players", 7982); + vd.getOptions().add(capOption2); + } MenuOption capOption3 = new MenuOption(7983, "30 Maximum Players", 7983); vd.getOptions().add(capOption3);