forked from MagicBane/Server
items removed properly from inventory, NPCs nop longer stock base items
This commit is contained in:
@@ -808,7 +808,7 @@ public class MobAI {
|
|||||||
chaseTarget(mob);
|
chaseTarget(mob);
|
||||||
break;
|
break;
|
||||||
case GuardMinion:
|
case GuardMinion:
|
||||||
if (!mob.npcOwner.isAlive() || ((Mob) mob.npcOwner).despawned)
|
if (!mob.npcOwner.isAlive() && mob.getCombatTarget() == null)
|
||||||
randomGuardPatrolPoint(mob);
|
randomGuardPatrolPoint(mob);
|
||||||
else {
|
else {
|
||||||
if (mob.getCombatTarget() != null) {
|
if (mob.getCombatTarget() != null) {
|
||||||
@@ -1043,7 +1043,6 @@ public class MobAI {
|
|||||||
mob.setCombatTarget(newTarget);
|
mob.setCombatTarget(newTarget);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CheckMobMovement(mob);
|
CheckMobMovement(mob);
|
||||||
CheckForAttack(mob);
|
CheckForAttack(mob);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
@@ -1054,24 +1053,9 @@ public class MobAI {
|
|||||||
public static void GuardMinionLogic(Mob mob) {
|
public static void GuardMinionLogic(Mob mob) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (!mob.npcOwner.isAlive()) {
|
boolean isComanded = mob.npcOwner.isAlive();
|
||||||
|
if (!isComanded) {
|
||||||
if (mob.getCombatTarget() == null) {
|
GuardCaptainLogic(mob);
|
||||||
CheckForPlayerGuardAggro(mob);
|
|
||||||
} else {
|
|
||||||
|
|
||||||
AbstractWorldObject newTarget = ChangeTargetFromHateValue(mob);
|
|
||||||
|
|
||||||
if (newTarget != null) {
|
|
||||||
|
|
||||||
if (newTarget.getObjectType().equals(Enum.GameObjectType.PlayerCharacter)) {
|
|
||||||
if (GuardCanAggro(mob, (PlayerCharacter) newTarget))
|
|
||||||
mob.setCombatTarget(newTarget);
|
|
||||||
} else
|
|
||||||
mob.setCombatTarget(newTarget);
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}else {
|
}else {
|
||||||
if (mob.npcOwner.getCombatTarget() != null)
|
if (mob.npcOwner.getCombatTarget() != null)
|
||||||
mob.setCombatTarget(mob.npcOwner.getCombatTarget());
|
mob.setCombatTarget(mob.npcOwner.getCombatTarget());
|
||||||
|
|||||||
Reference in New Issue
Block a user