示例#1
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (m_Potion.Deleted || m_Potion.Map == Map.Internal)
                {
                    return;
                }

                IPoint3D p = targeted as IPoint3D;

                if (p == null)
                {
                    return;
                }

                Map map = from.Map;

                if (map == null)
                {
                    return;
                }

                if (m_Potion.CanUseExplosionPotion(from))
                {
                    SpellHelper.GetSurfaceTop(ref p);

                    from.RevealingAction();

                    IEntity to = new Entity(Serial.Zero, new Point3D(p), map);

                    if (p is Mobile)
                    {
                        if (!RelativeLocation) // explosion location = current mob location.
                        {
                            p = ((Mobile)p).Location;
                        }
                        else
                        {
                            to = (Mobile)p;
                        }
                    }

                    Effects.SendMovingEffect(from, to, m_Potion.ItemID, 7, 0, false, false, m_Potion.Hue, 0);

                    if (m_Potion.Amount > 1)
                    {
                        Mobile.LiftItemDupe(m_Potion, 1).EventItem = m_Potion.EventItem;
                    }

                    m_Potion.Internalize();
                    Timer.DelayCall(TimeSpan.FromSeconds(1.0), new TimerStateCallback(m_Potion.Reposition_OnTick), new object[] { from, p, map });
                }
            }