Inheritance: MagerySpell
Esempio n. 1
0
        public virtual Spell ChooseSpell( Mobile c )
        {
            if ( !SmartAI )
            {
                if ( !m_Mobile.Summoned && ScaleByMagery( HealChance ) > Utility.RandomDouble() )
                {
                    if ( m_Mobile.Hits < (m_Mobile.HitsMax - 50) )
                        return new GreaterHealSpell( m_Mobile, null );
                    else if ( m_Mobile.Hits < (m_Mobile.HitsMax - 10) )
                        return new HealSpell( m_Mobile, null );
                }

                return GetRandomDamageSpell();
            }

            Spell spell = null;

            int healChance = (m_Mobile.Hits == 0 ? m_Mobile.HitsMax : (m_Mobile.HitsMax / m_Mobile.Hits));

            if ( m_Mobile.Summoned )
                healChance = 0;

            switch ( Utility.Random( 4 + healChance ) )
            {
                default:
                case 0: // Heal ourself
                {
                    if ( !m_Mobile.Summoned )
                    {
                        if ( m_Mobile.Hits < (m_Mobile.HitsMax - 50) )
                            spell = new GreaterHealSpell( m_Mobile, null );
                        else if ( m_Mobile.Hits < (m_Mobile.HitsMax - 10) )
                            spell = new HealSpell( m_Mobile, null );
                    }

                    break;
                }
                case 1: // Poison them
                {
                    if ( !c.Poisoned )
                        spell = new PoisonSpell( m_Mobile, null );

                    break;
                }
                case 2: // Deal some damage
                {
                    spell = GetRandomDamageSpell();

                    break;
                }
                case 3: // Set up a combo
                {
                    if ( m_Mobile.Mana < 40 && m_Mobile.Mana > 15 )
                    {
                        if ( c.Paralyzed && !c.Poisoned )
                        {
                            m_Mobile.DebugSay( "I am going to meditate" );

                            m_Mobile.UseSkill( SkillName.Meditation );
                        }
                        else if ( !c.Poisoned )
                        {
                            spell = new ParalyzeSpell( m_Mobile, null );
                        }
                    }
                    else if ( m_Mobile.Mana > 60 )
                    {
                        if ( Utility.Random( 2 ) == 0 && !c.Paralyzed && !c.Frozen && !c.Poisoned )
                        {
                            m_Combo = 0;
                            spell = new ParalyzeSpell( m_Mobile, null );
                        }
                        else
                        {
                            m_Combo = 1;
                            spell = new ExplosionSpell( m_Mobile, null );
                        }
                    }

                    break;
                }
            }

            return spell;
        }
 public InternalSphereTarget(ExplosionSpell owner)
     : base(Core.ML ? 10 : 12, false, TargetFlags.Harmful)
 {
     m_Owner = owner;
     m_Owner.Caster.SendAsciiMessage("Select target...");
 }
Esempio n. 3
0
        public virtual Spell DoCombo(Mobile c)
        {
            Spell spell = null;

            if (m_Combo == 0)
            {
                spell = new ExplosionSpell(m_Mobile, null);
                ++m_Combo; // Move to next spell
            }
            else if (m_Combo == 1)
            {
                spell = new WeakenSpell(m_Mobile, null);
                ++m_Combo; // Move to next spell
            }
            else if (m_Combo == 2)
            {
                if (!c.Poisoned)
                    spell = new PoisonSpell(m_Mobile, null);
                else if (IsNecromancer)
                    spell = new StrangleSpell(m_Mobile, null);

                ++m_Combo; // Move to next spell
            }

            if (m_Combo == 3 && spell == null)
            {
                switch (Utility.Random(IsNecromancer ? 4 : 3))
                {
                    case 0:
                        {
                            if (c.Int < c.Dex)
                                spell = new FeeblemindSpell(m_Mobile, null);
                            else
                                spell = new ClumsySpell(m_Mobile, null);

                            ++m_Combo; // Move to next spell

                            break;
                        }
                    case 1:
                        {
                            spell = new EnergyBoltSpell(m_Mobile, null);
                            m_Combo = -1; // Reset combo state
                            break;
                        }
                    case 2:
                        {
                            spell = new FlameStrikeSpell(m_Mobile, null);
                            m_Combo = -1; // Reset combo state
                            break;
                        }
                    default:
                        {
                            spell = new PainSpikeSpell(m_Mobile, null);
                            m_Combo = -1; // Reset combo state
                            break;
                        }
                }
            }
            else if (m_Combo == 4 && spell == null)
            {
                spell = new MindBlastSpell(m_Mobile, null);
                m_Combo = -1;
            }

            return spell;
        }
Esempio n. 4
0
		public override Spell ChooseSpell(Mobile c)
		{

			if (c is PlayerMobile && SmartAI && (c.Spell is MagicTrapSpell || c.Spell is MagicArrowSpell))
			{
				m_EnemyCountersPara = true;
			}

			if (c.Int > 70 && m_Mobile.MagicDamageAbsorb <= 0 && m_Mobile.Mana > 20 && m_Mobile.Hits > 60 && m_Mobile.CanBeginAction(typeof(DefensiveSpell)))
			{
				Spell temp = c.Spell as Spell;

				if (temp == null || (temp != null && temp.IsCasting && (int)temp.Circle <= (int)SpellCircle.Fourth))
					return new MagicReflectSpell(m_Mobile, null);
			}

			if (c.Dex > 60 && m_Mobile.MeleeDamageAbsorb <= 0 && m_Mobile.Mana > 20 && m_Mobile.Hits > 30 && m_Mobile.CanBeginAction(typeof(DefensiveSpell)))
				return new ReactiveArmorSpell(m_Mobile, null);


			Spell spell = null;

			int healChance = (m_Mobile.Hits == 0 ? m_Mobile.HitsMax : (m_Mobile.HitsMax / m_Mobile.Hits));

			switch (Utility.Random(1 + healChance))
			{
				default:
				case 0: // Heal ourself
					{
						if (HealPotCount >= 1 && m_Mobile.Hits < (m_Mobile.HitsMax - 30))
							DrinkHeal(m_Mobile);
						else if (m_Mobile.Hits < (m_Mobile.HitsMax - 35) && m_Mobile.Hits >= 45)
							spell = new GreaterHealSpell(m_Mobile, null);
						else if (m_Mobile.Hits < (m_Mobile.HitsMax - 10))
							spell = new HealSpell(m_Mobile, null);
						break;
					}

				case 1: // Set up a combo
					{
						//para them and med up until we have mana for a dump
						if (m_Mobile.Mana < 85 && m_Mobile.Mana > 2)
						{
							m_RegainingMana = true;
							//if there low on life and we have the mana try an finish them		
							if (m_Mobile.Mana > 20 && c.Hits < 28)
								spell = new EnergyBoltSpell(m_Mobile, null);

							if (m_Mobile.Mana > 12 && c.Hits < 15)
								spell = new LightningSpell(m_Mobile, null);

							if (c.Paralyzed && !c.Poisoned)
							{
								if (c.Hits < 45 && m_Mobile.Mana > 40)
									spell = new ExplosionSpell(m_Mobile, null);

								if (c.Hits < 30)
									spell = new EnergyBoltSpell(m_Mobile, null);

								m_Mobile.DebugSay("I am going to meditate");

								m_Mobile.UseSkill(SkillName.Meditation);
							}
							else if (!c.Poisoned && m_EnemyCountersPara == false && m_Mobile.Mana > 40)
							{
								spell = new ParalyzeSpell(m_Mobile, null);
							}
							else
							{
								if (m_Mobile.InRange(c, 4))
									RunFrom(c);
								if (!m_Mobile.InRange(c, 6))
									RunTo(c, CanRun);

								//m_Mobile.UseSkill( SkillName.Meditation );

							}
						}

						if (m_Mobile.Mana > 85)
						{
							m_RegainingMana = false;
							Combo = 0;

						}

						break;
					}
			}

			return spell;
		}
