Inheritance: MagerySpell
示例#1
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;
        }
		public override bool Think()
		{
			if (m_Mobile.Deleted)
			{
				return false;
			}

			Mobile combatant = m_Guard.Combatant;

			if (combatant == null || combatant.Deleted || !combatant.Alive || combatant.IsDeadBondedPet ||
				!m_Mobile.CanSee(combatant) || !m_Mobile.CanBeHarmful(combatant, false) || combatant.Map != m_Mobile.Map)
			{
				// Our combatant is deleted, dead, hidden, or we cannot hurt them
				// Try to find another combatant
				if (AcquireFocusMob(m_Mobile.RangePerception, m_Mobile.FightMode, false, false, true))
				{
					m_Mobile.Combatant = combatant = m_Mobile.FocusMob;
					m_Mobile.FocusMob = null;
				}
				else
				{
					m_Mobile.Combatant = combatant = null;
				}
			}

			if (combatant != null && (!m_Mobile.InLOS(combatant) || !m_Mobile.InRange(combatant, 12)))
			{
				if (AcquireFocusMob(m_Mobile.RangePerception, m_Mobile.FightMode, false, false, true))
				{
					m_Mobile.Combatant = combatant = m_Mobile.FocusMob;
					m_Mobile.FocusMob = null;
				}
				else if (!m_Mobile.InRange(combatant, 36))
				{
					m_Mobile.Combatant = combatant = null;
				}
			}

			Mobile dispelTarget = FindDispelTarget(true);

			if (m_Guard.Target != null && m_ReleaseTarget == DateTime.MinValue)
			{
				m_ReleaseTarget = DateTime.UtcNow + TimeSpan.FromSeconds(10.0);
			}

			if (m_Guard.Target != null && DateTime.UtcNow > m_ReleaseTarget)
			{
				Target targ = m_Guard.Target;

				Mobile toHarm = (dispelTarget == null ? combatant : dispelTarget);

				if ((targ.Flags & TargetFlags.Harmful) != 0 && toHarm != null)
				{
					if (m_Guard.Map == toHarm.Map && (targ.Range < 0 || m_Guard.InRange(toHarm, targ.Range)) && m_Guard.CanSee(toHarm) &&
						m_Guard.InLOS(toHarm))
					{
						targ.Invoke(m_Guard, toHarm);
					}
					else if (targ is DispelSpell.InternalTarget)
					{
						targ.Cancel(m_Guard, TargetCancelType.Canceled);
					}
				}
				else if ((targ.Flags & TargetFlags.Beneficial) != 0)
				{
					targ.Invoke(m_Guard, m_Guard);
				}
				else
				{
					targ.Cancel(m_Guard, TargetCancelType.Canceled);
				}

				m_ReleaseTarget = DateTime.MinValue;
			}

			if (dispelTarget != null)
			{
				if (Action != ActionType.Combat)
				{
					Action = ActionType.Combat;
				}

				m_Guard.Warmode = true;

				RunFrom(dispelTarget);
			}
			else if (combatant != null)
			{
				if (Action != ActionType.Combat)
				{
					Action = ActionType.Combat;
				}

				m_Guard.Warmode = true;

				RunTo(combatant);
			}
			else if (m_Guard.Orders.Movement != MovementType.Stand)
			{
				Mobile toFollow = null;

				if (m_Guard.Town != null && m_Guard.Orders.Movement == MovementType.Follow)
				{
					toFollow = m_Guard.Orders.Follow;

					if (toFollow == null)
					{
						toFollow = m_Guard.Town.Sheriff;
					}
				}

				if (toFollow != null && toFollow.Map == m_Guard.Map && toFollow.InRange(m_Guard, m_Guard.RangePerception * 3) &&
					Town.FromRegion(toFollow.Region) == m_Guard.Town)
				{
					if (Action != ActionType.Combat)
					{
						Action = ActionType.Combat;
					}

					if (m_Mobile.CurrentSpeed != m_Mobile.ActiveSpeed)
					{
						m_Mobile.CurrentSpeed = m_Mobile.ActiveSpeed;
					}

					m_Guard.Warmode = true;

					RunTo(toFollow);
				}
				else
				{
					if (Action != ActionType.Wander)
					{
						Action = ActionType.Wander;
					}

					if (m_Mobile.CurrentSpeed != m_Mobile.PassiveSpeed)
					{
						m_Mobile.CurrentSpeed = m_Mobile.PassiveSpeed;
					}

					m_Guard.Warmode = false;

					WalkRandomInHome(2, 2, 1);
				}
			}
			else
			{
				if (Action != ActionType.Wander)
				{
					Action = ActionType.Wander;
				}

				m_Guard.Warmode = false;
			}

			if ((IsDamaged || IsPoisoned) && m_Guard.Skills.Healing.Base > 20.0)
			{
				TimeSpan ts = TimeUntilBandage;

				if (ts == TimeSpan.MaxValue)
				{
					StartBandage();
				}
			}

			if (m_Mobile.Spell == null && Core.TickCount >= m_Mobile.NextSpellTime)
			{
				Spell spell = null;

				DateTime toRelease = DateTime.MinValue;

				if (IsPoisoned)
				{
					Poison p = m_Guard.Poison;

					TimeSpan ts = TimeUntilBandage;

					if (p != Poison.Lesser || ts == TimeSpan.MaxValue || TimeUntilBandage < TimeSpan.FromSeconds(1.5) ||
						(m_Guard.HitsMax - m_Guard.Hits) > Utility.Random(250))
					{
						if (IsAllowed(GuardAI.Bless))
						{
							spell = new CureSpell(m_Guard, null);
						}
						else
						{
							UseItemByType(typeof(BaseCurePotion));
						}
					}
				}
				else if (IsDamaged && (m_Guard.HitsMax - m_Guard.Hits) > Utility.Random(200))
				{
					if (IsAllowed(GuardAI.Magic) && ((m_Guard.Hits * 100) / Math.Max(m_Guard.HitsMax, 1)) < 10 &&
						m_Guard.Home != Point3D.Zero && !Utility.InRange(m_Guard.Location, m_Guard.Home, 15) && m_Guard.Mana >= 11)
					{
						spell = new RecallSpell(m_Guard, null, new RunebookEntry(m_Guard.Home, m_Guard.Map, "Guard's Home", null), null);
					}
					else if (IsAllowed(GuardAI.Bless))
					{
						if (m_Guard.Mana >= 11 && (m_Guard.Hits + 30) < m_Guard.HitsMax)
						{
							spell = new GreaterHealSpell(m_Guard, null);
						}
						else if ((m_Guard.Hits + 10) < m_Guard.HitsMax &&
								 (m_Guard.Mana < 11 || (m_Guard.NextCombatTime - Core.TickCount) > 2000))
						{
							spell = new HealSpell(m_Guard, null);
						}
					}
					else if (m_Guard.CanBeginAction(typeof(BaseHealPotion)))
					{
						UseItemByType(typeof(BaseHealPotion));
					}
				}
				else if (dispelTarget != null && (IsAllowed(GuardAI.Magic) || IsAllowed(GuardAI.Bless) || IsAllowed(GuardAI.Curse)))
				{
					if (!dispelTarget.Paralyzed && m_Guard.Mana > (ManaReserve + 20) && 40 > Utility.Random(100))
					{
						spell = new ParalyzeSpell(m_Guard, null);
					}
					else
					{
						spell = new DispelSpell(m_Guard, null);
					}
				}

				if (combatant != null)
				{
					if (m_Combo != null)
					{
						if (spell == null)
						{
							spell = SpellCombo.Process(m_Guard, combatant, ref m_Combo, ref m_ComboIndex, ref toRelease);
						}
						else
						{
							m_Combo = null;
							m_ComboIndex = -1;
						}
					}
					else if (20 > Utility.Random(100) && IsAllowed(GuardAI.Magic))
					{
						if (80 > Utility.Random(100))
						{
							m_Combo = (IsAllowed(GuardAI.Smart) ? SpellCombo.Simple : SpellCombo.Strong);
							m_ComboIndex = -1;

							if (m_Guard.Mana >= (ManaReserve + m_Combo.Mana))
							{
								spell = SpellCombo.Process(m_Guard, combatant, ref m_Combo, ref m_ComboIndex, ref toRelease);
							}
							else
							{
								m_Combo = null;

								if (m_Guard.Mana >= (ManaReserve + 40))
								{
									spell = RandomOffenseSpell();
								}
							}
						}
						else if (m_Guard.Mana >= (ManaReserve + 40))
						{
							spell = RandomOffenseSpell();
						}
					}

					if (spell == null && 2 > Utility.Random(100) && m_Guard.Mana >= (ManaReserve + 10))
					{
						int strMod = GetStatMod(m_Guard, StatType.Str);
						int dexMod = GetStatMod(m_Guard, StatType.Dex);
						int intMod = GetStatMod(m_Guard, StatType.Int);

						var types = new List<Type>();

						if (strMod <= 0)
						{
							types.Add(typeof(StrengthSpell));
						}

						if (dexMod <= 0 && IsAllowed(GuardAI.Melee))
						{
							types.Add(typeof(AgilitySpell));
						}

						if (intMod <= 0 && IsAllowed(GuardAI.Magic))
						{
							types.Add(typeof(CunningSpell));
						}

						if (IsAllowed(GuardAI.Bless))
						{
							if (types.Count > 1)
							{
								spell = new BlessSpell(m_Guard, null);
							}
							else if (types.Count == 1)
							{
								spell = (Spell)Activator.CreateInstance(types[0], new object[] {m_Guard, null});
							}
						}
						else if (types.Count > 0)
						{
							if (types[0] == typeof(StrengthSpell))
							{
								UseItemByType(typeof(BaseStrengthPotion));
							}
							else if (types[0] == typeof(AgilitySpell))
							{
								UseItemByType(typeof(BaseAgilityPotion));
							}
						}
					}

					if (spell == null && 2 > Utility.Random(100) && m_Guard.Mana >= (ManaReserve + 10) && IsAllowed(GuardAI.Curse))
					{
						if (!combatant.Poisoned && 40 > Utility.Random(100))
						{
							spell = new PoisonSpell(m_Guard, null);
						}
						else
						{
							int strMod = GetStatMod(combatant, StatType.Str);
							int dexMod = GetStatMod(combatant, StatType.Dex);
							int intMod = GetStatMod(combatant, StatType.Int);

							var types = new List<Type>();

							if (strMod >= 0)
							{
								types.Add(typeof(WeakenSpell));
							}

							if (dexMod >= 0 && IsAllowed(GuardAI.Melee))
							{
								types.Add(typeof(ClumsySpell));
							}

							if (intMod >= 0 && IsAllowed(GuardAI.Magic))
							{
								types.Add(typeof(FeeblemindSpell));
							}

							if (types.Count > 1)
							{
								spell = new CurseSpell(m_Guard, null);
							}
							else if (types.Count == 1)
							{
								spell = (Spell)Activator.CreateInstance(types[0], new object[] {m_Guard, null});
							}
						}
					}
				}

				if (spell != null && (m_Guard.HitsMax - m_Guard.Hits + 10) > Utility.Random(100))
				{
					Type type = null;

					if (spell is GreaterHealSpell)
					{
						type = typeof(BaseHealPotion);
					}
					else if (spell is CureSpell)
					{
						type = typeof(BaseCurePotion);
					}
					else if (spell is StrengthSpell)
					{
						type = typeof(BaseStrengthPotion);
					}
					else if (spell is AgilitySpell)
					{
						type = typeof(BaseAgilityPotion);
					}

					if (type == typeof(BaseHealPotion) && !m_Guard.CanBeginAction(type))
					{
						type = null;
					}

					if (type != null && m_Guard.Target == null && UseItemByType(type))
					{
						if (spell is GreaterHealSpell)
						{
							if ((m_Guard.Hits + 30) > m_Guard.HitsMax && (m_Guard.Hits + 10) < m_Guard.HitsMax)
							{
								spell = new HealSpell(m_Guard, null);
							}
						}
						else
						{
							spell = null;
						}
					}
				}
				else if (spell == null && m_Guard.Stam < (m_Guard.StamMax / 3) && IsAllowed(GuardAI.Melee))
				{
					UseItemByType(typeof(BaseRefreshPotion));
				}

				if (spell == null || !spell.Cast())
				{
					EquipWeapon();
				}
			}
			else if (m_Mobile.Spell is Spell && ((Spell)m_Mobile.Spell).State == SpellState.Sequencing)
			{
				EquipWeapon();
			}

			return true;
		}
