public AIControlMobileTarget( BaseAI ai, OrderType order ) : base( -1, false, TargetFlags.None )
		{
			m_List = new ArrayList();
			m_Order = order;

			AddAI( ai );
		}
Esempio n. 2
0
		public AIControlMobileTarget( BaseAI ai, OrderType order ) : base( -1, false, ( order == OrderType.Attack ? TargetFlags.Harmful : TargetFlags.None ) )
		{
			m_List = new List<BaseAI>();
			m_Order = order;

			AddAI( ai );
		}
Esempio n. 3
0
		public void AddAI( BaseAI ai )
		{
			if ( !m_List.Contains( ai ) )
			{
				m_List.Add( ai );
			}
		}
Esempio n. 4
0
        protected override void OnTarget( Mobile from, object target )
        {
            if( target is BaseCreature )
            {
                BaseCreature pet = (BaseCreature)target;
                m_ai = pet.AIObject;

                if( pet.Body.IsHuman )
                    from.SendMessage("The person looks at you in disgust.");
                else if( pet.ControlMaster != from )
                    from.SendMessage("That is not your pet.");
                else if( pet.Combatant != null && pet.InRange(pet.Combatant, 12) )
                    from.SendMessage("You cannot do that while your pet is fighting.");
                else if( pet.Controlled == true && pet.ControlMaster == from )
                {
                    if( Utility.Random(15) == 1 )
                    {
                        m_ai.DoMove(Direction.South);
                        m_ai.DoMove(Direction.South);
                        m_ai.DoMove(Direction.East);
                        m_ai.DoMove(Direction.South);
                        m_ai.NextMove = DateTime.Now;

                        from.SendMessage("Your pet shies away from the rope.");
                        pet.PlaySound(pet.GetAngerSound());
                    }
                    else
                    {
                        if( pet.Blessed == false )
                        {
                            pet.Blessed = true;
                            pet.CantWalk = true;
                            pet.ControlOrder = OrderType.Stay;
                            pet.Combatant = null;
                            pet.Loyalty = 85;

                            from.LocalOverheadMessage(MessageType.Regular, from.EmoteHue, false, "*attaches the rope to the animal*");
                            from.Backpack.ConsumeTotal(typeof(HitchingRope), 1);
                            from.SendMessage("Your pet has been hitched to the post.");
                        }
                    }
                }
            }
        }
Esempio n. 5
0
            public ResponseTimer(BaseCreature mobile, SpeechEventArgs p, BaseAI ai)
                : base(TimeSpan.FromSeconds(1))
            {
                e = p;
                m_Mobile = mobile;
                m_AI = ai;

                Priority = TimerPriority.OneSecond;
            }
Esempio n. 6
0
            public InteractTimer(BaseCreature mobile, BaseAI ai, Mobile from)
                : base(TimeSpan.FromSeconds(30.0))
            {
                m_Mobile = mobile;
                m_AI = ai;
                m_From = from;

                Priority = TimerPriority.OneSecond;
            }
Esempio n. 7
0
 public InternalTimer(BaseAI b, TimeSpan delay )
     : base(delay)
 {
     m_b = b;
      m_End = DateTime.Now + delay;
      Priority = TimerPriority.OneSecond;
 }
Esempio n. 8
0
			public InternalEntry(Mobile from, int number, int range, BaseCreature mobile, BaseAI ai, OrderType order)
				: base(number, range)
			{
				m_From = from;
				m_Mobile = mobile;
				m_AI = ai;
				m_Order = order;

				if (mobile.IsDeadPet &&
					(order == OrderType.Guard || order == OrderType.Attack || order == OrderType.Transfer || order == OrderType.Drop))
				{
					Enabled = false;
				}
			}
