Ejemplo n.º 1
0
                protected override void OnTick()
                {
                    if (m_Point is Item && (((Item)m_Point).Deleted || ((Item)m_Point).Map != m_Map))
                    {
                        return;
                    }
                    else if (m_Point is Mobile && (((Mobile)m_Point).Deleted || ((Mobile)m_Point).Map != m_Map))
                    {
                        return;
                    }
                    else if (m_Map == null)
                    {
                        return;
                    }

                    if (m_Point is Item)
                    {
                        m_Point = ((Item)m_Point).GetWorldLocation();
                    }

                    if (InstantExplosion)
                    {
                        m_Potion.Explode(m_Mobile, true, new Point3D(m_Point), m_Map);
                    }
                    else
                    {
                        m_Potion.MoveToWorld(new Point3D(m_Point), m_Map);
                    }
                }
Ejemplo n.º 2
0
            protected override void OnTick()
            {
                if (m_Potion.Deleted)
                {
                    Stop();
                }
                else if (m_Index == 0)
                {
                    if (m_Potion.Map == Map.Internal)
                    {
                        m_Potion.Explode(m_Mobile, true, m_Mobile.Location, m_Mobile.Map);
                    }
                    else
                    {
                        m_Potion.Explode(m_Mobile, true, m_Potion.Location, m_Potion.Map);
                    }

                    Stop();

                    if (m_Mobile.Target is InternalTarget)
                    {
                        Target.Cancel(m_Mobile);
                    }
                }
                else
                {
                    if (m_Potion.Map == Map.Internal)
                    {
                        m_Mobile.PublicOverheadMessage(MessageType.Regular, 0x22, false, m_Index.ToString());
                    }
                    else
                    {
                        m_Potion.PublicOverheadMessage(MessageType.Regular, 0x22, false, m_Index.ToString());
                    }

                    --m_Index;
                }
            }
Ejemplo n.º 3
0
        public void Explode(Mobile from, 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);
            }

            int alchemyBonus = direct ? (int)(from.Skills[SkillName.Alchemy].Value / 10) : 0;

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

            foreach (object o in eable)
            {
                if (o is Mobile)
                {
                    toExplode.Add(o);
                }
                else if (o is BaseAtomicBomb && 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;

                    if (from == null || (SpellHelper.ValidIndirectTarget(from, m) && from.CanBeHarmful(m, false)))
                    {
                        if (from != null)
                        {
                            from.DoHarmful(m);
                        }

                        int damage = Utility.RandomMinMax(MinDamage, MaxDamage);

                        damage += alchemyBonus;

                        if (damage > 40)
                        {
                            damage = 40;
                        }

                        AOS.Damage(from, damage, 0, 100, 0, 0, 0);
                    }
                }
                else if (o is BaseAtomicBomb)
                {
                    BaseAtomicBomb pot = (BaseAtomicBomb)o;

                    pot.Explode(from, 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);
                        }
                    }
                }
            }
        }