示例#3
0
文件: Bless.cs 项目: Crome696/ServUO
 public InternalTarget(BlessSpell owner)
     : base(Core.ML ? 10 : 12, false, TargetFlags.Beneficial)
 {
     this.m_Owner = owner;
 }
示例#4
0
 public InternalTarget( BlessSpell owner )
     : base(12, false, TargetFlags.Beneficial)
 {
     m_Owner = owner;
 }
示例#5
0
文件: MageAI.cs 项目: guy489/runuot2a
        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 );

                        break;
                    }
                    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();
                        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;

            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;
        }
示例#6
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;
        }
示例#7
0
 public InternalSphereTarget(BlessSpell owner)
     : base(Core.ML ? 10 : 12, false, TargetFlags.Beneficial)
 {
     m_Owner = owner;
     m_Owner.Caster.SendAsciiMessage("Selecione o alvo...");
 }
示例#8
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)
                spell = new ManaDrainSpell(this.m_Mobile, null);

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

                        if (!c.Poisoned)
                            spell = new BloodOathSpell(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: // 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;
                    }
            }

            return spell;
        }
示例#9
0
 public InternalTarget(BlessSpell owner)
     : base(Core.ML ? 10 : 12, false, TargetFlags.Beneficial)
 {
     this.m_Owner = owner;
 }
