diff --git a/Projects/UOContent/Migrations/Server.Multis.BaseContestHouse.v1.json b/Projects/UOContent/Migrations/Server.Multis.BaseContestHouse.v1.json new file mode 100644 index 000000000..82392981f --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Multis.BaseContestHouse.v1.json @@ -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" + ] + } + ] +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Multis.Camelot.v0.json b/Projects/UOContent/Migrations/Server.Multis.Camelot.v0.json new file mode 100644 index 000000000..0d816c134 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Multis.Camelot.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Multis.Camelot" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Multis.CasaMoga.v0.json b/Projects/UOContent/Migrations/Server.Multis.CasaMoga.v0.json new file mode 100644 index 000000000..4ac22589a --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Multis.CasaMoga.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Multis.CasaMoga" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Multis.Castle.v0.json b/Projects/UOContent/Migrations/Server.Multis.Castle.v0.json new file mode 100644 index 000000000..38aa9652b --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Multis.Castle.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Multis.Castle" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Multis.CastleOfOceania.v0.json b/Projects/UOContent/Migrations/Server.Multis.CastleOfOceania.v0.json new file mode 100644 index 000000000..13e124411 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Multis.CastleOfOceania.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Multis.CastleOfOceania" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Multis.DarkthornKeep.v0.json b/Projects/UOContent/Migrations/Server.Multis.DarkthornKeep.v0.json new file mode 100644 index 000000000..bae25c481 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Multis.DarkthornKeep.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Multis.DarkthornKeep" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Multis.Deeds.BrickHouseDeed.v0.json b/Projects/UOContent/Migrations/Server.Multis.Deeds.BrickHouseDeed.v0.json new file mode 100644 index 000000000..b752267f0 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Multis.Deeds.BrickHouseDeed.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Multis.Deeds.BrickHouseDeed" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Multis.Deeds.CastleDeed.v0.json b/Projects/UOContent/Migrations/Server.Multis.Deeds.CastleDeed.v0.json new file mode 100644 index 000000000..675fc2494 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Multis.Deeds.CastleDeed.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Multis.Deeds.CastleDeed" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Multis.Deeds.FieldStoneHouseDeed.v0.json b/Projects/UOContent/Migrations/Server.Multis.Deeds.FieldStoneHouseDeed.v0.json new file mode 100644 index 000000000..d47027a29 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Multis.Deeds.FieldStoneHouseDeed.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Multis.Deeds.FieldStoneHouseDeed" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Multis.Deeds.HouseDeed.v0.json b/Projects/UOContent/Migrations/Server.Multis.Deeds.HouseDeed.v0.json new file mode 100644 index 000000000..0d692d5c0 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Multis.Deeds.HouseDeed.v0.json @@ -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": [ + "" + ] + } + ] +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Multis.Deeds.KeepDeed.v0.json b/Projects/UOContent/Migrations/Server.Multis.Deeds.KeepDeed.v0.json new file mode 100644 index 000000000..562fc3f58 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Multis.Deeds.KeepDeed.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Multis.Deeds.KeepDeed" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Multis.Deeds.LargeMarbleDeed.v0.json b/Projects/UOContent/Migrations/Server.Multis.Deeds.LargeMarbleDeed.v0.json new file mode 100644 index 000000000..674e20a0b --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Multis.Deeds.LargeMarbleDeed.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Multis.Deeds.LargeMarbleDeed" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Multis.Deeds.LargePatioDeed.v0.json b/Projects/UOContent/Migrations/Server.Multis.Deeds.LargePatioDeed.v0.json new file mode 100644 index 000000000..632d3b875 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Multis.Deeds.LargePatioDeed.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Multis.Deeds.LargePatioDeed" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Multis.Deeds.LogCabinDeed.v0.json b/Projects/UOContent/Migrations/Server.Multis.Deeds.LogCabinDeed.v0.json new file mode 100644 index 000000000..37d59be6c --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Multis.Deeds.LogCabinDeed.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Multis.Deeds.LogCabinDeed" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Multis.Deeds.MarbleWorkshopDeed.v0.json b/Projects/UOContent/Migrations/Server.Multis.Deeds.MarbleWorkshopDeed.v0.json new file mode 100644 index 000000000..255dcf522 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Multis.Deeds.MarbleWorkshopDeed.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Multis.Deeds.MarbleWorkshopDeed" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Multis.Deeds.SandstonePatioDeed.v0.json b/Projects/UOContent/Migrations/Server.Multis.Deeds.SandstonePatioDeed.v0.json new file mode 100644 index 000000000..eed571e7e --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Multis.Deeds.SandstonePatioDeed.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Multis.Deeds.SandstonePatioDeed" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Multis.Deeds.SmallBrickHouseDeed.v0.json b/Projects/UOContent/Migrations/Server.Multis.Deeds.SmallBrickHouseDeed.v0.json new file mode 100644 index 000000000..6b6577017 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Multis.Deeds.SmallBrickHouseDeed.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Multis.Deeds.SmallBrickHouseDeed" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Multis.Deeds.SmallTowerDeed.v0.json b/Projects/UOContent/Migrations/Server.Multis.Deeds.SmallTowerDeed.v0.json new file mode 100644 index 000000000..867f91a07 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Multis.Deeds.SmallTowerDeed.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Multis.Deeds.SmallTowerDeed" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Multis.Deeds.StonePlasterHouseDeed.v0.json b/Projects/UOContent/Migrations/Server.Multis.Deeds.StonePlasterHouseDeed.v0.json new file mode 100644 index 000000000..a44fa9e9e --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Multis.Deeds.StonePlasterHouseDeed.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Multis.Deeds.StonePlasterHouseDeed" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Multis.Deeds.StoneWorkshopDeed.v0.json b/Projects/UOContent/Migrations/Server.Multis.Deeds.StoneWorkshopDeed.v0.json new file mode 100644 index 000000000..b40b2da0d --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Multis.Deeds.StoneWorkshopDeed.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Multis.Deeds.StoneWorkshopDeed" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Multis.Deeds.ThatchedRoofCottageDeed.v0.json b/Projects/UOContent/Migrations/Server.Multis.Deeds.ThatchedRoofCottageDeed.v0.json new file mode 100644 index 000000000..2da3acf20 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Multis.Deeds.ThatchedRoofCottageDeed.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Multis.Deeds.ThatchedRoofCottageDeed" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Multis.Deeds.TowerDeed.v0.json b/Projects/UOContent/Migrations/Server.Multis.Deeds.TowerDeed.v0.json new file mode 100644 index 000000000..e71196b88 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Multis.Deeds.TowerDeed.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Multis.Deeds.TowerDeed" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Multis.Deeds.TwoStoryStonePlasterHouseDeed.v0.json b/Projects/UOContent/Migrations/Server.Multis.Deeds.TwoStoryStonePlasterHouseDeed.v0.json new file mode 100644 index 000000000..6e6ee3522 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Multis.Deeds.TwoStoryStonePlasterHouseDeed.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Multis.Deeds.TwoStoryStonePlasterHouseDeed" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Multis.Deeds.TwoStoryWoodPlasterHouseDeed.v0.json b/Projects/UOContent/Migrations/Server.Multis.Deeds.TwoStoryWoodPlasterHouseDeed.v0.json new file mode 100644 index 000000000..a9d1ddea6 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Multis.Deeds.TwoStoryWoodPlasterHouseDeed.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Multis.Deeds.TwoStoryWoodPlasterHouseDeed" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Multis.Deeds.VillaDeed.v0.json b/Projects/UOContent/Migrations/Server.Multis.Deeds.VillaDeed.v0.json new file mode 100644 index 000000000..5b776d43a --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Multis.Deeds.VillaDeed.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Multis.Deeds.VillaDeed" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Multis.Deeds.WoodHouseDeed.v0.json b/Projects/UOContent/Migrations/Server.Multis.Deeds.WoodHouseDeed.v0.json new file mode 100644 index 000000000..c4a64fba2 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Multis.Deeds.WoodHouseDeed.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Multis.Deeds.WoodHouseDeed" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Multis.Deeds.WoodPlasterHouseDeed.v0.json b/Projects/UOContent/Migrations/Server.Multis.Deeds.WoodPlasterHouseDeed.v0.json new file mode 100644 index 000000000..450dc6602 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Multis.Deeds.WoodPlasterHouseDeed.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Multis.Deeds.WoodPlasterHouseDeed" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Multis.ElsaCastle.v0.json b/Projects/UOContent/Migrations/Server.Multis.ElsaCastle.v0.json new file mode 100644 index 000000000..54b830550 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Multis.ElsaCastle.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Multis.ElsaCastle" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Multis.FeudalCastle.v0.json b/Projects/UOContent/Migrations/Server.Multis.FeudalCastle.v0.json new file mode 100644 index 000000000..37b754e18 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Multis.FeudalCastle.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Multis.FeudalCastle" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Multis.GothicRoseCastle.v0.json b/Projects/UOContent/Migrations/Server.Multis.GothicRoseCastle.v0.json new file mode 100644 index 000000000..251388607 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Multis.GothicRoseCastle.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Multis.GothicRoseCastle" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Multis.GrimswindSisters.v0.json b/Projects/UOContent/Migrations/Server.Multis.GrimswindSisters.v0.json new file mode 100644 index 000000000..021ab5233 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Multis.GrimswindSisters.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Multis.GrimswindSisters" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Multis.GuildHouse.v0.json b/Projects/UOContent/Migrations/Server.Multis.GuildHouse.v0.json new file mode 100644 index 000000000..75e1bd270 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Multis.GuildHouse.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Multis.GuildHouse" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Multis.Keep.v0.json b/Projects/UOContent/Migrations/Server.Multis.Keep.v0.json new file mode 100644 index 000000000..5fe2ffc07 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Multis.Keep.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Multis.Keep" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Multis.LacrimaeInCaelo.v0.json b/Projects/UOContent/Migrations/Server.Multis.LacrimaeInCaelo.v0.json new file mode 100644 index 000000000..638d78a36 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Multis.LacrimaeInCaelo.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Multis.LacrimaeInCaelo" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Multis.LargeMarbleHouse.v0.json b/Projects/UOContent/Migrations/Server.Multis.LargeMarbleHouse.v0.json new file mode 100644 index 000000000..6bf98fab1 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Multis.LargeMarbleHouse.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Multis.LargeMarbleHouse" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Multis.LargePatioHouse.v0.json b/Projects/UOContent/Migrations/Server.Multis.LargePatioHouse.v0.json new file mode 100644 index 000000000..d38686cd9 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Multis.LargePatioHouse.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Multis.LargePatioHouse" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Multis.LogCabin.v0.json b/Projects/UOContent/Migrations/Server.Multis.LogCabin.v0.json new file mode 100644 index 000000000..bd07bacec --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Multis.LogCabin.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Multis.LogCabin" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Multis.MovingCrate.v0.json b/Projects/UOContent/Migrations/Server.Multis.MovingCrate.v0.json new file mode 100644 index 000000000..1e0e10e1f --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Multis.MovingCrate.v0.json @@ -0,0 +1,11 @@ +{ + "version": 0, + "type": "Server.Multis.MovingCrate", + "properties": [ + { + "name": "House", + "type": "Server.Multis.BaseHouse", + "rule": "SerializableInterfaceMigrationRule" + } + ] +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Multis.OkinawaSweetDreamCastle.v0.json b/Projects/UOContent/Migrations/Server.Multis.OkinawaSweetDreamCastle.v0.json new file mode 100644 index 000000000..c867d3d66 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Multis.OkinawaSweetDreamCastle.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Multis.OkinawaSweetDreamCastle" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Multis.PackingBox.v0.json b/Projects/UOContent/Migrations/Server.Multis.PackingBox.v0.json new file mode 100644 index 000000000..0b62ec435 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Multis.PackingBox.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Multis.PackingBox" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Multis.PreviewHouse.v0.json b/Projects/UOContent/Migrations/Server.Multis.PreviewHouse.v0.json new file mode 100644 index 000000000..cdbd1b23d --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Multis.PreviewHouse.v0.json @@ -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" + ] + } + ] +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Multis.RobinsNest.v0.json b/Projects/UOContent/Migrations/Server.Multis.RobinsNest.v0.json new file mode 100644 index 000000000..8b8fb7664 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Multis.RobinsNest.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Multis.RobinsNest" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Multis.RobinsRoost.v0.json b/Projects/UOContent/Migrations/Server.Multis.RobinsRoost.v0.json new file mode 100644 index 000000000..2712d28d2 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Multis.RobinsRoost.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Multis.RobinsRoost" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Multis.SandStonePatio.v0.json b/Projects/UOContent/Migrations/Server.Multis.SandStonePatio.v0.json new file mode 100644 index 000000000..dae92b501 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Multis.SandStonePatio.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Multis.SandStonePatio" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Multis.SandalwoodKeep.v0.json b/Projects/UOContent/Migrations/Server.Multis.SandalwoodKeep.v0.json new file mode 100644 index 000000000..d21ff554c --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Multis.SandalwoodKeep.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Multis.SandalwoodKeep" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Multis.SmallOldHouse.v0.json b/Projects/UOContent/Migrations/Server.Multis.SmallOldHouse.v0.json new file mode 100644 index 000000000..428f378d9 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Multis.SmallOldHouse.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Multis.SmallOldHouse" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Multis.SmallShop.v0.json b/Projects/UOContent/Migrations/Server.Multis.SmallShop.v0.json new file mode 100644 index 000000000..c0445ff51 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Multis.SmallShop.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Multis.SmallShop" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Multis.SmallTower.v0.json b/Projects/UOContent/Migrations/Server.Multis.SmallTower.v0.json new file mode 100644 index 000000000..0328c6408 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Multis.SmallTower.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Multis.SmallTower" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Multis.Spires.v0.json b/Projects/UOContent/Migrations/Server.Multis.Spires.v0.json new file mode 100644 index 000000000..8f2a5f820 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Multis.Spires.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Multis.Spires" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Multis.TheSandstoneCastle.v0.json b/Projects/UOContent/Migrations/Server.Multis.TheSandstoneCastle.v0.json new file mode 100644 index 000000000..cd0d66970 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Multis.TheSandstoneCastle.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Multis.TheSandstoneCastle" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Multis.Tower.v0.json b/Projects/UOContent/Migrations/Server.Multis.Tower.v0.json new file mode 100644 index 000000000..dee425eeb --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Multis.Tower.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Multis.Tower" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Multis.TraditionalKeep.v0.json b/Projects/UOContent/Migrations/Server.Multis.TraditionalKeep.v0.json new file mode 100644 index 000000000..4a87f2b5c --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Multis.TraditionalKeep.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Multis.TraditionalKeep" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Multis.TrinsicKeep.v0.json b/Projects/UOContent/Migrations/Server.Multis.TrinsicKeep.v0.json new file mode 100644 index 000000000..bd90abb03 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Multis.TrinsicKeep.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Multis.TrinsicKeep" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Multis.TwoStoryHouse.v0.json b/Projects/UOContent/Migrations/Server.Multis.TwoStoryHouse.v0.json new file mode 100644 index 000000000..51d321a24 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Multis.TwoStoryHouse.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Multis.TwoStoryHouse" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Multis.TwoStoryVilla.v0.json b/Projects/UOContent/Migrations/Server.Multis.TwoStoryVilla.v0.json new file mode 100644 index 000000000..56ff6b46b --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Multis.TwoStoryVilla.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Multis.TwoStoryVilla" +} \ No newline at end of file diff --git a/Projects/UOContent/Migrations/Server.Multis.VillaCrowley.v0.json b/Projects/UOContent/Migrations/Server.Multis.VillaCrowley.v0.json new file mode 100644 index 000000000..a7e53ff34 --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Multis.VillaCrowley.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Multis.VillaCrowley" +} \ No newline at end of file diff --git a/Projects/UOContent/Multis/Deeds.cs b/Projects/UOContent/Multis/Deeds.cs index e4ed5c202..3b420d337 100644 --- a/Projects/UOContent/Multis/Deeds.cs +++ b/Projects/UOContent/Multis/Deeds.cs @@ -1,842 +1,283 @@ -using Server.Regions; -using Server.Targeting; +using ModernUO.Serialization; -namespace Server.Multis.Deeds +namespace Server.Multis.Deeds; + +[SerializationGenerator(0, false)] +public partial class StonePlasterHouseDeed : HouseDeed { - public class HousePlacementTarget : MultiTarget + [Constructible] + public StonePlasterHouseDeed() : base(0x64, new Point3D(0, 4, 0)) { - private readonly HouseDeed m_Deed; - - public HousePlacementTarget(HouseDeed deed) : base(deed.MultiID, deed.Offset) => m_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)) - { - m_Deed.OnPlacement(from, p); - } - else if (reg.IsPartOf()) - { - // Lord British has decreed a 'no build' period, thus you cannot build this house at this time. - from.SendLocalizedMessage(501270); - } - else if (reg.IsPartOf() || reg.IsPartOf()) - { - // 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()) - { - 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. - } - } } - public abstract class HouseDeed : Item - { - public HouseDeed(int id, Point3D offset) : base(0x14F0) - { - LootType = LootType.Newbied; + public override int LabelNumber => 1041211; + public override Rectangle2D[] Area => SmallOldHouse.AreaArray; - MultiID = id; - Offset = offset; - } - - public HouseDeed(Serial serial) : base(serial) - { - } - - [CommandProperty(AccessLevel.GameMaster)] - public int MultiID { get; set; } - - [CommandProperty(AccessLevel.GameMaster)] - public Point3D Offset { get; set; } - - public virtual Direction HouseDirection => Direction.South; - - public abstract Rectangle2D[] Area { get; } - - public override double DefaultWeight => 1.0; - - public override void Serialize(IGenericWriter writer) - { - base.Serialize(writer); - - writer.Write(1); // version - - writer.Write(Offset); - - writer.Write(MultiID); - } - - public override void Deserialize(IGenericReader reader) - { - base.Deserialize(reader); - - var version = reader.ReadInt(); - - switch (version) - { - case 1: - { - Offset = reader.ReadPoint3D(); - - goto case 0; - } - case 0: - { - MultiID = reader.ReadInt(); - - break; - } - } - - if (Weight == 0.0) - { - Weight = 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) - { - object 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; - } - } - } - } - } - - public class StonePlasterHouseDeed : HouseDeed - { - [Constructible] - public StonePlasterHouseDeed() : base(0x64, new Point3D(0, 4, 0)) - { - } - - public StonePlasterHouseDeed(Serial serial) : base(serial) - { - } - - public override int LabelNumber => 1041211; - public override Rectangle2D[] Area => SmallOldHouse.AreaArray; - - public override BaseHouse GetHouse(Mobile owner) => new SmallOldHouse(owner, 0x64); - - 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 FieldStoneHouseDeed : HouseDeed - { - [Constructible] - public FieldStoneHouseDeed() : base(0x66, new Point3D(0, 4, 0)) - { - } - - public FieldStoneHouseDeed(Serial serial) : base(serial) - { - } - - public override int LabelNumber => 1041212; - public override Rectangle2D[] Area => SmallOldHouse.AreaArray; - - public override BaseHouse GetHouse(Mobile owner) => new SmallOldHouse(owner, 0x66); - - 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 SmallBrickHouseDeed : HouseDeed - { - [Constructible] - public SmallBrickHouseDeed() : base(0x68, new Point3D(0, 4, 0)) - { - } - - public SmallBrickHouseDeed(Serial serial) : base(serial) - { - } - - public override int LabelNumber => 1041213; - public override Rectangle2D[] Area => SmallOldHouse.AreaArray; - - public override BaseHouse GetHouse(Mobile owner) => new SmallOldHouse(owner, 0x68); - - 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 WoodHouseDeed : HouseDeed - { - [Constructible] - public WoodHouseDeed() : base(0x6A, new Point3D(0, 4, 0)) - { - } - - public WoodHouseDeed(Serial serial) : base(serial) - { - } - - public override int LabelNumber => 1041214; - public override Rectangle2D[] Area => SmallOldHouse.AreaArray; - - public override BaseHouse GetHouse(Mobile owner) => new SmallOldHouse(owner, 0x6A); - - 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 WoodPlasterHouseDeed : HouseDeed - { - [Constructible] - public WoodPlasterHouseDeed() : base(0x6C, new Point3D(0, 4, 0)) - { - } - - public WoodPlasterHouseDeed(Serial serial) : base(serial) - { - } - - public override int LabelNumber => 1041215; - public override Rectangle2D[] Area => SmallOldHouse.AreaArray; - - public override BaseHouse GetHouse(Mobile owner) => new SmallOldHouse(owner, 0x6C); - - 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 ThatchedRoofCottageDeed : HouseDeed - { - [Constructible] - public ThatchedRoofCottageDeed() : base(0x6E, new Point3D(0, 4, 0)) - { - } - - public ThatchedRoofCottageDeed(Serial serial) : base(serial) - { - } - - public override int LabelNumber => 1041216; - public override Rectangle2D[] Area => SmallOldHouse.AreaArray; - - public override BaseHouse GetHouse(Mobile owner) => new SmallOldHouse(owner, 0x6E); - - 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 BrickHouseDeed : HouseDeed - { - [Constructible] - public BrickHouseDeed() : base(0x74, new Point3D(-1, 7, 0)) - { - } - - public BrickHouseDeed(Serial serial) : base(serial) - { - } - - public override int LabelNumber => 1041219; - public override Rectangle2D[] Area => GuildHouse.AreaArray; - - public override BaseHouse GetHouse(Mobile owner) => new GuildHouse(owner); - - 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 TwoStoryWoodPlasterHouseDeed : HouseDeed - { - [Constructible] - public TwoStoryWoodPlasterHouseDeed() : base(0x76, new Point3D(-3, 7, 0)) - { - } - - public TwoStoryWoodPlasterHouseDeed(Serial serial) : base(serial) - { - } - - public override int LabelNumber => 1041220; - public override Rectangle2D[] Area => TwoStoryHouse.AreaArray; - - public override BaseHouse GetHouse(Mobile owner) => new TwoStoryHouse(owner, 0x76); - - 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 TwoStoryStonePlasterHouseDeed : HouseDeed - { - [Constructible] - public TwoStoryStonePlasterHouseDeed() : base(0x78, new Point3D(-3, 7, 0)) - { - } - - public TwoStoryStonePlasterHouseDeed(Serial serial) : base(serial) - { - } - - public override int LabelNumber => 1041221; - public override Rectangle2D[] Area => TwoStoryHouse.AreaArray; - - public override BaseHouse GetHouse(Mobile owner) => new TwoStoryHouse(owner, 0x78); - - 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 TowerDeed : HouseDeed - { - [Constructible] - public TowerDeed() : base(0x7A, new Point3D(0, 7, 0)) - { - } - - public TowerDeed(Serial serial) : base(serial) - { - } - - public override int LabelNumber => 1041222; - public override Rectangle2D[] Area => Tower.AreaArray; - - public override BaseHouse GetHouse(Mobile owner) => new Tower(owner); - - 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 KeepDeed : HouseDeed - { - [Constructible] - public KeepDeed() : base(0x7C, new Point3D(0, 11, 0)) - { - } - - public KeepDeed(Serial serial) : base(serial) - { - } - - public override int LabelNumber => 1041223; - public override Rectangle2D[] Area => Keep.AreaArray; - - public override BaseHouse GetHouse(Mobile owner) => new Keep(owner); - - 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 CastleDeed : HouseDeed - { - [Constructible] - public CastleDeed() : base(0x7E, new Point3D(0, 16, 0)) - { - } - - public CastleDeed(Serial serial) : base(serial) - { - } - - public override int LabelNumber => 1041224; - public override Rectangle2D[] Area => Castle.AreaArray; - - public override BaseHouse GetHouse(Mobile owner) => new Castle(owner); - - 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 LargePatioDeed : HouseDeed - { - [Constructible] - public LargePatioDeed() : base(0x8C, new Point3D(-4, 7, 0)) - { - } - - public LargePatioDeed(Serial serial) : base(serial) - { - } - - public override int LabelNumber => 1041231; - public override Rectangle2D[] Area => LargePatioHouse.AreaArray; - - public override BaseHouse GetHouse(Mobile owner) => new LargePatioHouse(owner); - - 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 LargeMarbleDeed : HouseDeed - { - [Constructible] - public LargeMarbleDeed() : base(0x96, new Point3D(-4, 7, 0)) - { - } - - public LargeMarbleDeed(Serial serial) : base(serial) - { - } - - public override int LabelNumber => 1041236; - public override Rectangle2D[] Area => LargeMarbleHouse.AreaArray; - - public override BaseHouse GetHouse(Mobile owner) => new LargeMarbleHouse(owner); - - 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 SmallTowerDeed : HouseDeed - { - [Constructible] - public SmallTowerDeed() : base(0x98, new Point3D(3, 4, 0)) - { - } - - public SmallTowerDeed(Serial serial) : base(serial) - { - } - - public override int LabelNumber => 1041237; - public override Rectangle2D[] Area => SmallTower.AreaArray; - - public override BaseHouse GetHouse(Mobile owner) => new SmallTower(owner); - - 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 LogCabinDeed : HouseDeed - { - [Constructible] - public LogCabinDeed() : base(0x9A, new Point3D(1, 6, 0)) - { - } - - public LogCabinDeed(Serial serial) : base(serial) - { - } - - public override int LabelNumber => 1041238; - public override Rectangle2D[] Area => LogCabin.AreaArray; - - public override BaseHouse GetHouse(Mobile owner) => new LogCabin(owner); - - 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 SandstonePatioDeed : HouseDeed - { - [Constructible] - public SandstonePatioDeed() : base(0x9C, new Point3D(-1, 4, 0)) - { - } - - public SandstonePatioDeed(Serial serial) : base(serial) - { - } - - public override int LabelNumber => 1041239; - public override Rectangle2D[] Area => SandStonePatio.AreaArray; - - public override BaseHouse GetHouse(Mobile owner) => new SandStonePatio(owner); - - 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 VillaDeed : HouseDeed - { - [Constructible] - public VillaDeed() : base(0x9E, new Point3D(3, 6, 0)) - { - } - - public VillaDeed(Serial serial) : base(serial) - { - } - - public override int LabelNumber => 1041240; - public override Rectangle2D[] Area => TwoStoryVilla.AreaArray; - - public override BaseHouse GetHouse(Mobile owner) => new TwoStoryVilla(owner); - - 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 StoneWorkshopDeed : HouseDeed - { - [Constructible] - public StoneWorkshopDeed() : base(0xA0, new Point3D(-1, 4, 0)) - { - } - - public StoneWorkshopDeed(Serial serial) : base(serial) - { - } - - public override int LabelNumber => 1041241; - public override Rectangle2D[] Area => SmallShop.AreaArray2; - - public override BaseHouse GetHouse(Mobile owner) => new SmallShop(owner, 0xA0); - - 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 MarbleWorkshopDeed : HouseDeed - { - [Constructible] - public MarbleWorkshopDeed() : base(0xA2, new Point3D(-1, 4, 0)) - { - } - - public MarbleWorkshopDeed(Serial serial) : base(serial) - { - } - - public override int LabelNumber => 1041242; - public override Rectangle2D[] Area => SmallShop.AreaArray1; - - public override BaseHouse GetHouse(Mobile owner) => new SmallShop(owner, 0xA2); - - 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 override BaseHouse GetHouse(Mobile owner) => new SmallOldHouse(owner, 0x64); +} + +[SerializationGenerator(0, false)] +public partial class FieldStoneHouseDeed : HouseDeed +{ + [Constructible] + public FieldStoneHouseDeed() : base(0x66, new Point3D(0, 4, 0)) + { + } + + public override int LabelNumber => 1041212; + public override Rectangle2D[] Area => SmallOldHouse.AreaArray; + + public override BaseHouse GetHouse(Mobile owner) => new SmallOldHouse(owner, 0x66); +} + +[SerializationGenerator(0, false)] +public partial class SmallBrickHouseDeed : HouseDeed +{ + [Constructible] + public SmallBrickHouseDeed() : base(0x68, new Point3D(0, 4, 0)) + { + } + + public override int LabelNumber => 1041213; + public override Rectangle2D[] Area => SmallOldHouse.AreaArray; + + public override BaseHouse GetHouse(Mobile owner) => new SmallOldHouse(owner, 0x68); +} + +[SerializationGenerator(0, false)] +public partial class WoodHouseDeed : HouseDeed +{ + [Constructible] + public WoodHouseDeed() : base(0x6A, new Point3D(0, 4, 0)) + { + } + + public override int LabelNumber => 1041214; + public override Rectangle2D[] Area => SmallOldHouse.AreaArray; + + public override BaseHouse GetHouse(Mobile owner) => new SmallOldHouse(owner, 0x6A); +} + +[SerializationGenerator(0, false)] +public partial class WoodPlasterHouseDeed : HouseDeed +{ + [Constructible] + public WoodPlasterHouseDeed() : base(0x6C, new Point3D(0, 4, 0)) + { + } + + public override int LabelNumber => 1041215; + public override Rectangle2D[] Area => SmallOldHouse.AreaArray; + + public override BaseHouse GetHouse(Mobile owner) => new SmallOldHouse(owner, 0x6C); +} + +[SerializationGenerator(0, false)] +public partial class ThatchedRoofCottageDeed : HouseDeed +{ + [Constructible] + public ThatchedRoofCottageDeed() : base(0x6E, new Point3D(0, 4, 0)) + { + } + + public override int LabelNumber => 1041216; + public override Rectangle2D[] Area => SmallOldHouse.AreaArray; + + public override BaseHouse GetHouse(Mobile owner) => new SmallOldHouse(owner, 0x6E); +} + +[SerializationGenerator(0, false)] +public partial class BrickHouseDeed : HouseDeed +{ + [Constructible] + public BrickHouseDeed() : base(0x74, new Point3D(-1, 7, 0)) + { + } + + public override int LabelNumber => 1041219; + public override Rectangle2D[] Area => GuildHouse.AreaArray; + + public override BaseHouse GetHouse(Mobile owner) => new GuildHouse(owner); +} + +[SerializationGenerator(0, false)] +public partial class TwoStoryWoodPlasterHouseDeed : HouseDeed +{ + [Constructible] + public TwoStoryWoodPlasterHouseDeed() : base(0x76, new Point3D(-3, 7, 0)) + { + } + + public override int LabelNumber => 1041220; + public override Rectangle2D[] Area => TwoStoryHouse.AreaArray; + + public override BaseHouse GetHouse(Mobile owner) => new TwoStoryHouse(owner, 0x76); +} + +[SerializationGenerator(0, false)] +public partial class TwoStoryStonePlasterHouseDeed : HouseDeed +{ + [Constructible] + public TwoStoryStonePlasterHouseDeed() : base(0x78, new Point3D(-3, 7, 0)) + { + } + + public override int LabelNumber => 1041221; + public override Rectangle2D[] Area => TwoStoryHouse.AreaArray; + + public override BaseHouse GetHouse(Mobile owner) => new TwoStoryHouse(owner, 0x78); +} + +[SerializationGenerator(0, false)] +public partial class TowerDeed : HouseDeed +{ + [Constructible] + public TowerDeed() : base(0x7A, new Point3D(0, 7, 0)) + { + } + + public override int LabelNumber => 1041222; + public override Rectangle2D[] Area => Tower.AreaArray; + + public override BaseHouse GetHouse(Mobile owner) => new Tower(owner); +} + +[SerializationGenerator(0, false)] +public partial class KeepDeed : HouseDeed +{ + [Constructible] + public KeepDeed() : base(0x7C, new Point3D(0, 11, 0)) + { + } + + public override int LabelNumber => 1041223; + public override Rectangle2D[] Area => Keep.AreaArray; + + public override BaseHouse GetHouse(Mobile owner) => new Keep(owner); +} + +[SerializationGenerator(0, false)] +public partial class CastleDeed : HouseDeed +{ + [Constructible] + public CastleDeed() : base(0x7E, new Point3D(0, 16, 0)) + { + } + + public override int LabelNumber => 1041224; + public override Rectangle2D[] Area => Castle.AreaArray; + + public override BaseHouse GetHouse(Mobile owner) => new Castle(owner); +} + +[SerializationGenerator(0, false)] +public partial class LargePatioDeed : HouseDeed +{ + [Constructible] + public LargePatioDeed() : base(0x8C, new Point3D(-4, 7, 0)) + { + } + + public override int LabelNumber => 1041231; + public override Rectangle2D[] Area => LargePatioHouse.AreaArray; + + public override BaseHouse GetHouse(Mobile owner) => new LargePatioHouse(owner); +} + +[SerializationGenerator(0, false)] +public partial class LargeMarbleDeed : HouseDeed +{ + [Constructible] + public LargeMarbleDeed() : base(0x96, new Point3D(-4, 7, 0)) + { + } + + public override int LabelNumber => 1041236; + public override Rectangle2D[] Area => LargeMarbleHouse.AreaArray; + + public override BaseHouse GetHouse(Mobile owner) => new LargeMarbleHouse(owner); +} + +[SerializationGenerator(0, false)] +public partial class SmallTowerDeed : HouseDeed +{ + [Constructible] + public SmallTowerDeed() : base(0x98, new Point3D(3, 4, 0)) + { + } + + public override int LabelNumber => 1041237; + public override Rectangle2D[] Area => SmallTower.AreaArray; + + public override BaseHouse GetHouse(Mobile owner) => new SmallTower(owner); +} + +[SerializationGenerator(0, false)] +public partial class LogCabinDeed : HouseDeed +{ + [Constructible] + public LogCabinDeed() : base(0x9A, new Point3D(1, 6, 0)) + { + } + + public override int LabelNumber => 1041238; + public override Rectangle2D[] Area => LogCabin.AreaArray; + + public override BaseHouse GetHouse(Mobile owner) => new LogCabin(owner); +} + +[SerializationGenerator(0, false)] +public partial class SandstonePatioDeed : HouseDeed +{ + [Constructible] + public SandstonePatioDeed() : base(0x9C, new Point3D(-1, 4, 0)) + { + } + + public override int LabelNumber => 1041239; + public override Rectangle2D[] Area => SandStonePatio.AreaArray; + + public override BaseHouse GetHouse(Mobile owner) => new SandStonePatio(owner); +} + +[SerializationGenerator(0, false)] +public partial class VillaDeed : HouseDeed +{ + [Constructible] + public VillaDeed() : base(0x9E, new Point3D(3, 6, 0)) + { + } + + public override int LabelNumber => 1041240; + public override Rectangle2D[] Area => TwoStoryVilla.AreaArray; + + public override BaseHouse GetHouse(Mobile owner) => new TwoStoryVilla(owner); +} + +[SerializationGenerator(0, false)] +public partial class StoneWorkshopDeed : HouseDeed +{ + [Constructible] + public StoneWorkshopDeed() : base(0xA0, new Point3D(-1, 4, 0)) + { + } + + public override int LabelNumber => 1041241; + public override Rectangle2D[] Area => SmallShop.AreaArray2; + + public override BaseHouse GetHouse(Mobile owner) => new SmallShop(owner, 0xA0); +} + +[SerializationGenerator(0, false)] +public partial class MarbleWorkshopDeed : HouseDeed +{ + [Constructible] + public MarbleWorkshopDeed() : base(0xA2, new Point3D(-1, 4, 0)) + { + } + + public override int LabelNumber => 1041242; + public override Rectangle2D[] Area => SmallShop.AreaArray1; + + public override BaseHouse GetHouse(Mobile owner) => new SmallShop(owner, 0xA2); } diff --git a/Projects/UOContent/Multis/HouseDeed.cs b/Projects/UOContent/Multis/HouseDeed.cs new file mode 100644 index 000000000..01ca55c12 --- /dev/null +++ b/Projects/UOContent/Multis/HouseDeed.cs @@ -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; + } + } + } + } +} diff --git a/Projects/UOContent/Multis/HousePlacementTarget.cs b/Projects/UOContent/Multis/HousePlacementTarget.cs new file mode 100644 index 000000000..142d80052 --- /dev/null +++ b/Projects/UOContent/Multis/HousePlacementTarget.cs @@ -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()) + { + // Lord British has decreed a 'no build' period, thus you cannot build this house at this time. + from.SendLocalizedMessage(501270); + } + else if (reg.IsPartOf() || reg.IsPartOf()) + { + // 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()) + { + 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. + } + } +} diff --git a/Projects/UOContent/Multis/Houses/ContestHouses.cs b/Projects/UOContent/Multis/Houses/ContestHouses.cs index 06382205e..b37a8f62f 100644 --- a/Projects/UOContent/Multis/Houses/ContestHouses.cs +++ b/Projects/UOContent/Multis/Houses/ContestHouses.cs @@ -1,778 +1,490 @@ using System.Collections.Generic; using System.Linq; +using ModernUO.Serialization; using Server.Items; using Server.Logging; -namespace Server.Multis +namespace Server.Multis; + +public enum ContestHouseType { - public enum ContestHouseType + Keep, + Castle, + Other +} + +[SerializationGenerator(1, false)] +public partial class BaseContestHouse : BaseHouse +{ + private static readonly ILogger logger = LogFactory.GetLogger(typeof(BaseContestHouse)); + + [SerializableField(0)] + private ContestHouseType _houseType; + + [Tidy] + [CanBeNull] + [SerializableField(1, setter: "private")] + private List _fixtures; + + public BaseContestHouse(ContestHouseType type, int multiID, Mobile owner, int maxLockDown, int maxSecure) + : base(multiID, owner, maxLockDown, maxSecure) { - Keep, - Castle, - Other + _houseType = type; + + AutoAddFixtures(); } - public class BaseContestHouse : BaseHouse + public virtual int SignPostID => 9; + + public override Point3D BaseBanLocation => new( + Components.Min.X, + Components.Height - 1 - Components.Center.Y, + 0 + ); + + public override Rectangle2D[] Area { - private static readonly ILogger logger = LogFactory.GetLogger(typeof(BaseContestHouse)); - - public BaseContestHouse(ContestHouseType type, int multiID, Mobile owner, int maxLockDown, int maxSecure) - : base(multiID, owner, maxLockDown, maxSecure) + get { - HouseType = type; + var mcl = Components; + return new[] { new Rectangle2D(mcl.Min.X, mcl.Min.Y, mcl.Width, mcl.Height) }; + } + } - AutoAddFixtures(); + protected void SetSign(int xOffset, int yOffset, int zOffset, bool post) + { + SetSign(xOffset, yOffset, zOffset); + + var hanger = new Static(0xB9E); + hanger.MoveToWorld(new Point3D(X + xOffset, Y + yOffset, Z + zOffset), Map); + + AddFixture(hanger); + + if (post) + { + var signPost = new Static(SignPostID); + signPost.MoveToWorld(new Point3D(X + xOffset, Y + yOffset - 1, Z + zOffset), Map); + + AddFixture(signPost); + } + } + + public override void OnAfterDelete() + { + base.OnAfterDelete(); + + if (Fixtures == null) + { + return; } - public BaseContestHouse(Serial serial) : base(serial) + foreach (var item in Fixtures) { + item.Delete(); + } + } + + public override void OnLocationChange(Point3D oldLocation) + { + base.OnLocationChange(oldLocation); + + var x = Location.X - oldLocation.X; + var y = Location.Y - oldLocation.Y; + var z = Location.Z - oldLocation.Z; + + if (Fixtures == null) + { + return; } - public ContestHouseType HouseType { get; set; } - public List Fixtures { get; private set; } - - public virtual int SignPostID => 9; - - public override Point3D BaseBanLocation => new( - Components.Min.X, - Components.Height - 1 - Components.Center.Y, - 0 - ); - - public override Rectangle2D[] Area + foreach (var item in Fixtures) { - get - { - var mcl = Components; - return new[] { new Rectangle2D(mcl.Min.X, mcl.Min.Y, mcl.Width, mcl.Height) }; - } + item.Location = new Point3D(item.X + x, item.Y + y, item.Z + z); + } + } + + public override void OnMapChange() + { + base.OnMapChange(); + + if (Fixtures == null) + { + return; } - protected void SetSign(int xOffset, int yOffset, int zOffset, bool post) + foreach (var item in Fixtures) { - SetSign(xOffset, yOffset, zOffset); + item.Map = Map; + } + } - var hanger = new Static(0xB9E); - hanger.MoveToWorld(new Point3D(X + xOffset, Y + yOffset, Z + zOffset), Map); + public void AddTeleporters(int id, Point3D offset1, Point3D offset2) + { + var tele1 = new HouseTeleporter(id); + var tele2 = new HouseTeleporter(id); - AddFixture(hanger); + tele1.Target = tele2; + tele2.Target = tele1; - if (post) - { - var signPost = new Static(SignPostID); - signPost.MoveToWorld(new Point3D(X + xOffset, Y + yOffset - 1, Z + zOffset), Map); + tele1.MoveToWorld(new Point3D(X + offset1.X, Y + offset1.Y, offset1.Z), Map); + tele2.MoveToWorld(new Point3D(X + offset2.X, Y + offset2.Y, offset2.Z), Map); - AddFixture(signPost); - } + AddFixture(tele1); + AddFixture(tele2); + } + + public void AddFixture(Item item) + { + Fixtures ??= []; + Fixtures.Add(item); + } + + public override bool IsInside(Point3D p, int height) + { + if (base.IsInside(p, height)) + { + return true; } - public override void OnAfterDelete() + if (Fixtures == null) { - base.OnAfterDelete(); - - if (Fixtures == null) - { - return; - } - - foreach (var item in Fixtures) - { - item.Delete(); - } - } - - public override void OnLocationChange(Point3D oldLocation) - { - base.OnLocationChange(oldLocation); - - var x = Location.X - oldLocation.X; - var y = Location.Y - oldLocation.Y; - var z = Location.Z - oldLocation.Z; - - if (Fixtures == null) - { - return; - } - - foreach (var item in Fixtures) - { - item.Location = new Point3D(item.X + x, item.Y + y, item.Z + z); - } - } - - public override void OnMapChange() - { - base.OnMapChange(); - - if (Fixtures == null) - { - return; - } - - foreach (var item in Fixtures) - { - item.Map = Map; - } - } - - public void AddTeleporters(int id, Point3D offset1, Point3D offset2) - { - var tele1 = new HouseTeleporter(id); - var tele2 = new HouseTeleporter(id); - - tele1.Target = tele2; - tele2.Target = tele1; - - tele1.MoveToWorld(new Point3D(X + offset1.X, Y + offset1.Y, offset1.Z), Map); - tele2.MoveToWorld(new Point3D(X + offset2.X, Y + offset2.Y, offset2.Z), Map); - - AddFixture(tele1); - AddFixture(tele2); - } - - public void AddFixture(Item item) - { - Fixtures ??= new List(); - - Fixtures.Add(item); - } - - public override bool IsInside(Point3D p, int height) - { - if (base.IsInside(p, height)) - { - return true; - } - - if (Fixtures == null) - { - return false; - } - - foreach (Item fixture in Fixtures) - { - if (fixture is HouseTeleporter fix && fix.Location == p) - { - return true; - } - } - return false; } - public virtual void AutoAddFixtures() + for (var i = 0; i < Fixtures.Count; i++) { - var components = MultiData.GetComponents(ItemID); - - var teleporters = new Dictionary>(); - - foreach (var entry in components.List.Where(e => e.Flags == 0)) - // Teleporters + var fixture = Fixtures[i]; + if (fixture is HouseTeleporter fix && fix.Location == p) { - if (entry.ItemId >= 0x181D && entry.ItemId <= 0x1828) + return true; + } + } + + return false; + } + + public virtual void AutoAddFixtures() + { + var components = MultiData.GetComponents(ItemID); + + var teleporters = new Dictionary>(); + + foreach (var entry in components.List.Where(e => e.Flags == 0)) + // Teleporters + { + if (entry.ItemId >= 0x181D && entry.ItemId <= 0x1828) + { + if (teleporters.TryGetValue(entry.ItemId, out var result)) { - if (teleporters.TryGetValue(entry.ItemId, out var result)) - { - result.Add(entry); - } - else - { - teleporters.Add(entry.ItemId, new List { entry }); - } + result.Add(entry); } else { - var data = TileData.ItemTable[entry.ItemId & TileData.MaxItemValue]; - - // door - if (data.Door) - { - AddDoor(entry.ItemId, entry.OffsetX, entry.OffsetY, entry.OffsetZ); - } - else - { - Item st = new Static(entry.ItemId); - - st.MoveToWorld(new Point3D(X + entry.OffsetX, Y + entry.OffsetY, entry.OffsetZ), Map); - AddFixture(st); - } + teleporters.Add(entry.ItemId, new List { entry }); } } - - foreach (var door in Doors) - { - foreach (var check in Doors.Where(d => d != door)) - { - if (door.InRange(check.Location, 1)) - { - door.Link = check; - check.Link = door; - } - } - } - - foreach (var (key, value) in teleporters) - { - if (value.Count > 2) - { - logger.Warning("More than 2 teleporters detected for {ItemId:X}!", key); - } - else if (value.Count <= 1) - { - logger.Warning("1 or less teleporters detected for {ItemId:X}!", key); - - continue; - } - - AddTeleporters( - key, - new Point3D(value[0].OffsetX, value[0].OffsetY, value[0].OffsetZ), - new Point3D(value[1].OffsetX, value[1].OffsetY, value[1].OffsetZ) - ); - } - - teleporters.Clear(); - } - - public override void Serialize(IGenericWriter writer) - { - base.Serialize(writer); - writer.Write(0); // version - - writer.Write((int)HouseType); - - if (Fixtures != null) - { - Fixtures.Tidy(); - writer.Write(Fixtures); - } else { - writer.Write(0); + var data = TileData.ItemTable[entry.ItemId & TileData.MaxItemValue]; + + // door + if (data.Door) + { + AddDoor(entry.ItemId, entry.OffsetX, entry.OffsetY, entry.OffsetZ); + } + else + { + Item st = new Static(entry.ItemId); + + st.MoveToWorld(new Point3D(X + entry.OffsetX, Y + entry.OffsetY, entry.OffsetZ), Map); + AddFixture(st); + } } } - public override void Deserialize(IGenericReader reader) + for (var i = 0; i < Doors.Count; i++) { - base.Deserialize(reader); - var version = reader.ReadInt(); - - HouseType = (ContestHouseType)reader.ReadInt(); - - var count = reader.ReadInt(); - - for (var i = 0; i < count; i++) + var door = Doors[i]; + foreach (var check in Doors.Where(d => d != door)) { - AddFixture(reader.ReadEntity()); + if (door.InRange(check.Location, 1)) + { + door.Link = check; + check.Link = door; + } } } + + foreach (var (key, value) in teleporters) + { + if (value.Count > 2) + { + logger.Warning("More than 2 teleporters detected for {ItemId:X}!", key); + } + else if (value.Count <= 1) + { + logger.Warning("1 or less teleporters detected for {ItemId:X}!", key); + + continue; + } + + AddTeleporters( + key, + new Point3D(value[0].OffsetX, value[0].OffsetY, value[0].OffsetZ), + new Point3D(value[1].OffsetX, value[1].OffsetY, value[1].OffsetZ) + ); + } + + teleporters.Clear(); } - public class TrinsicKeep : BaseContestHouse + private void Deserialize(IGenericReader reader, int version) { - public static Rectangle2D[] AreaArray = - { - new(-11, -11, 23, 23), new(-10, 13, 6, 1), - new(-2, 13, 6, 1), new(6, 13, 7, 1) - }; - - public TrinsicKeep(Mobile owner) - : base(ContestHouseType.Keep, 0x147E, owner, 2113, 18) - { - SetSign(-11, 13, 7, false); - } - - public TrinsicKeep(Serial serial) : base(serial) - { - } - - public override Rectangle2D[] Area => AreaArray; - - 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 GothicRoseCastle : BaseContestHouse - { - public static Rectangle2D[] AreaArray = - { - new(-15, -15, 31, 31), - new(-14, 16, 11, 1), - new(-2, 16, 6, 1), - new(5, 16, 11, 1) - }; - - public GothicRoseCastle(Mobile owner) - : base(ContestHouseType.Castle, 0x147F, owner, 3281, 28) - { - SetSign(-15, 16, 7, false); - } - - public GothicRoseCastle(Serial serial) : base(serial) - { - } - - 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 ElsaCastle : BaseContestHouse - { - public ElsaCastle(Mobile owner) - : base(ContestHouseType.Castle, 0x1480, owner, 3281, 28) - { - SetSign(-15, 16, 7, false); - } - - public ElsaCastle(Serial serial) : base(serial) - { - } - - 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 Spires : BaseContestHouse - { - public Spires(Mobile owner) - : base(ContestHouseType.Castle, 0x1481, owner, 3281, 28) - { - SetSign(-15, 16, 7, false); - } - - public Spires(Serial serial) : base(serial) - { - } - - 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 CastleOfOceania : BaseContestHouse - { - public CastleOfOceania(Mobile owner) - : base(ContestHouseType.Castle, 0x1482, owner, 3281, 28) - { - SetSign(-15, 16, 7, false); - } - - public CastleOfOceania(Serial serial) : base(serial) - { - } - - 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 FeudalCastle : BaseContestHouse - { - public static Rectangle2D[] AreaArray = - { - new(-15, -15, 31, 31), - new(5, 16, 1, 1), - new(7, 16, 4, 1), - new(12, 16, 1, 1) - }; - - public FeudalCastle(Mobile owner) - : base(ContestHouseType.Castle, 0x1483, owner, 3281, 28) - { - SetSign(-15, 16, 7, true); - } - - public FeudalCastle(Serial serial) : base(serial) - { - } - - public override Rectangle2D[] Area => AreaArray; - - 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 RobinsNest : BaseContestHouse - { - public RobinsNest(Mobile owner) - : base(ContestHouseType.Keep, 0x1484, owner, 2113, 18) - { - SetSign(-11, 13, 7, false); - } - - public RobinsNest(Serial serial) : base(serial) - { - } - - 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 TraditionalKeep : BaseContestHouse - { - public static Rectangle2D[] AreaArray = - { - new(-11, -11, 23, 23), - new(-10, 13, 6, 1), - new(-2, 13, 6, 1), - new(6, 13, 7, 1) - }; - - public TraditionalKeep(Mobile owner) - : base(ContestHouseType.Keep, 0x1485, owner, 2113, 18) - { - SetSign(-11, 13, 7, false); - } - - public TraditionalKeep(Serial serial) : base(serial) - { - } - - public override Rectangle2D[] Area => AreaArray; - - 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 VillaCrowley : BaseContestHouse - { - public VillaCrowley(Mobile owner) - : base(ContestHouseType.Keep, 0x1486, owner, 2113, 18) - { - SetSign(-11, 13, 7, true); - } - - public VillaCrowley(Serial serial) : base(serial) - { - } - - 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 DarkthornKeep : BaseContestHouse - { - public DarkthornKeep(Mobile owner) - : base(ContestHouseType.Keep, 0x1487, owner, 2113, 18) - { - SetSign(-11, 13, 7, false); - } - - public DarkthornKeep(Serial serial) : base(serial) - { - } - - 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 SandalwoodKeep : BaseContestHouse - { - public SandalwoodKeep(Mobile owner) - : base(ContestHouseType.Keep, 0x1488, owner, 2113, 18) - { - SetSign(-11, 13, 7, true); - } - - public SandalwoodKeep(Serial serial) : base(serial) - { - } - - public override int SignPostID => 353; - - 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 CasaMoga : BaseContestHouse - { - public CasaMoga(Mobile owner) - : base(ContestHouseType.Keep, 0x1489, owner, 2113, 18) - { - SetSign(-11, 13, 7, false); - } - - public CasaMoga(Serial serial) : base(serial) - { - } - - 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 RobinsRoost : BaseContestHouse - { - public RobinsRoost(Mobile owner) - : base(ContestHouseType.Castle, 0x148A, owner, 3281, 28) - { - SetSign(-15, 16, 7, true); - } - - public RobinsRoost(Serial serial) : base(serial) - { - } - - 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 Camelot : BaseContestHouse - { - public Camelot(Mobile owner) - : base(ContestHouseType.Castle, 0x148B, owner, 3281, 28) - { - SetSign(-15, 16, 7, false); - } - - public Camelot(Serial serial) : base(serial) - { - } + HouseType = (ContestHouseType)reader.ReadInt(); - 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 LacrimaeInCaelo : BaseContestHouse - { - public LacrimaeInCaelo(Mobile owner) - : base(ContestHouseType.Castle, 0x148C, owner, 3281, 28) - { - SetSign(-15, 16, 7, false); - } - - public LacrimaeInCaelo(Serial serial) : base(serial) - { - } - - 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 OkinawaSweetDreamCastle : BaseContestHouse - { - public static Rectangle2D[] AreaArray = - { - new(-15, -15, 31, 31), - new(-14, 16, 6, 1), - new(-7, 16, 8, 1), - new(10, 16, 5, 1) - }; - - public OkinawaSweetDreamCastle(Mobile owner) - : base(ContestHouseType.Castle, 0x148D, owner, 3281, 28) - { - SetSign(-15, 16, 7, true); - } - - public OkinawaSweetDreamCastle(Serial serial) : base(serial) - { - } - - public override Rectangle2D[] Area => AreaArray; - - 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 TheSandstoneCastle : BaseContestHouse - { - public TheSandstoneCastle(Mobile owner) - : base(ContestHouseType.Castle, 0x148E, owner, 3281, 28) - { - SetSign(-15, 16, 7, true); - } - - public TheSandstoneCastle(Serial serial) : base(serial) - { - } - - 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 GrimswindSisters : BaseContestHouse - { - public static Rectangle2D[] AreaArray = - { - new(-15, -15, 31, 31), - new(-14, 16, 9, 1), - new(-3, 16, 8, 1), - new(7, 16, 9, 1) - }; - - public GrimswindSisters(Mobile owner) - : base(ContestHouseType.Castle, 0x148F, owner, 3281, 28) - { - SetSign(-15, 16, 7, false); - } - - public GrimswindSisters(Serial serial) : base(serial) - { - } - - public override Rectangle2D[] Area => AreaArray; - - public override void Serialize(IGenericWriter writer) - { - base.Serialize(writer); - writer.Write(0); // version - } + var count = reader.ReadInt(); - public override void Deserialize(IGenericReader reader) + for (var i = 0; i < count; i++) { - base.Deserialize(reader); - var version = reader.ReadInt(); + AddFixture(reader.ReadEntity()); } } } + +[SerializationGenerator(0, false)] +public partial class TrinsicKeep : BaseContestHouse +{ + public static readonly Rectangle2D[] AreaArray = + { + new(-11, -11, 23, 23), new(-10, 13, 6, 1), + new(-2, 13, 6, 1), new(6, 13, 7, 1) + }; + + public TrinsicKeep(Mobile owner) + : base(ContestHouseType.Keep, 0x147E, owner, 2113, 18) + { + SetSign(-11, 13, 7, false); + } + + public override Rectangle2D[] Area => AreaArray; +} + +[SerializationGenerator(0, false)] +public partial class GothicRoseCastle : BaseContestHouse +{ + public static readonly Rectangle2D[] AreaArray = + { + new(-15, -15, 31, 31), + new(-14, 16, 11, 1), + new(-2, 16, 6, 1), + new(5, 16, 11, 1) + }; + + public GothicRoseCastle(Mobile owner) + : base(ContestHouseType.Castle, 0x147F, owner, 3281, 28) + { + SetSign(-15, 16, 7, false); + } + + public override Rectangle2D[] Area => AreaArray; +} + +[SerializationGenerator(0, false)] +public partial class ElsaCastle : BaseContestHouse +{ + public ElsaCastle(Mobile owner) + : base(ContestHouseType.Castle, 0x1480, owner, 3281, 28) + { + SetSign(-15, 16, 7, false); + } +} + +[SerializationGenerator(0, false)] +public partial class Spires : BaseContestHouse +{ + public Spires(Mobile owner) + : base(ContestHouseType.Castle, 0x1481, owner, 3281, 28) + { + SetSign(-15, 16, 7, false); + } +} + +[SerializationGenerator(0, false)] +public partial class CastleOfOceania : BaseContestHouse +{ + public CastleOfOceania(Mobile owner) + : base(ContestHouseType.Castle, 0x1482, owner, 3281, 28) + { + SetSign(-15, 16, 7, false); + } +} + +[SerializationGenerator(0, false)] +public partial class FeudalCastle : BaseContestHouse +{ + public static readonly Rectangle2D[] AreaArray = + { + new(-15, -15, 31, 31), + new(5, 16, 1, 1), + new(7, 16, 4, 1), + new(12, 16, 1, 1) + }; + + public FeudalCastle(Mobile owner) + : base(ContestHouseType.Castle, 0x1483, owner, 3281, 28) + { + SetSign(-15, 16, 7, true); + } + + public override Rectangle2D[] Area => AreaArray; +} + +[SerializationGenerator(0, false)] +public partial class RobinsNest : BaseContestHouse +{ + public RobinsNest(Mobile owner) + : base(ContestHouseType.Keep, 0x1484, owner, 2113, 18) + { + SetSign(-11, 13, 7, false); + } +} + +[SerializationGenerator(0, false)] +public partial class TraditionalKeep : BaseContestHouse +{ + public static readonly Rectangle2D[] AreaArray = + { + new(-11, -11, 23, 23), + new(-10, 13, 6, 1), + new(-2, 13, 6, 1), + new(6, 13, 7, 1) + }; + + public TraditionalKeep(Mobile owner) + : base(ContestHouseType.Keep, 0x1485, owner, 2113, 18) + { + SetSign(-11, 13, 7, false); + } + + public override Rectangle2D[] Area => AreaArray; +} + +[SerializationGenerator(0, false)] +public partial class VillaCrowley : BaseContestHouse +{ + public VillaCrowley(Mobile owner) + : base(ContestHouseType.Keep, 0x1486, owner, 2113, 18) + { + SetSign(-11, 13, 7, true); + } +} + +[SerializationGenerator(0, false)] +public partial class DarkthornKeep : BaseContestHouse +{ + public DarkthornKeep(Mobile owner) + : base(ContestHouseType.Keep, 0x1487, owner, 2113, 18) + { + SetSign(-11, 13, 7, false); + } +} + +[SerializationGenerator(0, false)] +public partial class SandalwoodKeep : BaseContestHouse +{ + public SandalwoodKeep(Mobile owner) + : base(ContestHouseType.Keep, 0x1488, owner, 2113, 18) + { + SetSign(-11, 13, 7, true); + } + + public override int SignPostID => 353; +} + +[SerializationGenerator(0, false)] +public partial class CasaMoga : BaseContestHouse +{ + public CasaMoga(Mobile owner) + : base(ContestHouseType.Keep, 0x1489, owner, 2113, 18) + { + SetSign(-11, 13, 7, false); + } +} + +[SerializationGenerator(0, false)] +public partial class RobinsRoost : BaseContestHouse +{ + public RobinsRoost(Mobile owner) + : base(ContestHouseType.Castle, 0x148A, owner, 3281, 28) + { + SetSign(-15, 16, 7, true); + } +} + +[SerializationGenerator(0, false)] +public partial class Camelot : BaseContestHouse +{ + public Camelot(Mobile owner) + : base(ContestHouseType.Castle, 0x148B, owner, 3281, 28) + { + SetSign(-15, 16, 7, false); + } +} + +[SerializationGenerator(0, false)] +public partial class LacrimaeInCaelo : BaseContestHouse +{ + public LacrimaeInCaelo(Mobile owner) + : base(ContestHouseType.Castle, 0x148C, owner, 3281, 28) + { + SetSign(-15, 16, 7, false); + } +} + +[SerializationGenerator(0, false)] +public partial class OkinawaSweetDreamCastle : BaseContestHouse +{ + public static readonly Rectangle2D[] AreaArray = + { + new(-15, -15, 31, 31), + new(-14, 16, 6, 1), + new(-7, 16, 8, 1), + new(10, 16, 5, 1) + }; + + public OkinawaSweetDreamCastle(Mobile owner) + : base(ContestHouseType.Castle, 0x148D, owner, 3281, 28) + { + SetSign(-15, 16, 7, true); + } +} + +[SerializationGenerator(0, false)] +public partial class TheSandstoneCastle : BaseContestHouse +{ + public TheSandstoneCastle(Mobile owner) + : base(ContestHouseType.Castle, 0x148E, owner, 3281, 28) + { + SetSign(-15, 16, 7, true); + } +} + +[SerializationGenerator(0, false)] +public partial class GrimswindSisters : BaseContestHouse +{ + public static readonly Rectangle2D[] AreaArray = + { + new(-15, -15, 31, 31), + new(-14, 16, 9, 1), + new(-3, 16, 8, 1), + new(7, 16, 9, 1) + }; + + public GrimswindSisters(Mobile owner) + : base(ContestHouseType.Castle, 0x148F, owner, 3281, 28) + { + SetSign(-15, 16, 7, false); + } + + public override Rectangle2D[] Area => AreaArray; +} diff --git a/Projects/UOContent/Multis/Houses/Houses.cs b/Projects/UOContent/Multis/Houses/Houses.cs index b8f5c9a94..17faea68c 100644 --- a/Projects/UOContent/Multis/Houses/Houses.cs +++ b/Projects/UOContent/Multis/Houses/Houses.cs @@ -1,586 +1,388 @@ +using ModernUO.Serialization; using Server.Items; 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) - { - var keyValue = CreateKeys(owner); + AddSouthDoor(0, 3, 7, keyValue); - AddSouthDoor(0, 3, 7, keyValue); - - 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(); - } + SetSign(2, 4, 5); } - 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) }; - - public GuildHouse(Mobile owner) : base(0x74, owner, 1100, 8) + return ItemID switch { - var keyValue = CreateKeys(owner); - - AddSouthDoors(-1, 6, 7, keyValue); - - SetSign(4, 8, 16); - - AddSouthDoor(-3, -1, 7); - AddSouthDoor(3, -1, 7); - } - - public GuildHouse(Serial serial) : base(serial) - { - } - - public override int DefaultPrice => 144500; - - public override HousePlacementEntry ConvertEntry => HousePlacementEntry.ThreeStoryFoundations[20]; - public override int ConvertOffsetX => -1; - public override int ConvertOffsetY => -1; - - public override Rectangle2D[] Area => AreaArray; - public override Point3D BaseBanLocation => new(4, 8, 0); - - public override HouseDeed GetDeed() => new BrickHouseDeed(); - - 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 TwoStoryHouse : BaseHouse - { - public static Rectangle2D[] AreaArray = - { new(-7, 0, 14, 7), new(-7, -7, 9, 7), new(-4, 7, 4, 1) }; - - public TwoStoryHouse(Mobile owner, int id) : base(id, owner, 1370, 10) - { - var keyValue = CreateKeys(owner); - - AddSouthDoors(-3, 6, 7, keyValue); - - SetSign(2, 8, 16); - - 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 int DefaultPrice => 192400; - - public override HouseDeed GetDeed() - { - return ItemID switch - { - 0x76 => new TwoStoryWoodPlasterHouseDeed(), - 0x78 => new TwoStoryStonePlasterHouseDeed(), - _ => new TwoStoryStonePlasterHouseDeed() - }; - } - - 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 Tower : BaseHouse - { - public static Rectangle2D[] AreaArray = - { - new(-7, -7, 16, 14), new(-1, 7, 4, 2), new(-11, 0, 4, 7), - new(9, 0, 4, 7) + 0x64 => new StonePlasterHouseDeed(), + 0x66 => new FieldStoneHouseDeed(), + 0x68 => new SmallBrickHouseDeed(), + 0x6A => new WoodHouseDeed(), + 0x6C => new WoodPlasterHouseDeed(), + _ => new ThatchedRoofCottageDeed() + }; + } +} + +[SerializationGenerator(0, false)] +public partial class GuildHouse : BaseHouse +{ + public static readonly Rectangle2D[] AreaArray = [new(-7, -7, 14, 14), new(-2, 7, 4, 1)]; + + public GuildHouse(Mobile owner) : base(0x74, owner, 1100, 8) + { + var keyValue = CreateKeys(owner); + + AddSouthDoors(-1, 6, 7, keyValue); + + SetSign(4, 8, 16); + + AddSouthDoor(-3, -1, 7); + AddSouthDoor(3, -1, 7); + } + + public override int DefaultPrice => 144500; + + public override HousePlacementEntry ConvertEntry => HousePlacementEntry.ThreeStoryFoundations[20]; + public override int ConvertOffsetX => -1; + public override int ConvertOffsetY => -1; + + public override Rectangle2D[] Area => AreaArray; + public override Point3D BaseBanLocation => new(4, 8, 0); + + public override HouseDeed GetDeed() => new BrickHouseDeed(); +} + +[SerializationGenerator(0, false)] +public partial class TwoStoryHouse : BaseHouse +{ + public static readonly Rectangle2D[] AreaArray = + [new(-7, 0, 14, 7), new(-7, -7, 9, 7), new(-4, 7, 4, 1)]; + + public TwoStoryHouse(Mobile owner, int id) : base(id, owner, 1370, 10) + { + var keyValue = CreateKeys(owner); + + AddSouthDoors(-3, 6, 7, keyValue); + + SetSign(2, 8, 16); + + AddSouthDoor(-3, 0, 7); + AddSouthDoor(id == 0x76 ? -2 : -3, 0, 27); + } + + public override Rectangle2D[] Area => AreaArray; + public override Point3D BaseBanLocation => new(2, 8, 0); + + public override int DefaultPrice => 192400; + + public override HouseDeed GetDeed() + { + return ItemID switch + { + 0x76 => new TwoStoryWoodPlasterHouseDeed(), + _ => new TwoStoryStonePlasterHouseDeed() + }; + } +} + +[SerializationGenerator(0, false)] +public partial class Tower : BaseHouse +{ + public static readonly Rectangle2D[] AreaArray = + [ + new(-7, -7, 16, 14), new(-1, 7, 4, 2), new(-11, 0, 4, 7), + new(9, 0, 4, 7) + ]; + + 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 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(); - } } } diff --git a/Projects/UOContent/Multis/Houses/MovingCrate.cs b/Projects/UOContent/Multis/Houses/MovingCrate.cs index a52ad7aec..d3127c1a3 100644 --- a/Projects/UOContent/Multis/Houses/MovingCrate.cs +++ b/Projects/UOContent/Multis/Houses/MovingCrate.cs @@ -1,346 +1,303 @@ using System; using System.Collections.Generic; +using ModernUO.Serialization; using Server.Items; 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; - public static readonly int Rows = 3; - public static readonly int Columns = 5; - public static readonly int HorizontalSpacing = 25; - public static readonly int VerticalSpacing = 25; + Hue = 0x8A5; + Movable = false; - 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; - 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) { - 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; } } } - - // 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]; - - foreach (var item in Items) + if (item is PackingBox packingBox) { - if (item is PackingBox) + var subItems = packingBox.Items; + + if (subItems.Count < MaxItemsPerSubcontainer) { - 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; + packingBox.DropItem(dropped); + return; } } - - 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) - { - if (m.AccessLevel < AccessLevel.GameMaster) - { - m.SendLocalizedMessage(1061145); // You cannot place items into a house moving crate. - return false; - } + // 3. Drop the item into a new container + var subContainer = new PackingBox(); + subContainer.DropItem(dropped); - return base.CheckHold(m, item, message, checkItems, plusItems, plusWeight); + var location = GetFreeLocation(); + if (location != Point3D.Zero) + { + AddItem(subContainer); + subContainer.Location = location; } - - 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) + else { - base.OnItemRemoved(item); - - 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(); - 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(); - - 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(); - } + base.DropItem(subContainer); } } - 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) { - } - - 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) + if (item is PackingBox) { - 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); - - if (TotalItems == 0) + for (var j = 0; j < Columns; j++) { - 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) - { - base.Serialize(writer); + return Point3D.Zero; + } - 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(); + 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(); + } } } diff --git a/Projects/UOContent/Multis/Houses/PreviewHouse.cs b/Projects/UOContent/Multis/Houses/PreviewHouse.cs index 3db6b4d72..ca254c149 100644 --- a/Projects/UOContent/Multis/Houses/PreviewHouse.cs +++ b/Projects/UOContent/Multis/Houses/PreviewHouse.cs @@ -1,147 +1,117 @@ using System; using System.Collections.Generic; +using ModernUO.Serialization; 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 _previewComponents; + + private Timer _timer; + + public PreviewHouse(int multiID) : base(multiID) { - private List m_Components; - private Timer m_Timer; + var mcl = Components; - public PreviewHouse(int multiID) : base(multiID) + for (var i = 1; i < mcl.List.Length; ++i) { - m_Components = new List(); + var entry = mcl.List[i]; - var mcl = Components; - - for (var i = 1; i < mcl.List.Length; ++i) + if (entry.Flags == 0) { - 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) - { - 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); + _previewComponents ??= []; + _previewComponents.Add(item); } } - public override void OnMapChange() + _timer = new DecayTimer(this); + _timer.Start(); + } + + public override void OnLocationChange(Point3D oldLocation) + { + base.OnLocationChange(oldLocation); + + if (_previewComponents == null) { - base.OnMapChange(); - - if (m_Components == null) - { - return; - } - - for (var i = 0; i < m_Components.Count; ++i) - { - var item = m_Components[i]; - - item.Map = Map; - } + return; } - 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) - { - return; - } + item.MoveToWorld(new Point3D(item.X + xOffset, item.Y + yOffset, item.Z + zOffset), Map); + } + } - for (var i = 0; i < m_Components.Count; ++i) - { - var item = m_Components[i]; + public override void OnMapChange() + { + 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); - - var version = reader.ReadInt(); - - switch (version) - { - case 0: - { - m_Components = reader.ReadEntityList(); - - 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(); - } + _item.Delete(); } } }