#W# Inn room size and price now set in inndoors.cfg.

This commit is contained in:
WarrentyExpired 2026-08-25 13:16:08 -04:00
parent 9415670556
commit 8f44a3fe50
8 changed files with 114 additions and 84 deletions

View file

@ -17,9 +17,13 @@ namespace Server.Custom.InnRooms
private Point3D m_RoomLocation;
private Map m_RoomMap;
private bool m_AutoRenew;
private int m_RentCost = 5000;
private bool m_AutoRenew;
private TimeSpan m_RentDuration = TimeSpan.FromDays(7);
private Rectangle2D m_RoomArea;
private int m_RentCost;
[CommandProperty(AccessLevel.GameMaster)]
public Rectangle2D RoomArea { get { return m_RoomArea; } set { m_RoomArea = value; } }
[CommandProperty(AccessLevel.GameMaster)]
public bool AutoRenew { get { return m_AutoRenew; } set { m_AutoRenew = value; } }
@ -47,10 +51,12 @@ namespace Server.Custom.InnRooms
}
[Constructable]
public InnDoor(int itemID) : base(itemID)
public InnDoor(int itemID, Rectangle2D roomArea, int rentCost) : base(itemID)
{
Movable = false;
Name = "A Vacant Inn Room";
m_RoomArea = roomArea;
m_RentCost = rentCost;
}
public InnDoor(Serial serial) : base(serial)
@ -102,7 +108,7 @@ namespace Server.Custom.InnRooms
m_AutoRenew = true;
Name = from.Name + "'s Inn Room";
m_House = new InnRoomHouse(from);
m_House = new InnRoomHouse(from, m_RoomArea);
Point3D buriedLocation = new Point3D(RoomLocation.X, RoomLocation.Y, RoomLocation.Z - 20);
m_House.MoveToWorld(buriedLocation, RoomMap);
@ -262,8 +268,11 @@ namespace Server.Custom.InnRooms
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)1);
writer.Write((int)3);
writer.Write(m_RentCost);
writer.Write(m_RoomArea);
writer.Write(m_AutoRenew);
writer.Write(m_Renter);
@ -278,6 +287,19 @@ namespace Server.Custom.InnRooms
base.Deserialize(reader);
int version = reader.ReadInt();
if (version >= 3)
{
m_RentCost = reader.ReadInt();
}
else
{
m_RentCost = 5000;
}
if (version >= 2)
{
m_RoomArea = reader.ReadRect2D();
}
if (version >= 1)
{
m_AutoRenew = reader.ReadBool();