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

            if (player.Quest is AmbitiousQueenQuest qs && qs.RedSolen == RedSolen)
            {
                if (qs.IsObjectiveInProgress(typeof(KillQueensObjective)))
                {
                    qs.AddConversation(new DuringKillQueensConversation());
                }
                else
                {
                    QuestObjective obj = qs.FindObjective <ReturnAfterKillsObjective>();

                    if (obj?.Completed == false)
                    {
                        obj.Complete();
                    }
                    else if (qs.IsObjectiveInProgress(typeof(GatherFungiObjective)))
                    {
                        qs.AddConversation(new DuringFungiGatheringConversation());
                    }
                    else
                    {
                        GetRewardObjective lastObj = qs.FindObjective <GetRewardObjective>();

                        if (lastObj?.Completed == false)
                        {
                            bool bagOfSending          = lastObj.BagOfSending;
                            bool powderOfTranslocation = lastObj.PowderOfTranslocation;
                            bool gold = lastObj.Gold;

                            AmbitiousQueenQuest.GiveRewardTo(player, ref bagOfSending, ref powderOfTranslocation, ref gold);

                            lastObj.BagOfSending          = bagOfSending;
                            lastObj.PowderOfTranslocation = powderOfTranslocation;
                            lastObj.Gold = gold;

                            if (!bagOfSending && !powderOfTranslocation && !gold)
                            {
                                lastObj.Complete();
                            }
                            else
                            {
                                qs.AddConversation(new FullBackpackConversation(false, lastObj.BagOfSending,
                                                                                lastObj.PowderOfTranslocation, lastObj.Gold));
                            }
                        }
                    }
                }
            }
Exemple #2
0
        public override void OnTalk(PlayerMobile player, bool contextMenu)
        {
            this.Direction = GetDirectionTo(player);

            AmbitiousQueenQuest qs = player.Quest as AmbitiousQueenQuest;

            if (qs != null && qs.RedSolen == this.RedSolen)
            {
                if (qs.IsObjectiveInProgress(typeof(KillQueensObjective)))
                {
                    qs.AddConversation(new DuringKillQueensConversation());
                }
                else
                {
                    QuestObjective obj = qs.FindObjective(typeof(ReturnAfterKillsObjective));

                    if (obj != null && !obj.Completed)
                    {
                        obj.Complete();
                    }
                    else if (qs.IsObjectiveInProgress(typeof(GatherFungiObjective)))
                    {
                        qs.AddConversation(new DuringFungiGatheringConversation());
                    }
                    else
                    {
                        GetRewardObjective lastObj = qs.FindObjective(typeof(GetRewardObjective)) as GetRewardObjective;

                        if (lastObj != null && !lastObj.Completed)
                        {
                            bool bagOfSending          = lastObj.BagOfSending;
                            bool powderOfTranslocation = lastObj.PowderOfTranslocation;
                            bool gold = lastObj.Gold;

                            AmbitiousQueenQuest.GiveRewardTo(player, ref bagOfSending, ref powderOfTranslocation, ref gold);

                            lastObj.BagOfSending          = bagOfSending;
                            lastObj.PowderOfTranslocation = powderOfTranslocation;
                            lastObj.Gold = gold;

                            if (!bagOfSending && !powderOfTranslocation && !gold)
                            {
                                lastObj.Complete();
                            }
                            else
                            {
                                qs.AddConversation(new FullBackpackConversation(false, lastObj.BagOfSending, lastObj.PowderOfTranslocation, lastObj.Gold));
                            }
                        }
                    }
                }
            }
            else
            {
                QuestSystem newQuest = new AmbitiousQueenQuest(player, this.RedSolen);

                if (player.Quest == null && QuestSystem.CanOfferQuest(player, typeof(AmbitiousQueenQuest)))
                {
                    newQuest.SendOffer();
                }
                else
                {
                    newQuest.AddConversation(new DontOfferConversation());
                }
            }
        }