fix: Codegens spell items (#1765)
### Summary - Fixes some serialization issues with spell items - Fixes accessibility issues with field spells and removes the awkward "InternalItem" concept - Codegens the fields/items used in spells
This commit is contained in:
parent
542b672d9d
commit
8efa90b3ce
25 changed files with 1389 additions and 1507 deletions
|
|
@ -1,60 +1,40 @@
|
|||
using System;
|
||||
using ModernUO.Serialization;
|
||||
|
||||
namespace Server.Items
|
||||
namespace Server.Items;
|
||||
|
||||
[SerializationGenerator(0, false)]
|
||||
public partial class ArcaneFocus : TransientItem
|
||||
{
|
||||
public class ArcaneFocus : TransientItem
|
||||
[SerializableField(0)]
|
||||
[SerializedCommandProperty(AccessLevel.GameMaster)]
|
||||
private int _strengthBonus;
|
||||
|
||||
[Constructible]
|
||||
public ArcaneFocus() : this(TimeSpan.FromHours(1), 1)
|
||||
{
|
||||
[Constructible]
|
||||
public ArcaneFocus()
|
||||
: this(TimeSpan.FromHours(1), 1)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
[Constructible]
|
||||
public ArcaneFocus(int lifeSpan, int strengthBonus)
|
||||
: this(TimeSpan.FromSeconds(lifeSpan), strengthBonus)
|
||||
{
|
||||
}
|
||||
[Constructible]
|
||||
public ArcaneFocus(int lifeSpan, int strengthBonus) : this(TimeSpan.FromSeconds(lifeSpan), strengthBonus)
|
||||
{
|
||||
}
|
||||
|
||||
public ArcaneFocus(TimeSpan lifeSpan, int strengthBonus) : base(0x3155, lifeSpan)
|
||||
{
|
||||
LootType = LootType.Blessed;
|
||||
StrengthBonus = strengthBonus;
|
||||
}
|
||||
public ArcaneFocus(TimeSpan lifeSpan, int strengthBonus) : base(0x3155, lifeSpan)
|
||||
{
|
||||
LootType = LootType.Blessed;
|
||||
_strengthBonus = strengthBonus;
|
||||
}
|
||||
|
||||
public ArcaneFocus(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
public override int LabelNumber => 1032629; // Arcane Focus
|
||||
|
||||
public override int LabelNumber => 1032629; // Arcane Focus
|
||||
public override TextDefinition InvalidTransferMessage => 1073480; // Your arcane focus disappears.
|
||||
public override bool Nontransferable => true;
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int StrengthBonus { get; set; }
|
||||
public override void GetProperties(IPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
public override TextDefinition InvalidTransferMessage { get; } = 1073480; // Your arcane focus disappears.
|
||||
public override bool Nontransferable => true;
|
||||
|
||||
public override void GetProperties(IPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
list.Add(1060485, StrengthBonus); // strength bonus ~1_val~
|
||||
}
|
||||
|
||||
public override void Serialize(IGenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(0);
|
||||
|
||||
writer.Write(StrengthBonus);
|
||||
}
|
||||
|
||||
public override void Deserialize(IGenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
var version = reader.ReadInt();
|
||||
|
||||
StrengthBonus = reader.ReadInt();
|
||||
}
|
||||
list.Add(1060485, _strengthBonus); // strength bonus ~1_val~
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue