forked from MagicBane/Server
replaced MobileFSM.STATE with MobileFSM.MobBehaviourTypes
This commit is contained in:
@@ -10,8 +10,6 @@ package engine.InterestManagement;
|
||||
|
||||
import engine.Enum.DispatchChannel;
|
||||
import engine.Enum.GameObjectType;
|
||||
import engine.ai.MobileFSM;
|
||||
import engine.ai.MobileFSM.STATE;
|
||||
import engine.gameManager.GroupManager;
|
||||
import engine.gameManager.SessionManager;
|
||||
import engine.job.JobScheduler;
|
||||
@@ -338,11 +336,12 @@ public enum InterestManager implements Runnable {
|
||||
if (!awonpc.isAlive() && (awonpc.isPet() || awonpc.isSiege() || awonpc.isNecroPet() || awonpc.isPlayerGuard()))
|
||||
continue;
|
||||
|
||||
if (awonpc.state.equals(STATE.Respawn) || awonpc.state.equals(STATE.Disabled))
|
||||
if (awonpc.isAlive() == false)
|
||||
continue;
|
||||
|
||||
awonpc.playerAgroMap.put(player.getObjectUUID(), false);
|
||||
MobileFSM.setAwake(awonpc, false);
|
||||
//MobileFSM.setAwake(awonpc, false);
|
||||
((Mob)awonpc).setCombatTarget(null);
|
||||
// IVarController.setVariable(awonpc, "IntelligenceDisableDelay", (double) (System.currentTimeMillis() + 5000));
|
||||
// awonpc.enableIntelligence();
|
||||
lcm = new LoadCharacterMsg(awonpc, PlayerCharacter.hideNonAscii());
|
||||
@@ -358,7 +357,8 @@ public enum InterestManager implements Runnable {
|
||||
awonpc.playerAgroMap.put(player.getObjectUUID(), false);
|
||||
|
||||
if (awonpc.isMob())
|
||||
MobileFSM.setAwake(awonpc, false);
|
||||
//MobileFSM.setAwake(awonpc, false);
|
||||
((Mob)awonpc).setCombatTarget(null);
|
||||
// IVarController.setVariable(awonpc, "IntelligenceDisableDelay", (double) (System.currentTimeMillis() + 5000));
|
||||
// awonpc.enableIntelligence();
|
||||
lcm = new LoadCharacterMsg(awonpc, PlayerCharacter.hideNonAscii());
|
||||
|
||||
+242
-1258
File diff suppressed because it is too large
Load Diff
@@ -9,7 +9,6 @@
|
||||
|
||||
package engine.db.handlers;
|
||||
|
||||
import engine.ai.MobileFSM.STATE;
|
||||
import engine.gameManager.NPCManager;
|
||||
import engine.objects.Mob;
|
||||
import engine.objects.Zone;
|
||||
@@ -124,9 +123,8 @@ public class dbMobHandler extends dbHandlerBase {
|
||||
|
||||
toCreate.setTimeToSpawnSiege(System.currentTimeMillis() + MBServerStatics.FIFTEEN_MINUTES);
|
||||
toCreate.setDeathTime(System.currentTimeMillis());
|
||||
toCreate.state = STATE.Respawn;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -458,7 +458,7 @@ public class InfoCmd extends AbstractDevCmd {
|
||||
output += StringUtils.addWS("isAlive: "
|
||||
+ targetMob.isAlive(), 20);
|
||||
output += newline;
|
||||
output += "Mob State: " + targetMob.state.name();
|
||||
//output += "Mob State: " + targetMob.state.name();
|
||||
|
||||
output += newline;
|
||||
output += "Speed : " + targetMob.getSpeed();
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
package engine.gameManager;
|
||||
|
||||
import engine.Enum.*;
|
||||
import engine.ai.MobileFSM.STATE;
|
||||
import engine.exception.MsgSendException;
|
||||
import engine.job.JobContainer;
|
||||
import engine.job.JobScheduler;
|
||||
@@ -183,7 +182,6 @@ public enum CombatManager {
|
||||
|
||||
//set sources target
|
||||
pet.setCombatTarget(target);
|
||||
pet.state = STATE.Attack;
|
||||
// setFirstHitCombatTarget(player,target);
|
||||
|
||||
//put in combat if not already
|
||||
@@ -691,7 +689,6 @@ public enum CombatManager {
|
||||
count++;
|
||||
|
||||
mob.setCombatTarget(ac);
|
||||
mob.state = STATE.Attack;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1339,7 +1336,6 @@ public enum CombatManager {
|
||||
Mob pet = ((PlayerCharacter) tarAc).getPet();
|
||||
if (pet != null && pet.assist() && pet.getCombatTarget() == null) {
|
||||
pet.setCombatTarget(ac);
|
||||
pet.state = STATE.Retaliate;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1351,7 +1347,6 @@ public enum CombatManager {
|
||||
if (ac.getObjectType() == GameObjectType.Mob && retaliater.isSiege())
|
||||
return;
|
||||
retaliater.setCombatTarget(ac);
|
||||
retaliater.state = STATE.Retaliate;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@ package engine.gameManager;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.InterestManagement.WorldGrid;
|
||||
import engine.ai.MobileFSM;
|
||||
import engine.math.Vector3fImmutable;
|
||||
import engine.net.Dispatch;
|
||||
import engine.net.DispatchMessage;
|
||||
@@ -115,8 +114,6 @@ public enum NPCManager {
|
||||
|
||||
public static void dismissNecroPet(Mob necroPet, boolean updateOwner) {
|
||||
|
||||
necroPet.state = MobileFSM.STATE.Disabled;
|
||||
|
||||
necroPet.combatTarget = null;
|
||||
necroPet.hasLoot = false;
|
||||
|
||||
@@ -202,7 +199,6 @@ public enum NPCManager {
|
||||
try {
|
||||
dismissNecroPet(necroPet, true);
|
||||
} catch (Exception e) {
|
||||
necroPet.state = MobileFSM.STATE.Disabled;
|
||||
Logger.error(e);
|
||||
}
|
||||
}
|
||||
@@ -333,7 +329,6 @@ public enum NPCManager {
|
||||
mob.deathTime = System.currentTimeMillis();
|
||||
mob.spawnTime = 900;
|
||||
mob.npcOwner = guardCaptain;
|
||||
mob.state = MobileFSM.STATE.Respawn;
|
||||
|
||||
return mob;
|
||||
}
|
||||
@@ -342,12 +337,9 @@ public enum NPCManager {
|
||||
|
||||
for (Mob toRemove : mobile.siegeMinionMap.keySet()) {
|
||||
|
||||
toRemove.state = MobileFSM.STATE.Disabled;
|
||||
|
||||
if (mobile.isMoving()) {
|
||||
|
||||
mobile.stopMovement(mobile.getLoc());
|
||||
mobile.state = MobileFSM.STATE.Disabled;
|
||||
|
||||
if (toRemove.parentZone != null)
|
||||
toRemove.parentZone.zoneMobSet.remove(toRemove);
|
||||
@@ -383,7 +375,6 @@ public enum NPCManager {
|
||||
public static boolean removeMobileFromBuilding(Mob mobile, Building building) {
|
||||
|
||||
// Remove npc from it's building
|
||||
mobile.state = MobileFSM.STATE.Disabled;
|
||||
|
||||
try {
|
||||
mobile.clearEffects();
|
||||
|
||||
@@ -12,7 +12,6 @@ package engine.net.client;
|
||||
|
||||
import engine.Enum.*;
|
||||
import engine.InterestManagement.WorldGrid;
|
||||
import engine.ai.MobileFSM.STATE;
|
||||
import engine.exception.MsgSendException;
|
||||
import engine.gameManager.*;
|
||||
import engine.job.JobContainer;
|
||||
@@ -2026,7 +2025,6 @@ public class ClientMessagePump implements NetMsgHandler {
|
||||
|
||||
if (pet.getCombatTarget() == null)
|
||||
return;
|
||||
pet.state = STATE.Attack;
|
||||
}
|
||||
|
||||
protected static void petCmd(PetCmdMsg msg, ClientConnection conn) throws MsgSendException {
|
||||
@@ -2044,15 +2042,14 @@ public class ClientMessagePump implements NetMsgHandler {
|
||||
if (!pet.isAlive())
|
||||
return;
|
||||
|
||||
if (pet.state == STATE.Disabled)
|
||||
return;
|
||||
//if (pet.state == STATE.Disabled)
|
||||
// return;
|
||||
|
||||
int type = msg.getType();
|
||||
|
||||
if (type == 1) { //stop attack
|
||||
pet.setCombatTarget(null);
|
||||
pc.setCombat(false);
|
||||
pet.state = STATE.Awake;
|
||||
|
||||
}
|
||||
else if (type == 2) { //dismiss
|
||||
|
||||
@@ -3,7 +3,6 @@ package engine.net.client.handlers;
|
||||
import engine.Enum;
|
||||
import engine.Enum.DispatchChannel;
|
||||
import engine.InterestManagement.WorldGrid;
|
||||
import engine.ai.MobileFSM;
|
||||
import engine.exception.MsgSendException;
|
||||
import engine.gameManager.BuildingManager;
|
||||
import engine.gameManager.DbManager;
|
||||
@@ -67,7 +66,6 @@ public class MinionTrainingMsgHandler extends AbstractClientMsgHandler {
|
||||
if (!npc.getSiegeMinionMap().containsKey(toRemove))
|
||||
return true;
|
||||
|
||||
toRemove.state = MobileFSM.STATE.Disabled;
|
||||
npc.getSiegeMinionMap().remove(toRemove);
|
||||
|
||||
//toRemove.disableIntelligence();
|
||||
@@ -160,7 +158,6 @@ public class MinionTrainingMsgHandler extends AbstractClientMsgHandler {
|
||||
toCreate.setSpawnTime(60 * 15);
|
||||
toCreate.setTimeToSpawnSiege(System.currentTimeMillis() + (60 * 15 * 1000));
|
||||
toCreate.setDeathTime(System.currentTimeMillis());
|
||||
toCreate.state = MobileFSM.STATE.Respawn;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -199,7 +196,6 @@ public class MinionTrainingMsgHandler extends AbstractClientMsgHandler {
|
||||
if (!DbManager.MobQueries.REMOVE_FROM_GUARDS(npc.getObjectUUID(), toRemove.getMobBaseID(), npc.getSiegeMinionMap().get(toRemove)))
|
||||
return true;
|
||||
|
||||
toRemove.state = MobileFSM.STATE.Disabled;
|
||||
npc.getSiegeMinionMap().remove(toRemove);
|
||||
|
||||
//toRemove.disableIntelligence();
|
||||
@@ -293,7 +289,6 @@ public class MinionTrainingMsgHandler extends AbstractClientMsgHandler {
|
||||
if (toCreate != null) {
|
||||
toCreate.setTimeToSpawnSiege(System.currentTimeMillis() + MBServerStatics.FIFTEEN_MINUTES);
|
||||
toCreate.setDeathTime(System.currentTimeMillis());
|
||||
toCreate.state = MobileFSM.STATE.Respawn;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,6 @@ import engine.Enum.GameObjectType;
|
||||
import engine.Enum.ModType;
|
||||
import engine.Enum.SourceType;
|
||||
import engine.InterestManagement.WorldGrid;
|
||||
import engine.ai.MobileFSM.STATE;
|
||||
import engine.gameManager.ZoneManager;
|
||||
import engine.math.Vector3fImmutable;
|
||||
import engine.net.Dispatch;
|
||||
@@ -204,7 +203,7 @@ public abstract class AbstractIntelligenceAgent extends AbstractCharacter {
|
||||
|
||||
WorldGrid.RemoveWorldObject(this);
|
||||
if (this.getObjectType() == GameObjectType.Mob){
|
||||
((Mob)this).state = STATE.Disabled;
|
||||
//((Mob)this).state = STATE.Disabled;
|
||||
if (((Mob)this).getParentZone() != null)
|
||||
((Mob)this).getParentZone().zoneMobSet.remove(this);
|
||||
}
|
||||
|
||||
+19
-21
@@ -8,13 +8,11 @@
|
||||
|
||||
|
||||
package engine.objects;
|
||||
|
||||
import ch.claude_martin.enumbitset.EnumBitSet;
|
||||
import engine.Enum;
|
||||
import engine.Enum.*;
|
||||
import engine.InterestManagement.WorldGrid;
|
||||
import engine.ai.MobileFSM;
|
||||
import engine.ai.MobileFSM.STATE;
|
||||
import engine.exception.SerializationException;
|
||||
import engine.gameManager.*;
|
||||
import engine.job.JobContainer;
|
||||
@@ -35,7 +33,6 @@ import engine.net.client.msg.PlaceAssetMsg;
|
||||
import engine.server.MBServerStatics;
|
||||
import org.joda.time.DateTime;
|
||||
import org.pmw.tinylog.Logger;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
@@ -44,7 +41,6 @@ import java.util.HashSet;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.ThreadLocalRandom;
|
||||
import java.util.concurrent.locks.ReentrantReadWriteLock;
|
||||
|
||||
import static engine.net.client.msg.ErrorPopupMsg.sendErrorPopup;
|
||||
|
||||
public class Mob extends AbstractIntelligenceAgent {
|
||||
@@ -89,7 +85,6 @@ public class Mob extends AbstractIntelligenceAgent {
|
||||
public AbstractCharacter npcOwner;
|
||||
public Vector3fImmutable inBuildingLoc = null;
|
||||
private boolean noAggro = false;
|
||||
public STATE state = STATE.Disabled;
|
||||
private int aggroTargetID = 0;
|
||||
private boolean walkingHome = true;
|
||||
private long lastAttackTime = 0;
|
||||
@@ -110,7 +105,7 @@ public class Mob extends AbstractIntelligenceAgent {
|
||||
|
||||
public EnumBitSet<MonsterType> notEnemy;
|
||||
public EnumBitSet<Enum.MonsterType> enemy;
|
||||
|
||||
public MobileFSM.MobBehaviourType BehaviourType;
|
||||
/**
|
||||
* No Id Constructor
|
||||
*/
|
||||
@@ -122,7 +117,7 @@ public class Mob extends AbstractIntelligenceAgent {
|
||||
walk, combat, bindLoc, currentLoc, faceDir, healthCurrent, manaCurrent, stamCurrent, guild, runningTrains);
|
||||
|
||||
this.dbID = MBServerStatics.NO_DB_ROW_ASSIGNED_YET;
|
||||
this.state = STATE.Idle;
|
||||
//this.state = STATE.Idle;
|
||||
this.loadID = npcType;
|
||||
this.isMob = isMob;
|
||||
this.mobBase = MobBase.getMobBase(loadID);
|
||||
@@ -155,7 +150,7 @@ public class Mob extends AbstractIntelligenceAgent {
|
||||
byte runningTrains, int npcType, boolean isMob, Zone parent, int newUUID, Building building, int contractID) {
|
||||
super(firstName, lastName, statStrCurrent, statDexCurrent, statConCurrent, statIntCurrent, statSpiCurrent, level, exp, sit,
|
||||
walk, combat, bindLoc, currentLoc, faceDir, healthCurrent, manaCurrent, stamCurrent, guild, runningTrains, newUUID);
|
||||
this.state = STATE.Idle;
|
||||
//this.state = STATE.Idle;
|
||||
this.dbID = newUUID;
|
||||
this.loadID = npcType;
|
||||
this.isMob = isMob;
|
||||
@@ -178,7 +173,7 @@ public class Mob extends AbstractIntelligenceAgent {
|
||||
*/
|
||||
public Mob(MobBase mobBase, Guild guild, Zone parent, short level, PlayerCharacter owner, int tableID) {
|
||||
super(mobBase.getFirstName(), "", (short) 0, (short) 0, (short) 0, (short) 0, (short) 0, level, 0, false, true, false, owner.getLoc(), owner.getLoc(), owner.getFaceDir(), (short) mobBase.getHealthMax(), (short) 0, (short) 0, guild, (byte) 0, tableID);
|
||||
this.state = STATE.Idle;
|
||||
//this.state = STATE.Idle;
|
||||
this.dbID = tableID;
|
||||
this.loadID = mobBase.getObjectUUID();
|
||||
this.isMob = true;
|
||||
@@ -214,7 +209,7 @@ public class Mob extends AbstractIntelligenceAgent {
|
||||
|
||||
try {
|
||||
this.dbID = rs.getInt(1);
|
||||
this.state = STATE.Idle;
|
||||
//this.state = STATE.Idle;
|
||||
this.loadID = rs.getInt("mob_mobbaseID");
|
||||
this.gridObjectType = GridObjectType.DYNAMIC;
|
||||
this.spawnRadius = rs.getFloat("mob_spawnRadius");
|
||||
@@ -298,7 +293,7 @@ public class Mob extends AbstractIntelligenceAgent {
|
||||
this.equipmentSetID = this.contract.getEquipmentSet();
|
||||
|
||||
this.nameOverride = rs.getString("mob_name");
|
||||
|
||||
this.BehaviourType = MobileFSM.MobBehaviourType.valueOf(rs.getString("fsm"));
|
||||
} catch (Exception e) {
|
||||
Logger.error(currentID + "");
|
||||
}
|
||||
@@ -650,7 +645,7 @@ public class Mob extends AbstractIntelligenceAgent {
|
||||
DbManager.addToCache(mob);
|
||||
mob.setPet(owner, true);
|
||||
mob.setWalkMode(false);
|
||||
mob.state = STATE.Awake;
|
||||
//mob.state = STATE.Awake;
|
||||
|
||||
} catch (Exception e) {
|
||||
Logger.error(e);
|
||||
@@ -717,7 +712,7 @@ public class Mob extends AbstractIntelligenceAgent {
|
||||
//target is mob's combat target, LETS GO.
|
||||
if (source.getHateValue() > target.getHateValue()) {
|
||||
mob.setCombatTarget(source);
|
||||
MobileFSM.setAggro(mob, source.getObjectUUID());
|
||||
//MobileFSM.setAggro(mob, source.getObjectUUID());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1144,8 +1139,8 @@ public class Mob extends AbstractIntelligenceAgent {
|
||||
if (!this.isMoving())
|
||||
return;
|
||||
|
||||
if (state == STATE.Disabled)
|
||||
return;
|
||||
//if (state == STATE.Disabled)
|
||||
// return;
|
||||
|
||||
if (this.isAlive() == false || this.getBonuses().getBool(ModType.Stunned, SourceType.None) || this.getBonuses().getBool(ModType.CannotMove, SourceType.None)) {
|
||||
//Target is stunned or rooted. Don't move
|
||||
@@ -1185,7 +1180,8 @@ public class Mob extends AbstractIntelligenceAgent {
|
||||
try {
|
||||
if (this.isSiege) {
|
||||
this.deathTime = System.currentTimeMillis();
|
||||
this.state = STATE.Dead;
|
||||
//this.state = STATE.Dead;
|
||||
MobileFSM.dead(this);
|
||||
try {
|
||||
this.clearEffects();
|
||||
} catch (Exception e) {
|
||||
@@ -1211,7 +1207,7 @@ public class Mob extends AbstractIntelligenceAgent {
|
||||
}
|
||||
|
||||
} else if (this.isPet() || this.isNecroPet()) {
|
||||
this.state = STATE.Disabled;
|
||||
//this.state = STATE.Disabled;
|
||||
|
||||
this.combatTarget = null;
|
||||
this.hasLoot = false;
|
||||
@@ -1248,7 +1244,8 @@ public class Mob extends AbstractIntelligenceAgent {
|
||||
//cleanup effects
|
||||
|
||||
this.deathTime = System.currentTimeMillis();
|
||||
this.state = STATE.Dead;
|
||||
//this.state = STATE.Dead;
|
||||
MobileFSM.dead(this);
|
||||
|
||||
playerAgroMap.clear();
|
||||
|
||||
@@ -2037,7 +2034,8 @@ public class Mob extends AbstractIntelligenceAgent {
|
||||
PlayerCharacter player = (PlayerCharacter) ac;
|
||||
|
||||
if (this.getCombatTarget() == null) {
|
||||
MobileFSM.setAggro(this, player.getObjectUUID());
|
||||
//MobileFSM.setAggro(this, player.getObjectUUID());
|
||||
this.combatTarget = ac;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2048,7 +2046,7 @@ public class Mob extends AbstractIntelligenceAgent {
|
||||
|
||||
if (ac.getHateValue() > ((PlayerCharacter) this.getCombatTarget()).getHateValue()) {
|
||||
this.setCombatTarget(player);
|
||||
MobileFSM.setAggro(this, player.getObjectUUID());
|
||||
//MobileFSM.setAggro(this, player.getObjectUUID());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2329,7 +2327,7 @@ public class Mob extends AbstractIntelligenceAgent {
|
||||
WorldGrid.RemoveWorldObject(this);
|
||||
DbManager.removeFromCache(this);
|
||||
if (this.getObjectType() == GameObjectType.Mob) {
|
||||
this.state = STATE.Disabled;
|
||||
//this.state = STATE.Disabled;
|
||||
if (this.getParentZone() != null)
|
||||
this.getParentZone().zoneMobSet.remove(this);
|
||||
}
|
||||
|
||||
@@ -12,7 +12,6 @@ package engine.objects;
|
||||
import engine.Enum;
|
||||
import engine.Enum.*;
|
||||
import engine.InterestManagement.WorldGrid;
|
||||
import engine.ai.MobileFSM.STATE;
|
||||
import engine.exception.SerializationException;
|
||||
import engine.gameManager.*;
|
||||
import engine.job.JobContainer;
|
||||
@@ -790,7 +789,6 @@ public class NPC extends AbstractCharacter {
|
||||
|
||||
for (Mob toRemove : this.siegeMinionMap.keySet()) {
|
||||
|
||||
toRemove.state = STATE.Disabled;
|
||||
|
||||
try {
|
||||
toRemove.clearEffects();
|
||||
@@ -1461,7 +1459,6 @@ public class NPC extends AbstractCharacter {
|
||||
|
||||
mob.setSpawnTime(10);
|
||||
mob.setNpcOwner(this);
|
||||
mob.state = STATE.Awake;
|
||||
mob.region = AbstractWorldObject.GetRegionByWorldObject(mob);
|
||||
return mob;
|
||||
}
|
||||
|
||||
@@ -15,7 +15,6 @@ import engine.InterestManagement.HeightMap;
|
||||
import engine.InterestManagement.InterestManager;
|
||||
import engine.InterestManagement.RealmMap;
|
||||
import engine.InterestManagement.WorldGrid;
|
||||
import engine.ai.MobileFSM.STATE;
|
||||
import engine.db.archive.CharacterRecord;
|
||||
import engine.db.archive.DataWarehouse;
|
||||
import engine.db.archive.PvpRecord;
|
||||
@@ -4580,7 +4579,6 @@ public class PlayerCharacter extends AbstractCharacter {
|
||||
if (!currentPet.isSiege()) {
|
||||
|
||||
currentPet.setCombatTarget(null);
|
||||
currentPet.state = STATE.Disabled;
|
||||
|
||||
if (currentPet.getParentZone() != null)
|
||||
|
||||
|
||||
@@ -125,7 +125,7 @@ public class ApplyEffectPowerAction extends AbstractPowerAction {
|
||||
if (this.effectID.equals("TAUNT")){
|
||||
|
||||
if (awo != null && awo.getObjectType() == GameObjectType.Mob){
|
||||
MobileFSM.setAggro((Mob)awo,source.getObjectUUID());
|
||||
((Mob) awo).setCombatTarget(source);
|
||||
ChatSystemMsg msg = ChatManager.CombatInfo(source, awo);
|
||||
DispatchMessage.sendToAllInRange(source, msg);
|
||||
}
|
||||
@@ -252,7 +252,7 @@ public class ApplyEffectPowerAction extends AbstractPowerAction {
|
||||
if (this.effectID.equals("TAUNT")){
|
||||
|
||||
if (awo != null && awo.getObjectType() == GameObjectType.Mob){
|
||||
MobileFSM.setAggro((Mob)awo,source.getObjectUUID());
|
||||
((Mob) awo).setCombatTarget(source);
|
||||
ChatSystemMsg msg = ChatManager.CombatInfo(source, awo);
|
||||
DispatchMessage.sendToAllInRange(source, msg);
|
||||
}
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
package engine.powers.poweractions;
|
||||
|
||||
import engine.Enum.GameObjectType;
|
||||
import engine.ai.MobileFSM.STATE;
|
||||
import engine.math.Vector3fImmutable;
|
||||
import engine.objects.AbstractCharacter;
|
||||
import engine.objects.AbstractWorldObject;
|
||||
@@ -32,7 +31,6 @@ public class ClearAggroPowerAction extends AbstractPowerAction {
|
||||
protected void _startAction(AbstractCharacter source, AbstractWorldObject awo, Vector3fImmutable targetLoc, int trains, ActionsBase ab, PowersBase pb) {
|
||||
if (awo != null && awo.getObjectType() == GameObjectType.Mob){
|
||||
((Mob)awo).setNoAggro(true);
|
||||
((Mob)awo).state = STATE.Patrol;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -10,11 +10,9 @@
|
||||
package engine.powers.poweractions;
|
||||
|
||||
import engine.Enum.GameObjectType;
|
||||
import engine.ai.MobileFSM.STATE;
|
||||
import engine.math.Vector3fImmutable;
|
||||
import engine.objects.AbstractCharacter;
|
||||
import engine.objects.AbstractWorldObject;
|
||||
import engine.objects.Mob;
|
||||
import engine.powers.ActionsBase;
|
||||
import engine.powers.PowersBase;
|
||||
|
||||
@@ -31,7 +29,6 @@ public class ClearNearbyAggroPowerAction extends AbstractPowerAction {
|
||||
@Override
|
||||
protected void _startAction(AbstractCharacter source, AbstractWorldObject awo, Vector3fImmutable targetLoc, int trains, ActionsBase ab, PowersBase pb) {
|
||||
if (source.getObjectType() == GameObjectType.Mob){
|
||||
((Mob)source).state = STATE.Patrol;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -11,7 +11,6 @@ package engine.powers.poweractions;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.InterestManagement.WorldGrid;
|
||||
import engine.ai.MobileFSM.STATE;
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.gameManager.NPCManager;
|
||||
import engine.gameManager.ZoneManager;
|
||||
@@ -82,7 +81,6 @@ public class CreateMobPowerAction extends AbstractPowerAction {
|
||||
if(currentPet!= null && !currentPet.isNecroPet() && !currentPet.isSiege()) {
|
||||
DbManager.removeFromCache(currentPet);
|
||||
WorldGrid.RemoveWorldObject(currentPet);
|
||||
currentPet.state = STATE.Disabled;
|
||||
currentPet.setCombatTarget(null);
|
||||
|
||||
if (currentPet.getParentZone() != null)
|
||||
@@ -116,7 +114,6 @@ public class CreateMobPowerAction extends AbstractPowerAction {
|
||||
if(!currentPet.isNecroPet() && !currentPet.isSiege()) {
|
||||
DbManager.removeFromCache(currentPet);
|
||||
currentPet.setCombatTarget(null);
|
||||
currentPet.state = STATE.Disabled;
|
||||
|
||||
currentPet.setOwner(null);
|
||||
WorldGrid.RemoveWorldObject(currentPet);
|
||||
|
||||
@@ -41,7 +41,8 @@ public class MobRecallPowerAction extends AbstractPowerAction {
|
||||
|
||||
MovementManager.translocate(awoac,awoac.getBindLoc(), null);
|
||||
if (awoac.getObjectType() == GameObjectType.Mob){
|
||||
MobileFSM.setAwake((Mob)awoac,true);
|
||||
//MobileFSM.setAwake((Mob)awoac,true);
|
||||
((Mob)awoac).setCombatTarget(null);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@ public class RecallPowerAction extends AbstractPowerAction {
|
||||
awoac.setBindLoc(MBServerStatics.startX, MBServerStatics.startY, MBServerStatics.startZ);
|
||||
awoac.teleport(awoac.getBindLoc());
|
||||
if (awoac.getObjectType() == GameObjectType.Mob){
|
||||
MobileFSM.setAwake((Mob)awoac,true);
|
||||
((Mob)awoac).setCombatTarget(null);
|
||||
if (awoac.isAlive())
|
||||
WorldGrid.updateObject(awoac);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user