Esempio n. 5
0
		public virtual Spell ChooseSpell( Mobile c )
		{
			if ( !SmartAI )
			{
				if ( !m_Mobile.Summoned && ScaleByHealing( HealChance ) > Utility.RandomDouble() )
				{
					switch( Utility.Random( 2 ) )
					{
						case 0:
							if ( m_Mobile.Hits < (m_Mobile.HitsMax - 50) )
							{
								m_Mobile.UseSkill( SkillName.SpiritSpeak );
							}
							else if ( m_Mobile.Hits < (m_Mobile.HitsMax - 10) )
							{
								m_Mobile.UseSkill( SkillName.SpiritSpeak );
							}
						break;
						case 1:
							if ( m_Mobile.Hits < (m_Mobile.HitsMax - 50) )
							{
								return new GreaterHealSpell( m_Mobile, null );
							}
							else if ( m_Mobile.Hits < (m_Mobile.HitsMax - 10) )
							{
								return new HealSpell( m_Mobile, null );
							}
						break;
					}
				}

				return GetRandomDamageSpell();
			}

			Spell spell = null;

			int healChance = (m_Mobile.Hits == 0 ? m_Mobile.HitsMax : (m_Mobile.HitsMax / m_Mobile.Hits));

			if ( m_Mobile.Summoned )
				healChance = 0;

			switch ( Utility.Random( 6 + healChance ) )
			{
				default:
				case 0: // Heal ourself
				{
					if ( !m_Mobile.Summoned )
					{
						switch( Utility.Random( 2 ) )
						{
							case 0:
								if ( m_Mobile.Hits < (m_Mobile.HitsMax - 50) )
								{
									m_Mobile.UseSkill( SkillName.SpiritSpeak );
								}
								else if ( m_Mobile.Hits < (m_Mobile.HitsMax - 10) )
								{
									m_Mobile.UseSkill( SkillName.SpiritSpeak );
								}
							break;
							case 1:
								if ( m_Mobile.Hits < (m_Mobile.HitsMax - 50) )
								{
									return new GreaterHealSpell( m_Mobile, null );
								}
								else if ( m_Mobile.Hits < (m_Mobile.HitsMax - 10) )
								{
									return new HealSpell( m_Mobile, null );
								}
							break;
						}
					}

					break;
				}
				case 1: // Poison them
				{
					if ( !c.Poisoned )
						spell = new PoisonSpell( m_Mobile, null );

					break;
				}
				case 2: // PoisonStrike them
				{
					if ( !c.Poisoned )
						spell = new PoisonStrikeSpell( m_Mobile, null );

					break;
				}
				case 3: // Deal some damage
				{
					spell = GetRandomDamageSpell();

					break;
				}
				case 4: // Set up a combo
				{
					if ( m_Mobile.Mana < 40 && m_Mobile.Mana > 15 )
					{
						if ( c.Paralyzed && !c.Poisoned )
						{
							m_Mobile.DebugSay( "I am going to meditate" );

							m_Mobile.UseSkill( SkillName.Meditation );
						}
						else if ( !c.Poisoned )
						{
							spell = new ParalyzeSpell( m_Mobile, null );
						}
					}
					else if ( m_Mobile.Mana > 60 )
					{
						if ( Utility.Random( 4 ) == 0 && !c.Paralyzed && !c.Frozen && !c.Poisoned )
						{
							m_Combo = 0;
							spell = new ParalyzeSpell( m_Mobile, null );
						}
						else
						{
							m_Combo = 1;
							spell = new ExplosionSpell( m_Mobile, null );
						}
					}
					break;
				}
				case 5: //Combo to soften our enemies with a powerful attack while we have max mana amounts
				{
					if ( m_Mobile.Mana > 80 )
					{
						if ( Utility.Random( 2 ) == 0 && !c.Paralyzed && !c.Frozen && !c.Poisoned ) 
						{
							m_Combo = 0;
							spell = new VengefulSpiritSpell ( m_Mobile, null );
						}
						else
						{
							m_Combo = 0;
							spell = new ParalyzeSpell( m_Mobile, null );
						}
					}
				    break;
				}
			}

			return spell;
		}
Esempio n. 6
0
 public InternalTarget( ExplosionSpell owner )
     : base(Core.ML ? 10 : 12, false, TargetFlags.Harmful)
 {
     m_Owner = owner;
 }
        public virtual Spell DoCombo(Mobile c)
        {
            Spell spell = null;

            if ( m_Mobile.HitsMax > 0 && (m_Mobile.Hits / m_Mobile.HitsMax) < 0.1 && m_Mobile.Hits < 300 )
            {
                spell = CheckCastHealingSpell();
                m_Combo = -1;
                return spell;
            }
            if (m_Combo == 0)
            {
                spell = new ExplosionSpell(m_Mobile, null);
                m_Mobile.DebugSay( "Explosion" );
                ++m_Combo; // Move to next spell
            }
            else if (m_Combo == 1)
            {
                spell = new CorpseSkinSpell(m_Mobile, null);
                m_Mobile.DebugSay( "Corpse skin" );
                ++m_Combo; // Move to next spell
            }
            else if (m_Combo == 2)
            {
                if ( !c.Poisoned )
                {
                    spell = new PoisonSpell(m_Mobile, null);
                    m_Mobile.DebugSay( "Poison" );
                }
                else
                {
                    spell = new CurseSpell(m_Mobile, null);
                    m_Mobile.DebugSay( "Curse" );
                }

                ++m_Combo; // Move to next spell
            }
            else if (m_Combo == 3)
            {
                spell = new StrangleSpell(m_Mobile, null);
                m_Mobile.DebugSay( "Strangle" );
                ++m_Combo; // Move to next spell
            }
            else if (m_Combo == 4)
            {
                spell = new PainSpikeSpell(m_Mobile, null);
                m_Mobile.DebugSay( "pain spike" );
                ++m_Combo; // Move to next spell
            }
            else if (m_Combo == 7)
            {
                spell = new ExplosionSpell(m_Mobile, null);
                m_Mobile.DebugSay( "Explosion" );
                ++m_Combo; // Move to next spell
            }
            else if (m_Combo == 8)
            {
                if ( !c.Poisoned )
                {
                    spell = new PoisonSpell(m_Mobile, null);
                    m_Mobile.DebugSay( "Poison" );
                }
                else
                {
                    spell = new CurseSpell(m_Mobile, null);
                    m_Mobile.DebugSay( "Curse" );
                }

                ++m_Combo; // Move to next spell
            }
            else if (m_Combo == 9)
            {
                spell = new FlameStrikeSpell(m_Mobile, null);
                m_Mobile.DebugSay( "Flamestrike" );
                m_Combo = -1;
            }
            else if (m_Combo == 10)
            {
                spell = new StrangleSpell(m_Mobile, null);
                m_Mobile.DebugSay( "Strangle" );
                ++m_Combo; // Move to next spell
            }
            else if (m_Combo == 11)
            {
                spell = new CorpseSkinSpell(m_Mobile, null);
                m_Mobile.DebugSay( "Corpse skin" );
                ++m_Combo; // Move to next spell
            }
            else if (m_Combo == 12)
            {
                spell = new ExplosionSpell(m_Mobile, null);
                m_Mobile.DebugSay( "Explosion" );
                ++m_Combo; // Move to next spell
            }
            else if (m_Combo == 13)
            {
                spell = new PoisonStrikeSpell(m_Mobile, null);
                m_Mobile.DebugSay( "Poison strike" );
                ++m_Combo; // Move to next spell
            }
            else if (m_Combo == 14)
            {
                spell = new PoisonStrikeSpell(m_Mobile, null);
                m_Mobile.DebugSay( "Poison strike" );
                ++m_Combo; // Move to next spell
            }
            else if (m_Combo == 15)
            {
                spell = new PainSpikeSpell(m_Mobile, null);
                m_Mobile.DebugSay( "Pain spike" );
                m_Combo = -1;
            }
            if (m_Combo == 5 && spell == null)
            {
                switch (Utility.Random(3))
                {
                    default:
                    case 0:
                        {
                            spell = new ExplosionSpell(m_Mobile, null);
                            m_Mobile.DebugSay( "Explosion" );
                            break;
                        }
                    case 1:
                        {
                            spell = new PoisonStrikeSpell(m_Mobile, null);
                            m_Mobile.DebugSay( "Poison strike" );
                            break;
                        }
                    case 2:
                        {
                            spell = new FlameStrikeSpell(m_Mobile, null);
                            m_Mobile.DebugSay( "Flamestrike" );
                            ++m_Combo; // Move to next spell
                            break;
                        }
                }
            }
            else if (m_Combo == 6 && spell == null)
            {
                spell = new VengefulSpiritSpell(m_Mobile, null);
                m_Mobile.DebugSay( "Revenant" );
                m_Combo = -1;
            }

            return spell;
        }
