Пример #1
0
        public void OnGivenFungi(PlayerMobile player, ZoogiFungus fungi)
        {
            this.Direction = GetDirectionTo(player);

            SolenMatriarchQuest qs = player.Quest as SolenMatriarchQuest;

            if (qs != null && qs.RedSolen == this.RedSolen)
            {
                QuestObjective obj = qs.FindObjective(typeof(ProcessFungiObjective));

                if (obj != null && !obj.Completed)
                {
                    int amount = fungi.Amount / 2;

                    if (amount > 100)
                    {
                        amount = 100;
                    }

                    if (amount > 0)
                    {
                        if (amount * 2 >= fungi.Amount)
                        {
                            fungi.Delete();
                        }
                        else
                        {
                            fungi.Amount -= amount * 2;
                        }

                        PowderOfTranslocation powder = new PowderOfTranslocation(amount);
                        player.AddToBackpack(powder);

                        player.SendLocalizedMessage(1054100); // You receive some powder of translocation.

                        obj.Complete();
                    }
                }
            }
        }
Пример #2
0
        public override void OnTalk(PlayerMobile player, bool contextMenu)
        {
            this.Direction = GetDirectionTo(player);

            SolenMatriarchQuest qs = player.Quest as SolenMatriarchQuest;

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

                    if (obj != null && !obj.Completed)
                    {
                        obj.Complete();
                    }
                    else if (qs.IsObjectiveInProgress(typeof(GatherWaterObjective)))
                    {
                        qs.AddConversation(new DuringWaterGatheringConversation());
                    }
                    else
                    {
                        obj = qs.FindObjective(typeof(ReturnAfterWaterObjective));

                        if (obj != null && !obj.Completed)
                        {
                            obj.Complete();
                        }
                        else if (qs.IsObjectiveInProgress(typeof(ProcessFungiObjective)))
                        {
                            qs.AddConversation(new DuringFungiProcessConversation());
                        }
                        else
                        {
                            obj = qs.FindObjective(typeof(GetRewardObjective));

                            if (obj != null && !obj.Completed)
                            {
                                if (SolenMatriarchQuest.GiveRewardTo(player))
                                {
                                    obj.Complete();
                                }
                                else
                                {
                                    qs.AddConversation(new FullBackpackConversation(false));
                                }
                            }
                        }
                    }
                }
            }
            else if (SolenMatriarchQuest.IsFriend(player, this.RedSolen))
            {
                QuestSystem newQuest = new SolenMatriarchQuest(player, this.RedSolen);

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