예제 #1
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);
            reader.ReadInt();

            int c = reader.ReadInt();

            for (int i = 0; i < c; i++)
            {
                Mobile   m  = reader.ReadMobile();
                DateTime dt = reader.ReadDateTime();

                if (m != null && dt > DateTime.UtcNow)
                {
                    PlantDelayTable[m] = dt;
                }
            }

            if (Map == Map.Felucca)
            {
                FelInstance = this;
            }
            else if (Map == Map.Trammel)
            {
                TramInstance = this;
            }
            else
            {
                Delete();
            }
        }
예제 #2
0
        public override void Delete()
        {
            if (Owner != null && PlantStatus < PlantStatus.DecorativePlant)
            {
                MaginciaPlantSystem.OnPlantDelete(Owner, Map);
            }

            base.Delete();
        }
예제 #3
0
 public static void Initialize()
 {
     if (Enabled)
     {
         if (FelInstance == null)
         {
             FelInstance = new MaginciaPlantSystem();
             FelInstance.MoveToWorld(new Point3D(3715, 2049, 5), Map.Felucca);
         }
         if (TramInstance == null)
         {
             TramInstance = new MaginciaPlantSystem();
             TramInstance.MoveToWorld(new Point3D(3715, 2049, 5), Map.Trammel);
         }
     }
 }
예제 #4
0
 public static void Initialize()
 {
     if (Enabled)
     {
         if (m_FelInstance == null)
         {
             m_FelInstance = new MaginciaPlantSystem();
             m_FelInstance.MoveToWorld(new Point3D(3715, 2049, 5), Map.Felucca);
         }
         if (m_TramInstance == null)
         {
             m_TramInstance = new MaginciaPlantSystem();
             m_TramInstance.MoveToWorld(new Point3D(3715, 2049, 5), Map.Trammel);
         }
     }
 }
예제 #5
0
        public override bool PlantSeed(Mobile from, Seed seed)
        {
            if (!MaginciaPlantSystem.CheckDelay(from) || !CheckLocation(from, seed) || !base.PlantSeed(from, seed))
            {
                return(false);
            }

            if (m_Timer != null)
            {
                m_Timer.Stop();
                m_Timer = null;
            }

            Owner   = from;
            Planted = DateTime.UtcNow;

            MaginciaPlantSystem.OnPlantPlanted(from, from.Map);

            return(true);
        }
예제 #6
0
        public static bool CheckDelay(Mobile from)
        {
            MaginciaPlantSystem system = null;
            Map map = from.Map;

            if (map == Map.Trammel)
            {
                system = TramInstance;
            }
            else if (map == Map.Felucca)
            {
                system = FelInstance;
            }

            if (system == null)
            {
                from.SendLocalizedMessage(1150457); // The ground here is not good for gardening.
                return(false);
            }

            return(system.CheckPlantDelay(from));
        }
예제 #7
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            int c = reader.ReadInt();

            for (int i = 0; i < c; i++)
            {
                Mobile m = reader.ReadMobile();
                DateTime dt = reader.ReadDateTime();

                if (m != null && dt > DateTime.UtcNow)
                    m_PlantDelayTable[m] = dt;
            }

            if (this.Map == Map.Felucca)
                m_FelInstance = this;

            else if (this.Map == Map.Trammel)
                m_TramInstance = this;

            else
                Delete();
        }