Esempio n. 8
0
 public InternalSphereTarget(ExplosionSpell owner)
     : base(Core.ML ? 10 : 12, false, TargetFlags.Harmful)
 {
     m_Owner = owner;
     m_Owner.Caster.SendAsciiMessage("Selecione o alvo...");
 }
Esempio n. 9
0
		public virtual Spell DoCombo(Mobile c)
		{
			Spell spell = null;

			if (m_Combo == 0)
			{
				//m_Mobile.Say( "combo phase 0" );
				spell = new ExplosionSpell(m_Mobile, null);
				++m_Combo; // Move to next spell
			}
			else if (m_Combo == 1)
			{
				//m_Mobile.Say( "combo phase 1" );
				spell = new ExplosionSpell(m_Mobile, null);
				++m_Combo; // Move to next spell
			}
			else if (m_Combo == 2)
			{
				//m_Mobile.Say( "combo phase 2" );
				if (!c.Poisoned)
					spell = new PoisonSpell(m_Mobile, null);

				++m_Combo; // Move to next spell
			}

			else if (m_Combo == 3)
			{

				//m_Mobile.Say( "combo phase 3" );
				if (c.Poisoned)
					spell = new WeakenSpell(m_Mobile, null);

				if (!c.Poisoned)
					spell = new PoisonSpell(m_Mobile, null);

				++m_Combo; // Move to next spell
			}

			else if (m_Combo == 4)
			{
				//	m_Mobile.Say( "combo phase 4 ebolt" );
				spell = new EnergyBoltSpell(m_Mobile, null);

				++m_Combo; // Move to next spell
			}

			else if (m_Combo == 5)
			{
				//m_Mobile.Say( "combo phase 5" );
				if (c.Poisoned && c.Alive)
				{
					spell = new HarmSpell(m_Mobile, null);

					m_Combo = 5; // Move to next spell
				}

				if (!c.Poisoned)
				{
					if (m_Mobile.Mana > 20)
						spell = new EnergyBoltSpell(m_Mobile, null);

					if (m_Mobile.Mana < 19)
						spell = new LightningSpell(m_Mobile, null);
					m_Combo = -1; // Reset combo state
				}

			}

			return spell;
		}
Esempio n. 10
0
		public virtual Spell DoCombo( Mobile c )
		{
			Spell spell = null;

			if ( m_Combo == 0 )
			{
				spell = new ExplosionSpell( m_Mobile, null );
				++m_Combo; // Move to next spell
			}
			else if ( m_Combo == 1 )
			{
				spell = new WeakenSpell( m_Mobile, null );
				++m_Combo; // Move to next spell
			}
			else if ( m_Combo == 2 )
			{
				if ( !( ( m_Mobile is IEvoCreature || m_Mobile is EvolutionDragon ) && c is PlayerMobile ) && !c.Poisoned )
					spell = new PoisonSpell( m_Mobile, null );

				++m_Combo; // Move to next spell
			}

			if ( m_Combo == 3 && spell == null )
			{
				switch ( Utility.Random( 3 ) )
				{
					default:
					case 0:
					{
						if ( c.Int < c.Dex )
							spell = new FeeblemindSpell( m_Mobile, null );
						else
							spell = new ClumsySpell( m_Mobile, null );

						++m_Combo; // Move to next spell

						break;
					}
					case 1:
					{
						spell = new EnergyBoltSpell( m_Mobile, null );
						m_Combo = -1; // Reset combo state
						break;
					}
					case 2:
					{
						spell = new FlameStrikeSpell( m_Mobile, null );
						m_Combo = -1; // Reset combo state
						break;
					}
				}
			}
			else if ( m_Combo == 4 && spell == null )
			{
				spell = new MindBlastSpell( m_Mobile, null );
				m_Combo = -1;
			}

			return spell;
		}
Esempio n. 11
0
		public virtual Spell ChooseSpell(Mobile c)
		{
			if (!SmartAI)
			{
				if (!m_Mobile.Summoned && ScaleByMagery(HealChance) > Utility.RandomDouble())
				{
					if (m_Mobile.Hits < (m_Mobile.HitsMax - 50))
						return new GreaterHealSpell(m_Mobile, null);
					else if (m_Mobile.Hits < (m_Mobile.HitsMax - 10))
						return new HealSpell(m_Mobile, null);
				}

				return GetRandomDamageSpell();
			}

			if (c.Int > 70 && m_Mobile.CanBeginAction(typeof(DefensiveSpell)))
				return new MagicReflectSpell(m_Mobile, null);

			if (c.Dex > 60 && m_Mobile.CanBeginAction(typeof(DefensiveSpell)))
				return new ReactiveArmorSpell(m_Mobile, null);


			Spell spell = null;

			int healChance = (m_Mobile.Hits == 0 ? m_Mobile.HitsMax : (m_Mobile.HitsMax / m_Mobile.Hits));

			if (m_Mobile.Summoned)
				healChance = 0;

			switch (Utility.Random(1 + healChance))
			{
				default:
				case 0: // Heal ourself
					{
						if (!m_Mobile.Summoned)
						{
							if (m_Mobile.Hits < (m_Mobile.HitsMax - 50))
								spell = new GreaterHealSpell(m_Mobile, null);
							else if (m_Mobile.Hits < (m_Mobile.HitsMax - 10))
								spell = new HealSpell(m_Mobile, null);
						}

						break;
					}
				//case 1: // Poison them
				//{
				//	if ( !c.Poisoned )
				//		spell = new PoisonSpell( m_Mobile, null );
				//
				//	break;
				//	}
				//case 2: // Deal some damage
				//	{
				//		spell = GetRandomDamageSpell();
				//
				//		break;
				//	}
				case 1: // Set up a combo
					{
						if (m_Mobile.Mana < 50 && m_Mobile.Mana > 15)
						{
							if (c.Paralyzed && !c.Poisoned)
							{
								if (c.Hits < 45)
									spell = new ExplosionSpell(m_Mobile, null);

								if (c.Hits < 30)
									spell = new EnergyBoltSpell(m_Mobile, null);

								m_Mobile.DebugSay("I am going to meditate");

								m_Mobile.UseSkill(SkillName.Meditation);
							}
							else if (!c.Poisoned)
							{
								spell = new ParalyzeSpell(m_Mobile, null);
							}
						}
						else if (m_Mobile.Mana > 80)
						{

							m_Combo = 1;
							spell = new ExplosionSpell(m_Mobile, null);

						}

						break;
					}
			}

			return spell;
		}
