fix: Finishes code gen for misc items (#1248)
This commit is contained in:
parent
6d00b2caa9
commit
5660f4636e
43 changed files with 2797 additions and 3156 deletions
|
|
@ -155,5 +155,22 @@ public static class TextDefinitionExtensions
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void PublicOverheadMessage(this TextDefinition def, Item item, MessageType messageType, int hue)
|
||||||
|
{
|
||||||
|
if (def == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (def.Number > 0)
|
||||||
|
{
|
||||||
|
item.PublicOverheadMessage(messageType, hue, def.Number);
|
||||||
|
}
|
||||||
|
else if (def.String != null)
|
||||||
|
{
|
||||||
|
item.PublicOverheadMessage(messageType, hue, false, def.String);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static bool IsNullOrEmpty(this TextDefinition def) => def?.IsEmpty != false;
|
public static bool IsNullOrEmpty(this TextDefinition def) => def?.IsEmpty != false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -261,8 +261,8 @@ namespace Server.Commands
|
||||||
|
|
||||||
var hi = new HintItem(m_ItemID, range, messageNumber, hintNumber);
|
var hi = new HintItem(m_ItemID, range, messageNumber, hintNumber);
|
||||||
|
|
||||||
hi.WarningString = messageString;
|
hi.WarningMessage = messageString;
|
||||||
hi.HintString = hintString;
|
hi.HintMessage = hintString;
|
||||||
hi.ResetDelay = resetDelay;
|
hi.ResetDelay = resetDelay;
|
||||||
|
|
||||||
item = hi;
|
item = hi;
|
||||||
|
|
@ -316,7 +316,7 @@ namespace Server.Commands
|
||||||
|
|
||||||
var wi = new WarningItem(m_ItemID, range, messageNumber);
|
var wi = new WarningItem(m_ItemID, range, messageNumber);
|
||||||
|
|
||||||
wi.WarningString = messageString;
|
wi.WarningMessage = messageString;
|
||||||
wi.ResetDelay = resetDelay;
|
wi.ResetDelay = resetDelay;
|
||||||
|
|
||||||
item = wi;
|
item = wi;
|
||||||
|
|
@ -687,7 +687,7 @@ namespace Server.Commands
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
st.MessageString = m_Params[i][++indexOf..];
|
st.Message = m_Params[i][++indexOf..];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWithOrdinal("MessageNumber"))
|
else if (m_Params[i].StartsWithOrdinal("MessageNumber"))
|
||||||
|
|
@ -696,7 +696,7 @@ namespace Server.Commands
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
st.MessageNumber = Utility.ToInt32(m_Params[i].AsSpan()[++indexOf..]);
|
st.Message = Utility.ToInt32(m_Params[i].AsSpan()[++indexOf..]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWithOrdinal("PointDest"))
|
else if (m_Params[i].StartsWithOrdinal("PointDest"))
|
||||||
|
|
|
||||||
|
|
@ -257,8 +257,8 @@ namespace Server.Commands
|
||||||
|
|
||||||
var hi = new HintItem(m_ItemID, range, messageNumber, hintNumber);
|
var hi = new HintItem(m_ItemID, range, messageNumber, hintNumber);
|
||||||
|
|
||||||
hi.WarningString = messageString;
|
hi.WarningMessage = messageString;
|
||||||
hi.HintString = hintString;
|
hi.HintMessage = hintString;
|
||||||
hi.ResetDelay = resetDelay;
|
hi.ResetDelay = resetDelay;
|
||||||
|
|
||||||
item = hi;
|
item = hi;
|
||||||
|
|
@ -312,7 +312,7 @@ namespace Server.Commands
|
||||||
|
|
||||||
var wi = new WarningItem(m_ItemID, range, messageNumber);
|
var wi = new WarningItem(m_ItemID, range, messageNumber);
|
||||||
|
|
||||||
wi.WarningString = messageString;
|
wi.WarningMessage = messageString;
|
||||||
wi.ResetDelay = resetDelay;
|
wi.ResetDelay = resetDelay;
|
||||||
|
|
||||||
item = wi;
|
item = wi;
|
||||||
|
|
@ -683,7 +683,7 @@ namespace Server.Commands
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
st.MessageString = m_Params[i][++indexOf..];
|
st.Message = m_Params[i][++indexOf..];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWithOrdinal("MessageNumber"))
|
else if (m_Params[i].StartsWithOrdinal("MessageNumber"))
|
||||||
|
|
@ -692,7 +692,7 @@ namespace Server.Commands
|
||||||
|
|
||||||
if (indexOf >= 0)
|
if (indexOf >= 0)
|
||||||
{
|
{
|
||||||
st.MessageNumber = Utility.ToInt32(m_Params[i].AsSpan()[++indexOf..]);
|
st.Message = Utility.ToInt32(m_Params[i].AsSpan()[++indexOf..]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m_Params[i].StartsWithOrdinal("PointDest"))
|
else if (m_Params[i].StartsWithOrdinal("PointDest"))
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,86 +1,63 @@
|
||||||
|
using ModernUO.Serialization;
|
||||||
using Server.Targeting;
|
using Server.Targeting;
|
||||||
|
|
||||||
namespace Server.Items
|
namespace Server.Items;
|
||||||
|
|
||||||
|
[SerializationGenerator(0, false)]
|
||||||
|
public partial class Scales : Item
|
||||||
{
|
{
|
||||||
public class Scales : Item
|
[Constructible]
|
||||||
|
public Scales() : base(0x1852) => Weight = 4.0;
|
||||||
|
|
||||||
|
public override void OnDoubleClick(Mobile from)
|
||||||
{
|
{
|
||||||
[Constructible]
|
from.SendLocalizedMessage(502431); // What would you like to weigh?
|
||||||
public Scales() : base(0x1852) => Weight = 4.0;
|
from.Target = new InternalTarget(this);
|
||||||
|
}
|
||||||
|
|
||||||
public Scales(Serial serial) : base(serial)
|
private class InternalTarget : Target
|
||||||
|
{
|
||||||
|
private Scales _scales;
|
||||||
|
|
||||||
|
public InternalTarget(Scales item) : base(1, false, TargetFlags.None) => _scales = item;
|
||||||
|
|
||||||
|
protected override void OnTarget(Mobile from, object targeted)
|
||||||
{
|
{
|
||||||
}
|
if (targeted == _scales)
|
||||||
|
|
||||||
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 void OnDoubleClick(Mobile from)
|
|
||||||
{
|
|
||||||
from.SendLocalizedMessage(502431); // What would you like to weigh?
|
|
||||||
from.Target = new InternalTarget(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
private class InternalTarget : Target
|
|
||||||
{
|
|
||||||
private readonly Scales m_Item;
|
|
||||||
|
|
||||||
public InternalTarget(Scales item) : base(1, false, TargetFlags.None) => m_Item = item;
|
|
||||||
|
|
||||||
protected override void OnTarget(Mobile from, object targeted)
|
|
||||||
{
|
{
|
||||||
string message;
|
from.SendMessage("It cannot weigh itself.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (targeted == m_Item)
|
if (targeted is Mobile m)
|
||||||
{
|
{
|
||||||
message = "It cannot weight itself.";
|
from.SendLocalizedMessage(502432); // That is too heavy for these scales!
|
||||||
}
|
}
|
||||||
else if (targeted is Item item)
|
|
||||||
{
|
|
||||||
var root = item.RootParent;
|
|
||||||
|
|
||||||
if (root != null && root != from || item.Parent == from)
|
if (targeted is not Item { Movable: true } item)
|
||||||
{
|
{
|
||||||
message = "You decide that item's current location is too awkward to get an accurate result.";
|
from.SendMessage("You cannot weigh that.");
|
||||||
}
|
return;
|
||||||
else if (item.Movable)
|
}
|
||||||
{
|
|
||||||
message = item.Amount > 1
|
|
||||||
? "You place one item on the scale. "
|
|
||||||
: "You place that item on the scale. ";
|
|
||||||
|
|
||||||
var weight = item.Weight;
|
var root = item.RootParent;
|
||||||
|
|
||||||
if (weight <= 0.0)
|
if (root != null && root != from || item.Parent == from)
|
||||||
{
|
{
|
||||||
message += "It is lighter than a feather.";
|
from.SendMessage("You decide that item's current location is too awkward to get an accurate result.");
|
||||||
}
|
return;
|
||||||
else
|
}
|
||||||
{
|
|
||||||
message += $"It weighs {weight} stones.";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
message = "You cannot weigh that object.";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
message = "You cannot weigh that object.";
|
|
||||||
}
|
|
||||||
|
|
||||||
from.SendMessage(message);
|
var amount = item.Amount > 1 ? "one" : "that";
|
||||||
|
var weight = item.Weight;
|
||||||
|
|
||||||
|
if (weight <= 0.0)
|
||||||
|
{
|
||||||
|
from.SendMessage($"You place {amount} item on the scale. It is lighter than a feather.");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
from.SendMessage($"You place {amount} item on the scale. It weighs {weight} stones.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,107 +1,81 @@
|
||||||
|
using ModernUO.Serialization;
|
||||||
using Server.Multis;
|
using Server.Multis;
|
||||||
|
|
||||||
namespace Server.Items
|
namespace Server.Items;
|
||||||
|
|
||||||
|
[SerializationGenerator(0)]
|
||||||
|
public partial class SerpentPillar : Item
|
||||||
{
|
{
|
||||||
public class SerpentPillar : Item
|
[SerializableField(0)]
|
||||||
|
[SerializableFieldAttr("[CommandProperty(AccessLevel.GameMaster)]")]
|
||||||
|
private bool _active;
|
||||||
|
|
||||||
|
[SerializableField(1)]
|
||||||
|
[SerializableFieldAttr("[CommandProperty(AccessLevel.GameMaster)]")]
|
||||||
|
private string _word;
|
||||||
|
|
||||||
|
[SerializableField(2)]
|
||||||
|
[SerializableFieldAttr("[CommandProperty(AccessLevel.GameMaster)]")]
|
||||||
|
private Rectangle2D _destination;
|
||||||
|
|
||||||
|
[Constructible]
|
||||||
|
public SerpentPillar() : this(null, new Rectangle2D(), false)
|
||||||
{
|
{
|
||||||
[Constructible]
|
}
|
||||||
public SerpentPillar() : this(null, new Rectangle2D(), false)
|
|
||||||
|
public SerpentPillar(string word, Rectangle2D destination, bool active = true) : base(0x233F)
|
||||||
|
{
|
||||||
|
Movable = false;
|
||||||
|
_active = active;
|
||||||
|
_word = word;
|
||||||
|
_destination = destination;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override bool HandlesOnSpeech => true;
|
||||||
|
|
||||||
|
public override void OnSpeech(SpeechEventArgs e)
|
||||||
|
{
|
||||||
|
var from = e.Mobile;
|
||||||
|
|
||||||
|
if (!e.Handled && from.InRange(this, 10) && e.Speech.ToLower() == Word)
|
||||||
{
|
{
|
||||||
}
|
var boat = BaseBoat.FindBoatAt(from.Location, from.Map);
|
||||||
|
|
||||||
public SerpentPillar(string word, Rectangle2D destination, bool active = true) : base(0x233F)
|
if (boat == null)
|
||||||
{
|
|
||||||
Movable = false;
|
|
||||||
|
|
||||||
Active = active;
|
|
||||||
Word = word;
|
|
||||||
Destination = destination;
|
|
||||||
}
|
|
||||||
|
|
||||||
public SerpentPillar(Serial serial) : base(serial)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
[CommandProperty(AccessLevel.GameMaster)]
|
|
||||||
public bool Active { get; set; }
|
|
||||||
|
|
||||||
[CommandProperty(AccessLevel.GameMaster)]
|
|
||||||
public string Word { get; set; }
|
|
||||||
|
|
||||||
[CommandProperty(AccessLevel.GameMaster)]
|
|
||||||
public Rectangle2D Destination { get; set; }
|
|
||||||
|
|
||||||
public override bool HandlesOnSpeech => true;
|
|
||||||
|
|
||||||
public override void OnSpeech(SpeechEventArgs e)
|
|
||||||
{
|
|
||||||
var from = e.Mobile;
|
|
||||||
|
|
||||||
if (!e.Handled && from.InRange(this, 10) && e.Speech.ToLower() == Word)
|
|
||||||
{
|
{
|
||||||
var boat = BaseBoat.FindBoatAt(from.Location, from.Map);
|
return;
|
||||||
|
|
||||||
if (boat == null)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!Active)
|
|
||||||
{
|
|
||||||
boat.TillerMan
|
|
||||||
?.Say(
|
|
||||||
502507
|
|
||||||
); // Ar, Legend has it that these pillars are inactive! No man knows how it might be undone!
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var map = from.Map;
|
|
||||||
|
|
||||||
for (var i = 0; i < 5; i++) // Try 5 times
|
|
||||||
{
|
|
||||||
var x = Utility.Random(Destination.X, Destination.Width);
|
|
||||||
var y = Utility.Random(Destination.Y, Destination.Height);
|
|
||||||
var z = map.GetAverageZ(x, y);
|
|
||||||
|
|
||||||
var dest = new Point3D(x, y, z);
|
|
||||||
|
|
||||||
if (boat.CanFit(dest, map, boat.ItemID))
|
|
||||||
{
|
|
||||||
var xOffset = x - boat.X;
|
|
||||||
var yOffset = y - boat.Y;
|
|
||||||
var zOffset = z - boat.Z;
|
|
||||||
|
|
||||||
boat.Teleport(xOffset, yOffset, zOffset);
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
boat.TillerMan?.Say(502508); // Ar, I refuse to take that matey through here!
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public override void Serialize(IGenericWriter writer)
|
if (!Active)
|
||||||
{
|
{
|
||||||
base.Serialize(writer);
|
// Ar, Legend has it that these pillars are inactive! No man knows how it might be undone!
|
||||||
|
boat.TillerMan?.Say(502507);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
writer.WriteEncodedInt(0); // version
|
var map = from.Map;
|
||||||
|
|
||||||
writer.Write(Active);
|
for (var i = 0; i < 5; i++) // Try 5 times
|
||||||
writer.Write(Word);
|
{
|
||||||
writer.Write(Destination);
|
var x = Utility.Random(Destination.X, Destination.Width);
|
||||||
}
|
var y = Utility.Random(Destination.Y, Destination.Height);
|
||||||
|
var z = map.GetAverageZ(x, y);
|
||||||
|
|
||||||
public override void Deserialize(IGenericReader reader)
|
var dest = new Point3D(x, y, z);
|
||||||
{
|
|
||||||
base.Deserialize(reader);
|
|
||||||
|
|
||||||
var version = reader.ReadEncodedInt();
|
if (boat.CanFit(dest, map, boat.ItemID))
|
||||||
|
{
|
||||||
|
var xOffset = x - boat.X;
|
||||||
|
var yOffset = y - boat.Y;
|
||||||
|
var zOffset = z - boat.Z;
|
||||||
|
|
||||||
Active = reader.ReadBool();
|
boat.Teleport(xOffset, yOffset, zOffset);
|
||||||
Word = reader.ReadString();
|
|
||||||
Destination = reader.ReadRect2D();
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
boat.TillerMan?.Say(502508); // Ar, I refuse to take that matey through here!
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,164 +1,146 @@
|
||||||
|
using System;
|
||||||
|
using ModernUO.Serialization;
|
||||||
using Server.Gumps;
|
using Server.Gumps;
|
||||||
using Server.Network;
|
using Server.Network;
|
||||||
|
|
||||||
namespace Server.Items
|
namespace Server.Items;
|
||||||
|
|
||||||
|
[SerializationGenerator(0, false)]
|
||||||
|
public partial class SpecialBeardDye : Item
|
||||||
{
|
{
|
||||||
public class SpecialBeardDye : Item
|
[Constructible]
|
||||||
|
public SpecialBeardDye() : base(0xE26)
|
||||||
{
|
{
|
||||||
[Constructible]
|
Weight = 1.0;
|
||||||
public SpecialBeardDye() : base(0xE26)
|
LootType = LootType.Newbied;
|
||||||
{
|
|
||||||
Weight = 1.0;
|
|
||||||
LootType = LootType.Newbied;
|
|
||||||
}
|
|
||||||
|
|
||||||
public SpecialBeardDye(Serial serial) : base(serial)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public override int LabelNumber => 1041087; // Special Beard Dye
|
|
||||||
|
|
||||||
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 void OnDoubleClick(Mobile from)
|
|
||||||
{
|
|
||||||
if (from.InRange(GetWorldLocation(), 1))
|
|
||||||
{
|
|
||||||
from.CloseGump<SpecialBeardDyeGump>();
|
|
||||||
from.SendGump(new SpecialBeardDyeGump(this));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
from.LocalOverheadMessage(MessageType.Regular, 906, 1019045); // I can't reach that.
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class SpecialBeardDyeGump : Gump
|
public override int LabelNumber => 1041087; // Special Beard Dye
|
||||||
|
|
||||||
|
public override void OnDoubleClick(Mobile from)
|
||||||
{
|
{
|
||||||
private static readonly SpecialBeardDyeEntry[] m_Entries =
|
if (from.InRange(GetWorldLocation(), 1))
|
||||||
{
|
{
|
||||||
new("*****", 12, 10),
|
from.CloseGump<SpecialBeardDyeGump>();
|
||||||
new("*****", 32, 5),
|
from.SendGump(new SpecialBeardDyeGump(this));
|
||||||
new("*****", 38, 8),
|
|
||||||
new("*****", 54, 3),
|
|
||||||
new("*****", 62, 10),
|
|
||||||
new("*****", 81, 2),
|
|
||||||
new("*****", 89, 2),
|
|
||||||
new("*****", 1153, 2)
|
|
||||||
};
|
|
||||||
|
|
||||||
private readonly SpecialBeardDye m_SpecialBeardDye;
|
|
||||||
|
|
||||||
public SpecialBeardDyeGump(SpecialBeardDye dye) : base(0, 0)
|
|
||||||
{
|
|
||||||
m_SpecialBeardDye = dye;
|
|
||||||
|
|
||||||
AddPage(0);
|
|
||||||
AddBackground(150, 60, 350, 358, 2600);
|
|
||||||
AddBackground(170, 104, 110, 270, 5100);
|
|
||||||
AddHtmlLocalized(230, 75, 200, 20, 1011013); // Hair Color Selection Menu
|
|
||||||
AddHtmlLocalized(235, 380, 300, 20, 1013007); // Dye my beard this color!
|
|
||||||
AddButton(200, 380, 0xFA5, 0xFA7, 1); // DYE HAIR
|
|
||||||
|
|
||||||
for (var i = 0; i < m_Entries.Length; ++i)
|
|
||||||
{
|
|
||||||
AddLabel(180, 109 + i * 22, m_Entries[i].HueStart - 1, m_Entries[i].Name);
|
|
||||||
AddButton(257, 110 + i * 22, 5224, 5224, 0, GumpButtonType.Page, i + 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (var i = 0; i < m_Entries.Length; ++i)
|
|
||||||
{
|
|
||||||
var e = m_Entries[i];
|
|
||||||
|
|
||||||
AddPage(i + 1);
|
|
||||||
|
|
||||||
for (var j = 0; j < e.HueCount; ++j)
|
|
||||||
{
|
|
||||||
AddLabel(328 + j / 16 * 80, 102 + j % 16 * 17, e.HueStart + j - 1, "*****");
|
|
||||||
AddRadio(310 + j / 16 * 80, 102 + j % 16 * 17, 210, 211, false, i * 100 + j);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
public override void OnResponse(NetState from, RelayInfo info)
|
|
||||||
{
|
{
|
||||||
if (m_SpecialBeardDye.Deleted)
|
from.LocalOverheadMessage(MessageType.Regular, 906, 1019045); // I can't reach that.
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var m = from.Mobile;
|
|
||||||
var switches = info.Switches;
|
|
||||||
|
|
||||||
if (!m_SpecialBeardDye.IsChildOf(m.Backpack))
|
|
||||||
{
|
|
||||||
m.SendLocalizedMessage(1042010); // You must have the objectin your backpack to use it.
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (info.ButtonID != 0 && switches.Length > 0)
|
|
||||||
{
|
|
||||||
if (m.FacialHairItemID == 0)
|
|
||||||
{
|
|
||||||
m.SendLocalizedMessage(502623); // You have no hair to dye and cannot use this
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// To prevent this from being exploited, the hue is abstracted into an internal list
|
|
||||||
|
|
||||||
var entryIndex = switches[0] / 100;
|
|
||||||
var hueOffset = switches[0] % 100;
|
|
||||||
|
|
||||||
if (entryIndex >= 0 && entryIndex < m_Entries.Length)
|
|
||||||
{
|
|
||||||
var e = m_Entries[entryIndex];
|
|
||||||
|
|
||||||
if (hueOffset >= 0 && hueOffset < e.HueCount)
|
|
||||||
{
|
|
||||||
var hue = e.HueStart + hueOffset;
|
|
||||||
|
|
||||||
m.FacialHairHue = hue;
|
|
||||||
|
|
||||||
m.SendLocalizedMessage(501199); // You dye your hair
|
|
||||||
m_SpecialBeardDye.Delete();
|
|
||||||
m.PlaySound(0x4E);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
m.SendLocalizedMessage(501200); // You decide not to dye your hair
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private class SpecialBeardDyeEntry
|
|
||||||
{
|
|
||||||
public SpecialBeardDyeEntry(string name, int hueStart, int hueCount)
|
|
||||||
{
|
|
||||||
Name = name;
|
|
||||||
HueStart = hueStart;
|
|
||||||
HueCount = hueCount;
|
|
||||||
}
|
|
||||||
|
|
||||||
public string Name { get; }
|
|
||||||
|
|
||||||
public int HueStart { get; }
|
|
||||||
|
|
||||||
public int HueCount { get; }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class SpecialBeardDyeGump : Gump
|
||||||
|
{
|
||||||
|
private static SpecialBeardDyeEntry[] _entries =
|
||||||
|
{
|
||||||
|
new("*****", 12, 10),
|
||||||
|
new("*****", 32, 5),
|
||||||
|
new("*****", 38, 8),
|
||||||
|
new("*****", 54, 3),
|
||||||
|
new("*****", 62, 10),
|
||||||
|
new("*****", 81, 2),
|
||||||
|
new("*****", 89, 2),
|
||||||
|
new("*****", 1153, 2)
|
||||||
|
};
|
||||||
|
|
||||||
|
private SpecialBeardDye _specialBeardDye;
|
||||||
|
|
||||||
|
public SpecialBeardDyeGump(SpecialBeardDye dye) : base(0, 0)
|
||||||
|
{
|
||||||
|
_specialBeardDye = dye;
|
||||||
|
|
||||||
|
AddPage(0);
|
||||||
|
AddBackground(150, 60, 350, 358, 2600);
|
||||||
|
AddBackground(170, 104, 110, 270, 5100);
|
||||||
|
AddHtmlLocalized(230, 75, 200, 20, 1011013); // Hair Color Selection Menu
|
||||||
|
AddHtmlLocalized(235, 380, 300, 20, 1013007); // Dye my beard this color!
|
||||||
|
AddButton(200, 380, 0xFA5, 0xFA7, 1); // DYE HAIR
|
||||||
|
|
||||||
|
for (var i = 0; i < _entries.Length; ++i)
|
||||||
|
{
|
||||||
|
AddLabel(180, 109 + i * 22, _entries[i].HueStart - 1, _entries[i].Name);
|
||||||
|
AddButton(257, 110 + i * 22, 5224, 5224, 0, GumpButtonType.Page, i + 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (var i = 0; i < _entries.Length; ++i)
|
||||||
|
{
|
||||||
|
var e = _entries[i];
|
||||||
|
|
||||||
|
AddPage(i + 1);
|
||||||
|
|
||||||
|
for (var j = 0; j < e.HueCount; ++j)
|
||||||
|
{
|
||||||
|
AddLabel(328 + j / 16 * 80, 102 + j % 16 * 17, e.HueStart + j - 1, "*****");
|
||||||
|
AddRadio(310 + j / 16 * 80, 102 + j % 16 * 17, 210, 211, false, i * 100 + j);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void OnResponse(NetState from, RelayInfo info)
|
||||||
|
{
|
||||||
|
if (_specialBeardDye.Deleted)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var m = from.Mobile;
|
||||||
|
var switches = info.Switches;
|
||||||
|
|
||||||
|
if (!_specialBeardDye.IsChildOf(m.Backpack))
|
||||||
|
{
|
||||||
|
m.SendLocalizedMessage(1042010); // You must have the object in your backpack to use it.
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (info.ButtonID != 0 && switches.Length > 0)
|
||||||
|
{
|
||||||
|
if (m.FacialHairItemID == 0)
|
||||||
|
{
|
||||||
|
m.SendLocalizedMessage(502623); // You have no hair to dye and cannot use this
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// To prevent this from being exploited, the hue is abstracted into an internal list
|
||||||
|
var entryIndex = Math.DivRem(switches[0], 100, out var hueOffset);
|
||||||
|
|
||||||
|
if (entryIndex >= 0 && entryIndex < _entries.Length)
|
||||||
|
{
|
||||||
|
var e = _entries[entryIndex];
|
||||||
|
|
||||||
|
if (hueOffset >= 0 && hueOffset < e.HueCount)
|
||||||
|
{
|
||||||
|
var hue = e.HueStart + hueOffset;
|
||||||
|
|
||||||
|
m.FacialHairHue = hue;
|
||||||
|
|
||||||
|
m.SendLocalizedMessage(501199); // You dye your hair
|
||||||
|
_specialBeardDye.Delete();
|
||||||
|
m.PlaySound(0x4E);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m.SendLocalizedMessage(501200); // You decide not to dye your hair
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private class SpecialBeardDyeEntry
|
||||||
|
{
|
||||||
|
public SpecialBeardDyeEntry(string name, int hueStart, int hueCount)
|
||||||
|
{
|
||||||
|
Name = name;
|
||||||
|
HueStart = hueStart;
|
||||||
|
HueCount = hueCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public string Name { get; }
|
||||||
|
|
||||||
|
public int HueStart { get; }
|
||||||
|
|
||||||
|
public int HueCount { get; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,165 +1,147 @@
|
||||||
|
using System;
|
||||||
|
using ModernUO.Serialization;
|
||||||
using Server.Gumps;
|
using Server.Gumps;
|
||||||
using Server.Network;
|
using Server.Network;
|
||||||
|
|
||||||
namespace Server.Items
|
namespace Server.Items;
|
||||||
|
|
||||||
|
[SerializationGenerator(0, false)]
|
||||||
|
public partial class SpecialHairDye : Item
|
||||||
{
|
{
|
||||||
public class SpecialHairDye : Item
|
[Constructible]
|
||||||
|
public SpecialHairDye() : base(0xE26)
|
||||||
{
|
{
|
||||||
[Constructible]
|
Weight = 1.0;
|
||||||
public SpecialHairDye() : base(0xE26)
|
LootType = LootType.Newbied;
|
||||||
{
|
|
||||||
Weight = 1.0;
|
|
||||||
LootType = LootType.Newbied;
|
|
||||||
}
|
|
||||||
|
|
||||||
public SpecialHairDye(Serial serial) : base(serial)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public override string DefaultName => "Special Hair Dye";
|
|
||||||
|
|
||||||
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 void OnDoubleClick(Mobile from)
|
|
||||||
{
|
|
||||||
if (from.InRange(GetWorldLocation(), 1))
|
|
||||||
{
|
|
||||||
from.CloseGump<SpecialHairDyeGump>();
|
|
||||||
from.SendGump(new SpecialHairDyeGump(this));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
from.LocalOverheadMessage(MessageType.Regular, 906, 1019045); // I can't reach that.
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class SpecialHairDyeGump : Gump
|
public override int LabelNumber => 1074402;
|
||||||
|
|
||||||
|
public override void OnDoubleClick(Mobile from)
|
||||||
{
|
{
|
||||||
private static readonly SpecialHairDyeEntry[] m_Entries =
|
if (from.InRange(GetWorldLocation(), 1))
|
||||||
{
|
{
|
||||||
new("*****", 12, 10),
|
from.CloseGump<SpecialHairDyeGump>();
|
||||||
new("*****", 32, 5),
|
from.SendGump(new SpecialHairDyeGump(this));
|
||||||
new("*****", 38, 8),
|
|
||||||
new("*****", 54, 3),
|
|
||||||
new("*****", 62, 10),
|
|
||||||
new("*****", 81, 2),
|
|
||||||
new("*****", 89, 2),
|
|
||||||
new("*****", 1153, 2)
|
|
||||||
};
|
|
||||||
|
|
||||||
private readonly SpecialHairDye m_SpecialHairDye;
|
|
||||||
|
|
||||||
public SpecialHairDyeGump(SpecialHairDye dye) : base(0, 0)
|
|
||||||
{
|
|
||||||
m_SpecialHairDye = dye;
|
|
||||||
|
|
||||||
AddPage(0);
|
|
||||||
AddBackground(150, 60, 350, 358, 2600);
|
|
||||||
AddBackground(170, 104, 110, 270, 5100);
|
|
||||||
AddHtmlLocalized(230, 75, 200, 20, 1011013); // Hair Color Selection Menu
|
|
||||||
AddHtmlLocalized(235, 380, 300, 20, 1011014); // Dye my hair this color!
|
|
||||||
AddButton(200, 380, 0xFA5, 0xFA7, 1); // DYE HAIR
|
|
||||||
|
|
||||||
for (var i = 0; i < m_Entries.Length; ++i)
|
|
||||||
{
|
|
||||||
AddLabel(180, 109 + i * 22, m_Entries[i].HueStart - 1, m_Entries[i].Name);
|
|
||||||
AddButton(257, 110 + i * 22, 5224, 5224, 0, GumpButtonType.Page, i + 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (var i = 0; i < m_Entries.Length; ++i)
|
|
||||||
{
|
|
||||||
var e = m_Entries[i];
|
|
||||||
|
|
||||||
AddPage(i + 1);
|
|
||||||
|
|
||||||
for (var j = 0; j < e.HueCount; ++j)
|
|
||||||
{
|
|
||||||
AddLabel(328 + j / 16 * 80, 102 + j % 16 * 17, e.HueStart + j - 1, "*****");
|
|
||||||
AddRadio(310 + j / 16 * 80, 102 + j % 16 * 17, 210, 211, false, i * 100 + j);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
public override void OnResponse(NetState from, RelayInfo info)
|
|
||||||
{
|
{
|
||||||
if (m_SpecialHairDye.Deleted)
|
from.LocalOverheadMessage(MessageType.Regular, 906, 1019045); // I can't reach that.
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var m = from.Mobile;
|
|
||||||
var switches = info.Switches;
|
|
||||||
|
|
||||||
if (!m_SpecialHairDye.IsChildOf(m.Backpack))
|
|
||||||
{
|
|
||||||
m.SendLocalizedMessage(1042010); // You must have the objectin your backpack to use it.
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (info.ButtonID != 0 && switches.Length > 0)
|
|
||||||
{
|
|
||||||
if (m.HairItemID == 0)
|
|
||||||
{
|
|
||||||
m.SendLocalizedMessage(502623); // You have no hair to dye and cannot use this
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// To prevent this from being exploited, the hue is abstracted into an internal list
|
|
||||||
|
|
||||||
var entryIndex = switches[0] / 100;
|
|
||||||
var hueOffset = switches[0] % 100;
|
|
||||||
|
|
||||||
if (entryIndex >= 0 && entryIndex < m_Entries.Length)
|
|
||||||
{
|
|
||||||
var e = m_Entries[entryIndex];
|
|
||||||
|
|
||||||
if (hueOffset >= 0 && hueOffset < e.HueCount)
|
|
||||||
{
|
|
||||||
m_SpecialHairDye.Delete();
|
|
||||||
|
|
||||||
var hue = e.HueStart + hueOffset;
|
|
||||||
|
|
||||||
m.HairHue = hue;
|
|
||||||
|
|
||||||
m.SendLocalizedMessage(501199); // You dye your hair
|
|
||||||
m.PlaySound(0x4E);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
m.SendLocalizedMessage(501200); // You decide not to dye your hair
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private class SpecialHairDyeEntry
|
|
||||||
{
|
|
||||||
public SpecialHairDyeEntry(string name, int hueStart, int hueCount)
|
|
||||||
{
|
|
||||||
Name = name;
|
|
||||||
HueStart = hueStart;
|
|
||||||
HueCount = hueCount;
|
|
||||||
}
|
|
||||||
|
|
||||||
public string Name { get; }
|
|
||||||
|
|
||||||
public int HueStart { get; }
|
|
||||||
|
|
||||||
public int HueCount { get; }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class SpecialHairDyeGump : Gump
|
||||||
|
{
|
||||||
|
private static readonly SpecialHairDyeEntry[] _entries =
|
||||||
|
{
|
||||||
|
new("*****", 12, 10),
|
||||||
|
new("*****", 32, 5),
|
||||||
|
new("*****", 38, 8),
|
||||||
|
new("*****", 54, 3),
|
||||||
|
new("*****", 62, 10),
|
||||||
|
new("*****", 81, 2),
|
||||||
|
new("*****", 89, 2),
|
||||||
|
new("*****", 1153, 2)
|
||||||
|
};
|
||||||
|
|
||||||
|
private SpecialHairDye _specialHairDye;
|
||||||
|
|
||||||
|
public SpecialHairDyeGump(SpecialHairDye dye) : base(0, 0)
|
||||||
|
{
|
||||||
|
_specialHairDye = dye;
|
||||||
|
|
||||||
|
AddPage(0);
|
||||||
|
AddBackground(150, 60, 350, 358, 2600);
|
||||||
|
AddBackground(170, 104, 110, 270, 5100);
|
||||||
|
AddHtmlLocalized(230, 75, 200, 20, 1011013); // Hair Color Selection Menu
|
||||||
|
AddHtmlLocalized(235, 380, 300, 20, 1011014); // Dye my hair this color!
|
||||||
|
AddButton(200, 380, 0xFA5, 0xFA7, 1); // DYE HAIR
|
||||||
|
|
||||||
|
for (var i = 0; i < _entries.Length; ++i)
|
||||||
|
{
|
||||||
|
AddLabel(180, 109 + i * 22, _entries[i].HueStart - 1, _entries[i].Name);
|
||||||
|
AddButton(257, 110 + i * 22, 5224, 5224, 0, GumpButtonType.Page, i + 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (var i = 0; i < _entries.Length; ++i)
|
||||||
|
{
|
||||||
|
var e = _entries[i];
|
||||||
|
|
||||||
|
AddPage(i + 1);
|
||||||
|
|
||||||
|
for (var j = 0; j < e.HueCount; ++j)
|
||||||
|
{
|
||||||
|
AddLabel(328 + j / 16 * 80, 102 + j % 16 * 17, e.HueStart + j - 1, "*****");
|
||||||
|
AddRadio(310 + j / 16 * 80, 102 + j % 16 * 17, 210, 211, false, i * 100 + j);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void OnResponse(NetState from, RelayInfo info)
|
||||||
|
{
|
||||||
|
if (_specialHairDye.Deleted)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var m = from.Mobile;
|
||||||
|
var switches = info.Switches;
|
||||||
|
|
||||||
|
if (!_specialHairDye.IsChildOf(m.Backpack))
|
||||||
|
{
|
||||||
|
m.SendLocalizedMessage(1042010); // You must have the objecti n your backpack to use it.
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (info.ButtonID != 0 && switches.Length > 0)
|
||||||
|
{
|
||||||
|
if (m.HairItemID == 0)
|
||||||
|
{
|
||||||
|
m.SendLocalizedMessage(502623); // You have no hair to dye and cannot use this
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// To prevent this from being exploited, the hue is abstracted into an internal list
|
||||||
|
var entryIndex = Math.DivRem(switches[0], 100, out var hueOffset);
|
||||||
|
|
||||||
|
if (entryIndex >= 0 && entryIndex < _entries.Length)
|
||||||
|
{
|
||||||
|
var e = _entries[entryIndex];
|
||||||
|
|
||||||
|
if (hueOffset >= 0 && hueOffset < e.HueCount)
|
||||||
|
{
|
||||||
|
_specialHairDye.Delete();
|
||||||
|
|
||||||
|
var hue = e.HueStart + hueOffset;
|
||||||
|
|
||||||
|
m.HairHue = hue;
|
||||||
|
|
||||||
|
m.SendLocalizedMessage(501199); // You dye your hair
|
||||||
|
m.PlaySound(0x4E);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m.SendLocalizedMessage(501200); // You decide not to dye your hair
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private class SpecialHairDyeEntry
|
||||||
|
{
|
||||||
|
public SpecialHairDyeEntry(string name, int hueStart, int hueCount)
|
||||||
|
{
|
||||||
|
Name = name;
|
||||||
|
HueStart = hueStart;
|
||||||
|
HueCount = hueCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public string Name { get; }
|
||||||
|
|
||||||
|
public int HueStart { get; }
|
||||||
|
|
||||||
|
public int HueCount { get; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,92 +1,37 @@
|
||||||
namespace Server.Items
|
using ModernUO.Serialization;
|
||||||
|
|
||||||
|
namespace Server.Items;
|
||||||
|
|
||||||
|
[SerializationGenerator(0, false)]
|
||||||
|
public partial class Static : Item
|
||||||
{
|
{
|
||||||
public class Static : Item
|
public Static() : base(0x80) => Movable = false;
|
||||||
|
|
||||||
|
[Constructible]
|
||||||
|
public Static(int itemID) : base(itemID) => Movable = false;
|
||||||
|
|
||||||
|
[Constructible]
|
||||||
|
public Static(int itemID, int count) : this(Utility.Random(itemID, count))
|
||||||
{
|
{
|
||||||
public Static() : base(0x80) => Movable = false;
|
|
||||||
|
|
||||||
[Constructible]
|
|
||||||
public Static(int itemID) : base(itemID) => Movable = false;
|
|
||||||
|
|
||||||
[Constructible]
|
|
||||||
public Static(int itemID, int count) : this(Utility.Random(itemID, count))
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public Static(Serial serial) : base(serial)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Serialize(IGenericWriter writer)
|
|
||||||
{
|
|
||||||
base.Serialize(writer);
|
|
||||||
|
|
||||||
writer.Write(1); // version
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Deserialize(IGenericReader reader)
|
|
||||||
{
|
|
||||||
base.Deserialize(reader);
|
|
||||||
|
|
||||||
var version = reader.ReadInt();
|
|
||||||
|
|
||||||
if (version == 0 && Weight == 0)
|
|
||||||
{
|
|
||||||
Weight = -1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public class LocalizedStatic : Static
|
|
||||||
{
|
|
||||||
private int m_LabelNumber;
|
|
||||||
|
|
||||||
[Constructible]
|
|
||||||
public LocalizedStatic(int itemID) : this(itemID, itemID < 0x4000 ? 1020000 + itemID : 1078872 + itemID)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
[Constructible]
|
|
||||||
public LocalizedStatic(int itemID, int labelNumber) : base(itemID) => m_LabelNumber = labelNumber;
|
|
||||||
|
|
||||||
public LocalizedStatic(Serial serial) : base(serial)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
[CommandProperty(AccessLevel.GameMaster)]
|
|
||||||
public int Number
|
|
||||||
{
|
|
||||||
get => m_LabelNumber;
|
|
||||||
set
|
|
||||||
{
|
|
||||||
m_LabelNumber = value;
|
|
||||||
InvalidateProperties();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public override int LabelNumber => m_LabelNumber;
|
|
||||||
|
|
||||||
public override void Serialize(IGenericWriter writer)
|
|
||||||
{
|
|
||||||
base.Serialize(writer);
|
|
||||||
|
|
||||||
writer.Write((byte)0); // version
|
|
||||||
writer.WriteEncodedInt(m_LabelNumber);
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Deserialize(IGenericReader reader)
|
|
||||||
{
|
|
||||||
base.Deserialize(reader);
|
|
||||||
|
|
||||||
int version = reader.ReadByte();
|
|
||||||
|
|
||||||
switch (version)
|
|
||||||
{
|
|
||||||
case 0:
|
|
||||||
{
|
|
||||||
m_LabelNumber = reader.ReadEncodedInt();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[SerializationGenerator(0)]
|
||||||
|
public partial class LocalizedStatic : Static
|
||||||
|
{
|
||||||
|
[EncodedInt]
|
||||||
|
[InvalidateProperties]
|
||||||
|
[SerializableField(0)]
|
||||||
|
[SerializableFieldAttr("[CommandProperty(AccessLevel.GameMaster)]")]
|
||||||
|
private int _number;
|
||||||
|
|
||||||
|
[Constructible]
|
||||||
|
public LocalizedStatic(int itemID) : this(itemID, itemID < 0x4000 ? 1020000 + itemID : 1078872 + itemID)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
[Constructible]
|
||||||
|
public LocalizedStatic(int itemID, int number) : base(itemID) => _number = number;
|
||||||
|
|
||||||
|
public override int LabelNumber => _number;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,32 +1,16 @@
|
||||||
namespace Server.Items
|
using ModernUO.Serialization;
|
||||||
|
|
||||||
|
namespace Server.Items;
|
||||||
|
|
||||||
|
[SerializationGenerator(0, false)]
|
||||||
|
public partial class SwarmOfFlies : Item
|
||||||
{
|
{
|
||||||
public class SwarmOfFlies : Item
|
[Constructible]
|
||||||
|
public SwarmOfFlies() : base(0x91B)
|
||||||
{
|
{
|
||||||
[Constructible]
|
Hue = 1;
|
||||||
public SwarmOfFlies() : base(0x91B)
|
Movable = false;
|
||||||
{
|
|
||||||
Hue = 1;
|
|
||||||
Movable = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public SwarmOfFlies(Serial serial) : base(serial)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public override string DefaultName => "a swarm of flies";
|
|
||||||
|
|
||||||
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 string DefaultName => "a swarm of flies";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,156 +1,127 @@
|
||||||
using System;
|
using System;
|
||||||
|
using ModernUO.Serialization;
|
||||||
using Server.Multis;
|
using Server.Multis;
|
||||||
using Server.Network;
|
using Server.Network;
|
||||||
|
|
||||||
namespace Server.Items
|
namespace Server.Items;
|
||||||
|
|
||||||
|
[SerializationGenerator(0, false)]
|
||||||
|
public partial class TrashBarrel : Container, IChoppable
|
||||||
{
|
{
|
||||||
public class TrashBarrel : Container, IChoppable
|
private Timer m_Timer;
|
||||||
|
|
||||||
|
[Constructible]
|
||||||
|
public TrashBarrel() : base(0xE77)
|
||||||
{
|
{
|
||||||
private Timer m_Timer;
|
Hue = 0x3B2;
|
||||||
|
Movable = false;
|
||||||
|
}
|
||||||
|
|
||||||
[Constructible]
|
public override int LabelNumber => 1041064; // a trash barrel
|
||||||
public TrashBarrel() : base(0xE77)
|
|
||||||
|
public override int DefaultMaxWeight => 0; // A value of 0 signals unlimited weight
|
||||||
|
|
||||||
|
public override bool IsDecoContainer => false;
|
||||||
|
|
||||||
|
public void OnChop(Mobile from)
|
||||||
|
{
|
||||||
|
var house = BaseHouse.FindHouseAt(from);
|
||||||
|
|
||||||
|
if (house?.IsCoOwner(from) == true)
|
||||||
{
|
{
|
||||||
Hue = 0x3B2;
|
Effects.PlaySound(Location, Map, 0x3B3);
|
||||||
Movable = false;
|
from.SendLocalizedMessage(500461); // You destroy the item.
|
||||||
|
Destroy();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public TrashBarrel(Serial serial) : base(serial)
|
[AfterDeserialization]
|
||||||
|
private void AfterDeserialization()
|
||||||
|
{
|
||||||
|
if (Items.Count > 0)
|
||||||
{
|
{
|
||||||
|
m_Timer = new EmptyTimer(this);
|
||||||
|
m_Timer.Start();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public override int LabelNumber => 1041064; // a trash barrel
|
private void InvalidateContents(Mobile from)
|
||||||
|
{
|
||||||
public override int DefaultMaxWeight => 0; // A value of 0 signals unlimited weight
|
if (TotalItems >= 50)
|
||||||
|
|
||||||
public override bool IsDecoContainer => false;
|
|
||||||
|
|
||||||
public void OnChop(Mobile from)
|
|
||||||
{
|
{
|
||||||
var house = BaseHouse.FindHouseAt(from);
|
Empty(501478); // The trash is full! Emptying!
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SendLocalizedMessageTo(from, 1010442); // The item will be deleted in three minutes
|
||||||
|
|
||||||
if (house?.IsCoOwner(from) == true)
|
if (m_Timer != null)
|
||||||
{
|
{
|
||||||
Effects.PlaySound(Location, Map, 0x3B3);
|
m_Timer.Stop();
|
||||||
from.SendLocalizedMessage(500461); // You destroy the item.
|
|
||||||
Destroy();
|
|
||||||
}
|
}
|
||||||
}
|
else
|
||||||
|
|
||||||
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();
|
|
||||||
|
|
||||||
if (Items.Count > 0)
|
|
||||||
{
|
{
|
||||||
m_Timer = new EmptyTimer(this);
|
m_Timer = new EmptyTimer(this);
|
||||||
m_Timer.Start();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_Timer.Start();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public override bool OnDragDrop(Mobile from, Item dropped)
|
public override bool OnDragDrop(Mobile from, Item dropped)
|
||||||
|
{
|
||||||
|
if (base.OnDragDrop(from, dropped))
|
||||||
{
|
{
|
||||||
if (!base.OnDragDrop(from, dropped))
|
InvalidateContents(from);
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (TotalItems >= 50)
|
|
||||||
{
|
|
||||||
Empty(501478); // The trash is full! Emptying!
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
SendLocalizedMessageTo(from, 1010442); // The item will be deleted in three minutes
|
|
||||||
|
|
||||||
if (m_Timer != null)
|
|
||||||
{
|
|
||||||
m_Timer.Stop();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
m_Timer = new EmptyTimer(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
m_Timer.Start();
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool OnDragDropInto(Mobile from, Item item, Point3D p)
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override bool OnDragDropInto(Mobile from, Item item, Point3D p)
|
||||||
|
{
|
||||||
|
if (base.OnDragDropInto(from, item, p))
|
||||||
{
|
{
|
||||||
if (!base.OnDragDropInto(from, item, p))
|
InvalidateContents(from);
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (TotalItems >= 50)
|
|
||||||
{
|
|
||||||
Empty(501478); // The trash is full! Emptying!
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
SendLocalizedMessageTo(from, 1010442); // The item will be deleted in three minutes
|
|
||||||
|
|
||||||
if (m_Timer != null)
|
|
||||||
{
|
|
||||||
m_Timer.Stop();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
m_Timer = new EmptyTimer(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
m_Timer.Start();
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Empty(int message)
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Empty(int message)
|
||||||
|
{
|
||||||
|
var items = Items;
|
||||||
|
|
||||||
|
if (items.Count > 0)
|
||||||
{
|
{
|
||||||
var items = Items;
|
PublicOverheadMessage(MessageType.Regular, 0x3B2, message);
|
||||||
|
|
||||||
if (items.Count > 0)
|
for (var i = items.Count - 1; i >= 0; --i)
|
||||||
{
|
{
|
||||||
PublicOverheadMessage(MessageType.Regular, 0x3B2, message);
|
if (i >= items.Count)
|
||||||
|
|
||||||
for (var i = items.Count - 1; i >= 0; --i)
|
|
||||||
{
|
{
|
||||||
if (i >= items.Count)
|
continue;
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
items[i].Delete();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
items[i].Delete();
|
||||||
}
|
}
|
||||||
|
|
||||||
m_Timer?.Stop();
|
|
||||||
|
|
||||||
m_Timer = null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private class EmptyTimer : Timer
|
m_Timer?.Stop();
|
||||||
|
m_Timer = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private class EmptyTimer : Timer
|
||||||
|
{
|
||||||
|
private TrashBarrel _barrel;
|
||||||
|
|
||||||
|
public EmptyTimer(TrashBarrel barrel) : base(TimeSpan.FromMinutes(3.0)) => _barrel = barrel;
|
||||||
|
|
||||||
|
protected override void OnTick()
|
||||||
{
|
{
|
||||||
private readonly TrashBarrel m_Barrel;
|
_barrel.Empty(501479); // Emptying the trashcan!
|
||||||
|
|
||||||
public EmptyTimer(TrashBarrel barrel) : base(TimeSpan.FromMinutes(3.0)) => m_Barrel = barrel;
|
|
||||||
|
|
||||||
protected override void OnTick()
|
|
||||||
{
|
|
||||||
m_Barrel.Empty(501479); // Emptying the trashcan!
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,59 +1,40 @@
|
||||||
|
using ModernUO.Serialization;
|
||||||
using Server.Network;
|
using Server.Network;
|
||||||
|
|
||||||
namespace Server.Items
|
namespace Server.Items;
|
||||||
|
|
||||||
|
[Flippable(0xE41, 0xE40)]
|
||||||
|
[SerializationGenerator(0, false)]
|
||||||
|
public partial class TrashChest : Container
|
||||||
{
|
{
|
||||||
[Flippable(0xE41, 0xE40)]
|
[Constructible]
|
||||||
public class TrashChest : Container
|
public TrashChest() : base(0xE41) => Movable = false;
|
||||||
|
|
||||||
|
public override int DefaultMaxWeight => 0; // A value of 0 signals unlimited weight
|
||||||
|
|
||||||
|
public override bool IsDecoContainer => false;
|
||||||
|
|
||||||
|
public override bool OnDragDrop(Mobile from, Item dropped)
|
||||||
{
|
{
|
||||||
[Constructible]
|
if (base.OnDragDrop(from, dropped))
|
||||||
public TrashChest() : base(0xE41) => Movable = false;
|
|
||||||
|
|
||||||
public TrashChest(Serial serial) : base(serial)
|
|
||||||
{
|
{
|
||||||
}
|
|
||||||
|
|
||||||
public override int DefaultMaxWeight => 0; // A value of 0 signals unlimited weight
|
|
||||||
|
|
||||||
public override bool IsDecoContainer => false;
|
|
||||||
|
|
||||||
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 bool OnDragDrop(Mobile from, Item dropped)
|
|
||||||
{
|
|
||||||
if (!base.OnDragDrop(from, dropped))
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
PublicOverheadMessage(MessageType.Regular, 0x3B2, Utility.Random(1042891, 8));
|
PublicOverheadMessage(MessageType.Regular, 0x3B2, Utility.Random(1042891, 8));
|
||||||
dropped.Delete();
|
dropped.Delete();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool OnDragDropInto(Mobile from, Item item, Point3D p)
|
return false;
|
||||||
{
|
}
|
||||||
if (!base.OnDragDropInto(from, item, p))
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
public override bool OnDragDropInto(Mobile from, Item item, Point3D p)
|
||||||
|
{
|
||||||
|
if (base.OnDragDropInto(from, item, p))
|
||||||
|
{
|
||||||
PublicOverheadMessage(MessageType.Regular, 0x3B2, Utility.Random(1042891, 8));
|
PublicOverheadMessage(MessageType.Regular, 0x3B2, Utility.Random(1042891, 8));
|
||||||
item.Delete();
|
item.Delete();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,39 +1,18 @@
|
||||||
namespace Server.Items
|
using ModernUO.Serialization;
|
||||||
|
|
||||||
|
namespace Server.Items;
|
||||||
|
|
||||||
|
[SerializationGenerator(0, false)]
|
||||||
|
public partial class TribalBerry : Item
|
||||||
{
|
{
|
||||||
public class TribalBerry : Item
|
[Constructible]
|
||||||
|
public TribalBerry(int amount = 1) : base(0x9D0)
|
||||||
{
|
{
|
||||||
[Constructible]
|
Weight = 1.0;
|
||||||
public TribalBerry(int amount = 1) : base(0x9D0)
|
Stackable = true;
|
||||||
{
|
Amount = amount;
|
||||||
Weight = 1.0;
|
Hue = 6;
|
||||||
Stackable = true;
|
|
||||||
Amount = amount;
|
|
||||||
Hue = 6;
|
|
||||||
}
|
|
||||||
|
|
||||||
public TribalBerry(Serial serial) : base(serial)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public override int LabelNumber => 1040001; // tribal berry
|
|
||||||
|
|
||||||
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 == 4)
|
|
||||||
{
|
|
||||||
Hue = 6;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override int LabelNumber => 1040001; // tribal berry
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
using System;
|
using System;
|
||||||
|
using ModernUO.Serialization;
|
||||||
using Server.Factions;
|
using Server.Factions;
|
||||||
using Server.Mobiles;
|
using Server.Mobiles;
|
||||||
using Server.Spells;
|
using Server.Spells;
|
||||||
|
|
@ -6,87 +7,67 @@ using Server.Spells.Fifth;
|
||||||
using Server.Spells.Ninjitsu;
|
using Server.Spells.Ninjitsu;
|
||||||
using Server.Spells.Seventh;
|
using Server.Spells.Seventh;
|
||||||
|
|
||||||
namespace Server.Items
|
namespace Server.Items;
|
||||||
|
|
||||||
|
[SerializationGenerator(0, false)]
|
||||||
|
public partial class TribalPaint : Item
|
||||||
{
|
{
|
||||||
public class TribalPaint : Item
|
[Constructible]
|
||||||
|
public TribalPaint() : base(0x9EC)
|
||||||
{
|
{
|
||||||
[Constructible]
|
Hue = 2101;
|
||||||
public TribalPaint() : base(0x9EC)
|
Weight = 2.0;
|
||||||
|
Stackable = Core.ML;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override int LabelNumber => 1040000; // savage kin paint
|
||||||
|
|
||||||
|
public override void OnDoubleClick(Mobile from)
|
||||||
|
{
|
||||||
|
if (!IsChildOf(from.Backpack))
|
||||||
{
|
{
|
||||||
Hue = 2101;
|
from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
|
||||||
Weight = 2.0;
|
return;
|
||||||
Stackable = Core.ML;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public TribalPaint(Serial serial) : base(serial)
|
if (Sigil.ExistsOn(from))
|
||||||
{
|
{
|
||||||
|
from.SendLocalizedMessage(1010465); // You cannot disguise yourself while holding a sigil.
|
||||||
}
|
}
|
||||||
|
else if (!from.CanBeginAction<IncognitoSpell>())
|
||||||
public override int LabelNumber => 1040000; // savage kin paint
|
|
||||||
|
|
||||||
public override void OnDoubleClick(Mobile from)
|
|
||||||
{
|
{
|
||||||
if (IsChildOf(from.Backpack))
|
from.SendLocalizedMessage(501698); // You cannot disguise yourself while incognitoed.
|
||||||
|
}
|
||||||
|
else if (!from.CanBeginAction<PolymorphSpell>())
|
||||||
|
{
|
||||||
|
from.SendLocalizedMessage(501699); // You cannot disguise yourself while polymorphed.
|
||||||
|
}
|
||||||
|
else if (TransformationSpellHelper.UnderTransformation(from))
|
||||||
|
{
|
||||||
|
from.SendLocalizedMessage(501699); // You cannot disguise yourself while polymorphed.
|
||||||
|
}
|
||||||
|
else if (AnimalForm.UnderTransformation(from))
|
||||||
|
{
|
||||||
|
from.SendLocalizedMessage(1061634); // You cannot disguise yourself while in that form.
|
||||||
|
}
|
||||||
|
else if (from.IsBodyMod || from.FindItemOnLayer(Layer.Helm) is OrcishKinMask)
|
||||||
|
{
|
||||||
|
from.SendLocalizedMessage(501605); // You are already disguised.
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
from.BodyMod = from.Female ? 184 : 183;
|
||||||
|
from.HueMod = 0;
|
||||||
|
|
||||||
|
if (from is PlayerMobile mobile)
|
||||||
{
|
{
|
||||||
if (Sigil.ExistsOn(from))
|
mobile.SavagePaintExpiration = TimeSpan.FromDays(7.0);
|
||||||
{
|
|
||||||
from.SendLocalizedMessage(1010465); // You cannot disguise yourself while holding a sigil.
|
|
||||||
}
|
|
||||||
else if (!from.CanBeginAction<IncognitoSpell>())
|
|
||||||
{
|
|
||||||
from.SendLocalizedMessage(501698); // You cannot disguise yourself while incognitoed.
|
|
||||||
}
|
|
||||||
else if (!from.CanBeginAction<PolymorphSpell>())
|
|
||||||
{
|
|
||||||
from.SendLocalizedMessage(501699); // You cannot disguise yourself while polymorphed.
|
|
||||||
}
|
|
||||||
else if (TransformationSpellHelper.UnderTransformation(from))
|
|
||||||
{
|
|
||||||
from.SendLocalizedMessage(501699); // You cannot disguise yourself while polymorphed.
|
|
||||||
}
|
|
||||||
else if (AnimalForm.UnderTransformation(from))
|
|
||||||
{
|
|
||||||
from.SendLocalizedMessage(1061634); // You cannot disguise yourself while in that form.
|
|
||||||
}
|
|
||||||
else if (from.IsBodyMod || from.FindItemOnLayer(Layer.Helm) is OrcishKinMask)
|
|
||||||
{
|
|
||||||
from.SendLocalizedMessage(501605); // You are already disguised.
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
from.BodyMod = from.Female ? 184 : 183;
|
|
||||||
from.HueMod = 0;
|
|
||||||
|
|
||||||
if (from is PlayerMobile mobile)
|
|
||||||
{
|
|
||||||
mobile.SavagePaintExpiration = TimeSpan.FromDays(7.0);
|
|
||||||
}
|
|
||||||
|
|
||||||
from.SendLocalizedMessage(
|
|
||||||
1042537
|
|
||||||
); // You now bear the markings of the savage tribe. Your body paint will last about a week or you can remove it with an oil cloth.
|
|
||||||
|
|
||||||
Consume();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Serialize(IGenericWriter writer)
|
// You now bear the markings of the savage tribe. Your body paint will last about a week or you can remove it with an oil cloth.
|
||||||
{
|
from.SendLocalizedMessage(1042537);
|
||||||
base.Serialize(writer);
|
|
||||||
|
|
||||||
writer.Write(0);
|
Consume();
|
||||||
}
|
|
||||||
|
|
||||||
public override void Deserialize(IGenericReader reader)
|
|
||||||
{
|
|
||||||
base.Deserialize(reader);
|
|
||||||
|
|
||||||
var version = reader.ReadInt();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,116 +1,100 @@
|
||||||
using System;
|
using System;
|
||||||
|
using ModernUO.Serialization;
|
||||||
using Server.Mobiles;
|
using Server.Mobiles;
|
||||||
|
|
||||||
namespace Server.Items
|
namespace Server.Items;
|
||||||
|
|
||||||
|
[SerializationGenerator(0, false)]
|
||||||
|
public partial class UnholyBone : Item, ICarvable
|
||||||
{
|
{
|
||||||
public class UnholyBone : Item, ICarvable
|
private SpawnTimer m_Timer;
|
||||||
|
|
||||||
|
[Constructible]
|
||||||
|
public UnholyBone() : base(0xF7E)
|
||||||
{
|
{
|
||||||
private SpawnTimer m_Timer;
|
Movable = false;
|
||||||
|
Hue = 0x497;
|
||||||
|
|
||||||
[Constructible]
|
m_Timer = new SpawnTimer(this);
|
||||||
public UnholyBone() : base(0xF7E)
|
m_Timer.Start();
|
||||||
|
}
|
||||||
|
|
||||||
|
public override string DefaultName => "unholy bone";
|
||||||
|
|
||||||
|
public void Carve(Mobile from, Item item)
|
||||||
|
{
|
||||||
|
Effects.PlaySound(GetWorldLocation(), Map, 0x48F);
|
||||||
|
Effects.SendLocationEffect(GetWorldLocation(), Map, 0x3728, 10);
|
||||||
|
|
||||||
|
if (Utility.RandomDouble() < 0.3)
|
||||||
{
|
{
|
||||||
Movable = false;
|
if (ItemID == 0xF7E)
|
||||||
Hue = 0x497;
|
|
||||||
|
|
||||||
m_Timer = new SpawnTimer(this);
|
|
||||||
m_Timer.Start();
|
|
||||||
}
|
|
||||||
|
|
||||||
public UnholyBone(Serial serial) : base(serial)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public override string DefaultName => "unholy bone";
|
|
||||||
|
|
||||||
public void Carve(Mobile from, Item item)
|
|
||||||
{
|
|
||||||
Effects.PlaySound(GetWorldLocation(), Map, 0x48F);
|
|
||||||
Effects.SendLocationEffect(GetWorldLocation(), Map, 0x3728, 10);
|
|
||||||
|
|
||||||
if (Utility.RandomDouble() < 0.3)
|
|
||||||
{
|
{
|
||||||
if (ItemID == 0xF7E)
|
from.SendMessage("You destroy the bone.");
|
||||||
{
|
|
||||||
from.SendMessage("You destroy the bone.");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
from.SendMessage("You destroy the bone pile.");
|
|
||||||
}
|
|
||||||
|
|
||||||
var gold = new Gold(25, 100);
|
|
||||||
|
|
||||||
gold.MoveToWorld(GetWorldLocation(), Map);
|
|
||||||
|
|
||||||
Delete();
|
|
||||||
|
|
||||||
m_Timer.Stop();
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (ItemID == 0xF7E)
|
from.SendMessage("You destroy the bone pile.");
|
||||||
{
|
|
||||||
from.SendMessage("You damage the bone.");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
from.SendMessage("You damage the bone pile.");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var gold = new Gold(25, 100);
|
||||||
|
|
||||||
|
gold.MoveToWorld(GetWorldLocation(), Map);
|
||||||
|
|
||||||
|
Delete();
|
||||||
|
|
||||||
|
m_Timer.Stop();
|
||||||
}
|
}
|
||||||
|
else if (ItemID == 0xF7E)
|
||||||
public override void Serialize(IGenericWriter writer)
|
|
||||||
{
|
{
|
||||||
base.Serialize(writer);
|
from.SendMessage("You damage the bone.");
|
||||||
|
|
||||||
writer.Write(0); // version
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
public override void Deserialize(IGenericReader reader)
|
|
||||||
{
|
{
|
||||||
base.Deserialize(reader);
|
from.SendMessage("You damage the bone pile.");
|
||||||
|
|
||||||
var version = reader.ReadInt();
|
|
||||||
|
|
||||||
m_Timer = new SpawnTimer(this);
|
|
||||||
m_Timer.Start();
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private class SpawnTimer : Timer
|
[AfterDeserialization]
|
||||||
|
private void AfterDeserialize()
|
||||||
|
{
|
||||||
|
m_Timer = new SpawnTimer(this);
|
||||||
|
m_Timer.Start();
|
||||||
|
}
|
||||||
|
|
||||||
|
private class SpawnTimer : Timer
|
||||||
|
{
|
||||||
|
private Item m_Item;
|
||||||
|
|
||||||
|
public SpawnTimer(Item item) : base(TimeSpan.FromSeconds(Utility.RandomMinMax(5, 10))) => m_Item = item;
|
||||||
|
|
||||||
|
protected override void OnTick()
|
||||||
{
|
{
|
||||||
private readonly Item m_Item;
|
if (m_Item?.Deleted != false)
|
||||||
|
|
||||||
public SpawnTimer(Item item) : base(TimeSpan.FromSeconds(Utility.RandomMinMax(5, 10))) => m_Item = item;
|
|
||||||
|
|
||||||
protected override void OnTick()
|
|
||||||
{
|
{
|
||||||
if (m_Item.Deleted)
|
return;
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var spawn = Utility.Random(12) switch
|
|
||||||
{
|
|
||||||
0 => (Mobile)new Skeleton(),
|
|
||||||
1 => new Zombie(),
|
|
||||||
2 => new Wraith(),
|
|
||||||
3 => new Spectre(),
|
|
||||||
4 => new Ghoul(),
|
|
||||||
5 => new Mummy(),
|
|
||||||
6 => new Bogle(),
|
|
||||||
7 => new RottingCorpse(),
|
|
||||||
8 => new BoneKnight(),
|
|
||||||
9 => new SkeletalKnight(),
|
|
||||||
10 => new Lich(),
|
|
||||||
11 => new LichLord(),
|
|
||||||
_ => new Skeleton()
|
|
||||||
};
|
|
||||||
|
|
||||||
spawn.MoveToWorld(m_Item.Location, m_Item.Map);
|
|
||||||
|
|
||||||
m_Item.Delete();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Mobile spawn = Utility.Random(12) switch
|
||||||
|
{
|
||||||
|
0 => new Skeleton(),
|
||||||
|
1 => new Zombie(),
|
||||||
|
2 => new Wraith(),
|
||||||
|
3 => new Spectre(),
|
||||||
|
4 => new Ghoul(),
|
||||||
|
5 => new Mummy(),
|
||||||
|
6 => new Bogle(),
|
||||||
|
7 => new RottingCorpse(),
|
||||||
|
8 => new BoneKnight(),
|
||||||
|
9 => new SkeletalKnight(),
|
||||||
|
10 => new Lich(),
|
||||||
|
11 => new LichLord(),
|
||||||
|
_ => new Skeleton()
|
||||||
|
};
|
||||||
|
|
||||||
|
spawn.MoveToWorld(m_Item.Location, m_Item.Map);
|
||||||
|
|
||||||
|
m_Item.Delete();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,237 +1,162 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using ModernUO.Serialization;
|
||||||
using Server.Network;
|
using Server.Network;
|
||||||
|
|
||||||
namespace Server.Items
|
namespace Server.Items;
|
||||||
|
|
||||||
|
[SerializationGenerator(1, false)]
|
||||||
|
public partial class WarningItem : Item
|
||||||
{
|
{
|
||||||
public class WarningItem : Item
|
private bool m_Broadcasting;
|
||||||
|
|
||||||
|
[SerializableField(0)]
|
||||||
|
[SerializableFieldAttr("[CommandProperty(AccessLevel.GameMaster)]")]
|
||||||
|
private TextDefinition _warningMessage;
|
||||||
|
|
||||||
|
// Field 1
|
||||||
|
private int _range;
|
||||||
|
|
||||||
|
[SerializableField(2)]
|
||||||
|
private TimeSpan _resetDelay;
|
||||||
|
|
||||||
|
private DateTime m_LastBroadcast;
|
||||||
|
|
||||||
|
[Constructible]
|
||||||
|
public WarningItem(int itemID, int range, int warning) : base(itemID)
|
||||||
{
|
{
|
||||||
private bool m_Broadcasting;
|
Movable = false;
|
||||||
|
|
||||||
private DateTime m_LastBroadcast;
|
_warningMessage = warning;
|
||||||
private int m_Range;
|
_range = Math.Min(range, 18);
|
||||||
|
}
|
||||||
|
|
||||||
[Constructible]
|
[Constructible]
|
||||||
public WarningItem(int itemID, int range, int warning) : base(itemID)
|
public WarningItem(int itemID, int range, string warning) : base(itemID)
|
||||||
|
{
|
||||||
|
Movable = false;
|
||||||
|
|
||||||
|
_warningMessage = warning;
|
||||||
|
_range = Math.Min(range, 18);
|
||||||
|
}
|
||||||
|
|
||||||
|
[CommandProperty(AccessLevel.GameMaster)]
|
||||||
|
[SerializableProperty(1, useField: nameof(_range))]
|
||||||
|
public int Range
|
||||||
|
{
|
||||||
|
get => _range;
|
||||||
|
set
|
||||||
{
|
{
|
||||||
if (range > 18)
|
_range = Math.Min(value, 18);
|
||||||
{
|
this.MarkDirty();
|
||||||
range = 18;
|
|
||||||
}
|
|
||||||
|
|
||||||
Movable = false;
|
|
||||||
|
|
||||||
WarningNumber = warning;
|
|
||||||
m_Range = range;
|
|
||||||
}
|
|
||||||
|
|
||||||
[Constructible]
|
|
||||||
public WarningItem(int itemID, int range, string warning) : base(itemID)
|
|
||||||
{
|
|
||||||
if (range > 18)
|
|
||||||
{
|
|
||||||
range = 18;
|
|
||||||
}
|
|
||||||
|
|
||||||
Movable = false;
|
|
||||||
|
|
||||||
WarningString = warning;
|
|
||||||
m_Range = range;
|
|
||||||
}
|
|
||||||
|
|
||||||
public WarningItem(Serial serial) : base(serial)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
[CommandProperty(AccessLevel.GameMaster)]
|
|
||||||
public string WarningString { get; set; }
|
|
||||||
|
|
||||||
[CommandProperty(AccessLevel.GameMaster)]
|
|
||||||
public int WarningNumber { get; set; }
|
|
||||||
|
|
||||||
[CommandProperty(AccessLevel.GameMaster)]
|
|
||||||
public int Range
|
|
||||||
{
|
|
||||||
get => m_Range;
|
|
||||||
set
|
|
||||||
{
|
|
||||||
if (value > 18)
|
|
||||||
{
|
|
||||||
value = 18;
|
|
||||||
}
|
|
||||||
|
|
||||||
m_Range = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[CommandProperty(AccessLevel.GameMaster)]
|
|
||||||
public TimeSpan ResetDelay { get; set; }
|
|
||||||
|
|
||||||
public virtual bool OnlyToTriggerer => false;
|
|
||||||
public virtual int NeighborRange => 5;
|
|
||||||
|
|
||||||
public override bool HandlesOnMovement => true;
|
|
||||||
|
|
||||||
public virtual void SendMessage(Mobile triggerer, bool onlyToTriggerer, string messageString, int messageNumber)
|
|
||||||
{
|
|
||||||
if (onlyToTriggerer)
|
|
||||||
{
|
|
||||||
if (messageString != null)
|
|
||||||
{
|
|
||||||
triggerer.SendMessage(messageString);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
triggerer.SendLocalizedMessage(messageNumber);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (messageString != null)
|
|
||||||
{
|
|
||||||
PublicOverheadMessage(MessageType.Regular, 0x3B2, false, messageString);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
PublicOverheadMessage(MessageType.Regular, 0x3B2, messageNumber);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public virtual void Broadcast(Mobile triggerer)
|
|
||||||
{
|
|
||||||
if (m_Broadcasting || Core.Now < m_LastBroadcast + ResetDelay)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
m_LastBroadcast = Core.Now;
|
|
||||||
|
|
||||||
m_Broadcasting = true;
|
|
||||||
|
|
||||||
SendMessage(triggerer, OnlyToTriggerer, WarningString, WarningNumber);
|
|
||||||
|
|
||||||
if (NeighborRange >= 0)
|
|
||||||
{
|
|
||||||
var list = new List<WarningItem>();
|
|
||||||
|
|
||||||
foreach (var item in GetItemsInRange(NeighborRange))
|
|
||||||
{
|
|
||||||
if (item != this && item is WarningItem warningItem)
|
|
||||||
{
|
|
||||||
list.Add(warningItem);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (var i = 0; i < list.Count; i++)
|
|
||||||
{
|
|
||||||
list[i].Broadcast(triggerer);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Timer.StartTimer(StopBroadcasting);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void StopBroadcasting()
|
|
||||||
{
|
|
||||||
m_Broadcasting = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void OnMovement(Mobile m, Point3D oldLocation)
|
|
||||||
{
|
|
||||||
if (m.Player && Utility.InRange(m.Location, Location, m_Range) &&
|
|
||||||
!Utility.InRange(oldLocation, Location, m_Range))
|
|
||||||
{
|
|
||||||
Broadcast(m);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Serialize(IGenericWriter writer)
|
|
||||||
{
|
|
||||||
base.Serialize(writer);
|
|
||||||
|
|
||||||
writer.Write(0);
|
|
||||||
|
|
||||||
writer.Write(WarningString);
|
|
||||||
writer.Write(WarningNumber);
|
|
||||||
writer.Write(m_Range);
|
|
||||||
|
|
||||||
writer.Write(ResetDelay);
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Deserialize(IGenericReader reader)
|
|
||||||
{
|
|
||||||
base.Deserialize(reader);
|
|
||||||
|
|
||||||
var version = reader.ReadInt();
|
|
||||||
|
|
||||||
switch (version)
|
|
||||||
{
|
|
||||||
case 0:
|
|
||||||
{
|
|
||||||
WarningString = reader.ReadString();
|
|
||||||
WarningNumber = reader.ReadInt();
|
|
||||||
m_Range = reader.ReadInt();
|
|
||||||
ResetDelay = reader.ReadTimeSpan();
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class HintItem : WarningItem
|
public virtual bool OnlyToTriggerer => false;
|
||||||
|
public virtual int NeighborRange => 5;
|
||||||
|
|
||||||
|
public override bool HandlesOnMovement => true;
|
||||||
|
|
||||||
|
public virtual void SendMessage(Mobile triggerer, bool onlyToTriggerer, TextDefinition warningMessage)
|
||||||
{
|
{
|
||||||
[Constructible]
|
if (onlyToTriggerer)
|
||||||
public HintItem(int itemID, int range, int warning, int hint) : base(itemID, range, warning) => HintNumber = hint;
|
|
||||||
|
|
||||||
[Constructible]
|
|
||||||
public HintItem(int itemID, int range, string warning, string hint) : base(itemID, range, warning) =>
|
|
||||||
HintString = hint;
|
|
||||||
|
|
||||||
public HintItem(Serial serial) : base(serial)
|
|
||||||
{
|
{
|
||||||
|
warningMessage.SendMessageTo(triggerer);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
warningMessage.PublicOverheadMessage(this, MessageType.Regular, 0x3B2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual void Broadcast(Mobile triggerer)
|
||||||
|
{
|
||||||
|
if (m_Broadcasting || Core.Now < m_LastBroadcast + ResetDelay)
|
||||||
|
{
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
[CommandProperty(AccessLevel.GameMaster)]
|
m_LastBroadcast = Core.Now;
|
||||||
public string HintString { get; set; }
|
|
||||||
|
|
||||||
[CommandProperty(AccessLevel.GameMaster)]
|
m_Broadcasting = true;
|
||||||
public int HintNumber { get; set; }
|
|
||||||
|
|
||||||
public override bool OnlyToTriggerer => true;
|
SendMessage(triggerer, OnlyToTriggerer, _warningMessage);
|
||||||
|
|
||||||
public override void OnDoubleClick(Mobile from)
|
if (NeighborRange >= 0)
|
||||||
{
|
{
|
||||||
SendMessage(from, true, HintString, HintNumber);
|
var list = new List<WarningItem>();
|
||||||
}
|
|
||||||
|
|
||||||
public override void Serialize(IGenericWriter writer)
|
foreach (var item in GetItemsInRange(NeighborRange))
|
||||||
{
|
|
||||||
base.Serialize(writer);
|
|
||||||
|
|
||||||
writer.Write(0);
|
|
||||||
|
|
||||||
writer.Write(HintString);
|
|
||||||
writer.Write(HintNumber);
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Deserialize(IGenericReader reader)
|
|
||||||
{
|
|
||||||
base.Deserialize(reader);
|
|
||||||
|
|
||||||
var version = reader.ReadInt();
|
|
||||||
|
|
||||||
switch (version)
|
|
||||||
{
|
{
|
||||||
case 0:
|
if (item != this && item is WarningItem warningItem)
|
||||||
{
|
{
|
||||||
HintString = reader.ReadString();
|
list.Add(warningItem);
|
||||||
HintNumber = reader.ReadInt();
|
}
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
for (var i = 0; i < list.Count; i++)
|
||||||
}
|
{
|
||||||
|
list[i].Broadcast(triggerer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Timer.StartTimer(StopBroadcasting);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void StopBroadcasting()
|
||||||
|
{
|
||||||
|
m_Broadcasting = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void OnMovement(Mobile m, Point3D oldLocation)
|
||||||
|
{
|
||||||
|
if (m.Player && Utility.InRange(m.Location, Location, _range) &&
|
||||||
|
!Utility.InRange(oldLocation, Location, _range))
|
||||||
|
{
|
||||||
|
Broadcast(m);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Deserialize(IGenericReader reader, int version)
|
||||||
|
{
|
||||||
|
var warningMessageString = reader.ReadString();
|
||||||
|
var warningMessageInt = reader.ReadInt();
|
||||||
|
|
||||||
|
_range = reader.ReadInt();
|
||||||
|
ResetDelay = reader.ReadTimeSpan();
|
||||||
|
|
||||||
|
_warningMessage = warningMessageInt > 0 ? warningMessageInt : warningMessageString;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
[SerializationGenerator(1, false)]
|
||||||
|
public partial class HintItem : WarningItem
|
||||||
|
{
|
||||||
|
[SerializableField(0)]
|
||||||
|
[SerializableFieldAttr("[CommandProperty(AccessLevel.GameMaster)]")]
|
||||||
|
private TextDefinition _hintMessage;
|
||||||
|
|
||||||
|
[Constructible]
|
||||||
|
public HintItem(int itemID, int range, int warning, int hint) : base(itemID, range, warning) =>
|
||||||
|
_hintMessage = hint;
|
||||||
|
|
||||||
|
[Constructible]
|
||||||
|
public HintItem(int itemID, int range, string warning, string hint) : base(itemID, range, warning) =>
|
||||||
|
_hintMessage = hint;
|
||||||
|
|
||||||
|
public override bool OnlyToTriggerer => true;
|
||||||
|
|
||||||
|
public override void OnDoubleClick(Mobile from)
|
||||||
|
{
|
||||||
|
SendMessage(from, true, _hintMessage);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Deserialize(IGenericReader reader, int version)
|
||||||
|
{
|
||||||
|
var hintMessageString = reader.ReadString();
|
||||||
|
var hintMessageInt = reader.ReadInt();
|
||||||
|
|
||||||
|
_hintMessage = hintMessageInt > 0 ? hintMessageInt : hintMessageString;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,155 +1,116 @@
|
||||||
|
using ModernUO.Serialization;
|
||||||
using Server.Targeting;
|
using Server.Targeting;
|
||||||
|
|
||||||
namespace Server.Items
|
namespace Server.Items;
|
||||||
|
|
||||||
|
[Flippable(0x1f14, 0x1f15, 0x1f16, 0x1f17)]
|
||||||
|
[SerializationGenerator(0, false)]
|
||||||
|
public partial class WayPoint : Item
|
||||||
{
|
{
|
||||||
[Flippable(0x1f14, 0x1f15, 0x1f16, 0x1f17)]
|
[SerializableField(0)]
|
||||||
public class WayPoint : Item
|
[SerializableFieldAttr("[CommandProperty(AccessLevel.GameMaster)]")]
|
||||||
|
private WayPoint _nextPoint;
|
||||||
|
|
||||||
|
[Constructible]
|
||||||
|
public WayPoint(WayPoint prev = null) : base(0x1f14)
|
||||||
{
|
{
|
||||||
private WayPoint m_Next;
|
Hue = 0x498;
|
||||||
|
Visible = false;
|
||||||
|
// this.Movable = false;
|
||||||
|
|
||||||
[Constructible]
|
if (prev != null)
|
||||||
public WayPoint(WayPoint prev = null) : base(0x1f14)
|
|
||||||
{
|
{
|
||||||
Hue = 0x498;
|
prev.NextPoint = this;
|
||||||
Visible = false;
|
|
||||||
// this.Movable = false;
|
|
||||||
|
|
||||||
if (prev != null)
|
|
||||||
{
|
|
||||||
prev.NextPoint = this;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public WayPoint(Serial serial) : base(serial)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public override string DefaultName => "AI Way Point";
|
|
||||||
|
|
||||||
[CommandProperty(AccessLevel.GameMaster)]
|
|
||||||
public WayPoint NextPoint
|
|
||||||
{
|
|
||||||
get => m_Next;
|
|
||||||
set
|
|
||||||
{
|
|
||||||
if (m_Next != this)
|
|
||||||
{
|
|
||||||
m_Next = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void Initialize()
|
|
||||||
{
|
|
||||||
CommandSystem.Register("WayPointSeq", AccessLevel.GameMaster, WayPointSeq_OnCommand);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void WayPointSeq_OnCommand(CommandEventArgs arg)
|
|
||||||
{
|
|
||||||
arg.Mobile.SendMessage("Target the position of the first way point.");
|
|
||||||
arg.Mobile.Target = new WayPointSeqTarget(null);
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void OnDoubleClick(Mobile from)
|
|
||||||
{
|
|
||||||
if (from.AccessLevel >= AccessLevel.GameMaster)
|
|
||||||
{
|
|
||||||
from.SendMessage("Target the next way point in the sequence.");
|
|
||||||
|
|
||||||
from.Target = new NextPointTarget(this);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void OnSingleClick(Mobile from)
|
|
||||||
{
|
|
||||||
base.OnSingleClick(from);
|
|
||||||
|
|
||||||
if (m_Next == null)
|
|
||||||
{
|
|
||||||
LabelTo(from, "(Unlinked)");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
LabelTo(from, "(Linked: {0})", m_Next.Location);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Deserialize(IGenericReader reader)
|
|
||||||
{
|
|
||||||
base.Deserialize(reader);
|
|
||||||
|
|
||||||
var version = reader.ReadInt();
|
|
||||||
|
|
||||||
switch (version)
|
|
||||||
{
|
|
||||||
case 0:
|
|
||||||
{
|
|
||||||
m_Next = reader.ReadEntity<WayPoint>();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Serialize(IGenericWriter writer)
|
|
||||||
{
|
|
||||||
base.Serialize(writer);
|
|
||||||
|
|
||||||
writer.Write(0);
|
|
||||||
|
|
||||||
writer.Write(m_Next);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class NextPointTarget : Target
|
public override string DefaultName => "AI Way Point";
|
||||||
|
|
||||||
|
public static void Initialize()
|
||||||
{
|
{
|
||||||
private readonly WayPoint m_Point;
|
CommandSystem.Register("WayPointSeq", AccessLevel.GameMaster, WayPointSeq_OnCommand);
|
||||||
|
}
|
||||||
|
|
||||||
public NextPointTarget(WayPoint pt) : base(-1, false, TargetFlags.None) => m_Point = pt;
|
public static void WayPointSeq_OnCommand(CommandEventArgs arg)
|
||||||
|
{
|
||||||
|
arg.Mobile.SendMessage("Target the position of the first way point.");
|
||||||
|
arg.Mobile.Target = new WayPointSeqTarget(null);
|
||||||
|
}
|
||||||
|
|
||||||
protected override void OnTarget(Mobile from, object target)
|
public override void OnDoubleClick(Mobile from)
|
||||||
|
{
|
||||||
|
if (from.AccessLevel >= AccessLevel.GameMaster)
|
||||||
{
|
{
|
||||||
if (target is WayPoint point && m_Point != null)
|
from.SendMessage("Target the next way point in the sequence.");
|
||||||
{
|
|
||||||
m_Point.NextPoint = point;
|
from.Target = new NextPointTarget(this);
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
from.SendMessage("Target a way point.");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class WayPointSeqTarget : Target
|
public override void OnSingleClick(Mobile from)
|
||||||
{
|
{
|
||||||
private readonly WayPoint m_Last;
|
base.OnSingleClick(from);
|
||||||
|
|
||||||
public WayPointSeqTarget(WayPoint last) : base(-1, true, TargetFlags.None) => m_Last = last;
|
if (_nextPoint == null)
|
||||||
|
|
||||||
protected override void OnTarget(Mobile from, object targeted)
|
|
||||||
{
|
{
|
||||||
if (targeted is WayPoint wayPoint)
|
LabelTo(from, "(Unlinked)");
|
||||||
{
|
}
|
||||||
if (m_Last != null)
|
else
|
||||||
{
|
{
|
||||||
m_Last.NextPoint = wayPoint;
|
LabelTo(from, "(Linked: {0})", _nextPoint.Location);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (targeted is IPoint3D d)
|
}
|
||||||
{
|
|
||||||
var p = new Point3D(d);
|
public class NextPointTarget : Target
|
||||||
|
{
|
||||||
var point = new WayPoint(m_Last);
|
private WayPoint _point;
|
||||||
point.MoveToWorld(p, from.Map);
|
|
||||||
|
public NextPointTarget(WayPoint pt) : base(-1, false, TargetFlags.None) => _point = pt;
|
||||||
from.Target = new WayPointSeqTarget(point);
|
|
||||||
from.SendMessage(
|
protected override void OnTarget(Mobile from, object target)
|
||||||
"Target the position of the next way point in the sequence, or target a way point link the newest way point to."
|
{
|
||||||
);
|
if (target is WayPoint point && _point != null)
|
||||||
}
|
{
|
||||||
else
|
_point.NextPoint = point;
|
||||||
{
|
}
|
||||||
from.SendMessage("Target a position, or another way point.");
|
else
|
||||||
}
|
{
|
||||||
|
from.SendMessage("Target a way point.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class WayPointSeqTarget : Target
|
||||||
|
{
|
||||||
|
private WayPoint _last;
|
||||||
|
|
||||||
|
public WayPointSeqTarget(WayPoint last) : base(-1, true, TargetFlags.None) => _last = last;
|
||||||
|
|
||||||
|
protected override void OnTarget(Mobile from, object targeted)
|
||||||
|
{
|
||||||
|
if (targeted is WayPoint wayPoint)
|
||||||
|
{
|
||||||
|
if (_last != null)
|
||||||
|
{
|
||||||
|
_last.NextPoint = wayPoint;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (targeted is IPoint3D d)
|
||||||
|
{
|
||||||
|
var p = new Point3D(d);
|
||||||
|
|
||||||
|
var point = new WayPoint(_last);
|
||||||
|
point.MoveToWorld(p, from.Map);
|
||||||
|
|
||||||
|
from.Target = new WayPointSeqTarget(point);
|
||||||
|
from.SendMessage(
|
||||||
|
"Target the position of the next way point in the sequence, or target a way point link the newest way point to."
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
from.SendMessage("Target a position, or another way point.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,188 +1,120 @@
|
||||||
|
using ModernUO.Serialization;
|
||||||
using Server.Gumps;
|
using Server.Gumps;
|
||||||
using Server.Multis;
|
using Server.Multis;
|
||||||
using Server.Network;
|
using Server.Network;
|
||||||
|
|
||||||
namespace Server.Items
|
namespace Server.Items;
|
||||||
|
|
||||||
|
[SerializationGenerator(0, false)]
|
||||||
|
public abstract partial class BaseWindChimes : Item
|
||||||
{
|
{
|
||||||
public abstract class BaseWindChimes : Item
|
[InvalidateProperties]
|
||||||
|
[SerializableField(0)]
|
||||||
|
[SerializableFieldAttr("[CommandProperty(AccessLevel.GameMaster)]")]
|
||||||
|
private bool _turnedOn;
|
||||||
|
|
||||||
|
public BaseWindChimes(int itemID) : base(itemID)
|
||||||
{
|
{
|
||||||
private bool m_TurnedOn;
|
}
|
||||||
|
|
||||||
public BaseWindChimes(int itemID) : base(itemID)
|
public static int[] Sounds { get; } = { 0x505, 0x506, 0x507 };
|
||||||
|
|
||||||
|
public override bool HandlesOnMovement => _turnedOn && IsLockedDown;
|
||||||
|
|
||||||
|
public override void OnMovement(Mobile m, Point3D oldLocation)
|
||||||
|
{
|
||||||
|
if (_turnedOn && IsLockedDown && (!m.Hidden || m.AccessLevel == AccessLevel.Player) &&
|
||||||
|
Utility.InRange(m.Location, Location, 2) && !Utility.InRange(oldLocation, Location, 2))
|
||||||
{
|
{
|
||||||
|
Effects.PlaySound(Location, Map, Sounds.RandomElement());
|
||||||
}
|
}
|
||||||
|
|
||||||
public BaseWindChimes(Serial serial) : base(serial)
|
base.OnMovement(m, oldLocation);
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void GetProperties(IPropertyList list)
|
||||||
|
{
|
||||||
|
base.GetProperties(list);
|
||||||
|
|
||||||
|
if (_turnedOn)
|
||||||
{
|
{
|
||||||
|
list.Add(502695); // turned on
|
||||||
}
|
}
|
||||||
|
else
|
||||||
[CommandProperty(AccessLevel.GameMaster)]
|
|
||||||
public bool TurnedOn
|
|
||||||
{
|
{
|
||||||
get => m_TurnedOn;
|
list.Add(502696); // turned off
|
||||||
set
|
|
||||||
{
|
|
||||||
m_TurnedOn = value;
|
|
||||||
InvalidateProperties();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static int[] Sounds { get; } = { 0x505, 0x506, 0x507 };
|
|
||||||
|
|
||||||
public override bool HandlesOnMovement => m_TurnedOn && IsLockedDown;
|
|
||||||
|
|
||||||
public override void OnMovement(Mobile m, Point3D oldLocation)
|
|
||||||
{
|
|
||||||
if (m_TurnedOn && IsLockedDown && (!m.Hidden || m.AccessLevel == AccessLevel.Player) &&
|
|
||||||
Utility.InRange(m.Location, Location, 2) && !Utility.InRange(oldLocation, Location, 2))
|
|
||||||
{
|
|
||||||
Effects.PlaySound(Location, Map, Sounds.RandomElement());
|
|
||||||
}
|
|
||||||
|
|
||||||
base.OnMovement(m, oldLocation);
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void GetProperties(IPropertyList list)
|
|
||||||
{
|
|
||||||
base.GetProperties(list);
|
|
||||||
|
|
||||||
if (m_TurnedOn)
|
|
||||||
{
|
|
||||||
list.Add(502695); // turned on
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
list.Add(502696); // turned off
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool IsOwner(Mobile mob) => BaseHouse.FindHouseAt(this)?.IsOwner(mob) == true;
|
|
||||||
|
|
||||||
public override void OnDoubleClick(Mobile from)
|
|
||||||
{
|
|
||||||
if (IsOwner(from))
|
|
||||||
{
|
|
||||||
from.SendGump(new OnOffGump(this));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
from.SendLocalizedMessage(502691); // You must be the owner to use this.
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Serialize(IGenericWriter writer)
|
|
||||||
{
|
|
||||||
base.Serialize(writer);
|
|
||||||
|
|
||||||
writer.Write(0); // version
|
|
||||||
|
|
||||||
writer.Write(m_TurnedOn);
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Deserialize(IGenericReader reader)
|
|
||||||
{
|
|
||||||
base.Deserialize(reader);
|
|
||||||
|
|
||||||
var version = reader.ReadInt();
|
|
||||||
|
|
||||||
switch (version)
|
|
||||||
{
|
|
||||||
case 0:
|
|
||||||
{
|
|
||||||
m_TurnedOn = reader.ReadBool();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private class OnOffGump : Gump
|
|
||||||
{
|
|
||||||
private readonly BaseWindChimes m_Chimes;
|
|
||||||
|
|
||||||
public OnOffGump(BaseWindChimes chimes) : base(150, 200)
|
|
||||||
{
|
|
||||||
m_Chimes = chimes;
|
|
||||||
|
|
||||||
AddBackground(0, 0, 300, 150, 0xA28);
|
|
||||||
AddHtmlLocalized(45, 20, 300, 35, chimes.TurnedOn ? 1011035 : 1011034); // [De]Activate this item
|
|
||||||
AddButton(40, 53, 0xFA5, 0xFA7, 1);
|
|
||||||
AddHtmlLocalized(80, 55, 65, 35, 1011036); // OKAY
|
|
||||||
AddButton(150, 53, 0xFA5, 0xFA7, 0);
|
|
||||||
AddHtmlLocalized(190, 55, 100, 35, 1011012); // CANCEL
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void OnResponse(NetState sender, RelayInfo info)
|
|
||||||
{
|
|
||||||
var from = sender.Mobile;
|
|
||||||
|
|
||||||
if (info.ButtonID == 1)
|
|
||||||
{
|
|
||||||
var newValue = !m_Chimes.TurnedOn;
|
|
||||||
|
|
||||||
m_Chimes.TurnedOn = newValue;
|
|
||||||
|
|
||||||
if (newValue && !m_Chimes.IsLockedDown)
|
|
||||||
{
|
|
||||||
from.SendLocalizedMessage(502693); // Remember, this only works when locked down.
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
from.SendLocalizedMessage(502694); // Cancelled action.
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class WindChimes : BaseWindChimes
|
public bool IsOwner(Mobile mob) => BaseHouse.FindHouseAt(this)?.IsOwner(mob) == true;
|
||||||
|
|
||||||
|
public override void OnDoubleClick(Mobile from)
|
||||||
{
|
{
|
||||||
[Constructible]
|
if (IsOwner(from))
|
||||||
public WindChimes() : base(0x2832)
|
|
||||||
{
|
{
|
||||||
|
from.SendGump(new OnOffGump(this));
|
||||||
}
|
}
|
||||||
|
else
|
||||||
public WindChimes(Serial serial) : base(serial)
|
|
||||||
{
|
{
|
||||||
}
|
from.SendLocalizedMessage(502691); // You must be the owner to use this.
|
||||||
|
|
||||||
public override int LabelNumber => 1030290;
|
|
||||||
|
|
||||||
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 FancyWindChimes : BaseWindChimes
|
private class OnOffGump : Gump
|
||||||
{
|
{
|
||||||
[Constructible]
|
private readonly BaseWindChimes m_Chimes;
|
||||||
public FancyWindChimes() : base(0x2833)
|
|
||||||
|
public OnOffGump(BaseWindChimes chimes) : base(150, 200)
|
||||||
{
|
{
|
||||||
|
m_Chimes = chimes;
|
||||||
|
|
||||||
|
AddBackground(0, 0, 300, 150, 0xA28);
|
||||||
|
AddHtmlLocalized(45, 20, 300, 35, chimes.TurnedOn ? 1011035 : 1011034); // [De]Activate this item
|
||||||
|
AddButton(40, 53, 0xFA5, 0xFA7, 1);
|
||||||
|
AddHtmlLocalized(80, 55, 65, 35, 1011036); // OKAY
|
||||||
|
AddButton(150, 53, 0xFA5, 0xFA7, 0);
|
||||||
|
AddHtmlLocalized(190, 55, 100, 35, 1011012); // CANCEL
|
||||||
}
|
}
|
||||||
|
|
||||||
public FancyWindChimes(Serial serial) : base(serial)
|
public override void OnResponse(NetState sender, RelayInfo info)
|
||||||
{
|
{
|
||||||
}
|
var from = sender.Mobile;
|
||||||
|
|
||||||
public override int LabelNumber => 1030291;
|
if (info.ButtonID == 1)
|
||||||
|
{
|
||||||
|
var newValue = !m_Chimes.TurnedOn;
|
||||||
|
|
||||||
public override void Serialize(IGenericWriter writer)
|
m_Chimes.TurnedOn = newValue;
|
||||||
{
|
|
||||||
base.Serialize(writer);
|
|
||||||
writer.Write(0); // version
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Deserialize(IGenericReader reader)
|
if (newValue && !m_Chimes.IsLockedDown)
|
||||||
{
|
{
|
||||||
base.Deserialize(reader);
|
from.SendLocalizedMessage(502693); // Remember, this only works when locked down.
|
||||||
var version = reader.ReadInt();
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
from.SendLocalizedMessage(502694); // Cancelled action.
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[SerializationGenerator(0, false)]
|
||||||
|
public partial class WindChimes : BaseWindChimes
|
||||||
|
{
|
||||||
|
[Constructible]
|
||||||
|
public WindChimes() : base(0x2832)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[SerializationGenerator(0, false)]
|
||||||
|
public partial class FancyWindChimes : BaseWindChimes
|
||||||
|
{
|
||||||
|
[Constructible]
|
||||||
|
public FancyWindChimes() : base(0x2833)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public override int LabelNumber => 1030291;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
{
|
||||||
|
"version": 0,
|
||||||
|
"type": "Server.Items.BaseWindChimes",
|
||||||
|
"properties": [
|
||||||
|
{
|
||||||
|
"name": "TurnedOn",
|
||||||
|
"type": "bool",
|
||||||
|
"rule": "PrimitiveTypeMigrationRule",
|
||||||
|
"ruleArguments": [
|
||||||
|
""
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,24 @@
|
||||||
|
{
|
||||||
|
"version": 1,
|
||||||
|
"type": "Server.Items.ControlPanel",
|
||||||
|
"properties": [
|
||||||
|
{
|
||||||
|
"name": "SideLength",
|
||||||
|
"type": "int",
|
||||||
|
"rule": "PrimitiveTypeMigrationRule",
|
||||||
|
"ruleArguments": [
|
||||||
|
""
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Path",
|
||||||
|
"type": "Server.Point2D[]",
|
||||||
|
"rule": "ArrayMigrationRule",
|
||||||
|
"ruleArguments": [
|
||||||
|
"Server.Point2D",
|
||||||
|
"PrimitiveUOTypeMigrationRule",
|
||||||
|
"Point2D"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"version": 0,
|
||||||
|
"type": "Server.Items.FancyWindChimes"
|
||||||
|
}
|
||||||
14
Projects/UOContent/Migrations/Server.Items.HintItem.v1.json
Normal file
14
Projects/UOContent/Migrations/Server.Items.HintItem.v1.json
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
{
|
||||||
|
"version": 1,
|
||||||
|
"type": "Server.Items.HintItem",
|
||||||
|
"properties": [
|
||||||
|
{
|
||||||
|
"name": "HintMessage",
|
||||||
|
"type": "Server.TextDefinition",
|
||||||
|
"rule": "PrimitiveUOTypeMigrationRule",
|
||||||
|
"ruleArguments": [
|
||||||
|
"TextDefinition"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,30 @@
|
||||||
|
{
|
||||||
|
"version": 0,
|
||||||
|
"type": "Server.Items.KeywordTeleporter",
|
||||||
|
"properties": [
|
||||||
|
{
|
||||||
|
"name": "Substring",
|
||||||
|
"type": "string",
|
||||||
|
"rule": "PrimitiveTypeMigrationRule",
|
||||||
|
"ruleArguments": [
|
||||||
|
""
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Keyword",
|
||||||
|
"type": "int",
|
||||||
|
"rule": "PrimitiveTypeMigrationRule",
|
||||||
|
"ruleArguments": [
|
||||||
|
""
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Range",
|
||||||
|
"type": "int",
|
||||||
|
"rule": "PrimitiveTypeMigrationRule",
|
||||||
|
"ruleArguments": [
|
||||||
|
""
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
{
|
||||||
|
"version": 0,
|
||||||
|
"type": "Server.Items.LocalizedStatic",
|
||||||
|
"properties": [
|
||||||
|
{
|
||||||
|
"name": "Number",
|
||||||
|
"type": "int",
|
||||||
|
"rule": "PrimitiveTypeMigrationRule",
|
||||||
|
"ruleArguments": [
|
||||||
|
"EncodedInt"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"version": 0,
|
||||||
|
"type": "Server.Items.PowerGenerator"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"version": 0,
|
||||||
|
"type": "Server.Items.Scales"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,30 @@
|
||||||
|
{
|
||||||
|
"version": 0,
|
||||||
|
"type": "Server.Items.SerpentPillar",
|
||||||
|
"properties": [
|
||||||
|
{
|
||||||
|
"name": "Active",
|
||||||
|
"type": "bool",
|
||||||
|
"rule": "PrimitiveTypeMigrationRule",
|
||||||
|
"ruleArguments": [
|
||||||
|
""
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Word",
|
||||||
|
"type": "string",
|
||||||
|
"rule": "PrimitiveTypeMigrationRule",
|
||||||
|
"ruleArguments": [
|
||||||
|
""
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Destination",
|
||||||
|
"type": "Server.Rectangle2D",
|
||||||
|
"rule": "PrimitiveUOTypeMigrationRule",
|
||||||
|
"ruleArguments": [
|
||||||
|
"Rect2D"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,28 @@
|
||||||
|
{
|
||||||
|
"version": 1,
|
||||||
|
"type": "Server.Items.SkillTeleporter",
|
||||||
|
"properties": [
|
||||||
|
{
|
||||||
|
"name": "Skill",
|
||||||
|
"type": "Server.SkillName",
|
||||||
|
"rule": "EnumMigrationRule"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Required",
|
||||||
|
"type": "double",
|
||||||
|
"rule": "PrimitiveTypeMigrationRule",
|
||||||
|
"ruleArguments": [
|
||||||
|
""
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Message",
|
||||||
|
"type": "Server.TextDefinition",
|
||||||
|
"rule": "PrimitiveUOTypeMigrationRule",
|
||||||
|
"ruleArguments": [
|
||||||
|
"@CanBeNull",
|
||||||
|
"TextDefinition"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"version": 0,
|
||||||
|
"type": "Server.Items.SpecialBeardDye"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"version": 0,
|
||||||
|
"type": "Server.Items.SpecialHairDye"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"version": 0,
|
||||||
|
"type": "Server.Items.Static"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"version": 0,
|
||||||
|
"type": "Server.Items.SwarmOfFlies"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,40 @@
|
||||||
|
{
|
||||||
|
"version": 5,
|
||||||
|
"type": "Server.Items.Teleporter",
|
||||||
|
"properties": [
|
||||||
|
{
|
||||||
|
"name": "Flags",
|
||||||
|
"type": "Server.Items.TeleporterFlags",
|
||||||
|
"rule": "EnumMigrationRule"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Delay",
|
||||||
|
"type": "System.TimeSpan",
|
||||||
|
"rule": "PrimitiveTypeMigrationRule"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SoundID",
|
||||||
|
"type": "int",
|
||||||
|
"rule": "PrimitiveTypeMigrationRule",
|
||||||
|
"ruleArguments": [
|
||||||
|
"EncodedInt"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "PointDest",
|
||||||
|
"type": "Server.Point3D",
|
||||||
|
"rule": "PrimitiveUOTypeMigrationRule",
|
||||||
|
"ruleArguments": [
|
||||||
|
"Point3D"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "MapDest",
|
||||||
|
"type": "Server.Map",
|
||||||
|
"rule": "PrimitiveUOTypeMigrationRule",
|
||||||
|
"ruleArguments": [
|
||||||
|
"Map"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"version": 0,
|
||||||
|
"type": "Server.Items.TrashBarrel"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"version": 0,
|
||||||
|
"type": "Server.Items.TrashChest"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"version": 0,
|
||||||
|
"type": "Server.Items.TribalBerry"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"version": 0,
|
||||||
|
"type": "Server.Items.TribalPaint"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"version": 0,
|
||||||
|
"type": "Server.Items.UnholyBone"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,32 @@
|
||||||
|
{
|
||||||
|
"version": 1,
|
||||||
|
"type": "Server.Items.WaitTeleporter",
|
||||||
|
"properties": [
|
||||||
|
{
|
||||||
|
"name": "StartMessage",
|
||||||
|
"type": "Server.TextDefinition",
|
||||||
|
"rule": "PrimitiveUOTypeMigrationRule",
|
||||||
|
"ruleArguments": [
|
||||||
|
"@CanBeNull",
|
||||||
|
"TextDefinition"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "ProgressMessage",
|
||||||
|
"type": "Server.TextDefinition",
|
||||||
|
"rule": "PrimitiveUOTypeMigrationRule",
|
||||||
|
"ruleArguments": [
|
||||||
|
"@CanBeNull",
|
||||||
|
"TextDefinition"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "ShowTimeRemaining",
|
||||||
|
"type": "bool",
|
||||||
|
"rule": "PrimitiveTypeMigrationRule",
|
||||||
|
"ruleArguments": [
|
||||||
|
""
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,27 @@
|
||||||
|
{
|
||||||
|
"version": 1,
|
||||||
|
"type": "Server.Items.WarningItem",
|
||||||
|
"properties": [
|
||||||
|
{
|
||||||
|
"name": "WarningMessage",
|
||||||
|
"type": "Server.TextDefinition",
|
||||||
|
"rule": "PrimitiveUOTypeMigrationRule",
|
||||||
|
"ruleArguments": [
|
||||||
|
"TextDefinition"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Range",
|
||||||
|
"type": "int",
|
||||||
|
"rule": "PrimitiveTypeMigrationRule",
|
||||||
|
"ruleArguments": [
|
||||||
|
""
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "ResetDelay",
|
||||||
|
"type": "System.TimeSpan",
|
||||||
|
"rule": "PrimitiveTypeMigrationRule"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
11
Projects/UOContent/Migrations/Server.Items.WayPoint.v0.json
Normal file
11
Projects/UOContent/Migrations/Server.Items.WayPoint.v0.json
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
{
|
||||||
|
"version": 0,
|
||||||
|
"type": "Server.Items.WayPoint",
|
||||||
|
"properties": [
|
||||||
|
{
|
||||||
|
"name": "NextPoint",
|
||||||
|
"type": "Server.Items.WayPoint",
|
||||||
|
"rule": "SerializableInterfaceMigrationRule"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"version": 0,
|
||||||
|
"type": "Server.Items.WindChimes"
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue