Server.Mobiles.MageAI.DoActionGuard C# (CSharp) Méthode

DoActionGuard() public méthode

public DoActionGuard ( ) : bool
Résultat bool
		public override bool DoActionGuard()
		{
			if( m_LastTarget != null && m_LastTarget.Hidden )
			{
				Map map = m_Mobile.Map;

				if( map == null || !m_Mobile.InRange( m_LastTargetLoc, 12 ) )
				{
					m_LastTarget = null;
				}
				else if( m_Mobile.Spell == null && DateTime.Now > m_NextCastTime )
				{
					m_Mobile.DebugSay( "I am going to reveal my last target" );

					m_RevealTarget = new LandTarget( m_LastTargetLoc, map );
					Spell spell = new RevealSpell( m_Mobile, null );

					if( spell.Cast() )
						m_LastTarget = null; // only do it once

					m_NextCastTime = DateTime.Now + GetDelay( spell );
				}
			}

			if( AcquireFocusMob( m_Mobile.RangePerception, m_Mobile.FightMode, false, false, true ) )
			{
				m_Mobile.DebugSay( "I am going to attack {0}", m_Mobile.FocusMob.Name );

				m_Mobile.Combatant = m_Mobile.FocusMob;
				Action = ActionType.Combat;
			}
			else
			{
				if( !m_Mobile.Controlled )
				{
					ProcessTarget();

					Spell spell = CheckCastHealingSpell();

					if( spell != null )
						spell.Cast();
				}

				base.DoActionGuard();
			}

			return true;
		}