Esempio n. 1
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 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: (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();
        }
Esempio n. 2
0
        public static void DoBleed(Mobile m, Mobile from, int level, bool blooddrinker)
        {
            if (m.Alive)
            {
                int damage = Utility.RandomMinMax(level, level * 2);

                if (!m.Player)
                {
                    damage *= 2;
                }

                m.PlaySound(0x133);
                m.Damage(damage, from);

                if (blooddrinker)
                {
                    from.Heal(damage, from, true);                     // Check for OSI message accuracy instead of standard heal message
                }

                Blood blood = new Blood();

                blood.ItemID = Utility.Random(0x122A, 5);

                blood.MoveToWorld(m.Location, m.Map);
            }
            else
            {
                EndBleed(m, false);
            }
        }
        public void DoHeal(Mobile from)
        {
            int min = Scale(from, Server.Misc.MyServerSettings.PlayerLevelMod(MinHeal, from));
            int max = Scale(from, Server.Misc.MyServerSettings.PlayerLevelMod(MaxHeal, from));

            from.Heal(Utility.RandomMinMax(min, max));
        }
Esempio n. 4
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)
            {
                Caster.LocalOverheadMessage(MessageType.Regular, 0x22, (Caster == m) ? 1005000 : 1010398);
            }
            else if (CheckBSequence(m))
            {
                SpellHelper.Turn(Caster, m);

                m.Heal((int)Damage.instance.RandDegatsMagiques(Caster, Info.skillForCasting, Info.Circle, Info.castTime));

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

            FinishSequence();
        }
Esempio n. 5
0
 public static void GetOnHitEffect(Mobile atk, double damage)
 {
     if (m_Table.Contains((BaseWeapon)atk.Weapon))
     {
         atk.Heal((int)(CurseWeaponSpell.LifestealPercentMax * Spell.GetSpellScaling(atk, Info.skillForCasting) * damage));
     }
 }
Esempio n. 6
0
            protected override void OnTick()
            {
                if (!dest.CheckAlive())
                {
                    Stop();
                    m_Table.Remove(dest);
                }

                if (DateTime.Now < NextTick)
                {
                    return;
                }

                if (DateTime.Now >= NextTick)
                {
                    double heal = Utility.RandomMinMax(6, 9) + source.Skills[SkillName.Magery].Value / 50.0;
                    heal *= ClericDivineFocusSpell.GetScalar(source);

                    dest.Heal((int)heal);

                    dest.PlaySound(0x202);
                    dest.FixedParticles(0x376A, 1, 62, 9923, 3, 3, EffectLayer.Waist);
                    dest.FixedParticles(0x3779, 1, 46, 9502, 5, 3, EffectLayer.Waist);
                    NextTick = DateTime.Now + TimeSpan.FromSeconds(4);
                }

                if (DateTime.Now >= Expire)
                {
                    Stop();
                    if (m_Table.Contains(dest))
                    {
                        m_Table.Remove(dest);
                    }
                }
            }
Esempio n. 7
0
        public void DoHeal(Mobile from)
        {
            int min = MinHeal;
            int max = MaxHeal;

            from.Heal(Utility.RandomMinMax(min, max));
        }
Esempio n. 8
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));
        }
Esempio n. 9
0
        public static void DoBleed(Mobile m, Mobile from, int level, bool blooddrinker)
        {
            if (m.Alive)
            {
                int damage = Utility.RandomMinMax(level, level * 2);

                if (!m.Player)
                {
                    damage *= 2;
                }

                m.PlaySound(0x133);
                AOS.Damage(m, from, damage, false, 0, 0, 0, 0, 0, 0, 100, false, false, false);

                if (blooddrinker && from.Hits < from.HitsMax)
                {
                    from.SendLocalizedMessage(1113606); //The blood drinker effect heals you.
                    from.Heal(damage);
                }

                Blood blood = new Blood();

                blood.ItemID = Utility.Random(0x122A, 5);

                blood.MoveToWorld(m.Location, m.Map);
            }
            else
            {
                EndBleed(m, false);
            }
        }