Esempio n. 9
0
		public  void ChangeAIType( AIType NewAI )
		{
			if ( m_AI != null )
				m_AI.m_Timer.Stop();

			if( ForcedAI != null )
			{
				m_AI = ForcedAI;
				return;
			}

			m_AI = null;

			switch ( NewAI )
			{
				case AIType.AI_Melee:
					m_AI = new MeleeAI(this);
					break;
				case AIType.AI_Animal:
					m_AI = new AnimalAI(this);
					break;
				case AIType.AI_Berserk:
					m_AI = new BerserkAI(this);
					break;
				case AIType.AI_Archer:
					m_AI = new ArcherAI(this);
					break;
				case AIType.AI_Healer:
					m_AI = new HealerAI(this);
					break;
				case AIType.AI_Vendor:
					m_AI = new VendorAI(this);
					break;
				case AIType.AI_Mage:
					m_AI = new MageAI(this);
					break;
				case AIType.AI_Predator:
					//m_AI = new PredatorAI(this);
					m_AI = new MeleeAI(this);
					break;
				case AIType.AI_Thief:
					m_AI = new ThiefAI(this);
					break;
			}
		}
Esempio n. 10
0
        public virtual void ChangeAIType(AIType NewAI)
        {
            if ( m_AI != null )
                m_AI.m_Timer.Stop();

            m_AI = null;

            if ( this is BaseFactionGuard )
            {
                m_AI = new FactionGuardAI( (BaseFactionGuard) this );
                return;
            }

            switch (NewAI)
            {
                case AIType.AI_Melee:
                    m_AI = new MeleeAI(this);
                    break;
                case AIType.AI_Animal:
                    m_AI = new AnimalAI(this);
                    break;
                case AIType.AI_Berserk:
                    m_AI = new BerserkAI(this);
                    break;
                case AIType.AI_Archer:
                    m_AI = new ArcherAI(this);
                    break;
                case AIType.AI_Healer:
                    m_AI = new HealerAI(this);
                    break;
                case AIType.AI_Vendor:
                    m_AI = new VendorAI(this);
                    break;
                case AIType.AI_Mage:
                    m_AI = new MageAI(this);
                    break;
                case AIType.AI_Predator:
                    //m_AI = new PredatorAI(this);
                    m_AI = new MeleeAI(this);
                    break;
                case AIType.AI_Thief:
                    m_AI = new ThiefAI(this);
                    break;
            }
        }
Esempio n. 11
0
		private void InitAI()
		{
			switch ( AI )
			{
				case AIType.AI_Melee:
					m_ForcedAI = new EvoMeleeAI( this, m_CanAttackPlayers );
					break;
				case AIType.AI_Berserk:
					m_ForcedAI = new EvoBerserkAI( this, m_CanAttackPlayers );
					break;
				case AIType.AI_Archer:
					m_ForcedAI = new EvoArcherAI( this, m_CanAttackPlayers );
					break;
				case AIType.AI_Mage:
					m_ForcedAI = new EvoMageAI( this, m_CanAttackPlayers );
					break;
				default:
					m_ForcedAI = null;
					break;
			}
			ChangeAIType( AI );
		}
Esempio n. 12
0
		public CombatTarget( BaseAI ai, BaseCreature bc )
			: base( 10, false, TargetFlags.None )
		{
			m_AI = ai;
			creature = bc;
		}
