Пример #1
0
            protected override void OnTick()
            {
                if (this.m_Owner.Deleted)
                {
                    this.Stop();
                    return;
                }

                foreach (Mobile m in this.m_Owner.GetMobilesInRange(9))
                {
                    if (m == this.m_Owner || m == this.m_Owner.Harrower || !this.m_Owner.CanBeHarmful(m))
                    {
                        continue;
                    }

                    if (m is BaseCreature)
                    {
                        BaseCreature bc = m as BaseCreature;

                        if (bc.Controlled || bc.Summoned)
                        {
                            m_ToDrain.Add(m);
                        }
                    }
                    else if (m.Player)
                    {
                        m_ToDrain.Add(m);
                    }
                }

                foreach (Mobile m in m_ToDrain)
                {
                    this.m_Owner.DoHarmful(m);

                    m.FixedParticles(0x374A, 10, 15, 5013, 0x455, 0, EffectLayer.Waist);
                    m.PlaySound(0x1F1);

                    int drain = Utility.RandomMinMax(14, 30);

                    //Monster Stealables
                    if (m is PlayerMobile)
                    {
                        PlayerMobile pm = m as PlayerMobile;
                        drain = (int)LifeShieldLotion.HandleLifeDrain(pm, drain);
                    }
                    //end

                    this.m_Owner.Hits += drain;

                    if (this.m_Owner.Harrower != null)
                    {
                        this.m_Owner.Harrower.Hits += drain;
                    }

                    m.Damage(drain, this.m_Owner);
                }

                m_ToDrain.Clear();
            }
Пример #2
0
            protected override void OnTick()
            {
                if (m_Owner.Deleted)
                {
                    Stop();
                    return;
                }

                foreach (Mobile m in m_Owner.GetMobilesInRange(9))
                {
                    if (m == m_Owner || m == m_Owner.Harrower || !m_Owner.CanBeHarmful(m))
                    {
                        continue;
                    }

                    if (m is BaseCreature)
                    {
                        BaseCreature bc = m as BaseCreature;

                        if (bc.Controlled || bc.Summoned)
                        {
                            m_ToDrain.Add(m);
                        }
                    }
                    else if (m.Player)
                    {
                        m_ToDrain.Add(m);
                    }
                }

                foreach (Mobile m in m_ToDrain)
                {
                    m_Owner.DoHarmful(m);

                    m.FixedParticles(0x374A, 10, 15, 5013, 0x455, 0, EffectLayer.Waist);
                    m.PlaySound(0x1F1);

                    int drain = Utility.RandomMinMax(14, 30);

                    if (LifeShieldLotion.UnderEffect(m))
                    {
                        double scale = Utility.RandomMinMax(50, 100) / 100.0;
                        drain = (int)(drain * scale);
                    }

                    m_Owner.Hits += drain;

                    if (m_Owner.Harrower != null)
                    {
                        m_Owner.Harrower.Hits += drain;
                    }

                    m.Damage(drain, m_Owner);
                }

                m_ToDrain.Clear();
            }
Пример #3
0
        public void DrainLife()
        {
            ArrayList list = new ArrayList();

            foreach (Mobile m in this.GetMobilesInRange(2))
            {
                if (m == this || !CanBeHarmful(m))
                {
                    continue;
                }

                if (m is BaseCreature && (((BaseCreature)m).Controlled || ((BaseCreature)m).Summoned || ((BaseCreature)m).Team != this.Team))
                {
                    list.Add(m);
                }
                else if (m.IsPlayer)
                {
                    list.Add(m);
                }
            }

            foreach (Mobile m in list)
            {
                DoHarmful(m);

                m.FixedParticles(0x374A, 10, 15, 5013, 0x496, 0, EffectLayer.Waist);
                m.PlaySound(0x231);

                m.SendAsciiMessage("You feel the life drain out of you!");

                int toDrain = Utility.RandomMinMax(10, 40);

                if (LifeShieldLotion.UnderEffect(m))
                {
                    double scale = Utility.RandomMinMax(50, 100) / 100.0;
                    toDrain = (int)(toDrain + scale);
                }

                Hits += toDrain;
                m.Damage(toDrain, this);
            }
        }