fix: Converts houses/deeds to serialization generator (#2288)
### Summary * Converts HouseDeeds to serialization generator * Converts Houses to serialization generator * Converts ContestHouses to serialization generator
This commit is contained in:
parent
d984961b38
commit
771cb50919
63 changed files with 1872 additions and 2528 deletions
22
Projects/UOContent/Migrations/Server.Multis.BaseContestHouse.v1.json
generated
Normal file
22
Projects/UOContent/Migrations/Server.Multis.BaseContestHouse.v1.json
generated
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
{
|
||||||
|
"version": 1,
|
||||||
|
"type": "Server.Multis.BaseContestHouse",
|
||||||
|
"properties": [
|
||||||
|
{
|
||||||
|
"name": "HouseType",
|
||||||
|
"type": "Server.Multis.ContestHouseType",
|
||||||
|
"rule": "EnumMigrationRule"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Fixtures",
|
||||||
|
"type": "System.Collections.Generic.List\u003CServer.Item\u003E",
|
||||||
|
"rule": "ListMigrationRule",
|
||||||
|
"ruleArguments": [
|
||||||
|
"@Tidy",
|
||||||
|
"@CanBeNull",
|
||||||
|
"Server.Item",
|
||||||
|
"SerializableInterfaceMigrationRule"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
4
Projects/UOContent/Migrations/Server.Multis.Camelot.v0.json
generated
Normal file
4
Projects/UOContent/Migrations/Server.Multis.Camelot.v0.json
generated
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"version": 0,
|
||||||
|
"type": "Server.Multis.Camelot"
|
||||||
|
}
|
||||||
4
Projects/UOContent/Migrations/Server.Multis.CasaMoga.v0.json
generated
Normal file
4
Projects/UOContent/Migrations/Server.Multis.CasaMoga.v0.json
generated
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"version": 0,
|
||||||
|
"type": "Server.Multis.CasaMoga"
|
||||||
|
}
|
||||||
4
Projects/UOContent/Migrations/Server.Multis.Castle.v0.json
generated
Normal file
4
Projects/UOContent/Migrations/Server.Multis.Castle.v0.json
generated
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"version": 0,
|
||||||
|
"type": "Server.Multis.Castle"
|
||||||
|
}
|
||||||
4
Projects/UOContent/Migrations/Server.Multis.CastleOfOceania.v0.json
generated
Normal file
4
Projects/UOContent/Migrations/Server.Multis.CastleOfOceania.v0.json
generated
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"version": 0,
|
||||||
|
"type": "Server.Multis.CastleOfOceania"
|
||||||
|
}
|
||||||
4
Projects/UOContent/Migrations/Server.Multis.DarkthornKeep.v0.json
generated
Normal file
4
Projects/UOContent/Migrations/Server.Multis.DarkthornKeep.v0.json
generated
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"version": 0,
|
||||||
|
"type": "Server.Multis.DarkthornKeep"
|
||||||
|
}
|
||||||
4
Projects/UOContent/Migrations/Server.Multis.Deeds.BrickHouseDeed.v0.json
generated
Normal file
4
Projects/UOContent/Migrations/Server.Multis.Deeds.BrickHouseDeed.v0.json
generated
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"version": 0,
|
||||||
|
"type": "Server.Multis.Deeds.BrickHouseDeed"
|
||||||
|
}
|
||||||
4
Projects/UOContent/Migrations/Server.Multis.Deeds.CastleDeed.v0.json
generated
Normal file
4
Projects/UOContent/Migrations/Server.Multis.Deeds.CastleDeed.v0.json
generated
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"version": 0,
|
||||||
|
"type": "Server.Multis.Deeds.CastleDeed"
|
||||||
|
}
|
||||||
4
Projects/UOContent/Migrations/Server.Multis.Deeds.FieldStoneHouseDeed.v0.json
generated
Normal file
4
Projects/UOContent/Migrations/Server.Multis.Deeds.FieldStoneHouseDeed.v0.json
generated
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"version": 0,
|
||||||
|
"type": "Server.Multis.Deeds.FieldStoneHouseDeed"
|
||||||
|
}
|
||||||
22
Projects/UOContent/Migrations/Server.Multis.Deeds.HouseDeed.v0.json
generated
Normal file
22
Projects/UOContent/Migrations/Server.Multis.Deeds.HouseDeed.v0.json
generated
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
{
|
||||||
|
"version": 0,
|
||||||
|
"type": "Server.Multis.Deeds.HouseDeed",
|
||||||
|
"properties": [
|
||||||
|
{
|
||||||
|
"name": "Offset",
|
||||||
|
"type": "Server.Point3D",
|
||||||
|
"rule": "PrimitiveUOTypeMigrationRule",
|
||||||
|
"ruleArguments": [
|
||||||
|
"Point3D"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "MultiID",
|
||||||
|
"type": "int",
|
||||||
|
"rule": "PrimitiveTypeMigrationRule",
|
||||||
|
"ruleArguments": [
|
||||||
|
""
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
4
Projects/UOContent/Migrations/Server.Multis.Deeds.KeepDeed.v0.json
generated
Normal file
4
Projects/UOContent/Migrations/Server.Multis.Deeds.KeepDeed.v0.json
generated
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"version": 0,
|
||||||
|
"type": "Server.Multis.Deeds.KeepDeed"
|
||||||
|
}
|
||||||
4
Projects/UOContent/Migrations/Server.Multis.Deeds.LargeMarbleDeed.v0.json
generated
Normal file
4
Projects/UOContent/Migrations/Server.Multis.Deeds.LargeMarbleDeed.v0.json
generated
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"version": 0,
|
||||||
|
"type": "Server.Multis.Deeds.LargeMarbleDeed"
|
||||||
|
}
|
||||||
4
Projects/UOContent/Migrations/Server.Multis.Deeds.LargePatioDeed.v0.json
generated
Normal file
4
Projects/UOContent/Migrations/Server.Multis.Deeds.LargePatioDeed.v0.json
generated
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"version": 0,
|
||||||
|
"type": "Server.Multis.Deeds.LargePatioDeed"
|
||||||
|
}
|
||||||
4
Projects/UOContent/Migrations/Server.Multis.Deeds.LogCabinDeed.v0.json
generated
Normal file
4
Projects/UOContent/Migrations/Server.Multis.Deeds.LogCabinDeed.v0.json
generated
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"version": 0,
|
||||||
|
"type": "Server.Multis.Deeds.LogCabinDeed"
|
||||||
|
}
|
||||||
4
Projects/UOContent/Migrations/Server.Multis.Deeds.MarbleWorkshopDeed.v0.json
generated
Normal file
4
Projects/UOContent/Migrations/Server.Multis.Deeds.MarbleWorkshopDeed.v0.json
generated
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"version": 0,
|
||||||
|
"type": "Server.Multis.Deeds.MarbleWorkshopDeed"
|
||||||
|
}
|
||||||
4
Projects/UOContent/Migrations/Server.Multis.Deeds.SandstonePatioDeed.v0.json
generated
Normal file
4
Projects/UOContent/Migrations/Server.Multis.Deeds.SandstonePatioDeed.v0.json
generated
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"version": 0,
|
||||||
|
"type": "Server.Multis.Deeds.SandstonePatioDeed"
|
||||||
|
}
|
||||||
4
Projects/UOContent/Migrations/Server.Multis.Deeds.SmallBrickHouseDeed.v0.json
generated
Normal file
4
Projects/UOContent/Migrations/Server.Multis.Deeds.SmallBrickHouseDeed.v0.json
generated
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"version": 0,
|
||||||
|
"type": "Server.Multis.Deeds.SmallBrickHouseDeed"
|
||||||
|
}
|
||||||
4
Projects/UOContent/Migrations/Server.Multis.Deeds.SmallTowerDeed.v0.json
generated
Normal file
4
Projects/UOContent/Migrations/Server.Multis.Deeds.SmallTowerDeed.v0.json
generated
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"version": 0,
|
||||||
|
"type": "Server.Multis.Deeds.SmallTowerDeed"
|
||||||
|
}
|
||||||
4
Projects/UOContent/Migrations/Server.Multis.Deeds.StonePlasterHouseDeed.v0.json
generated
Normal file
4
Projects/UOContent/Migrations/Server.Multis.Deeds.StonePlasterHouseDeed.v0.json
generated
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"version": 0,
|
||||||
|
"type": "Server.Multis.Deeds.StonePlasterHouseDeed"
|
||||||
|
}
|
||||||
4
Projects/UOContent/Migrations/Server.Multis.Deeds.StoneWorkshopDeed.v0.json
generated
Normal file
4
Projects/UOContent/Migrations/Server.Multis.Deeds.StoneWorkshopDeed.v0.json
generated
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"version": 0,
|
||||||
|
"type": "Server.Multis.Deeds.StoneWorkshopDeed"
|
||||||
|
}
|
||||||
4
Projects/UOContent/Migrations/Server.Multis.Deeds.ThatchedRoofCottageDeed.v0.json
generated
Normal file
4
Projects/UOContent/Migrations/Server.Multis.Deeds.ThatchedRoofCottageDeed.v0.json
generated
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"version": 0,
|
||||||
|
"type": "Server.Multis.Deeds.ThatchedRoofCottageDeed"
|
||||||
|
}
|
||||||
4
Projects/UOContent/Migrations/Server.Multis.Deeds.TowerDeed.v0.json
generated
Normal file
4
Projects/UOContent/Migrations/Server.Multis.Deeds.TowerDeed.v0.json
generated
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"version": 0,
|
||||||
|
"type": "Server.Multis.Deeds.TowerDeed"
|
||||||
|
}
|
||||||
4
Projects/UOContent/Migrations/Server.Multis.Deeds.TwoStoryStonePlasterHouseDeed.v0.json
generated
Normal file
4
Projects/UOContent/Migrations/Server.Multis.Deeds.TwoStoryStonePlasterHouseDeed.v0.json
generated
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"version": 0,
|
||||||
|
"type": "Server.Multis.Deeds.TwoStoryStonePlasterHouseDeed"
|
||||||
|
}
|
||||||
4
Projects/UOContent/Migrations/Server.Multis.Deeds.TwoStoryWoodPlasterHouseDeed.v0.json
generated
Normal file
4
Projects/UOContent/Migrations/Server.Multis.Deeds.TwoStoryWoodPlasterHouseDeed.v0.json
generated
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"version": 0,
|
||||||
|
"type": "Server.Multis.Deeds.TwoStoryWoodPlasterHouseDeed"
|
||||||
|
}
|
||||||
4
Projects/UOContent/Migrations/Server.Multis.Deeds.VillaDeed.v0.json
generated
Normal file
4
Projects/UOContent/Migrations/Server.Multis.Deeds.VillaDeed.v0.json
generated
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"version": 0,
|
||||||
|
"type": "Server.Multis.Deeds.VillaDeed"
|
||||||
|
}
|
||||||
4
Projects/UOContent/Migrations/Server.Multis.Deeds.WoodHouseDeed.v0.json
generated
Normal file
4
Projects/UOContent/Migrations/Server.Multis.Deeds.WoodHouseDeed.v0.json
generated
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"version": 0,
|
||||||
|
"type": "Server.Multis.Deeds.WoodHouseDeed"
|
||||||
|
}
|
||||||
4
Projects/UOContent/Migrations/Server.Multis.Deeds.WoodPlasterHouseDeed.v0.json
generated
Normal file
4
Projects/UOContent/Migrations/Server.Multis.Deeds.WoodPlasterHouseDeed.v0.json
generated
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"version": 0,
|
||||||
|
"type": "Server.Multis.Deeds.WoodPlasterHouseDeed"
|
||||||
|
}
|
||||||
4
Projects/UOContent/Migrations/Server.Multis.ElsaCastle.v0.json
generated
Normal file
4
Projects/UOContent/Migrations/Server.Multis.ElsaCastle.v0.json
generated
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"version": 0,
|
||||||
|
"type": "Server.Multis.ElsaCastle"
|
||||||
|
}
|
||||||
4
Projects/UOContent/Migrations/Server.Multis.FeudalCastle.v0.json
generated
Normal file
4
Projects/UOContent/Migrations/Server.Multis.FeudalCastle.v0.json
generated
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"version": 0,
|
||||||
|
"type": "Server.Multis.FeudalCastle"
|
||||||
|
}
|
||||||
4
Projects/UOContent/Migrations/Server.Multis.GothicRoseCastle.v0.json
generated
Normal file
4
Projects/UOContent/Migrations/Server.Multis.GothicRoseCastle.v0.json
generated
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"version": 0,
|
||||||
|
"type": "Server.Multis.GothicRoseCastle"
|
||||||
|
}
|
||||||
4
Projects/UOContent/Migrations/Server.Multis.GrimswindSisters.v0.json
generated
Normal file
4
Projects/UOContent/Migrations/Server.Multis.GrimswindSisters.v0.json
generated
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"version": 0,
|
||||||
|
"type": "Server.Multis.GrimswindSisters"
|
||||||
|
}
|
||||||
4
Projects/UOContent/Migrations/Server.Multis.GuildHouse.v0.json
generated
Normal file
4
Projects/UOContent/Migrations/Server.Multis.GuildHouse.v0.json
generated
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"version": 0,
|
||||||
|
"type": "Server.Multis.GuildHouse"
|
||||||
|
}
|
||||||
4
Projects/UOContent/Migrations/Server.Multis.Keep.v0.json
generated
Normal file
4
Projects/UOContent/Migrations/Server.Multis.Keep.v0.json
generated
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"version": 0,
|
||||||
|
"type": "Server.Multis.Keep"
|
||||||
|
}
|
||||||
4
Projects/UOContent/Migrations/Server.Multis.LacrimaeInCaelo.v0.json
generated
Normal file
4
Projects/UOContent/Migrations/Server.Multis.LacrimaeInCaelo.v0.json
generated
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"version": 0,
|
||||||
|
"type": "Server.Multis.LacrimaeInCaelo"
|
||||||
|
}
|
||||||
4
Projects/UOContent/Migrations/Server.Multis.LargeMarbleHouse.v0.json
generated
Normal file
4
Projects/UOContent/Migrations/Server.Multis.LargeMarbleHouse.v0.json
generated
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"version": 0,
|
||||||
|
"type": "Server.Multis.LargeMarbleHouse"
|
||||||
|
}
|
||||||
4
Projects/UOContent/Migrations/Server.Multis.LargePatioHouse.v0.json
generated
Normal file
4
Projects/UOContent/Migrations/Server.Multis.LargePatioHouse.v0.json
generated
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"version": 0,
|
||||||
|
"type": "Server.Multis.LargePatioHouse"
|
||||||
|
}
|
||||||
4
Projects/UOContent/Migrations/Server.Multis.LogCabin.v0.json
generated
Normal file
4
Projects/UOContent/Migrations/Server.Multis.LogCabin.v0.json
generated
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"version": 0,
|
||||||
|
"type": "Server.Multis.LogCabin"
|
||||||
|
}
|
||||||
11
Projects/UOContent/Migrations/Server.Multis.MovingCrate.v0.json
generated
Normal file
11
Projects/UOContent/Migrations/Server.Multis.MovingCrate.v0.json
generated
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
{
|
||||||
|
"version": 0,
|
||||||
|
"type": "Server.Multis.MovingCrate",
|
||||||
|
"properties": [
|
||||||
|
{
|
||||||
|
"name": "House",
|
||||||
|
"type": "Server.Multis.BaseHouse",
|
||||||
|
"rule": "SerializableInterfaceMigrationRule"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
4
Projects/UOContent/Migrations/Server.Multis.OkinawaSweetDreamCastle.v0.json
generated
Normal file
4
Projects/UOContent/Migrations/Server.Multis.OkinawaSweetDreamCastle.v0.json
generated
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"version": 0,
|
||||||
|
"type": "Server.Multis.OkinawaSweetDreamCastle"
|
||||||
|
}
|
||||||
4
Projects/UOContent/Migrations/Server.Multis.PackingBox.v0.json
generated
Normal file
4
Projects/UOContent/Migrations/Server.Multis.PackingBox.v0.json
generated
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"version": 0,
|
||||||
|
"type": "Server.Multis.PackingBox"
|
||||||
|
}
|
||||||
15
Projects/UOContent/Migrations/Server.Multis.PreviewHouse.v0.json
generated
Normal file
15
Projects/UOContent/Migrations/Server.Multis.PreviewHouse.v0.json
generated
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
{
|
||||||
|
"version": 0,
|
||||||
|
"type": "Server.Multis.PreviewHouse",
|
||||||
|
"properties": [
|
||||||
|
{
|
||||||
|
"name": "PreviewComponents",
|
||||||
|
"type": "System.Collections.Generic.List\u003CServer.Item\u003E",
|
||||||
|
"rule": "ListMigrationRule",
|
||||||
|
"ruleArguments": [
|
||||||
|
"Server.Item",
|
||||||
|
"SerializableInterfaceMigrationRule"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
4
Projects/UOContent/Migrations/Server.Multis.RobinsNest.v0.json
generated
Normal file
4
Projects/UOContent/Migrations/Server.Multis.RobinsNest.v0.json
generated
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"version": 0,
|
||||||
|
"type": "Server.Multis.RobinsNest"
|
||||||
|
}
|
||||||
4
Projects/UOContent/Migrations/Server.Multis.RobinsRoost.v0.json
generated
Normal file
4
Projects/UOContent/Migrations/Server.Multis.RobinsRoost.v0.json
generated
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"version": 0,
|
||||||
|
"type": "Server.Multis.RobinsRoost"
|
||||||
|
}
|
||||||
4
Projects/UOContent/Migrations/Server.Multis.SandStonePatio.v0.json
generated
Normal file
4
Projects/UOContent/Migrations/Server.Multis.SandStonePatio.v0.json
generated
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"version": 0,
|
||||||
|
"type": "Server.Multis.SandStonePatio"
|
||||||
|
}
|
||||||
4
Projects/UOContent/Migrations/Server.Multis.SandalwoodKeep.v0.json
generated
Normal file
4
Projects/UOContent/Migrations/Server.Multis.SandalwoodKeep.v0.json
generated
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"version": 0,
|
||||||
|
"type": "Server.Multis.SandalwoodKeep"
|
||||||
|
}
|
||||||
4
Projects/UOContent/Migrations/Server.Multis.SmallOldHouse.v0.json
generated
Normal file
4
Projects/UOContent/Migrations/Server.Multis.SmallOldHouse.v0.json
generated
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"version": 0,
|
||||||
|
"type": "Server.Multis.SmallOldHouse"
|
||||||
|
}
|
||||||
4
Projects/UOContent/Migrations/Server.Multis.SmallShop.v0.json
generated
Normal file
4
Projects/UOContent/Migrations/Server.Multis.SmallShop.v0.json
generated
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"version": 0,
|
||||||
|
"type": "Server.Multis.SmallShop"
|
||||||
|
}
|
||||||
4
Projects/UOContent/Migrations/Server.Multis.SmallTower.v0.json
generated
Normal file
4
Projects/UOContent/Migrations/Server.Multis.SmallTower.v0.json
generated
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"version": 0,
|
||||||
|
"type": "Server.Multis.SmallTower"
|
||||||
|
}
|
||||||
4
Projects/UOContent/Migrations/Server.Multis.Spires.v0.json
generated
Normal file
4
Projects/UOContent/Migrations/Server.Multis.Spires.v0.json
generated
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"version": 0,
|
||||||
|
"type": "Server.Multis.Spires"
|
||||||
|
}
|
||||||
4
Projects/UOContent/Migrations/Server.Multis.TheSandstoneCastle.v0.json
generated
Normal file
4
Projects/UOContent/Migrations/Server.Multis.TheSandstoneCastle.v0.json
generated
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"version": 0,
|
||||||
|
"type": "Server.Multis.TheSandstoneCastle"
|
||||||
|
}
|
||||||
4
Projects/UOContent/Migrations/Server.Multis.Tower.v0.json
generated
Normal file
4
Projects/UOContent/Migrations/Server.Multis.Tower.v0.json
generated
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"version": 0,
|
||||||
|
"type": "Server.Multis.Tower"
|
||||||
|
}
|
||||||
4
Projects/UOContent/Migrations/Server.Multis.TraditionalKeep.v0.json
generated
Normal file
4
Projects/UOContent/Migrations/Server.Multis.TraditionalKeep.v0.json
generated
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"version": 0,
|
||||||
|
"type": "Server.Multis.TraditionalKeep"
|
||||||
|
}
|
||||||
4
Projects/UOContent/Migrations/Server.Multis.TrinsicKeep.v0.json
generated
Normal file
4
Projects/UOContent/Migrations/Server.Multis.TrinsicKeep.v0.json
generated
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"version": 0,
|
||||||
|
"type": "Server.Multis.TrinsicKeep"
|
||||||
|
}
|
||||||
4
Projects/UOContent/Migrations/Server.Multis.TwoStoryHouse.v0.json
generated
Normal file
4
Projects/UOContent/Migrations/Server.Multis.TwoStoryHouse.v0.json
generated
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"version": 0,
|
||||||
|
"type": "Server.Multis.TwoStoryHouse"
|
||||||
|
}
|
||||||
4
Projects/UOContent/Migrations/Server.Multis.TwoStoryVilla.v0.json
generated
Normal file
4
Projects/UOContent/Migrations/Server.Multis.TwoStoryVilla.v0.json
generated
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"version": 0,
|
||||||
|
"type": "Server.Multis.TwoStoryVilla"
|
||||||
|
}
|
||||||
4
Projects/UOContent/Migrations/Server.Multis.VillaCrowley.v0.json
generated
Normal file
4
Projects/UOContent/Migrations/Server.Multis.VillaCrowley.v0.json
generated
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"version": 0,
|
||||||
|
"type": "Server.Multis.VillaCrowley"
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load diff
133
Projects/UOContent/Multis/HouseDeed.cs
Normal file
133
Projects/UOContent/Multis/HouseDeed.cs
Normal file
|
|
@ -0,0 +1,133 @@
|
||||||
|
using ModernUO.Serialization;
|
||||||
|
|
||||||
|
namespace Server.Multis.Deeds;
|
||||||
|
|
||||||
|
[SerializationGenerator(0, false)]
|
||||||
|
public abstract partial class HouseDeed : Item
|
||||||
|
{
|
||||||
|
[SerializableField(0)]
|
||||||
|
[SerializedCommandProperty(AccessLevel.GameMaster)]
|
||||||
|
private Point3D _offset;
|
||||||
|
|
||||||
|
[SerializableField(1)]
|
||||||
|
[SerializedCommandProperty(AccessLevel.GameMaster)]
|
||||||
|
private int _multiID;
|
||||||
|
|
||||||
|
public HouseDeed(int id, Point3D offset) : base(0x14F0)
|
||||||
|
{
|
||||||
|
LootType = LootType.Newbied;
|
||||||
|
|
||||||
|
_multiID = id;
|
||||||
|
_offset = offset;
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual Direction HouseDirection => Direction.South;
|
||||||
|
|
||||||
|
public abstract Rectangle2D[] Area { get; }
|
||||||
|
|
||||||
|
public override double DefaultWeight => 1.0;
|
||||||
|
|
||||||
|
public override void OnDoubleClick(Mobile from)
|
||||||
|
{
|
||||||
|
if (!IsChildOf(from.Backpack))
|
||||||
|
{
|
||||||
|
from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
|
||||||
|
}
|
||||||
|
else if (from.AccessLevel < AccessLevel.GameMaster && BaseHouse.HasAccountHouse(from))
|
||||||
|
{
|
||||||
|
from.SendLocalizedMessage(501271); // You already own a house, you may not place another!
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* House placement cancellation could result in a
|
||||||
|
* 60 second delay in the return of your deed.
|
||||||
|
*/
|
||||||
|
from.SendLocalizedMessage(1010433);
|
||||||
|
|
||||||
|
from.Target = new HousePlacementTarget(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public abstract BaseHouse GetHouse(Mobile owner);
|
||||||
|
|
||||||
|
public void OnPlacement(Mobile from, Point3D p)
|
||||||
|
{
|
||||||
|
if (Deleted)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!IsChildOf(from.Backpack))
|
||||||
|
{
|
||||||
|
from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
|
||||||
|
}
|
||||||
|
else if (from.AccessLevel < AccessLevel.GameMaster && BaseHouse.HasAccountHouse(from))
|
||||||
|
{
|
||||||
|
from.SendLocalizedMessage(501271); // You already own a house, you may not place another!
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var center = new Point3D(p.X - Offset.X, p.Y - Offset.Y, p.Z - Offset.Z);
|
||||||
|
var res = HousePlacement.Check(from, MultiID, center, out var toMove, HouseDirection);
|
||||||
|
|
||||||
|
switch (res)
|
||||||
|
{
|
||||||
|
case HousePlacementResult.Valid:
|
||||||
|
{
|
||||||
|
var house = GetHouse(from);
|
||||||
|
house.MoveToWorld(center, from.Map);
|
||||||
|
Delete();
|
||||||
|
|
||||||
|
for (var i = 0; i < toMove.Count; ++i)
|
||||||
|
{
|
||||||
|
var o = toMove[i];
|
||||||
|
|
||||||
|
if (o is Mobile mobile)
|
||||||
|
{
|
||||||
|
mobile.Location = house.BanLocation;
|
||||||
|
}
|
||||||
|
else if (o is Item item)
|
||||||
|
{
|
||||||
|
item.Location = house.BanLocation;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case HousePlacementResult.BadItem:
|
||||||
|
case HousePlacementResult.BadLand:
|
||||||
|
case HousePlacementResult.BadStatic:
|
||||||
|
case HousePlacementResult.BadRegionHidden:
|
||||||
|
{
|
||||||
|
// The house could not be created here. Either something is blocking the house, or the house would not be on valid terrain.
|
||||||
|
from.SendLocalizedMessage(1043287);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case HousePlacementResult.NoSurface:
|
||||||
|
{
|
||||||
|
from.SendMessage(
|
||||||
|
"The house could not be created here. Part of the foundation would not be on any surface."
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case HousePlacementResult.BadRegion:
|
||||||
|
{
|
||||||
|
from.SendLocalizedMessage(501265); // Housing cannot be created in this area.
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case HousePlacementResult.BadRegionTemp:
|
||||||
|
{
|
||||||
|
// Lord British has decreed a 'no build' period, thus you cannot build this house at this time.
|
||||||
|
from.SendLocalizedMessage(501270);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case HousePlacementResult.BadRegionRaffle:
|
||||||
|
{
|
||||||
|
// You must have a deed for this plot of land in order to build here.
|
||||||
|
from.SendLocalizedMessage(1150493);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
51
Projects/UOContent/Multis/HousePlacementTarget.cs
Normal file
51
Projects/UOContent/Multis/HousePlacementTarget.cs
Normal file
|
|
@ -0,0 +1,51 @@
|
||||||
|
using Server.Regions;
|
||||||
|
using Server.Targeting;
|
||||||
|
|
||||||
|
namespace Server.Multis.Deeds;
|
||||||
|
|
||||||
|
public class HousePlacementTarget : MultiTarget
|
||||||
|
{
|
||||||
|
private readonly HouseDeed _deed;
|
||||||
|
|
||||||
|
public HousePlacementTarget(HouseDeed deed) : base(deed.MultiID, deed.Offset) => _deed = deed;
|
||||||
|
|
||||||
|
protected override void OnTarget(Mobile from, object o)
|
||||||
|
{
|
||||||
|
if (o is not IPoint3D ip)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Point3D p = ip switch
|
||||||
|
{
|
||||||
|
Item item => item.GetWorldTop(),
|
||||||
|
Mobile m => m.Location,
|
||||||
|
_ => new Point3D(ip)
|
||||||
|
};
|
||||||
|
|
||||||
|
var reg = Region.Find(p, from.Map);
|
||||||
|
|
||||||
|
if (from.AccessLevel >= AccessLevel.GameMaster || reg.AllowHousing(from, p))
|
||||||
|
{
|
||||||
|
_deed.OnPlacement(from, p);
|
||||||
|
}
|
||||||
|
else if (reg.IsPartOf<TempNoHousingRegion>())
|
||||||
|
{
|
||||||
|
// Lord British has decreed a 'no build' period, thus you cannot build this house at this time.
|
||||||
|
from.SendLocalizedMessage(501270);
|
||||||
|
}
|
||||||
|
else if (reg.IsPartOf<TreasureRegion>() || reg.IsPartOf<HouseRegion>())
|
||||||
|
{
|
||||||
|
// The house could not be created here. Either something is blocking the house, or the house would not be on valid terrain.
|
||||||
|
from.SendLocalizedMessage(1043287);
|
||||||
|
}
|
||||||
|
else if (reg.IsPartOf<HouseRaffleRegion>())
|
||||||
|
{
|
||||||
|
from.SendLocalizedMessage(1150493); // You must have a deed for this plot of land in order to build here.
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
from.SendLocalizedMessage(501265); // Housing can not be created in this area.
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,586 +1,388 @@
|
||||||
|
using ModernUO.Serialization;
|
||||||
using Server.Items;
|
using Server.Items;
|
||||||
using Server.Multis.Deeds;
|
using Server.Multis.Deeds;
|
||||||
|
|
||||||
namespace Server.Multis
|
namespace Server.Multis;
|
||||||
|
|
||||||
|
[SerializationGenerator(0, false)]
|
||||||
|
public partial class SmallOldHouse : BaseHouse
|
||||||
{
|
{
|
||||||
public class SmallOldHouse : BaseHouse
|
public static readonly Rectangle2D[] AreaArray = [new(-3, -3, 7, 7), new(-1, 4, 3, 1)];
|
||||||
|
|
||||||
|
public SmallOldHouse(Mobile owner, int id) : base(id, owner, 425, 3)
|
||||||
{
|
{
|
||||||
public static Rectangle2D[] AreaArray = { new(-3, -3, 7, 7), new(-1, 4, 3, 1) };
|
var keyValue = CreateKeys(owner);
|
||||||
|
|
||||||
public SmallOldHouse(Mobile owner, int id) : base(id, owner, 425, 3)
|
AddSouthDoor(0, 3, 7, keyValue);
|
||||||
{
|
|
||||||
var keyValue = CreateKeys(owner);
|
|
||||||
|
|
||||||
AddSouthDoor(0, 3, 7, keyValue);
|
SetSign(2, 4, 5);
|
||||||
|
|
||||||
SetSign(2, 4, 5);
|
|
||||||
}
|
|
||||||
|
|
||||||
public SmallOldHouse(Serial serial) : base(serial)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public override Rectangle2D[] Area => AreaArray;
|
|
||||||
public override Point3D BaseBanLocation => new(2, 4, 0);
|
|
||||||
|
|
||||||
public override int DefaultPrice => 43800;
|
|
||||||
|
|
||||||
public override HousePlacementEntry ConvertEntry => HousePlacementEntry.TwoStoryFoundations[0];
|
|
||||||
|
|
||||||
public override HouseDeed GetDeed()
|
|
||||||
{
|
|
||||||
return ItemID switch
|
|
||||||
{
|
|
||||||
0x64 => new StonePlasterHouseDeed(),
|
|
||||||
0x66 => new FieldStoneHouseDeed(),
|
|
||||||
0x68 => new SmallBrickHouseDeed(),
|
|
||||||
0x6A => new WoodHouseDeed(),
|
|
||||||
0x6C => new WoodPlasterHouseDeed(),
|
|
||||||
0x6E => new ThatchedRoofCottageDeed(),
|
|
||||||
_ => new ThatchedRoofCottageDeed()
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Serialize(IGenericWriter writer)
|
|
||||||
{
|
|
||||||
base.Serialize(writer);
|
|
||||||
writer.Write(0); // version
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Deserialize(IGenericReader reader)
|
|
||||||
{
|
|
||||||
base.Deserialize(reader);
|
|
||||||
var version = reader.ReadInt();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class GuildHouse : BaseHouse
|
public override Rectangle2D[] Area => AreaArray;
|
||||||
|
public override Point3D BaseBanLocation => new(2, 4, 0);
|
||||||
|
|
||||||
|
public override int DefaultPrice => 43800;
|
||||||
|
|
||||||
|
public override HousePlacementEntry ConvertEntry => HousePlacementEntry.TwoStoryFoundations[0];
|
||||||
|
|
||||||
|
public override HouseDeed GetDeed()
|
||||||
{
|
{
|
||||||
public static Rectangle2D[] AreaArray = { new(-7, -7, 14, 14), new(-2, 7, 4, 1) };
|
return ItemID switch
|
||||||
|
|
||||||
public GuildHouse(Mobile owner) : base(0x74, owner, 1100, 8)
|
|
||||||
{
|
{
|
||||||
var keyValue = CreateKeys(owner);
|
0x64 => new StonePlasterHouseDeed(),
|
||||||
|
0x66 => new FieldStoneHouseDeed(),
|
||||||
AddSouthDoors(-1, 6, 7, keyValue);
|
0x68 => new SmallBrickHouseDeed(),
|
||||||
|
0x6A => new WoodHouseDeed(),
|
||||||
SetSign(4, 8, 16);
|
0x6C => new WoodPlasterHouseDeed(),
|
||||||
|
_ => new ThatchedRoofCottageDeed()
|
||||||
AddSouthDoor(-3, -1, 7);
|
};
|
||||||
AddSouthDoor(3, -1, 7);
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public GuildHouse(Serial serial) : base(serial)
|
[SerializationGenerator(0, false)]
|
||||||
{
|
public partial class GuildHouse : BaseHouse
|
||||||
}
|
{
|
||||||
|
public static readonly Rectangle2D[] AreaArray = [new(-7, -7, 14, 14), new(-2, 7, 4, 1)];
|
||||||
public override int DefaultPrice => 144500;
|
|
||||||
|
public GuildHouse(Mobile owner) : base(0x74, owner, 1100, 8)
|
||||||
public override HousePlacementEntry ConvertEntry => HousePlacementEntry.ThreeStoryFoundations[20];
|
{
|
||||||
public override int ConvertOffsetX => -1;
|
var keyValue = CreateKeys(owner);
|
||||||
public override int ConvertOffsetY => -1;
|
|
||||||
|
AddSouthDoors(-1, 6, 7, keyValue);
|
||||||
public override Rectangle2D[] Area => AreaArray;
|
|
||||||
public override Point3D BaseBanLocation => new(4, 8, 0);
|
SetSign(4, 8, 16);
|
||||||
|
|
||||||
public override HouseDeed GetDeed() => new BrickHouseDeed();
|
AddSouthDoor(-3, -1, 7);
|
||||||
|
AddSouthDoor(3, -1, 7);
|
||||||
public override void Serialize(IGenericWriter writer)
|
}
|
||||||
{
|
|
||||||
base.Serialize(writer);
|
public override int DefaultPrice => 144500;
|
||||||
writer.Write(0); // version
|
|
||||||
}
|
public override HousePlacementEntry ConvertEntry => HousePlacementEntry.ThreeStoryFoundations[20];
|
||||||
|
public override int ConvertOffsetX => -1;
|
||||||
public override void Deserialize(IGenericReader reader)
|
public override int ConvertOffsetY => -1;
|
||||||
{
|
|
||||||
base.Deserialize(reader);
|
public override Rectangle2D[] Area => AreaArray;
|
||||||
var version = reader.ReadInt();
|
public override Point3D BaseBanLocation => new(4, 8, 0);
|
||||||
}
|
|
||||||
}
|
public override HouseDeed GetDeed() => new BrickHouseDeed();
|
||||||
|
}
|
||||||
public class TwoStoryHouse : BaseHouse
|
|
||||||
{
|
[SerializationGenerator(0, false)]
|
||||||
public static Rectangle2D[] AreaArray =
|
public partial class TwoStoryHouse : BaseHouse
|
||||||
{ new(-7, 0, 14, 7), new(-7, -7, 9, 7), new(-4, 7, 4, 1) };
|
{
|
||||||
|
public static readonly Rectangle2D[] AreaArray =
|
||||||
public TwoStoryHouse(Mobile owner, int id) : base(id, owner, 1370, 10)
|
[new(-7, 0, 14, 7), new(-7, -7, 9, 7), new(-4, 7, 4, 1)];
|
||||||
{
|
|
||||||
var keyValue = CreateKeys(owner);
|
public TwoStoryHouse(Mobile owner, int id) : base(id, owner, 1370, 10)
|
||||||
|
{
|
||||||
AddSouthDoors(-3, 6, 7, keyValue);
|
var keyValue = CreateKeys(owner);
|
||||||
|
|
||||||
SetSign(2, 8, 16);
|
AddSouthDoors(-3, 6, 7, keyValue);
|
||||||
|
|
||||||
AddSouthDoor(-3, 0, 7);
|
SetSign(2, 8, 16);
|
||||||
AddSouthDoor(id == 0x76 ? -2 : -3, 0, 27);
|
|
||||||
}
|
AddSouthDoor(-3, 0, 7);
|
||||||
|
AddSouthDoor(id == 0x76 ? -2 : -3, 0, 27);
|
||||||
public TwoStoryHouse(Serial serial) : base(serial)
|
}
|
||||||
{
|
|
||||||
}
|
public override Rectangle2D[] Area => AreaArray;
|
||||||
|
public override Point3D BaseBanLocation => new(2, 8, 0);
|
||||||
public override Rectangle2D[] Area => AreaArray;
|
|
||||||
public override Point3D BaseBanLocation => new(2, 8, 0);
|
public override int DefaultPrice => 192400;
|
||||||
|
|
||||||
public override int DefaultPrice => 192400;
|
public override HouseDeed GetDeed()
|
||||||
|
{
|
||||||
public override HouseDeed GetDeed()
|
return ItemID switch
|
||||||
{
|
{
|
||||||
return ItemID switch
|
0x76 => new TwoStoryWoodPlasterHouseDeed(),
|
||||||
{
|
_ => new TwoStoryStonePlasterHouseDeed()
|
||||||
0x76 => new TwoStoryWoodPlasterHouseDeed(),
|
};
|
||||||
0x78 => new TwoStoryStonePlasterHouseDeed(),
|
}
|
||||||
_ => new TwoStoryStonePlasterHouseDeed()
|
}
|
||||||
};
|
|
||||||
}
|
[SerializationGenerator(0, false)]
|
||||||
|
public partial class Tower : BaseHouse
|
||||||
public override void Serialize(IGenericWriter writer)
|
{
|
||||||
{
|
public static readonly Rectangle2D[] AreaArray =
|
||||||
base.Serialize(writer);
|
[
|
||||||
writer.Write(0); // version
|
new(-7, -7, 16, 14), new(-1, 7, 4, 2), new(-11, 0, 4, 7),
|
||||||
}
|
new(9, 0, 4, 7)
|
||||||
|
];
|
||||||
public override void Deserialize(IGenericReader reader)
|
|
||||||
{
|
public Tower(Mobile owner) : base(0x7A, owner, 2119, 15)
|
||||||
base.Deserialize(reader);
|
{
|
||||||
var version = reader.ReadInt();
|
var keyValue = CreateKeys(owner);
|
||||||
}
|
|
||||||
}
|
AddSouthDoors(false, 0, 6, 6, keyValue);
|
||||||
|
|
||||||
public class Tower : BaseHouse
|
SetSign(5, 8, 16);
|
||||||
{
|
|
||||||
public static Rectangle2D[] AreaArray =
|
AddSouthDoor(false, 3, -2, 6);
|
||||||
{
|
AddEastDoor(false, 1, 4, 26);
|
||||||
new(-7, -7, 16, 14), new(-1, 7, 4, 2), new(-11, 0, 4, 7),
|
AddEastDoor(false, 1, 4, 46);
|
||||||
new(9, 0, 4, 7)
|
}
|
||||||
|
|
||||||
|
public override int DefaultPrice => 433200;
|
||||||
|
|
||||||
|
public override HousePlacementEntry ConvertEntry => HousePlacementEntry.ThreeStoryFoundations[37];
|
||||||
|
public override int ConvertOffsetY => -1;
|
||||||
|
|
||||||
|
public override Rectangle2D[] Area => AreaArray;
|
||||||
|
public override Point3D BaseBanLocation => new(5, 8, 0);
|
||||||
|
|
||||||
|
public override HouseDeed GetDeed() => new TowerDeed();
|
||||||
|
}
|
||||||
|
|
||||||
|
[SerializationGenerator(0, false)]
|
||||||
|
public partial class Keep : BaseHouse // warning: ODD shape!
|
||||||
|
{
|
||||||
|
public static readonly Rectangle2D[] AreaArray =
|
||||||
|
[
|
||||||
|
new(-11, -11, 7, 8), new(-11, 5, 7, 8), new(6, -11, 7, 8),
|
||||||
|
new(6, 5, 7, 8), new(-9, -3, 5, 8), new(6, -3, 5, 8),
|
||||||
|
new(-4, -9, 10, 20), new(-1, 11, 4, 1)
|
||||||
|
];
|
||||||
|
|
||||||
|
public Keep(Mobile owner) : base(0x7C, owner, 2625, 18)
|
||||||
|
{
|
||||||
|
var keyValue = CreateKeys(owner);
|
||||||
|
|
||||||
|
AddSouthDoors(false, 0, 10, 6, keyValue);
|
||||||
|
|
||||||
|
SetSign(5, 12, 16);
|
||||||
|
}
|
||||||
|
|
||||||
|
public override int DefaultPrice => 665200;
|
||||||
|
|
||||||
|
public override Rectangle2D[] Area => AreaArray;
|
||||||
|
public override Point3D BaseBanLocation => new(5, 13, 0);
|
||||||
|
|
||||||
|
public override HouseDeed GetDeed() => new KeepDeed();
|
||||||
|
}
|
||||||
|
|
||||||
|
[SerializationGenerator(0, false)]
|
||||||
|
public partial class Castle : BaseHouse
|
||||||
|
{
|
||||||
|
public static readonly Rectangle2D[] AreaArray = [new(-15, -15, 31, 31), new(-1, 16, 4, 1)];
|
||||||
|
|
||||||
|
public Castle(Mobile owner) : base(0x7E, owner, 4076, 28)
|
||||||
|
{
|
||||||
|
var keyValue = CreateKeys(owner);
|
||||||
|
|
||||||
|
AddSouthDoors(false, 0, 15, 6, keyValue);
|
||||||
|
|
||||||
|
SetSign(5, 17, 16);
|
||||||
|
|
||||||
|
AddSouthDoors(false, 0, 11, 6, true);
|
||||||
|
AddSouthDoors(false, 0, 5, 6, false);
|
||||||
|
AddSouthDoors(false, -1, -11, 6, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public override int DefaultPrice => 1022800;
|
||||||
|
|
||||||
|
public override Rectangle2D[] Area => AreaArray;
|
||||||
|
public override Point3D BaseBanLocation => new(5, 17, 0);
|
||||||
|
|
||||||
|
public override HouseDeed GetDeed() => new CastleDeed();
|
||||||
|
}
|
||||||
|
|
||||||
|
[SerializationGenerator(0, false)]
|
||||||
|
public partial class LargePatioHouse : BaseHouse
|
||||||
|
{
|
||||||
|
public static readonly Rectangle2D[] AreaArray = [new(-7, -7, 15, 14), new(-5, 7, 4, 1)];
|
||||||
|
|
||||||
|
public LargePatioHouse(Mobile owner) : base(0x8C, owner, 1100, 8)
|
||||||
|
{
|
||||||
|
var keyValue = CreateKeys(owner);
|
||||||
|
|
||||||
|
AddSouthDoors(-4, 6, 7, keyValue);
|
||||||
|
|
||||||
|
SetSign(1, 8, 16);
|
||||||
|
|
||||||
|
AddEastDoor(1, 4, 7);
|
||||||
|
AddEastDoor(1, -4, 7);
|
||||||
|
AddSouthDoor(4, -1, 7);
|
||||||
|
}
|
||||||
|
|
||||||
|
public override int DefaultPrice => 152800;
|
||||||
|
|
||||||
|
public override HousePlacementEntry ConvertEntry => HousePlacementEntry.ThreeStoryFoundations[29];
|
||||||
|
public override int ConvertOffsetY => -1;
|
||||||
|
|
||||||
|
public override Rectangle2D[] Area => AreaArray;
|
||||||
|
public override Point3D BaseBanLocation => new(1, 8, 0);
|
||||||
|
|
||||||
|
public override HouseDeed GetDeed() => new LargePatioDeed();
|
||||||
|
}
|
||||||
|
|
||||||
|
[SerializationGenerator(0, false)]
|
||||||
|
public partial class LargeMarbleHouse : BaseHouse
|
||||||
|
{
|
||||||
|
public static readonly Rectangle2D[] AreaArray = [new(-7, -7, 15, 14), new(-6, 7, 6, 1)];
|
||||||
|
|
||||||
|
public LargeMarbleHouse(Mobile owner) : base(0x96, owner, 1370, 10)
|
||||||
|
{
|
||||||
|
var keyValue = CreateKeys(owner);
|
||||||
|
|
||||||
|
AddSouthDoors(false, -4, 3, 4, keyValue);
|
||||||
|
|
||||||
|
SetSign(1, 8, 11);
|
||||||
|
}
|
||||||
|
|
||||||
|
public override int DefaultPrice => 192000;
|
||||||
|
|
||||||
|
public override HousePlacementEntry ConvertEntry => HousePlacementEntry.ThreeStoryFoundations[29];
|
||||||
|
public override int ConvertOffsetY => -1;
|
||||||
|
|
||||||
|
public override Rectangle2D[] Area => AreaArray;
|
||||||
|
public override Point3D BaseBanLocation => new(1, 8, 0);
|
||||||
|
|
||||||
|
public override HouseDeed GetDeed() => new LargeMarbleDeed();
|
||||||
|
}
|
||||||
|
|
||||||
|
[SerializationGenerator(0, false)]
|
||||||
|
public partial class SmallTower : BaseHouse
|
||||||
|
{
|
||||||
|
public static readonly Rectangle2D[] AreaArray = [new(-3, -3, 8, 7), new(2, 4, 3, 1)];
|
||||||
|
|
||||||
|
public SmallTower(Mobile owner) : base(0x98, owner, 580, 4)
|
||||||
|
{
|
||||||
|
var keyValue = CreateKeys(owner);
|
||||||
|
|
||||||
|
AddSouthDoor(false, 3, 3, 6, keyValue);
|
||||||
|
|
||||||
|
SetSign(1, 4, 5);
|
||||||
|
}
|
||||||
|
|
||||||
|
public override int DefaultPrice => 88500;
|
||||||
|
|
||||||
|
public override HousePlacementEntry ConvertEntry => HousePlacementEntry.TwoStoryFoundations[6];
|
||||||
|
|
||||||
|
public override Rectangle2D[] Area => AreaArray;
|
||||||
|
public override Point3D BaseBanLocation => new(1, 4, 0);
|
||||||
|
|
||||||
|
public override HouseDeed GetDeed() => new SmallTowerDeed();
|
||||||
|
}
|
||||||
|
|
||||||
|
[SerializationGenerator(0, false)]
|
||||||
|
public partial class LogCabin : BaseHouse
|
||||||
|
{
|
||||||
|
public static readonly Rectangle2D[] AreaArray = [new(-3, -6, 8, 13)];
|
||||||
|
|
||||||
|
public LogCabin(Mobile owner) : base(0x9A, owner, 1100, 8)
|
||||||
|
{
|
||||||
|
var keyValue = CreateKeys(owner);
|
||||||
|
|
||||||
|
AddSouthDoor(1, 4, 8, keyValue);
|
||||||
|
|
||||||
|
SetSign(5, 8, 20);
|
||||||
|
|
||||||
|
AddSouthDoor(1, 0, 29);
|
||||||
|
}
|
||||||
|
|
||||||
|
public override int DefaultPrice => 97800;
|
||||||
|
|
||||||
|
public override HousePlacementEntry ConvertEntry => HousePlacementEntry.TwoStoryFoundations[12];
|
||||||
|
|
||||||
|
public override Rectangle2D[] Area => AreaArray;
|
||||||
|
public override Point3D BaseBanLocation => new(5, 8, 0);
|
||||||
|
|
||||||
|
public override HouseDeed GetDeed() => new LogCabinDeed();
|
||||||
|
}
|
||||||
|
|
||||||
|
[SerializationGenerator(0, false)]
|
||||||
|
public partial class SandStonePatio : BaseHouse
|
||||||
|
{
|
||||||
|
public static readonly Rectangle2D[] AreaArray = [new(-5, -4, 12, 8), new(-2, 4, 3, 1)];
|
||||||
|
|
||||||
|
public SandStonePatio(Mobile owner) : base(0x9C, owner, 850, 6)
|
||||||
|
{
|
||||||
|
var keyValue = CreateKeys(owner);
|
||||||
|
|
||||||
|
AddSouthDoor(-1, 3, 6, keyValue);
|
||||||
|
|
||||||
|
SetSign(4, 6, 24);
|
||||||
|
}
|
||||||
|
|
||||||
|
public override int DefaultPrice => 90900;
|
||||||
|
|
||||||
|
public override HousePlacementEntry ConvertEntry => HousePlacementEntry.TwoStoryFoundations[35];
|
||||||
|
public override int ConvertOffsetY => -1;
|
||||||
|
|
||||||
|
public override Rectangle2D[] Area => AreaArray;
|
||||||
|
public override Point3D BaseBanLocation => new(4, 6, 0);
|
||||||
|
|
||||||
|
public override HouseDeed GetDeed() => new SandstonePatioDeed();
|
||||||
|
}
|
||||||
|
|
||||||
|
[SerializationGenerator(0, false)]
|
||||||
|
public partial class TwoStoryVilla : BaseHouse
|
||||||
|
{
|
||||||
|
public static readonly Rectangle2D[] AreaArray = [new(-5, -5, 11, 11), new(2, 6, 4, 1)];
|
||||||
|
|
||||||
|
public TwoStoryVilla(Mobile owner) : base(0x9E, owner, 1100, 8)
|
||||||
|
{
|
||||||
|
var keyValue = CreateKeys(owner);
|
||||||
|
|
||||||
|
AddSouthDoors(3, 1, 5, keyValue);
|
||||||
|
|
||||||
|
SetSign(3, 8, 24);
|
||||||
|
|
||||||
|
AddEastDoor(1, 0, 25);
|
||||||
|
AddSouthDoor(-3, -1, 25);
|
||||||
|
}
|
||||||
|
|
||||||
|
public override int DefaultPrice => 136500;
|
||||||
|
|
||||||
|
public override HousePlacementEntry ConvertEntry => HousePlacementEntry.TwoStoryFoundations[31];
|
||||||
|
|
||||||
|
public override Rectangle2D[] Area => AreaArray;
|
||||||
|
public override Point3D BaseBanLocation => new(3, 8, 0);
|
||||||
|
|
||||||
|
public override HouseDeed GetDeed() => new VillaDeed();
|
||||||
|
}
|
||||||
|
|
||||||
|
[SerializationGenerator(0, false)]
|
||||||
|
public partial class SmallShop : BaseHouse
|
||||||
|
{
|
||||||
|
public static readonly Rectangle2D[] AreaArray1 = [new(-3, -3, 7, 7), new(-1, 4, 4, 1)];
|
||||||
|
public static readonly Rectangle2D[] AreaArray2 = [new(-3, -3, 7, 7), new(-2, 4, 3, 1)];
|
||||||
|
|
||||||
|
public SmallShop(Mobile owner, int id) : base(id, owner, 425, 3)
|
||||||
|
{
|
||||||
|
var keyValue = CreateKeys(owner);
|
||||||
|
|
||||||
|
var door = MakeDoor(false, DoorFacing.EastCW);
|
||||||
|
|
||||||
|
door.Locked = true;
|
||||||
|
door.KeyValue = keyValue;
|
||||||
|
|
||||||
|
if (door is BaseHouseDoor houseDoor)
|
||||||
|
{
|
||||||
|
houseDoor.Facing = DoorFacing.EastCCW;
|
||||||
|
}
|
||||||
|
|
||||||
|
AddDoor(door, -2, 0, id == 0xA2 ? 24 : 27);
|
||||||
|
|
||||||
|
// AddSouthDoor( false, -2, 0, 27 - (id == 0xA2 ? 3 : 0), keyValue );
|
||||||
|
|
||||||
|
SetSign(3, 4, 7 - (id == 0xA2 ? 2 : 0));
|
||||||
|
}
|
||||||
|
|
||||||
|
public override Rectangle2D[] Area => ItemID == 0x40A2 ? AreaArray1 : AreaArray2;
|
||||||
|
public override Point3D BaseBanLocation => new(3, 4, 0);
|
||||||
|
|
||||||
|
public override int DefaultPrice => 63000;
|
||||||
|
|
||||||
|
public override HousePlacementEntry ConvertEntry => HousePlacementEntry.TwoStoryFoundations[0];
|
||||||
|
|
||||||
|
public override HouseDeed GetDeed()
|
||||||
|
{
|
||||||
|
return ItemID switch
|
||||||
|
{
|
||||||
|
0xA0 => new StoneWorkshopDeed(),
|
||||||
|
_ => new MarbleWorkshopDeed()
|
||||||
};
|
};
|
||||||
|
|
||||||
public Tower(Mobile owner) : base(0x7A, owner, 2119, 15)
|
|
||||||
{
|
|
||||||
var keyValue = CreateKeys(owner);
|
|
||||||
|
|
||||||
AddSouthDoors(false, 0, 6, 6, keyValue);
|
|
||||||
|
|
||||||
SetSign(5, 8, 16);
|
|
||||||
|
|
||||||
AddSouthDoor(false, 3, -2, 6);
|
|
||||||
AddEastDoor(false, 1, 4, 26);
|
|
||||||
AddEastDoor(false, 1, 4, 46);
|
|
||||||
}
|
|
||||||
|
|
||||||
public Tower(Serial serial) : base(serial)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public override int DefaultPrice => 433200;
|
|
||||||
|
|
||||||
public override HousePlacementEntry ConvertEntry => HousePlacementEntry.ThreeStoryFoundations[37];
|
|
||||||
public override int ConvertOffsetY => -1;
|
|
||||||
|
|
||||||
public override Rectangle2D[] Area => AreaArray;
|
|
||||||
public override Point3D BaseBanLocation => new(5, 8, 0);
|
|
||||||
|
|
||||||
public override HouseDeed GetDeed() => new TowerDeed();
|
|
||||||
|
|
||||||
public override void Serialize(IGenericWriter writer)
|
|
||||||
{
|
|
||||||
base.Serialize(writer);
|
|
||||||
writer.Write(0); // version
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Deserialize(IGenericReader reader)
|
|
||||||
{
|
|
||||||
base.Deserialize(reader);
|
|
||||||
var version = reader.ReadInt();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public class Keep : BaseHouse // warning: ODD shape!
|
|
||||||
{
|
|
||||||
public static Rectangle2D[] AreaArray =
|
|
||||||
{
|
|
||||||
new(-11, -11, 7, 8), new(-11, 5, 7, 8), new(6, -11, 7, 8),
|
|
||||||
new(6, 5, 7, 8), new(-9, -3, 5, 8), new(6, -3, 5, 8),
|
|
||||||
new(-4, -9, 10, 20), new(-1, 11, 4, 1)
|
|
||||||
};
|
|
||||||
|
|
||||||
public Keep(Mobile owner) : base(0x7C, owner, 2625, 18)
|
|
||||||
{
|
|
||||||
var keyValue = CreateKeys(owner);
|
|
||||||
|
|
||||||
AddSouthDoors(false, 0, 10, 6, keyValue);
|
|
||||||
|
|
||||||
SetSign(5, 12, 16);
|
|
||||||
}
|
|
||||||
|
|
||||||
public Keep(Serial serial) : base(serial)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public override int DefaultPrice => 665200;
|
|
||||||
|
|
||||||
public override Rectangle2D[] Area => AreaArray;
|
|
||||||
public override Point3D BaseBanLocation => new(5, 13, 0);
|
|
||||||
|
|
||||||
public override HouseDeed GetDeed() => new KeepDeed();
|
|
||||||
|
|
||||||
public override void Serialize(IGenericWriter writer)
|
|
||||||
{
|
|
||||||
base.Serialize(writer);
|
|
||||||
writer.Write(0); // version
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Deserialize(IGenericReader reader)
|
|
||||||
{
|
|
||||||
base.Deserialize(reader);
|
|
||||||
var version = reader.ReadInt();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public class Castle : BaseHouse
|
|
||||||
{
|
|
||||||
public static Rectangle2D[] AreaArray = { new(-15, -15, 31, 31), new(-1, 16, 4, 1) };
|
|
||||||
|
|
||||||
public Castle(Mobile owner) : base(0x7E, owner, 4076, 28)
|
|
||||||
{
|
|
||||||
var keyValue = CreateKeys(owner);
|
|
||||||
|
|
||||||
AddSouthDoors(false, 0, 15, 6, keyValue);
|
|
||||||
|
|
||||||
SetSign(5, 17, 16);
|
|
||||||
|
|
||||||
AddSouthDoors(false, 0, 11, 6, true);
|
|
||||||
AddSouthDoors(false, 0, 5, 6, false);
|
|
||||||
AddSouthDoors(false, -1, -11, 6, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
public Castle(Serial serial) : base(serial)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public override int DefaultPrice => 1022800;
|
|
||||||
|
|
||||||
public override Rectangle2D[] Area => AreaArray;
|
|
||||||
public override Point3D BaseBanLocation => new(5, 17, 0);
|
|
||||||
|
|
||||||
public override HouseDeed GetDeed() => new CastleDeed();
|
|
||||||
|
|
||||||
public override void Serialize(IGenericWriter writer)
|
|
||||||
{
|
|
||||||
base.Serialize(writer);
|
|
||||||
writer.Write(0); // version
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Deserialize(IGenericReader reader)
|
|
||||||
{
|
|
||||||
base.Deserialize(reader);
|
|
||||||
var version = reader.ReadInt();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public class LargePatioHouse : BaseHouse
|
|
||||||
{
|
|
||||||
public static Rectangle2D[] AreaArray = { new(-7, -7, 15, 14), new(-5, 7, 4, 1) };
|
|
||||||
|
|
||||||
public LargePatioHouse(Mobile owner) : base(0x8C, owner, 1100, 8)
|
|
||||||
{
|
|
||||||
var keyValue = CreateKeys(owner);
|
|
||||||
|
|
||||||
AddSouthDoors(-4, 6, 7, keyValue);
|
|
||||||
|
|
||||||
SetSign(1, 8, 16);
|
|
||||||
|
|
||||||
AddEastDoor(1, 4, 7);
|
|
||||||
AddEastDoor(1, -4, 7);
|
|
||||||
AddSouthDoor(4, -1, 7);
|
|
||||||
}
|
|
||||||
|
|
||||||
public LargePatioHouse(Serial serial) : base(serial)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public override int DefaultPrice => 152800;
|
|
||||||
|
|
||||||
public override HousePlacementEntry ConvertEntry => HousePlacementEntry.ThreeStoryFoundations[29];
|
|
||||||
public override int ConvertOffsetY => -1;
|
|
||||||
|
|
||||||
public override Rectangle2D[] Area => AreaArray;
|
|
||||||
public override Point3D BaseBanLocation => new(1, 8, 0);
|
|
||||||
|
|
||||||
public override HouseDeed GetDeed() => new LargePatioDeed();
|
|
||||||
|
|
||||||
public override void Serialize(IGenericWriter writer)
|
|
||||||
{
|
|
||||||
base.Serialize(writer);
|
|
||||||
writer.Write(0); // version
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Deserialize(IGenericReader reader)
|
|
||||||
{
|
|
||||||
base.Deserialize(reader);
|
|
||||||
var version = reader.ReadInt();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public class LargeMarbleHouse : BaseHouse
|
|
||||||
{
|
|
||||||
public static Rectangle2D[] AreaArray = { new(-7, -7, 15, 14), new(-6, 7, 6, 1) };
|
|
||||||
|
|
||||||
public LargeMarbleHouse(Mobile owner) : base(0x96, owner, 1370, 10)
|
|
||||||
{
|
|
||||||
var keyValue = CreateKeys(owner);
|
|
||||||
|
|
||||||
AddSouthDoors(false, -4, 3, 4, keyValue);
|
|
||||||
|
|
||||||
SetSign(1, 8, 11);
|
|
||||||
}
|
|
||||||
|
|
||||||
public LargeMarbleHouse(Serial serial) : base(serial)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public override int DefaultPrice => 192000;
|
|
||||||
|
|
||||||
public override HousePlacementEntry ConvertEntry => HousePlacementEntry.ThreeStoryFoundations[29];
|
|
||||||
public override int ConvertOffsetY => -1;
|
|
||||||
|
|
||||||
public override Rectangle2D[] Area => AreaArray;
|
|
||||||
public override Point3D BaseBanLocation => new(1, 8, 0);
|
|
||||||
|
|
||||||
public override HouseDeed GetDeed() => new LargeMarbleDeed();
|
|
||||||
|
|
||||||
public override void Serialize(IGenericWriter writer)
|
|
||||||
{
|
|
||||||
base.Serialize(writer);
|
|
||||||
writer.Write(0); // version
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Deserialize(IGenericReader reader)
|
|
||||||
{
|
|
||||||
base.Deserialize(reader);
|
|
||||||
var version = reader.ReadInt();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public class SmallTower : BaseHouse
|
|
||||||
{
|
|
||||||
public static Rectangle2D[] AreaArray = { new(-3, -3, 8, 7), new(2, 4, 3, 1) };
|
|
||||||
|
|
||||||
public SmallTower(Mobile owner) : base(0x98, owner, 580, 4)
|
|
||||||
{
|
|
||||||
var keyValue = CreateKeys(owner);
|
|
||||||
|
|
||||||
AddSouthDoor(false, 3, 3, 6, keyValue);
|
|
||||||
|
|
||||||
SetSign(1, 4, 5);
|
|
||||||
}
|
|
||||||
|
|
||||||
public SmallTower(Serial serial) : base(serial)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public override int DefaultPrice => 88500;
|
|
||||||
|
|
||||||
public override HousePlacementEntry ConvertEntry => HousePlacementEntry.TwoStoryFoundations[6];
|
|
||||||
|
|
||||||
public override Rectangle2D[] Area => AreaArray;
|
|
||||||
public override Point3D BaseBanLocation => new(1, 4, 0);
|
|
||||||
|
|
||||||
public override HouseDeed GetDeed() => new SmallTowerDeed();
|
|
||||||
|
|
||||||
public override void Serialize(IGenericWriter writer)
|
|
||||||
{
|
|
||||||
base.Serialize(writer);
|
|
||||||
writer.Write(0); // version
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Deserialize(IGenericReader reader)
|
|
||||||
{
|
|
||||||
base.Deserialize(reader);
|
|
||||||
var version = reader.ReadInt();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public class LogCabin : BaseHouse
|
|
||||||
{
|
|
||||||
public static Rectangle2D[] AreaArray = { new(-3, -6, 8, 13) };
|
|
||||||
|
|
||||||
public LogCabin(Mobile owner) : base(0x9A, owner, 1100, 8)
|
|
||||||
{
|
|
||||||
var keyValue = CreateKeys(owner);
|
|
||||||
|
|
||||||
AddSouthDoor(1, 4, 8, keyValue);
|
|
||||||
|
|
||||||
SetSign(5, 8, 20);
|
|
||||||
|
|
||||||
AddSouthDoor(1, 0, 29);
|
|
||||||
}
|
|
||||||
|
|
||||||
public LogCabin(Serial serial) : base(serial)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public override int DefaultPrice => 97800;
|
|
||||||
|
|
||||||
public override HousePlacementEntry ConvertEntry => HousePlacementEntry.TwoStoryFoundations[12];
|
|
||||||
|
|
||||||
public override Rectangle2D[] Area => AreaArray;
|
|
||||||
public override Point3D BaseBanLocation => new(5, 8, 0);
|
|
||||||
|
|
||||||
public override HouseDeed GetDeed() => new LogCabinDeed();
|
|
||||||
|
|
||||||
public override void Serialize(IGenericWriter writer)
|
|
||||||
{
|
|
||||||
base.Serialize(writer);
|
|
||||||
writer.Write(0); // version
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Deserialize(IGenericReader reader)
|
|
||||||
{
|
|
||||||
base.Deserialize(reader);
|
|
||||||
var version = reader.ReadInt();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public class SandStonePatio : BaseHouse
|
|
||||||
{
|
|
||||||
public static Rectangle2D[] AreaArray = { new(-5, -4, 12, 8), new(-2, 4, 3, 1) };
|
|
||||||
|
|
||||||
public SandStonePatio(Mobile owner) : base(0x9C, owner, 850, 6)
|
|
||||||
{
|
|
||||||
var keyValue = CreateKeys(owner);
|
|
||||||
|
|
||||||
AddSouthDoor(-1, 3, 6, keyValue);
|
|
||||||
|
|
||||||
SetSign(4, 6, 24);
|
|
||||||
}
|
|
||||||
|
|
||||||
public SandStonePatio(Serial serial) : base(serial)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public override int DefaultPrice => 90900;
|
|
||||||
|
|
||||||
public override HousePlacementEntry ConvertEntry => HousePlacementEntry.TwoStoryFoundations[35];
|
|
||||||
public override int ConvertOffsetY => -1;
|
|
||||||
|
|
||||||
public override Rectangle2D[] Area => AreaArray;
|
|
||||||
public override Point3D BaseBanLocation => new(4, 6, 0);
|
|
||||||
|
|
||||||
public override HouseDeed GetDeed() => new SandstonePatioDeed();
|
|
||||||
|
|
||||||
public override void Serialize(IGenericWriter writer)
|
|
||||||
{
|
|
||||||
base.Serialize(writer);
|
|
||||||
writer.Write(0); // version
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Deserialize(IGenericReader reader)
|
|
||||||
{
|
|
||||||
base.Deserialize(reader);
|
|
||||||
var version = reader.ReadInt();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public class TwoStoryVilla : BaseHouse
|
|
||||||
{
|
|
||||||
public static Rectangle2D[] AreaArray = { new(-5, -5, 11, 11), new(2, 6, 4, 1) };
|
|
||||||
|
|
||||||
public TwoStoryVilla(Mobile owner) : base(0x9E, owner, 1100, 8)
|
|
||||||
{
|
|
||||||
var keyValue = CreateKeys(owner);
|
|
||||||
|
|
||||||
AddSouthDoors(3, 1, 5, keyValue);
|
|
||||||
|
|
||||||
SetSign(3, 8, 24);
|
|
||||||
|
|
||||||
AddEastDoor(1, 0, 25);
|
|
||||||
AddSouthDoor(-3, -1, 25);
|
|
||||||
}
|
|
||||||
|
|
||||||
public TwoStoryVilla(Serial serial) : base(serial)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public override int DefaultPrice => 136500;
|
|
||||||
|
|
||||||
public override HousePlacementEntry ConvertEntry => HousePlacementEntry.TwoStoryFoundations[31];
|
|
||||||
|
|
||||||
public override Rectangle2D[] Area => AreaArray;
|
|
||||||
public override Point3D BaseBanLocation => new(3, 8, 0);
|
|
||||||
|
|
||||||
public override HouseDeed GetDeed() => new VillaDeed();
|
|
||||||
|
|
||||||
public override void Serialize(IGenericWriter writer)
|
|
||||||
{
|
|
||||||
base.Serialize(writer);
|
|
||||||
writer.Write(0); // version
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Deserialize(IGenericReader reader)
|
|
||||||
{
|
|
||||||
base.Deserialize(reader);
|
|
||||||
var version = reader.ReadInt();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public class SmallShop : BaseHouse
|
|
||||||
{
|
|
||||||
public static Rectangle2D[] AreaArray1 = { new(-3, -3, 7, 7), new(-1, 4, 4, 1) };
|
|
||||||
public static Rectangle2D[] AreaArray2 = { new(-3, -3, 7, 7), new(-2, 4, 3, 1) };
|
|
||||||
|
|
||||||
public SmallShop(Mobile owner, int id) : base(id, owner, 425, 3)
|
|
||||||
{
|
|
||||||
var keyValue = CreateKeys(owner);
|
|
||||||
|
|
||||||
var door = MakeDoor(false, DoorFacing.EastCW);
|
|
||||||
|
|
||||||
door.Locked = true;
|
|
||||||
door.KeyValue = keyValue;
|
|
||||||
|
|
||||||
if (door is BaseHouseDoor houseDoor)
|
|
||||||
{
|
|
||||||
houseDoor.Facing = DoorFacing.EastCCW;
|
|
||||||
}
|
|
||||||
|
|
||||||
AddDoor(door, -2, 0, id == 0xA2 ? 24 : 27);
|
|
||||||
|
|
||||||
// AddSouthDoor( false, -2, 0, 27 - (id == 0xA2 ? 3 : 0), keyValue );
|
|
||||||
|
|
||||||
SetSign(3, 4, 7 - (id == 0xA2 ? 2 : 0));
|
|
||||||
}
|
|
||||||
|
|
||||||
public SmallShop(Serial serial) : base(serial)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public override Rectangle2D[] Area => ItemID == 0x40A2 ? AreaArray1 : AreaArray2;
|
|
||||||
public override Point3D BaseBanLocation => new(3, 4, 0);
|
|
||||||
|
|
||||||
public override int DefaultPrice => 63000;
|
|
||||||
|
|
||||||
public override HousePlacementEntry ConvertEntry => HousePlacementEntry.TwoStoryFoundations[0];
|
|
||||||
|
|
||||||
public override HouseDeed GetDeed()
|
|
||||||
{
|
|
||||||
return ItemID switch
|
|
||||||
{
|
|
||||||
0xA0 => new StoneWorkshopDeed(),
|
|
||||||
0xA2 => new MarbleWorkshopDeed(),
|
|
||||||
_ => new MarbleWorkshopDeed()
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Serialize(IGenericWriter writer)
|
|
||||||
{
|
|
||||||
base.Serialize(writer);
|
|
||||||
writer.Write(0); // version
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Deserialize(IGenericReader reader)
|
|
||||||
{
|
|
||||||
base.Deserialize(reader);
|
|
||||||
var version = reader.ReadInt();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,346 +1,303 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using ModernUO.Serialization;
|
||||||
using Server.Items;
|
using Server.Items;
|
||||||
using Server.Network;
|
using Server.Network;
|
||||||
|
|
||||||
namespace Server.Multis
|
namespace Server.Multis;
|
||||||
|
|
||||||
|
[SerializationGenerator(0)]
|
||||||
|
public partial class MovingCrate : Container
|
||||||
{
|
{
|
||||||
public class MovingCrate : Container
|
private const int MaxItemsPerSubcontainer = 20;
|
||||||
|
private const int Rows = 3;
|
||||||
|
private const int Columns = 5;
|
||||||
|
private const int HorizontalSpacing = 25;
|
||||||
|
private const int VerticalSpacing = 25;
|
||||||
|
|
||||||
|
private Timer _internalizeTimer;
|
||||||
|
|
||||||
|
[SerializableField(0)]
|
||||||
|
private BaseHouse _house;
|
||||||
|
|
||||||
|
public MovingCrate(BaseHouse house) : base(0xE3D)
|
||||||
{
|
{
|
||||||
public static readonly int MaxItemsPerSubcontainer = 20;
|
Hue = 0x8A5;
|
||||||
public static readonly int Rows = 3;
|
Movable = false;
|
||||||
public static readonly int Columns = 5;
|
|
||||||
public static readonly int HorizontalSpacing = 25;
|
|
||||||
public static readonly int VerticalSpacing = 25;
|
|
||||||
|
|
||||||
private Timer m_InternalizeTimer;
|
House = house;
|
||||||
|
}
|
||||||
|
|
||||||
public MovingCrate(BaseHouse house) : base(0xE3D)
|
public override int LabelNumber => 1061690; // Packing Crate
|
||||||
|
|
||||||
|
public override int DefaultMaxItems => 0;
|
||||||
|
public override int DefaultMaxWeight => 0;
|
||||||
|
|
||||||
|
public override bool IsDecoContainer => false;
|
||||||
|
|
||||||
|
/*
|
||||||
|
public override void AddNameProperties( ObjectPropertyList list )
|
||||||
|
{
|
||||||
|
base.AddNameProperties( list );
|
||||||
|
|
||||||
|
if (House != null && House.InternalizedVendors.Count > 0)
|
||||||
|
list.Add( 1061833, House.InternalizedVendors.Count.ToString() ); // This packing crate contains ~1_COUNT~ vendors/barkeepers.
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
public override void DropItem(Item dropped)
|
||||||
|
{
|
||||||
|
// 1. Try to stack the item
|
||||||
|
foreach (var item in Items)
|
||||||
{
|
{
|
||||||
Hue = 0x8A5;
|
if (item is PackingBox)
|
||||||
Movable = false;
|
|
||||||
|
|
||||||
House = house;
|
|
||||||
}
|
|
||||||
|
|
||||||
public MovingCrate(Serial serial) : base(serial)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public override int LabelNumber => 1061690; // Packing Crate
|
|
||||||
|
|
||||||
public BaseHouse House { get; set; }
|
|
||||||
|
|
||||||
public override int DefaultMaxItems => 0;
|
|
||||||
public override int DefaultMaxWeight => 0;
|
|
||||||
|
|
||||||
public override bool IsDecoContainer => false;
|
|
||||||
|
|
||||||
/*
|
|
||||||
public override void AddNameProperties( ObjectPropertyList list )
|
|
||||||
{
|
|
||||||
base.AddNameProperties( list );
|
|
||||||
|
|
||||||
if (House != null && House.InternalizedVendors.Count > 0)
|
|
||||||
list.Add( 1061833, House.InternalizedVendors.Count.ToString() ); // This packing crate contains ~1_COUNT~ vendors/barkeepers.
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
public override void DropItem(Item dropped)
|
|
||||||
{
|
|
||||||
// 1. Try to stack the item
|
|
||||||
foreach (var item in Items)
|
|
||||||
{
|
{
|
||||||
if (item is PackingBox)
|
var subItems = item.Items;
|
||||||
|
|
||||||
|
for (var i = 0; i < subItems.Count; i++)
|
||||||
{
|
{
|
||||||
var subItems = item.Items;
|
var subItem = subItems[i];
|
||||||
|
|
||||||
for (var i = 0; i < subItems.Count; i++)
|
if (subItem is not Container && subItem.StackWith(null, dropped, false))
|
||||||
{
|
{
|
||||||
var subItem = subItems[i];
|
|
||||||
|
|
||||||
if (subItem is not Container && subItem.StackWith(null, dropped, false))
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 2. Try to drop the item into an existing container
|
|
||||||
foreach (var item in Items)
|
|
||||||
{
|
|
||||||
if (item is PackingBox packingBox)
|
|
||||||
{
|
|
||||||
var subItems = packingBox.Items;
|
|
||||||
|
|
||||||
if (subItems.Count < MaxItemsPerSubcontainer)
|
|
||||||
{
|
|
||||||
packingBox.DropItem(dropped);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 3. Drop the item into a new container
|
|
||||||
var subContainer = new PackingBox();
|
|
||||||
subContainer.DropItem(dropped);
|
|
||||||
|
|
||||||
var location = GetFreeLocation();
|
|
||||||
if (location != Point3D.Zero)
|
|
||||||
{
|
|
||||||
AddItem(subContainer);
|
|
||||||
subContainer.Location = location;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
base.DropItem(subContainer);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private Point3D GetFreeLocation()
|
// 2. Try to drop the item into an existing container
|
||||||
|
foreach (var item in Items)
|
||||||
{
|
{
|
||||||
var positions = new bool[Rows, Columns];
|
if (item is PackingBox packingBox)
|
||||||
|
|
||||||
foreach (var item in Items)
|
|
||||||
{
|
{
|
||||||
if (item is PackingBox)
|
var subItems = packingBox.Items;
|
||||||
|
|
||||||
|
if (subItems.Count < MaxItemsPerSubcontainer)
|
||||||
{
|
{
|
||||||
var i = (item.Y - Bounds.Y) / VerticalSpacing;
|
packingBox.DropItem(dropped);
|
||||||
if (i < 0)
|
return;
|
||||||
{
|
|
||||||
i = 0;
|
|
||||||
}
|
|
||||||
else if (i >= Rows)
|
|
||||||
{
|
|
||||||
i = Rows - 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
var j = (item.X - Bounds.X) / HorizontalSpacing;
|
|
||||||
if (j < 0)
|
|
||||||
{
|
|
||||||
j = 0;
|
|
||||||
}
|
|
||||||
else if (j >= Columns)
|
|
||||||
{
|
|
||||||
j = Columns - 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
positions[i, j] = true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (var i = 0; i < Rows; i++)
|
|
||||||
{
|
|
||||||
for (var j = 0; j < Columns; j++)
|
|
||||||
{
|
|
||||||
if (!positions[i, j])
|
|
||||||
{
|
|
||||||
var x = Bounds.X + j * HorizontalSpacing;
|
|
||||||
var y = Bounds.Y + i * VerticalSpacing;
|
|
||||||
|
|
||||||
return new Point3D(x, y, 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return Point3D.Zero;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool CheckHold(Mobile m, Item item, bool message, bool checkItems, int plusItems, int plusWeight)
|
// 3. Drop the item into a new container
|
||||||
{
|
var subContainer = new PackingBox();
|
||||||
if (m.AccessLevel < AccessLevel.GameMaster)
|
subContainer.DropItem(dropped);
|
||||||
{
|
|
||||||
m.SendLocalizedMessage(1061145); // You cannot place items into a house moving crate.
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return base.CheckHold(m, item, message, checkItems, plusItems, plusWeight);
|
var location = GetFreeLocation();
|
||||||
|
if (location != Point3D.Zero)
|
||||||
|
{
|
||||||
|
AddItem(subContainer);
|
||||||
|
subContainer.Location = location;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
public override bool CheckLift(Mobile from, Item item, ref LRReason reject) => House?.Deleted == false &&
|
|
||||||
base.CheckLift(from, item, ref reject) && House.IsOwner(from);
|
|
||||||
|
|
||||||
public override bool CheckItemUse(Mobile from, Item item) =>
|
|
||||||
House?.Deleted == false && base.CheckItemUse(from, item) && House.IsOwner(from);
|
|
||||||
|
|
||||||
public override void OnItemRemoved(Item item)
|
|
||||||
{
|
{
|
||||||
base.OnItemRemoved(item);
|
base.DropItem(subContainer);
|
||||||
|
|
||||||
if (TotalItems == 0)
|
|
||||||
{
|
|
||||||
Delete();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void RestartTimer()
|
|
||||||
{
|
|
||||||
if (m_InternalizeTimer == null)
|
|
||||||
{
|
|
||||||
m_InternalizeTimer = new InternalizeTimer(this);
|
|
||||||
m_InternalizeTimer.Start();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
m_InternalizeTimer.Stop();
|
|
||||||
m_InternalizeTimer.Start();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Hide()
|
|
||||||
{
|
|
||||||
if (m_InternalizeTimer != null)
|
|
||||||
{
|
|
||||||
m_InternalizeTimer.Stop();
|
|
||||||
m_InternalizeTimer = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
var toRemove = new List<Item>();
|
|
||||||
foreach (var item in Items)
|
|
||||||
{
|
|
||||||
if (item is PackingBox && item.Items.Count == 0)
|
|
||||||
{
|
|
||||||
toRemove.Add(item);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach (var item in toRemove)
|
|
||||||
{
|
|
||||||
item.Delete();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (TotalItems == 0)
|
|
||||||
{
|
|
||||||
Delete();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Internalize();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void OnAfterDelete()
|
|
||||||
{
|
|
||||||
base.OnAfterDelete();
|
|
||||||
|
|
||||||
if (House?.MovingCrate == this)
|
|
||||||
{
|
|
||||||
House.MovingCrate = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
m_InternalizeTimer?.Stop();
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Serialize(IGenericWriter writer)
|
|
||||||
{
|
|
||||||
base.Serialize(writer);
|
|
||||||
|
|
||||||
writer.WriteEncodedInt(1);
|
|
||||||
|
|
||||||
writer.Write(House);
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Deserialize(IGenericReader reader)
|
|
||||||
{
|
|
||||||
base.Deserialize(reader);
|
|
||||||
|
|
||||||
var version = reader.ReadEncodedInt();
|
|
||||||
|
|
||||||
House = reader.ReadEntity<BaseHouse>();
|
|
||||||
|
|
||||||
if (House != null)
|
|
||||||
{
|
|
||||||
House.MovingCrate = this;
|
|
||||||
Timer.StartTimer(Hide);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Timer.StartTimer(Delete);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (version == 0)
|
|
||||||
{
|
|
||||||
MaxItems = -1; // reset to default
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public class InternalizeTimer : Timer
|
|
||||||
{
|
|
||||||
private readonly MovingCrate m_Crate;
|
|
||||||
|
|
||||||
public InternalizeTimer(MovingCrate crate) : base(TimeSpan.FromMinutes(5.0))
|
|
||||||
{
|
|
||||||
m_Crate = crate;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void OnTick()
|
|
||||||
{
|
|
||||||
m_Crate.Hide();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class PackingBox : BaseContainer
|
private Point3D GetFreeLocation()
|
||||||
{
|
{
|
||||||
public PackingBox() : base(0x9A8) => Movable = false;
|
var positions = new bool[Rows, Columns];
|
||||||
|
|
||||||
public PackingBox(Serial serial) : base(serial)
|
foreach (var item in Items)
|
||||||
{
|
{
|
||||||
}
|
if (item is PackingBox)
|
||||||
|
|
||||||
public override int LabelNumber => 1061690; // Packing Crate
|
|
||||||
|
|
||||||
public override int DefaultGumpID => 0x4B;
|
|
||||||
public override int DefaultDropSound => 0x42;
|
|
||||||
|
|
||||||
public override Rectangle2D Bounds => new(16, 51, 168, 73);
|
|
||||||
|
|
||||||
public override int DefaultMaxItems => 0;
|
|
||||||
public override int DefaultMaxWeight => 0;
|
|
||||||
|
|
||||||
public override void SendCantStoreMessage(Mobile to, Item item)
|
|
||||||
{
|
|
||||||
to.SendLocalizedMessage(1061145); // You cannot place items into a house moving crate.
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void OnItemRemoved(Item item)
|
|
||||||
{
|
|
||||||
base.OnItemRemoved(item);
|
|
||||||
|
|
||||||
if (item.GetBounce() == null && TotalItems == 0)
|
|
||||||
{
|
{
|
||||||
Delete();
|
var i = (item.Y - Bounds.Y) / VerticalSpacing;
|
||||||
|
if (i < 0)
|
||||||
|
{
|
||||||
|
i = 0;
|
||||||
|
}
|
||||||
|
else if (i >= Rows)
|
||||||
|
{
|
||||||
|
i = Rows - 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
var j = (item.X - Bounds.X) / HorizontalSpacing;
|
||||||
|
if (j < 0)
|
||||||
|
{
|
||||||
|
j = 0;
|
||||||
|
}
|
||||||
|
else if (j >= Columns)
|
||||||
|
{
|
||||||
|
j = Columns - 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
positions[i, j] = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void OnItemBounceCleared(Item item)
|
for (var i = 0; i < Rows; i++)
|
||||||
{
|
{
|
||||||
base.OnItemBounceCleared(item);
|
for (var j = 0; j < Columns; j++)
|
||||||
|
|
||||||
if (TotalItems == 0)
|
|
||||||
{
|
{
|
||||||
Delete();
|
if (!positions[i, j])
|
||||||
|
{
|
||||||
|
var x = Bounds.X + j * HorizontalSpacing;
|
||||||
|
var y = Bounds.Y + i * VerticalSpacing;
|
||||||
|
|
||||||
|
return new Point3D(x, y, 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Serialize(IGenericWriter writer)
|
return Point3D.Zero;
|
||||||
{
|
}
|
||||||
base.Serialize(writer);
|
|
||||||
|
|
||||||
writer.WriteEncodedInt(1); // version
|
public override bool CheckHold(Mobile m, Item item, bool message, bool checkItems, int plusItems, int plusWeight)
|
||||||
|
{
|
||||||
|
if (m.AccessLevel < AccessLevel.GameMaster)
|
||||||
|
{
|
||||||
|
m.SendLocalizedMessage(1061145); // You cannot place items into a house moving crate.
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Deserialize(IGenericReader reader)
|
return base.CheckHold(m, item, message, checkItems, plusItems, plusWeight);
|
||||||
|
}
|
||||||
|
|
||||||
|
public override bool CheckLift(Mobile from, Item item, ref LRReason reject) => House?.Deleted == false &&
|
||||||
|
base.CheckLift(from, item, ref reject) && House.IsOwner(from);
|
||||||
|
|
||||||
|
public override bool CheckItemUse(Mobile from, Item item) =>
|
||||||
|
House?.Deleted == false && base.CheckItemUse(from, item) && House.IsOwner(from);
|
||||||
|
|
||||||
|
public override void OnItemRemoved(Item item)
|
||||||
|
{
|
||||||
|
base.OnItemRemoved(item);
|
||||||
|
|
||||||
|
if (TotalItems == 0)
|
||||||
{
|
{
|
||||||
base.Deserialize(reader);
|
Delete();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var version = reader.ReadEncodedInt();
|
public void RestartTimer()
|
||||||
|
{
|
||||||
|
if (_internalizeTimer == null)
|
||||||
|
{
|
||||||
|
_internalizeTimer = new InternalizeTimer(this);
|
||||||
|
_internalizeTimer.Start();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_internalizeTimer.Stop();
|
||||||
|
_internalizeTimer.Start();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (version == 0)
|
public void Hide()
|
||||||
|
{
|
||||||
|
if (_internalizeTimer != null)
|
||||||
|
{
|
||||||
|
_internalizeTimer.Stop();
|
||||||
|
_internalizeTimer = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
var toRemove = new List<Item>();
|
||||||
|
foreach (var item in Items)
|
||||||
|
{
|
||||||
|
if (item is PackingBox && item.Items.Count == 0)
|
||||||
{
|
{
|
||||||
MaxItems = -1; // reset to default
|
toRemove.Add(item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
foreach (var item in toRemove)
|
||||||
|
{
|
||||||
|
item.Delete();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (TotalItems == 0)
|
||||||
|
{
|
||||||
|
Delete();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Internalize();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void OnAfterDelete()
|
||||||
|
{
|
||||||
|
base.OnAfterDelete();
|
||||||
|
|
||||||
|
if (House?.MovingCrate == this)
|
||||||
|
{
|
||||||
|
House.MovingCrate = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
_internalizeTimer?.Stop();
|
||||||
|
}
|
||||||
|
|
||||||
|
[AfterDeserialization]
|
||||||
|
private void AfterDeserialization()
|
||||||
|
{
|
||||||
|
if (House != null)
|
||||||
|
{
|
||||||
|
House.MovingCrate = this;
|
||||||
|
Timer.StartTimer(Hide);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Timer.StartTimer(Delete);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class InternalizeTimer : Timer
|
||||||
|
{
|
||||||
|
private readonly MovingCrate m_Crate;
|
||||||
|
|
||||||
|
public InternalizeTimer(MovingCrate crate) : base(TimeSpan.FromMinutes(5.0))
|
||||||
|
{
|
||||||
|
m_Crate = crate;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnTick()
|
||||||
|
{
|
||||||
|
m_Crate.Hide();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[SerializationGenerator(0)]
|
||||||
|
public partial class PackingBox : BaseContainer
|
||||||
|
{
|
||||||
|
public PackingBox() : base(0x9A8) => Movable = false;
|
||||||
|
|
||||||
|
public override int LabelNumber => 1061690; // Packing Crate
|
||||||
|
|
||||||
|
public override int DefaultGumpID => 0x4B;
|
||||||
|
public override int DefaultDropSound => 0x42;
|
||||||
|
|
||||||
|
public override Rectangle2D Bounds => new(16, 51, 168, 73);
|
||||||
|
|
||||||
|
public override int DefaultMaxItems => 0;
|
||||||
|
public override int DefaultMaxWeight => 0;
|
||||||
|
|
||||||
|
public override void SendCantStoreMessage(Mobile to, Item item)
|
||||||
|
{
|
||||||
|
to.SendLocalizedMessage(1061145); // You cannot place items into a house moving crate.
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void OnItemRemoved(Item item)
|
||||||
|
{
|
||||||
|
base.OnItemRemoved(item);
|
||||||
|
|
||||||
|
if (item.GetBounce() == null && TotalItems == 0)
|
||||||
|
{
|
||||||
|
Delete();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void OnItemBounceCleared(Item item)
|
||||||
|
{
|
||||||
|
base.OnItemBounceCleared(item);
|
||||||
|
|
||||||
|
if (TotalItems == 0)
|
||||||
|
{
|
||||||
|
Delete();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,147 +1,117 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using ModernUO.Serialization;
|
||||||
using Server.Items;
|
using Server.Items;
|
||||||
|
|
||||||
namespace Server.Multis
|
namespace Server.Multis;
|
||||||
|
|
||||||
|
[SerializationGenerator(0, false)]
|
||||||
|
public partial class PreviewHouse : BaseMulti
|
||||||
{
|
{
|
||||||
public class PreviewHouse : BaseMulti
|
[SerializableField(0)]
|
||||||
|
private List<Item> _previewComponents;
|
||||||
|
|
||||||
|
private Timer _timer;
|
||||||
|
|
||||||
|
public PreviewHouse(int multiID) : base(multiID)
|
||||||
{
|
{
|
||||||
private List<Item> m_Components;
|
var mcl = Components;
|
||||||
private Timer m_Timer;
|
|
||||||
|
|
||||||
public PreviewHouse(int multiID) : base(multiID)
|
for (var i = 1; i < mcl.List.Length; ++i)
|
||||||
{
|
{
|
||||||
m_Components = new List<Item>();
|
var entry = mcl.List[i];
|
||||||
|
|
||||||
var mcl = Components;
|
if (entry.Flags == 0)
|
||||||
|
|
||||||
for (var i = 1; i < mcl.List.Length; ++i)
|
|
||||||
{
|
{
|
||||||
var entry = mcl.List[i];
|
Item item = new Static(entry.ItemId);
|
||||||
|
item.MoveToWorld(new Point3D(X + entry.OffsetX, Y + entry.OffsetY, Z + entry.OffsetZ), Map);
|
||||||
|
|
||||||
if (entry.Flags == 0)
|
_previewComponents ??= [];
|
||||||
{
|
_previewComponents.Add(item);
|
||||||
Item item = new Static(entry.ItemId);
|
|
||||||
|
|
||||||
item.MoveToWorld(new Point3D(X + entry.OffsetX, Y + entry.OffsetY, Z + entry.OffsetZ), Map);
|
|
||||||
|
|
||||||
m_Components.Add(item);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
m_Timer = new DecayTimer(this);
|
|
||||||
m_Timer.Start();
|
|
||||||
}
|
|
||||||
|
|
||||||
public PreviewHouse(Serial serial) : base(serial)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void OnLocationChange(Point3D oldLocation)
|
|
||||||
{
|
|
||||||
base.OnLocationChange(oldLocation);
|
|
||||||
|
|
||||||
if (m_Components == null)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var xOffset = X - oldLocation.X;
|
|
||||||
var yOffset = Y - oldLocation.Y;
|
|
||||||
var zOffset = Z - oldLocation.Z;
|
|
||||||
|
|
||||||
for (var i = 0; i < m_Components.Count; ++i)
|
|
||||||
{
|
|
||||||
var item = m_Components[i];
|
|
||||||
|
|
||||||
item.MoveToWorld(new Point3D(item.X + xOffset, item.Y + yOffset, item.Z + zOffset), Map);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void OnMapChange()
|
_timer = new DecayTimer(this);
|
||||||
|
_timer.Start();
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void OnLocationChange(Point3D oldLocation)
|
||||||
|
{
|
||||||
|
base.OnLocationChange(oldLocation);
|
||||||
|
|
||||||
|
if (_previewComponents == null)
|
||||||
{
|
{
|
||||||
base.OnMapChange();
|
return;
|
||||||
|
|
||||||
if (m_Components == null)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (var i = 0; i < m_Components.Count; ++i)
|
|
||||||
{
|
|
||||||
var item = m_Components[i];
|
|
||||||
|
|
||||||
item.Map = Map;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void OnDelete()
|
var xOffset = X - oldLocation.X;
|
||||||
|
var yOffset = Y - oldLocation.Y;
|
||||||
|
var zOffset = Z - oldLocation.Z;
|
||||||
|
|
||||||
|
for (var i = 0; i < _previewComponents.Count; ++i)
|
||||||
{
|
{
|
||||||
base.OnDelete();
|
var item = _previewComponents[i];
|
||||||
|
|
||||||
if (m_Components == null)
|
item.MoveToWorld(new Point3D(item.X + xOffset, item.Y + yOffset, item.Z + zOffset), Map);
|
||||||
{
|
}
|
||||||
return;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
for (var i = 0; i < m_Components.Count; ++i)
|
public override void OnMapChange()
|
||||||
{
|
{
|
||||||
var item = m_Components[i];
|
base.OnMapChange();
|
||||||
|
|
||||||
item.Delete();
|
if (_previewComponents == null)
|
||||||
}
|
{
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void OnAfterDelete()
|
for (var i = 0; i < _previewComponents.Count; ++i)
|
||||||
{
|
{
|
||||||
m_Timer?.Stop();
|
_previewComponents[i].Map = Map;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
m_Timer = null;
|
public override void OnDelete()
|
||||||
|
{
|
||||||
|
base.OnDelete();
|
||||||
|
|
||||||
base.OnAfterDelete();
|
if (_previewComponents == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Serialize(IGenericWriter writer)
|
for (var i = 0; i < _previewComponents.Count; ++i)
|
||||||
{
|
{
|
||||||
base.Serialize(writer);
|
_previewComponents[i]?.Delete();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
writer.Write(0); // version
|
public override void OnAfterDelete()
|
||||||
|
{
|
||||||
|
_timer?.Stop();
|
||||||
|
_timer = null;
|
||||||
|
|
||||||
writer.Write(m_Components);
|
base.OnAfterDelete();
|
||||||
|
}
|
||||||
|
|
||||||
|
[AfterDeserialization(false)]
|
||||||
|
private void AfterDeserialization()
|
||||||
|
{
|
||||||
|
Delete();
|
||||||
|
}
|
||||||
|
|
||||||
|
private class DecayTimer : Timer
|
||||||
|
{
|
||||||
|
private readonly Item _item;
|
||||||
|
|
||||||
|
public DecayTimer(Item item) : base(TimeSpan.FromSeconds(20.0))
|
||||||
|
{
|
||||||
|
_item = item;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Deserialize(IGenericReader reader)
|
protected override void OnTick()
|
||||||
{
|
{
|
||||||
base.Deserialize(reader);
|
_item.Delete();
|
||||||
|
|
||||||
var version = reader.ReadInt();
|
|
||||||
|
|
||||||
switch (version)
|
|
||||||
{
|
|
||||||
case 0:
|
|
||||||
{
|
|
||||||
m_Components = reader.ReadEntityList<Item>();
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Timer.StartTimer(Delete);
|
|
||||||
}
|
|
||||||
|
|
||||||
private class DecayTimer : Timer
|
|
||||||
{
|
|
||||||
private readonly Item m_Item;
|
|
||||||
|
|
||||||
public DecayTimer(Item item) : base(TimeSpan.FromSeconds(20.0))
|
|
||||||
{
|
|
||||||
m_Item = item;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void OnTick()
|
|
||||||
{
|
|
||||||
m_Item.Delete();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue