public RefundEntry(Mobile from, YardGate gate, int price)
     : base(6104, 9)
 {
     m_From = from;
     m_Gate = gate;
     value = price;
 }
 public RefundEntry(Mobile from, YardGate gate, int price)
     : base(6104, 9)
 {
     m_From = from;
     m_Gate = gate;
     value  = price;
 }
Exemplo n.º 3
0
        public static void UpdateOldGates(CommandEventArgs e)
        {
            List<Item> toDelete = new List<Item>();

            foreach (Item item in World.Items.Values)
            {
                if (item.GetType() == typeof(YardIronGate) ||
                    item.GetType() == typeof(YardShortIronGate) ||
                    item.GetType() == typeof(YardLightWoodGate) ||
                    item.GetType() == typeof(YardDarkWoodGate))
                {
                    toDelete.Add(item);
                }
            }

            for (int i = 0; i < toDelete.Count; i++)
            {
                if (toDelete[i].GetType() == typeof(YardIronGate))
                {
                    YardIronGate gate = (YardIronGate)toDelete[i];
                    if (gate != null)
                    {
                        YardGate newGate = new YardGate(2084, gate.Placer, gate.Price, null, gate.Location, (DoorFacing)((gate.ClosedID - 2084) / 2));
                    }
                }
                else if (toDelete[i].GetType() == typeof(YardShortIronGate))
                {
                    YardShortIronGate gate = (YardShortIronGate)toDelete[i];
                    if (gate != null)
                    {
                        YardGate newGate = new YardGate(2124, gate.Placer, gate.Price, null, gate.Location, (DoorFacing)((gate.ClosedID - 2124) / 2));
                    }
                }
                else if (toDelete[i].GetType() == typeof(YardLightWoodGate))
                {
                    YardLightWoodGate gate = (YardLightWoodGate)toDelete[i];
                    if (gate != null)
                    {
                        YardGate newGate = new YardGate(2105, gate.Placer, gate.Price, null, gate.Location, (DoorFacing)((gate.ClosedID - 2105) / 2));
                    }
                }
                else if (toDelete[i].GetType() == typeof(YardDarkWoodGate))
                {
                    YardDarkWoodGate gate = (YardDarkWoodGate)toDelete[i];
                    if (gate != null)
                    {
                        YardGate newGate = new YardGate(2150, gate.Placer, gate.Price, null, gate.Location, (DoorFacing)((gate.ClosedID - 2150) / 2));
                    }
                }

                toDelete[i].Delete();
            }

            World.Save();
        }
Exemplo n.º 4
0
        public static void UpdateOldGates(CommandEventArgs e)
        {
            List <Item> toDelete = new List <Item>();

            foreach (Item item in World.Items.Values)
            {
                if (item.GetType() == typeof(YardIronGate) ||
                    item.GetType() == typeof(YardShortIronGate) ||
                    item.GetType() == typeof(YardLightWoodGate) ||
                    item.GetType() == typeof(YardDarkWoodGate))
                {
                    toDelete.Add(item);
                }
            }

            for (int i = 0; i < toDelete.Count; i++)
            {
                if (toDelete[i].GetType() == typeof(YardIronGate))
                {
                    YardIronGate gate = (YardIronGate)toDelete[i];
                    if (gate != null)
                    {
                        YardGate newGate = new YardGate(2084, gate.Placer, gate.Price, null, gate.Location, (DoorFacing)((gate.ClosedID - 2084) / 2));
                    }
                }
                else if (toDelete[i].GetType() == typeof(YardShortIronGate))
                {
                    YardShortIronGate gate = (YardShortIronGate)toDelete[i];
                    if (gate != null)
                    {
                        YardGate newGate = new YardGate(2124, gate.Placer, gate.Price, null, gate.Location, (DoorFacing)((gate.ClosedID - 2124) / 2));
                    }
                }
                else if (toDelete[i].GetType() == typeof(YardLightWoodGate))
                {
                    YardLightWoodGate gate = (YardLightWoodGate)toDelete[i];
                    if (gate != null)
                    {
                        YardGate newGate = new YardGate(2105, gate.Placer, gate.Price, null, gate.Location, (DoorFacing)((gate.ClosedID - 2105) / 2));
                    }
                }
                else if (toDelete[i].GetType() == typeof(YardDarkWoodGate))
                {
                    YardDarkWoodGate gate = (YardDarkWoodGate)toDelete[i];
                    if (gate != null)
                    {
                        YardGate newGate = new YardGate(2150, gate.Placer, gate.Price, null, gate.Location, (DoorFacing)((gate.ClosedID - 2150) / 2));
                    }
                }

                toDelete[i].Delete();
            }

            World.Save();
        }
Exemplo n.º 5
0
        public static void CleanYards()
        {
            if (OrphanedYardItems == null || OrphanedYardItems.Count <= 0)
            {
                return;
            }

            Console.WriteLine();
            Console.WriteLine(String.Format("Cleaning {0} Orphaned Yard Items...", OrphanedYardItems.Count));
            for (int i = 0; i < OrphanedYardItems.Count; i++)
            {
                if (OrphanedYardItems[i] is YardItem)
                {
                    YardItem item = (YardItem)OrphanedYardItems[i];
                    if (item == null)
                    {
                        continue;
                    }
                    item.FindHouseOfPlacer();
                    if (item.House == null)
                    {
                        item.Refund();
                    }
                }
                else if (OrphanedYardItems[i] is YardGate)
                {
                    YardGate item = (YardGate)OrphanedYardItems[i];
                    if (item == null)
                    {
                        continue;
                    }
                    item.FindHouseOfPlacer();
                    if (item.House == null)
                    {
                        item.Refund();
                    }
                }
            }

            OrphanedYardItems.Clear();
        }
Exemplo n.º 6
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);
            int version = reader.ReadInt();

            Placer = reader.ReadMobile();
            Price  = reader.ReadInt();
            Console.WriteLine();
            Console.Write("Updating YardDarkWoodGate...");
            YardGate newGate = new YardGate(2150, Placer, Price, null, Location, (DoorFacing)((ClosedID - 2150) / 2));

            newGate.Map = Map;
            if (newGate != null)
            {
                Console.WriteLine(String.Format("New gate = {0}, ItemID = {1}, Location = {2}", newGate.Serial.ToString(), newGate.ItemID, newGate.Location));
            }
            else
            {
                Console.WriteLine("Null");
            }
            Delete();
        }
 public YardSecurityEntry(Mobile from, YardGate gate)
     : base(6203, 9)
 {
     m_From = from;
     m_Gate = gate;
 }
Exemplo n.º 8
0
 public override void Deserialize(GenericReader reader)
 {
     base.Deserialize(reader);
     int version = reader.ReadInt();
     Placer = reader.ReadMobile();
     Price = reader.ReadInt();
     Console.WriteLine();
     Console.Write("Updating YardDarkWoodGate...");
     YardGate newGate = new YardGate(2150, Placer, Price, null, Location, (DoorFacing)((ClosedID - 2150) / 2));
     newGate.Map = Map;
     if (newGate != null)
     {
         Console.WriteLine(String.Format("New gate = {0}, ItemID = {1}, Location = {2}", newGate.Serial.ToString(), newGate.ItemID, newGate.Location));
     }
     else
     {
         Console.WriteLine("Null");
     }
     Delete();
 }
 public YardSecurityEntry(Mobile from, YardGate gate)
     : base(6203, 9)
 {
     m_From = from;
     m_Gate = gate;
 }