fix: Codegens guildstone and jewelery (#1061)
This commit is contained in:
parent
3594e97109
commit
c1cc1308a5
45 changed files with 1239 additions and 1673 deletions
|
|
@ -51,8 +51,6 @@ public abstract partial class BaseBoard : Container, ISecurable
|
|||
|
||||
private void Deserialize(IGenericReader reader, int version)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
if (version == 1)
|
||||
{
|
||||
Level = (SecureLevel)reader.ReadInt();
|
||||
|
|
|
|||
|
|
@ -1,47 +1,71 @@
|
|||
using ModernUO.Serialization;
|
||||
using Server.Guilds;
|
||||
using Server.Multis;
|
||||
using Server.Prompts;
|
||||
|
||||
namespace Server.Items
|
||||
namespace Server.Items;
|
||||
|
||||
[SerializationGenerator(0, false)]
|
||||
public partial class GuildDeed : Item
|
||||
{
|
||||
public class GuildDeed : Item
|
||||
[Constructible]
|
||||
public GuildDeed() : base(0x14F0) => Weight = 1.0;
|
||||
|
||||
public override int LabelNumber => 1041055; // a guild deed
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
[Constructible]
|
||||
public GuildDeed() : base(0x14F0) => Weight = 1.0;
|
||||
|
||||
public GuildDeed(Serial serial) : base(serial)
|
||||
if (Guild.NewGuildSystem)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
public override int LabelNumber => 1041055; // a guild deed
|
||||
|
||||
public override void Serialize(IGenericWriter writer)
|
||||
if (!IsChildOf(from.Backpack))
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write(0); // version
|
||||
from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
|
||||
}
|
||||
|
||||
public override void Deserialize(IGenericReader reader)
|
||||
else if (from.Guild != null)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
from.SendLocalizedMessage(501137); // You must resign from your current guild before founding another!
|
||||
}
|
||||
else
|
||||
{
|
||||
var house = BaseHouse.FindHouseAt(from);
|
||||
|
||||
var version = reader.ReadInt();
|
||||
|
||||
if (Weight == 0.0)
|
||||
if (house == null)
|
||||
{
|
||||
Weight = 1.0;
|
||||
from.SendLocalizedMessage(501138); // You can only place a guildstone in a house.
|
||||
}
|
||||
else if (house.FindGuildstone() != null)
|
||||
{
|
||||
from.SendLocalizedMessage(501142); // Only one guildstone may reside in a given house.
|
||||
}
|
||||
else if (!house.IsOwner(from))
|
||||
{
|
||||
from.SendLocalizedMessage(501141); // You can only place a guildstone in a house you own!
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1013060); // Enter new guild name (40 characters max):
|
||||
from.Prompt = new InternalPrompt(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
private class InternalPrompt : Prompt
|
||||
{
|
||||
private readonly GuildDeed m_Deed;
|
||||
|
||||
public InternalPrompt(GuildDeed deed) => m_Deed = deed;
|
||||
|
||||
public override void OnResponse(Mobile from, string text)
|
||||
{
|
||||
if (Guild.NewGuildSystem)
|
||||
if (m_Deed.Deleted)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!IsChildOf(from.Backpack))
|
||||
if (!m_Deed.IsChildOf(from.Backpack))
|
||||
{
|
||||
from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
|
||||
}
|
||||
|
|
@ -67,76 +91,30 @@ namespace Server.Items
|
|||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1013060); // Enter new guild name (40 characters max):
|
||||
from.Prompt = new InternalPrompt(this);
|
||||
m_Deed.Delete();
|
||||
|
||||
if (text.Length > 40)
|
||||
{
|
||||
text = text[..40];
|
||||
}
|
||||
|
||||
var guild = new Guild(from, text, "none");
|
||||
|
||||
from.Guild = guild;
|
||||
from.GuildTitle = "Guildmaster";
|
||||
|
||||
var stone = new Guildstone(guild);
|
||||
|
||||
stone.MoveToWorld(from.Location, from.Map);
|
||||
|
||||
guild.Guildstone = stone;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class InternalPrompt : Prompt
|
||||
public override void OnCancel(Mobile from)
|
||||
{
|
||||
private readonly GuildDeed m_Deed;
|
||||
|
||||
public InternalPrompt(GuildDeed deed) => m_Deed = deed;
|
||||
|
||||
public override void OnResponse(Mobile from, string text)
|
||||
{
|
||||
if (m_Deed.Deleted)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!m_Deed.IsChildOf(from.Backpack))
|
||||
{
|
||||
from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
|
||||
}
|
||||
else if (from.Guild != null)
|
||||
{
|
||||
from.SendLocalizedMessage(501137); // You must resign from your current guild before founding another!
|
||||
}
|
||||
else
|
||||
{
|
||||
var house = BaseHouse.FindHouseAt(from);
|
||||
|
||||
if (house == null)
|
||||
{
|
||||
from.SendLocalizedMessage(501138); // You can only place a guildstone in a house.
|
||||
}
|
||||
else if (house.FindGuildstone() != null)
|
||||
{
|
||||
from.SendLocalizedMessage(501142); // Only one guildstone may reside in a given house.
|
||||
}
|
||||
else if (!house.IsOwner(from))
|
||||
{
|
||||
from.SendLocalizedMessage(501141); // You can only place a guildstone in a house you own!
|
||||
}
|
||||
else
|
||||
{
|
||||
m_Deed.Delete();
|
||||
|
||||
if (text.Length > 40)
|
||||
{
|
||||
text = text[..40];
|
||||
}
|
||||
|
||||
var guild = new Guild(from, text, "none");
|
||||
|
||||
from.Guild = guild;
|
||||
from.GuildTitle = "Guildmaster";
|
||||
|
||||
var stone = new Guildstone(guild);
|
||||
|
||||
stone.MoveToWorld(from.Location, from.Map);
|
||||
|
||||
guild.Guildstone = stone;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnCancel(Mobile from)
|
||||
{
|
||||
from.SendLocalizedMessage(501145); // Placement of guildstone cancelled.
|
||||
}
|
||||
from.SendLocalizedMessage(501145); // Placement of guildstone cancelled.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,101 +1,65 @@
|
|||
using ModernUO.Serialization;
|
||||
using Server.Guilds;
|
||||
using Server.Multis;
|
||||
|
||||
namespace Server.Items
|
||||
namespace Server.Items;
|
||||
|
||||
[SerializationGenerator(0, false)]
|
||||
public partial class GuildTeleporter : Item
|
||||
{
|
||||
public class GuildTeleporter : Item
|
||||
[SerializableField(0)]
|
||||
private Item _stone;
|
||||
|
||||
[Constructible]
|
||||
public GuildTeleporter(Item stone = null) : base(0x1869)
|
||||
{
|
||||
private Item m_Stone;
|
||||
Weight = 1.0;
|
||||
LootType = LootType.Blessed;
|
||||
_stone = stone;
|
||||
}
|
||||
|
||||
[Constructible]
|
||||
public GuildTeleporter(Item stone = null) : base(0x1869)
|
||||
public override int LabelNumber => 1041054; // guildstone teleporter
|
||||
|
||||
public override bool DisplayLootType => false;
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (Guild.NewGuildSystem)
|
||||
{
|
||||
Weight = 1.0;
|
||||
LootType = LootType.Blessed;
|
||||
|
||||
m_Stone = stone;
|
||||
return;
|
||||
}
|
||||
|
||||
public GuildTeleporter(Serial serial) : base(serial)
|
||||
if (!IsChildOf(from.Backpack))
|
||||
{
|
||||
from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
|
||||
return;
|
||||
}
|
||||
|
||||
public override int LabelNumber => 1041054; // guildstone teleporter
|
||||
|
||||
public override bool DisplayLootType => false;
|
||||
|
||||
public override void Serialize(IGenericWriter writer)
|
||||
if (_stone is not Guildstone gs || gs.Deleted || gs.Guild?.Teleporter != this)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write(0); // version
|
||||
|
||||
writer.Write(m_Stone);
|
||||
from.SendLocalizedMessage(501197); // This teleporting object can not determine what guildstone to teleport
|
||||
return;
|
||||
}
|
||||
|
||||
public override void Deserialize(IGenericReader reader)
|
||||
var house = BaseHouse.FindHouseAt(from);
|
||||
|
||||
if (house == null)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
LootType = LootType.Blessed;
|
||||
|
||||
var version = reader.ReadInt();
|
||||
|
||||
switch (version)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
m_Stone = reader.ReadEntity<Item>();
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (Weight == 0.0)
|
||||
{
|
||||
Weight = 1.0;
|
||||
}
|
||||
from.SendLocalizedMessage(501138); // You can only place a guildstone in a house.
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
else if (!house.IsOwner(from))
|
||||
{
|
||||
if (Guild.NewGuildSystem)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var stone = m_Stone as Guildstone;
|
||||
|
||||
if (!IsChildOf(from.Backpack))
|
||||
{
|
||||
from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
|
||||
}
|
||||
else if (stone?.Deleted != false || stone.Guild?.Teleporter != this)
|
||||
{
|
||||
from.SendLocalizedMessage(501197); // This teleporting object can not determine what guildstone to teleport
|
||||
}
|
||||
else
|
||||
{
|
||||
var house = BaseHouse.FindHouseAt(from);
|
||||
|
||||
if (house == null)
|
||||
{
|
||||
from.SendLocalizedMessage(501138); // You can only place a guildstone in a house.
|
||||
}
|
||||
else if (!house.IsOwner(from))
|
||||
{
|
||||
from.SendLocalizedMessage(501141); // You can only place a guildstone in a house you own!
|
||||
}
|
||||
else if (house.FindGuildstone() != null)
|
||||
{
|
||||
from.SendLocalizedMessage(501142); // Only one guildstone may reside in a given house.
|
||||
}
|
||||
else
|
||||
{
|
||||
m_Stone.MoveToWorld(from.Location, from.Map);
|
||||
Delete();
|
||||
stone.Guild.Teleporter = null;
|
||||
}
|
||||
}
|
||||
from.SendLocalizedMessage(501141); // You can only place a guildstone in a house you own!
|
||||
}
|
||||
else if (house.FindGuildstone() != null)
|
||||
{
|
||||
from.SendLocalizedMessage(501142); // Only one guildstone may reside in a given house.
|
||||
}
|
||||
else
|
||||
{
|
||||
gs.MoveToWorld(from.Location, from.Map);
|
||||
Delete();
|
||||
gs.Guild.Teleporter = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
using ModernUO.Serialization;
|
||||
using Server.Factions;
|
||||
using Server.Guilds;
|
||||
using Server.Gumps;
|
||||
|
|
@ -5,461 +6,311 @@ using Server.Multis;
|
|||
using Server.Network;
|
||||
using Server.Targeting;
|
||||
|
||||
namespace Server.Items
|
||||
namespace Server.Items;
|
||||
|
||||
[SerializationGenerator(4, false)]
|
||||
public partial class Guildstone : Item, IAddon, IChoppable
|
||||
{
|
||||
public class Guildstone : Item, IAddon, IChoppable
|
||||
[InvalidateProperties]
|
||||
[SerializableField(0)]
|
||||
[SerializableFieldAttr("[CommandProperty(AccessLevel.GameMaster)]")]
|
||||
private string _guildName;
|
||||
|
||||
[InvalidateProperties]
|
||||
[SerializableField(1)]
|
||||
[SerializableFieldAttr("[CommandProperty(AccessLevel.GameMaster)]")]
|
||||
private string _guildAbbrev;
|
||||
|
||||
[InvalidateProperties]
|
||||
[SerializableField(2, setter: "private")]
|
||||
[SerializableFieldAttr("[CommandProperty(AccessLevel.GameMaster)]")]
|
||||
private Guild _guild;
|
||||
|
||||
public Guildstone(Guild g) : this(g, g.Name, g.Abbreviation)
|
||||
{
|
||||
private bool m_BeforeChangeover;
|
||||
private string m_GuildAbbrev;
|
||||
private string m_GuildName;
|
||||
}
|
||||
|
||||
public Guildstone(Guild g) : this(g, g.Name, g.Abbreviation)
|
||||
public Guildstone(Guild g, string guildName, string abbrev) : base(Guild.NewGuildSystem ? 0xED6 : 0xED4)
|
||||
{
|
||||
_guild = g;
|
||||
_guildName = guildName;
|
||||
_guildAbbrev = abbrev;
|
||||
|
||||
Movable = false;
|
||||
}
|
||||
|
||||
public override int LabelNumber => 1041429; // a guildstone
|
||||
|
||||
public Item Deed => new GuildstoneDeed(Guild, _guildName, _guildAbbrev);
|
||||
|
||||
public bool CouldFit(IPoint3D p, Map map) => map.CanFit(p.X, p.Y, p.Z, ItemData.Height);
|
||||
|
||||
public void OnChop(Mobile from)
|
||||
{
|
||||
if (!Guild.NewGuildSystem)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
public Guildstone(Guild g, string guildName, string abbrev) : base(Guild.NewGuildSystem ? 0xED6 : 0xED4)
|
||||
var house = BaseHouse.FindHouseAt(this);
|
||||
|
||||
if (house?.IsOwner(from) == true && house.Addons.Contains(this))
|
||||
{
|
||||
Guild = g;
|
||||
m_GuildName = guildName;
|
||||
m_GuildAbbrev = abbrev;
|
||||
Effects.PlaySound(GetWorldLocation(), Map, 0x3B3);
|
||||
from.SendLocalizedMessage(500461); // You destroy the item.
|
||||
|
||||
Movable = false;
|
||||
}
|
||||
Delete();
|
||||
|
||||
public Guildstone(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
house.Addons.Remove(this);
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public string GuildName
|
||||
{
|
||||
get => m_GuildName;
|
||||
set
|
||||
var deed = Deed;
|
||||
|
||||
if (deed != null)
|
||||
{
|
||||
m_GuildName = value;
|
||||
InvalidateProperties();
|
||||
}
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public string GuildAbbrev
|
||||
{
|
||||
get => m_GuildAbbrev;
|
||||
set
|
||||
{
|
||||
m_GuildAbbrev = value;
|
||||
InvalidateProperties();
|
||||
}
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public Guild Guild { get; private set; }
|
||||
|
||||
public override int LabelNumber => 1041429; // a guildstone
|
||||
|
||||
public Item Deed => new GuildstoneDeed(Guild, m_GuildName, m_GuildAbbrev);
|
||||
|
||||
public bool CouldFit(IPoint3D p, Map map) => map.CanFit(p.X, p.Y, p.Z, ItemData.Height);
|
||||
|
||||
public void OnChop(Mobile from)
|
||||
{
|
||||
if (!Guild.NewGuildSystem)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var house = BaseHouse.FindHouseAt(this);
|
||||
|
||||
var contains = false;
|
||||
|
||||
if (house == null && m_BeforeChangeover ||
|
||||
house?.IsOwner(from) == true && (contains = house.Addons.Contains(this)))
|
||||
{
|
||||
Effects.PlaySound(GetWorldLocation(), Map, 0x3B3);
|
||||
from.SendLocalizedMessage(500461); // You destroy the item.
|
||||
|
||||
Delete();
|
||||
|
||||
if (contains)
|
||||
{
|
||||
house.Addons.Remove(this);
|
||||
}
|
||||
|
||||
var deed = Deed;
|
||||
|
||||
if (deed != null)
|
||||
{
|
||||
from.AddToBackpack(deed);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize(IGenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
if (Guild?.Disbanded == false)
|
||||
{
|
||||
m_GuildName = Guild.Name;
|
||||
m_GuildAbbrev = Guild.Abbreviation;
|
||||
}
|
||||
|
||||
writer.Write(3); // version
|
||||
|
||||
writer.Write(m_BeforeChangeover);
|
||||
|
||||
writer.Write(m_GuildName);
|
||||
writer.Write(m_GuildAbbrev);
|
||||
|
||||
writer.Write(Guild);
|
||||
}
|
||||
|
||||
public override void Deserialize(IGenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
var version = reader.ReadInt();
|
||||
|
||||
switch (version)
|
||||
{
|
||||
case 3:
|
||||
{
|
||||
m_BeforeChangeover = reader.ReadBool();
|
||||
goto case 2;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
m_GuildName = reader.ReadString();
|
||||
m_GuildAbbrev = reader.ReadString();
|
||||
|
||||
goto case 1;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
Guild = reader.ReadEntity<Guild>();
|
||||
|
||||
goto case 0;
|
||||
}
|
||||
case 0:
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (Guild.NewGuildSystem && ItemID == 0xED4)
|
||||
{
|
||||
ItemID = 0xED6;
|
||||
}
|
||||
|
||||
if (version <= 2)
|
||||
{
|
||||
m_BeforeChangeover = true;
|
||||
}
|
||||
|
||||
if (Guild.NewGuildSystem && m_BeforeChangeover)
|
||||
{
|
||||
Timer.StartTimer(AddToHouse);
|
||||
}
|
||||
|
||||
if (!Guild.NewGuildSystem && Guild == null)
|
||||
{
|
||||
Delete();
|
||||
}
|
||||
}
|
||||
|
||||
private void AddToHouse()
|
||||
{
|
||||
var house = BaseHouse.FindHouseAt(this);
|
||||
|
||||
if (Guild.NewGuildSystem && m_BeforeChangeover && house?.Addons.Contains(this) == false)
|
||||
{
|
||||
house.Addons.Add(this);
|
||||
m_BeforeChangeover = false;
|
||||
}
|
||||
}
|
||||
|
||||
public override void GetProperties(IPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
if (Guild?.Disbanded == false)
|
||||
{
|
||||
string name;
|
||||
string abbr;
|
||||
|
||||
if ((name = Guild.Name) == null || (name = name.Trim()).Length <= 0)
|
||||
{
|
||||
name = "(unnamed)";
|
||||
}
|
||||
|
||||
if ((abbr = Guild.Abbreviation) == null || (abbr = abbr.Trim()).Length <= 0)
|
||||
{
|
||||
abbr = "";
|
||||
}
|
||||
|
||||
// list.Add( 1060802, Utility.FixHtml( name ) ); // Guild name: ~1_val~
|
||||
list.Add(1060802, $"{Utility.FixHtml(name)} [{Utility.FixHtml(abbr)}]");
|
||||
}
|
||||
else if (m_GuildName != null && m_GuildAbbrev != null)
|
||||
{
|
||||
list.Add(1060802, $"{Utility.FixHtml(m_GuildName)} [{Utility.FixHtml(m_GuildAbbrev)}]");
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnSingleClick(Mobile from)
|
||||
{
|
||||
base.OnSingleClick(from);
|
||||
|
||||
if (Guild?.Disbanded == false)
|
||||
{
|
||||
string name;
|
||||
|
||||
if ((name = Guild.Name) == null || (name = name.Trim()).Length <= 0)
|
||||
{
|
||||
name = "(unnamed)";
|
||||
}
|
||||
|
||||
LabelTo(from, name);
|
||||
}
|
||||
else if (m_GuildName != null)
|
||||
{
|
||||
LabelTo(from, m_GuildName);
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnAfterDelete()
|
||||
{
|
||||
if (!Guild.NewGuildSystem && Guild?.Disbanded == false)
|
||||
{
|
||||
Guild.Disband();
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (Guild.NewGuildSystem)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (Guild?.Disbanded != false)
|
||||
{
|
||||
Delete();
|
||||
}
|
||||
else if (!from.InRange(GetWorldLocation(), 2))
|
||||
{
|
||||
from.SendLocalizedMessage(500446); // That is too far away.
|
||||
}
|
||||
else if (Guild.Accepted.Contains(from))
|
||||
{
|
||||
var guildState = PlayerState.Find(Guild.Leader);
|
||||
var targetState = PlayerState.Find(from);
|
||||
|
||||
var guildFaction = guildState?.Faction;
|
||||
var targetFaction = targetState?.Faction;
|
||||
|
||||
if (guildFaction != targetFaction || targetState?.IsLeaving == true)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (guildState != null && targetState != null)
|
||||
{
|
||||
targetState.Leaving = guildState.Leaving;
|
||||
}
|
||||
|
||||
Guild.Accepted.Remove(from);
|
||||
Guild.AddMember(from);
|
||||
|
||||
GuildGump.EnsureClosed(from);
|
||||
from.SendGump(new GuildGump(from, Guild));
|
||||
}
|
||||
else if (from.AccessLevel < AccessLevel.GameMaster && !Guild.IsMember(from))
|
||||
{
|
||||
from.NetState.SendMessageLocalized(
|
||||
Serial,
|
||||
ItemID,
|
||||
MessageType.Regular,
|
||||
0x3B2,
|
||||
3,
|
||||
501158
|
||||
); // You are not a member ...
|
||||
}
|
||||
else
|
||||
{
|
||||
GuildGump.EnsureClosed(from);
|
||||
from.SendGump(new GuildGump(from, Guild));
|
||||
from.AddToBackpack(deed);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Flippable(0x14F0, 0x14EF)]
|
||||
public class GuildstoneDeed : Item
|
||||
private void Deserialize(IGenericReader reader, int version)
|
||||
{
|
||||
private string m_GuildAbbrev;
|
||||
reader.ReadBool(); // Before Change Over
|
||||
_guildName = reader.ReadString();
|
||||
_guildAbbrev = reader.ReadString();
|
||||
_guild = reader.ReadEntity<Guild>();
|
||||
}
|
||||
|
||||
private string m_GuildName;
|
||||
|
||||
[Constructible]
|
||||
public GuildstoneDeed(Guild g = null, string guildName = null, string abbrev = null) : base(0x14F0)
|
||||
[AfterDeserialization(false)]
|
||||
private void AfterDeserialization()
|
||||
{
|
||||
if (Guild.NewGuildSystem && ItemID == 0xED4)
|
||||
{
|
||||
Guild = g;
|
||||
m_GuildName = guildName;
|
||||
m_GuildAbbrev = abbrev;
|
||||
|
||||
Weight = 1.0;
|
||||
ItemID = 0xED6;
|
||||
}
|
||||
|
||||
public GuildstoneDeed(Serial serial) : base(serial)
|
||||
if (!Guild.NewGuildSystem && Guild == null)
|
||||
{
|
||||
Delete();
|
||||
}
|
||||
}
|
||||
|
||||
public override void GetProperties(IPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
if (_guild?.Disbanded == false)
|
||||
{
|
||||
string name;
|
||||
string abbr;
|
||||
|
||||
if ((name = _guild.Name) == null || (name = name.Trim()).Length <= 0)
|
||||
{
|
||||
name = "(unnamed)";
|
||||
}
|
||||
|
||||
if ((abbr = _guild.Abbreviation) == null || (abbr = abbr.Trim()).Length <= 0)
|
||||
{
|
||||
abbr = "";
|
||||
}
|
||||
|
||||
// list.Add( 1060802, Utility.FixHtml( name ) ); // Guild name: ~1_val~
|
||||
list.Add(1060802, $"{Utility.FixHtml(name)} [{Utility.FixHtml(abbr)}]");
|
||||
}
|
||||
else if (_guildName != null && _guildAbbrev != null)
|
||||
{
|
||||
list.Add(1060802, $"{Utility.FixHtml(_guildName)} [{Utility.FixHtml(_guildAbbrev)}]");
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnSingleClick(Mobile from)
|
||||
{
|
||||
base.OnSingleClick(from);
|
||||
|
||||
if (_guild?.Disbanded == false)
|
||||
{
|
||||
string name;
|
||||
|
||||
if ((name = _guild.Name) == null || (name = name.Trim()).Length <= 0)
|
||||
{
|
||||
name = "(unnamed)";
|
||||
}
|
||||
|
||||
LabelTo(from, name);
|
||||
}
|
||||
else if (_guildName != null)
|
||||
{
|
||||
LabelTo(from, _guildName);
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnAfterDelete()
|
||||
{
|
||||
if (!Guild.NewGuildSystem && _guild?.Disbanded == false)
|
||||
{
|
||||
_guild.Disband();
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (Guild.NewGuildSystem)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
public override int LabelNumber => 1041233; // deed to a guildstone
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public string GuildName
|
||||
if (_guild?.Disbanded != false)
|
||||
{
|
||||
get => m_GuildName;
|
||||
set
|
||||
{
|
||||
m_GuildName = value;
|
||||
InvalidateProperties();
|
||||
}
|
||||
Delete();
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public string GuildAbbrev
|
||||
else if (!from.InRange(GetWorldLocation(), 2))
|
||||
{
|
||||
get => m_GuildAbbrev;
|
||||
set
|
||||
{
|
||||
m_GuildAbbrev = value;
|
||||
InvalidateProperties();
|
||||
}
|
||||
from.SendLocalizedMessage(500446); // That is too far away.
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public Guild Guild { get; private set; }
|
||||
|
||||
public override void Serialize(IGenericWriter writer)
|
||||
else if (_guild.Accepted.Contains(from))
|
||||
{
|
||||
base.Serialize(writer);
|
||||
var guildState = PlayerState.Find(_guild.Leader);
|
||||
var targetState = PlayerState.Find(from);
|
||||
|
||||
if (Guild?.Disbanded == false)
|
||||
{
|
||||
m_GuildName = Guild.Name;
|
||||
m_GuildAbbrev = Guild.Abbreviation;
|
||||
}
|
||||
var guildFaction = guildState?.Faction;
|
||||
var targetFaction = targetState?.Faction;
|
||||
|
||||
writer.Write(1); // version
|
||||
|
||||
writer.Write(m_GuildName);
|
||||
writer.Write(m_GuildAbbrev);
|
||||
|
||||
writer.Write(Guild);
|
||||
}
|
||||
|
||||
public override void Deserialize(IGenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
var version = reader.ReadInt();
|
||||
|
||||
switch (version)
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
m_GuildName = reader.ReadString();
|
||||
m_GuildAbbrev = reader.ReadString();
|
||||
|
||||
Guild = reader.ReadEntity<Guild>();
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void GetProperties(IPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
if (Guild?.Disbanded == false)
|
||||
{
|
||||
string name;
|
||||
string abbr;
|
||||
|
||||
if ((name = Guild.Name) == null || (name = name.Trim()).Length <= 0)
|
||||
{
|
||||
name = "(unnamed)";
|
||||
}
|
||||
|
||||
if ((abbr = Guild.Abbreviation) == null || (abbr = abbr.Trim()).Length <= 0)
|
||||
{
|
||||
abbr = "";
|
||||
}
|
||||
|
||||
// list.Add( 1060802, Utility.FixHtml( name ) ); // Guild name: ~1_val~
|
||||
list.Add(1060802, $"{Utility.FixHtml(name)} [{Utility.FixHtml(abbr)}]");
|
||||
}
|
||||
else if (m_GuildName != null && m_GuildAbbrev != null)
|
||||
{
|
||||
list.Add(1060802, $"{Utility.FixHtml(m_GuildName)} [{Utility.FixHtml(m_GuildAbbrev)}]");
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (IsChildOf(from.Backpack))
|
||||
{
|
||||
var house = BaseHouse.FindHouseAt(from);
|
||||
|
||||
if (house?.IsOwner(from) == true)
|
||||
{
|
||||
from.SendLocalizedMessage(1062838); // Where would you like to place this decoration?
|
||||
from.BeginTarget(-1, true, TargetFlags.None, Placement_OnTarget);
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(502092); // You must be in your house to do this.
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
|
||||
}
|
||||
}
|
||||
|
||||
public void Placement_OnTarget(Mobile from, object targeted)
|
||||
{
|
||||
if (targeted is not IPoint3D p || Deleted)
|
||||
if (guildFaction != targetFaction || targetState?.IsLeaving == true)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var loc = new Point3D(p);
|
||||
|
||||
var house = BaseHouse.FindHouseAt(loc, from.Map, 16);
|
||||
|
||||
if (IsChildOf(from.Backpack))
|
||||
if (guildState != null && targetState != null)
|
||||
{
|
||||
if (house?.IsOwner(from) == true)
|
||||
{
|
||||
Item addon = new Guildstone(Guild, m_GuildName, m_GuildAbbrev);
|
||||
|
||||
addon.MoveToWorld(loc, from.Map);
|
||||
|
||||
house.Addons.Add(addon);
|
||||
Delete();
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1042036); // That location is not in your house.
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
|
||||
targetState.Leaving = guildState.Leaving;
|
||||
}
|
||||
|
||||
_guild.Remove(_guild.Accepted, from);
|
||||
_guild.AddMember(from);
|
||||
|
||||
GuildGump.EnsureClosed(from);
|
||||
from.SendGump(new GuildGump(from, Guild));
|
||||
}
|
||||
else if (from.AccessLevel < AccessLevel.GameMaster && !_guild.IsMember(from))
|
||||
{
|
||||
// You are not a member ...
|
||||
from.NetState.SendMessageLocalized(Serial, ItemID, MessageType.Regular, 0x3B2, 3, 501158);
|
||||
}
|
||||
else
|
||||
{
|
||||
GuildGump.EnsureClosed(from);
|
||||
from.SendGump(new GuildGump(from, _guild));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Flippable(0x14F0, 0x14EF)]
|
||||
[SerializationGenerator(0, false)]
|
||||
public partial class GuildstoneDeed : Item
|
||||
{
|
||||
[InvalidateProperties]
|
||||
[SerializableField(0)]
|
||||
[SerializableFieldAttr("[CommandProperty(AccessLevel.GameMaster)]")]
|
||||
private string _guildName;
|
||||
|
||||
[InvalidateProperties]
|
||||
[SerializableField(1)]
|
||||
[SerializableFieldAttr("[CommandProperty(AccessLevel.GameMaster)]")]
|
||||
private string _guildAbbrev;
|
||||
|
||||
[InvalidateProperties]
|
||||
[SerializableField(2, setter: "private")]
|
||||
[SerializableFieldAttr("[CommandProperty(AccessLevel.GameMaster)]")]
|
||||
private Guild _guild;
|
||||
|
||||
[Constructible]
|
||||
public GuildstoneDeed(Guild g = null, string guildName = null, string abbrev = null) : base(0x14F0)
|
||||
{
|
||||
_guild = g;
|
||||
_guildName = guildName;
|
||||
_guildAbbrev = abbrev;
|
||||
|
||||
Weight = 1.0;
|
||||
}
|
||||
|
||||
public override int LabelNumber => 1041233; // deed to a guildstone
|
||||
|
||||
public override void GetProperties(IPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
if (_guild?.Disbanded == false)
|
||||
{
|
||||
string name;
|
||||
string abbr;
|
||||
|
||||
if ((name = _guild.Name) == null || (name = name.Trim()).Length <= 0)
|
||||
{
|
||||
name = "(unnamed)";
|
||||
}
|
||||
|
||||
if ((abbr = _guild.Abbreviation) == null || (abbr = abbr.Trim()).Length <= 0)
|
||||
{
|
||||
abbr = "";
|
||||
}
|
||||
|
||||
// list.Add( 1060802, Utility.FixHtml( name ) ); // Guild name: ~1_val~
|
||||
list.Add(1060802, $"{Utility.FixHtml(name)} [{Utility.FixHtml(abbr)}]");
|
||||
}
|
||||
else if (_guildName != null && _guildAbbrev != null)
|
||||
{
|
||||
list.Add(1060802, $"{Utility.FixHtml(_guildName)} [{Utility.FixHtml(_guildAbbrev)}]");
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (!IsChildOf(from.Backpack))
|
||||
{
|
||||
from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
|
||||
return;
|
||||
}
|
||||
|
||||
var house = BaseHouse.FindHouseAt(from);
|
||||
|
||||
if (house?.IsOwner(from) == true)
|
||||
{
|
||||
from.SendLocalizedMessage(1062838); // Where would you like to place this decoration?
|
||||
from.BeginTarget(-1, true, TargetFlags.None, Placement_OnTarget);
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(502092); // You must be in your house to do this.
|
||||
}
|
||||
}
|
||||
|
||||
public void Placement_OnTarget(Mobile from, object targeted)
|
||||
{
|
||||
if (targeted is not IPoint3D p || Deleted)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!IsChildOf(from.Backpack))
|
||||
{
|
||||
from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
|
||||
return;
|
||||
}
|
||||
|
||||
var loc = new Point3D(p);
|
||||
|
||||
var house = BaseHouse.FindHouseAt(loc, from.Map, 16);
|
||||
if (house?.IsOwner(from) == true)
|
||||
{
|
||||
Item addon = new Guildstone(_guild, _guildName, _guildAbbrev);
|
||||
|
||||
addon.MoveToWorld(loc, from.Map);
|
||||
|
||||
house.Add(house.Addons, addon);
|
||||
Delete();
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1042036); // That location is not in your house.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,34 +1,18 @@
|
|||
namespace Server.Items
|
||||
using ModernUO.Serialization;
|
||||
|
||||
namespace Server.Items;
|
||||
|
||||
[SerializationGenerator(0, false)]
|
||||
public partial class BraceletOfHealth : GoldBracelet
|
||||
{
|
||||
public class BraceletOfHealth : GoldBracelet
|
||||
[Constructible]
|
||||
public BraceletOfHealth()
|
||||
{
|
||||
[Constructible]
|
||||
public BraceletOfHealth()
|
||||
{
|
||||
Hue = 0x21;
|
||||
Attributes.BonusHits = 5;
|
||||
Attributes.RegenHits = 10;
|
||||
}
|
||||
|
||||
public BraceletOfHealth(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber => 1061103; // Bracelet of Health
|
||||
public override int ArtifactRarity => 11;
|
||||
|
||||
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();
|
||||
}
|
||||
Hue = 0x21;
|
||||
Attributes.BonusHits = 5;
|
||||
Attributes.RegenHits = 10;
|
||||
}
|
||||
|
||||
public override int LabelNumber => 1061103; // Bracelet of Health
|
||||
public override int ArtifactRarity => 11;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,34 +1,18 @@
|
|||
namespace Server.Items
|
||||
using ModernUO.Serialization;
|
||||
|
||||
namespace Server.Items;
|
||||
|
||||
[SerializationGenerator(0)]
|
||||
public partial class EssenceOfBattle : GoldRing
|
||||
{
|
||||
public class EssenceOfBattle : GoldRing
|
||||
[Constructible]
|
||||
public EssenceOfBattle()
|
||||
{
|
||||
[Constructible]
|
||||
public EssenceOfBattle()
|
||||
{
|
||||
Hue = 0x550;
|
||||
Attributes.BonusDex = 7;
|
||||
Attributes.BonusStr = 7;
|
||||
Attributes.WeaponDamage = 30;
|
||||
}
|
||||
|
||||
public EssenceOfBattle(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber => 1072935; // Essence of Battle
|
||||
|
||||
public override void Serialize(IGenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(IGenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
var version = reader.ReadEncodedInt();
|
||||
}
|
||||
Hue = 0x550;
|
||||
Attributes.BonusDex = 7;
|
||||
Attributes.BonusStr = 7;
|
||||
Attributes.WeaponDamage = 30;
|
||||
}
|
||||
|
||||
public override int LabelNumber => 1072935; // Essence of Battle
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,36 +1,20 @@
|
|||
namespace Server.Items
|
||||
using ModernUO.Serialization;
|
||||
|
||||
namespace Server.Items;
|
||||
|
||||
[SerializationGenerator(0)]
|
||||
public partial class PendantOfTheMagi : GoldNecklace
|
||||
{
|
||||
public class PendantOfTheMagi : GoldNecklace
|
||||
[Constructible]
|
||||
public PendantOfTheMagi()
|
||||
{
|
||||
[Constructible]
|
||||
public PendantOfTheMagi()
|
||||
{
|
||||
Hue = 0x48D;
|
||||
Attributes.BonusInt = 10;
|
||||
Attributes.RegenMana = 3;
|
||||
Attributes.SpellDamage = 5;
|
||||
Attributes.LowerManaCost = 10;
|
||||
Attributes.LowerRegCost = 30;
|
||||
}
|
||||
|
||||
public PendantOfTheMagi(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber => 1072937; // Pendant of the Magi
|
||||
|
||||
public override void Serialize(IGenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(IGenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
var version = reader.ReadEncodedInt();
|
||||
}
|
||||
Hue = 0x48D;
|
||||
Attributes.BonusInt = 10;
|
||||
Attributes.RegenMana = 3;
|
||||
Attributes.SpellDamage = 5;
|
||||
Attributes.LowerManaCost = 10;
|
||||
Attributes.LowerRegCost = 30;
|
||||
}
|
||||
|
||||
public override int LabelNumber => 1072937; // Pendant of the Magi
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,39 +1,23 @@
|
|||
namespace Server.Items
|
||||
using ModernUO.Serialization;
|
||||
|
||||
namespace Server.Items;
|
||||
|
||||
[SerializationGenerator(0)]
|
||||
public partial class ResilientBracer : GoldBracelet
|
||||
{
|
||||
public class ResilientBracer : GoldBracelet
|
||||
[Constructible]
|
||||
public ResilientBracer()
|
||||
{
|
||||
[Constructible]
|
||||
public ResilientBracer()
|
||||
{
|
||||
Hue = 0x488;
|
||||
Hue = 0x488;
|
||||
|
||||
SkillBonuses.SetValues(0, SkillName.MagicResist, 15.0);
|
||||
SkillBonuses.SetValues(0, SkillName.MagicResist, 15.0);
|
||||
|
||||
Attributes.BonusHits = 5;
|
||||
Attributes.RegenHits = 2;
|
||||
Attributes.DefendChance = 10;
|
||||
}
|
||||
|
||||
public ResilientBracer(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber => 1072933; // Resillient Bracer
|
||||
|
||||
public override int PhysicalResistance => 20;
|
||||
|
||||
public override void Serialize(IGenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(IGenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
var version = reader.ReadEncodedInt();
|
||||
}
|
||||
Attributes.BonusHits = 5;
|
||||
Attributes.RegenHits = 2;
|
||||
Attributes.DefendChance = 10;
|
||||
}
|
||||
|
||||
public override int LabelNumber => 1072933; // Resillient Bracer
|
||||
|
||||
public override int PhysicalResistance => 20;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,42 +1,21 @@
|
|||
namespace Server.Items
|
||||
using ModernUO.Serialization;
|
||||
|
||||
namespace Server.Items;
|
||||
|
||||
[SerializationGenerator(0, false)]
|
||||
public partial class OrnamentOfTheMagician : GoldBracelet
|
||||
{
|
||||
public class OrnamentOfTheMagician : GoldBracelet
|
||||
[Constructible]
|
||||
public OrnamentOfTheMagician()
|
||||
{
|
||||
[Constructible]
|
||||
public OrnamentOfTheMagician()
|
||||
{
|
||||
Hue = 0x554;
|
||||
Attributes.CastRecovery = 3;
|
||||
Attributes.CastSpeed = 2;
|
||||
Attributes.LowerManaCost = 10;
|
||||
Attributes.LowerRegCost = 20;
|
||||
Resistances.Energy = 15;
|
||||
}
|
||||
|
||||
public OrnamentOfTheMagician(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber => 1061105; // Ornament of the Magician
|
||||
public override int ArtifactRarity => 11;
|
||||
|
||||
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();
|
||||
|
||||
if (Hue == 0x12B)
|
||||
{
|
||||
Hue = 0x554;
|
||||
}
|
||||
}
|
||||
Hue = 0x554;
|
||||
Attributes.CastRecovery = 3;
|
||||
Attributes.CastSpeed = 2;
|
||||
Attributes.LowerManaCost = 10;
|
||||
Attributes.LowerRegCost = 20;
|
||||
Resistances.Energy = 15;
|
||||
}
|
||||
|
||||
public override int LabelNumber => 1061105; // Ornament of the Magician
|
||||
public override int ArtifactRarity => 11;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,37 +1,21 @@
|
|||
namespace Server.Items
|
||||
using ModernUO.Serialization;
|
||||
|
||||
namespace Server.Items;
|
||||
|
||||
[SerializationGenerator(0, false)]
|
||||
public partial class RingOfTheElements : GoldRing
|
||||
{
|
||||
public class RingOfTheElements : GoldRing
|
||||
[Constructible]
|
||||
public RingOfTheElements()
|
||||
{
|
||||
[Constructible]
|
||||
public RingOfTheElements()
|
||||
{
|
||||
Hue = 0x4E9;
|
||||
Attributes.Luck = 100;
|
||||
Resistances.Fire = 16;
|
||||
Resistances.Cold = 16;
|
||||
Resistances.Poison = 16;
|
||||
Resistances.Energy = 16;
|
||||
}
|
||||
|
||||
public RingOfTheElements(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber => 1061104; // Ring of the Elements
|
||||
public override int ArtifactRarity => 11;
|
||||
|
||||
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();
|
||||
}
|
||||
Hue = 0x4E9;
|
||||
Attributes.Luck = 100;
|
||||
Resistances.Fire = 16;
|
||||
Resistances.Cold = 16;
|
||||
Resistances.Poison = 16;
|
||||
Resistances.Energy = 16;
|
||||
}
|
||||
|
||||
public override int LabelNumber => 1061104; // Ring of the Elements
|
||||
public override int ArtifactRarity => 11;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,41 +1,20 @@
|
|||
namespace Server.Items
|
||||
using ModernUO.Serialization;
|
||||
|
||||
namespace Server.Items;
|
||||
|
||||
[SerializationGenerator(0, false)]
|
||||
public partial class RingOfTheVile : GoldRing
|
||||
{
|
||||
public class RingOfTheVile : GoldRing
|
||||
[Constructible]
|
||||
public RingOfTheVile()
|
||||
{
|
||||
[Constructible]
|
||||
public RingOfTheVile()
|
||||
{
|
||||
Hue = 0x4F7;
|
||||
Attributes.BonusDex = 8;
|
||||
Attributes.RegenStam = 6;
|
||||
Attributes.AttackChance = 15;
|
||||
Resistances.Poison = 20;
|
||||
}
|
||||
|
||||
public RingOfTheVile(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber => 1061102; // Ring of the Vile
|
||||
public override int ArtifactRarity => 11;
|
||||
|
||||
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();
|
||||
|
||||
if (Hue == 0x4F4)
|
||||
{
|
||||
Hue = 0x4F7;
|
||||
}
|
||||
}
|
||||
Hue = 0x4F7;
|
||||
Attributes.BonusDex = 8;
|
||||
Attributes.RegenStam = 6;
|
||||
Attributes.AttackChance = 15;
|
||||
Resistances.Poison = 20;
|
||||
}
|
||||
|
||||
public override int LabelNumber => 1061102; // Ring of the Vile
|
||||
public override int ArtifactRarity => 11;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,499 +1,444 @@
|
|||
using System;
|
||||
using ModernUO.Serialization;
|
||||
using Server.Engines.Craft;
|
||||
|
||||
namespace Server.Items
|
||||
namespace Server.Items;
|
||||
|
||||
public enum GemType
|
||||
{
|
||||
public enum GemType
|
||||
None,
|
||||
StarSapphire,
|
||||
Emerald,
|
||||
Sapphire,
|
||||
Ruby,
|
||||
Citrine,
|
||||
Amethyst,
|
||||
Tourmaline,
|
||||
Amber,
|
||||
Diamond
|
||||
}
|
||||
|
||||
[SerializationGenerator(4, false)]
|
||||
public abstract partial class BaseJewel : Item, ICraftable
|
||||
{
|
||||
[EncodedInt]
|
||||
[InvalidateProperties]
|
||||
[SerializableField(0)]
|
||||
[SerializableFieldAttr("[CommandProperty(AccessLevel.GameMaster)]")]
|
||||
private int _maxHitPoints;
|
||||
|
||||
// Field 1
|
||||
private int _hitPoints;
|
||||
|
||||
[SerializableField(2, "private", "private")]
|
||||
private CraftResource _rawResource;
|
||||
|
||||
[SerializableField(3)]
|
||||
[InvalidateProperties]
|
||||
[SerializableFieldAttr("[CommandProperty(AccessLevel.GameMaster)]")]
|
||||
private GemType _gemType;
|
||||
|
||||
[SerializableField(4, setter: "private")]
|
||||
[SerializableFieldAttr("[CommandProperty(AccessLevel.GameMaster, canModify: true)]")]
|
||||
private AosAttributes _attributes;
|
||||
|
||||
[SerializableField(5, setter: "private")]
|
||||
[SerializableFieldAttr("[CommandProperty(AccessLevel.GameMaster, canModify: true)]")]
|
||||
private AosElementAttributes _resistances;
|
||||
|
||||
[SerializableField(6, setter: "private")]
|
||||
[SerializableFieldAttr("[CommandProperty(AccessLevel.GameMaster, canModify: true)]")]
|
||||
private AosSkillBonuses _skillBonuses;
|
||||
|
||||
public BaseJewel(int itemID, Layer layer) : base(itemID)
|
||||
{
|
||||
None,
|
||||
StarSapphire,
|
||||
Emerald,
|
||||
Sapphire,
|
||||
Ruby,
|
||||
Citrine,
|
||||
Amethyst,
|
||||
Tourmaline,
|
||||
Amber,
|
||||
Diamond
|
||||
_attributes = new AosAttributes(this);
|
||||
_resistances = new AosElementAttributes(this);
|
||||
_skillBonuses = new AosSkillBonuses(this);
|
||||
_rawResource = CraftResource.Iron;
|
||||
Hue = CraftResources.GetHue(_rawResource);
|
||||
_gemType = GemType.None;
|
||||
|
||||
Layer = layer;
|
||||
|
||||
_hitPoints = _maxHitPoints = Utility.RandomMinMax(InitMinHits, InitMaxHits);
|
||||
}
|
||||
|
||||
public abstract class BaseJewel : Item, ICraftable
|
||||
[EncodedInt]
|
||||
[SerializableField(1)]
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int HitPoints
|
||||
{
|
||||
private GemType m_GemType;
|
||||
private int m_HitPoints;
|
||||
private int m_MaxHitPoints;
|
||||
private CraftResource m_Resource;
|
||||
|
||||
public BaseJewel(int itemID, Layer layer) : base(itemID)
|
||||
get => _hitPoints;
|
||||
set
|
||||
{
|
||||
Attributes = new AosAttributes(this);
|
||||
Resistances = new AosElementAttributes(this);
|
||||
SkillBonuses = new AosSkillBonuses(this);
|
||||
m_Resource = CraftResource.Iron;
|
||||
m_GemType = GemType.None;
|
||||
|
||||
Layer = layer;
|
||||
|
||||
m_HitPoints = m_MaxHitPoints = Utility.RandomMinMax(InitMinHits, InitMaxHits);
|
||||
}
|
||||
|
||||
public BaseJewel(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int MaxHitPoints
|
||||
{
|
||||
get => m_MaxHitPoints;
|
||||
set
|
||||
if (value != _hitPoints && _maxHitPoints > 0)
|
||||
{
|
||||
m_MaxHitPoints = value;
|
||||
_hitPoints = value;
|
||||
|
||||
if (_hitPoints < 0)
|
||||
{
|
||||
Delete();
|
||||
}
|
||||
else if (_hitPoints > _maxHitPoints)
|
||||
{
|
||||
_hitPoints = _maxHitPoints;
|
||||
}
|
||||
|
||||
InvalidateProperties();
|
||||
this.MarkDirty();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public CraftResource Resource
|
||||
{
|
||||
get => _rawResource;
|
||||
set
|
||||
{
|
||||
_rawResource = value;
|
||||
Hue = CraftResources.GetHue(_rawResource);
|
||||
}
|
||||
}
|
||||
|
||||
public override int PhysicalResistance => Resistances.Physical;
|
||||
public override int FireResistance => Resistances.Fire;
|
||||
public override int ColdResistance => Resistances.Cold;
|
||||
public override int PoisonResistance => Resistances.Poison;
|
||||
public override int EnergyResistance => Resistances.Energy;
|
||||
public virtual int BaseGemTypeNumber => 0;
|
||||
|
||||
public virtual int InitMinHits => 0;
|
||||
public virtual int InitMaxHits => 0;
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_gemType == GemType.None)
|
||||
{
|
||||
return base.LabelNumber;
|
||||
}
|
||||
|
||||
return BaseGemTypeNumber + (int)_gemType - 1;
|
||||
}
|
||||
}
|
||||
|
||||
public virtual int ArtifactRarity => 0;
|
||||
|
||||
public int OnCraft(
|
||||
int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, BaseTool tool,
|
||||
CraftItem craftItem, int resHue
|
||||
)
|
||||
{
|
||||
var resourceType = typeRes ?? craftItem.Resources[0].ItemType;
|
||||
|
||||
Resource = CraftResources.GetFromType(resourceType);
|
||||
|
||||
var context = craftSystem.GetContext(from);
|
||||
|
||||
if (context?.DoNotColor == true)
|
||||
{
|
||||
Hue = 0;
|
||||
}
|
||||
|
||||
if (craftItem.Resources.Count > 1)
|
||||
{
|
||||
resourceType = craftItem.Resources[1].ItemType;
|
||||
|
||||
if (resourceType == typeof(StarSapphire))
|
||||
{
|
||||
GemType = GemType.StarSapphire;
|
||||
}
|
||||
else if (resourceType == typeof(Emerald))
|
||||
{
|
||||
GemType = GemType.Emerald;
|
||||
}
|
||||
else if (resourceType == typeof(Sapphire))
|
||||
{
|
||||
GemType = GemType.Sapphire;
|
||||
}
|
||||
else if (resourceType == typeof(Ruby))
|
||||
{
|
||||
GemType = GemType.Ruby;
|
||||
}
|
||||
else if (resourceType == typeof(Citrine))
|
||||
{
|
||||
GemType = GemType.Citrine;
|
||||
}
|
||||
else if (resourceType == typeof(Amethyst))
|
||||
{
|
||||
GemType = GemType.Amethyst;
|
||||
}
|
||||
else if (resourceType == typeof(Tourmaline))
|
||||
{
|
||||
GemType = GemType.Tourmaline;
|
||||
}
|
||||
else if (resourceType == typeof(Amber))
|
||||
{
|
||||
GemType = GemType.Amber;
|
||||
}
|
||||
else if (resourceType == typeof(Diamond))
|
||||
{
|
||||
GemType = GemType.Diamond;
|
||||
}
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int HitPoints
|
||||
return 1;
|
||||
}
|
||||
|
||||
public override void OnAfterDuped(Item newItem)
|
||||
{
|
||||
if (newItem is not BaseJewel jewel)
|
||||
{
|
||||
get => m_HitPoints;
|
||||
set
|
||||
{
|
||||
if (value != m_HitPoints && MaxHitPoints > 0)
|
||||
{
|
||||
m_HitPoints = value;
|
||||
|
||||
if (m_HitPoints < 0)
|
||||
{
|
||||
Delete();
|
||||
}
|
||||
else if (m_HitPoints > MaxHitPoints)
|
||||
{
|
||||
m_HitPoints = MaxHitPoints;
|
||||
}
|
||||
|
||||
InvalidateProperties();
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster, canModify: true)]
|
||||
public AosAttributes Attributes { get; private set; }
|
||||
jewel.Attributes = new AosAttributes(newItem, Attributes);
|
||||
jewel.Resistances = new AosElementAttributes(newItem, Resistances);
|
||||
jewel.SkillBonuses = new AosSkillBonuses(newItem, SkillBonuses);
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster, canModify: true)]
|
||||
public AosElementAttributes Resistances { get; private set; }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster, canModify: true)]
|
||||
public AosSkillBonuses SkillBonuses { get; private set; }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public CraftResource Resource
|
||||
public override void OnAdded(IEntity parent)
|
||||
{
|
||||
if (Core.AOS && parent is Mobile from)
|
||||
{
|
||||
get => m_Resource;
|
||||
set
|
||||
SkillBonuses.AddTo(from);
|
||||
|
||||
var strBonus = Attributes.BonusStr;
|
||||
var dexBonus = Attributes.BonusDex;
|
||||
var intBonus = Attributes.BonusInt;
|
||||
|
||||
if (strBonus != 0 || dexBonus != 0 || intBonus != 0)
|
||||
{
|
||||
m_Resource = value;
|
||||
Hue = CraftResources.GetHue(m_Resource);
|
||||
}
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public GemType GemType
|
||||
{
|
||||
get => m_GemType;
|
||||
set
|
||||
{
|
||||
m_GemType = value;
|
||||
InvalidateProperties();
|
||||
}
|
||||
}
|
||||
|
||||
public override int PhysicalResistance => Resistances.Physical;
|
||||
public override int FireResistance => Resistances.Fire;
|
||||
public override int ColdResistance => Resistances.Cold;
|
||||
public override int PoisonResistance => Resistances.Poison;
|
||||
public override int EnergyResistance => Resistances.Energy;
|
||||
public virtual int BaseGemTypeNumber => 0;
|
||||
|
||||
public virtual int InitMinHits => 0;
|
||||
public virtual int InitMaxHits => 0;
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
if (m_GemType == GemType.None)
|
||||
{
|
||||
return base.LabelNumber;
|
||||
}
|
||||
|
||||
return BaseGemTypeNumber + (int)m_GemType - 1;
|
||||
}
|
||||
}
|
||||
|
||||
public virtual int ArtifactRarity => 0;
|
||||
|
||||
public int OnCraft(
|
||||
int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, BaseTool tool,
|
||||
CraftItem craftItem, int resHue
|
||||
)
|
||||
{
|
||||
var resourceType = typeRes ?? craftItem.Resources[0].ItemType;
|
||||
|
||||
Resource = CraftResources.GetFromType(resourceType);
|
||||
|
||||
var context = craftSystem.GetContext(from);
|
||||
|
||||
if (context?.DoNotColor == true)
|
||||
{
|
||||
Hue = 0;
|
||||
}
|
||||
|
||||
if (craftItem.Resources.Count > 1)
|
||||
{
|
||||
resourceType = craftItem.Resources[1].ItemType;
|
||||
|
||||
if (resourceType == typeof(StarSapphire))
|
||||
{
|
||||
GemType = GemType.StarSapphire;
|
||||
}
|
||||
else if (resourceType == typeof(Emerald))
|
||||
{
|
||||
GemType = GemType.Emerald;
|
||||
}
|
||||
else if (resourceType == typeof(Sapphire))
|
||||
{
|
||||
GemType = GemType.Sapphire;
|
||||
}
|
||||
else if (resourceType == typeof(Ruby))
|
||||
{
|
||||
GemType = GemType.Ruby;
|
||||
}
|
||||
else if (resourceType == typeof(Citrine))
|
||||
{
|
||||
GemType = GemType.Citrine;
|
||||
}
|
||||
else if (resourceType == typeof(Amethyst))
|
||||
{
|
||||
GemType = GemType.Amethyst;
|
||||
}
|
||||
else if (resourceType == typeof(Tourmaline))
|
||||
{
|
||||
GemType = GemType.Tourmaline;
|
||||
}
|
||||
else if (resourceType == typeof(Amber))
|
||||
{
|
||||
GemType = GemType.Amber;
|
||||
}
|
||||
else if (resourceType == typeof(Diamond))
|
||||
{
|
||||
GemType = GemType.Diamond;
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
public override void OnAfterDuped(Item newItem)
|
||||
{
|
||||
if (newItem is not BaseJewel jewel)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
jewel.Attributes = new AosAttributes(newItem, Attributes);
|
||||
jewel.Resistances = new AosElementAttributes(newItem, Resistances);
|
||||
jewel.SkillBonuses = new AosSkillBonuses(newItem, SkillBonuses);
|
||||
}
|
||||
|
||||
public override void OnAdded(IEntity parent)
|
||||
{
|
||||
if (Core.AOS && parent is Mobile from)
|
||||
{
|
||||
SkillBonuses.AddTo(from);
|
||||
|
||||
var strBonus = Attributes.BonusStr;
|
||||
var dexBonus = Attributes.BonusDex;
|
||||
var intBonus = Attributes.BonusInt;
|
||||
|
||||
if (strBonus != 0 || dexBonus != 0 || intBonus != 0)
|
||||
{
|
||||
var modName = Serial.ToString();
|
||||
|
||||
if (strBonus != 0)
|
||||
{
|
||||
from.AddStatMod(new StatMod(StatType.Str, $"{modName}Str", strBonus, TimeSpan.Zero));
|
||||
}
|
||||
|
||||
if (dexBonus != 0)
|
||||
{
|
||||
from.AddStatMod(new StatMod(StatType.Dex, $"{modName}Dex", dexBonus, TimeSpan.Zero));
|
||||
}
|
||||
|
||||
if (intBonus != 0)
|
||||
{
|
||||
from.AddStatMod(new StatMod(StatType.Int, $"{modName}Int", intBonus, TimeSpan.Zero));
|
||||
}
|
||||
}
|
||||
|
||||
from.CheckStatTimers();
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnRemoved(IEntity parent)
|
||||
{
|
||||
if (Core.AOS && parent is Mobile from)
|
||||
{
|
||||
SkillBonuses.Remove();
|
||||
|
||||
var modName = Serial.ToString();
|
||||
|
||||
from.RemoveStatMod($"{modName}Str");
|
||||
from.RemoveStatMod($"{modName}Dex");
|
||||
from.RemoveStatMod($"{modName}Int");
|
||||
if (strBonus != 0)
|
||||
{
|
||||
from.AddStatMod(new StatMod(StatType.Str, $"{modName}Str", strBonus, TimeSpan.Zero));
|
||||
}
|
||||
|
||||
from.CheckStatTimers();
|
||||
}
|
||||
}
|
||||
if (dexBonus != 0)
|
||||
{
|
||||
from.AddStatMod(new StatMod(StatType.Dex, $"{modName}Dex", dexBonus, TimeSpan.Zero));
|
||||
}
|
||||
|
||||
public override void GetProperties(IPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
SkillBonuses.GetProperties(list);
|
||||
|
||||
int prop;
|
||||
|
||||
if ((prop = ArtifactRarity) > 0)
|
||||
{
|
||||
list.Add(1061078, prop); // artifact rarity ~1_val~
|
||||
if (intBonus != 0)
|
||||
{
|
||||
from.AddStatMod(new StatMod(StatType.Int, $"{modName}Int", intBonus, TimeSpan.Zero));
|
||||
}
|
||||
}
|
||||
|
||||
if ((prop = Attributes.WeaponDamage) != 0)
|
||||
{
|
||||
list.Add(1060401, prop); // damage increase ~1_val~%
|
||||
}
|
||||
|
||||
if ((prop = Attributes.DefendChance) != 0)
|
||||
{
|
||||
list.Add(1060408, prop); // defense chance increase ~1_val~%
|
||||
}
|
||||
|
||||
if ((prop = Attributes.BonusDex) != 0)
|
||||
{
|
||||
list.Add(1060409, prop); // dexterity bonus ~1_val~
|
||||
}
|
||||
|
||||
if ((prop = Attributes.EnhancePotions) != 0)
|
||||
{
|
||||
list.Add(1060411, prop); // enhance potions ~1_val~%
|
||||
}
|
||||
|
||||
if ((prop = Attributes.CastRecovery) != 0)
|
||||
{
|
||||
list.Add(1060412, prop); // faster cast recovery ~1_val~
|
||||
}
|
||||
|
||||
if ((prop = Attributes.CastSpeed) != 0)
|
||||
{
|
||||
list.Add(1060413, prop); // faster casting ~1_val~
|
||||
}
|
||||
|
||||
if ((prop = Attributes.AttackChance) != 0)
|
||||
{
|
||||
list.Add(1060415, prop); // hit chance increase ~1_val~%
|
||||
}
|
||||
|
||||
if ((prop = Attributes.BonusHits) != 0)
|
||||
{
|
||||
list.Add(1060431, prop); // hit point increase ~1_val~
|
||||
}
|
||||
|
||||
if ((prop = Attributes.BonusInt) != 0)
|
||||
{
|
||||
list.Add(1060432, prop); // intelligence bonus ~1_val~
|
||||
}
|
||||
|
||||
if ((prop = Attributes.LowerManaCost) != 0)
|
||||
{
|
||||
list.Add(1060433, prop); // lower mana cost ~1_val~%
|
||||
}
|
||||
|
||||
if ((prop = Attributes.LowerRegCost) != 0)
|
||||
{
|
||||
list.Add(1060434, prop); // lower reagent cost ~1_val~%
|
||||
}
|
||||
|
||||
if ((prop = Attributes.Luck) != 0)
|
||||
{
|
||||
list.Add(1060436, prop); // luck ~1_val~
|
||||
}
|
||||
|
||||
if ((prop = Attributes.BonusMana) != 0)
|
||||
{
|
||||
list.Add(1060439, prop); // mana increase ~1_val~
|
||||
}
|
||||
|
||||
if ((prop = Attributes.RegenMana) != 0)
|
||||
{
|
||||
list.Add(1060440, prop); // mana regeneration ~1_val~
|
||||
}
|
||||
|
||||
if (Attributes.NightSight != 0)
|
||||
{
|
||||
list.Add(1060441); // night sight
|
||||
}
|
||||
|
||||
if ((prop = Attributes.ReflectPhysical) != 0)
|
||||
{
|
||||
list.Add(1060442, prop); // reflect physical damage ~1_val~%
|
||||
}
|
||||
|
||||
if ((prop = Attributes.RegenStam) != 0)
|
||||
{
|
||||
list.Add(1060443, prop); // stamina regeneration ~1_val~
|
||||
}
|
||||
|
||||
if ((prop = Attributes.RegenHits) != 0)
|
||||
{
|
||||
list.Add(1060444, prop); // hit point regeneration ~1_val~
|
||||
}
|
||||
|
||||
if (Attributes.SpellChanneling != 0)
|
||||
{
|
||||
list.Add(1060482); // spell channeling
|
||||
}
|
||||
|
||||
if ((prop = Attributes.SpellDamage) != 0)
|
||||
{
|
||||
list.Add(1060483, prop); // spell damage increase ~1_val~%
|
||||
}
|
||||
|
||||
if ((prop = Attributes.BonusStam) != 0)
|
||||
{
|
||||
list.Add(1060484, prop); // stamina increase ~1_val~
|
||||
}
|
||||
|
||||
if ((prop = Attributes.BonusStr) != 0)
|
||||
{
|
||||
list.Add(1060485, prop); // strength bonus ~1_val~
|
||||
}
|
||||
|
||||
if ((prop = Attributes.WeaponSpeed) != 0)
|
||||
{
|
||||
list.Add(1060486, prop); // swing speed increase ~1_val~%
|
||||
}
|
||||
|
||||
if (Core.ML && (prop = Attributes.IncreasedKarmaLoss) != 0)
|
||||
{
|
||||
list.Add(1075210, prop); // Increased Karma Loss ~1val~%
|
||||
}
|
||||
|
||||
AddResistanceProperties(list);
|
||||
|
||||
if (m_HitPoints >= 0 && m_MaxHitPoints > 0)
|
||||
{
|
||||
list.Add(1060639, $"{m_HitPoints}\t{m_MaxHitPoints}"); // durability ~1_val~ / ~2_val~
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize(IGenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write(3); // version
|
||||
|
||||
writer.WriteEncodedInt(m_MaxHitPoints);
|
||||
writer.WriteEncodedInt(m_HitPoints);
|
||||
|
||||
writer.WriteEncodedInt((int)m_Resource);
|
||||
writer.WriteEncodedInt((int)m_GemType);
|
||||
|
||||
Attributes.Serialize(writer);
|
||||
Resistances.Serialize(writer);
|
||||
SkillBonuses.Serialize(writer);
|
||||
}
|
||||
|
||||
public override void Deserialize(IGenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
var version = reader.ReadInt();
|
||||
|
||||
switch (version)
|
||||
{
|
||||
case 3:
|
||||
{
|
||||
m_MaxHitPoints = reader.ReadEncodedInt();
|
||||
m_HitPoints = reader.ReadEncodedInt();
|
||||
|
||||
goto case 2;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
m_Resource = (CraftResource)reader.ReadEncodedInt();
|
||||
m_GemType = (GemType)reader.ReadEncodedInt();
|
||||
|
||||
goto case 1;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
Attributes = new AosAttributes(this);
|
||||
Attributes.Deserialize(reader);
|
||||
Resistances = new AosElementAttributes(this);
|
||||
Resistances.Deserialize(reader);
|
||||
SkillBonuses = new AosSkillBonuses(this);
|
||||
SkillBonuses.Deserialize(reader);
|
||||
|
||||
var m = Parent as Mobile;
|
||||
|
||||
if (Core.AOS && m != null)
|
||||
{
|
||||
SkillBonuses.AddTo(m);
|
||||
}
|
||||
|
||||
var strBonus = Attributes.BonusStr;
|
||||
var dexBonus = Attributes.BonusDex;
|
||||
var intBonus = Attributes.BonusInt;
|
||||
|
||||
if (m != null && (strBonus != 0 || dexBonus != 0 || intBonus != 0))
|
||||
{
|
||||
var modName = Serial.ToString();
|
||||
|
||||
if (strBonus != 0)
|
||||
{
|
||||
m.AddStatMod(new StatMod(StatType.Str, $"{modName}Str", strBonus, TimeSpan.Zero));
|
||||
}
|
||||
|
||||
if (dexBonus != 0)
|
||||
{
|
||||
m.AddStatMod(new StatMod(StatType.Dex, $"{modName}Dex", dexBonus, TimeSpan.Zero));
|
||||
}
|
||||
|
||||
if (intBonus != 0)
|
||||
{
|
||||
m.AddStatMod(new StatMod(StatType.Int, $"{modName}Int", intBonus, TimeSpan.Zero));
|
||||
}
|
||||
}
|
||||
|
||||
m?.CheckStatTimers();
|
||||
|
||||
break;
|
||||
}
|
||||
case 0:
|
||||
{
|
||||
Attributes = new AosAttributes(this);
|
||||
Resistances = new AosElementAttributes(this);
|
||||
SkillBonuses = new AosSkillBonuses(this);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (version < 2)
|
||||
{
|
||||
m_Resource = CraftResource.Iron;
|
||||
m_GemType = GemType.None;
|
||||
}
|
||||
from.CheckStatTimers();
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnRemoved(IEntity parent)
|
||||
{
|
||||
if (Core.AOS && parent is Mobile from)
|
||||
{
|
||||
SkillBonuses.Remove();
|
||||
|
||||
var modName = Serial.ToString();
|
||||
|
||||
from.RemoveStatMod($"{modName}Str");
|
||||
from.RemoveStatMod($"{modName}Dex");
|
||||
from.RemoveStatMod($"{modName}Int");
|
||||
|
||||
from.CheckStatTimers();
|
||||
}
|
||||
}
|
||||
|
||||
public override void GetProperties(IPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
SkillBonuses.GetProperties(list);
|
||||
|
||||
int prop;
|
||||
|
||||
if ((prop = ArtifactRarity) > 0)
|
||||
{
|
||||
list.Add(1061078, prop); // artifact rarity ~1_val~
|
||||
}
|
||||
|
||||
if ((prop = Attributes.WeaponDamage) != 0)
|
||||
{
|
||||
list.Add(1060401, prop); // damage increase ~1_val~%
|
||||
}
|
||||
|
||||
if ((prop = Attributes.DefendChance) != 0)
|
||||
{
|
||||
list.Add(1060408, prop); // defense chance increase ~1_val~%
|
||||
}
|
||||
|
||||
if ((prop = Attributes.BonusDex) != 0)
|
||||
{
|
||||
list.Add(1060409, prop); // dexterity bonus ~1_val~
|
||||
}
|
||||
|
||||
if ((prop = Attributes.EnhancePotions) != 0)
|
||||
{
|
||||
list.Add(1060411, prop); // enhance potions ~1_val~%
|
||||
}
|
||||
|
||||
if ((prop = Attributes.CastRecovery) != 0)
|
||||
{
|
||||
list.Add(1060412, prop); // faster cast recovery ~1_val~
|
||||
}
|
||||
|
||||
if ((prop = Attributes.CastSpeed) != 0)
|
||||
{
|
||||
list.Add(1060413, prop); // faster casting ~1_val~
|
||||
}
|
||||
|
||||
if ((prop = Attributes.AttackChance) != 0)
|
||||
{
|
||||
list.Add(1060415, prop); // hit chance increase ~1_val~%
|
||||
}
|
||||
|
||||
if ((prop = Attributes.BonusHits) != 0)
|
||||
{
|
||||
list.Add(1060431, prop); // hit point increase ~1_val~
|
||||
}
|
||||
|
||||
if ((prop = Attributes.BonusInt) != 0)
|
||||
{
|
||||
list.Add(1060432, prop); // intelligence bonus ~1_val~
|
||||
}
|
||||
|
||||
if ((prop = Attributes.LowerManaCost) != 0)
|
||||
{
|
||||
list.Add(1060433, prop); // lower mana cost ~1_val~%
|
||||
}
|
||||
|
||||
if ((prop = Attributes.LowerRegCost) != 0)
|
||||
{
|
||||
list.Add(1060434, prop); // lower reagent cost ~1_val~%
|
||||
}
|
||||
|
||||
if ((prop = Attributes.Luck) != 0)
|
||||
{
|
||||
list.Add(1060436, prop); // luck ~1_val~
|
||||
}
|
||||
|
||||
if ((prop = Attributes.BonusMana) != 0)
|
||||
{
|
||||
list.Add(1060439, prop); // mana increase ~1_val~
|
||||
}
|
||||
|
||||
if ((prop = Attributes.RegenMana) != 0)
|
||||
{
|
||||
list.Add(1060440, prop); // mana regeneration ~1_val~
|
||||
}
|
||||
|
||||
if (Attributes.NightSight != 0)
|
||||
{
|
||||
list.Add(1060441); // night sight
|
||||
}
|
||||
|
||||
if ((prop = Attributes.ReflectPhysical) != 0)
|
||||
{
|
||||
list.Add(1060442, prop); // reflect physical damage ~1_val~%
|
||||
}
|
||||
|
||||
if ((prop = Attributes.RegenStam) != 0)
|
||||
{
|
||||
list.Add(1060443, prop); // stamina regeneration ~1_val~
|
||||
}
|
||||
|
||||
if ((prop = Attributes.RegenHits) != 0)
|
||||
{
|
||||
list.Add(1060444, prop); // hit point regeneration ~1_val~
|
||||
}
|
||||
|
||||
if (Attributes.SpellChanneling != 0)
|
||||
{
|
||||
list.Add(1060482); // spell channeling
|
||||
}
|
||||
|
||||
if ((prop = Attributes.SpellDamage) != 0)
|
||||
{
|
||||
list.Add(1060483, prop); // spell damage increase ~1_val~%
|
||||
}
|
||||
|
||||
if ((prop = Attributes.BonusStam) != 0)
|
||||
{
|
||||
list.Add(1060484, prop); // stamina increase ~1_val~
|
||||
}
|
||||
|
||||
if ((prop = Attributes.BonusStr) != 0)
|
||||
{
|
||||
list.Add(1060485, prop); // strength bonus ~1_val~
|
||||
}
|
||||
|
||||
if ((prop = Attributes.WeaponSpeed) != 0)
|
||||
{
|
||||
list.Add(1060486, prop); // swing speed increase ~1_val~%
|
||||
}
|
||||
|
||||
if (Core.ML && (prop = Attributes.IncreasedKarmaLoss) != 0)
|
||||
{
|
||||
list.Add(1075210, prop); // Increased Karma Loss ~1val~%
|
||||
}
|
||||
|
||||
AddResistanceProperties(list);
|
||||
|
||||
if (_hitPoints >= 0 && _maxHitPoints > 0)
|
||||
{
|
||||
list.Add(1060639, $"{_hitPoints}\t{_maxHitPoints}"); // durability ~1_val~ / ~2_val~
|
||||
}
|
||||
}
|
||||
|
||||
private void Deserialize(IGenericReader reader, int version)
|
||||
{
|
||||
_maxHitPoints = reader.ReadEncodedInt();
|
||||
_hitPoints = reader.ReadEncodedInt();
|
||||
_rawResource = (CraftResource)reader.ReadEncodedInt();
|
||||
_gemType = (GemType)reader.ReadEncodedInt();
|
||||
_attributes = new AosAttributes(this);
|
||||
_attributes.Deserialize(reader);
|
||||
_resistances = new AosElementAttributes(this);
|
||||
_resistances.Deserialize(reader);
|
||||
_skillBonuses = new AosSkillBonuses(this);
|
||||
_skillBonuses.Deserialize(reader);
|
||||
}
|
||||
|
||||
[AfterDeserialization]
|
||||
private void AfterDeserialization()
|
||||
{
|
||||
var m = Parent as Mobile;
|
||||
|
||||
if (Core.AOS && m != null)
|
||||
{
|
||||
SkillBonuses.AddTo(m);
|
||||
}
|
||||
|
||||
var strBonus = Attributes.BonusStr;
|
||||
var dexBonus = Attributes.BonusDex;
|
||||
var intBonus = Attributes.BonusInt;
|
||||
|
||||
if (m != null && (strBonus != 0 || dexBonus != 0 || intBonus != 0))
|
||||
{
|
||||
var modName = Serial.ToString();
|
||||
|
||||
if (strBonus != 0)
|
||||
{
|
||||
m.AddStatMod(new StatMod(StatType.Str, $"{modName}Str", strBonus, TimeSpan.Zero));
|
||||
}
|
||||
|
||||
if (dexBonus != 0)
|
||||
{
|
||||
m.AddStatMod(new StatMod(StatType.Dex, $"{modName}Dex", dexBonus, TimeSpan.Zero));
|
||||
}
|
||||
|
||||
if (intBonus != 0)
|
||||
{
|
||||
m.AddStatMod(new StatMod(StatType.Int, $"{modName}Int", intBonus, TimeSpan.Zero));
|
||||
}
|
||||
}
|
||||
|
||||
m?.CheckStatTimers();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,24 +1,10 @@
|
|||
namespace Server.Items
|
||||
using ModernUO.Serialization;
|
||||
|
||||
namespace Server.Items;
|
||||
|
||||
[SerializationGenerator(0, false)]
|
||||
public partial class Beads : Item
|
||||
{
|
||||
public class Beads : Item
|
||||
{
|
||||
[Constructible]
|
||||
public Beads() : base(0x108B) => Weight = 1.0;
|
||||
|
||||
public Beads(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
[Constructible]
|
||||
public Beads() : base(0x108B) => Weight = 1.0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,77 +1,27 @@
|
|||
namespace Server.Items
|
||||
using ModernUO.Serialization;
|
||||
|
||||
namespace Server.Items;
|
||||
|
||||
[SerializationGenerator(0, false)]
|
||||
public abstract partial class BaseBracelet : BaseJewel
|
||||
{
|
||||
public abstract class BaseBracelet : BaseJewel
|
||||
public BaseBracelet(int itemID) : base(itemID, Layer.Bracelet)
|
||||
{
|
||||
public BaseBracelet(int itemID) : base(itemID, Layer.Bracelet)
|
||||
{
|
||||
}
|
||||
|
||||
public BaseBracelet(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int BaseGemTypeNumber => 1044221; // star sapphire bracelet
|
||||
|
||||
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 GoldBracelet : BaseBracelet
|
||||
{
|
||||
[Constructible]
|
||||
public GoldBracelet() : base(0x1086) => Weight = 0.1;
|
||||
|
||||
public GoldBracelet(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 SilverBracelet : BaseBracelet
|
||||
{
|
||||
[Constructible]
|
||||
public SilverBracelet() : base(0x1F06) => Weight = 0.1;
|
||||
|
||||
public SilverBracelet(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 override int BaseGemTypeNumber => 1044221; // star sapphire bracelet
|
||||
}
|
||||
|
||||
[SerializationGenerator(0, false)]
|
||||
public partial class GoldBracelet : BaseBracelet
|
||||
{
|
||||
[Constructible]
|
||||
public GoldBracelet() : base(0x1086) => Weight = 0.1;
|
||||
}
|
||||
|
||||
[SerializationGenerator(0, false)]
|
||||
public partial class SilverBracelet : BaseBracelet
|
||||
{
|
||||
[Constructible]
|
||||
public SilverBracelet() : base(0x1F06) => Weight = 0.1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,77 +1,27 @@
|
|||
namespace Server.Items
|
||||
using ModernUO.Serialization;
|
||||
|
||||
namespace Server.Items;
|
||||
|
||||
[SerializationGenerator(0, false)]
|
||||
public abstract partial class BaseEarrings : BaseJewel
|
||||
{
|
||||
public abstract class BaseEarrings : BaseJewel
|
||||
public BaseEarrings(int itemID) : base(itemID, Layer.Earrings)
|
||||
{
|
||||
public BaseEarrings(int itemID) : base(itemID, Layer.Earrings)
|
||||
{
|
||||
}
|
||||
|
||||
public BaseEarrings(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int BaseGemTypeNumber => 1044203; // star sapphire earrings
|
||||
|
||||
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 GoldEarrings : BaseEarrings
|
||||
{
|
||||
[Constructible]
|
||||
public GoldEarrings() : base(0x1087) => Weight = 0.1;
|
||||
|
||||
public GoldEarrings(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 SilverEarrings : BaseEarrings
|
||||
{
|
||||
[Constructible]
|
||||
public SilverEarrings() : base(0x1F07) => Weight = 0.1;
|
||||
|
||||
public SilverEarrings(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 override int BaseGemTypeNumber => 1044203; // star sapphire earrings
|
||||
}
|
||||
|
||||
[SerializationGenerator(0, false)]
|
||||
public partial class GoldEarrings : BaseEarrings
|
||||
{
|
||||
[Constructible]
|
||||
public GoldEarrings() : base(0x1087) => Weight = 0.1;
|
||||
}
|
||||
|
||||
[SerializationGenerator(0, false)]
|
||||
public partial class SilverEarrings : BaseEarrings
|
||||
{
|
||||
[Constructible]
|
||||
public SilverEarrings() : base(0x1F07) => Weight = 0.1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,149 +1,48 @@
|
|||
namespace Server.Items
|
||||
using ModernUO.Serialization;
|
||||
|
||||
namespace Server.Items;
|
||||
|
||||
[SerializationGenerator(0, false)]
|
||||
public abstract partial class BaseNecklace : BaseJewel
|
||||
{
|
||||
public abstract class BaseNecklace : BaseJewel
|
||||
public BaseNecklace(int itemID) : base(itemID, Layer.Neck)
|
||||
{
|
||||
public BaseNecklace(int itemID) : base(itemID, Layer.Neck)
|
||||
{
|
||||
}
|
||||
|
||||
public BaseNecklace(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int BaseGemTypeNumber => 1044241; // star sapphire necklace
|
||||
|
||||
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 Necklace : BaseNecklace
|
||||
{
|
||||
[Constructible]
|
||||
public Necklace() : base(0x1085) => Weight = 0.1;
|
||||
|
||||
public Necklace(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 GoldNecklace : BaseNecklace
|
||||
{
|
||||
[Constructible]
|
||||
public GoldNecklace() : base(0x1088) => Weight = 0.1;
|
||||
|
||||
public GoldNecklace(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 GoldBeadNecklace : BaseNecklace
|
||||
{
|
||||
[Constructible]
|
||||
public GoldBeadNecklace() : base(0x1089) => Weight = 0.1;
|
||||
|
||||
public GoldBeadNecklace(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 SilverNecklace : BaseNecklace
|
||||
{
|
||||
[Constructible]
|
||||
public SilverNecklace() : base(0x1F08) => Weight = 0.1;
|
||||
|
||||
public SilverNecklace(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 SilverBeadNecklace : BaseNecklace
|
||||
{
|
||||
[Constructible]
|
||||
public SilverBeadNecklace() : base(0x1F05) => Weight = 0.1;
|
||||
|
||||
public SilverBeadNecklace(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 override int BaseGemTypeNumber => 1044241; // star sapphire necklace
|
||||
}
|
||||
|
||||
[SerializationGenerator(0, false)]
|
||||
public partial class Necklace : BaseNecklace
|
||||
{
|
||||
[Constructible]
|
||||
public Necklace() : base(0x1085) => Weight = 0.1;
|
||||
}
|
||||
|
||||
[SerializationGenerator(0, false)]
|
||||
public partial class GoldNecklace : BaseNecklace
|
||||
{
|
||||
[Constructible]
|
||||
public GoldNecklace() : base(0x1088) => Weight = 0.1;
|
||||
}
|
||||
|
||||
[SerializationGenerator(0, false)]
|
||||
public partial class GoldBeadNecklace : BaseNecklace
|
||||
{
|
||||
[Constructible]
|
||||
public GoldBeadNecklace() : base(0x1089) => Weight = 0.1;
|
||||
}
|
||||
|
||||
[SerializationGenerator(0, false)]
|
||||
public partial class SilverNecklace : BaseNecklace
|
||||
{
|
||||
[Constructible]
|
||||
public SilverNecklace() : base(0x1F08) => Weight = 0.1;
|
||||
}
|
||||
|
||||
[SerializationGenerator(0, false)]
|
||||
public partial class SilverBeadNecklace : BaseNecklace
|
||||
{
|
||||
[Constructible]
|
||||
public SilverBeadNecklace() : base(0x1F05) => Weight = 0.1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,77 +1,27 @@
|
|||
namespace Server.Items
|
||||
using ModernUO.Serialization;
|
||||
|
||||
namespace Server.Items;
|
||||
|
||||
[SerializationGenerator(0, false)]
|
||||
public abstract partial class BaseRing : BaseJewel
|
||||
{
|
||||
public abstract class BaseRing : BaseJewel
|
||||
public BaseRing(int itemID) : base(itemID, Layer.Ring)
|
||||
{
|
||||
public BaseRing(int itemID) : base(itemID, Layer.Ring)
|
||||
{
|
||||
}
|
||||
|
||||
public BaseRing(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int BaseGemTypeNumber => 1044176; // star sapphire ring
|
||||
|
||||
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 GoldRing : BaseRing
|
||||
{
|
||||
[Constructible]
|
||||
public GoldRing() : base(0x108a) => Weight = 0.1;
|
||||
|
||||
public GoldRing(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 SilverRing : BaseRing
|
||||
{
|
||||
[Constructible]
|
||||
public SilverRing() : base(0x1F09) => Weight = 0.1;
|
||||
|
||||
public SilverRing(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 override int BaseGemTypeNumber => 1044176; // star sapphire ring
|
||||
}
|
||||
|
||||
[SerializationGenerator(0, false)]
|
||||
public partial class GoldRing : BaseRing
|
||||
{
|
||||
[Constructible]
|
||||
public GoldRing() : base(0x108a) => Weight = 0.1;
|
||||
}
|
||||
|
||||
[SerializationGenerator(0, false)]
|
||||
public partial class SilverRing : BaseRing
|
||||
{
|
||||
[Constructible]
|
||||
public SilverRing() : base(0x1F09) => Weight = 0.1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"version": 0,
|
||||
"type": "Server.Items.BaseBracelet"
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"version": 0,
|
||||
"type": "Server.Items.BaseEarrings"
|
||||
}
|
||||
56
Projects/UOContent/Migrations/Server.Items.BaseJewel.v4.json
Normal file
56
Projects/UOContent/Migrations/Server.Items.BaseJewel.v4.json
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
{
|
||||
"version": 4,
|
||||
"type": "Server.Items.BaseJewel",
|
||||
"properties": [
|
||||
{
|
||||
"name": "MaxHitPoints",
|
||||
"type": "int",
|
||||
"rule": "PrimitiveTypeMigrationRule",
|
||||
"ruleArguments": [
|
||||
"EncodedInt"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "HitPoints",
|
||||
"type": "int",
|
||||
"rule": "PrimitiveTypeMigrationRule",
|
||||
"ruleArguments": [
|
||||
"EncodedInt"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "RawResource",
|
||||
"type": "Server.Items.CraftResource",
|
||||
"rule": "EnumMigrationRule"
|
||||
},
|
||||
{
|
||||
"name": "GemType",
|
||||
"type": "Server.Items.GemType",
|
||||
"rule": "EnumMigrationRule"
|
||||
},
|
||||
{
|
||||
"name": "Attributes",
|
||||
"type": "Server.AosAttributes",
|
||||
"rule": "RawSerializableMigrationRule",
|
||||
"ruleArguments": [
|
||||
"DeserializationRequiresParent"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Resistances",
|
||||
"type": "Server.AosElementAttributes",
|
||||
"rule": "RawSerializableMigrationRule",
|
||||
"ruleArguments": [
|
||||
"DeserializationRequiresParent"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "SkillBonuses",
|
||||
"type": "Server.AosSkillBonuses",
|
||||
"rule": "RawSerializableMigrationRule",
|
||||
"ruleArguments": [
|
||||
"DeserializationRequiresParent"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"version": 0,
|
||||
"type": "Server.Items.BaseNecklace"
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"version": 0,
|
||||
"type": "Server.Items.BaseRing"
|
||||
}
|
||||
4
Projects/UOContent/Migrations/Server.Items.Beads.v0.json
Normal file
4
Projects/UOContent/Migrations/Server.Items.Beads.v0.json
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"version": 0,
|
||||
"type": "Server.Items.Beads"
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"version": 0,
|
||||
"type": "Server.Items.BraceletOfHealth"
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"version": 0,
|
||||
"type": "Server.Items.EssenceOfBattle"
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"version": 0,
|
||||
"type": "Server.Items.GoldBeadNecklace"
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"version": 0,
|
||||
"type": "Server.Items.GoldBracelet"
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"version": 0,
|
||||
"type": "Server.Items.GoldEarrings"
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"version": 0,
|
||||
"type": "Server.Items.GoldNecklace"
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"version": 0,
|
||||
"type": "Server.Items.GoldRing"
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"version": 0,
|
||||
"type": "Server.Items.GuildDeed"
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"version": 0,
|
||||
"type": "Server.Items.GuildTeleporter",
|
||||
"properties": [
|
||||
{
|
||||
"name": "Stone",
|
||||
"type": "Server.Item",
|
||||
"rule": "SerializableInterfaceMigrationRule"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
"version": 4,
|
||||
"type": "Server.Items.Guildstone",
|
||||
"properties": [
|
||||
{
|
||||
"name": "GuildName",
|
||||
"type": "string",
|
||||
"rule": "PrimitiveTypeMigrationRule",
|
||||
"ruleArguments": [
|
||||
""
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "GuildAbbrev",
|
||||
"type": "string",
|
||||
"rule": "PrimitiveTypeMigrationRule",
|
||||
"ruleArguments": [
|
||||
""
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Guild",
|
||||
"type": "Server.Guilds.Guild",
|
||||
"rule": "SerializableInterfaceMigrationRule"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
"version": 0,
|
||||
"type": "Server.Items.GuildstoneDeed",
|
||||
"properties": [
|
||||
{
|
||||
"name": "GuildName",
|
||||
"type": "string",
|
||||
"rule": "PrimitiveTypeMigrationRule",
|
||||
"ruleArguments": [
|
||||
""
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "GuildAbbrev",
|
||||
"type": "string",
|
||||
"rule": "PrimitiveTypeMigrationRule",
|
||||
"ruleArguments": [
|
||||
""
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Guild",
|
||||
"type": "Server.Guilds.Guild",
|
||||
"rule": "SerializableInterfaceMigrationRule"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"version": 0,
|
||||
"type": "Server.Items.Necklace"
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"version": 0,
|
||||
"type": "Server.Items.OrnamentOfTheMagician"
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"version": 0,
|
||||
"type": "Server.Items.PendantOfTheMagi"
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"version": 0,
|
||||
"type": "Server.Items.ResilientBracer"
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"version": 0,
|
||||
"type": "Server.Items.RingOfTheElements"
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"version": 0,
|
||||
"type": "Server.Items.RingOfTheVile"
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"version": 0,
|
||||
"type": "Server.Items.SilverBeadNecklace"
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"version": 0,
|
||||
"type": "Server.Items.SilverBracelet"
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"version": 0,
|
||||
"type": "Server.Items.SilverEarrings"
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"version": 0,
|
||||
"type": "Server.Items.SilverNecklace"
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"version": 0,
|
||||
"type": "Server.Items.SilverRing"
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue