Exemple #1
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.Peddrenth || !m_Owner.CanBeHarmful(m))
                    {
                        continue;
                    }

                    if (m is BaseCreature)
                    {
                        var 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);

                    m_Owner.Hits += drain;

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

                    m.Damage(drain, m_Owner);
                }

                m_ToDrain.Clear();
            }