Beispiel #1
0
        public override void OnTalk(PlayerMobile player, bool contextMenu)
        {
            if (player.Quest is StudyOfSolenQuest qs && qs.Naturalist == this)
            {
                StudyNestsObjective study = qs.FindObjective <StudyNestsObjective>();
                if (study == null)
                {
                    return;
                }

                if (!study.Completed)
                {
                    PlaySound(0x41F);
                    qs.AddConversation(new NaturalistDuringStudyConversation());
                    return;
                }

                QuestObjective obj = qs.FindObjective <ReturnToNaturalistObjective>();

                if (obj?.Completed == false)
                {
                    Seed reward;

                    var type = Utility.Random(17) switch
                    {
                        0 => PlantType.CampionFlowers,
                        1 => PlantType.Poppies,
                        2 => PlantType.Snowdrops,
                        3 => PlantType.Bulrushes,
                        4 => PlantType.Lilies,
                        5 => PlantType.PampasGrass,
                        6 => PlantType.Rushes,
                        7 => PlantType.ElephantEarPlant,
                        8 => PlantType.Fern,
                        9 => PlantType.PonytailPalm,
                        10 => PlantType.SmallPalm,
                        11 => PlantType.CenturyPlant,
                        12 => PlantType.WaterPlant,
                        13 => PlantType.SnakePlant,
                        14 => PlantType.PricklyPearCactus,
                        15 => PlantType.BarrelCactus,
                        _ => PlantType.TribarrelCactus
                    };

                    if (study.StudiedSpecialNest)
                    {
                        reward = new Seed(type, PlantHue.FireRed);
                    }
                    else
                    {
                        var hue = Utility.Random(3) switch
                        {
                            0 => PlantHue.Pink,
                            1 => PlantHue.Magenta,
                            _ => PlantHue.Aqua
                        };

                        reward = new Seed(type, hue);
                    }

                    if (player.PlaceInBackpack(reward))
                    {
                        obj.Complete();

                        PlaySound(0x449);
                        PlaySound(0x41B);

                        if (study.StudiedSpecialNest)
                        {
                            qs.AddConversation(new SpecialEndConversation());
                        }
                        else
                        {
                            qs.AddConversation(new EndConversation());
                        }
                    }
                    else
                    {
                        reward.Delete();

                        qs.AddConversation(new FullBackpackConversation());
                    }
                }
            }
            else
            {
                QuestSystem newQuest = new StudyOfSolenQuest(player, this);

                if (player.Quest == null && QuestSystem.CanOfferQuest(player, typeof(StudyOfSolenQuest)))
                {
                    PlaySound(0x42F);
                    newQuest.SendOffer();
                }
                else
                {
                    PlaySound(0x448);
                    newQuest.AddConversation(new DontOfferConversation());
                }
            }
        }