Esempio n. 12
0
        public virtual Spell ChooseSpell( Mobile c )
        {
            Spell spell = null;

            if( !SmartAI )
            {
                spell = CheckCastHealingSpell();

                if( spell != null )
                    return spell;

                switch( Utility.Random(16) )
                {
                    case 0:
                        {
                            spell = new FireballSpell(m_Mobile, null);
                            break;
                        }
                    case 1:
                        {
                            m_Mobile.DebugSay("Protecting myself");

                            spell = new ProtectionSpell(m_Mobile, null);
                            break;
                        }
                    case 2:	// Poison them
                        {
                            m_Mobile.DebugSay("Attempting to poison");

                            if( !c.Poisoned )
                                spell = new PoisonSpell(m_Mobile, null);

                            break;
                        }
                    case 3:	// Bless ourselves.
                        {
                            m_Mobile.DebugSay("Blessing myself");

                            spell = new BlessSpell(m_Mobile, null);
                            break;
                        }
                    case 4:
                        {
                            m_Mobile.DebugSay("Summoning FIRE FIELD!!!");

                            spell = new FireFieldSpell(m_Mobile, null);
                            break;
                        }
                    case 5:
                    case 6: // Curse them.
                        {
                            m_Mobile.DebugSay("Attempting to curse");

                            spell = GetRandomCurseSpell();
                            break;
                        }
                    case 7:	// Paralyze them.
                        {
                            m_Mobile.DebugSay("Attempting to paralyze");

                            if( m_Mobile.Skills[SkillName.Magery].Value > 50.0 )
                                spell = new ParalyzeSpell(m_Mobile, null);

                            break;
                        }
                    case 8: // Drain mana
                        {
                            m_Mobile.DebugSay("Attempting to drain mana");

                            spell = GetRandomManaDrainSpell();
                            break;
                        }

                    default: // Damage them.
                        {
                            m_Mobile.DebugSay("Just doing damage");

                            spell = GetRandomDamageSpell();
                            break;
                        }
                }

                return spell;
            }

            spell = CheckCastHealingSpell();

            if( spell != null )
                return spell;

            if( !c.Poisoned && c.Spell != null && c.Mana > (c.ManaMax / 2) )
                return GetRandomManaDrainSpell();

            if( m_Mobile.Hits < (m_Mobile.HitsMax / 2) && 0.30 > Utility.RandomDouble() )
            {
                spell = new ProtectionSpell(m_Mobile, null);

                if( spell == null )
                    spell = new BlessSpell(m_Mobile, null);

                if( spell != null )
                    return spell;
            }

            if( c.Hits < (c.HitsMax * 0.30) ) //They're dying, set up a kill combo
            {
                m_Combo = 0;

                if( !c.Poisoned )
                    spell = new PoisonSpell(m_Mobile, null);
                else
                    spell = new ParalyzeSpell(m_Mobile, null);
            }

            switch( Utility.Random(10) )
            {
                default:
                case 0: // Deal some damage
                    {
                        spell = GetRandomDamageSpell();
                        break;
                    }
                case 1: // Poison them
                    {
                        if( !c.Poisoned )
                            spell = new PoisonSpell(m_Mobile, null);

                        break;
                    }
                case 2: // Set up a combo
                    {
                        if( m_Mobile.Mana < 40 && m_Mobile.Mana > 15 )
                        {
                            if( c.Paralyzed && !c.Poisoned )
                            {
                                m_Mobile.DebugSay("I am going to meditate");

                                m_Mobile.UseSkill(SkillName.Meditation);
                            }
                            else if( !c.Poisoned )
                            {
                                spell = new ParalyzeSpell(m_Mobile, null);
                            }
                        }
                        else if( m_Mobile.Mana > 60 )
                        {
                            if( Utility.Random(2) == 0 && !c.Paralyzed && !c.Frozen && !c.Poisoned )
                            {
                                m_Combo = 0;
                                spell = new ParalyzeSpell(m_Mobile, null);
                            }
                            else
                            {
                                m_Combo = 1;
                                spell = new ExplosionSpell(m_Mobile, null);
                            }
                        }

                        break;
                    }
                case 3:
                    {
                        spell = GetRandomCurseSpell();
                        break;
                    }
            }

            return spell;
        }
Esempio n. 13
0
		public override Spell DoCombo(Mobile c)
		{
			//m_Mobile.Say("doing human AI combo");
			if (c is PlayerMobile && SmartAI && (c.Spell is MagicTrapSpell || c.Spell is MagicArrowSpell))
			{
				m_EnemyCountersPara = true;
			}

			Spell spell = null;

			if (Combo == 0)
			{
				//m_Mobile.Say( "combo phase 1" );
				spell = new ExplosionSpell(m_Mobile, null);
				++Combo; // Move to next spell

			}

			if (Combo == 1)
			{
				//m_Mobile.Say( "combo phase 1" );
				spell = new ExplosionSpell(m_Mobile, null);
				++Combo; // Move to next spell

			}
			else if (Combo == 2)
			{
				//m_Mobile.Say( "combo phase 2" );
				if (!c.Poisoned && (CheckCanPoison(c)))
					spell = new PoisonSpell(m_Mobile, null);

				++Combo; // Move to next spell

			}

			else if (Combo == 3)
			{

				//m_Mobile.Say( "combo phase 3" );
				if (c.Poisoned || !CheckCanPoison(c))
					spell = new WeakenSpell(m_Mobile, null);

				if (!c.Poisoned && (CheckCanPoison(c)))
					spell = new PoisonSpell(m_Mobile, null);

				++Combo; // Move to next spell

			}

			else if (Combo == 4)
			{
				//	m_Mobile.Say( "combo phase 4 ebolt" );

				if (!c.Poisoned && (CheckCanPoison(c)))
				{
					spell = new PoisonSpell(m_Mobile, null);
					Combo = 4;
				}

				else
					spell = new EnergyBoltSpell(m_Mobile, null);

				++Combo; // Move to next spell

			}
			else if (Combo == 5)
			{
				//m_Mobile.Say( "combo phase 5" );
				if (c.Poisoned)
				{
					if (c.Hits < 20 && m_Mobile.Mana >= 20)
						spell = new EnergyBoltSpell(m_Mobile, null);

					else
						spell = new HarmSpell(m_Mobile, null);

					Combo = 5; // Move to next spell

				}

				if (!c.Poisoned)
				{
					if (m_Mobile.Mana > 20)
						spell = new EnergyBoltSpell(m_Mobile, null);

					if (m_Mobile.Mana < 19)
						spell = new LightningSpell(m_Mobile, null);
					Combo = -1; // Reset combo state

				}

			}

			return spell;
		}
