Exemple #1
0
        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.Backpack != null && player.Backpack.ConsumeTotal(typeof(Gold), 10))
                            {
                                obj.Complete();
                            }
                            else
                            {
                                BankBox bank = player.FindBankNoCreate();
                                if (bank != null && bank.ConsumeTotal(typeof(Gold), 10))
                                {
                                    obj.Complete();
                                }

                                else
                                {
                                    player.SendLocalizedMessage(1055108); // You don't have enough gold to buy the sheet music.
                                }
                            }
                        }
                    }
                }
            }
        }
Exemple #2
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());
                    }
                }
            }
        }