Beispiel #2
0
        public override void OnTalk(PlayerMobile player, bool contextMenu)
        {
            StudyOfSolenQuest qs = player.Quest as StudyOfSolenQuest;

            if (qs != null && qs.Naturalist == this)
            {
                StudyNestsObjective study = qs.FindObjective(typeof(StudyNestsObjective)) as StudyNestsObjective;

                if (study != null)
                {
                    if (!study.Completed)
                    {
                        this.PlaySound(0x41F);
                        qs.AddConversation(new NaturalistDuringStudyConversation());
                    }
                    else
                    {
                        QuestObjective obj = qs.FindObjective(typeof(ReturnToNaturalistObjective));

                        if (obj != null && !obj.Completed)
                        {
                            Seed reward;

                            PlantType type;
                            switch (Utility.Random(17))
                            {
                            case 0:
                                type = PlantType.CampionFlowers;
                                break;

                            case 1:
                                type = PlantType.Poppies;
                                break;

                            case 2:
                                type = PlantType.Snowdrops;
                                break;

                            case 3:
                                type = PlantType.Bulrushes;
                                break;

                            case 4:
                                type = PlantType.Lilies;
                                break;

                            case 5:
                                type = PlantType.PampasGrass;
                                break;

                            case 6:
                                type = PlantType.Rushes;
                                break;

                            case 7:
                                type = PlantType.ElephantEarPlant;
                                break;

                            case 8:
                                type = PlantType.Fern;
                                break;

                            case 9:
                                type = PlantType.PonytailPalm;
                                break;

                            case 10:
                                type = PlantType.SmallPalm;
                                break;

                            case 11:
                                type = PlantType.CenturyPlant;
                                break;

                            case 12:
                                type = PlantType.WaterPlant;
                                break;

                            case 13:
                                type = PlantType.SnakePlant;
                                break;

                            case 14:
                                type = PlantType.PricklyPearCactus;
                                break;

                            case 15:
                                type = PlantType.BarrelCactus;
                                break;

                            default:
                                type = PlantType.TribarrelCactus;
                                break;
                            }

                            if (study.StudiedSpecialNest)
                            {
                                PlantHue hue;
                                switch (Utility.Random(3))
                                {
                                case 0:
                                    hue = PlantHue.FireRed;
                                    break;

                                case 1:
                                    hue = PlantHue.White;
                                    break;

                                default:
                                    hue = PlantHue.Black;
                                    break;
                                }

                                reward = new Seed(type, hue, false);
                            }
                            else
                            {
                                PlantHue hue;
                                switch (Utility.Random(3))
                                {
                                case 0:
                                    hue = PlantHue.Pink;
                                    break;

                                case 1:
                                    hue = PlantHue.Magenta;
                                    break;

                                default:
                                    hue = PlantHue.Aqua;
                                    break;
                                }

                                reward = new Seed(type, hue, false);
                            }

                            if (player.PlaceInBackpack(reward))
                            {
                                obj.Complete();

                                this.PlaySound(0x449);
                                this.PlaySound(0x41B);

                                if (study.StudiedSpecialNest)
                                {
                                    qs.AddConversation(new SpecialEndConversation());
                                }
                                else
                                {
                                    qs.AddConversation(new EndConversation());
                                }
                            }
                            else
                            {
                                reward.Delete();

                                qs.AddConversation(new FullBackpackConversation());
                            }
                        }
                    }
                }
            }
            else
            {
                QuestSystem newQuest = new StudyOfSolenQuest(player, this);

                if (player.Quest == null && QuestSystem.CanOfferQuest(player, typeof(StudyOfSolenQuest)))
                {
                    this.PlaySound(0x42F);
                    newQuest.SendOffer();
                }
                else
                {
                    this.PlaySound(0x448);
                    newQuest.AddConversation(new DontOfferConversation());
                }
            }
        }
