public override bool DoEffect(Mobile from, Mobile target)
        {
            if ( target.Alive && from.CanBeBeneficial( target ) && from.CanSee( target ) && from.InLOS( target ) )
            {
                from.DoBeneficial( target );
                SpellHelper.Turn( from, target );

                int toHeal = Utility.RandomMinMax( m_Min, m_Max );
                if ( from != target && from.NetState != null )
                    from.NetState.Send( new MessageLocalizedAffix( Serial.MinusOne, -1, MessageType.Label, 0x3B2, 3, 1008158, "", AffixType.Append | AffixType.System, (target.Hits+toHeal > target.HitsMax ? target.HitsMax - target.Hits : toHeal).ToString(), "" ) );
                target.Heal( toHeal );

                target.FixedParticles( 0x376A, 9, 32, 5030, EffectLayer.Waist );
                target.PlaySound( 0x202 );
                return true;
            }

            return false;
        }
Beispiel #2
0
        public void Target( Mobile m )
        {
            if ( !Caster.CanSee( m ) )
            {
                Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
            }
            else if ( m is BaseCreature && ((BaseCreature)m).IsAnimatedDead )
            {
                Caster.SendLocalizedMessage( 1061654 ); // You cannot heal that which is not alive.
            }
            else if ( m.IsDeadBondedPet )
            {
                Caster.SendLocalizedMessage( 1060177 ); // You cannot heal a creature that is already dead!
            }
            else if ( m.Poisoned || Server.Items.MortalStrike.IsWounded( m ) )
            {
                Caster.LocalOverheadMessage( MessageType.Regular, 0x22, (Caster == m) ? 1005000 : 1010398 );
            }
            else if ( CheckBSequence( m ) )
            {
                SpellHelper.Turn( Caster, m );

                // Algorithm: (40% of magery) + (1-10)

                int toHeal = (int)(Caster.Skills[SkillName.Magery].Value * 0.4);
                toHeal += Utility.Random( 1, 10 );

                m.Heal( toHeal );

                m.FixedParticles( 0x376A, 9, 32, 5030, EffectLayer.Waist );
                m.PlaySound( 0x202 );
            }

            FinishSequence();
        }
Beispiel #3
0
        public void Target( Mobile m )
        {
            if ( !Caster.CanSee( m ) )
            {
                Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
            }
            else if ( m is BaseCreature && ((BaseCreature)m).IsAnimatedDead )
            {
                Caster.SendLocalizedMessage( 1061654 ); // You cannot heal that which is not alive.
            }
            else if ( Server.Items.MortalStrike.IsWounded( m ) )
            {
                Caster.LocalOverheadMessage( MessageType.Regular, 0x22, (Caster == m) ? 1005000 : 1010398 );
            }
            /* // idea... dont allow lesser heal to heal through poison (but allow it on gheal)
            else if ( m.Poisoned || Server.Items.MortalStrike.IsWounded( m ) )
            {
                Caster.LocalOverheadMessage( MessageType.Regular, 0x22, (Caster == m) ? 1005000 : 1010398 ); // You cannot heal that target/yourself in their/your current state.
            }*/
            else if ( CheckBSequence( m ) )
            {
                SpellHelper.Turn( Caster, m );

                int toHeal = 1 + (int)( Utility.Random( 15 ) * Caster.Skills[SkillName.Magery].Value / 100.0 );
                if ( Caster != m && Caster.NetState != null )
                    Caster.NetState.Send( new MessageLocalizedAffix( Serial.MinusOne, -1, MessageType.Label, 0x3B2, 3, 1008158, "", AffixType.Append | AffixType.System, (m.Hits+toHeal > m.HitsMax ? m.HitsMax - m.Hits : toHeal).ToString(), "" ) );
                m.Heal( toHeal );

                m.FixedParticles( 0x376A, 9, 32, 5005, EffectLayer.Waist );
                m.PlaySound( 0x1F2 );
            }

            FinishSequence();
        }
        public void Target( Mobile m )
        {
            if ( !Caster.CanSee( m ) )
            {
                Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
            }
            else if ( m is BaseCreature && ((BaseCreature)m).IsAnimatedDead )
            {
                Caster.SendLocalizedMessage( 1061654 ); // You cannot heal that which is not alive.
            }
            else if ( Server.Items.MortalStrike.IsWounded( m ) )
            {
                Caster.LocalOverheadMessage( MessageType.Regular, 0x22, (Caster == m) ? 1005000 : 1010398 );
            }
            else if ( CheckBSequence( m ) )
            {
                SpellHelper.Turn( Caster, m );

                // Algorithm: (40% of magery) + (1-10)

                int toHeal = (int)(Caster.Skills[SkillName.Magery].Value * 0.4) + Utility.Random( 10 ) + 1;
                if ( Caster != m && Caster.NetState != null )
                    Caster.NetState.Send( new MessageLocalizedAffix( Serial.MinusOne, -1, MessageType.Label, 0x3B2, 3, 1008158, "", AffixType.Append | AffixType.System, (m.Hits+toHeal > m.HitsMax ? m.HitsMax - m.Hits : toHeal).ToString(), "" ) );
                m.Heal( toHeal );

                m.FixedParticles( 0x376A, 9, 32, 5030, EffectLayer.Waist );
                m.PlaySound( 0x202 );
            }

            FinishSequence();
        }
