Exemplo n.º 1
0
        public override void OnChestOpened(Mobile from, TreasureMapChest chest)
        {
            if (from is PlayerMobile)
            {
                var quest = QuestHelper.GetQuest <TheTreasureChaseQuest>((PlayerMobile)from);

                if (quest != null)
                {
                    if (Level == 0)
                    {
                        TownCryerSystem.CompleteQuest((PlayerMobile)from, 1158239, 1158251, 0x655);

                        /*Your eyes widen as you pry open the old chest and reveal the treasure within! Even this small cache
                         * excites you as the thought of bigger and better treasure looms on the horizon! The map is covered
                         * in ancient runes and marks the location of another treasure hoard. You carefully furl the map and
                         * set off on your next adventure!*/

                        from.SendLocalizedMessage(1158245, "", 0x23); // You have found the first zealot treasure! As you dig up the chest a leather bound case appears to contain an additional map. You place it in your backpack for later examination.
                        chest.DropItem(new BuriedRichesTreasureMap(1));
                    }
                    else
                    {
                        from.SendLocalizedMessage(1158246, "", 0x23); // You have found the second zealot treasure! As you dig up the chest a leather bound case appears to contain an additional map. You place it in your backpack for later examination.
                        quest.CompleteQuest();
                    }
                }
            }
        }
Exemplo n.º 2
0
        public override void OnDoubleClick(Mobile m)
        {
            if (m is PlayerMobile mobile && mobile.InRange(Location, 5))
            {
                PaladinsOfTrinsic quest = QuestHelper.GetQuest(mobile, typeof(PaladinsOfTrinsic)) as PaladinsOfTrinsic;

                if (quest != null)
                {
                    quest.GiveRewards();
                }
                else
                {
                    PaladinsOfTrinsic2 quest2 = QuestHelper.GetQuest(mobile, typeof(PaladinsOfTrinsic2)) as PaladinsOfTrinsic2;

                    if (quest2 != null)
                    {
                        if (quest2.Completed)
                        {
                            quest2.CompleteQuest();
                        }
                        else
                        {
                            mobile.SendGump(new MondainQuestGump(quest2, MondainQuestGump.Section.InProgress, false));
                            quest2.InProgress();
                        }
                    }
                }
            }
        }
Exemplo n.º 3
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);
                    }
                }
            }
        }
Exemplo n.º 4
0
        public override void OnDoubleClick(Mobile from)
        {
            PlayerMobile pm = from as PlayerMobile;

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

            if (QuestHelper.GetQuest(pm, typeof(WhosMostHumbleQuest)) is WhosMostHumbleQuest quest && pm.Backpack != null && !quest.HasGivenTo(this))
            {
                Item item = from.FindItemOnLayer(Layer.Cloak);

                if (item is GreyCloak cloak && cloak.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);
                    }
                }
Exemplo n.º 5
0
        public bool CanBeSeenBy(PlayerMobile pm)
        {
            if (pm.AccessLevel > AccessLevel.Player)
            {
                return(true);
            }

            var quest = QuestHelper.GetQuest <RightingWrongQuest4>(pm);

            return(quest != null && !quest.Completed);
        }
Exemplo n.º 6
0
        public override void OnMovement(Mobile m, Point3D oldLocation)
        {
            if (m is PlayerMobile && InRange(m.Location, 5) && !InRange(oldLocation, 5))
            {
                APleaFromMinocQuest quest = QuestHelper.GetQuest <APleaFromMinocQuest>((PlayerMobile)m);

                if (quest != null)
                {
                    quest.CompleteQuest();
                }
            }
        }
Exemplo n.º 7
0
        public override void OnMovement(Mobile m, Point3D oldLocation)
        {
            if (m is PlayerMobile && InRange(m.Location, 5) && !InRange(oldLocation, 5))
            {
                RightingWrongQuest quest = QuestHelper.GetQuest <RightingWrongQuest>((PlayerMobile)m);

                if (quest != null)
                {
                    quest.OnCompleted();
                    quest.GiveRewards();
                }
            }
        }
        public static void CheckLocation(PlayerMobile pm, Point3D oldLocation)
        {
            AVisitToCastleBlackthornQuest quest = QuestHelper.GetQuest <AVisitToCastleBlackthornQuest>(pm);

            if (quest != null)
            {
                quest.OnCompleted();
                TownCryerSystem.CompleteQuest(quest.Owner, 1158202, quest.Complete, 0x61B);

                quest.Objectives[0].CurProgress++;
                quest.GiveRewards();
            }
        }