Esempio n. 10
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();
        }
Esempio n. 11
0
		public void DoHeal( Mobile from )
		{
			int min = Scale( from, MinHeal );
			int max = Scale( from, MaxHeal );

			from.Heal( Utility.RandomMinMax( min, max ) );
		}
Esempio n. 12
0
            protected override void OnTick()
            {
                if (!dest.CheckAlive())
                {
                    Stop();
                    m_Table.Remove(dest);
                }

                if (DateTime.UtcNow < NextTick)
                {
                    return;
                }

                if (DateTime.UtcNow >= NextTick)
                {
                    double heal = 5 + (source.Skills[SkillName.Healing].Value / 20.0) + (source.Skills[SkillName.SpiritSpeak].Value / 20.0);

                    dest.Heal((int)heal);

                    dest.PlaySound(0x202);
                    dest.FixedParticles(0x376A, 1, 62, 9923, 3, 3, EffectLayer.Waist);
                    dest.FixedParticles(0x3779, 1, 46, 9502, 5, 3, EffectLayer.Waist);
                    NextTick = DateTime.UtcNow + TimeSpan.FromSeconds(4);
                }

                if (DateTime.UtcNow >= Expire)
                {
                    Stop();
                    if (m_Table.Contains(dest))
                    {
                        m_Table.Remove(dest);
                    }
                }
            }
Esempio n. 13
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 != this.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.
        }
Esempio n. 14
0
        public void DoHeal(Mobile from)
        {
            var min = Scale(from, MinHeal);
            var max = Scale(from, MaxHeal);

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

            from.Heal(Utility.RandomMinMax(min, max));
        }
Esempio n. 16
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.
            }
        }
Esempio n. 17
0
		public void DoHeal( Mobile from )
		{
			int min = MinHeal;
			int max = MaxHeal;

			from.Heal( Utility.RandomMinMax( min, max ) );
		}
Esempio n. 18
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));
        }
        public void DoHeal(Mobile from)
        {
            var heal = (double)Utility.Dice(12, PotionStrength + 1, 0);

            from.FireHook(h => h.OnHeal(from, from, this, ref heal));
            from.Heal((int)heal);
        }
Esempio n. 20
0
        public static void DoBleed(Mobile m, Mobile from, int level, bool blooddrinker)
        {
            if (m.Alive)
            {
                int damage = Utility.RandomMinMax(level, level * 2);

                if (!m.Player)
                    damage *= 2;

                m.PlaySound(0x133);
                AOS.Damage(m, from, damage, false, 0, 0, 0, 0, 0, 0, 100, false, false, false);

                if (blooddrinker && from.Hits < from.HitsMax)
                {
                    from.SendLocalizedMessage(1113606); //The blood drinker effect heals you.
                    from.Heal(damage);
                }

                Blood blood = new Blood();

                blood.ItemID = Utility.Random(0x122A, 5);

                blood.MoveToWorld(m.Location, m.Map);
            }
            else
            {
                EndBleed(m, false);
            }
        }
Esempio n. 21
0
            protected override void OnTick()
            {
                if (!dest.CheckAlive())
                {
                    Stop();
                    m_Table.Remove(dest);
                }

                if (DateTime.UtcNow < NextTick)
                {
                    return;
                }

                if (DateTime.UtcNow >= NextTick)
                {
                    double heal = Utility.RandomMinMax(5, 10);
                    dest.Heal((int)heal);
                    dest.FixedParticles(0x3779, 1, 46, 9502, 5, 3, EffectLayer.Waist);
                    NextTick = DateTime.UtcNow + TimeSpan.FromSeconds(4);
                }

                if (DateTime.UtcNow >= Expire)
                {
                    Stop();
                    if (m_Table.Contains(dest))
                    {
                        m_Table.Remove(dest);
                    }
                }
            }