Esempio n. 13
0
        public void ChangeAIType(AIType NewAI)
        {
            if (m_AI != null)
            {
                m_AI.m_Timer.Stop();
            }

            if (ForcedAI != null)
            {
                m_AI = ForcedAI;
                return;
            }

            m_AI = null;

            switch (NewAI)
            {
                case AIType.AI_Melee:
                    m_AI = new MeleeAI(this);
                    break;
                case AIType.AI_Animal:
                    m_AI = new AnimalAI(this);
                    break;
                case AIType.AI_Berserk:
                    m_AI = new BerserkAI(this);
                    break;
                case AIType.AI_Archer:
                    m_AI = new ArcherAI(this);
                    break;
                case AIType.AI_Healer:
                    m_AI = new HealerAI(this);
                    break;
                case AIType.AI_Vendor:
                    m_AI = new VendorAI(this);
                    break;
                case AIType.AI_Mage:
                    m_AI = new MageAI(this);
                    break;
                case AIType.AI_Predator:
                    //m_AI = new PredatorAI(this);
                    m_AI = new MeleeAI(this);
                    break;
                case AIType.AI_Thief:
                    m_AI = new ThiefAI(this);
                    break;
                case AIType.AI_NecroMage:
                    m_AI = new NecroMageAI(this);
                    break;
                case AIType.AI_OrcScout:
                    m_AI = new OrcScoutAI(this);
                    break;
                case AIType.AI_Samurai:
                    m_AI = new SamuraiAI(this);
                    break;
                case AIType.AI_Ninja:
                    m_AI = new NinjaAI(this);
                    break;
                case AIType.AI_Spellweaving:
                    m_AI = new SpellweavingAI(this);
                    break;
                case AIType.AI_Mystic:
                    m_AI = new MysticAI(this);
                    break;
                case AIType.AI_Paladin:
                    m_AI = new PaladinAI(this);
                    break;
            }
        }
Esempio n. 14
0
 public void AddAI(BaseAI ai)
 {
     if (!this.m_List.Contains(ai))
         this.m_List.Add(ai);
 }
Esempio n. 15
0
            public AITimer( BaseAI owner )
                : base(TimeSpan.FromSeconds( Utility.RandomDouble() ), TimeSpan.FromSeconds( Math.Max( 0.0, owner.m_Mobile.CurrentSpeed ) ))
            {
                m_Owner = owner;

                if ( Delay > m_Owner.m_Mobile.ReaquireDelay )
                    Delay = m_Owner.m_Mobile.ReaquireDelay;

                if ( m_Owner.m_Mobile.CurrentSpeed > 0.5 )
                    Priority = TimerPriority.FiftyMS;
                else if ( m_Owner.m_Mobile.CurrentSpeed > 0.25 )
                    Priority = TimerPriority.TwentyFiveMS;
                else
                    Priority = TimerPriority.TenMS;
            }
Esempio n. 16
0
		public virtual void ChangeAIType(AIType NewAI)
		{
			if ( m_AI != null )
				m_AI.m_Timer.Stop();

			if (ForcedAI != null)
			{
				m_AI = ForcedAI;
				return;
			}

			m_AI = null;

			switch (NewAI)
			{
				case AIType.AI_Melee:
					m_AI = new MeleeAI(this);
					break;
				case AIType.AI_Animal:
					m_AI = new AnimalAI(this);
					break;
				case AIType.AI_Berserk:
					m_AI = new BerserkAI(this);
					break;
				case AIType.AI_Archer:
					m_AI = new ArcherAI(this);
					break;
				case AIType.AI_Healer:
					m_AI = new HealerAI(this);
					break;
				case AIType.AI_Vendor:
					m_AI = new VendorAI(this);
					break;
				case AIType.AI_Mage:
					m_AI = new MageAI(this);
					break;
				case AIType.AI_HumanMage:
					m_AI = new HumanMageAI(this);
					break;
				case AIType.AI_Predator:
					m_AI = new MeleeAI(this);
					break;
				case AIType.AI_Thief:
					m_AI = new ThiefAI(this);
					break;
				case AIType.AI_Council:
					m_AI = new CouncilAI(this);
					break;
				case AIType.AI_CouncilMember:
					m_AI = new CouncilMemberAI(this);
					break;
				case AIType.AI_Suicide:
					m_AI = new SuicideAI(this);
					break;
				case AIType.AI_Genie:
					m_AI = new GenieAI(this);
					break;
				case AIType.AI_BaseHybrid:
					m_AI = new BaseHybridAI(this);
					break;
				case AIType.AI_Vamp:
					m_AI = new VampireAI(this);
					break;
                case AIType.AI_Chicken:
                    m_AI = new ChickenAI(this);
                    break;
                case AIType.AI_Dragon:
                    m_AI = new DragonAI(this);
                    break;
				case AIType.AI_Hybrid:
					m_AI = new HybridAI(this);
					break;
			}
		}