Exemplo n.º 9
0
        public override void OnMovement(Mobile m, Point3D oldLocation)
        {
            if (m is PlayerMobile mobile && InRange(mobile.Location, 5) && !InRange(oldLocation, 5))
            {
                PaladinsOfTrinsic2 quest = QuestHelper.GetQuest <PaladinsOfTrinsic2>(mobile);

                if (quest != null && !quest.SentMessage && quest.Completed)
                {
                    mobile.SendLocalizedMessage(1158111); // You have proven yourself Honorable, the Lord Commander looks overjoyed as you approach him triumphantly! Speak to him to claim your reward!
                    quest.SentMessage = true;
                }
            }
        }
Exemplo n.º 10
0
        public override void OnDoubleClick(Mobile m)
        {
            if (m is PlayerMobile)
            {
                var pm = m as PlayerMobile;

                if (QuestHelper.CheckDoneOnce(pm, typeof(APleaFromMinocQuest), this, false))
                {
                    if (CheckProgress(pm))
                    {
                        return;
                    }

                    AForcedSacraficeQuest2 quest = QuestHelper.GetQuest <AForcedSacraficeQuest2>(pm);

                    if (quest != null && quest.Completed)
                    {
                        quest.CompleteQuest();
                        return;
                    }

                    BaseQuest q = QuestHelper.RandomQuest(pm, new Type[] { typeof(ClearingCovetousQuest) }, this, false);

                    if (q == null)
                    {
                        q = QuestHelper.RandomQuest(pm, new Type[] { typeof(AForcedSacraficeQuest) }, this, false);

                        if (q == null)
                        {
                            q = QuestHelper.RandomQuest(pm, new Type[] { typeof(AForcedSacraficeQuest2) }, this, false);
                        }
                    }

                    if (q != null)
                    {
                        pm.CloseGump(typeof(MondainQuestGump));
                        pm.SendGump(new MondainQuestGump(q));
                    }
                    else
                    {
                        SayTo(m, 1080107, 0x3B2); // I'm sorry, I have nothing for you at this time.
                    }
                }
                else
                {
                    SayTo(m, 1080107, 0x3B2); // I'm sorry, I have nothing for you at this time.
                }
            }
        }
Exemplo n.º 11
0
        }                                                               // // You've completed an Animal Training quest! Visit an Animal Trainer to continue!

        public static void CheckTame(PlayerMobile pm)
        {
            if (pm == null)
            {
                return;
            }

            var quest = QuestHelper.GetQuest(pm, typeof(TamingPetQuest));

            if (quest != null && !quest.Completed)
            {
                quest.Objectives[0].CurProgress++;
                quest.OnCompleted();
            }
        }
Exemplo n.º 12
0
        public static void CheckComplete(PlayerMobile pm)
        {
            if (pm == null)
            {
                return;
            }

            BaseQuest quest = QuestHelper.GetQuest(pm, typeof(TeachingSomethingNewQuest));

            if (quest != null && !quest.Completed)
            {
                quest.Objectives[0].CurProgress++;
                quest.OnCompleted();
            }
        }
Exemplo n.º 13
0
        public static void OnBossSlain(Despise.DespiseBoss boss)
        {
            foreach (DamageStore ds in boss.GetLootingRights())
            {
                if (ds.m_Mobile is PlayerMobile pm)
                {
                    WhisperingWithWispsQuest quest = QuestHelper.GetQuest <WhisperingWithWispsQuest>(pm);

                    if (quest != null && !quest.Completed)
                    {
                        quest.Objectives[0].CurProgress++;
                        quest.OnCompleted();
                    }
                }
            }
        }
Exemplo n.º 14
0
        public override void OnDoubleClick(Mobile m)
        {
            if (m is PlayerMobile && m.InRange(Location, 5))
            {
                RightingWrongQuest4 quest = QuestHelper.GetQuest <RightingWrongQuest4>((PlayerMobile)m);

                if (quest != null && quest.Completed)
                {
                    quest.CompleteQuest();
                }
                else
                {
                    base.OnDoubleClick(m);
                }
            }
        }
Exemplo n.º 15
0
        public override void OnDoubleClick(Mobile from)
        {
            if (from is PlayerMobile && from.InRange(Location, 2))
            {
                var quest = QuestHelper.GetQuest <RightingWrongQuest4>((PlayerMobile)from);

                if (from is PlayerMobile && quest != null && !quest.Completed)
                {
                    quest.Objectives[0].CurProgress++;
                    quest.OnCompleted();

                    Visible = false;
                    Visible = true;
                }
            }
        }
Exemplo n.º 16
0
        private bool CheckProgress(PlayerMobile pm)
        {
            foreach (var t in _Quests)
            {
                var quest = QuestHelper.GetQuest(pm, t);

                if (quest != null && !quest.Completed)
                {
                    pm.CloseGump(typeof(MondainQuestGump));
                    pm.SendGump(new MondainQuestGump(quest, MondainQuestGump.Section.InProgress, false));
                    return(true);
                }
            }

            return(false);
        }