Beispiel #5
0
        public void DoHeal( Mobile from )
        {
            int min = Scale( from, MinHeal );
            int max = Scale( from, MaxHeal );

            from.Heal( Utility.RandomMinMax( min, max ) );
        }
        public void DoHeal(Mobile from)
        {
            int min = Scale(from, MinHeal);
            int max = Scale(from, MaxHeal);

            from.Heal(Utility.RandomMinMax(min, max) + (IntensifiedStrength ? 5 : 0));
        }
        public void DoHeal(Mobile from, double scalar)
        {
            int min = Scale(from, MinHeal - (int)Math.Floor(MinHeal * scalar));
            int max = Scale(from, MaxHeal - (int)Math.Floor(MaxHeal * scalar));

            from.Heal(Utility.RandomMinMax(min, max)+(IntensifiedStrength?5:0));
        }
Beispiel #8
0
		public override void OnDoubleClick( Mobile from )
		{
			if ( !from.InRange( this.GetWorldLocation(), 1 ) )
			{
				from.SendLocalizedMessage( 502138 ); // That is too far away for you to use
				return;
			}
			else if ( from != m_Caster )
			{
				// from.SendLocalizedMessage( ); // 
				return;
			}

			BaseWeapon weapon = from.FindItemOnLayer( Layer.OneHanded ) as BaseWeapon;

			if ( weapon == null )
				weapon = from.FindItemOnLayer( Layer.TwoHanded ) as BaseWeapon;

			if ( weapon != null )
			{
				from.SendLocalizedMessage( 1080116 ); // You must have a free hand to use a Healing Stone.
			}
			else if ( from.BeginAction( typeof( BaseHealPotion ) ) )
			{
				from.Heal( Utility.RandomMinMax( BasePotion.Scale( from, 13 ) , BasePotion.Scale( from, 16 ) ) );
				this.Consume();
				Timer.DelayCall( TimeSpan.FromSeconds( 8.0 ), new TimerStateCallback( ReleaseHealLock ), from );
			}
			else
				from.SendLocalizedMessage( 1095172 ); // You must wait a few seconds before using another Healing Stone.
		}
		public void DoHeal( Mobile from )
		{
			int min = Scale( from, MinHeal );
			int max = Scale( from, MaxHeal );

			int toHeal = Utility.RandomMinMax( min, max );

			int healmessage = Math.Min( from.HitsMax - from.Hits, toHeal );

			from.Heal( toHeal );

			if ( healmessage > 0 )
				from.PrivateOverheadMessage( MessageType.Regular, 0x42, false, healmessage.ToString(), from.NetState );
		}
Beispiel #10
0
		public void Target( Mobile m )
		{
			if ( !Caster.CanSee( m ) )
			{
				Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
			}
			else if ( m.IsDeadBondedPet )
			{
				Caster.SendLocalizedMessage( 1060177 ); // You cannot heal a creature that is already dead!
			}
			else if ( m is BaseCreature && ((BaseCreature)m).IsAnimatedDead )
			{
				Caster.SendLocalizedMessage( 1061654 ); // You cannot heal that which is not alive.
			}
			else if ( m is Golem )
			{
				Caster.LocalOverheadMessage( MessageType.Regular, 0x3B2, 500951 ); // You cannot heal that.
			}
			else if ( m.Poisoned || Server.Items.MortalStrike.IsWounded( m ) )
			{
				Caster.LocalOverheadMessage( MessageType.Regular, 0x22, (Caster == m) ? 1005000 : 1010398 );
			}
			else if ( CheckBSequence( m ) )
			{
				SpellHelper.Turn( Caster, m );

				int toHeal;

				if ( Core.AOS )
				{
					toHeal = Caster.Skills.Magery.Fixed / 120;
					toHeal += Utility.RandomMinMax( 1, 4 );

					if( Core.SE && Caster != m )
						toHeal = (int)(toHeal * 1.5);
				}
				else
				{
					toHeal = (int)(Caster.Skills[SkillName.Magery].Value * 0.1);
					toHeal += Utility.Random( 1, 5 );
				}

				m.Heal( toHeal );

				m.FixedParticles( 0x376A, 9, 32, 5005, EffectLayer.Waist );
				m.PlaySound( 0x1F2 );
			}

			FinishSequence();
		}
Beispiel #11
0
            protected override void OnTick()
            {
                if (m_Count >= (m_MaxCount + 1) || m_User == null || !m_User.Paralyzed)
                {
                    Stop();
                }

                if (m_Count == m_MaxCount)
                {
                    m_User.Heal((m_User.HitsMax / 2));
                    m_User.FixedParticles(0x376A, 9, 32, 5030, EffectLayer.Waist);
                    m_User.PlaySound(0x202);
                }

                m_Count++;
            }