Esempio n. 14
0
        public virtual Spell ChooseSpell(IDamageable d)
        {
            if (!(d is Mobile))
            {
                m_Mobile.DebugSay("Just doing damage");
                return GetRandomDamageSpell();
            }

            Mobile c = d as Mobile;
            Spell spell = null;

            if (!this.SmartAI)
            {
                spell = this.CheckCastHealingSpell();

                if (spell == null && m_Mobile.RawInt >= 80)
                    spell = CheckCastDispelField();

                if (spell != null)
                    return spell;

                int maxCircle = GetMaxCircle();

                switch (Utility.Random(15))
                {
                    case 0:
                    case 1:	// Poison them
                        {
                            if (c.Poisoned)
                                goto default;

                            this.m_Mobile.DebugSay("Attempting to poison");

                            spell = new PoisonSpell(this.m_Mobile, null);
                            break;
                        }
                    case 2:	// Bless ourselves
                        {
                            this.m_Mobile.DebugSay("Blessing myself");

                            spell = GetRandomBuffSpell();//new BlessSpell(this.m_Mobile, null);
                            break;
                        }
                    case 3:
                    case 4: // Curse them
                        {
                            this.m_Mobile.DebugSay("Attempting to curse");

                            spell = this.GetRandomCurseSpell();
                            break;
                        }
                    case 5:	// Paralyze them
                        {
                            this.m_Mobile.DebugSay("Attempting to paralyze");

                            if (maxCircle >= 5)
                                spell = new ParalyzeSpell(m_Mobile, null);
                            else
                                spell = GetRandomCurseSpell();
                            break;
                        }
                    case 6: // Drain mana
                        {
                            this.m_Mobile.DebugSay("Attempting to drain mana");

                            spell = this.GetRandomManaDrainSpell();
                            break;
                        }
                    default: // Damage them
                        {
                            this.m_Mobile.DebugSay("Just doing damage");

                            spell = this.GetRandomDamageSpell();
                            break;
                        }
                }

                return spell;
            }

            if (m_Mobile.Hidden)
                return null;

            spell = CheckCastDispelField();

            if (spell == null)
                spell = CheckCastHealingSpell();

            if (spell == null && 0.05 >= Utility.RandomDouble())
                spell = GetRandomBuffSpell();

            else if (spell == null && m_Mobile.Followers + 1 < m_Mobile.FollowersMax && 0.05 >= Utility.RandomDouble())
                spell = GetRandomSummonSpell();

            else if (spell == null && 0.05 >= Utility.RandomDouble())
                spell = GetRandomFieldSpell();

            else if (spell == null && 0.05 >= Utility.RandomDouble())
                spell = GetRandomManaDrainSpell();

            if (spell != null)
                return spell;

            switch( Utility.Random(3) )
            {
                case 0: // Poison them
                    {
                        if (c.Poisoned)
                            goto case 1;

                        spell = new PoisonSpell(this.m_Mobile, null);
                        break;
                    }
                case 1: // Deal some damage
                    {
                        spell = this.GetRandomDamageSpell();

                        break;
                    }
                default: // Set up a combo
                    {
                        if (this.m_Mobile.Mana > 15 && this.m_Mobile.Mana < 40)
                        {
                            if (c.Paralyzed && !c.Poisoned && !this.m_Mobile.Meditating)
                            {
                                this.m_Mobile.DebugSay("I am going to meditate");

                                this.m_Mobile.UseSkill(SkillName.Meditation);
                            }
                            else if (!c.Poisoned)
                            {
                                spell = new ParalyzeSpell(this.m_Mobile, null);
                            }
                        }
                        else if (this.m_Mobile.Mana > 60)
                        {
                            if (Utility.RandomBool() && !c.Paralyzed && !c.Frozen && !c.Poisoned)
                            {
                                this.m_Combo = 0;
                                spell = new ParalyzeSpell(this.m_Mobile, null);
                            }
                            else
                            {
                                this.m_Combo = 1;
                                spell = new ExplosionSpell(this.m_Mobile, null);
                            }
                        }

                        break;
                    }
            }

            return spell;
        }
        public virtual Spell ChooseSpell( Mobile c )
        {
            Spell spell = null;

            spell = CheckCastHealingSpell();

            if ( spell != null )
                return spell;

            switch (Utility.Random(5))
            {
                default:
                case 0: case 1: case 2: // Deal some damage
                    {
                        spell = GetRandomDamageSpell(c);
                        break;
                    }
                case 3: // Curse it
                    {
                        spell = GetRandomCurseSpell();
                        break;
                    }
                case 4: // Set up a combo of attacks
                    {
                        switch ( Utility.Random( 6 ) )
                        {
                            default: case  0:
                            {
                                m_Combo = 0;
                                spell = new PoisonSpell(m_Mobile, null);
                                m_Mobile.DebugSay( "Poison" );
                                break;
                            }
                            case  1:
                            {
                                m_Combo = 0;
                                spell = new EvilOmenSpell(m_Mobile, null);
                                m_Mobile.DebugSay( "Evil Omen" );
                                break;
                            }
                            case  2:
                            {
                                m_Combo = 7;
                                spell = new CorpseSkinSpell(m_Mobile, null);
                                m_Mobile.DebugSay( "Corpse Skin" );
                                break;
                            }
                            case  3:
                            {
                                m_Combo = 7;
                                spell = new CurseSpell(m_Mobile, null);
                                m_Mobile.DebugSay( "Curse" );
                                break;
                            }
                            case  4:
                            {
                                m_Combo = 10;
                                spell = new CurseSpell(m_Mobile, null);
                                m_Mobile.DebugSay( "Curse" );
                                break;
                            }
                            case  5:
                            {
                                m_Combo = 10;
                                spell = new ExplosionSpell(m_Mobile, null);
                                m_Mobile.DebugSay( "Explosion" );
                                break;
                            }
                        }
                        break;
                    }
            }

            return spell;
        }
