public override bool OnMoveOver(Mobile m)
        {
            var player = m as PlayerMobile;

            if (player != null)
            {
                var qs = player.Quest;

                if (qs is HaochisTrialsQuest)
                {
                    if (HaochisTrialsQuest.HasLostHaochisKatana(player))
                    {
                        Item katana = new HaochisKatana();

                        if (!player.PlaceInBackpack(katana))
                        {
                            katana.Delete();
                            player.SendLocalizedMessage(1046260);
                            // You need to clear some space in your inventory to continue with the quest.  Come back here when you have more space in your inventory.
                        }
                    }
                    else
                    {
                        var obj = qs.FindObjective(typeof(FifthTrialIntroObjective));

                        if (obj != null && !obj.Completed)
                        {
                            Item katana = new HaochisKatana();

                            if (player.PlaceInBackpack(katana))
                            {
                                obj.Complete();
                            }
                            else
                            {
                                katana.Delete();
                                player.SendLocalizedMessage(1046260);
                                // You need to clear some space in your inventory to continue with the quest.  Come back here when you have more space in your inventory.
                            }
                        }
                    }
                }
            }

            return(base.OnMoveOver(m));
        }
Example #2
0
        public override void OnTalk(PlayerMobile player, bool contextMenu)
        {
            QuestSystem qs = player.Quest;

            if (qs is HaochisTrialsQuest)
            {
                if (HaochisTrialsQuest.HasLostHaochisKatana(player))
                {
                    qs.AddConversation(new LostSwordConversation());
                    return;
                }

                QuestObjective obj = qs.FindObjective <FindHaochiObjective>();

                if (obj?.Completed == false)
                {
                    obj.Complete();
                    return;
                }

                obj = qs.FindObjective <FirstTrialReturnObjective>();

                if (obj?.Completed == false)
                {
                    player.AddToBackpack(new LeatherDo());
                    obj.Complete();
                    return;
                }

                obj = qs.FindObjective <SecondTrialReturnObjective>();

                if (obj?.Completed == false)
                {
                    if (((SecondTrialReturnObjective)obj).Dragon)
                    {
                        player.AddToBackpack(new LeatherSuneate());
                    }

                    obj.Complete();
                    return;
                }

                obj = qs.FindObjective <ThirdTrialReturnObjective>();

                if (obj?.Completed == false)
                {
                    player.AddToBackpack(new LeatherHiroSode());
                    obj.Complete();
                    return;
                }

                obj = qs.FindObjective <FourthTrialReturnObjective>();

                if (obj?.Completed == false)
                {
                    if (!((FourthTrialReturnObjective)obj).KilledCat)
                    {
                        Container cont = GetNewContainer();
                        cont.DropItem(new LeatherHiroSode());
                        cont.DropItem(new JinBaori());
                        player.AddToBackpack(cont);
                    }

                    obj.Complete();
                    return;
                }

                obj = qs.FindObjective <FifthTrialReturnObjective>();

                if (obj?.Completed == false)
                {
                    HaochisKatana katana = player.Backpack?.FindItemByType <HaochisKatana>();
                    if (katana == null)
                    {
                        return;
                    }

                    katana.Delete();
                    obj.Complete();

                    obj = qs.FindObjective <FifthTrialIntroObjective>();
                    if (((FifthTrialIntroObjective)obj)?.StolenTreasure == true)
                    {
                        qs.AddConversation(new SixthTrialIntroConversation(true));
                    }
                    else
                    {
                        qs.AddConversation(new SixthTrialIntroConversation(false));
                    }
                }

                obj = qs.FindObjective <SixthTrialReturnObjective>();

                if (obj?.Completed == false)
                {
                    obj.Complete();
                    return;
                }

                obj = qs.FindObjective <SeventhTrialReturnObjective>();

                if (obj?.Completed == false)
                {
                    BaseWeapon weapon = new Daisho();
                    BaseRunicTool.ApplyAttributesTo(weapon, Utility.Random(1, 3), 10, 30);
                    player.AddToBackpack(weapon);

                    BaseArmor armor = new LeatherDo();
                    BaseRunicTool.ApplyAttributesTo(armor, Utility.Random(1, 3), 10, 20);
                    player.AddToBackpack(armor);

                    obj.Complete();
                }
            }
        }
Example #3
0
        public override void OnTalk(PlayerMobile player, bool contextMenu)
        {
            QuestSystem qs = player.Quest;

            if (qs is HaochisTrialsQuest)
            {
                if (HaochisTrialsQuest.HasLostHaochisKatana(player))
                {
                    qs.AddConversation(new LostSwordConversation());
                    return;
                }

                QuestObjective obj = qs.FindObjective(typeof(FindHaochiObjective));

                if (obj != null && !obj.Completed)
                {
                    obj.Complete();
                    return;
                }

                obj = qs.FindObjective(typeof(FirstTrialReturnObjective));

                if (obj != null && !obj.Completed)
                {
                    player.AddToBackpack(new LeatherDo());
                    obj.Complete();
                    return;
                }

                obj = qs.FindObjective(typeof(SecondTrialReturnObjective));

                if (obj != null && !obj.Completed)
                {
                    if (((SecondTrialReturnObjective)obj).Dragon)
                    {
                        player.AddToBackpack(new LeatherSuneate());
                    }

                    obj.Complete();
                    return;
                }

                obj = qs.FindObjective(typeof(ThirdTrialReturnObjective));

                if (obj != null && !obj.Completed)
                {
                    player.AddToBackpack(new LeatherHiroSode());
                    obj.Complete();
                    return;
                }

                obj = qs.FindObjective(typeof(FourthTrialReturnObjective));

                if (obj != null && !obj.Completed)
                {
                    if (!((FourthTrialReturnObjective)obj).KilledCat)
                    {
                        Container cont = GetNewContainer();
                        cont.DropItem(new LeatherHiroSode());
                        cont.DropItem(new JinBaori());
                        player.AddToBackpack(cont);
                    }

                    obj.Complete();
                    return;
                }

                obj = qs.FindObjective(typeof(FifthTrialReturnObjective));

                if (obj != null && !obj.Completed)
                {
                    Container pack = player.Backpack;
                    if (pack != null)
                    {
                        Item katana = pack.FindItemByType(typeof(HaochisKatana));
                        if (katana != null)
                        {
                            katana.Delete();
                            obj.Complete();

                            obj = qs.FindObjective(typeof(FifthTrialIntroObjective));
                            if (obj != null && ((FifthTrialIntroObjective)obj).StolenTreasure)
                            {
                                qs.AddConversation(new SixthTrialIntroConversation(true));
                            }
                            else
                            {
                                qs.AddConversation(new SixthTrialIntroConversation(false));
                            }
                        }
                    }

                    return;
                }

                obj = qs.FindObjective(typeof(SixthTrialReturnObjective));

                if (obj != null && !obj.Completed)
                {
                    obj.Complete();
                    return;
                }

                obj = qs.FindObjective(typeof(SeventhTrialReturnObjective));

                if (obj != null && !obj.Completed)
                {
                    BaseWeapon weapon = new Daisho();
                    player.AddToBackpack(weapon);

                    BaseArmor armor = new LeatherDo();
                    player.AddToBackpack(armor);

                    obj.Complete();
                    return;
                }
            }
        }