Beispiel #12
0
            protected override void OnTick()
            {
                Random dmg = new Random();

                this.m_Damage = dmg.Next(25, 33);
                this.m_Count++;

                if (this.m_Count > this.m_MaxCount || this.m_Mobile == null)
                {
                    m_Mobile.SendLocalizedMessage(502136);                     // The poison seems to have worn off.
                    m_Mobile.Poison = null;
                    this.Stop();
                    return;
                }

                m_Mobile.LocalOverheadMessage(
                    MessageType.Emote, 0x3F, true, "* You feel extremely weak and are in severe pain *");

                m_Mobile.NonlocalOverheadMessage(
                    MessageType.Emote, 0x3F, true, String.Format("* {0} is wracked with extreme pain *", m_Mobile.Name));

                int toHeal = Math.Min(m_From.HitsMax - m_From.Hits, m_Damage);

                if (toHeal > 0)
                {
                    m_From.SendLocalizedMessage(1060203, toHeal.ToString(CultureInfo.InvariantCulture));
                    // You have had ~1_HEALED_AMOUNT~ hit points of damage healed.
                    m_From.Heal(toHeal, m_Mobile, false);
                }

                if (m_Mobile != null)
                {
                    AOS.Damage(m_Mobile, m_From, m_Damage, 0, 0, 0, 100, 0);
                }

                if (0.60 <= Utility.RandomDouble())
                // OSI: randomly revealed between first and third damage tick, guessing 60% chance
                {
                    m_Mobile.RevealingAction();
                }

                if ((m_Index % m_Poison.m_MessageInterval) == 0)
                {
                    m_Mobile.OnPoisoned(m_From, m_Poison, m_Poison);
                }
            }
        public static void LifeforceDrainAttack(Mobile from, Mobile target)
        {
            int toDrain = 6 + (int)((120 - target.Skills[SkillName.MagicResist].Value) / 10);

            target.FixedParticles(0x3789, 10, 25, 5032, EffectLayer.Head);
            target.PlaySound(0x1F8);

            target.SendLocalizedMessage(1070848);               // You feel your life force being stolen away!

            target.Damage(toDrain, from);

            from.FixedParticles(0x376A, 9, 32, 5030, EffectLayer.Waist);
            from.PlaySound(0x202);

            from.Heal(toDrain);

            from.DoHarmful(target);

            return;
        }
Beispiel #14
0
		public void Target( Mobile m )
		{
			if ( !Caster.CanSee( m ) )
			{
				Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
			}
			else if ( m is Golem )
			{
				Caster.LocalOverheadMessage( MessageType.Regular, 0x3B2, 500951 ); // You cannot heal that.
			}
			else if ( m.Poisoned || Server.Items.MortalStrike.IsWounded( m ) )
			{
				Caster.LocalOverheadMessage( MessageType.Regular, 0x22, (Caster == m) ? 1005000 : 1010398 );
			}
			else if ( CheckBSequence( m ) )
			{
				SpellHelper.Turn( Caster, m );

				// Algorithm: (10% of magery) + (1-5)

				int toHeal = (int)(Caster.Skills[SkillName.Magery].Value * 0.1);
				toHeal += Utility.Random( 1, 5 );

				int healmessage = Math.Min( m.HitsMax - m.Hits, toHeal );

				m.Heal( toHeal );

				if ( healmessage > 0 )
				{
					m.PrivateOverheadMessage( MessageType.Regular, 0x42, false, healmessage.ToString(), m.NetState );
					if ( Caster != m )
						m.PrivateOverheadMessage( MessageType.Regular, 0x42, false, healmessage.ToString(), Caster.NetState );
				}

				m.FixedParticles( 0x376A, 9, 32, 5005, EffectLayer.Waist );
				m.PlaySound( 0x1F2 );
			}

			FinishSequence();
		}
Beispiel #15
0
            protected override void OnTick()
            {
                bool usingPetals = OrangePetals.UnderEffect(m_Mobile);

                if (Core.SA && usingPetals && m_Poison.RealLevel >= 3 && 0.25 > Utility.RandomDouble())
                {
                    OrangePetals.RemoveContext(m_Mobile);
                    usingPetals = false;

                    m_Mobile.LocalOverheadMessage(MessageType.Regular, 0x3F, 1053093); // * The strength of the poison overcomes your resistance! *
                }

                if ((Core.AOS && m_Poison.RealLevel < 4 && TransformationSpellHelper.UnderTransformation(m_Mobile, typeof(VampiricEmbraceSpell))) ||
                    (m_Poison.RealLevel <= 3 && usingPetals) ||
                    AnimalForm.UnderTransformation(m_Mobile, typeof(Unicorn)))
                {
                    if (m_Mobile.CurePoison(m_Mobile))
                    {
                        m_Mobile.LocalOverheadMessage(MessageType.Emote, 0x3F, 1053092);                   // * You feel yourself resisting the effects of the poison *

                        m_Mobile.NonlocalOverheadMessage(MessageType.Emote, 0x3F, 1114442, m_Mobile.Name); // * ~1_NAME~ seems resistant to the poison *

                        Stop();
                        return;
                    }
                }

                if (m_Index++ == m_Poison.m_Count)
                {
                    m_Mobile.SendLocalizedMessage(502136); // The poison seems to have worn off.
                    m_Mobile.Poison = null;

                    if (m_Mobile is PlayerMobile)
                    {
                        BuffInfo.RemoveBuff((PlayerMobile)m_Mobile, BuffIcon.Poison);
                    }

                    Stop();
                    return;
                }

                int damage;

                if (!Core.AOS && m_LastDamage != 0 && Utility.RandomBool())
                {
                    damage = m_LastDamage;
                }
                else
                {
                    damage = 1 + (int)(m_Mobile.Hits * m_Poison.m_Scalar);

                    if (damage < m_Poison.m_Minimum)
                    {
                        damage = m_Poison.m_Minimum;
                    }
                    else if (damage > m_Poison.m_Maximum)
                    {
                        damage = m_Poison.m_Maximum;
                    }

                    m_LastDamage = damage;
                }

                if (m_From != null)
                {
                    m_From.DoHarmful(m_Mobile, true);
                }

                IHonorTarget honorTarget = m_Mobile as IHonorTarget;

                if (honorTarget != null && honorTarget.ReceivedHonorContext != null)
                {
                    honorTarget.ReceivedHonorContext.OnTargetPoisoned();
                }

                #region Mondain's Legacy
                if (Core.ML)
                {
                    if (m_From != null && m_Mobile != m_From && !m_From.InRange(m_Mobile.Location, 1) && m_Poison.m_Level >= 10 && m_Poison.m_Level <= 13) // darkglow
                    {
                        m_From.SendLocalizedMessage(1072850);                                                                                              // Darkglow poison increases your damage!
                        damage = (int)Math.Floor(damage * 1.1);
                    }

                    if (m_From != null && m_Mobile != m_From && m_From.InRange(m_Mobile.Location, 1) && m_Poison.m_Level >= 14 && m_Poison.m_Level <= 18) // parasitic
                    {
                        int toHeal = Math.Min(m_From.HitsMax - m_From.Hits, damage);

                        if (toHeal > 0)
                        {
                            m_From.SendLocalizedMessage(1060203, toHeal.ToString()); // You have had ~1_HEALED_AMOUNT~ hit points of damage healed.
                            m_From.Heal(toHeal, m_Mobile, false);
                        }
                    }
                }
                #endregion

                AOS.Damage(m_Mobile, m_From, damage, 0, 0, 0, 100, 0);

                if ((m_Index % m_Poison.m_MessageInterval) == 0)
                {
                    m_Mobile.OnPoisoned(m_From, m_Poison, m_Poison);
                }
            }
