コード例 #1
0
        public override bool OnMoveOver(Mobile m)
        {
            PlayerMobile player = m as PlayerMobile;

            if (player != null)
            {
                QuestSystem 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
                    {
                        QuestObjective 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));
        }
コード例 #2
0
ファイル: Haochi.cs プロジェクト: libcs/game.ultimaonline.io
        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();
                    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();
                    return;
                }
            }
        }