Esempio n. 16
0
        public virtual Spell DoCombo(Mobile c)
        {
            Spell spell = null;

            if (m_ComboType == ComboType.None)
                m_ComboType = (ComboType)Utility.RandomMinMax(1, 7);

            if (m_Combo == 1)
            {
                switch (m_ComboType)
                {
                    case ComboType.Exp_FS_Poison:
                    case ComboType.Exp_MB_Poison:
                    case ComboType.Exp_EB_Poison:
                    case ComboType.Exp_FB_MA_Poison:
                    case ComboType.Exp_FB_Poison_Light:
                    case ComboType.Exp_FB_MA_Light:
                    case ComboType.Exp_Poison_FB_Light: spell = new ExplosionSpell(m_Mobile, null); break;
                }
            }
            else if (m_Combo == 2)
            {
                switch (m_ComboType)
                {
                    case ComboType.Exp_FS_Poison: spell = new FlameStrikeSpell(m_Mobile, null); break;
                    case ComboType.Exp_MB_Poison: spell = new MindBlastSpell(m_Mobile, null); break;
                    case ComboType.Exp_EB_Poison: spell = new EnergyBoltSpell(m_Mobile, null); break;
                    case ComboType.Exp_FB_MA_Poison: spell = new FireballSpell(m_Mobile, null); break;
                    case ComboType.Exp_FB_Poison_Light: spell = new FireballSpell(m_Mobile, null); break;
                    case ComboType.Exp_FB_MA_Light: spell = new FireballSpell(m_Mobile, null); break;
                    case ComboType.Exp_Poison_FB_Light: spell = new PoisonSpell(m_Mobile, null); break;
                }
            }
            else if (m_Combo == 3)
            {
                switch (m_ComboType)
                {
                    case ComboType.Exp_FS_Poison:
                    case ComboType.Exp_MB_Poison:
                    case ComboType.Exp_EB_Poison:
                        spell = new PoisonSpell(m_Mobile, null);
                        EndCombo();
                        return spell;
                    case ComboType.Exp_FB_MA_Poison: spell = new MagicArrowSpell(m_Mobile, null); break;
                    case ComboType.Exp_FB_Poison_Light: spell = new PoisonSpell(m_Mobile, null); break;
                    case ComboType.Exp_FB_MA_Light: spell = new MagicArrowSpell(m_Mobile, null); break;
                    case ComboType.Exp_Poison_FB_Light: spell = new FireballSpell(m_Mobile, null); break;
                }
            }
            else if (m_Combo == 4)
            {
                switch (m_ComboType)
                {
                    case ComboType.Exp_FS_Poison:
                    case ComboType.Exp_MB_Poison:
                    case ComboType.Exp_EB_Poison:
                        spell = new LightningSpell(m_Mobile, null);
                        EndCombo();
                        return spell;
                    case ComboType.Exp_FB_MA_Poison: spell = new PoisonSpell(m_Mobile, null); break;
                    case ComboType.Exp_FB_Poison_Light:
                    case ComboType.Exp_FB_MA_Light:
                    case ComboType.Exp_Poison_FB_Light: spell = new LightningSpell(m_Mobile, null);
                        EndCombo();
                        return spell;
                }
            }
            else if (m_Combo == 5)
            {
                switch (m_ComboType)
                {
                    case ComboType.Exp_FS_Poison:
                    case ComboType.Exp_MB_Poison:
                    case ComboType.Exp_EB_Poison:
                    case ComboType.Exp_FB_MA_Poison:
                    case ComboType.Exp_FB_Poison_Light:
                    case ComboType.Exp_FB_MA_Light:
                    case ComboType.Exp_Poison_FB_Light:
                        spell = new LightningSpell(m_Mobile, null);
                        EndCombo();
                        return spell;
                }
            }

            m_Combo++; // Move to next spell

            if (spell == null)
                spell = new PoisonSpell(m_Mobile, null);

            return spell;
        }
Esempio n. 17
0
        public virtual Spell DoCombo( Mobile c )
        {
            Spell spell = null;

            if ( m_Combo == 0 )
            {
                spell = new ExplosionSpell( m_Mobile, null );
                m_Combo = 4; // Move to next spell
            }

            if ( m_Combo == 3 && spell == null )
            {
                switch ( Utility.Random( 2 ) )
                {
                    default:
                    case 0:
                    {
                        spell = new EnergyBoltSpell( m_Mobile, null );
                        m_Combo = -1; // Reset combo state
                        break;
                    }
                    case 1:
                    {
                        spell = new FlameStrikeSpell( m_Mobile, null );
                        m_Combo = -1; // Reset combo state
                        break;
                    }
                }
            }
            else if ( m_Combo == 4 && spell == null )
            {
                spell = new MindBlastSpell( m_Mobile, null );
                m_Combo = -1;
            }

            return spell;
        }
Esempio n. 18
0
        public virtual Spell ChooseSpell( Mobile c )
        {
            Spell spell = null;

            if ( !SmartAI )
            {
                spell = CheckCastHealingSpell();

                if ( spell != null )
                    return spell;

                switch ( Utility.Random( 16 ) )
                {
                    case 0:
                    case 1:
                    case 2:	// Poison them
                    {
                        m_Mobile.DebugSay( "Attempting to poison" );

                        /*if ( !c.Poisoned )
                            spell = new PoisonSpell( m_Mobile, null );*/
                        goto default;
                    }
                    case 3:	// Bless ourselves.
                    /*
                    {
                        m_Mobile.DebugSay( "Blessing myself" );

                        spell = new BlessSpell( m_Mobile, null );
                        break;
                    }*/
                    case 4:
                    case 5:
                    case 6: // Curse them.
                    {
                        m_Mobile.DebugSay( "Attempting to curse" );

                        spell = GetRandomCurseSpell();
                        goto default;
                    }
                    case 7:	// Paralyze them.
                    {
                        /*m_Mobile.DebugSay( "Attempting to paralyze" );

                        if ( m_Mobile.Skills[SkillName.Magery].Value > 50.0 )
                            spell = new ParalyzeSpell( m_Mobile, null );*/
                        goto default;
                    }
                    case 8: // Drain mana
                    {
                        m_Mobile.DebugSay( "Attempting to drain mana" );

                        spell = GetRandomManaDrainSpell();
                        break;
                    }

                    default: // Damage them.
                    {
                        m_Mobile.DebugSay( "Just doing damage" );

                        spell = GetRandomDamageSpell();
                        break;
                    }
                }

                return spell;
            }

            spell = CheckCastHealingSpell();

            if ( spell != null )
                return spell;

            switch ( Utility.Random( 3 ) )
            {
                default:
                case 0: // Poison them
                {
                    /*if ( !c.Poisoned )
                        spell = new PoisonSpell( m_Mobile, null );*/

                    break;
                }
                case 1: // Deal some damage
                {
                    spell = GetRandomDamageSpell();

                    break;
                }
                case 2: // Set up a combo
                {
                    if ( m_Mobile.Mana < 40 && m_Mobile.Mana > 15 )
                    {
                        if ( c.Paralyzed && !c.Poisoned )
                        {
                            m_Mobile.DebugSay( "I am going to meditate" );

                            m_Mobile.UseSkill( SkillName.Meditation );
                        }
                        else if ( !c.Poisoned )
                        {
                            spell = new ParalyzeSpell( m_Mobile, null );
                        }
                    }
                    else if ( m_Mobile.Mana > 60 )
                    {
                        if ( Utility.Random( 2 ) == 0 && !c.Paralyzed && !c.Frozen && !c.Poisoned )
                        {
                            m_Combo = 0;
                            spell = new ParalyzeSpell( m_Mobile, null );
                        }
                        else
                        {
                            m_Combo = 1;
                            spell = new ExplosionSpell( m_Mobile, null );
                        }
                    }

                    break;
                }
            }

            return spell;
        }