Beispiel #16
0
        public static void LifeforceDrainAttack( Mobile from, Mobile target )
        {
            int toDrain = 6 + (int) ( ( 120 - target.Skills[SkillName.MagicResist].Value ) / 10 );

            target.FixedParticles( 0x3789, 10, 25, 5032, EffectLayer.Head );
            target.PlaySound( 0x1F8 );

            target.SendLocalizedMessage( 1070848 ); // You feel your life force being stolen away!

            target.Damage( toDrain, from );

            from.FixedParticles( 0x376A, 9, 32, 5030, EffectLayer.Waist );
            from.PlaySound( 0x202 );

            from.Heal( toDrain );

            from.DoHarmful( target );

            return;
        }
        public virtual void Heal(Mobile patient)
        {
            if (!Alive || !patient.Alive || !InRange(patient, 2))
            {
            }
            else if (patient.Poisoned)
            {
                double healing = Skills.Healing.Value;
                double anatomy = Skills.Anatomy.Value;
                double chance = (healing - 30.0) / 50.0 - patient.Poison.Level * 0.1;

                if ((healing >= 60.0 && anatomy >= 60.0) && chance > Utility.RandomDouble())
                {
                    if (patient.CurePoison(this))
                    {
                        patient.SendLocalizedMessage(1010059); // You have been cured of all poisons.
                        patient.PlaySound(0x57);

                        CheckSkill(SkillName.Healing, 0.0, 100.0);
                        CheckSkill(SkillName.Anatomy, 0.0, 100.0);
                    }
                }
            }
            else if (BleedAttack.IsBleeding(patient))
            {
                patient.SendLocalizedMessage(1060167); // The bleeding wounds have healed, you are no longer bleeding!
                BleedAttack.EndBleed(patient, true);
                patient.PlaySound(0x57);
            }
            else
            {
                double healing = Skills.Healing.Value;
                double anatomy = Skills.Anatomy.Value;
                double chance = (healing + 10.0) / 100.0;

                if (chance > Utility.RandomDouble())
                {
                    double min, max;

                    min = (anatomy / 10.0) + (healing / 6.0) + 4.0;
                    max = (anatomy / 8.0) + (healing / 3.0) + 4.0;

                    if (patient == this)
                        max += 10;

                    double toHeal = min + (Utility.RandomDouble() * (max - min));

                    toHeal *= HealScalar;

                    patient.Heal((int)toHeal);
                    patient.PlaySound(0x57);

                    CheckSkill(SkillName.Healing, 0.0, 100.0);
                    CheckSkill(SkillName.Anatomy, 0.0, 100.0);
                }
            }

            if (m_HealTimer != null)
                m_HealTimer.Stop();

            m_HealTimer = null;

            m_NextHealTime = DateTime.Now + TimeSpan.FromSeconds(MinHealDelay + (Utility.RandomDouble() * MaxHealDelay));
        }
Beispiel #18
0
		public static void Heal( int amount, Mobile target, Mobile from, bool message )
		{
			//TODO: All Healing *spells* go through ArcaneEmpowerment
			target.Heal( amount, from, message );
		}
Beispiel #19
0
        public override void OnGotMeleeAttack(Mobile attacker)
        {
            int bonusdmg = (Math.Max((int)attacker.Skills[SkillName.Chivalry].Value,(int)attacker.Skills[SkillName.Blacksmith].Value)/20);
            
            AOS.Damage(this, attacker, bonusdmg, true, 0, 0, 0, 0, 0, 0, 100, false, false, false);

            if(attacker is BaseCreature)
            {
                Say("Meurt, toi qui n'est pas digne de me reconnaitre");
                attacker.Kill();
            }

            if (attacker.FindItemOnLayer(Layer.OneHanded) is BaseWeapon)
            {
                BaseWeapon wpn = (BaseWeapon)attacker.FindItemOnLayer(Layer.OneHanded);
                if (wpn.Resource < CraftResource.MGlowing && Utility.RandomDouble()<.10)
                {
                    Emote("Votre arme perce sa lumière, vous offrant un second souffle");
                    attacker.Heal(Utility.Random(1,15));
                }
            }

            base.OnGotMeleeAttack(attacker);
        }