Exemplo n.º 17
0
        public static void OnBossSlain(Server.Engines.Despise.DespiseBoss boss)
        {
            foreach (var ds in boss.GetLootingRights())
            {
                if (ds.m_Mobile is PlayerMobile)
                {
                    var pm    = ds.m_Mobile as PlayerMobile;
                    var quest = QuestHelper.GetQuest <WhisperingWithWispsQuest>(pm);

                    if (quest != null && !quest.Completed)
                    {
                        quest.Objectives[0].CurProgress++;
                        quest.OnCompleted();
                    }
                }
            }
        }
Exemplo n.º 18
0
        public override void OnTalk(PlayerMobile player)
        {
            if (TheQuestionsQuest.CooldownTable.ContainsKey(player))
            {
                SayTo(player, 1075787, 1150); // I feel that thou hast yet more to learn about Humility... Please ponder these things further, and visit me again on the 'morrow.
                return;
            }

            if (QuestHelper.GetQuest(player, typeof(TheQuestionsQuest)) is TheQuestionsQuest q && !q.Completed)
            {
                SayTo(player, 1080107, 0x3B2); // I'm sorry, I have nothing for you at this time.
                return;
            }

            if (CheckQuestStatus(player, HumilityQuestStatus.RewardPending))
            {
                return;
            }

            if (CheckQuestStatus(player, HumilityQuestStatus.RewardRefused))
            {
                var quest = new HumilityProofGump
                {
                    Owner   = player,
                    Quester = this
                };

                player.SendGump(new MondainQuestGump(quest, MondainQuestGump.Section.Complete, false, true));

                return;
            }

            if (CheckQuestStatus(player, HumilityQuestStatus.RewardAccepted))
            {
                SayTo(player, 1075898, 0x3B2); // Worry not, noble one! We shall never forget thy deeds!
                return;
            }

            if (CheckQuestStatus(player, HumilityQuestStatus.Finished))
            {
                SayTo(player, 1075899, 0x3B2); // Hail, friend!
                return;
            }

            base.OnTalk(player);
        }
Exemplo n.º 19
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);
                    }
                }
            }
        }
Exemplo n.º 20
0
        public override void OnDoubleClick(Mobile m)
        {
            if (m is PlayerMobile pm && m.InRange(Location, 5))
            {
                if (QuestHelper.CheckDoneOnce(pm, typeof(Missing), null, false))
                {
                    if (QuestHelper.CheckDoneOnce(pm, typeof(EscortToDugan), null, false))
                    {
                        var q = QuestHelper.GetQuest <EndingtheThreat>(pm);

                        if (q == null)
                        {
                            var quest = QuestHelper.RandomQuest(pm, new[] { typeof(EndingtheThreat) }, this);

                            if (quest != null)
                            {
                                pm.CloseGump(typeof(MondainQuestGump));
                                pm.SendGump(new MondainQuestGump(quest));
                            }
                        }
                        else
                        {
                            OnTalk(pm);
                        }
                    }
                    else
                    {
                        OnOfferFailed();
                    }
                }
                else
                {
                    OnTalk(pm);
                }
            }
        }
