Example #1
0
        public void DoHeal( Mobile from )
        {
            int min = Scale( from, MinHeal );
            int max = Scale( from, MaxHeal );

            from.Heal( Utility.RandomMinMax( min, max ) );
        }
Example #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();
        }
Example #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 );
            }
            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();
        }
Example #4
0
        public void DoHeal(Mobile from)
        {
            int min = Scale(from, MinHeal);
            int max = Scale(from, MaxHeal);

            from.Heal(Utility.RandomMinMax(min, max) + (IntensifiedStrength ? 5 : 0));
        }
Example #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));
        }
Example #6
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();
        }
Example #7
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 );
		}
Example #9
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();
		}
Example #10
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();
		}
Example #11
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));
        }
Example #13
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 );
		}
Example #14
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);
        }
Example #15
0
        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;
        }
Example #16
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 );
		}
Example #17
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);
            }
        }
Example #18
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.
		}