Beispiel #20
0
        public static int Damage(Mobile m, Mobile from, int damage, int phys, int fire, int cold, int pois, int nrgy, bool keepAlive, int armorIgnore)
        {
            if (m == null || m.Deleted || !m.Alive || damage <= 0)
                return 0;


            if (phys == 0 && fire == 100 && cold == 0 && pois == 0 && nrgy == 0)
                Mobiles.MeerMage.StopEffect(m, true);

            if (!Core.AOS)
            {
                m.Damage(damage, from);
                return damage;
            }
            bool Stalker = false;
            TeiravonMobile TavMobile;
            double var = 1;
            if (from != null && from is TeiravonMobile)
            {
                TavMobile = from as TeiravonMobile;
                var = .9 - (TavMobile.PlayerLevel * .01);
                if (TavMobile.HasFeat(TeiravonMobile.Feats.StalkingPrey))
                    Stalker = true;
            }

            if (from != null && Spells.Third.BlessSpell.narindun.Contains(from))
            {
                if (Utility.Random(1000) == 1000)
                {
                    Revenant rev = new Revenant(from, m, TimeSpan.FromSeconds(15));

                    if (BaseCreature.Summon(rev, false, from, m.Location, 0x81, TimeSpan.FromSeconds(15 + 2.0)))
                        rev.FixedParticles(0x373A, 1, 15, 9909, EffectLayer.Waist);
                }
            }

            if (from !=null && Spells.Third.BlessSpell.narindun.Contains(m))
            {
                if (Utility.Random(1000) == 1000)
                {
                    Revenant rev = new Revenant(m, from, TimeSpan.FromSeconds(15));

                    if (BaseCreature.Summon(rev, false, m, from.Location, 0x81, TimeSpan.FromSeconds(15 + 2.0)))
                        rev.FixedParticles(0x373A, 1, 15, 9909, EffectLayer.Waist);
                }
            }

            Fix(ref phys);
            Fix(ref fire);
            Fix(ref cold);
            Fix(ref pois);
            Fix(ref nrgy);

            int resPhys = m.PhysicalResistance;
            int resFire = m.FireResistance;
            int resCold = m.ColdResistance;
            int resPois = m.PoisonResistance;
            int resNrgy = m.EnergyResistance;

            if (Spells.Third.BlessSpell.saerin.Contains(m))
                resPhys = 95;

            if (armorIgnore > 0 )
            {
                double f = (100 - armorIgnore) / 100.0;
                resPhys =(int)(resPhys * f);
                resFire = (int)(resFire * f);
                resCold = (int)(resCold * f);
                resPois = (int)(resPois * f);
                resNrgy = (int)(resNrgy * f);
            }
            if (from != null && IsTracking(from, m) && Stalker)
            {
                resPhys = (int)(resPhys * var);
                resFire = (int)(resFire * var);
                resCold = (int)(resCold * var);
                resPois = (int)(resPois * var);
                resNrgy = (int)(resNrgy * var);
            }

            if (m_ArmorIgnore)
                resPhys = resFire = resCold = resPois = resNrgy = 0;

            if (Spells.Third.BlessSpell.saerin.Contains(m) && resPhys < 50)
                resPhys = 50;

            int totalDamage;



            totalDamage = damage * phys * (100 - resPhys);
            totalDamage += damage * fire * (100 - resFire);
            totalDamage += damage * cold * (100 - resCold);
            totalDamage += damage * pois * (100 - resPois);
            totalDamage += damage * nrgy * (100 - resNrgy);

            totalDamage /= 10000;

            if (totalDamage < 1)
                totalDamage = 1;

            #region Dragon Barding
            if ((!Core.AOS || from == null || !from.Player) && m.Player && m.Mount is SwampDragon)
            {
                SwampDragon pet = m.Mount as SwampDragon;

                if (pet != null && pet.HasBarding)
                {
                    int percent = (pet.BardingExceptional ? 20 : 10);
                    int absorbed = Scale(totalDamage, percent);

                    totalDamage -= absorbed;
                    pet.BardingHP -= absorbed;

                    if (pet.BardingHP < 0)
                    {
                        pet.HasBarding = false;
                        pet.BardingHP = 0;

                        m.SendLocalizedMessage(1053031); // Your dragon's barding has been destroyed!
                    }
                }
            }
            #endregion

            if (keepAlive && totalDamage > m.Hits)
                totalDamage = m.Hits;

            if (from != null)
            {
                int reflectPhys = AosAttributes.GetValue(m, AosAttribute.ReflectPhysical);

                if (reflectPhys != 0)
                {
                    if (from is ExodusMinion && ((ExodusMinion)from).FieldActive || from is ExodusOverseer && ((ExodusOverseer)from).FieldActive)
                    {
                        from.FixedParticles(0x376A, 20, 10, 0x2530, EffectLayer.Waist);
                        from.PlaySound(0x2F4);
                        m.SendAsciiMessage("Your weapon cannot penetrate the creature's magical barrier");
                    }
                    else
                    {
                        from.Damage(Scale((damage * phys * (100 - resPhys)) / 10000, reflectPhys), m);
                    }
                }
            }

            if (from != null && Spells.Third.BlessSpell.valar.Contains(m))
            {
                ArrayList TargList = new ArrayList();

                foreach (Mobile x in m.GetMobilesInRange(2))
                {
                    if (x != m && x.AccessLevel <= m.AccessLevel && !x.Blessed)
                        TargList.Add(x);

                }

                if (TargList.Count > 0)
                {
                    m.FixedParticles(0x376A, 9, 32, 5005, 2634, 2, EffectLayer.Waist);
                    totalDamage = totalDamage / TargList.Count;
                    for (int i = 0; i < TargList.Count; ++i)
                    {
                        Mobile dude = TargList[i] as Mobile;
                        dude.Damage(totalDamage, from);
                    }
                }
            }

            if (m is TeiravonMobile)
            {
                TeiravonMobile tav = m as TeiravonMobile;
                if (((tav.IsOrc() && tav.HasFeat(TeiravonMobile.Feats.Tuffness) || tav.HasFeat(TeiravonMobile.Feats.PhysicalResistance)) && from != null && from != tav))
                {
                    double reduce = (((double)(100 - Utility.RandomMinMax(0, 5)) - (double)(tav.PlayerLevel / 1.75)) / (double)100);

                    int temp = totalDamage;

                    totalDamage = (int)((double)totalDamage * (double)reduce);

                    if (temp - totalDamage < 1)
                        totalDamage -= 1;

                    if (totalDamage < 0)
                        totalDamage = 0;

                    if (Utility.RandomMinMax(1, 20) > 19)
                    {
                        totalDamage = 0;
                        tav.SendMessage("Your tough skin deflects the attack!");
                        from.SendMessage("{0} deflects the attack!", tav.Name);
                    }

                }
            }

            if (Spells.Third.BlessSpell.kamalini.Contains(m) && (((DateTime)Spells.Third.BlessSpell.kamalini[m] + TimeSpan.FromSeconds(3)).CompareTo(DateTime.Now)) < 0)
            {
                IPooledEnumerable eable = m.GetMobilesInRange(2);
                ArrayList targets = new ArrayList();
                int total = 0;
                foreach (Mobile t in eable)
                {
                    if (t.AccessLevel > m.AccessLevel || t.Blessed || t == m)
                        continue;
                    targets.Add(t);
                }
                eable.Free();

                for (int i = 0; i < targets.Count; ++i)
                {
                    Mobile x = (Mobile)targets[i];
                    total += (int)(x.Hits * .03);
                }
                if (total > 2)
                {
                    m.Heal(Utility.RandomMinMax((int)(total * .75), total));
                    m.FixedParticles(0x376A, 9, 32, 5005, EffectLayer.Waist);
                    m.PlaySound(0x1F2);
                    Spells.Third.BlessSpell.kamalini[m] = DateTime.Now;
                }
            }
            m.Damage(totalDamage, from);
            return totalDamage;
        }