Esempio n. 17
0
        public void ChangeAIType(AIType NewAI)
        {
            if (this.m_AI != null)
                this.m_AI.m_Timer.Stop();

            if (this.ForcedAI != null)
            {
                this.m_AI = this.ForcedAI;
                return;
            }

            this.m_AI = null;

            switch ( NewAI )
            {
                case AIType.AI_Melee:
                    this.m_AI = new MeleeAI(this);
                    break;
                case AIType.AI_Animal:
                    this.m_AI = new AnimalAI(this);
                    break;
                case AIType.AI_Berserk:
                    this.m_AI = new BerserkAI(this);
                    break;
                case AIType.AI_Archer:
                    this.m_AI = new ArcherAI(this);
                    break;
                case AIType.AI_Healer:
                    this.m_AI = new HealerAI(this);
                    break;
                case AIType.AI_Vendor:
                    this.m_AI = new VendorAI(this);
                    break;
                case AIType.AI_Mage:
                    this.m_AI = new MageAI(this);
                    break;
                case AIType.AI_Predator:
                    //m_AI = new PredatorAI(this);
                    this.m_AI = new MeleeAI(this);
                    break;
                case AIType.AI_Thief:
                    this.m_AI = new ThiefAI(this);
                    break;
                case AIType.AI_NecroMage:
                    this.m_AI = new NecroMageAI(this);
                    break;
                case AIType.AI_OrcScout:
                    this.m_AI = new OrcScoutAI(this);
                    break;
                case AIType.AI_Spellbinder:
                    this.m_AI = new SpellbinderAI(this);
                    break;
            }
        }
Esempio n. 18
0
 public InternalEntry(Mobile from, int number, int range, BaseCreature mobile, BaseAI ai, OrderType order)
     : base(number, range)
 {
     m_From = from;
     m_Mobile = mobile;
     m_AI = ai;
     m_Order = order;
 }
Esempio n. 19
0
		public override void OnResponse( NetState state, RelayInfo info )
		{
			Mobile from = state.Mobile;
			BaseCreature toMobile = m_to;

			if( toMobile.Alive )
			{
				m_ai = toMobile.AIObject;

				if( m_ai == null )
				{
					from.SendMessage( "Mobile AI is null or unavailable. Unable to process with this item." );
					return;
				}

				toMobile.CantWalk = false;

				m_ai.NextMove = DateTime.Now + TimeSpan.FromSeconds( 60 );
				DateTime delay = DateTime.Now + TimeSpan.FromSeconds( 60 );

				if( info.ButtonID == 0 )
				{
					from.SendMessage( "You finish controlling " + toMobile.Name );
					m_ai.NextMove = DateTime.Now;
				}

				if( info.ButtonID == 1 )
				{
					m_ai.NextMove = DateTime.Now;
					m_ai.DoMove( Direction.North );
					m_ai.NextMove = delay;
					from.SendGump( new CreatureControl( toMobile, from ) );
				}

				if( info.ButtonID == 2 )
				{
					m_ai.NextMove = DateTime.Now;
					m_ai.DoMove( Direction.East );
					m_ai.NextMove = delay;
					from.SendGump( new CreatureControl( toMobile, from ) );
				}

				if( info.ButtonID == 3 )
				{
					m_ai.NextMove = DateTime.Now;
					m_ai.DoMove( Direction.South );
					m_ai.NextMove = delay;
					from.SendGump( new CreatureControl( toMobile, from ) );
				}

				if( info.ButtonID == 4 )
				{
					m_ai.NextMove = DateTime.Now;
					m_ai.DoMove( Direction.West );
					m_ai.NextMove = delay;
					from.SendGump( new CreatureControl( toMobile, from ) );
				}

				if( info.ButtonID == 5 )
				{
					m_ai.NextMove = DateTime.Now;
					m_ai.DoMove( Direction.Up );
					m_ai.NextMove = delay;
					from.SendGump( new CreatureControl( toMobile, from ) );
				}

				if( info.ButtonID == 6 )
				{
					m_ai.NextMove = DateTime.Now;
					m_ai.DoMove( Direction.Right );
					m_ai.NextMove = delay;
					from.SendGump( new CreatureControl( toMobile, from ) );
				}

				if( info.ButtonID == 7 )
				{
					m_ai.NextMove = DateTime.Now;
					m_ai.DoMove( Direction.Down );
					m_ai.NextMove = delay;
					from.SendGump( new CreatureControl( toMobile, from ) );
				}

				if( info.ButtonID == 8 )
				{
					m_ai.NextMove = DateTime.Now;
					m_ai.DoMove( Direction.Left );
					m_ai.NextMove = delay;
					from.SendGump( new CreatureControl( toMobile, from ) );
				}

				if( info.ButtonID == 9 )
				{
					from.SendMessage( "Who would you like this creature to attack?" );
					from.Target = new CombatTarget( m_ai, toMobile );
				}
			}

		}