Esempio n. 19
0
        public virtual Spell ChooseSpell( Mobile c )
        {
            Spell spell = null;

            if ( !SmartAI )
            {
                spell = CheckCastHealingSpell();

                if ( spell != null )
                    return spell;

                switch ( Utility.Random( 14 ) )
                {
                    case 0:
                    case 1:
                    case 2:
                    {
                        goto case 6;
                    }
                    case 3:
                    case 4:
                    case 5:
                    case 6:	// Paralyze them.
                    {
                        m_Mobile.DebugSay( "Attempting to paralyze" );

                        if ( m_Mobile.Skills[SkillName.Magery].Value > 50.0 )
                            spell = new ParalyzeSpell( m_Mobile, null );
                        goto default;
                    }
                    case 7: // Drain mana
                    {
                        m_Mobile.DebugSay( "Attempting to drain mana" );

                        spell = GetRandomManaDrainSpell();
                        break;
                    }
                    default: // Damage them.
                    {
                        m_Mobile.DebugSay( "Just doing damage" );

                        spell = GetRandomDamageSpell();
                        break;
                    }
                }

                return spell;
            }

            spell = CheckCastHealingSpell();

            if ( spell != null )
                return spell;

            switch ( Utility.Random( 2 ) )
            {
                default:
                case 0: // Deal some damage
                {
                    spell = GetRandomDamageSpell();

                    break;
                }
                case 1: // Set up a combo
                {
                    if ( m_Mobile.Mana < 40 && m_Mobile.Mana > 15 )
                    {
                        spell = new ParalyzeSpell( m_Mobile, null );
                    }
                    else if ( m_Mobile.Mana > 60 )
                    {
                        if ( Utility.Random( 2 ) == 0 && !c.Paralyzed && !c.Frozen && !c.Poisoned )
                        {
                            m_Combo = 0;
                            spell = new ParalyzeSpell( m_Mobile, null );
                        }
                        else
                        {
                            m_Combo = 3;
                            spell = new ExplosionSpell( m_Mobile, null );
                        }
                    }

                    break;
                }
            }

            return spell;
        }
Esempio n. 20
0
        public override Spell ChooseSpell( Mobile c )
        {
            Spell spell = null;

            spell = GetRandomBlessSpell();

            if ( spell != null )
                return spell;

            spell = CheckCastHealingSpell();

            if ( spell != null )
                return spell;

            switch ( Utility.Random( 12 ) )
            {
                default:
                case 0:
                case 1: // Curse them.
                    {
                        spell = GetRandomCurseSpell( c );

                        break;
                    }
                case 2: // Poison them
                    {
                        if ( !c.Poisoned )
                            spell = new PoisonSpell( m_Mobile, null );

                        break;
                    }
                case 3: // Drain some mana
                    {
                        spell = GetRandomManaDrainSpell( c );

                        break;
                    }
                case 4: // Animate dead
                    {
                        spell = new AnimateDeadSpell( m_Mobile, null );

                        break;
                    }
                case 5: // Vengeful spirit
                    {
                        spell = new VengefulSpiritSpell( m_Mobile, null );

                        break;
                    }
                case 6:
                case 7:
                case 8: // Deal some damage
                    {
                        spell = GetRandomDamageSpell( c );

                        break;
                    }
                case 9:
                case 10:
                case 11: // Set up a combo
                    {
                        if ( m_Mobile.Mana < 40 && m_Mobile.Mana > 15 )
                        {
                            if ( c.Paralyzed && !c.Poisoned )
                            {
                                m_Mobile.DebugSay( "I am going to meditate" );

                                m_Mobile.UseSkill( SkillName.Meditation );
                            }
                            else if ( !c.Poisoned )
                            {
                                spell = new ParalyzeSpell( m_Mobile, null );
                            }
                        }
                        else if ( m_Mobile.Mana > 60 )
                        {
                            if ( Utility.Random( 2 ) == 0 && !c.Paralyzed && !c.Frozen && !c.Poisoned )
                            {
                                m_Combo = 0;
                                spell = new ParalyzeSpell( m_Mobile, null );
                            }
                            else
                            {
                                m_Combo = 1;
                                spell = new ExplosionSpell( m_Mobile, null );
                            }
                        }

                        break;
                    }
            }

            return spell;
        }
Esempio n. 21
0
        public override Spell DoCombo(Mobile c)
        {
            Spell spell = null;

            if (m_NecroComboType == NecroComboType.None)
            {
                m_NecroComboType = (NecroComboType)Utility.RandomMinMax(1, 7);
                m_Combo = 0;
                m_Mobile.DebugSay("Doing {0} Combo", m_NecroComboType);
            }

            if (m_Combo == 0)
            {
                switch (m_NecroComboType)
                {
                    case NecroComboType.Exp_FS_Omen_Poison_PS:
                    case NecroComboType.Exp_MB_Omen_Poison_PS:
                    case NecroComboType.Exp_EB_Omen_Poison_PS:
                    case NecroComboType.Exp_FB_MA_Poison_PS:
                    case NecroComboType.Exp_FB_Poison_PS:
                    case NecroComboType.Exp_FB_MA_PS:
                    case NecroComboType.Exp_Poison_FB_PS: spell = new ExplosionSpell(m_Mobile, null); break;
                }

                ++m_Combo;
            }
            else if (m_Combo == 1)
            {
                switch (m_NecroComboType)
                {
                    case NecroComboType.Exp_FS_Omen_Poison_PS: spell = new FlameStrikeSpell(m_Mobile, null); break;
                    case NecroComboType.Exp_MB_Omen_Poison_PS: spell = new MindBlastSpell(m_Mobile, null); break;
                    case NecroComboType.Exp_EB_Omen_Poison_PS: spell = new EnergyBoltSpell(m_Mobile, null); break;
                    case NecroComboType.Exp_FB_MA_Poison_PS:
                    case NecroComboType.Exp_FB_Poison_PS:
                    case NecroComboType.Exp_FB_MA_PS: spell = new FireballSpell(m_Mobile, null); break;
                    case NecroComboType.Exp_Poison_FB_PS: spell = new PoisonSpell(m_Mobile, null); break;
                }

                ++m_Combo;
            }
            else if (m_Combo == 2)
            {
                switch (m_NecroComboType)
                {
                    case NecroComboType.Exp_FS_Omen_Poison_PS:
                    case NecroComboType.Exp_MB_Omen_Poison_PS:
                    case NecroComboType.Exp_EB_Omen_Poison_PS: spell = new EvilOmenSpell(m_Mobile, null); break;
                    case NecroComboType.Exp_FB_MA_Poison_PS: spell = new MagicArrowSpell(m_Mobile, null); break;
                    case NecroComboType.Exp_FB_Poison_PS: spell = new PoisonSpell(m_Mobile, null); break;
                    case NecroComboType.Exp_FB_MA_PS: spell = new MagicArrowSpell(m_Mobile, null); break;
                    case NecroComboType.Exp_Poison_FB_PS: spell = new FireballSpell(m_Mobile, null); break;
                }

                ++m_Combo;
            }
            else if (m_Combo == 3)
            {
                switch (m_NecroComboType)
                {
                    case NecroComboType.Exp_FS_Omen_Poison_PS:
                    case NecroComboType.Exp_MB_Omen_Poison_PS:
                    case NecroComboType.Exp_EB_Omen_Poison_PS:
                    case NecroComboType.Exp_FB_MA_Poison_PS:
                    case NecroComboType.Exp_FB_Poison_PS: spell = new PoisonSpell(m_Mobile, null); break;
                    case NecroComboType.Exp_FB_MA_PS:
                    case NecroComboType.Exp_Poison_FB_PS:
                        if (Utility.RandomBool())
                            spell = new PoisonStrikeSpell(m_Mobile, null);
                        else
                            spell = new PainSpikeSpell(m_Mobile, null);
                        EndCombo();
                        return spell;
                }

                ++m_Combo;
            }

            else if (m_Combo == 4)
            {
                switch (m_NecroComboType)
                {
                    case NecroComboType.Exp_FS_Omen_Poison_PS:
                    case NecroComboType.Exp_MB_Omen_Poison_PS:
                    case NecroComboType.Exp_EB_Omen_Poison_PS:
                    case NecroComboType.Exp_FB_MA_Poison_PS:
                    case NecroComboType.Exp_FB_Poison_PS:
                    case NecroComboType.Exp_FB_MA_PS:
                    case NecroComboType.Exp_Poison_FB_PS:
                        if (Utility.RandomBool())
                            spell = new PoisonStrikeSpell(m_Mobile, null);
                        else
                            spell = new PainSpikeSpell(m_Mobile, null);
                        EndCombo();
                        return spell;
                }
            }

            return spell;
        }