Beispiel #21
0
		public virtual void Heal(Mobile patient)
		{
			if ( !Alive || this.Map == Map.Internal || !CanBeBeneficial( patient, true, true ) || patient.Map != this.Map || !InRange( patient, HealEndRange ) )
			{
				StopHeal();
				return;
			}

			bool onSelf = ( patient == this );

			if ( !patient.Alive )
			{
			}
			else if (patient.Poisoned)
			{
				int poisonLevel = patient.Poison.Level;

				double healing = Skills.Healing.Value;
				double anatomy = Skills.Anatomy.Value;
				double chance = ( healing - 30.0 ) / 50.0 - poisonLevel * 0.1;

				if ((healing >= 60.0 && anatomy >= 60.0) && chance > Utility.RandomDouble())
				{
					if (patient.CurePoison(this))
					{
						patient.SendLocalizedMessage(1010059); // You have been cured of all poisons.

						CheckSkill( SkillName.Healing, 0.0, 60.0 + poisonLevel * 10.0 ); // TODO: Verify formula
						CheckSkill(SkillName.Anatomy, 0.0, 100.0);
					}
				}
			}
			else if (BleedAttack.IsBleeding(patient))
			{
				patient.SendLocalizedMessage(1060167); // The bleeding wounds have healed, you are no longer bleeding!
				BleedAttack.EndBleed( patient, false );
			}
			else
			{
				double healing = Skills.Healing.Value;
				double anatomy = Skills.Anatomy.Value;
				double chance = (healing + 10.0) / 100.0;

				if (chance > Utility.RandomDouble())
				{
					double min, max;

					min = (anatomy / 10.0) + (healing / 6.0) + 4.0;
					max = (anatomy / 8.0) + (healing / 3.0) + 4.0;

					if ( onSelf )
						max += 10;

					double toHeal = min + (Utility.RandomDouble() * (max - min));

					toHeal *= HealScalar;

					patient.Heal((int)toHeal);

					CheckSkill( SkillName.Healing, 0.0, 90.0 );
					CheckSkill(SkillName.Anatomy, 0.0, 100.0);
				}
			}

			HealEffect( patient );

			StopHeal();

			if ( ( onSelf && HealFully && Hits >= HealTrigger * HitsMax && Hits < HitsMax ) || ( !onSelf && HealOwnerFully && patient.Hits >= HealOwnerTrigger * patient.HitsMax && patient.Hits < patient.HitsMax ) )
				HealStart( patient );
		}