Esempio n. 20
0
		public  void ChangeAIType( AIType NewAI )
		{
			if ( m_AI != null )
				m_AI.m_Timer.Stop();

			if( ForcedAI != null )
			{
				m_AI = ForcedAI;
				return;
			}

			m_AI = null;

			   switch ( NewAI )
    				   {
				case AIType.AI_Melee:
					m_AI = new MeleeAI(this);
					break;
    				        case AIType.AI_Animal:
    				        m_AI = new AnimalAI(this);
    				        break;
                                        case AIType.AI_Berserk:
					m_AI = new BerserkAI(this); 
    				        break;  				        
                                        case AIType.AI_AnimalSkittish:
    				        m_AI = new AnimalSkittishAI(this);
    				        break;
    				       case AIType.AI_Archer:
    				        m_AI = new ArcherAI(this);
    				        break;
    				       case AIType.AI_Healer:
    				        m_AI = new HealerAI(this);
    				        break;
				        case AIType.AI_Vendor:
					m_AI = new VendorAI(this);
					break;
    				       case AIType.AI_Mage:
    				        m_AI = new MageAI(this);
    				        break;
    				       case AIType.AI_Necro:
    				        m_AI = new NecroAI(this);
    				        break;
    				       case AIType.AI_Necromage:
    				        m_AI = new NecromageAI(this);
    				        break;
    				       case AIType.AI_OrcScout:
    				        m_AI = new OrcScoutAI(this);
    				        break;
					case AIType.AI_Ninja:	
                              		m_AI = new NinjaAI(this);
                              		break;
    				       case AIType.AI_Paladin:
    				        m_AI = new PaladinAI(this);
    				        break;
				        case AIType.AI_Predator:
					//m_AI = new PredatorAI(this);
					m_AI = new MeleeAI(this);
    				        break;
    				       case AIType.AI_Thief:
    				        m_AI = new ThiefAI(this);
    				        break;
    				       case AIType.AI_Vampire:
    				        m_AI = new VampireAI(this);
    				        break;
    				   }
		}