Beispiel #3
0
        public override void OnTalk(PlayerMobile player, bool contextMenu)
        {
            StudyOfSolenQuest qs = player.Quest as StudyOfSolenQuest;

            if (qs != null && qs.Naturalist == this)
            {
                StudyNestsObjective study = qs.FindObjective(typeof(StudyNestsObjective)) as StudyNestsObjective;

                if (study != null)
                {
                    if (!study.Completed)
                    {
                        PlaySound(0x41F);
                        qs.AddConversation(new NaturalistDuringStudyConversation());
                    }
                    else
                    {
                        QuestObjective obj = qs.FindObjective(typeof(ReturnToNaturalistObjective));

                        if (obj != null && !obj.Completed)
                        {
                            Seed reward;

                            PlantType type;
                            switch (Utility.Random(study.StudiedSpecialNest ? 34 : 16))
                            {
                            case 0:
                                type = PlantType.CampionFlowers;
                                break;

                            case 1:
                                type = PlantType.Poppies;
                                break;

                            case 2:
                                type = PlantType.Snowdrops;
                                break;

                            case 3:
                                type = PlantType.Bulrushes;
                                break;

                            case 4:
                                type = PlantType.Lilies;
                                break;

                            case 5:
                                type = PlantType.PampasGrass;
                                break;

                            case 6:
                                type = PlantType.Rushes;
                                break;

                            case 7:
                                type = PlantType.ElephantEarPlant;
                                break;

                            case 8:
                                type = PlantType.Fern;
                                break;

                            case 9:
                                type = PlantType.PonytailPalm;
                                break;

                            case 10:
                                type = PlantType.SmallPalm;
                                break;

                            case 11:
                                type = PlantType.CenturyPlant;
                                break;

                            case 12:
                                type = PlantType.WaterPlant;
                                break;

                            case 13:
                                type = PlantType.SnakePlant;
                                break;

                            case 14:
                                type = PlantType.PricklyPearCactus;
                                break;

                            case 15:
                                type = PlantType.BarrelCactus;
                                break;

                            case 16:
                                type = PlantType.TribarrelCactus;
                                break;

                            case 17:
                                type = PlantType.Cactus;
                                break;

                            case 18:
                                type = PlantType.FlaxFlowers;
                                break;

                            case 19:
                                type = PlantType.FoxgloveFlowers;
                                break;

                            case 20:
                                type = PlantType.HopsEast;
                                break;

                            case 21:
                                type = PlantType.OrfluerFlowers;
                                break;

                            case 22:
                                type = PlantType.CypressTwisted;
                                break;

                            case 23:
                                type = PlantType.HedgeShort;
                                break;

                            case 24:
                                type = PlantType.JuniperBush;
                                break;

                            case 25:
                                type = PlantType.SnowdropPatch;
                                break;

                            case 26:
                                type = PlantType.Cattails;
                                break;

                            case 27:
                                type = PlantType.PoppyPatch;
                                break;

                            case 28:
                                type = PlantType.SpiderTree;
                                break;

                            case 29:
                                type = PlantType.WaterLily;
                                break;

                            case 30:
                                type = PlantType.CypressStraight;
                                break;

                            case 31:
                                type = PlantType.HedgeTall;
                                break;

                            case 32:
                                type = PlantType.HopsSouth;
                                break;

                            default:
                                type = PlantType.SugarCanes;
                                break;
                            }

                            if (study.StudiedSpecialNest)
                            {
                                PlantTypeInfo typeInfo = PlantTypeInfo.GetInfo(type);

                                if (typeInfo.PlantCategory == PlantCategory.Peculiar && type != PlantType.Cactus)
                                {
                                    reward = new Seed(type, Utility.RandomBool() ? PlantHue.White : PlantHue.Black, false);
                                }
                                else
                                {
                                    reward = new Seed(type, PlantHue.FireRed, false);
                                }
                            }
                            else
                            {
                                reward = new Seed(type, Utility.RandomList(PlantHue.Pink, PlantHue.Magenta, PlantHue.Aqua), false);
                            }

                            if (player.PlaceInBackpack(reward))
                            {
                                obj.Complete();

                                PlaySound(0x449);
                                PlaySound(0x41B);

                                if (study.StudiedSpecialNest)
                                {
                                    qs.AddConversation(new SpecialEndConversation());
                                }
                                else
                                {
                                    qs.AddConversation(new EndConversation());
                                }
                            }
                            else
                            {
                                reward.Delete();

                                qs.AddConversation(new FullBackpackConversation());
                            }
                        }
                    }
                }
            }
            else
            {
                QuestSystem newQuest = new StudyOfSolenQuest(player, this);

                if (player.Quest == null && QuestSystem.CanOfferQuest(player, typeof(StudyOfSolenQuest)))
                {
                    PlaySound(0x42F);
                    newQuest.SendOffer();
                }
                else
                {
                    PlaySound(0x448);
                    newQuest.AddConversation(new DontOfferConversation());
                }
            }
        }