Exemplo n.º 1
0
 protected override void OnTick()
 {
     if (m_Potion.Deleted)
     {
         Stop();
     }
     else if (m_Index == 0)
     {
         m_Potion.Explode(true, m_Potion.Location, m_Potion.Map);
         Stop();
     }
     else
     {
         m_Potion.PublicOverheadMessage(MessageType.Regular, 0x22, false, m_Index.ToString());
         --m_Index;
     }
 }
Exemplo n.º 2
0
        public void Explode(bool direct, Point3D loc, Map map)
        {
            if (Deleted)
            {
                return;
            }

            Delete();

            if (map == null)
            {
                return;
            }

            Effects.PlaySound(loc, map, 0x207);
            for (int i = 0; i < 20; i++)
            {
                Point3D temp1 = new Point3D(loc.X, loc.Y, (loc.Z + i));
                Effects.SendLocationEffect(temp1, map, 0x3709, 60);
            }

            IPooledEnumerable eable     = LeveledExplosion ? map.GetObjectsInRange(loc, ExplosionRange) : map.GetMobilesInRange(loc, ExplosionRange);
            ArrayList         toExplode = new ArrayList();

            foreach (object o in eable)
            {
                if (o is Mobile)
                {
                    if (o is ElementalChamp)
                    {
                    }
                    else
                    {
                        toExplode.Add(o);
                    }
                }

                else if (o is Atomic && o != this)
                {
                    toExplode.Add(o);
                }
            }

            eable.Free();

            for (int i = 0; i < toExplode.Count; ++i)
            {
                object o = toExplode[i];

                if (o is Mobile)
                {
                    Mobile m = (Mobile)o;

                    Spells.SpellHelper.Damage(TimeSpan.FromTicks(0), m, 40);
                }
                else if (o is Atomic)
                {
                    Atomic pot = (Atomic)o;

                    pot.Explode(false, pot.GetWorldLocation(), pot.Map);
                }
            }
            if (map != null)
            {
                for (int x = -8; x <= 8; ++x)
                {
                    for (int y = -8; y <= 8; ++y)
                    {
                        double dist = Math.Sqrt(x * x + y * y);

                        if (dist <= 8)
                        {
                            Explotion(loc, map, X + x, Y + y);
                        }
                    }
                }
            }
        }