Esempio n. 21
0
        public virtual void ChangeAIType( AIType NewAI )
        {
            if ( m_AI != null )
                m_AI.m_Timer.Stop();

            if ( ForcedAI != null )
            {
                m_AI = ForcedAI;
                return;
            }

            m_AI = null;

            if ( this is BaseFactionGuard )
            {
                m_AI = new FactionGuardAI( (BaseFactionGuard) this );
                return;
            }

            switch ( NewAI )
            {
                case AIType.AI_Melee:
                    m_AI = new MeleeAI( this );
                    break;
                case AIType.AI_Animal:
                    m_AI = new AnimalAI( this );
                    break;
                case AIType.AI_Berserk:
                    m_AI = new BerserkAI( this );
                    break;
                case AIType.AI_Archer:
                    m_AI = new ArcherAI( this );
                    break;
                case AIType.AI_Healer:
                    m_AI = new HealerAI( this );
                    break;
                case AIType.AI_Vendor:
                    m_AI = new VendorAI( this );
                    break;
                case AIType.AI_Mage:
                    m_AI = new MageAI( this );
                    break;
                case AIType.AI_Arcanist:
                    m_AI = new ArcanistAI( this );
                    break;
                case AIType.AI_Predator:
                    m_AI = new MeleeAI( this );
                    break;
                case AIType.AI_Thief:
                    m_AI = new ThiefAI( this );
                    break;
                case AIType.AI_Ninja:
                    m_AI = new NinjaAI( this );
                    break;
                case AIType.AI_Samurai:
                    m_AI = new SamuraiAI( this );
                    break;
                case AIType.AI_ChampionMelee:
                    m_AI = new ChampionMeleeAI( this );
                    break;
                case AIType.AI_BoneDemon:
                    m_AI = new BoneDemonAI( this );
                    break;
                case AIType.AI_BossMelee:
                    m_AI = new BossMeleeAI( this );
                    break;
                case AIType.AI_Necromancer:
                    m_AI = new NecromancerAI( this );
                    break;
                case AIType.AI_Mephitis:
                    m_AI = new MephitisAI( this );
                    break;
                case AIType.AI_OrcScout:
                    m_AI = new OrcScoutAI( this );
                    break;
                case AIType.AI_Mystic:
                    m_AI = new MysticAI( this );
                    break;
                case AIType.AI_Ambusher:
                    m_AI = new AmbusherAI( this );
                    break;
                case AIType.AI_WeakMage:
                    m_AI = new WeakMageAI( this );
                    break;
            }
        }
Esempio n. 22
0
			public AITimer(BaseAI owner)
				: base(TimeSpan.FromSeconds(Utility.RandomDouble()), TimeSpan.FromSeconds(Math.Max(0.0, owner.m_Mobile.CurrentSpeed)))
			{
				m_Owner = owner;

				//m_bDetectHidden = false;
				//m_NextDetectHidden = DateTime.Now;

				Priority = TimerPriority.FiftyMS;
			}
Esempio n. 23
0
        public void ChangeAIType( AIType NewAI )
        {
            if ( m_AI != null )
                m_AI.m_Timer.Stop();

            if( ForcedAI != null )
            {
                m_AI = ForcedAI;
                return;
            }

            m_AI = null;

            switch ( NewAI )
            {
                case AIType.AI_Melee:
                    m_AI = new MeleeAI(this);
                    break;
                case AIType.AI_Animal:
                    m_AI = new AnimalAI(this);
                    break;
                case AIType.AI_Berserk:
                    m_AI = new BerserkAI(this);
                    break;
                case AIType.AI_Archer:
                    m_AI = new ArcherAI(this);
                    break;
                case AIType.AI_Healer:
                    m_AI = new HealerAI(this);
                    break;
                case AIType.AI_Vendor:
                    m_AI = new VendorAI(this);
                    break;
                case AIType.AI_Mage:
                    m_AI = new MageAI(this);
                    break;
                case AIType.AI_Predator:
                    //m_AI = new PredatorAI(this);
                    m_AI = new MeleeAI(this);
                    break;
                case AIType.AI_Thief:
                    m_AI = new ThiefAI(this);
                    break;
            // >>> [2nd change of 2]
            // ERICA'S ORC SCOUT and NINJA
                case AIType.AI_OrcScout:
                    m_AI = new OrcScoutAI(this);
                        break;
                case AIType.AI_Ninja:
                    m_AI = new NinjaAI(this);
                    break;
            // PAPPA SMURF's Spellbinder
                case AIType.AI_Spellbinder:
                    m_AI = new SpellbinderAI(this);
                    break;
            // end 2nd
            }
        }
