Relevant methods made static and moved into NPCManager
This commit is contained in:
@@ -28,7 +28,6 @@ import engine.net.client.msg.*;
|
||||
import engine.net.client.msg.chat.AbstractChatMsg;
|
||||
import engine.net.client.msg.commands.ClientAdminCommandMsg;
|
||||
import engine.objects.*;
|
||||
import engine.powers.effectmodifiers.AbstractEffectModifier;
|
||||
import engine.server.MBServerStatics;
|
||||
import engine.server.world.WorldServer;
|
||||
import engine.session.Session;
|
||||
@@ -37,7 +36,6 @@ import org.pmw.tinylog.Logger;
|
||||
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.ThreadLocalRandom;
|
||||
|
||||
@@ -2028,7 +2026,7 @@ public class ClientMessagePump implements NetMsgHandler {
|
||||
|
||||
if (pet.getCombatTarget() == null)
|
||||
return;
|
||||
pet.setState(STATE.Attack);
|
||||
pet.state = STATE.Attack;
|
||||
}
|
||||
|
||||
protected static void petCmd(PetCmdMsg msg, ClientConnection conn) throws MsgSendException {
|
||||
@@ -2046,7 +2044,7 @@ public class ClientMessagePump implements NetMsgHandler {
|
||||
if (!pet.isAlive())
|
||||
return;
|
||||
|
||||
if (pet.getState() == STATE.Disabled)
|
||||
if (pet.state == STATE.Disabled)
|
||||
return;
|
||||
|
||||
int type = msg.getType();
|
||||
@@ -2054,7 +2052,7 @@ public class ClientMessagePump implements NetMsgHandler {
|
||||
if (type == 1) { //stop attack
|
||||
pet.setCombatTarget(null);
|
||||
pc.setCombat(false);
|
||||
pet.setState(STATE.Awake);
|
||||
pet.state = STATE.Awake;
|
||||
|
||||
}
|
||||
else if (type == 2) { //dismiss
|
||||
|
||||
@@ -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