Esempio n. 22
0
        public virtual void Heal(Mobile from)
        {
            if (this.Deleted || from == null) //from = player who triggered heal (not used yet)
            {
                return;
            }

            ArrayList targets = new ArrayList();

            foreach (Mobile m in this.GetMobilesInRange(3))
            {
                if (m == null || m.Deleted)
                {
                    continue;
                }

                if (m is BaseCreature && (((BaseCreature)m).Controlled || ((BaseCreature)m).Summoned))
                {
                    if (!m.IsDeadBondedPet && m.Alive && !m.Blessed && m.InLOS(this))
                    {
                        targets.Add(m);
                    }
                }
                else if (m.Player && !m.Blessed && m.AccessLevel == AccessLevel.Player && m.Alive && m.InLOS(this))
                {
                    targets.Add(m);
                }
            }

            for (int i = 0; i < targets.Count; ++i)
            {
                Mobile m = (Mobile)targets[i];

                if (m == null || m.Deleted)
                {
                    continue;
                }

                m.RevealingAction();
                //Effects.SendMovingEffect(this, m, 0x36D4, 5, 0, false, false);

                if (m.Poison != null)
                {
                    m.Poison = null;
                    m.FixedParticles(0x373A, 10, 15, 5012, EffectLayer.Waist);
                    m.PlaySound(0x1E0);
                }
                else
                {
                    //m.Heal(AOS.Scale(m.HitsMax, BasePotion.Scale(m, 20))); //Heal for 20+EnhancePotions% HitsMax
                    m.Heal(20);
                    m.Mana += 20;
                    m.Stam += 20;
                    m.FixedParticles(0x376A, 9, 32, 5005, EffectLayer.Waist);
                    m.PlaySound(0x1F2);
                }
            }

            this.Delete();
        }
Esempio n. 23
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 || m_Slayer.Slays(m))
            {
                Caster.SendLocalizedMessage(1060177);                   // You cannot heal a creature that is already dead!
            }
            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: (40% of magery) + (1-10)

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

                if (Caster is TeiravonMobile && Caster != m)
                {
                    TeiravonMobile TAV = (TeiravonMobile)Caster;
                    if (TAV.HasFeat(TeiravonMobile.Feats.HealersOath))
                    {
                        toHeal = (int)(toHeal * 1.5);
                    }
                    if ((m.Hits + toHeal) > m.HitsMax)
                    {
                        toHeal = m.HitsMax - m.Hits;
                    }
                    int exp = toHeal * (1 + (TAV.PlayerLevel / 2));

                    if (exp > 0 && Misc.Titles.AwardExp(TAV, exp))
                    {
                        TAV.SendMessage("You have gained {0} exp", exp);
                    }
                }

                m.Heal(toHeal);

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

            FinishSequence();
        }
Esempio n. 24
0
        public void DoHeal(Mobile from)
        {
            var toHeal = Utility.RandomMinMax(Scale(from, MinHeal), Scale(from, MaxHeal));

            from.Heal(toHeal);

            HealingStone.OnHealFromPotion(from, toHeal);
        }
Esempio n. 25
0
        public void DoHeal(Mobile from)
        {
            int min = Scale(from, MinHeal);
            int max = Scale(from, MaxHeal);

            ArcaneEmpowermentSpell.AddHealBonus(from, ref min);
            ArcaneEmpowermentSpell.AddHealBonus(from, ref max);
            from.Heal(Utility.RandomMinMax(min, max));
        }
