Пример #1
0
 public InternalTarget(TownHouseSetupGump gump, TownHouseSign sign, TargetType type, Point3D point) : base(20, true, TargetFlags.None)
 {
     m_Gump     = gump;
     m_Sign     = sign;
     m_Type     = type;
     m_BoundOne = point;
 }
Пример #2
0
            protected override void OnTarget(Mobile m, object o)
            {
                IPoint3D point = (IPoint3D)o;

                if (m_Contract == null || m_Contract.ParentHouse == null)
                {
                    return;
                }

                if (!m_Contract.ParentHouse.Region.Contains(new Point3D(point.X, point.Y, point.Z)))
                {
                    m.SendMessage("You must target within the home.");
                    m.Target = new InternalTarget(m_Gump, m_Contract, m_Type, m_BoundOne);
                    return;
                }

                switch (m_Type)
                {
                case TargetType.SignLoc:
                    m_Contract.SignLoc = new Point3D(point.X, point.Y, point.Z);
                    m_Contract.ShowSignPreview();
                    m_Gump.NewGump();
                    break;

                case TargetType.MinZ:
                    if (!m_Contract.ParentHouse.Region.Contains(new Point3D(point.X, point.Y, point.Z)))
                    {
                        m.SendMessage("That isn't within your house.");
                    }
                    else if (m_Contract.HasContractedArea(point.Z))
                    {
                        m.SendMessage("That area is already taken by another rental contract.");
                    }
                    else
                    {
                        m_Contract.MinZ = point.Z;

                        if (m_Contract.MaxZ < m_Contract.MinZ + 19)
                        {
                            m_Contract.MaxZ = point.Z + 19;
                        }
                    }

                    m_Contract.ShowFloorsPreview(m);
                    m_Gump.NewGump();
                    break;

                case TargetType.MaxZ:
                    if (!m_Contract.ParentHouse.Region.Contains(new Point3D(point.X, point.Y, point.Z)))
                    {
                        m.SendMessage("That isn't within your house.");
                    }
                    else if (m_Contract.HasContractedArea(point.Z))
                    {
                        m.SendMessage("That area is already taken by another rental contract.");
                    }
                    else
                    {
                        m_Contract.MaxZ = point.Z + 19;

                        if (m_Contract.MinZ > m_Contract.MaxZ)
                        {
                            m_Contract.MinZ = point.Z;
                        }
                    }

                    m_Contract.ShowFloorsPreview(m);
                    m_Gump.NewGump();
                    break;

                case TargetType.BlockOne:
                    m.SendMessage("Now target the south eastern corner.");
                    m.Target = new InternalTarget(m_Gump, m_Contract, TargetType.BlockTwo, new Point3D(point.X, point.Y, point.Z));
                    break;

                case TargetType.BlockTwo:
                    Rectangle2D rect = TownHouseSetupGump.FixRect(new Rectangle2D(m_BoundOne, new Point3D(point.X + 1, point.Y + 1, point.Z)));

                    if (m_Contract.HasContractedArea(rect, point.Z))
                    {
                        m.SendMessage("That area is already taken by another rental contract.");
                    }
                    else
                    {
                        m_Contract.Blocks.Add(rect);
                        m_Contract.ShowAreaPreview(m);
                    }

                    m_Gump.NewGump();
                    break;
                }
            }
Пример #3
0
 public InternalTarget(TownHouseSetupGump gump, TownHouseSign sign, TargetType type) : this(gump, sign, type, Point3D.Zero)
 {
 }