Server.Mobiles.BaseAI.OnCurrentOrderChanged C# (CSharp) Méthode

OnCurrentOrderChanged() public méthode

public OnCurrentOrderChanged ( ) : void
Résultat void
		public virtual void OnCurrentOrderChanged()
		{
			if (m_Mobile.Deleted || m_Mobile.ControlMaster == null || m_Mobile.ControlMaster.Deleted)
				return;

			switch (m_Mobile.ControlOrder)
			{
				case OrderType.None:
					m_Mobile.ControlMaster.RevealingAction();
					m_Mobile.Home = m_Mobile.Location;
					m_Mobile.CurrentSpeed = m_Mobile.PassiveSpeed;
					m_Mobile.PlaySound(m_Mobile.GetIdleSound());
					m_Mobile.Warmode = false;
					m_Mobile.Combatant = null;
					break;

				case OrderType.Come:
					m_Mobile.ControlMaster.RevealingAction();
					m_Mobile.CurrentSpeed = m_Mobile.ActiveSpeed;
					m_Mobile.PlaySound(m_Mobile.GetIdleSound());
					m_Mobile.Warmode = false;
					m_Mobile.Combatant = null;
					break;

				case OrderType.Drop:
					m_Mobile.ControlMaster.RevealingAction();
					m_Mobile.CurrentSpeed = m_Mobile.PassiveSpeed;
					m_Mobile.PlaySound(m_Mobile.GetIdleSound());
					m_Mobile.Warmode = true;
					m_Mobile.Combatant = null;
					break;

				case OrderType.Friend:
				case OrderType.Unfriend:
					m_Mobile.ControlMaster.RevealingAction();
					break;

				case OrderType.Guard:
					m_Mobile.ControlMaster.RevealingAction();
					m_Mobile.CurrentSpeed = m_Mobile.ActiveSpeed;
					m_Mobile.PlaySound(m_Mobile.GetIdleSound());
					m_Mobile.Warmode = true;
					m_Mobile.Combatant = null;
					string petname = String.Format("{0}", m_Mobile.Name);
					m_Mobile.ControlMaster.SendLocalizedMessage(1049671, petname);	//~1_PETNAME~ is now guarding you.
					break;

				case OrderType.Attack:
					m_Mobile.ControlMaster.RevealingAction();
					m_Mobile.CurrentSpeed = m_Mobile.ActiveSpeed;
					m_Mobile.PlaySound(m_Mobile.GetIdleSound());

					m_Mobile.Warmode = true;
					m_Mobile.Combatant = null;
					break;

				case OrderType.Patrol:
					m_Mobile.ControlMaster.RevealingAction();
					m_Mobile.CurrentSpeed = m_Mobile.ActiveSpeed;
					m_Mobile.PlaySound(m_Mobile.GetIdleSound());
					m_Mobile.Warmode = false;
					m_Mobile.Combatant = null;
					break;

				case OrderType.Release:
					m_Mobile.ControlMaster.RevealingAction();
					m_Mobile.CurrentSpeed = m_Mobile.PassiveSpeed;
					m_Mobile.PlaySound(m_Mobile.GetIdleSound());
					m_Mobile.Warmode = false;
					m_Mobile.Combatant = null;
					break;

				case OrderType.Stay:
					m_Mobile.ControlMaster.RevealingAction();
					m_Mobile.CurrentSpeed = m_Mobile.PassiveSpeed;
					m_Mobile.PlaySound(m_Mobile.GetIdleSound());
					m_Mobile.Warmode = false;
					m_Mobile.Combatant = null;
					break;

				case OrderType.Stop:
					m_Mobile.ControlMaster.RevealingAction();
					m_Mobile.Home = m_Mobile.Location;
					m_Mobile.CurrentSpeed = m_Mobile.PassiveSpeed;
					m_Mobile.PlaySound(m_Mobile.GetIdleSound());
					m_Mobile.Warmode = false;
					m_Mobile.Combatant = null;
					break;

				case OrderType.Follow:
					m_Mobile.ControlMaster.RevealingAction();
					m_Mobile.CurrentSpeed = m_Mobile.ActiveSpeed;
					m_Mobile.PlaySound(m_Mobile.GetIdleSound());

					m_Mobile.Warmode = false;
					m_Mobile.Combatant = null;
					break;

				case OrderType.Transfer:
					m_Mobile.ControlMaster.RevealingAction();
					m_Mobile.CurrentSpeed = m_Mobile.PassiveSpeed;
					m_Mobile.PlaySound(m_Mobile.GetIdleSound());

					m_Mobile.Warmode = false;
					m_Mobile.Combatant = null;
					break;
			}
		}