Esempio n. 26
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)
                {
                    // TODO: / 100 or / 120 ? 1, 3 or 1, 4 ?
                    toHeal  = Caster.Skills.Magery.Fixed / 100;
                    toHeal += Utility.RandomMinMax(1, 3);

                    if (m != Caster)
                    {
                        // Heal now heals 50% more damage when
                        // used on a target other than the caster.

                        toHeal += (int)(toHeal * 0.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();
        }
Esempio n. 27
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 != this.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.Hits >= from.HitsMax)
            {
                from.SendMessage("You are at full health,");
            }

            else if (from.BeginAction(typeof(BaseHealPotion)))
            {
                int healamount = Utility.RandomMinMax(BasePotion.Scale(from, 25), BasePotion.Scale(from, 35));

                if (healamount > m_Amount)
                {
                    healamount = m_Amount;
                }

                from.Heal(healamount);

                m_Amount -= healamount;

                if (m_Amount <= 0)
                {
                    this.Consume();
                }

                this.InvalidateProperties();

                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.
            }
        }
Esempio n. 28
0
        public void Target(IPoint3D p)
        {
            if (!Caster.CanSee(p))
            {
                Caster.SendLocalizedMessage(500237); // Target can not be seen.
            }
            else if (CheckSequence())
            {
                SpellHelper.Turn(Caster, p);

                SpellHelper.GetSurfaceTop(ref p);

                ArrayList targets = new ArrayList();

                IPooledEnumerable eable = Caster.Map.GetMobilesInRange(new Point3D(p), 3);

                foreach (Mobile m in eable)
                {
                    if (Caster.CanBeBeneficial(m, false))
                    {
                        targets.Add(m);
                    }
                }

                eable.Free();

                Effects.PlaySound(p, Caster.Map, 0x11);

                int val = (int)(Caster.Skills[CastSkill].Value / 20.0 + 5);

                if (targets.Count > 0)
                {
                    for (int i = 0; i < targets.Count; ++i)
                    {
                        Mobile m = (Mobile)targets[i];

                        if (m.BeginAction(typeof(SpringOfLifeSpell)))
                        {
                            Caster.DoBeneficial(m);
                            m.FixedParticles(0x375A, 9, 20, 5027, EffectLayer.Head);

                            int toHeal = (int)(Caster.Skills[DamageSkill].Value * 0.6);
                            toHeal += Utility.Random(1, 10);

                            m.Heal(toHeal);

                            new InternalTimer(m, Caster, val).Start();
                            m.FixedParticles(0x375A, 9, 20, 5027, EffectLayer.Waist);
                            m.PlaySound(0xAF);
                        }
                    }
                }
            }

            FinishSequence();
        }
Esempio n. 29
0
        private void curarPaciente(ref int healerNumber, ref int patientNumber, ref bool playSound, ref bool checkSkills, SkillName primarySkill, SkillName secondarySkill)
        {
            checkSkills   = true;
            patientNumber = -1;

            double healing = m_Healer.Skills[primarySkill].Value;
            double anatomy = m_Healer.Skills[secondarySkill].Value;
            double chance  = ((healing + 10.0) / 100.0) - (m_Slips * 0.02);

            if (chance > Utility.RandomDouble())
            {
                healerNumber = 500969; // You finish applying the bandages.

                double min, max;

                if (Core.AOS)
                {
                    min = (anatomy / 8.0) + (healing / 5.0) + 4.0;
                    max = (anatomy / 6.0) + (healing / 2.5) + 4.0;
                }
                else
                {
                    min = (anatomy / 5.0) + (healing / 5.0) + 3.0;
                    max = (anatomy / 5.0) + (healing / 2.0) + 10.0;
                }

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

                if (m_Patient.Body.IsMonster || m_Patient.Body.IsAnimal)
                {
                    toHeal += m_Patient.HitsMax / 100;
                }

                if (Core.AOS)
                {
                    toHeal -= toHeal * m_Slips * 0.35; // TODO: Verify algorithm
                }
                else
                {
                    toHeal -= m_Slips * 4;
                }

                if (toHeal < 1)
                {
                    toHeal       = 1;
                    healerNumber = 500968; // You apply the bandages, but they barely help.
                }

                m_Patient.Heal((int)toHeal, m_Healer, false);
            }
            else
            {
                healerNumber = 500968; // You apply the bandages, but they barely help.
                playSound    = false;
            }
        }