Beispiel #22
0
            protected override void OnTick()
            {
                #region Mondain's Legacy
                if ((Core.AOS && m_Poison.RealLevel < 4 &&
                     TransformationSpellHelper.UnderTransformation(m_Mobile, typeof(VampiricEmbraceSpell))) ||
                    (m_Poison.RealLevel < 3 && OrangePetals.UnderEffect(m_Mobile)) ||
                    AnimalForm.UnderTransformation(m_Mobile, typeof(Unicorn)))
                {
                    if (m_Mobile.CurePoison(m_Mobile))
                    {
                        m_Mobile.LocalOverheadMessage(
                            MessageType.Emote, 0x3F, true, "* You feel yourself resisting the effects of the poison *");

                        m_Mobile.NonlocalOverheadMessage(
                            MessageType.Emote, 0x3F, true, String.Format("* {0} seems resistant to the poison *", m_Mobile.Name));

                        Stop();
                        return;
                    }
                }
                #endregion

                if (m_Index++ == m_Poison.m_Count)
                {
                    m_Mobile.SendLocalizedMessage(502136);                     // The poison seems to have worn off.
                    m_Mobile.Poison = null;

                    Stop();
                    return;
                }

                int damage;

                if (!Core.AOS && m_LastDamage != 0 && Utility.RandomBool())
                {
                    damage = m_LastDamage;
                }
                else
                {
                    damage = 1 + (int)(m_Mobile.Hits * m_Poison.m_Scalar);

                    if (damage < m_Poison.m_Minimum)
                    {
                        damage = m_Poison.m_Minimum;
                    }
                    else if (damage > m_Poison.m_Maximum)
                    {
                        damage = m_Poison.m_Maximum;
                    }

                    m_LastDamage = damage;
                }

                if (m_From != null)
                {
                    m_From.DoHarmful(m_Mobile, true);
                }

                IHonorTarget honorTarget = m_Mobile as IHonorTarget;
                if (honorTarget != null && honorTarget.ReceivedHonorContext != null)
                {
                    honorTarget.ReceivedHonorContext.OnTargetPoisoned();
                }

                #region Mondain's Legacy
                if (Core.ML)
                {
                    if (m_From != null && m_Mobile != m_From && !m_From.InRange(m_Mobile.Location, 1) && m_Poison.m_Level >= 10 &&
                        m_Poison.m_Level <= 13)                         // darkglow
                    {
                        m_From.SendLocalizedMessage(1072850);           // Darkglow poison increases your damage!
                        damage = (int)Math.Floor(damage * 1.1);
                    }

                    if (m_From != null && m_Mobile != m_From && m_From.InRange(m_Mobile.Location, 1) && m_Poison.m_Level >= 14 &&
                        m_Poison.m_Level <= 18)                         // parasitic
                    {
                        int toHeal = Math.Min(m_From.HitsMax - m_From.Hits, damage);

                        if (toHeal > 0)
                        {
                            m_From.SendLocalizedMessage(1060203, toHeal.ToString(CultureInfo.InvariantCulture));
                            // You have had ~1_HEALED_AMOUNT~ hit points of damage healed.
                            m_From.Heal(toHeal, m_Mobile, false);
                        }
                    }
                }
                #endregion

                AOS.Damage(m_Mobile, m_From, damage, 0, 0, 0, 100, 0);

                if (0.60 <= Utility.RandomDouble())
                // OSI: randomly revealed between first and third damage tick, guessing 60% chance
                {
                    m_Mobile.RevealingAction();
                }

                if ((m_Index % m_Poison.m_MessageInterval) == 0)
                {
                    m_Mobile.OnPoisoned(m_From, m_Poison, m_Poison);
                }
            }
Beispiel #23
0
            protected override void OnTick()
            {
                if ((Core.AOS && m_Poison.Level < 4 && TransformationSpellHelper.UnderTransformation(m_Mobile, typeof(VampiricEmbraceSpell))) ||
                    (m_Poison.Level < 3 && OrangePetals.UnderEffect(m_Mobile)) ||
                    AnimalForm.UnderTransformation(m_Mobile, typeof(Unicorn)))
                {
                    if (m_Mobile.CurePoison(m_Mobile))
                    {
                        m_Mobile.LocalOverheadMessage(MessageType.Emote, 0x3F, true,
                                                      "* You feel yourself resisting the effects of the poison *");

                        m_Mobile.NonlocalOverheadMessage(MessageType.Emote, 0x3F, true,
                                                         String.Format("* {0} seems resistant to the poison *", m_Mobile.Name));

                        Stop();
                        return;
                    }
                }

                if (m_Index++ == m_Poison.m_Count)
                {
                    m_Mobile.SendLocalizedMessage(502136);                       // The poison seems to have worn off.
                    m_Mobile.Poison = null;

                    Stop();
                    return;
                }

                int damage;

                if (!Core.AOS && m_LastDamage != 0 && Utility.RandomBool())
                {
                    damage = m_LastDamage;
                }
                else
                {
                    damage = 1 + (int)(m_Mobile.Hits * m_Poison.m_Scalar);

                    if (damage < m_Poison.m_Minimum)
                    {
                        damage = m_Poison.m_Minimum;
                    }
                    else if (damage > m_Poison.m_Maximum)
                    {
                        damage = m_Poison.m_Maximum;
                    }

                    m_LastDamage = damage;
                }

                if (m_From != null)
                {
                    m_From.DoHarmful(m_Mobile, true);
                }

                IHonorTarget honorTarget = m_Mobile as IHonorTarget;

                if (honorTarget != null && honorTarget.ReceivedHonorContext != null)
                {
                    honorTarget.ReceivedHonorContext.OnTargetPoisoned();
                }

                // Genova: suporte ao UO:ML.
                #region Mondain's Legacy
                if (m_Mobile != m_From && m_From.InRange(m_Mobile.Location, 1) && Utility.InsensitiveCompare(m_Poison.Name, "Parasitic") == 0)
                {
                    m_From.Heal((int)(damage * 0.4));                          // TODO check
                }
                #endregion

                AOS.Damage(m_Mobile, m_From, damage, 0, 0, 0, 100, 0);

                if ((m_Index % m_Poison.m_MessageInterval) == 0)
                {
                    m_Mobile.OnPoisoned(m_From, m_Poison, m_Poison);
                }
            }