Esempio n. 24
0
		public void ChangeAIType(AIType NewAI)
		{
			if (m_AI != null)
				m_AI.m_Timer.Stop();

			if (ForcedAI != null)
			{
				m_AI = ForcedAI;
				return;
			}

			m_AI = null;

			switch (NewAI)
			{
				case AIType.AI_Melee:
					m_AI = new MeleeAI(this);
					break;
				case AIType.AI_Animal:
					m_AI = new AnimalAI(this);
					break;
				case AIType.AI_Berserk:
					m_AI = new BerserkAI(this);
					break;
				case AIType.AI_Archer:
					m_AI = new ArcherAI(this);
					break;
				case AIType.AI_Healer:
					m_AI = new HealerAI(this);
					break;
				case AIType.AI_Vendor:
					m_AI = new VendorAI(this);
					break;
				case AIType.AI_Mage:
					m_AI = new MageAI(this);
					break;
				case AIType.AI_Predator:
					//m_AI = new PredatorAI(this);
					m_AI = new MeleeAI(this);
					break;
				case AIType.AI_Thief:
					m_AI = new ThiefAI(this);
					break;
				#region Mondain's Legacy
				case AIType.AI_NecroMage:
					m_AI = new NecroMageAI(this);
					break;
				#endregion
				// >>>>>>>>>> ERICA'S ORC SCOUT
				case AIType.AI_OrcScout:
					m_AI = new OrcScoutAI(this);
					break;
				// PAPPA SMURF's Spellbinder
				case AIType.AI_Spellbinder:
					m_AI = new SpellbinderAI(this);
					break;
			}
		}
Esempio n. 25
0
        public override void OnAfterDelete()
        {
            if( m_AI != null )
            {
                if( m_AI.m_Timer != null )
                    m_AI.m_Timer.Stop();

                m_AI = null;
            }

            if( m_DeleteTimer != null )
            {
                m_DeleteTimer.Stop();
                m_DeleteTimer = null;
            }

            FocusMob = null;

            base.OnAfterDelete();
        }
Esempio n. 26
0
        public void ChangeAIType(AIType NewAI)
        {
            if (m_AI != null)
                m_AI.m_Timer.Stop();

            if (ForcedAI != null)
            {
                m_AI = ForcedAI;
                return;
            }

            m_AI = null;

            switch (NewAI)
            {
                case AIType.AI_Melee:
                    m_AI = new MeleeAI(this);
                    break;
                case AIType.AI_Animal:
                    m_AI = new AnimalAI(this);
                    break;
                case AIType.AI_Berserk:
                    m_AI = new BerserkAI(this);
                    break;
                case AIType.AI_Archer:
                    m_AI = new ArcherAI(this);
                    break;
                case AIType.AI_Healer:
                    m_AI = new HealerAI(this);
                    break;
                case AIType.AI_Vendor:
                    m_AI = new VendorAI(this);
                    break;
                case AIType.AI_Mage:
                    m_AI = new MageAI(this);
                    break;
                case AIType.AI_Predator:
                    //m_AI = new PredatorAI(this);
                    m_AI = new MeleeAI(this);
                    break;
                case AIType.AI_Thief:
                    m_AI = new ThiefAI(this);
                    break;
                // >>> [2nd change of 2]
                // ERICA'S ORC SCOUT and NINJA
                case AIType.AI_OrcScout:
                    m_AI = new OrcScoutAI(this);
                    break;
                case AIType.AI_Ninja:
                    m_AI = new NinjaAI(this);
                    break;
                // PAPPA SMURF's Spellbinder
                case AIType.AI_Spellbinder:
                    m_AI = new SpellbinderAI(this);
                    break;
                // end 2nd
                // Scriptiz : ajout de l'AI pour le POMI
                case AIType.AI_Pomi:
                    m_AI = new PomiAI(this);
                    break;
                //Myron : ajout de l'AI pour les gardes PNJ
                case AIType.AI_VivreGuard:
                    m_AI = new VivreGuardAI(this);
                    break;
                // Vinds : ajout de l'AI assassin
                case AIType.AI_Assassin:
                    m_AI = new AssassinAI(this);
                    break;
            }

        }