Esempio n. 30
0
        public void Target(Mobile m)
        {
            if (!Caster.InRange(m, 2))
            {
                Caster.SendLocalizedMessage(1060178);                   // You are too far away to perform that action!
            }
            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.Hits >= m.HitsMax)
            {
                Caster.SendLocalizedMessage(500955);                   // That being is not damaged!
            }
            else if (m.Poisoned || Server.Items.MortalStrike.IsWounded(m))
            {
                Caster.LocalOverheadMessage(MessageType.Regular, 0x3B2, (Caster == m) ? 1005000 : 1010398);
            }
            else if (CheckBSequence(m))
            {
                SpellHelper.Turn(Caster, m);

                /* Heals the target for 7 to 39 points of damage.
                 * The caster's Karma affects the amount of damage healed.
                 */

                int toHeal = ComputePowerValue(6) + Utility.RandomMinMax(0, 2);

                // TODO: Should caps be applied?
                Utility.FixMinMax(ref toHeal, 7, 39);

                Server.Spells.Spellweaving.ArcaneEmpowermentSpell.ApplyHealBonus(Caster, ref toHeal);

                int oldHits = m.Hits;

                m.Heal(toHeal, Caster, message: false);

                if (m.Hits > oldHits)
                {
                    int healedAmount = m.Hits - oldHits;

                    m.SendLocalizedMessage(1060203, healedAmount.ToString());                       // You have had ~1_HEALED_AMOUNT~ hit points of damage healed.
                }

                m.PlaySound(0x202);
                m.FixedParticles(0x376A, 1, 62, 9923, 3, 3, EffectLayer.Waist);
                m.FixedParticles(0x3779, 1, 46, 9502, 5, 3, EffectLayer.Waist);
            }

            FinishSequence();
        }
Esempio n. 31
0
        public static void Heal(Mobile m)
        {
            Mobile caster = m_Table3[m] as Mobile;

            int toHeal = 8 + GetFocusLevel(caster);

            ArcaneEmpowermentSpell.ApplyHealBonus(caster, ref toHeal);

            m.Heal(toHeal, caster);
            m.FixedParticles(0x376A, 9, 32, 5005, EffectLayer.Waist);
        }
Esempio n. 32
0
        public void FinishSequence(Mobile cible)
        {
            Owner.Animate(13, 7, 1, true, false, 0);
            double Ddamage = (int)((Owner.Niveau + Utility.RandomMinMax(minDegat, maxDegat)) * (Maitrise / 100.0));

            Ddamage *= getRatio();
            int damage = (int)Ddamage;

            damage /= m_number;             //Donc en fait le minMax correspond au global !!

            if (Owner.CanBeBeneficial(cible))
            {
                cible.Heal(damage);
            }

            //if(cible.Combatant == null && cible != Owner)
            //	cible.Combatant = Owner;

            SortNubiaHelper.MakeEffect(Owner, cible, this, false, false);

            int       i       = 0;
            ArrayList targets = new ArrayList();

            foreach (Mobile m in cible.GetMobilesInRange(5))
            {
                if (m == cible || m == Owner.Combatant || !(Owner.CanBeBeneficial(m)))
                {
                    continue;
                }
                i++;
                if (i >= m_number)
                {
                    break;
                }

                SortNubiaHelper.MakeEffect(Owner, cible, this, false, false);

                if (m.Combatant == null)
                {
                    m.Combatant = Owner;
                }

                //m.Damage( damage , Owner );
                targets.Add(m);
            }
            int count = targets.Count;

            for (int t = 0; t < count; t++)
            {
                Mobile mob = targets[t] as Mobile;
                mob.Heal(damage);
            }
            EndSortNubia();             //important ;)
        }
