public override void OnTalk(PlayerMobile player, bool contextMenu)
        {
            Direction = GetDirectionTo(player);

            QuestSystem qs = player.Quest;

            if (qs is StolenNecklaceQuest)
            {
                if (qs.IsObjectiveInProgress(typeof(GetStolenNecklaceObjective)))
                {
                    qs.AddConversation(new DuringGetStolenNecklaceConversation());
                }
            }
            else
            {
                QuestSystem newQuest = new StolenNecklaceQuest(player);

                if (qs == null && QuestSystem.CanOfferQuest(player, typeof(StolenNecklaceQuest)))
                {
                    newQuest.SendOffer();
                }
                else
                {
                    newQuest.AddConversation(new DontOfferConversation());
                }
            }
        }
        public override bool CanDrop(PlayerMobile player)
        {
            StolenNecklaceQuest qs = player.Quest as StolenNecklaceQuest;

            if (qs == null)
            {
                return(true);
            }

            /*return !qs.IsObjectiveInProgress( typeof( ReturnStolenNecklaceObjective ) );*/
            return(false);
        }
示例#3
0
        public override void OnDoubleClick(Mobile from)
        {
            PlayerMobile player = from as PlayerMobile;

            if (player != null && player.InRange(GetWorldLocation(), 2))
            {
                QuestSystem qs = player.Quest;

                if (qs is StolenNecklaceQuest)
                {
                    QuestObjective obj = qs.FindObjective(typeof(GetStolenNecklaceObjective));

                    if ((obj != null && !obj.Completed) || StolenNecklaceQuest.HasStolenNecklace(player))
                    {
                        Item necklace = new QuestStolenNecklace();

                        if (player.PlaceInBackpack(necklace))
                        {
                            player.SendMessage("You take the necklace from the bookcase and place it into your pack.");

                            if (obj != null && !obj.Completed)
                            {
                                obj.Complete();
                            }
                        }
                        else
                        {
                            player.SendMessage("You find a necklace, but can't pick it up because your pack is too full. Come back when you have more room in your pack.");
                            necklace.Delete();
                        }

                        return;
                    }
                }
            }

            base.OnDoubleClick(from);
        }