public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);
            int version = reader.ReadInt();

            //Version 0
            if (version >= 0)
            {
                m_ConstructionTile = (UOACZConstructionTile)reader.ReadItem();
            }
        }
Exemple #2
0
            protected override void OnTarget(Mobile from, object target)
            {
                PlayerMobile player = from as PlayerMobile;

                if (!UOACZSystem.IsUOACZValidMobile(player))
                {
                    return;
                }
                if (!player.IsUOACZHuman)
                {
                    return;
                }
                if (m_ConstructionDeed == null)
                {
                    return;
                }
                if (m_ConstructionDeed.Deleted)
                {
                    return;
                }

                if (!m_ConstructionDeed.IsChildOf(from.Backpack))
                {
                    player.SendMessage("That item must be in your pack in order to use it.");
                    return;
                }

                if (target is UOACZConstructionTile)
                {
                    UOACZConstructionTile constructionTile = target as UOACZConstructionTile;

                    if (Utility.GetDistance(player.Location, constructionTile.Location) > 1 || (Math.Abs(player.Location.Z - constructionTile.Location.Z) > 20))
                    {
                        player.SendMessage("You are too far away from that construction location.");
                        return;
                    }

                    if (constructionTile.Constructable != null)
                    {
                        player.SendMessage("That construction location already has something under construction.");
                        return;
                    }

                    constructionTile.PlaceObject(player, m_ConstructionDeed);
                }

                else
                {
                    player.SendMessage("That is not a valid construction location.");
                    return;
                }
            }