示例#10
0
文件: Bless.cs 项目: ygtkms/ServUO
 public InternalTarget(BlessSpell owner)
     : base(10, false, TargetFlags.Beneficial)
 {
     m_Owner = owner;
 }
示例#11
0
 protected override void OnTick()
 {
     BlessSpell.RemoveBless(Mobile);
 }
示例#12
0
        public override Spell ChooseSpell( Mobile c )
        {
            Spell 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 );

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

                        if ( Utility.RandomBool() && !ArcaneEmpowermentSpell.IsBuffed( m_Mobile ) )
                            spell = new ArcaneEmpowermentSpell( m_Mobile, null );
                        else
                            spell = new BlessSpell( m_Mobile, null );

                        break;
                    }
                case 4: // Wildfire
                    {
                        m_Mobile.DebugSay( "Incendio!" );

                        spell = new WildfireSpell( m_Mobile, null );

                        break;
                    }
                case 5: // Reduce their cast speed
                    {
                        if ( c.InRange( m_Mobile.Location, 6 ) )
                        {
                            if ( m_Mobile.Skills[SkillName.Spellweaving].Value >= 90.0 )
                                spell = new EssenceOfWindSpell( m_Mobile, null );
                            else if ( c.InRange( m_Mobile.Location, 2 ) )
                                spell = new ThunderstormSpell( m_Mobile, null );
                        }

                        m_Mobile.DebugSay( "Attempting to reduce their cast speed" );

                        break;
                    }
                case 6: // Curse them.
                    {
                        m_Mobile.DebugSay( "Attempting to curse" );

                        spell = GetRandomCurseSpell( c );
                        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( c );
                        break;
                    }

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

                        spell = GetRandomDamageSpell( c );
                        break;
                    }
            }

            return spell;
        }
示例#13
0
 public InternalSphereTarget(BlessSpell owner)
     : base(Core.ML ? 10 : 12, false, TargetFlags.Beneficial)
 {
     m_Owner = owner;
     m_Owner.Caster.SendAsciiMessage("Select target...");
 }
示例#14
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;
        }
示例#15
0
			public InternalTarget(BlessSpell owner)
				: base(owner.Caster.EraML ? 10 : 12, false, TargetFlags.Beneficial)
			{
				m_Owner = owner;
			}