Exemplo n.º 1
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;
		}
Exemplo n.º 2
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;
        }
Exemplo n.º 3
0
        public virtual Spell ChooseSpell(Mobile c)
        {
            Spell spell = this.CheckCastHealingSpell();

            if (spell != null)
                return spell;
				
            double damage = ((this.m_Mobile.Skills[SkillName.SpiritSpeak].Value - c.Skills[SkillName.MagicResist].Value) / 10) + (c.Player ? 18 : 30);
			
            if (damage > c.Hits)
                return new PainSpikeSpell(this.m_Mobile, null);

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

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

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

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

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

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

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

                        spell = this.GetRandomManaDrainSpell();
                        break;
                    }
                case 9:
                case 10: // Blood oath them
                    {
                        this.m_Mobile.DebugSay("Attempting to blood oath");
										
                        if (this.m_Mobile.Skills[SkillName.Necromancy].Value > 30 && BloodOathSpell.GetBloodOath(c) != this.m_Mobile)
                            spell = new BloodOathSpell(this.m_Mobile, null);
						
                        break;
                    }
                case 11:
                case 12: // Animate dead
                    {
                        this.m_Mobile.DebugSay("Attempting to animate dead");

                        if ((this.m_Animated == null || !this.m_Animated.Alive) && this.m_Mobile.Skills[SkillName.Necromancy].Value > 40)
                            spell = new AnimateDeadSpell(this.m_Mobile, null);

                        break;
                    }
                case 13:
                case 14:
                    {
                        this.m_Mobile.DebugSay("Attempting to cast vengeful spirit");

                        if (this.m_Mobile.Skills[SkillName.Necromancy].Value > 80 && (this.m_Mobile.Followers + 3) < this.m_Mobile.FollowersMax)
                            spell = new VengefulSpiritSpell(this.m_Mobile, null);

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

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

            return spell;
        }
Exemplo n.º 4
0
 public InternalTarget(VengefulSpiritSpell owner)
     : base(10, false, TargetFlags.Harmful)
 {
     m_Owner = owner;
 }
Exemplo n.º 5
0
 public InternalTarget( VengefulSpiritSpell owner )
     : base(12, false, TargetFlags.Harmful)
 {
     m_Owner = owner;
 }
Exemplo n.º 6
0
        public virtual Spell DoCombo(Mobile c)
        {
            Spell spell = null;

            if (m_Combo == 0)
            {
                spell = new PoisonStrikeSpell(m_Mobile, null);
                ++m_Combo; // Move to next spell
            }
            else if (m_Combo == 1)
            {
                spell = new BloodOathSpell(m_Mobile, null);
                ++m_Combo; // Move to next spell
            }
            else if (m_Combo == 2)
            {
                if (!c.Poisoned)
                    spell = new MindRotSpell(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 StrangleSpell(m_Mobile, null);
                            else
                                spell = new EvilOmenSpell(m_Mobile, null);

                            ++m_Combo; // Move to next spell

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

            return spell;
        }
Exemplo n.º 7
0
 public InternalTarget(VengefulSpiritSpell owner)
     : base(Core.ML ? 10 : 12, false, TargetFlags.Harmful)
 {
     this.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;
        }
Exemplo n.º 9
0
 public InternalTarget(VengefulSpiritSpell owner)
     : base(Core.ML ? 10 : 12, false, TargetFlags.Harmful)
 {
     this.m_Owner = owner;
 }