Ejemplo n.º 1
0
        public override void OnTalk(PlayerMobile player, bool contextMenu)
        {
            QuestSystem qs = player.Quest;

            if (!(qs is CollectorQuest))
            {
                return;
            }

            FindSheetMusicObjective obj = qs.FindObjective <FindSheetMusicObjective>();

            if (obj?.Completed == false)
            {
                Direction = GetDirectionTo(player);

                if (obj.IsInRightTheater())
                {
                    player.CloseGump <SheetMusicOfferGump>();
                    player.SendGump(new SheetMusicOfferGump());
                }
                else
                {
                    qs.AddConversation(new NoSheetMusicConversation());
                }
            }
        }
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            if (info.ButtonID == 1 && info.IsSwitched(1))
            {
                PlayerMobile player = sender.Mobile as PlayerMobile;

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

                    if (qs is CollectorQuest)
                    {
                        FindSheetMusicObjective obj = qs.FindObjective(typeof(FindSheetMusicObjective)) as FindSheetMusicObjective;

                        if (obj != null && !obj.Completed)
                        {
                            if (player.BankBox != null && player.BankBox.ConsumeTotal(typeof(Gold), 10))
                            {
                                obj.Complete();
                            }
                            else
                            {
                                player.SendLocalizedMessage(1055108);                                   // You don't have enough gold to buy the sheet music.
                            }
                        }
                    }
                }
            }
        }
Ejemplo n.º 3
0
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            if (info.ButtonID == 1 && info.IsSwitched(1))
            {
                if (sender.Mobile is PlayerMobile player)
                {
                    QuestSystem qs = player.Quest;

                    if (!(qs is CollectorQuest))
                    {
                        return;
                    }

                    FindSheetMusicObjective obj = qs.FindObjective <FindSheetMusicObjective>();

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

                    if (player.Backpack?.ConsumeTotal(typeof(Gold), 10) == true)
                    {
                        obj.Complete();
                    }
                    else
                    {
                        if (player.FindBankNoCreate()?.ConsumeTotal(typeof(Gold), 10) == true)
                        {
                            obj.Complete();
                        }

                        else
                        {
                            player.SendLocalizedMessage(
                                1055108); // You don't have enough gold to buy the sheet music.
                        }
                    }
                }
            }
        }
Ejemplo n.º 4
0
        public override void OnTalk(PlayerMobile player, bool contextMenu)
        {
            QuestSystem qs = player.Quest;

            if (qs is CollectorQuest)
            {
                FindSheetMusicObjective obj = qs.FindObjective(typeof(FindSheetMusicObjective)) as FindSheetMusicObjective;

                if (obj != null && !obj.Completed)
                {
                    Direction = GetDirectionTo(player);

                    if (obj.IsInRightTheater())
                    {
                        player.CloseGump(typeof(SheetMusicOfferGump));
                        player.SendGump(new SheetMusicOfferGump());
                    }
                    else
                    {
                        qs.AddConversation(new NoSheetMusicConversation());
                    }
                }
            }
        }