示例#1
0
        public override bool CanTeleport(Mobile m)
        {
            if (!base.CanTeleport(m))
            {
                return(false);
            }

            if (m_QuestType != null)
            {
                PlayerMobile pm = m as PlayerMobile;

                if (pm == null)
                {
                    return(false);
                }

                MLQuestContext context = MLQuestSystem.GetContext(pm);

                if (context == null || (!context.IsDoingQuest(m_QuestType) && !context.HasDoneQuest(m_QuestType)))
                {
                    TextDefinition.SendMessageTo(m, m_Message);
                    return(false);
                }
            }

            return(true);
        }
示例#2
0
        public override void OnDoubleClick(Mobile from)
        {
            PlayerMobile pm = from as PlayerMobile;

            if (pm == null || pm.Backpack == null)
            {
                return;
            }

            if (pm.InRange(GetWorldLocation(), 2))
            {
                MLQuestContext context = MLQuestSystem.GetContext(pm);

                if (context != null && context.IsDoingQuest(typeof(UnfadingMemoriesPartOne)) && pm.Backpack.FindItemByType(typeof(PrismaticAmber), false) == null)
                {
                    Item amber = new PrismaticAmber();

                    if (pm.PlaceInBackpack(amber))
                    {
                        MLQuestSystem.MarkQuestItem(pm, amber);
                        Delete();
                    }
                    else
                    {
                        pm.SendLocalizedMessage(502385);                         // Your pack cannot hold this item.
                        amber.Delete();
                    }
                }
                else
                {
                    pm.SendLocalizedMessage(1075464);                     // You already have as many of those as you need.
                }
            }
            else
            {
                pm.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045);                 // I can't reach that.
            }
        }