Ejemplo n.º 1
0
        public override void OnMovement(Mobile m, Point3D oldLocation)
        {
            PlayerMobile pm = m as PlayerMobile;

            if (pm == null || !pm.InRange(Location, 3))
            {
                return;
            }

            WhosMostHumbleQuest quest = QuestHelper.GetQuest(pm, typeof(WhosMostHumbleQuest)) as WhosMostHumbleQuest;

            if (quest != null)
            {
                if (m_NextGreet < DateTime.UtcNow && pm is PlayerMobile)
                {
                    Item item = pm.FindItemOnLayer(Layer.Cloak);

                    if (item is GreyCloak && ((GreyCloak)item).Owner == null && Greeting > 0)
                    {
                        SayTo(pm, Greeting);

                        m_NextGreet = DateTime.UtcNow + TimeSpan.FromSeconds(5);
                    }
                }
            }
        }
Ejemplo n.º 2
0
        public HumilityItemQuestGump(HumilityQuestMobile mobile, WhosMostHumbleQuest quest, int index)
            : base(75, 25)
        {
            m_Mobile   = mobile;
            m_Quest    = quest;
            m_NPCIndex = index;

            Disposable = false;
            Closable   = false;
            AddImageTiled(50, 20, 400, 400, 0x1404);
            AddImageTiled(83, 15, 350, 15, 0x280A);
            AddImageTiled(50, 29, 30, 390, 0x28DC);
            AddImageTiled(34, 140, 17, 279, 0x242F);
            AddImage(48, 135, 0x28AB);
            AddImage(-16, 285, 0x28A2);
            AddImage(0, 10, 0x28B5);
            AddImage(25, 0, 0x28B4);
            AddImageTiled(415, 29, 44, 390, 0xA2D);
            AddImageTiled(415, 29, 30, 390, 0x28DC);
            AddLabel(100, 50, 0x481, "");
            AddImage(370, 50, 0x589);
            AddImage(379, 60, 0x15E8);
            AddImage(425, 0, 0x28C9);
            AddImage(34, 419, 0x2842);
            AddImage(442, 419, 0x2840);
            AddImageTiled(51, 419, 392, 17, 0x2775);
            AddHtmlLocalized(130, 45, 270, 16, 1049010, 0x7FFF, false, false); // Quest Offer
            AddHtmlLocalized(98, 156, 312, 180, mobile.Greeting + 1, 0x15F90, false, true);
            AddImage(90, 33, 0x232D);
            AddImageTiled(130, 65, 175, 1, 0x238D);
            AddButton(95, 395, 0x2EE9, 0x2EEB, 1, GumpButtonType.Reply, 0);
            AddHtmlLocalized(0, 0, 0, 0, 1011036, false, false); // OKAY
        }
Ejemplo n.º 3
0
        public HumilityItemQuestGump(HumilityQuestMobile mobile, WhosMostHumbleQuest quest, int index) : base(50, 50)
        {
            m_Mobile   = mobile;
            m_Quest    = quest;
            m_NPCIndex = index;

            AddBackground(0, 0, 350, 250, 2600);
            AddHtml(100, 25, 175, 16, string.Format("{0} {1}", mobile.Name, mobile.Title), false, false);

            AddHtmlLocalized(40, 60, 270, 140, mobile.Greeting + 1, 1, false, true);
        }
Ejemplo n.º 4
0
        public HumilityItemQuestGump(HumilityQuestMobile mobile, WhosMostHumbleQuest quest, int index) : base(50, 50)
        {
            m_Mobile = mobile;
            m_Quest = quest;
            m_NPCIndex = index;

            AddBackground(0, 0, 350, 250, 2600);
            AddHtml(100, 25, 175, 16, String.Format("{0} {1}", mobile.Name, mobile.Title), false, false);

            AddHtmlLocalized(40, 60, 270, 140, mobile.Greeting + 1, 1, false, true);
        }
Ejemplo n.º 5
0
        public override void OnMovement(Mobile m, Point3D oldLocation)
        {
            if (m_NextTalk < DateTime.UtcNow && m is PlayerMobile pm && pm.Backpack != null && pm.InRange(Location, 8))
            {
                WhosMostHumbleQuest quest = QuestHelper.GetQuest(pm, typeof(WhosMostHumbleQuest)) as WhosMostHumbleQuest;

                if (quest != null)
                {
                    Item chain = pm.Backpack.FindItemByType(typeof(IronChain));

                    if (chain != null && chain.QuestItem)
                    {
                        SayTo(pm, 1075773);
                        m_NextTalk = DateTime.UtcNow + TimeSpan.FromSeconds(10);
                    }
                }
            }
        }
Ejemplo n.º 6
0
        public override void OnDoubleClick(Mobile from)
        {
            PlayerMobile pm = from as PlayerMobile;

            if (pm == null || !InRange(from.Location, 3))
            {
                return;
            }

            WhosMostHumbleQuest quest = QuestHelper.GetQuest(pm, typeof(WhosMostHumbleQuest)) as WhosMostHumbleQuest;

            if (quest != null && pm.Backpack != null && !quest.HasGivenTo(this))
            {
                Item item = from.FindItemOnLayer(Layer.Cloak);

                if (item is GreyCloak && ((GreyCloak)item).Owner == null)
                {
                    int idx = HumilityQuestMobileInfo.GetNPCIndex(GetType());

                    if (idx > -1 && quest.Infos.ContainsKey(idx) && idx < quest.Infos.Count)
                    {
                        Type needs = quest.Infos[idx].Needs;

                        Item need = from.Backpack.FindItemByType(needs);

                        // Found needed item
                        if (need != null)
                        {
                            need.Delete();
                            quest.RemoveQuestItem(need);

                            Item nextItem = Loot.Construct(quest.Infos[idx].Gives);

                            if (nextItem != null)
                            {
                                from.Backpack.DropItem(nextItem);
                                quest.AddQuestItem(nextItem, this);

                                if (this is Sean)
                                {
                                    SayTo(from, Greeting + 3, string.Format("#{0}", quest.Infos[idx].NeedsLoc));
                                }
                                else
                                {
                                    SayTo(from, Greeting + 4, string.Format("#{0}\t#{1}", quest.Infos[idx].NeedsLoc, quest.Infos[idx].GivesLoc));
                                }
                            }
                        }
                        else //Didn't find needed item
                        {
                            from.SendGump(new HumilityItemQuestGump(this, quest, idx));
                        }
                    }
                    else
                    {
                        Console.WriteLine("Error finding index for {0}", this);
                    }
                }
                else
                {
                    base.OnDoubleClick(from);
                }
            }
        }