Beispiel #24
0
        public static void DamageEater(Mobile m, int[] damage)
        {
            int alleater = SAAbsorptionAttributes.GetValue(m, SAAbsorptionAttribute.EaterDamage);
            int toheal = 0, eater = 0;

            if (alleater > 18)
                alleater = 18;

            for (int i = 0; i < damage.Length; i++)
            {
                eater = alleater;

                switch (i)
                {
                    case 0:
                        eater += SAAbsorptionAttributes.GetValue(m, SAAbsorptionAttribute.EaterFire);
                        break;
                    case 1:
                        eater += SAAbsorptionAttributes.GetValue(m, SAAbsorptionAttribute.EaterCold);
                        break;
                    case 2:
                        eater += SAAbsorptionAttributes.GetValue(m, SAAbsorptionAttribute.EaterPoison);
                        break;
                    case 3:
                        eater += SAAbsorptionAttributes.GetValue(m, SAAbsorptionAttribute.EaterEnergy);
                        break;
                    case 4:
                        eater += SAAbsorptionAttributes.GetValue(m, SAAbsorptionAttribute.EaterKinetic);
                        break;
                }

                if (eater > 30)
                    eater = 30;

                if (eater == 0)
                    continue;

                toheal += (Scale(damage[i], (100 + eater)));
            }

            if (toheal != 0)
            {
                m.SendLocalizedMessage(1113617); // Some of the damage you received has been converted to heal you.
                m.Heal(toheal);
            }
        }
Beispiel #25
0
		public override void OnDoubleClick( Mobile from )
		{
			if ( !from.InRange( this.GetWorldLocation(), 1 ) )
			{
				from.SendLocalizedMessage( 502138 ); // That is too far away for you to use
				return;
			}
			else if ( from != m_Caster )
			{
			}
            else if (!BasePotion.HasFreeHand(from))
            {
                from.SendLocalizedMessage(1080116); // You must have a free hand to use a Healing Stone.
            }
            else if (from.Hits >= from.HitsMax && !from.Poisoned)
            {
                from.SendLocalizedMessage(1049547); //You are already at full health.
            }
            else if (from.BeginAction(typeof(HealingStone)))
            {
                if (m_MaxHeal > m_LifeForce)
                    m_MaxHeal = m_LifeForce;

                if (from.Poisoned)
                {
                    int toUse = Math.Min(120, from.Poison.RealLevel * 25);

                    if (m_MaxLifeForce < toUse)
                        from.SendLocalizedMessage(1115265); //Your Mysticism, Focus, or Imbuing Skills are not enough to use the heal stone to cure yourself.
                    else if (m_LifeForce < toUse)
                    {
                        from.SendLocalizedMessage(1115264); //Your healing stone does not have enough energy to remove the poison.
                        m_LifeForce -= toUse / 3;
                    }
                    else
                    {
                        from.CurePoison(from);

                        from.SendLocalizedMessage(500231); // You feel cured of poison!

                        from.FixedEffect(0x373A, 10, 15);
                        from.PlaySound(0x1E0);

                        m_LifeForce -= toUse;
                    }

                    if (m_LifeForce <= 0)
                        this.Consume();

                    Timer.DelayCall(TimeSpan.FromSeconds(2.0), new TimerStateCallback(ReleaseHealLock), from);
                    return;
                }
                else
                {
                    int toHeal = Math.Min(m_MaxHeal, from.HitsMax - from.Hits);
                    from.Heal(toHeal);
                    Timer.DelayCall(TimeSpan.FromSeconds(2.0), new TimerStateCallback(ReleaseHealLock), from);

                    from.FixedParticles(0x376A, 9, 32, 5030, EffectLayer.Waist);
                    from.PlaySound(0x202);

                    m_LifeForce -= toHeal;
                    m_MaxHeal = 1;
                }

                if (m_LifeForce <= 0)
                {
                    from.SendLocalizedMessage(1115266); //The healing stone has used up all its energy and has been destroyed.
                    this.Consume();
                }
                else
                {
                    if (m_Timer != null)
                        m_Timer.Stop();

                    m_Timer = new InternalTimer(this);
                }
            }
            else
                from.SendLocalizedMessage(1095172); // You must wait a few seconds before using another Healing Stone.
		}