Esempio n. 33
0
        public void DoHeal(object obj)
        {
            double dam = (double)obj;

            if (dam < 0)
            {
                return;
            }

            Mobile.Heal((int)dam, Mobile, false);
            Mobile.SendLocalizedMessage(1113617); // Some of the damage you received has been converted to heal you.
            Server.Effects.SendPacket(Mobile.Location, Mobile.Map, new ParticleEffect(EffectType.FixedFrom, Mobile.Serial, Serial.Zero, 0x375A, Mobile.Location, Mobile.Location, 1, 10, false, false, 33, 0, 2, 6889, 1, Mobile.Serial, 45, 0));
            m_Charges--;
        }
Esempio n. 34
0
        public static void Heal(Mobile from, int amount, bool message)
        {
            int toheal = amount;

            if (RegenerescenceSpell.m_RegenerescenceTable.Contains(from))
            {
                toheal = (int)(toheal * (double)RegenerescenceSpell.m_RegenerescenceTable[from]);

                Effects.SendTargetParticles(from, 14217, 10, 20, 5013, 2042, 0, EffectLayer.CenterFeet); //ID, speed, dura, effect, hue, render, layer
                from.PlaySound(508);
            }

            from.Heal(toheal);
        }
        public void Exited(Mobile m)
        {
			if (m.Alive)
			{
				//m.Hits = MaxHits;
				m.Heal(100);
				m.FixedParticles(0x376A, 9, 32, 5005, EffectLayer.Waist);
				m.PlaySound(0x1F2);
            }
            //Al: Fix for getting out of the Arena flagged.
            PlayerMobile pm = m as PlayerMobile;
            if (pm != null) pm.ClearAggression();
			if (MyRegion != null && MyRegion.Players.Count == 0 && m_InUse)
            {
                Clean();
            }
        }
Esempio n. 36
0
        public void Target( Mobile m )
        {
            if ( !Caster.CanSee( m ) )
            {
                Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
            }
            else if ( CheckBSequence( m, false ) )
            {
                SpellHelper.Turn( Caster, m );

                m.PlaySound( 0x202 );
                m.FixedParticles( 0x376A, 1, 62, 0x480, 3, 3, EffectLayer.Waist );
                m.FixedParticles( 0x3779, 1, 46, 0x481, 5, 3, EffectLayer.Waist );

                double toHeal = Caster.Skills[SkillName.SpiritSpeak].Value / 2.0 + Utility.Random( 5 );

                toHeal *= ClericDivineFocusSpell.GetScalar( Caster );

                m.Heal( (int)toHeal );
            }

            FinishSequence();
        }
Esempio n. 37
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);
 }
Esempio n. 38
0
        public static void Heal( Mobile m )
        {
            Mobile caster = m_Table3[m] as Mobile;

            int toHeal = 8 + GetFocusLevel( caster );

            ArcaneEmpowermentSpell.ApplyHealBonus( caster, ref toHeal );

            m.Heal( toHeal, caster );
            m.FixedParticles( 0x376A, 9, 32, 5005, EffectLayer.Waist );
        }
Esempio n. 39
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 );
		}
