diff --git a/src/engine/db/handlers/dbBaneHandler.java b/src/engine/db/handlers/dbBaneHandler.java index 904f0cdd..a076e321 100644 --- a/src/engine/db/handlers/dbBaneHandler.java +++ b/src/engine/db/handlers/dbBaneHandler.java @@ -10,10 +10,9 @@ package engine.db.handlers; import engine.gameManager.DbManager; -import engine.objects.Bane; -import engine.objects.Building; -import engine.objects.City; -import engine.objects.PlayerCharacter; +import engine.gameManager.ZoneManager; +import engine.math.Vector3fImmutable; +import engine.objects.*; import org.joda.time.DateTime; import org.pmw.tinylog.Logger; diff --git a/src/engine/objects/Bane.java b/src/engine/objects/Bane.java index d80ef89f..643f1ec8 100644 --- a/src/engine/objects/Bane.java +++ b/src/engine/objects/Bane.java @@ -101,6 +101,8 @@ public final class Bane { JobScheduler.getInstance().scheduleJob(abtj, this.liveDate.getMillis()); this.activateBaneJob = abtj; + //add bane commander NPC + summonBaneCommander(this); break; } @@ -266,13 +268,19 @@ public final class Bane { BaneRecord baneRecord = BaneRecord.borrow(bane, Enum.RecordEventType.PENDING); DataWarehouse.pushToWarehouse(baneRecord); - //add bane commander NPC - int contractID = 1502042; - NPC.createNPC("Bane Commander",contractID,Vector3fImmutable.getRandomPointOnCircle(stone.loc,15),targetCity.getGuild(),cityZone,(short)70,stone); + summonBaneCommander(bane); return true; } + public static void summonBaneCommander(Bane bane){ + if(bane.getStone().getHirelings().isEmpty()) { + //add bane commander NPC + int contractID = 1502042; + NPC.createNPC("Bane Commander", contractID, Vector3fImmutable.getRandomPointOnCircle(bane.getStone().loc, 15), bane.getCity().getGuild(), ZoneManager.findSmallestZone(bane.getStone().loc), (short) 70, bane.getStone()); + } + } + public static Bane getBane(int cityUUID) { Bane outBane;