Exemple #1
0
        // Reveal uses magery and detect hidden vs. hide and stealth
        private static bool CheckDifficulty(Mobile from, Mobile m)
        {
            // Reveal always reveals vs. invisibility spell
            if (!Core.AOS || InvisibilitySpell.HasTimer(m))
            {
                return(true);
            }

            int magery       = from.Skills[SkillName.Magery].Fixed;
            int detectHidden = from.Skills[SkillName.DetectHidden].Fixed;

            int hiding  = m.Skills[SkillName.Hiding].Fixed;
            int stealth = m.Skills[SkillName.Stealth].Fixed;
            int divisor = hiding /*+ stealth*/;

            int chance;

            if (divisor > 0)
            {
                chance = 50 * (magery + detectHidden) / divisor;
            }
            else
            {
                chance = 100;
            }

            return(chance > Utility.Random(100));
        }
Exemple #2
0
        // Reveal uses magery and detect hidden vs. hide and stealth
        private static bool CheckDifficulty(Mobile from, Mobile m)
        {
            // Reveal always reveals vs. invisibility spell
            if (!Core.AOS || InvisibilitySpell.HasTimer(m))
            {
                return(true);
            }

            var magery       = from.Skills.Magery.Fixed;
            var detectHidden = from.Skills.DetectHidden.Fixed;

            var hiding  = m.Skills.Hiding.Fixed;
            var stealth = m.Skills.Stealth.Fixed;
            var divisor = hiding + stealth;

            int chance;

            if (divisor > 0)
            {
                chance = 50 * (magery + detectHidden) / divisor;
            }
            else
            {
                chance = 100;
            }

            return(chance > Utility.Random(100));
        }
Exemple #3
0
 public InternalTarget( InvisibilitySpell owner )
     : base(12, false, TargetFlags.Beneficial)
 {
     m_Owner = owner;
 }
 public InternalTarget(InvisibilitySpell owner)
     : base(Core.ML ? 10 : 12, false, TargetFlags.Beneficial)
 {
     this.m_Owner = owner;
 }
Exemple #5
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;
        }
Exemple #6
0
 public InternalTarget(InvisibilitySpell owner) : base(12, false, TargetFlags.Beneficial)
 {
     m_Owner = owner;
 }
Exemple #7
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:	// Poison them
					{
							//m_Mobile.DebugSay( "Attempting to poison" );

						if ( !c.Poisoned )
							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 = GetRandomCurse();
						break;
					}
					case 5:	// 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 6: // Drain mana
					{
							//m_Mobile.DebugSay( "Attempting to drain mana" );

						spell = GetRandomManaDrainSpell();
						break;
					}
					case 7:
						{
							//m_Mobile.DebugSay( "Attempting to Invis" );

							if( spell == null )
							{
								spell = new InvisibilitySpell( m_Mobile, null );
							}

							break;
						}

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

							spell = GetRandomDamage();
						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;
		}
Exemple #8
0
		public bool ApplyInvisibilityEffect(PlayerMobile Wearer)
		{
			Spell spell = new InvisibilitySpell(Wearer,null); 

			if (Wearer == null)
				return false;
						
			if (Wearer.Hidden == true)
			{
				// player is already invisible...do nothing
				return false;
			}
			else if (Wearer.Region.OnBeginSpellCast( Wearer, spell ) == false)
			{
				Wearer.SendMessage("The magic normally within this object seems absent.");
				return false;
			}	
			else
			{
				// hide the player, set a timer to check for additional charges or reveal
				Wearer.Hidden = true;

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

				m_InvisTimer = new MagicEffectTimer (Wearer, this, TimeSpan.FromSeconds(120));

				m_InvisTimer.Start();
				return true;
			}
		}
 public InternalSphereTarget(InvisibilitySpell owner)
     : base(Core.ML ? 10 : 12, false, TargetFlags.Beneficial)
 {
     m_Owner = owner;
     m_Owner.Caster.SendAsciiMessage("Select target...");
 }
 public InternalSphereTarget(InvisibilitySpell owner)
     : base(Core.ML ? 10 : 12, false, TargetFlags.Beneficial)
 {
     m_Owner = owner;
     m_Owner.Caster.SendAsciiMessage("Selecione o alvo...");
 }
Exemple #11
0
 public InternalTarget(InvisibilitySpell owner)
     : base(Core.ML ? 10 : 12, false, TargetFlags.Beneficial)
 {
     this.m_Owner = owner;
 }