Esempio n. 40
0
            public override void OnDoubleClick( Mobile from )
            {
                if ( !IsChildOf( from.Backpack ) )
                    return;

                if ( !from.Alive )
                    return;

                HealingStoneContext context = null;

                if ( m_MalusTable.ContainsKey( from ) )
                    context = m_MalusTable[from];

                if ( context != null && context.UnderCooldown )
                {
                    from.LocalOverheadMessage( MessageType.Regular, 0x22, 1095172 ); // You must wait a few seconds before using another Healing Stone.
                }
                else if ( from.Hits == from.HitsMax )
                {
                    from.SendLocalizedMessage( 1049547, "", 0x59 ); // You are already at full health.
                }
                else if ( !BasePotion.HasFreeHand( from ) && !BasePotion.HasBalancedWeapon( from ) )
                {
                    from.SendLocalizedMessage( 1080116 ); // You must have a free hand to use a Healing Stone.
                }
                else if ( MortalStrike.IsWounded( from ) )
                {
                    from.LocalOverheadMessage( MessageType.Regular, 0x22, 1005000 ); // You cannot heal yourself in your current state.
                }
                else if ( from.Poisoned )
                {
                    // TODO (SA): Healing Stone should now heal poison
                }
                else
                {
                    int amountToHeal = Utility.RandomMinMax( 1, 6 ) + (int) ( ( GetBaseSkill( from ) + GetBoostSkill( from ) ) / 8.0 );

                    if ( context != null )
                        amountToHeal = (int) ( amountToHeal * context.Scale );

                    amountToHeal = Math.Min( amountToHeal, HealingPoints );

                    // TODO (SA): Arcane Empowerment debe otorgar un bonus.

                    from.Heal( amountToHeal );
                    from.PlaySound( 0x202 );

                    HealingPoints -= amountToHeal;

                    if ( context != null )
                    {
                        context.Reset();
                    }
                    else
                    {
                        Timer t = Timer.DelayCall( TimeSpan.FromSeconds( Malus ), new TimerCallback(
                            delegate
                            {
                                m_MalusTable.Remove( from );
                            } ) );
                        m_MalusTable.Add( from, new HealingStoneContext( from, t ) );
                    }
                }
            }
Esempio n. 41
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 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))
            {
                int healamount = 0;
                if (m.Poisoned)
                {
                    healamount = 30;
                    Caster.LocalOverheadMessage(MessageType.Regular, 0x22, true, "The poison mitigates your healing!");
                }
                else
                    healamount = 38;

                if (Scroll != null)
                {
                    healamount -= 3;
                }

                m.Heal(healamount);

                m.FixedParticles(0x376A, 10, 15, 5030, EffectLayer.Waist);
                m.PlaySound(Sound);
            }	

			FinishSequence();
		}
Esempio n. 42
0
        public void Target( Mobile m )
        {
            if ( Caster ==  m )
            {
                Caster.SendMessage( "You cannot heal yourself" ); // Cannot heal self.
            }
            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 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 = (int)(Caster.Skills[SkillName.SpiritSpeak].Value * 0.4);
                toHeal += Utility.Random( 8, 15 );

                int toBleed = (int)(Caster.Skills[SkillName.SpiritSpeak].Value * 0.2);
                toBleed += Utility.Random( 5, 10 );

                m.Heal( toHeal );

                m.PlaySound( 0x133 );
                m.FixedParticles( 0x377A, 244, 25, 9950, 31, 0, EffectLayer.Waist );
                Caster.FixedParticles( 0x377A, 244, 25, 9950, 31, 0, EffectLayer.Waist );
                Caster.Damage( toBleed );
            }

            FinishSequence();
        }
Esempio n. 43
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 is Golem )
			{
				Caster.LocalOverheadMessage( MessageType.Regular, 0x3B2, 500951 ); // You cannot heal that.
			}
			else if ( CheckBSequence( m ) )
			{

				int toHeal;

                CustomRegion cR = Caster.Region as CustomRegion;

				if ( Core.AOS )
				{
					// TODO: / 100 or / 120 ? 1, 3 or 1, 4 ?
					toHeal = Caster.Skills.Magery.Fixed / 100;
					toHeal += Utility.RandomMinMax( 1, 3 );
				}
                else //Loki edit: New PvP changes
                {
                    toHeal = 3 + (int)(Caster.Skills[SkillName.Magery].Value * 0.1);
                    if (m.Poisoned)
                    {
                        toHeal -= 3;
                        if (toHeal < 1)
                            toHeal = 1;
                        Caster.LocalOverheadMessage(MessageType.Regular, 0x22, true, "The poison mitigates your healing!");
                    }
                } 

                m.Heal(toHeal);

				m.FixedParticles( 0x376A, 5, 15, 5005, EffectLayer.Waist );
				m.PlaySound( Sound );
			}

			FinishSequence();
		}