fix: Codgens more addons (#685)
* Fixes after deserialization not executing for older versions of an object * Codegens more addons
This commit is contained in:
parent
25fa9b397b
commit
4c265562bb
255 changed files with 1514 additions and 3742 deletions
|
|
@ -2,16 +2,13 @@ using System;
|
|||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class RejuvinationAddonComponent : AddonComponent
|
||||
[Serializable(0, false)]
|
||||
public partial class RejuvinationAddonComponent : AddonComponent
|
||||
{
|
||||
public RejuvinationAddonComponent(int itemID) : base(itemID)
|
||||
{
|
||||
}
|
||||
|
||||
public RejuvinationAddonComponent(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (from.BeginAction<RejuvinationAddonComponent>())
|
||||
|
|
@ -20,19 +17,17 @@ namespace Server.Items
|
|||
|
||||
var random = Utility.Random(1, 4);
|
||||
|
||||
if (random == 1 || random == 4)
|
||||
if (random is 1 or 4)
|
||||
{
|
||||
from.Hits = from.HitsMax;
|
||||
SendLocalizedMessageTo(from, 500801); // A sense of warmth fills your body!
|
||||
}
|
||||
|
||||
if (random == 2 || random == 4)
|
||||
else if (random is 2 or 4)
|
||||
{
|
||||
from.Mana = from.ManaMax;
|
||||
SendLocalizedMessageTo(from, 500802); // A feeling of power surges through your veins!
|
||||
}
|
||||
|
||||
if (random == 3 || random == 4)
|
||||
else if (random is 3 or 4)
|
||||
{
|
||||
from.Stam = from.StamMax;
|
||||
SendLocalizedMessageTo(from, 500803); // You feel as though you've slept for days!
|
||||
|
|
@ -54,23 +49,10 @@ namespace Server.Items
|
|||
SendLocalizedMessageTo(from, 500807); // You feel completely rejuvinated!
|
||||
}
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
public abstract class BaseRejuvinationAnkh : BaseAddon
|
||||
[Serializable(0, false)]
|
||||
public abstract partial class BaseRejuvinationAnkh : BaseAddon
|
||||
{
|
||||
private DateTime m_NextMessage;
|
||||
|
||||
|
|
@ -78,46 +60,27 @@ namespace Server.Items
|
|||
{
|
||||
}
|
||||
|
||||
public BaseRejuvinationAnkh(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override bool HandlesOnMovement => true;
|
||||
|
||||
public override void OnMovement(Mobile m, Point3D oldLocation)
|
||||
{
|
||||
base.OnMovement(m, oldLocation);
|
||||
|
||||
if (m.Player && Utility.InRange(Location, m.Location, 3) && !Utility.InRange(Location, oldLocation, 3))
|
||||
if (m.Player && Utility.InRange(Location, m.Location, 3) &&
|
||||
!Utility.InRange(Location, oldLocation, 3) && Core.Now >= m_NextMessage)
|
||||
{
|
||||
if (Core.Now >= m_NextMessage)
|
||||
if (Components.Count > 0)
|
||||
{
|
||||
if (Components.Count > 0)
|
||||
{
|
||||
Components[0].SendLocalizedMessageTo(m, 1010061); // An overwhelming sense of peace fills you.
|
||||
}
|
||||
|
||||
m_NextMessage = Core.Now + TimeSpan.FromSeconds(25.0);
|
||||
Components[0].SendLocalizedMessageTo(m, 1010061); // An overwhelming sense of peace fills you.
|
||||
}
|
||||
|
||||
m_NextMessage = Core.Now + TimeSpan.FromSeconds(25.0);
|
||||
}
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
public class RejuvinationAnkhWest : BaseRejuvinationAnkh
|
||||
[Serializable(0, false)]
|
||||
public partial class RejuvinationAnkhWest : BaseRejuvinationAnkh
|
||||
{
|
||||
[Constructible]
|
||||
public RejuvinationAnkhWest()
|
||||
|
|
@ -125,27 +88,10 @@ namespace Server.Items
|
|||
AddComponent(new RejuvinationAddonComponent(0x3), 0, 0, 0);
|
||||
AddComponent(new RejuvinationAddonComponent(0x2), 0, 1, 0);
|
||||
}
|
||||
|
||||
public RejuvinationAnkhWest(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();
|
||||
}
|
||||
}
|
||||
|
||||
public class RejuvinationAnkhNorth : BaseRejuvinationAnkh
|
||||
[Serializable(0, false)]
|
||||
public partial class RejuvinationAnkhNorth : BaseRejuvinationAnkh
|
||||
{
|
||||
[Constructible]
|
||||
public RejuvinationAnkhNorth()
|
||||
|
|
@ -153,23 +99,5 @@ namespace Server.Items
|
|||
AddComponent(new RejuvinationAddonComponent(0x4), 0, 0, 0);
|
||||
AddComponent(new RejuvinationAddonComponent(0x5), 1, 0, 0);
|
||||
}
|
||||
|
||||
public RejuvinationAnkhNorth(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue