fix: Source generates map item serialization (#1166)

This commit is contained in:
Kamron Batman 2022-09-07 01:13:20 -07:00 • committed by GitHub
parent b5a06d0545
commit b44c69bcee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 1517 additions and 1636 deletions

View file

@ -1,51 +1,27 @@
namespace Server.Items
using System;
using ModernUO.Serialization;
namespace Server.Items;
[SerializationGenerator(0)]
public partial class WorldMap : MapItem
{
public class WorldMap : MapItem
[Constructible]
public WorldMap()
{
[Constructible]
public WorldMap()
{
SetDisplay(0, 0, 5119, 4095, 400, 400);
}
SetDisplay(0, 0, 5119, 4095, 400, 400);
}
public WorldMap(Serial serial) : base(serial)
{
}
public override int LabelNumber => 1015233; // world map
public override int LabelNumber => 1015233; // world map
public override void CraftInit(Mobile from)
{
// Unlike the others, world map is not based on crafted location
public override void CraftInit(Mobile from)
{
// Unlike the others, world map is not based on crafted location
var skillValue = from.Skills.Cartography.Value;
var x20 = (int)(skillValue * 20);
var size = Math.Clamp(25 + (int)(skillValue * 6.6), 200, 400);
var skillValue = from.Skills.Cartography.Value;
var x20 = (int)(skillValue * 20);
var size = 25 + (int)(skillValue * 6.6);
if (size < 200)
{
size = 200;
}
else if (size > 400)
{
size = 400;
}
SetDisplay(1344 - x20, 1600 - x20, 1472 + x20, 1728 + x20, size, size);
}
public override void Serialize(IGenericWriter writer)
{
base.Serialize(writer);
writer.Write(0);
}
public override void Deserialize(IGenericReader reader)
{
base.Deserialize(reader);
var version = reader.ReadInt();
}
SetDisplay(1344 - x20, 1600 - x20, 1472 + x20, 1728 + x20, size, size);
}
}