ai acquisition revision

This commit is contained in:
xavier@runuo.com 2013-03-11 14:47:15 +00:00
parent 9028ed365c
commit 8690feea0a

View file

@ -2510,6 +2510,9 @@ namespace Server.Mobiles
if ( !m_Mobile.CanSee( m ) ) if ( !m_Mobile.CanSee( m ) )
continue; continue;
if( Core.AOS && m is BaseCreature && ( m as BaseCreature ).Summoned && !( m as BaseCreature ).Controlled )
continue;
if ( m_Mobile.Summoned && m_Mobile.SummonMaster != null ) if ( m_Mobile.Summoned && m_Mobile.SummonMaster != null )
{ {
// If this is a summon, it can't target its controller. // If this is a summon, it can't target its controller.
@ -2537,27 +2540,19 @@ namespace Server.Mobiles
if ( m is PlayerMobile && ( (PlayerMobile)m ).HonorActive && !( m_Mobile.Combatant == m )) if ( m is PlayerMobile && ( (PlayerMobile)m ).HonorActive && !( m_Mobile.Combatant == m ))
continue; continue;
if( acqType == FightMode.Aggressor || acqType == FightMode.Evil || ( m is BaseCreature ) && ( ( BaseCreature )m ).Summoned ) if( acqType == FightMode.Aggressor || acqType == FightMode.Evil )
{ {
BaseCreature bc = m as BaseCreature;
bool bValid = IsHostile( m ); bool bValid = IsHostile( m );
if( !bValid && ( !( m is BaseCreature ) || !bc.Summoned || bc.Controlled ) ) if ( !bValid )
{
bValid = ( m_Mobile.GetFactionAllegiance( m ) == BaseCreature.Allegiance.Enemy || m_Mobile.GetEthicAllegiance( m ) == BaseCreature.Allegiance.Enemy ); bValid = ( m_Mobile.GetFactionAllegiance( m ) == BaseCreature.Allegiance.Enemy || m_Mobile.GetEthicAllegiance( m ) == BaseCreature.Allegiance.Enemy );
if( acqType == FightMode.Evil && !bValid ) if ( acqType == FightMode.Evil && !bValid )
{ {
if( m is BaseCreature && bc.Controlled && bc.ControlMaster != null ) if( m is BaseCreature && ((BaseCreature)m).Controlled && ((BaseCreature)m).ControlMaster != null )
{ bValid = ( ((BaseCreature)m).ControlMaster.Karma < 0 );
bValid = ( bc.ControlMaster.Karma < 0 ); else
} bValid = ( m.Karma < 0 );
else
{
bValid = ( ( Core.AOS || m.Player ) && m.Karma < 0 );
}
}
} }
if ( !bValid ) if ( !bValid )
@ -2584,11 +2579,6 @@ namespace Server.Mobiles
eable.Free(); eable.Free();
m_Mobile.FocusMob = newFocusMob; m_Mobile.FocusMob = newFocusMob;
if( m_Mobile.FocusMob is BaseFamiliar )
{
m_Mobile.FocusMob = null;
}
} }
return (m_Mobile.FocusMob != null); return (m_Mobile.FocusMob != null);
@ -2824,3 +2814,4 @@ namespace Server.Mobiles
} }
} }
} }