Esempio n. 27
0
		public override void OnAfterDelete()
		{
			if ( m_AI != null )
			{
				if ( m_AI.m_Timer != null )
					m_AI.m_Timer.Stop();

				m_AI = null;
			}

			if ( m_DeleteTimer != null )
			{
				m_DeleteTimer.Stop();
				m_DeleteTimer = null;
			}

			FocusMob = null;

			if ( IsAnimatedDead )
				Spells.Necromancy.AnimateDeadSpell.Unregister( m_SummonMaster, this );

			base.OnAfterDelete();
		}
Esempio n. 28
0
            public AITimer( BaseAI owner )
                : base(TimeSpan.FromSeconds( Utility.RandomDouble() ), TimeSpan.FromSeconds( Math.Max( 0.0, owner.m_Mobile.CurrentSpeed ) ))
            {
                m_Owner = owner;

                m_Owner.m_NextDetectHidden = DateTime.Now;
            }
Esempio n. 29
0
			public AITimer(BaseAI owner)
				: base(
					TimeSpan.FromSeconds(Utility.RandomDouble()), TimeSpan.FromSeconds(Math.Max(0.0, owner.m_Mobile.CurrentSpeed)))
			{
				m_Owner = owner;

				m_Owner.m_NextDetectHidden = Core.TickCount;

				Priority = TimerPriority.FiftyMS;
			}
Esempio n. 30
0
        public void ChangeAIType(AIType NewAI)
        {
            if (m_AI != null)
                m_AI.m_Timer.Stop();

            if (ForcedAI != null)
            {
                m_AI = ForcedAI;
                return;
            }

            m_AI = null;

            switch (NewAI)
            {
                case AIType.AI_Melee:
                    m_AI = new MeleeAI(this);
                    break;
                case AIType.AI_Animal:
                    m_AI = new AnimalAI(this);
                    break;
                case AIType.AI_Berserk:
                    m_AI = new BerserkAI(this);
                    break;
                case AIType.AI_Archer:
                    m_AI = new ArcherAI(this);
                    break;
                case AIType.AI_Healer:
                    m_AI = new HealerAI(this);
                    break;
                case AIType.AI_Vendor:
                    m_AI = new VendorAI(this);
                    break;
                case AIType.AI_Mage:
                    m_AI = new MageAI(this);
                    break;
                case AIType.AI_Predator:
                    //m_AI = new PredatorAI(this);
                    m_AI = new MeleeAI(this);
                    break;
                case AIType.AI_Thief:
                    m_AI = new ThiefAI(this);
                    break;
                #region Mondain's Legacy
                case AIType.AI_Necromage:
                    m_AI = new NecromageAI(this);
                    break;

                case AIType.AI_Ninja:
                    m_AI = new NinjaAI(this);
                    break;

                case AIType.AI_OmniAI:
                    m_AI = new OmniAI(this);
                    break;//////////////////////////////////////////

                case AIType.AI_FlyingMelee:
                    m_AI = new FlyingMeleeAI(this);
                    break;
                case AIType.AI_FlyingAnimal:
                    m_AI = new FlyingAnimalAI(this);
                    break;
                case AIType.AI_FlyingBerserk:
                    m_AI = new FlyingBerserkAI(this);
                    break;
                case AIType.AI_FlyingArcher:
                    m_AI = new FlyingArcherAI(this);
                    break;
                case AIType.AI_FlyingHealer:
                    m_AI = new FlyingHealerAI(this);
                    break;
                case AIType.AI_FlyingVendor:
                    m_AI = new FlyingVendorAI(this);
                    break;
                case AIType.AI_FlyingMage:
                    m_AI = new FlyingMageAI(this);
                    break;
                case AIType.AI_FlyingPredator:
                    //m_AI = new FlyingPredatorAI(this);
                    m_AI = new FlyingMeleeAI(this);
                    break;
                case AIType.AI_FlyingThief:
                    m_AI = new FlyingThiefAI(this);
                    break;
                #endregion
            }
        }