Example #1
0
        public override void OnResponse(GameClient sender, RelayInfo info)
        {
            // 3 - Close
            // 4 - Continue

            if (info.ButtonID == 4)
            {
                m_From.DropHolding();

                if (!m_Quest.Completed)
                {
                    m_From.SendLocalizedMessage(1074861);                       // You do not have everything you need!
                }
                else
                {
                    QuestHelper.DeleteItems(m_Quest);

                    if (m_Quester != null)
                    {
                        m_Quest.Quester = m_Quester;
                    }

                    if (!QuestHelper.AnyRewards(m_Quest))
                    {
                        m_Quest.GiveRewards();
                    }
                    else
                    {
                        m_From.CloseGump(typeof(BaseQuestGump));
                        m_From.SendGump(new MLQuestRewardGump(m_Quest));
                    }
                }
            }
        }
Example #2
0
        public override bool OnMoveOver(Mobile m)
        {
            if (!base.OnMoveOver(m))
            {
                return(false);
            }

            PlayerMobile pm = m as PlayerMobile;

            if (pm != null && pm.Backpack != null && pm.HumilityQuestStatus == HumilityQuestStatus.RewardRefused)
            {
                PlainGreyCloak cloak = pm.FindItemOnLayer(Layer.Cloak) as PlainGreyCloak;

                if (cloak == null)
                {
                    pm.DropHolding();
                    cloak = pm.Backpack.FindItemByType <PlainGreyCloak>();
                }

                if (cloak != null)
                {
                    cloak.Delete();
                    pm.PlaceInBackpack(new CloakOfHumility());

                    /* As you near the shrine a strange energy envelops you. Suddenly,
                     * your cloak is transformed into the Cloak of Humility! */
                    pm.SendLocalizedMessage(1075897);

                    pm.PlaySound(0x244);
                    Effects.SendTargetParticles(pm, 0x376A, 1, 32, 0x13A6, EffectLayer.Waist);

                    pm.HumilityQuestStatus = HumilityQuestStatus.Finished;
                }
            }

            return(true);
        }