Exemplo n.º 21
0
        public static bool OnHarvest(Mobile m, Item tool)
        {
            if (!(m is PlayerMobile) || m.Map != Map.TerMur)
            {
                return(false);
            }

            PlayerMobile pm = (PlayerMobile)m;

            if ((pm.ToggleMiningStone || pm.ToggleStoneOnly) && VolcanoMineBounds.Contains(m.Location))
            {
                object locked = tool;

                if (!m.BeginAction(locked))
                {
                    return(false);
                }

                m.Animate(AnimationType.Attack, 3);

                Timer.DelayCall(Mining.System.OreAndStone.EffectSoundDelay, () =>
                {
                    m.PlaySound(Utility.RandomList(Mining.System.OreAndStone.EffectSounds));
                });

                Timer.DelayCall(Mining.System.OreAndStone.EffectDelay, () =>
                {
                    if (QuestHelper.GetQuest(pm, typeof(TheGreatVolcanoQuest)) is TheGreatVolcanoQuest quest && !quest.Completed && 0.05 > Utility.RandomDouble())
                    {
                        if (m.CheckSkill(SkillName.Mining, 90, 100))
                        {
                            double chance = Utility.RandomDouble();

                            if (0.08 > chance)
                            {
                                BaseCreature spawn = new VolcanoElemental();
                                Point3D p          = m.Location;

                                for (int i = 0; i < 10; i++)
                                {
                                    int x = Utility.RandomMinMax(p.X - 1, p.X + 1);
                                    int y = Utility.RandomMinMax(p.Y - 1, p.Y + 1);
                                    int z = Map.TerMur.GetAverageZ(x, y);

                                    if (Map.TerMur.CanSpawnMobile(x, y, z))
                                    {
                                        p = new Point3D(x, y, z);
                                        break;
                                    }
                                }

                                spawn.OnBeforeSpawn(p, Map.TerMur);
                                spawn.MoveToWorld(p, Map.TerMur);
                                spawn.OnAfterSpawn();

                                spawn.Combatant = m;

                                m.SendLocalizedMessage(1156508);      // Uh oh...that doesn't look like a lava rock!
                            }
                            else if (0.55 > chance)
                            {
                                m.PrivateOverheadMessage(MessageType.Regular, 1154, 1156507, m.NetState);     // *You uncover a lava rock and carefully store it for later!*
                                quest.Update(m);
                            }
                            else
                            {
                                m.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1156509);     // You loosen some dirt but fail to find anything.
                            }
                        }
                        else
                        {
                            m.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1156509);     // You loosen some dirt but fail to find anything.
                        }
                    }
                    else
                    {
                        m.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1156509);     // You loosen some dirt but fail to find anything.
                    }

                    if (tool is IUsesRemaining remaining)
                    {
                        remaining.UsesRemaining--;

                        if (remaining.UsesRemaining <= 0)
                        {
                            m.SendLocalizedMessage(1044038);     // You have worn out your tool!
                            tool.Delete();
                        }
                    }

                    m.EndAction(locked);
                });
Exemplo n.º 22
0
        public static bool OnHarvest(Mobile m, Item tool)
        {
            if (m is PlayerMobile && VolcanoMineBounds.Contains(m.Location))
            {
                object locked = tool;

                if (!m.BeginAction(locked))
                {
                    return(false);
                }

                m.Animate(Utility.RandomList(Mining.System.OreAndStone.EffectActions), 5, 1, true, false, 0);
                Timer.DelayCall(Mining.System.OreAndStone.EffectSoundDelay, () =>
                {
                    m.PlaySound(Utility.RandomList(Mining.System.OreAndStone.EffectSounds));
                });

                Timer.DelayCall(Mining.System.OreAndStone.EffectDelay, () =>
                {
                    TheGreatVolcanoQuest quest = QuestHelper.GetQuest((PlayerMobile)m, typeof(TheGreatVolcanoQuest)) as TheGreatVolcanoQuest;
                    Map map = m.Map;

                    if (map != null && map != Map.Internal && quest != null && !quest.Completed && 0.05 > Utility.RandomDouble())
                    {
                        if (m.CheckSkill(SkillName.Mining, 90, 100))
                        {
                            double chance = Utility.RandomDouble();

                            if (0.08 > chance)
                            {
                                BaseCreature spawn = new VolcanoElemental();
                                Point3D p          = m.Location;

                                for (int i = 0; i < 10; i++)
                                {
                                    int x = Utility.RandomMinMax(p.X - 1, p.X + 1);
                                    int y = Utility.RandomMinMax(p.Y - 1, p.Y + 1);
                                    int z = map.GetAverageZ(x, y);

                                    if (map.CanSpawnMobile(x, y, z))
                                    {
                                        p = new Point3D(x, y, z);
                                        break;
                                    }
                                }

                                spawn.MoveToWorld(p, map);
                                spawn.Combatant = m;

                                m.SendLocalizedMessage(1156508);      // Uh oh...that doesn't look like a lava rock!
                            }
                            else if (0.55 > chance)
                            {
                                //m.AddToBackpack(new LavaStone());
                                m.PrivateOverheadMessage(Server.Network.MessageType.Regular, 1154, 1156507, m.NetState);     // *You uncover a lava rock and carefully store it for later!*
                                quest.Update(m);
                            }
                            else
                            {
                                m.SendLocalizedMessage(1156509);      // You loosen some dirt but fail to find anything.
                            }
                        }
                        else
                        {
                            m.SendLocalizedMessage(1156509);      // You loosen some dirt but fail to find anything.
                        }
                    }
                    else
                    {
                        m.SendLocalizedMessage(1156509);      // You loosen some dirt but fail to find anything.
                    }
                    if (tool is IUsesRemaining)
                    {
                        ((IUsesRemaining)tool).UsesRemaining--;

                        if (((IUsesRemaining)tool).UsesRemaining <= 0)
                        {
                            m.SendLocalizedMessage(1044038);     // You have worn out your tool!
                            tool.Delete();
                        }
                    }

                    m.EndAction(locked);
                });

                return(true);
            }

            return(false);
        }