From 9f5bdce57191a39ee104d6cdbec59d1e8c87b6e4 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Wed, 14 Feb 2024 19:36:28 -0600 Subject: [PATCH] new NPC for ToL support --- .../handlers/ActivateNPCMsgHandler.java | 33 +++++++++++++++---- 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/src/engine/net/client/handlers/ActivateNPCMsgHandler.java b/src/engine/net/client/handlers/ActivateNPCMsgHandler.java index 3759b052..05f6a9c5 100644 --- a/src/engine/net/client/handlers/ActivateNPCMsgHandler.java +++ b/src/engine/net/client/handlers/ActivateNPCMsgHandler.java @@ -100,10 +100,10 @@ public class ActivateNPCMsgHandler extends AbstractClientMsgHandler { if (contractItem == null) return false; - if(msg.getContractItem() == 850){//runemaster - for(AbstractCharacter abs : building.getHirelings().keySet()) { - NPC npc = (NPC)abs; - if(npc.contract.getContractID() == 850) + if (msg.getContractItem() == 850) {//runemaster + for (AbstractCharacter abs : building.getHirelings().keySet()) { + NPC npc = (NPC) abs; + if (npc.contract.getContractID() == 850) return false; //can only have 1 runemaster } } @@ -127,8 +127,29 @@ public class ActivateNPCMsgHandler extends AbstractClientMsgHandler { // Check if contract can be slotted in this building - if (contract.canSlotinBuilding(building) == false) - return false; + if (contract.canSlotinBuilding(building) == false) { + boolean override = false; + if (building.getBlueprint().getBuildingGroup().equals(Enum.BuildingGroup.TOL)) { + if (contract.getContractID() == 899)//alchemist + override = true; + + if (contract.getContractID() == 866)//banker + override = true; + + if (contract.getContractID() == 865)//siege engineer + override = true; + } + if (building.getBlueprint().getBuildingGroup().equals(Enum.BuildingGroup.SIEGETENT)) { + if (contract.getContractID() == 865)//siege engineer + override = true; + } + if(building.getBlueprint().getBuildingGroup().equals(Enum.BuildingGroup.SIEGETENT)){ + if(contract.getContractID() == 865)//siege engineer + override = true; + } + if(override == false) + return false; + } if (!BuildingManager.addHireling(building, player, zone, contract, contractItem)) return false;