|
|
@ -58,7 +58,7 @@ public enum BuildingManager { |
|
|
|
|
|
|
|
|
|
|
|
for (int i = 1; i <= numOfSlots; i++) { |
|
|
|
for (int i = 1; i <= numOfSlots; i++) { |
|
|
|
|
|
|
|
|
|
|
|
if (!building.getHirelings().containsValue(i)) |
|
|
|
if (!building.hirelings.containsValue(i)) |
|
|
|
return i; |
|
|
|
return i; |
|
|
|
} |
|
|
|
} |
|
|
|
return -1; |
|
|
|
return -1; |
|
|
@ -78,7 +78,7 @@ public enum BuildingManager { |
|
|
|
|
|
|
|
|
|
|
|
for (int i = numOfSlots; i > 0; i--) { |
|
|
|
for (int i = numOfSlots; i > 0; i--) { |
|
|
|
|
|
|
|
|
|
|
|
if (!building.getHirelings().containsValue(i)) |
|
|
|
if (!building.hirelings.containsValue(i)) |
|
|
|
return i; |
|
|
|
return i; |
|
|
|
} |
|
|
|
} |
|
|
|
return -1; |
|
|
|
return -1; |
|
|
@ -291,7 +291,7 @@ public enum BuildingManager { |
|
|
|
|
|
|
|
|
|
|
|
// Method transfers ownership of all hirelings in a building
|
|
|
|
// Method transfers ownership of all hirelings in a building
|
|
|
|
|
|
|
|
|
|
|
|
public static void refreshHirelings(Building building) { |
|
|
|
public static void updateHirelingGuilds(Building building) { |
|
|
|
|
|
|
|
|
|
|
|
if (building == null) |
|
|
|
if (building == null) |
|
|
|
return; |
|
|
|
return; |
|
|
@ -303,7 +303,7 @@ public enum BuildingManager { |
|
|
|
else |
|
|
|
else |
|
|
|
newGuild = building.getOwner().getGuild(); |
|
|
|
newGuild = building.getOwner().getGuild(); |
|
|
|
|
|
|
|
|
|
|
|
for (AbstractCharacter hireling : building.getHirelings().keySet()) { |
|
|
|
for (AbstractCharacter hireling : building.hirelings.keySet()) { |
|
|
|
hireling.setGuild(newGuild); |
|
|
|
hireling.setGuild(newGuild); |
|
|
|
WorldGrid.updateObject(hireling); |
|
|
|
WorldGrid.updateObject(hireling); |
|
|
|
} |
|
|
|
} |
|
|
@ -336,7 +336,7 @@ public enum BuildingManager { |
|
|
|
|
|
|
|
|
|
|
|
// Remove hireling from building
|
|
|
|
// Remove hireling from building
|
|
|
|
|
|
|
|
|
|
|
|
building.getHirelings().remove(hireling); |
|
|
|
building.hirelings.remove(hireling); |
|
|
|
|
|
|
|
|
|
|
|
// Remove from zone mob set
|
|
|
|
// Remove from zone mob set
|
|
|
|
|
|
|
|
|
|
|
@ -388,7 +388,7 @@ public enum BuildingManager { |
|
|
|
|
|
|
|
|
|
|
|
if (building.getRank() < 1) { |
|
|
|
if (building.getRank() < 1) { |
|
|
|
|
|
|
|
|
|
|
|
for (AbstractCharacter slottedNPC : building.getHirelings().keySet()) |
|
|
|
for (AbstractCharacter slottedNPC : building.hirelings.keySet()) |
|
|
|
BuildingManager.removeHireling(building, slottedNPC); |
|
|
|
BuildingManager.removeHireling(building, slottedNPC); |
|
|
|
|
|
|
|
|
|
|
|
return; |
|
|
|
return; |
|
|
@ -396,14 +396,14 @@ public enum BuildingManager { |
|
|
|
|
|
|
|
|
|
|
|
// Delete hireling if building has deranked.
|
|
|
|
// Delete hireling if building has deranked.
|
|
|
|
|
|
|
|
|
|
|
|
for (AbstractCharacter hireling : building.getHirelings().keySet()) { |
|
|
|
for (AbstractCharacter hireling : building.hirelings.keySet()) { |
|
|
|
|
|
|
|
|
|
|
|
if (building.getHirelings().get(hireling) > building.getBlueprint().getSlotsForRank(building.getRank())) |
|
|
|
if (building.hirelings.get(hireling) > building.getBlueprint().getSlotsForRank(building.getRank())) |
|
|
|
BuildingManager.removeHireling(building, hireling); |
|
|
|
BuildingManager.removeHireling(building, hireling); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
refreshHirelings(building); |
|
|
|
updateHirelingGuilds(building); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static Building getBuilding(int id) { |
|
|
|
public static Building getBuilding(int id) { |
|
|
@ -564,7 +564,7 @@ public enum BuildingManager { |
|
|
|
if (building.getBlueprintUUID() == 0) |
|
|
|
if (building.getBlueprintUUID() == 0) |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
|
|
|
|
|
|
|
|
if (building.getBlueprint().getMaxSlots() == building.getHirelings().size()) |
|
|
|
if (building.getBlueprint().getMaxSlots() == building.hirelings.size()) |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
|
|
|
|
|
|
|
|
String pirateName = NPCManager.getPirateName(contract.getMobbaseID()); |
|
|
|
String pirateName = NPCManager.getPirateName(contract.getMobbaseID()); |
|
|
@ -804,7 +804,7 @@ public enum BuildingManager { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!building.getHirelings().containsKey(npc)) |
|
|
|
if (!building.hirelings.containsKey(npc)) |
|
|
|
return; |
|
|
|
return; |
|
|
|
|
|
|
|
|
|
|
|
if (!npc.remove()) { |
|
|
|
if (!npc.remove()) { |
|
|
@ -812,7 +812,7 @@ public enum BuildingManager { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
building.getHirelings().remove(npc); |
|
|
|
building.hirelings.remove(npc); |
|
|
|
|
|
|
|
|
|
|
|
itemBase = ItemBase.getItemBase(contract.getContractID()); |
|
|
|
itemBase = ItemBase.getItemBase(contract.getContractID()); |
|
|
|
|
|
|
|
|
|
|
|