slot NPC fix
This commit is contained in:
@@ -520,40 +520,10 @@ public enum BuildingManager {
|
|||||||
if (building.getBlueprintUUID() == 0)
|
if (building.getBlueprintUUID() == 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (building.getBlueprint().getMaxSlots() == building.getHirelings().size() && building.getBlueprint().getBuildingGroup().equals(BuildingGroup.TOL) == false)
|
if (building.getBlueprint().getSlotsForRank(building.getRank()) == building.getHirelings().size()) {
|
||||||
return false;
|
Logger.error("failed at addHireling with contract: " + contract.getContractID());
|
||||||
|
|
||||||
int availableSlots = 0;
|
|
||||||
if(building.getBlueprint().getBuildingGroup().equals(BuildingGroup.TOL)){
|
|
||||||
switch (building.getRank()) {
|
|
||||||
|
|
||||||
case 1:
|
|
||||||
case 2:
|
|
||||||
availableSlots = 1;
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
case 4:
|
|
||||||
case 5:
|
|
||||||
availableSlots = 2;
|
|
||||||
break;
|
|
||||||
case 6:
|
|
||||||
case 7:
|
|
||||||
availableSlots = 3;
|
|
||||||
break;
|
|
||||||
case 8:
|
|
||||||
availableSlots = 3;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
availableSlots = 0;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
availableSlots += 1;
|
|
||||||
}
|
|
||||||
if (availableSlots == building.getHirelings().size()){
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
String pirateName = NPCManager.getPirateName(contract.getMobbaseID());
|
String pirateName = NPCManager.getPirateName(contract.getMobbaseID());
|
||||||
|
|
||||||
if (item.getChargesRemaining() > 0)
|
if (item.getChargesRemaining() > 0)
|
||||||
|
|||||||
@@ -100,7 +100,6 @@ public class ActivateNPCMsgHandler extends AbstractClientMsgHandler {
|
|||||||
|
|
||||||
if (contractItem == null)
|
if (contractItem == null)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (msg.getContractItem() == 850) {//runemaster
|
if (msg.getContractItem() == 850) {//runemaster
|
||||||
for (AbstractCharacter abs : building.getHirelings().keySet()) {
|
for (AbstractCharacter abs : building.getHirelings().keySet()) {
|
||||||
NPC npc = (NPC) abs;
|
NPC npc = (NPC) abs;
|
||||||
|
|||||||
@@ -181,9 +181,6 @@ public class Blueprint {
|
|||||||
public int getMaxSlots() {
|
public int getMaxSlots() {
|
||||||
if (this.buildingGroup != null && this.buildingGroup.equals(BuildingGroup.BARRACK))
|
if (this.buildingGroup != null && this.buildingGroup.equals(BuildingGroup.BARRACK))
|
||||||
return 1;
|
return 1;
|
||||||
if (this.buildingGroup != null && this.buildingGroup.equals(BuildingGroup.TOL)){
|
|
||||||
return 4;
|
|
||||||
}
|
|
||||||
return maxSlots;
|
return maxSlots;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -319,7 +316,7 @@ public class Blueprint {
|
|||||||
if (this.maxSlots <= 1 && this.buildingGroup.equals(BuildingGroup.TOL) == false)
|
if (this.maxSlots <= 1 && this.buildingGroup.equals(BuildingGroup.TOL) == false)
|
||||||
return maxSlots;
|
return maxSlots;
|
||||||
|
|
||||||
if (this.maxRank == 1 && currentRank == 1 && this.buildingGroup.equals(BuildingGroup.TOL) == false)
|
if (this.maxRank == 1 && currentRank == 1&& this.buildingGroup.equals(BuildingGroup.TOL) == false)
|
||||||
return getMaxSlots();
|
return getMaxSlots();
|
||||||
|
|
||||||
switch (currentRank) {
|
switch (currentRank) {
|
||||||
@@ -335,11 +332,13 @@ public class Blueprint {
|
|||||||
break;
|
break;
|
||||||
case 6:
|
case 6:
|
||||||
case 7:
|
case 7:
|
||||||
|
availableSlots = 3;
|
||||||
|
break;
|
||||||
case 8:
|
case 8:
|
||||||
availableSlots = 3;
|
availableSlots = 3;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
availableSlots = 1;
|
availableSlots = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if(this.buildingGroup.equals(BuildingGroup.TOL)){
|
if(this.buildingGroup.equals(BuildingGroup.TOL)){
|
||||||
|
|||||||
Reference in New Issue
Block a user