Esempio n. 1
0
        public override void OnDoubleClick(Mobile from)
        {
            if (IsChildOf(from.Backpack))
            {
                if (from.Region != null && from.Region.IsPartOf <MazeOfDeathRegion>())
                {
                    from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1113585); // The compass' arrows flicker. You must be near the right location.
                }
                else
                {
                    from.SendLocalizedMessage(1155663); // Nothing happens.
                }
            }
            else if (RootParent == null && !Movable && !IsLockedDown && !IsSecure)
            {
                if (from.InRange(GetWorldLocation(), 3))
                {
                    if (from.Backpack != null && m_Span == 0)
                    {
                        if (from.Backpack.FindItemByType(typeof(GoldenCompass)) == null)
                        {
                            GoldenCompass gc = new GoldenCompass();

                            if (from.PlaceInBackpack(gc))
                            {
                                gc.StartTimer();
                                from.Backpack.DropItem(gc);
                                from.SendLocalizedMessage(1072223); // An item has been placed in your backpack.
                                gc.SendTimeRemainingMessage(from);
                            }
                            else
                            {
                                gc.Delete();
                            }
                        }
                        else
                        {
                            from.SendLocalizedMessage(501885); // You already own one of those!
                        }
                    }
                }
                else
                {
                    from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that.
                }
            }
        }
 public override void OnDoubleClick(Mobile from)
 {
     if (IsChildOf(from.Backpack) && from.Region != null && from.Region.IsPartOf(typeof(MazeOfDeathRegion)))
     {
         from.CloseGump(typeof(CompassDirectionGump));
         from.SendGump(new CompassDirectionGump(from));
     }
     else if (RootParent == null && from.InRange(GetWorldLocation(), 3) && !Movable && !IsLockedDown && !IsSecure)
     {
         if (from.Backpack != null && m_Span == 0 && from.Backpack.FindItemByType(typeof(GoldenCompass)) == null)
         {
             GoldenCompass c = new GoldenCompass();
             c.StartTimer();
             from.Backpack.DropItem(c);
             from.SendLocalizedMessage(1113584); // Please return what you borrow!
         }
     }
 }
Esempio n. 3
0
 public override void OnDoubleClick(Mobile from)
 {
     if (IsChildOf(from.Backpack) && from.Region != null && from.Region.IsPartOf(typeof(MazeOfDeathRegion)))
     {
         from.CloseGump(typeof(CompassDirectionGump));
         from.SendGump(new CompassDirectionGump(from));
     }
     else if (RootParent == null && from.InRange(GetWorldLocation(), 3) && !Movable && !IsLockedDown && !IsSecure)
     {
         if (from.Backpack != null && m_Span == 0 && from.Backpack.FindItemByType(typeof(GoldenCompass)) == null)
         {
             GoldenCompass c = new GoldenCompass();
             c.StartTimer();
             from.Backpack.DropItem(c);
             from.SendLocalizedMessage(1113584); // Please return what you borrow!
         }
     }
 }