Esempio n. 22
0
        public virtual Spell ChooseSpell(Mobile c)
        {
            Spell spell = null;

            if (!SmartAI)
            {
                spell = CheckCastHealingSpell();

                if (spell != null)
                    return spell;

                if (IsNecromancer)
                {
                    double psDamage = ((m_Mobile.Skills[SkillName.SpiritSpeak].Value - c.Skills[SkillName.MagicResist].Value) / 10) + (c.Player ? 18 : 30);

                    if (psDamage > c.Hits)
                        return new PainSpikeSpell(m_Mobile, null);
                }

                switch (Utility.Random(16))
                {
                    case 0:
                    case 1:	// Poison them
                        {
                            if (c.Poisoned)
                                goto default;

                            m_Mobile.DebugSay("Attempting to poison");

                            spell = new PoisonSpell(m_Mobile, null);
                            break;
                        }
                    case 2:	// Bless ourselves
                        {
                            m_Mobile.DebugSay("Blessing myself");

                            spell = new BlessSpell(m_Mobile, null);
                            break;
                        }
                    case 3:
                    case 4: // Curse them
                        {
                            m_Mobile.DebugSay("Attempting to curse");

                            spell = GetRandomCurseSpell();
                            break;
                        }
                    case 5:	// Paralyze them
                        {
                            if (c.Paralyzed || m_Mobile.Skills[SkillName.Magery].Value <= 50.0)
                                goto default;

                            m_Mobile.DebugSay("Attempting to paralyze");

                            spell = new ParalyzeSpell(m_Mobile, null);
                            break;
                        }
                    case 6: // Drain mana
                        {
                            m_Mobile.DebugSay("Attempting to drain mana");

                            spell = GetRandomManaDrainSpell();
                            break;
                        }
                    case 7: // Invis ourselves
                        {
                            if (Utility.RandomBool())
                                goto default;

                            m_Mobile.DebugSay("Attempting to invis myself");

                            spell = new InvisibilitySpell(m_Mobile, null);
                            break;
                        }
                    default: // Damage them
                        {
                            m_Mobile.DebugSay("Just doing damage");

                            spell = GetRandomDamageSpell();
                            break;
                        }
                }

                return spell;
            }

            spell = CheckCastHealingSpell();

            if (spell != null)
                return spell;

            switch (Utility.Random(3))
            {
                case 0: // Poison them
                    {
                        if (c.Poisoned)
                            goto case 1;

                        spell = new PoisonSpell(m_Mobile, null);
                        break;
                    }
                case 1: // Deal some damage
                    {
                        spell = GetRandomDamageSpell();

                        break;
                    }
                default: // Set up a combo
                    {
                        if (m_Mobile.Mana > 15 && m_Mobile.Mana < 40)
                        {
                            if (c.Paralyzed && !c.Poisoned && !m_Mobile.Meditating)
                            {
                                m_Mobile.DebugSay("I am going to meditate");

                                m_Mobile.UseSkill(SkillName.Meditation);
                            }
                            else if (!c.Poisoned)
                            {
                                spell = new ParalyzeSpell(m_Mobile, null);
                            }
                        }
                        else if (m_Mobile.Mana > 60)
                        {
                            if (Utility.RandomBool() && !c.Paralyzed && !c.Frozen && !c.Poisoned)
                            {
                                m_Combo = 0;
                                spell = new ParalyzeSpell(m_Mobile, null);
                            }
                            else
                            {
                                m_Combo = 1;
                                spell = new ExplosionSpell(m_Mobile, null);
                            }
                        }

                        break;
                    }
            }

            return spell;
        }
Esempio n. 23
0
 public InternalTarget(ExplosionSpell owner) : base(owner.SpellRange, false, TargetFlags.Harmful)
 {
     m_Owner = owner;
 }
Esempio n. 24
0
 public InternalTarget(ExplosionSpell owner)
     : base(Core.ML ? 10 : 12, false, TargetFlags.Harmful)
 {
     m_Owner = owner;
 }
Esempio n. 25
0
		public virtual Spell ChooseSpell(Mobile c)
		{

			// tamable solution ---------------
			Mobile com = m_Mobile.Combatant;
			Spell spell = null;

			if (com != null && com is BaseCreature && DateTime.Now >= m_NextCouncilSpell)
			{
				if (CastRevelationWave())
				{
					m_Mobile.DebugSay("I'm gunna cast Revelation Wave!");
					m_NextCouncilSpell = DateTime.Now + TimeBetweenCouncilSpell;
					return new RevelationWaveSpell(m_Mobile, null);
				}

				if (CastPoisonWave())
				{
					m_Mobile.DebugSay("I'm gunna cast Poison Wave!");
					m_NextCouncilSpell = DateTime.Now + TimeBetweenCouncilSpell;
					return new PoisonWaveSpell(m_Mobile, null);
				}
			}
			// end tamable solution ---------------		

			if (!SmartAI)
			{
				if (!m_Mobile.Summoned && ScaleByMagery(HealChance) > Utility.RandomDouble())
				{
					if (m_Mobile.Hits < (m_Mobile.HitsMax - 50))
						return new GreaterHealSpell(m_Mobile, null);
					else if (m_Mobile.Hits < (m_Mobile.HitsMax - 10))
						return new HealSpell(m_Mobile, null);
				}

				return GetRandomDamageSpell();
			}

			int healChance = (m_Mobile.Hits == 0 ? m_Mobile.HitsMax : (m_Mobile.HitsMax / m_Mobile.Hits));

			if (m_Mobile.Summoned)
				healChance = 0;

			switch (Utility.Random(4 + healChance))
			{
				default:
				case 0: // Heal ourself
					{
						if (!m_Mobile.Summoned)
						{
							if (m_Mobile.Hits < (m_Mobile.HitsMax - 50))
								spell = new GreaterHealSpell(m_Mobile, null);
							else if (m_Mobile.Hits < (m_Mobile.HitsMax - 10))
								spell = new HealSpell(m_Mobile, null);
						}

						break;
					}
				case 1: // Poison them
					{
						if (!c.Poisoned)
							spell = new PoisonSpell(m_Mobile, null);

						break;
					}
				case 2: // Deal some damage
					{
						spell = GetRandomDamageSpell();

						break;
					}
				case 3: // Set up a combo
					{
						if (m_Mobile.Mana < 40 && m_Mobile.Mana > 15)
						{
							if (c.Paralyzed && !c.Poisoned)
							{
								m_Mobile.DebugSay("I am going to meditate");

								m_Mobile.UseSkill(SkillName.Meditation);
							}
							else if (!c.Poisoned)
							{
								spell = new ParalyzeSpell(m_Mobile, null);
							}
						}
						else if (m_Mobile.Mana > 60)
						{
							if (Utility.Random(2) == 0 && !c.Paralyzed && !c.Frozen && !c.Poisoned)
							{
								m_Combo = 0;
								spell = new ParalyzeSpell(m_Mobile, null);
							}
							else
							{
								m_Combo = 1;
								spell = new ExplosionSpell(m_Mobile, null);
							}
						}

						break;
					}
			}

			return spell;
		}