forked from MagicBane/Server
Relevant methods made static and moved into NPCManager
This commit is contained in:
@@ -7,6 +7,7 @@ import engine.ai.MobileFSM;
|
||||
import engine.exception.MsgSendException;
|
||||
import engine.gameManager.BuildingManager;
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.gameManager.NPCManager;
|
||||
import engine.gameManager.SessionManager;
|
||||
import engine.net.Dispatch;
|
||||
import engine.net.DispatchMessage;
|
||||
@@ -66,8 +67,8 @@ public class MinionTrainingMsgHandler extends AbstractClientMsgHandler {
|
||||
if (!npc.getSiegeMinionMap().containsKey(toRemove))
|
||||
return true;
|
||||
|
||||
toRemove.setState(MobileFSM.STATE.Disabled);
|
||||
npc.getSiegeMinionMap().remove(toRemove);
|
||||
toRemove.state = MobileFSM.STATE.Disabled;
|
||||
npc.getSiegeMinionMap().remove(toRemove);
|
||||
|
||||
//toRemove.disableIntelligence();
|
||||
WorldGrid.RemoveWorldObject(toRemove);
|
||||
@@ -159,8 +160,8 @@ public class MinionTrainingMsgHandler extends AbstractClientMsgHandler {
|
||||
toCreate.setSpawnTime(60 * 15);
|
||||
toCreate.setTimeToSpawnSiege(System.currentTimeMillis() + (60 * 15 * 1000));
|
||||
toCreate.setDeathTime(System.currentTimeMillis());
|
||||
toCreate.setState(MobileFSM.STATE.Respawn);
|
||||
}
|
||||
toCreate.state = MobileFSM.STATE.Respawn;
|
||||
}
|
||||
}
|
||||
|
||||
ManageNPCMsg mnm = new ManageNPCMsg(npc);
|
||||
@@ -198,8 +199,8 @@ public class MinionTrainingMsgHandler extends AbstractClientMsgHandler {
|
||||
if (!DbManager.MobQueries.REMOVE_FROM_GUARDS(npc.getObjectUUID(), toRemove.getMobBaseID(), npc.getSiegeMinionMap().get(toRemove)))
|
||||
return true;
|
||||
|
||||
toRemove.setState(MobileFSM.STATE.Disabled);
|
||||
npc.getSiegeMinionMap().remove(toRemove);
|
||||
toRemove.state = MobileFSM.STATE.Disabled;
|
||||
npc.getSiegeMinionMap().remove(toRemove);
|
||||
|
||||
//toRemove.disableIntelligence();
|
||||
WorldGrid.RemoveWorldObject(toRemove);
|
||||
@@ -283,7 +284,7 @@ public class MinionTrainingMsgHandler extends AbstractClientMsgHandler {
|
||||
if (!DbManager.MobQueries.ADD_TO_GUARDS(npc.getObjectUUID(), mobBase, pirateName, npc.getSiegeMinionMap().size() + 1))
|
||||
return true;
|
||||
|
||||
Mob toCreate = npc.createGuardMob(mobBase, npc.getGuild(), zone, b.getLoc(), npc.getLevel(),pirateName);
|
||||
Mob toCreate = NPCManager.createGuardMob(npc, npc.getGuild(), zone, b.getLoc(), npc.getLevel(),pirateName);
|
||||
|
||||
if (toCreate == null)
|
||||
return true;
|
||||
@@ -292,8 +293,8 @@ public class MinionTrainingMsgHandler extends AbstractClientMsgHandler {
|
||||
if (toCreate != null) {
|
||||
toCreate.setTimeToSpawnSiege(System.currentTimeMillis() + MBServerStatics.FIFTEEN_MINUTES);
|
||||
toCreate.setDeathTime(System.currentTimeMillis());
|
||||
toCreate.setState(MobileFSM.STATE.Respawn);
|
||||
}
|
||||
toCreate.state = MobileFSM.STATE.Respawn;
|
||||
}
|
||||
}
|
||||
|
||||
ManageNPCMsg mnm = new ManageNPCMsg(npc);
|
||||
|
||||
@@ -6,6 +6,7 @@ import engine.Enum.ProfitType;
|
||||
import engine.exception.MsgSendException;
|
||||
import engine.gameManager.BuildingManager;
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.gameManager.NPCManager;
|
||||
import engine.gameManager.SessionManager;
|
||||
import engine.math.FastMath;
|
||||
import engine.math.Vector3fImmutable;
|
||||
@@ -209,7 +210,7 @@ public class OrderNPCMsgHandler extends AbstractClientMsgHandler {
|
||||
if (building.getHirelings().containsKey(mob) == false)
|
||||
return true;
|
||||
|
||||
if (mob.remove(building) == false) {
|
||||
if (NPCManager.removeMobileFromBuilding(mob, building) == false) {
|
||||
PlaceAssetMsg.sendPlaceAssetError(player.getClientConnection(), 1, "A Serious error has occurred. Please post details for to ensure transaction integrity");
|
||||
return true;
|
||||
}
|
||||
@@ -439,9 +440,9 @@ public class OrderNPCMsgHandler extends AbstractClientMsgHandler {
|
||||
case Mob:
|
||||
|
||||
Mob mob = (Mob) abstractCharacter;
|
||||
building = mob.getBuilding();
|
||||
building = mob.building;
|
||||
|
||||
if (mob.getBuilding() == null)
|
||||
if (mob.building == null)
|
||||
return;
|
||||
|
||||
City mobCity = building.getCity();
|
||||
|
||||
Reference in New Issue
Block a user