Example #1
0
        public void SeedSoil(Mobile from, Seed s)
        {
            if (from != null && !from.Deleted)
            {
                //planting gfx and sfx
                from.Animate(32, 5, 1, true, false, 0);
                from.PlaySound(0x368);

                //editing the targeted soil
                setOccupied(true);
                setOwner(from);
                PlantType = s.GetParentType();
                m_SeedName = s.Name;
                int enhancedHarvestingLevel = ((IKhaerosMobile)m_Owner).Feats.GetFeatLevel(FeatList.EnhancedHarvesting);

                //tracking when the soil was seeded and when it will bloom, and creating a delay for growth based on that.
                m_Seeded = DateTime.Now;
                m_Bloom = m_Seeded.AddDays(7 - enhancedHarvestingLevel);
                m_GrowthDelay = m_Bloom - m_Seeded;

                //reseting the deletion date of the soil and attached plants now that it has been refreshed through seeding.
                m_LastPlantRefresh = m_Seeded;
                m_PlantDeath = m_LastPlantRefresh + TimeSpan.FromDays(3 + enhancedHarvestingLevel);

                if (UniversalPlantTimer == null || !UniversalPlantTimer.Running)
                {
                    UniversalPlantTimer = new PlantTimer();
                    UniversalPlantTimer.Start();
                }
            }
            else
            {
                from.SendMessage("ERROR: Seed's parent is " + s.GetParentType());
                return;
            }
        }