From 4ee6ca5951edf33abcf91fadfdec20ec30c6fd6c Mon Sep 17 00:00:00 2001 From: mark Date: Sun, 23 Aug 2009 05:36:40 +0000 Subject: [PATCH] --- Scripts/Engines/AI/AI/BaseAI.cs | 7 +++++-- Scripts/Engines/AI/Creature/BaseCreature.cs | 4 ++-- Scripts/Engines/Factions/Core/PlayerState.cs | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Scripts/Engines/AI/AI/BaseAI.cs b/Scripts/Engines/AI/AI/BaseAI.cs index 97ebebd1f..8138a1330 100644 --- a/Scripts/Engines/AI/AI/BaseAI.cs +++ b/Scripts/Engines/AI/AI/BaseAI.cs @@ -1051,8 +1051,8 @@ namespace Server.Mobiles case OrderType.Friend: case OrderType.Unfriend: m_Mobile.ControlMaster.RevealingAction(); - break; + case OrderType.Guard: m_Mobile.ControlMaster.RevealingAction(); m_Mobile.CurrentSpeed = m_Mobile.ActiveSpeed; @@ -2392,8 +2392,11 @@ namespace Server.Mobiles } else if( m_Mobile.Controlled ) { - if( m_Mobile.ControlTarget == null || m_Mobile.ControlTarget.Deleted || !m_Mobile.ControlTarget.Alive || m_Mobile.ControlTarget.IsDeadBondedPet || !m_Mobile.InRange( m_Mobile.ControlTarget, m_Mobile.RangePerception * 2 ) ) + if( m_Mobile.ControlTarget == null || m_Mobile.ControlTarget.Deleted || m_Mobile.ControlTarget.Hidden || !m_Mobile.ControlTarget.Alive || m_Mobile.ControlTarget.IsDeadBondedPet || !m_Mobile.InRange( m_Mobile.ControlTarget, m_Mobile.RangePerception * 2 ) ) { + if ( m_Mobile.ControlTarget != null && m_Mobile.ControlTarget != m_Mobile.ControlMaster ) + m_Mobile.ControlTarget = null; + m_Mobile.FocusMob = null; return false; } diff --git a/Scripts/Engines/AI/Creature/BaseCreature.cs b/Scripts/Engines/AI/Creature/BaseCreature.cs index 82a1bed29..49849a23f 100644 --- a/Scripts/Engines/AI/Creature/BaseCreature.cs +++ b/Scripts/Engines/AI/Creature/BaseCreature.cs @@ -1683,7 +1683,7 @@ namespace Server.Mobiles else if ( version < 13 && m_ControlOrder >= OrderType.Unfriend ) ++m_ControlOrder; - if ( version < 16 ) + if ( version < 16 && Loyalty != MaxLoyalty ) Loyalty *= 10; double activeSpeed = m_dActiveSpeed; @@ -4180,7 +4180,7 @@ namespace Server.Mobiles rights[0].m_Damage = (int)(rights[0].m_Damage * 1.25); //This would be the first valid person attacking it. Gets a 25% bonus. Per 1/19/07 Five on Friday if ( rights.Count > 1 ) - rights.Sort(); //Sort by damage + rights.Sort(); //Sort by damage int topDamage = rights[0].m_Damage; int minDamage; diff --git a/Scripts/Engines/Factions/Core/PlayerState.cs b/Scripts/Engines/Factions/Core/PlayerState.cs index ff9e34fbc..21d98b142 100644 --- a/Scripts/Engines/Factions/Core/PlayerState.cs +++ b/Scripts/Engines/Factions/Core/PlayerState.cs @@ -249,7 +249,7 @@ namespace Server.Factions public int CompareTo( object obj ) { - return m_KillPoints - ((PlayerState)obj).m_KillPoints; + return ((PlayerState)obj).m_KillPoints - m_KillPoints; } } } \ No newline at end of file