fix: Codegens more misc items (#1216)

This commit is contained in:
Kamron Batman 2022-10-29 16:08:23 -07:00 committed by GitHub
parent 32a5825ddd
commit 39e6f62ec9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
81 changed files with 3042 additions and 3780 deletions

View file

@ -20,7 +20,7 @@ namespace Server.Commands
var found = false;
foreach (var item in eable)
{
if (item is MorphItem morphItem && morphItem.Z == z && morphItem.InactiveItemID == inactiveItemID && morphItem.ActiveItemID == activeItemID)
if (item is MorphItem morphItem && morphItem.Z == z && morphItem.InactiveItemId == inactiveItemID && morphItem.ActiveItemId == activeItemID)
{
found = true;
break;

View file

@ -1,138 +1,116 @@
using System;
using ModernUO.Serialization;
using Server.Accounting;
namespace Server.Items
namespace Server.Items;
[SerializationGenerator(0, false)]
public partial class Gold : Item
{
public class Gold : Item
[Constructible]
public Gold(int amountFrom, int amountTo) : this(Utility.RandomMinMax(amountFrom, amountTo))
{
[Constructible]
public Gold(int amountFrom, int amountTo) : this(Utility.RandomMinMax(amountFrom, amountTo))
}
[Constructible]
public Gold(int amount = 1) : base(0xEED)
{
Stackable = true;
Amount = amount;
}
public override double DefaultWeight => Core.ML ? 0.02 / 3 : 0.02;
public override int GetDropSound()
{
return Amount switch
{
<= 1 => 0x2E4,
<= 5 => 0x2E5,
_ => 0x2E6
};
}
protected override void OnAmountChange(int oldValue)
{
var newValue = Amount;
UpdateTotal(this, TotalType.Gold, newValue - oldValue);
}
public override void OnAdded(IEntity parent)
{
base.OnAdded(parent);
if (!AccountGold.Enabled)
{
return;
}
[Constructible]
public Gold(int amount = 1) : base(0xEED)
Mobile owner = null;
SecureTradeInfo tradeInfo = null;
var root = parent as Container;
while (root?.Parent is Container container)
{
Stackable = true;
Amount = amount;
root = container;
}
public Gold(Serial serial) : base(serial)
parent = root ?? parent;
if (parent is SecureTradeContainer trade && AccountGold.ConvertOnTrade)
{
if (trade.Trade.From.Container == trade)
{
tradeInfo = trade.Trade.From;
owner = tradeInfo.Mobile;
}
else if (trade.Trade.To.Container == trade)
{
tradeInfo = trade.Trade.To;
owner = tradeInfo.Mobile;
}
}
else if (parent is BankBox box && AccountGold.ConvertOnBank)
{
owner = box.Owner;
}
public override double DefaultWeight => Core.ML ? 0.02 / 3 : 0.02;
public override int GetDropSound()
if (owner?.Account?.DepositGold(Amount) != true)
{
if (Amount <= 1)
{
return 0x2E4;
}
if (Amount <= 5)
{
return 0x2E5;
}
return 0x2E6;
return;
}
protected override void OnAmountChange(int oldValue)
if (tradeInfo != null)
{
var newValue = Amount;
if (owner.NetState?.NewSecureTrading == false)
{
var plat = Math.DivRem(Amount, AccountGold.CurrencyThreshold, out var gold);
UpdateTotal(this, TotalType.Gold, newValue - oldValue);
tradeInfo.Plat += plat;
tradeInfo.Gold += gold;
}
tradeInfo.VirtualCheck?.UpdateTrade(tradeInfo.Mobile);
}
public override void OnAdded(IEntity parent)
owner.SendLocalizedMessage(1042763, $"{Amount:N0}");
Delete();
((Container)parent).UpdateTotals();
}
public override int GetTotal(TotalType type)
{
var baseTotal = base.GetTotal(type);
if (type == TotalType.Gold)
{
base.OnAdded(parent);
if (!AccountGold.Enabled)
{
return;
}
Mobile owner = null;
SecureTradeInfo tradeInfo = null;
var root = parent as Container;
while (root?.Parent is Container container)
{
root = container;
}
parent = root ?? parent;
if (parent is SecureTradeContainer trade && AccountGold.ConvertOnTrade)
{
if (trade.Trade.From.Container == trade)
{
tradeInfo = trade.Trade.From;
owner = tradeInfo.Mobile;
}
else if (trade.Trade.To.Container == trade)
{
tradeInfo = trade.Trade.To;
owner = tradeInfo.Mobile;
}
}
else if (parent is BankBox box && AccountGold.ConvertOnBank)
{
owner = box.Owner;
}
if (owner?.Account?.DepositGold(Amount) != true)
{
return;
}
if (tradeInfo != null)
{
if (owner.NetState?.NewSecureTrading == false)
{
var plat = Math.DivRem(Amount, AccountGold.CurrencyThreshold, out var gold);
tradeInfo.Plat += plat;
tradeInfo.Gold += gold;
}
tradeInfo.VirtualCheck?.UpdateTrade(tradeInfo.Mobile);
}
owner.SendLocalizedMessage(1042763, $"{Amount:N0}");
Delete();
((Container)parent).UpdateTotals();
baseTotal += Amount;
}
public override int GetTotal(TotalType type)
{
var baseTotal = base.GetTotal(type);
if (type == TotalType.Gold)
{
baseTotal += Amount;
}
return baseTotal;
}
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();
}
return baseTotal;
}
}

View file

@ -1,125 +1,102 @@
using System;
using ModernUO.Serialization;
using Server.Network;
using Server.Spells;
namespace Server.Items
namespace Server.Items;
[SerializationGenerator(0)]
public partial class Guillotine : Item
{
public class Guillotine : Item
private DateTime m_NextUse;
[Constructible]
public Guillotine() : base(4656) => Movable = false;
public override void OnDoubleClick(Mobile from)
{
private DateTime m_NextUse;
[Constructible]
public Guillotine()
: base(4656) =>
Movable = false;
public Guillotine(Serial serial)
: base(serial)
if (!from.InRange(GetWorldLocation(), 2) || !from.InLOS(this))
{
from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that
}
public override void OnDoubleClick(Mobile from)
else if (Visible && ItemID is 4656 or 4702 && Core.Now >= m_NextUse)
{
if (!from.InRange(GetWorldLocation(), 2) || !from.InLOS(this))
{
from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that
}
else if (Visible && ItemID is 4656 or 4702 && Core.Now >= m_NextUse)
{
var p = GetWorldLocation();
if (Utility.Random(Math.Max((from.X - p.X).Abs(), (from.Y - p.Y).Abs())) < 1)
{
Effects.PlaySound(from.Location, from.Map, from.GetHurtSound());
from.PublicOverheadMessage(MessageType.Regular, from.SpeechHue, true, "Ouch!");
SpellHelper.Damage(TimeSpan.FromSeconds(0.5), from, Utility.Dice(2, 10, 5));
}
Effects.PlaySound(GetWorldLocation(), Map, 0x387);
Timer.StartTimer(TimeSpan.FromSeconds(0.25), Down1);
Timer.StartTimer(TimeSpan.FromSeconds(0.50), Down2);
Timer.StartTimer(TimeSpan.FromSeconds(5.00), BackUp);
m_NextUse = Core.Now + TimeSpan.FromSeconds(10.0);
}
}
private void Down1()
{
ItemID = ItemID == 4656 ? 4678 : 4712;
}
private void Down2()
{
ItemID = ItemID == 4678 ? 4679 : 4713;
var p = GetWorldLocation();
var f = Map;
if (f == null)
if (Utility.Random(Math.Max((from.X - p.X).Abs(), (from.Y - p.Y).Abs())) < 1)
{
return;
Effects.PlaySound(from.Location, from.Map, from.GetHurtSound());
from.PublicOverheadMessage(MessageType.Regular, from.SpeechHue, true, "Ouch!");
SpellHelper.Damage(TimeSpan.FromSeconds(0.5), from, Utility.Dice(2, 10, 5));
}
new Blood(4650).MoveToWorld(p, f);
Effects.PlaySound(GetWorldLocation(), Map, 0x387);
for (var i = 0; i < 4; ++i)
Timer.StartTimer(TimeSpan.FromSeconds(0.25), Down1);
Timer.StartTimer(TimeSpan.FromSeconds(0.50), Down2);
Timer.StartTimer(TimeSpan.FromSeconds(5.00), BackUp);
m_NextUse = Core.Now + TimeSpan.FromSeconds(10.0);
}
}
private void Down1()
{
ItemID = ItemID == 4656 ? 4678 : 4712;
}
private void Down2()
{
ItemID = ItemID == 4678 ? 4679 : 4713;
var p = GetWorldLocation();
var f = Map;
if (f == null)
{
return;
}
new Blood(4650).MoveToWorld(p, f);
for (var i = 0; i < 4; ++i)
{
var x = p.X - 2 + Utility.Random(5);
var y = p.Y - 2 + Utility.Random(5);
var z = p.Z;
if (!f.CanFit(x, y, z, 1, false, false))
{
var x = p.X - 2 + Utility.Random(5);
var y = p.Y - 2 + Utility.Random(5);
var z = p.Z;
z = f.GetAverageZ(x, y);
if (!f.CanFit(x, y, z, 1, false, false))
{
z = f.GetAverageZ(x, y);
if (!f.CanFit(x, y, z, 1, false, false))
{
continue;
}
continue;
}
var loc = f.GetRandomNearbyLocation(p, 2, -2, 4, 1);
new Blood().MoveToWorld(loc, f);
}
}
private void BackUp()
{
if (ItemID is 4678 or 4679)
{
ItemID = 4656;
}
else if (ItemID is 4712 or 4713)
{
ItemID = 4702;
}
}
var loc = f.GetRandomNearbyLocation(p, 2, -2, 4, 1);
public override void Serialize(IGenericWriter writer)
{
base.Serialize(writer);
writer.Write((byte)0); // version
}
public override void Deserialize(IGenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadByte();
if (ItemID is 4678 or 4679)
{
ItemID = 4656;
}
else if (ItemID is 4712 or 4713)
{
ItemID = 4702;
}
new Blood().MoveToWorld(loc, f);
}
}
private void BackUp()
{
if (ItemID is 4678 or 4679)
{
ItemID = 4656;
}
else if (ItemID is 4712 or 4713)
{
ItemID = 4702;
}
}
[AfterDeserialization]
private void AfterDeserialization()
{
BackUp();
}
}

View file

@ -1,168 +1,150 @@
using System;
using ModernUO.Serialization;
using Server.Gumps;
using Server.Network;
namespace Server.Items
namespace Server.Items;
[SerializationGenerator(0, false)]
public partial class HairDye : Item
{
public class HairDye : Item
[Constructible]
public HairDye() : base(0xEFF) => Weight = 1.0;
public override int LabelNumber => 1041060; // Hair Dye
public override void OnDoubleClick(Mobile from)
{
[Constructible]
public HairDye() : base(0xEFF) => Weight = 1.0;
public HairDye(Serial serial) : base(serial)
if (from.InRange(GetWorldLocation(), 1))
{
from.CloseGump<HairDyeGump>();
from.SendGump(new HairDyeGump(this));
}
public override int LabelNumber => 1041060; // Hair Dye
public override void Serialize(IGenericWriter writer)
else
{
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<HairDyeGump>();
from.SendGump(new HairDyeGump(this));
}
else
{
from.LocalOverheadMessage(MessageType.Regular, 906, 1019045); // I can't reach that.
}
}
}
public class HairDyeGump : Gump
{
private static readonly HairDyeEntry[] m_Entries =
{
new("*****", 1602, 26),
new("*****", 1628, 27),
new("*****", 1502, 32),
new("*****", 1302, 32),
new("*****", 1402, 32),
new("*****", 1202, 24),
new("*****", 2402, 29),
new("*****", 2213, 6),
new("*****", 1102, 8),
new("*****", 1110, 8),
new("*****", 1118, 16),
new("*****", 1134, 16)
};
private readonly HairDye m_HairDye;
public HairDyeGump(HairDye dye) : base(50, 50)
{
m_HairDye = dye;
AddPage(0);
AddBackground(100, 10, 350, 355, 2600);
AddBackground(120, 54, 110, 270, 5100);
AddHtmlLocalized(70, 25, 400, 35, 1011013); // <center>Hair Color Selection Menu</center>
AddButton(149, 328, 4005, 4007, 1);
AddHtmlLocalized(185, 329, 250, 35, 1011014); // Dye my hair this color!
for (var i = 0; i < m_Entries.Length; ++i)
{
AddLabel(130, 59 + i * 22, m_Entries[i].HueStart - 1, m_Entries[i].Name);
AddButton(207, 60 + 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(278 + j / 16 * 80, 52 + j % 16 * 17, e.HueStart + j - 1, "*****");
AddRadio(260 + j / 16 * 80, 52 + j % 16 * 17, 210, 211, false, i * 100 + j);
}
}
}
public override void OnResponse(NetState from, RelayInfo info)
{
if (m_HairDye.Deleted)
{
return;
}
var m = from.Mobile;
var switches = info.Switches;
if (!m_HairDye.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.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.HairHue = hue;
m.FacialHairHue = hue;
m.SendLocalizedMessage(501199); // You dye your hair
m_HairDye.Delete();
m.PlaySound(0x4E);
}
}
}
}
else
{
m.SendLocalizedMessage(501200); // You decide not to dye your hair
}
}
private class HairDyeEntry
{
public HairDyeEntry(string name, int hueStart, int hueCount)
{
Name = name;
HueStart = hueStart;
HueCount = hueCount;
}
public string Name { get; }
public int HueStart { get; }
public int HueCount { get; }
from.LocalOverheadMessage(MessageType.Regular, 906, 1019045); // I can't reach that.
}
}
}
public class HairDyeGump : Gump
{
private static HairDyeEntry[] _entries =
{
new("*****", 1602, 26),
new("*****", 1628, 27),
new("*****", 1502, 32),
new("*****", 1302, 32),
new("*****", 1402, 32),
new("*****", 1202, 24),
new("*****", 2402, 29),
new("*****", 2213, 6),
new("*****", 1102, 8),
new("*****", 1110, 8),
new("*****", 1118, 16),
new("*****", 1134, 16)
};
private HairDye _hairDye;
public HairDyeGump(HairDye dye) : base(50, 50)
{
_hairDye = dye;
AddPage(0);
AddBackground(100, 10, 350, 355, 2600);
AddBackground(120, 54, 110, 270, 5100);
AddHtmlLocalized(70, 25, 400, 35, 1011013); // <center>Hair Color Selection Menu</center>
AddButton(149, 328, 4005, 4007, 1);
AddHtmlLocalized(185, 329, 250, 35, 1011014); // Dye my hair this color!
for (var i = 0; i < _entries.Length; ++i)
{
AddLabel(130, 59 + i * 22, _entries[i].HueStart - 1, _entries[i].Name);
AddButton(207, 60 + 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(278 + j / 16 * 80, 52 + j % 16 * 17, e.HueStart + j - 1, "*****");
AddRadio(260 + j / 16 * 80, 52 + j % 16 * 17, 210, 211, false, i * 100 + j);
}
}
}
public override void OnResponse(NetState from, RelayInfo info)
{
if (_hairDye.Deleted)
{
return;
}
var m = from.Mobile;
var switches = info.Switches;
if (!_hairDye.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.HairItemID == 0 && 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.HairHue = hue;
m.FacialHairHue = hue;
m.SendLocalizedMessage(501199); // You dye your hair
_hairDye.Delete();
m.PlaySound(0x4E);
}
}
}
}
else
{
m.SendLocalizedMessage(501200); // You decide not to dye your hair
}
}
private class HairDyeEntry
{
public HairDyeEntry(string name, int hueStart, int hueCount)
{
Name = name;
HueStart = hueStart;
HueCount = hueCount;
}
public string Name { get; }
public int HueStart { get; }
public int HueCount { get; }
}
}

View file

@ -1,30 +1,14 @@
namespace Server.Items
using ModernUO.Serialization;
namespace Server.Items;
[SerializationGenerator(0, false)]
public partial class HoveringWisp : Item
{
public class HoveringWisp : Item
[Constructible]
public HoveringWisp() : base(0x2100)
{
[Constructible]
public HoveringWisp() : base(0x2100)
{
}
public HoveringWisp(Serial serial) : base(serial)
{
}
public override int LabelNumber => 1072881; // hovering wisp
public override void Serialize(IGenericWriter writer)
{
base.Serialize(writer);
writer.Write(0); // version
}
public override void Deserialize(IGenericReader reader)
{
base.Deserialize(reader);
var version = reader.ReadInt();
}
}
public override int LabelNumber => 1072881; // hovering wisp
}

View file

@ -1,21 +1,20 @@
namespace Server.Items
namespace Server.Items;
internal interface IDurability
{
internal interface IDurability
{
bool CanFortify { get; }
bool CanFortify { get; }
int InitMinHits { get; }
int InitMaxHits { get; }
int InitMinHits { get; }
int InitMaxHits { get; }
int HitPoints { get; set; }
int MaxHitPoints { get; set; }
int HitPoints { get; set; }
int MaxHitPoints { get; set; }
void ScaleDurability();
void UnscaleDurability();
}
internal interface IWearableDurability : IDurability
{
int OnHit(BaseWeapon weapon, int damageTaken);
}
void ScaleDurability();
void UnscaleDurability();
}
internal interface IWearableDurability : IDurability
{
int OnHit(BaseWeapon weapon, int damageTaken);
}

View file

@ -1,375 +1,351 @@
using ModernUO.Serialization;
using Server.Gumps;
using Server.Multis;
using Server.Network;
using Server.Targeting;
namespace Server.Items
namespace Server.Items;
public enum DecorateCommand
{
public enum DecorateCommand
None,
Turn,
Up,
Down
}
[SerializationGenerator(0, false)]
public partial class InteriorDecorator : Item
{
private DecorateCommand m_Command;
[Constructible]
public InteriorDecorator() : base(0xFC1)
{
None,
Turn,
Up,
Down
Weight = 1.0;
LootType = LootType.Blessed;
}
public class InteriorDecorator : Item
[CommandProperty(AccessLevel.GameMaster)]
public DecorateCommand Command
{
private DecorateCommand m_Command;
[Constructible]
public InteriorDecorator() : base(0xFC1)
get => m_Command;
set
{
Weight = 1.0;
LootType = LootType.Blessed;
m_Command = value;
InvalidateProperties();
}
}
public override int LabelNumber => 1041280; // an interior decorator
public override void GetProperties(IPropertyList list)
{
base.GetProperties(list);
if (m_Command != DecorateCommand.None)
{
list.Add(1018322 + (int)m_Command); // Turn/Up/Down
}
}
public override void OnDoubleClick(Mobile from)
{
if (!CheckUse(from))
{
return;
}
public InteriorDecorator(Serial serial) : base(serial)
if (!from.HasGump<InternalGump>())
{
from.SendGump(new InternalGump(this));
}
[CommandProperty(AccessLevel.GameMaster)]
public DecorateCommand Command
if (m_Command != DecorateCommand.None)
{
get => m_Command;
set
from.Target = new InternalTarget(this);
}
}
public static bool CheckUse(Mobile from)
{
if (BaseHouse.FindHouseAt(from)?.IsCoOwner(from) == true)
{
return true;
}
from.SendLocalizedMessage(502092); // You must be in your house to do this.
return false;
}
private class InternalGump : Gump
{
private readonly InteriorDecorator m_Decorator;
public InternalGump(InteriorDecorator decorator) : base(150, 50)
{
m_Decorator = decorator;
AddBackground(0, 0, 200, 200, 2600);
AddButton(50, 45, decorator.Command == DecorateCommand.Turn ? 2154 : 2152, 2154, 1);
AddHtmlLocalized(90, 50, 70, 40, 1018323); // Turn
AddButton(50, 95, decorator.Command == DecorateCommand.Up ? 2154 : 2152, 2154, 2);
AddHtmlLocalized(90, 100, 70, 40, 1018324); // Up
AddButton(50, 145, decorator.Command == DecorateCommand.Down ? 2154 : 2152, 2154, 3);
AddHtmlLocalized(90, 150, 70, 40, 1018325); // Down
}
public override void OnResponse(NetState sender, RelayInfo info)
{
var command = info.ButtonID switch
{
m_Command = value;
InvalidateProperties();
}
}
1 => DecorateCommand.Turn,
2 => DecorateCommand.Up,
3 => DecorateCommand.Down,
_ => DecorateCommand.None
};
public override int LabelNumber => 1041280; // an interior decorator
public override void GetProperties(IPropertyList list)
{
base.GetProperties(list);
if (m_Command != DecorateCommand.None)
if (command != DecorateCommand.None)
{
list.Add(1018322 + (int)m_Command); // Turn/Up/Down
}
}
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 (!CheckUse(this, from))
{
return;
}
if (!from.HasGump<InternalGump>())
{
from.SendGump(new InternalGump(this));
}
if (m_Command != DecorateCommand.None)
{
from.Target = new InternalTarget(this);
}
}
public static bool InHouse(Mobile from)
{
var house = BaseHouse.FindHouseAt(from);
return house?.IsCoOwner(from) == true;
}
public static bool CheckUse(InteriorDecorator tool, Mobile from)
{
/*if (tool.Deleted || !tool.IsChildOf( from.Backpack ))
from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
else*/
if (!InHouse(from))
{
from.SendLocalizedMessage(502092); // You must be in your house to do this.
m_Decorator.Command = command;
sender.Mobile.SendGump(new InternalGump(m_Decorator));
sender.Mobile.Target = new InternalTarget(m_Decorator);
}
else
{
return true;
}
return false;
}
private class InternalGump : Gump
{
private readonly InteriorDecorator m_Decorator;
public InternalGump(InteriorDecorator decorator) : base(150, 50)
{
m_Decorator = decorator;
AddBackground(0, 0, 200, 200, 2600);
AddButton(50, 45, decorator.Command == DecorateCommand.Turn ? 2154 : 2152, 2154, 1);
AddHtmlLocalized(90, 50, 70, 40, 1018323); // Turn
AddButton(50, 95, decorator.Command == DecorateCommand.Up ? 2154 : 2152, 2154, 2);
AddHtmlLocalized(90, 100, 70, 40, 1018324); // Up
AddButton(50, 145, decorator.Command == DecorateCommand.Down ? 2154 : 2152, 2154, 3);
AddHtmlLocalized(90, 150, 70, 40, 1018325); // Down
}
public override void OnResponse(NetState sender, RelayInfo info)
{
var command = info.ButtonID switch
{
1 => DecorateCommand.Turn,
2 => DecorateCommand.Up,
3 => DecorateCommand.Down,
_ => DecorateCommand.None
};
if (command != DecorateCommand.None)
{
m_Decorator.Command = command;
sender.Mobile.SendGump(new InternalGump(m_Decorator));
sender.Mobile.Target = new InternalTarget(m_Decorator);
}
else
{
Target.Cancel(sender.Mobile);
}
Target.Cancel(sender.Mobile);
}
}
}
private class InternalTarget : Target
private class InternalTarget : Target
{
private readonly InteriorDecorator m_Decorator;
public InternalTarget(InteriorDecorator decorator) : base(-1, false, TargetFlags.None)
{
private readonly InteriorDecorator m_Decorator;
CheckLOS = false;
public InternalTarget(InteriorDecorator decorator) : base(-1, false, TargetFlags.None)
m_Decorator = decorator;
}
protected override void OnTargetNotAccessible(Mobile from, object targeted)
{
OnTarget(from, targeted);
}
protected override void OnTarget(Mobile from, object targeted)
{
if (targeted is Item item && CheckUse(from))
{
CheckLOS = false;
var house = BaseHouse.FindHouseAt(from);
m_Decorator = decorator;
}
protected override void OnTargetNotAccessible(Mobile from, object targeted)
{
OnTarget(from, targeted);
}
protected override void OnTarget(Mobile from, object targeted)
{
if (targeted is Item item && CheckUse(m_Decorator, from))
{
var house = BaseHouse.FindHouseAt(from);
var isDecorableComponent = false;
object addon = null;
var count = 0;
if (item is AddonComponent component)
{
count = component.Addon.Components.Count;
addon = component.Addon;
}
else if (item is AddonContainerComponent containerComponent)
{
count = containerComponent.Addon.Components.Count;
addon = containerComponent.Addon;
}
else if (item is BaseAddonContainer container)
{
count = container.Components.Count;
addon = container;
}
if (addon != null)
{
if (count == 1 && Core.SE)
{
isDecorableComponent = true;
}
if (m_Decorator.Command == DecorateCommand.Turn)
{
var attributes =
(FlippableAddonAttribute[])addon.GetType()
.GetCustomAttributes(typeof(FlippableAddonAttribute), false);
if (attributes.Length > 0)
{
isDecorableComponent = true;
}
}
}
if (house?.IsCoOwner(from) != true)
{
from.SendLocalizedMessage(502092); // You must be in your house to do this.
}
else if (item.Parent != null || !house.IsInside(item))
{
from.SendLocalizedMessage(1042270); // That is not in your house.
}
else if (!house.HasLockedDownItem(item) && !house.HasSecureItem(item) && !isDecorableComponent)
{
if (item is AddonComponent && m_Decorator.Command == DecorateCommand.Up)
{
from.SendLocalizedMessage(1042274); // You cannot raise it up any higher.
}
else if (item is AddonComponent && m_Decorator.Command == DecorateCommand.Down)
{
from.SendLocalizedMessage(1042275); // You cannot lower it down any further.
}
else
{
from.SendLocalizedMessage(1042271); // That is not locked down.
}
}
else if (item is VendorRentalContract)
{
from.SendLocalizedMessage(1062491); // You cannot use the house decorator on that object.
}
else if (item.TotalWeight + item.PileWeight > 100)
{
from.SendLocalizedMessage(1042272); // That is too heavy.
}
else
{
switch (m_Decorator.Command)
{
case DecorateCommand.Up:
Up(item, from);
break;
case DecorateCommand.Down:
Down(item, from);
break;
case DecorateCommand.Turn:
Turn(item, from);
break;
}
}
}
from.Target = new InternalTarget(m_Decorator);
}
protected override void OnTargetCancel(Mobile from, TargetCancelType cancelType)
{
if (cancelType == TargetCancelType.Canceled)
{
from.CloseGump<InternalGump>();
}
}
private static void Turn(Item item, Mobile from)
{
var isDecorableComponent = false;
object addon = null;
var count = 0;
if (item is AddonComponent component)
{
count = component.Addon.Components.Count;
addon = component.Addon;
}
else if (item is AddonContainerComponent containerComponent)
{
count = containerComponent.Addon.Components.Count;
addon = containerComponent.Addon;
}
else if (item is BaseAddonContainer container)
{
count = container.Components.Count;
addon = container;
}
if (addon != null)
{
var aAttributes =
(FlippableAddonAttribute[])addon.GetType()
.GetCustomAttributes(typeof(FlippableAddonAttribute), false);
if (aAttributes.Length > 0)
if (count == 1 && Core.SE)
{
aAttributes[0].Flip(from, (Item)addon);
return;
isDecorableComponent = true;
}
if (m_Decorator.Command == DecorateCommand.Turn)
{
var attributes =
(FlippableAddonAttribute[])addon.GetType()
.GetCustomAttributes(typeof(FlippableAddonAttribute), false);
if (attributes.Length > 0)
{
isDecorableComponent = true;
}
}
}
var attributes =
(FlippableAttribute[])item.GetType().GetCustomAttributes(typeof(FlippableAttribute), false);
if (attributes.Length > 0)
if (house?.IsCoOwner(from) != true)
{
attributes[0].Flip(item);
from.SendLocalizedMessage(502092); // You must be in your house to do this.
}
else
else if (item.Parent != null || !house.IsInside(item))
{
from.SendLocalizedMessage(1042273); // You cannot turn that.
from.SendLocalizedMessage(1042270); // That is not in your house.
}
}
private static void Up(Item item, Mobile from)
{
var floorZ = GetFloorZ(item);
if (floorZ > int.MinValue && item.Z < floorZ + 15) // Confirmed : no height checks here
else if (!house.HasLockedDownItem(item) && !house.HasSecureItem(item) && !isDecorableComponent)
{
item.Location = new Point3D(item.Location.X, item.Location.Y, item.Z + 1);
}
else
{
from.SendLocalizedMessage(1042274); // You cannot raise it up any higher.
}
}
private static void Down(Item item, Mobile from)
{
var floorZ = GetFloorZ(item);
if (floorZ > int.MinValue && item.Z > GetFloorZ(item))
{
item.Location = new Point3D(item.Location.X, item.Location.Y, item.Z - 1);
}
else
{
from.SendLocalizedMessage(1042275); // You cannot lower it down any further.
}
}
private static int GetFloorZ(Item item)
{
var map = item.Map;
if (map == null)
{
return int.MinValue;
}
var tiles = map.Tiles.GetStaticTiles(item.X, item.Y, true);
var z = int.MinValue;
for (var i = 0; i < tiles.Length; ++i)
{
var tile = tiles[i];
var id = TileData.ItemTable[tile.ID & TileData.MaxItemValue];
var top = tile.Z; // Confirmed : no height checks here
if (id.Surface && !id.Impassable && top > z && top <= item.Z)
if (item is AddonComponent && m_Decorator.Command == DecorateCommand.Up)
{
z = top;
from.SendLocalizedMessage(1042274); // You cannot raise it up any higher.
}
else if (item is AddonComponent && m_Decorator.Command == DecorateCommand.Down)
{
from.SendLocalizedMessage(1042275); // You cannot lower it down any further.
}
else
{
from.SendLocalizedMessage(1042271); // That is not locked down.
}
}
else if (item is VendorRentalContract)
{
from.SendLocalizedMessage(1062491); // You cannot use the house decorator on that object.
}
else if (item.TotalWeight + item.PileWeight > 100)
{
from.SendLocalizedMessage(1042272); // That is too heavy.
}
else
{
switch (m_Decorator.Command)
{
case DecorateCommand.Up:
{
Up(item, from);
break;
}
case DecorateCommand.Down:
{
Down(item, from);
break;
}
case DecorateCommand.Turn:
{
Turn(item, from);
break;
}
}
}
return z;
}
from.Target = new InternalTarget(m_Decorator);
}
protected override void OnTargetCancel(Mobile from, TargetCancelType cancelType)
{
if (cancelType == TargetCancelType.Canceled)
{
from.CloseGump<InternalGump>();
}
}
private static void Turn(Item item, Mobile from)
{
object addon = null;
if (item is AddonComponent component)
{
addon = component.Addon;
}
else if (item is AddonContainerComponent containerComponent)
{
addon = containerComponent.Addon;
}
else if (item is BaseAddonContainer container)
{
addon = container;
}
if (addon != null)
{
var aAttributes =
(FlippableAddonAttribute[])addon.GetType()
.GetCustomAttributes(typeof(FlippableAddonAttribute), false);
if (aAttributes.Length > 0)
{
aAttributes[0].Flip(from, (Item)addon);
return;
}
}
var attributes =
(FlippableAttribute[])item.GetType().GetCustomAttributes(typeof(FlippableAttribute), false);
if (attributes.Length > 0)
{
attributes[0].Flip(item);
}
else
{
from.SendLocalizedMessage(1042273); // You cannot turn that.
}
}
private static void Up(Item item, Mobile from)
{
var floorZ = GetFloorZ(item);
if (floorZ > int.MinValue && item.Z < floorZ + 15) // Confirmed : no height checks here
{
item.Location = new Point3D(item.Location.X, item.Location.Y, item.Z + 1);
}
else
{
from.SendLocalizedMessage(1042274); // You cannot raise it up any higher.
}
}
private static void Down(Item item, Mobile from)
{
var floorZ = GetFloorZ(item);
if (floorZ > int.MinValue && item.Z > GetFloorZ(item))
{
item.Location = new Point3D(item.Location.X, item.Location.Y, item.Z - 1);
}
else
{
from.SendLocalizedMessage(1042275); // You cannot lower it down any further.
}
}
private static int GetFloorZ(Item item)
{
var map = item.Map;
if (map == null)
{
return int.MinValue;
}
var tiles = map.Tiles.GetStaticTiles(item.X, item.Y, true);
var z = int.MinValue;
for (var i = 0; i < tiles.Length; ++i)
{
var tile = tiles[i];
var id = TileData.ItemTable[tile.ID & TileData.MaxItemValue];
var top = tile.Z; // Confirmed : no height checks here
if (id.Surface && !id.Impassable && top > z && top <= item.Z)
{
z = top;
}
}
return z;
}
}
}

View file

@ -1,3 +1,4 @@
using ModernUO.Serialization;
using Server.Network;
using Server.Prompts;
using Server.Targeting;
@ -18,10 +19,26 @@ public interface ILockable
uint KeyValue { get; set; }
}
public class Key : Item
[SerializationGenerator(0, false)]
public partial class Key : Item
{
private string m_Description;
private uint m_KeyVal;
[SerializableField(0)]
[SerializableFieldAttr("[CommandProperty(AccessLevel.GameMaster)]")]
private int _maxRange;
[SerializableField(1)]
[SerializableFieldAttr("[CommandProperty(AccessLevel.GameMaster)]")]
private Item _link;
[SerializableField(2)]
[InvalidateProperties]
[SerializableFieldAttr("[CommandProperty(AccessLevel.GameMaster)]")]
private string _description;
[SerializableField(3)]
[InvalidateProperties]
[SerializableFieldAttr("[CommandProperty(AccessLevel.GameMaster)]")]
private uint _keyValue;
[Constructible]
public Key(uint val = 0) : this(KeyType.Iron, val)
@ -32,44 +49,11 @@ public class Key : Item
{
Weight = 1.0;
MaxRange = 3;
m_KeyVal = val;
Link = link;
_maxRange = 3;
_keyValue = val;
_link = link;
}
public Key(Serial serial) : base(serial)
{
}
[CommandProperty(AccessLevel.GameMaster)]
public string Description
{
get => m_Description;
set
{
m_Description = value;
InvalidateProperties();
}
}
[CommandProperty(AccessLevel.GameMaster)]
public int MaxRange { get; set; }
[CommandProperty(AccessLevel.GameMaster)]
public uint KeyValue
{
get => m_KeyVal;
set
{
m_KeyVal = value;
InvalidateProperties();
}
}
[CommandProperty(AccessLevel.GameMaster)]
public Item Link { get; set; }
public static uint RandomValue() => (uint)(0xFFFFFFFE * Utility.RandomDouble()) + 1;
public static void RemoveKeys(Mobile m, uint keyValue)
@ -105,7 +89,7 @@ public class Key : Item
{
var keyRing = (KeyRing)item;
keyRing.RemoveKeys(keyValue);
keyRing.RemoveKey(keyValue);
}
}
}
@ -142,56 +126,6 @@ public class Key : Item
return false;
}
public override void Serialize(IGenericWriter writer)
{
base.Serialize(writer);
writer.Write(2); // version
writer.Write(MaxRange);
writer.Write(Link);
writer.Write(m_Description);
writer.Write(m_KeyVal);
}
public override void Deserialize(IGenericReader reader)
{
base.Deserialize(reader);
var version = reader.ReadInt();
switch (version)
{
case 2:
{
MaxRange = reader.ReadInt();
goto case 1;
}
case 1:
{
Link = reader.ReadEntity<Item>();
goto case 0;
}
case 0:
{
if (version < 2 || MaxRange == 0)
{
MaxRange = 3;
}
m_Description = reader.ReadString();
m_KeyVal = reader.ReadUInt();
break;
}
}
}
public override void OnDoubleClick(Mobile from)
{
if (!IsChildOf(from.Backpack))
@ -203,7 +137,7 @@ public class Key : Item
Target t;
int number;
if (m_KeyVal != 0)
if (_keyValue != 0)
{
number = 501662; // What shall I use this key on?
t = new UnlockTarget(this);
@ -224,14 +158,7 @@ public class Key : Item
string desc;
if (m_KeyVal == 0)
{
desc = "(blank)";
}
else if ((desc = m_Description) == null || (desc = desc.Trim()).Length <= 0)
{
desc = null;
}
desc = _keyValue == 0 ? "(blank)" : _description.DefaultIfNullOrEmpty(null)?.Trim();
if (desc != null)
{
@ -243,18 +170,9 @@ public class Key : Item
{
base.OnSingleClick(from);
string desc;
var desc = _keyValue == 0 ? "(blank)" : _description.DefaultIfNullOrEmpty(null)?.Trim();
if (m_KeyVal == 0)
{
desc = "(blank)";
}
else
{
desc = m_Description?.Trim() ?? "";
}
if (desc.Length > 0)
if (desc != null)
{
from.NetState.SendMessage(Serial, ItemID, MessageType.Regular, 0x3B2, 3, false, "ENU", "", desc);
}
@ -262,85 +180,85 @@ public class Key : Item
public bool UseOn(Mobile from, ILockable o)
{
if (o.KeyValue == KeyValue)
if (o.KeyValue != KeyValue)
{
if (o is BaseDoor door && !door.UseLocks())
{
return false;
}
o.Locked = !o.Locked;
if (o is Item item)
{
if (o.Locked)
{
item.SendLocalizedMessageTo(from, 1048000); // You lock it.
}
else
{
item.SendLocalizedMessageTo(from, 1048001); // You unlock it.
}
if (item is LockableContainer cont)
{
if (cont.LockLevel == ILockpickable.MagicLock)
{
cont.LockLevel = cont.RequiredSkill - 10;
}
if (cont.TrapType != TrapType.None && cont.TrapOnLockpick)
{
if (o.Locked)
{
cont.SendLocalizedMessageTo(from, 501673); // You re-enable the trap.
}
else
{
// You disable the trap temporarily. Lock it again to re-enable it.
cont.SendLocalizedMessageTo(from, 501672);
}
}
}
}
return true;
return false;
}
return false;
if (o is BaseDoor door && !door.UseLocks())
{
return false;
}
o.Locked = !o.Locked;
if (o is Item item)
{
if (o.Locked)
{
item.SendLocalizedMessageTo(from, 1048000); // You lock it.
}
else
{
item.SendLocalizedMessageTo(from, 1048001); // You unlock it.
}
if (item is LockableContainer cont)
{
if (cont.LockLevel == ILockpickable.MagicLock)
{
cont.LockLevel = cont.RequiredSkill - 10;
}
if (cont.TrapType != TrapType.None && cont.TrapOnLockpick)
{
if (o.Locked)
{
cont.SendLocalizedMessageTo(from, 501673); // You re-enable the trap.
}
else
{
// You disable the trap temporarily. Lock it again to re-enable it.
cont.SendLocalizedMessageTo(from, 501672);
}
}
}
}
return true;
}
private class RenamePrompt : Prompt
{
private readonly Key m_Key;
private Key _key;
public RenamePrompt(Key key) => m_Key = key;
public RenamePrompt(Key key) => _key = key;
public override void OnResponse(Mobile from, string text)
{
if (m_Key.Deleted || !m_Key.IsChildOf(from.Backpack))
if (_key.Deleted || !_key.IsChildOf(from.Backpack))
{
from.SendLocalizedMessage(501661); // That key is unreachable.
return;
}
m_Key.Description = Utility.FixHtml(text);
_key.Description = Utility.FixHtml(text);
}
}
private class UnlockTarget : Target
{
private readonly Key m_Key;
private Key _key;
public UnlockTarget(Key key) : base(key.MaxRange, false, TargetFlags.None)
{
m_Key = key;
_key = key;
CheckLOS = false;
}
protected override void OnTarget(Mobile from, object targeted)
{
if (m_Key.Deleted || !m_Key.IsChildOf(from.Backpack))
if (_key.Deleted || !_key.IsChildOf(from.Backpack))
{
from.SendLocalizedMessage(501661); // That key is unreachable.
return;
@ -348,15 +266,15 @@ public class Key : Item
int number;
if (targeted == m_Key)
if (targeted == _key)
{
number = 501665; // Enter a description for this key.
from.Prompt = new RenamePrompt(m_Key);
from.Prompt = new RenamePrompt(_key);
}
else if (targeted is ILockable lockable)
{
if (m_Key.UseOn(from, lockable))
if (_key.UseOn(from, lockable))
{
number = -1;
}
@ -379,13 +297,13 @@ public class Key : Item
private class CopyTarget : Target
{
private readonly Key m_Key;
private Key _key;
public CopyTarget(Key key) : base(3, false, TargetFlags.None) => m_Key = key;
public CopyTarget(Key key) : base(3, false, TargetFlags.None) => _key = key;
protected override void OnTarget(Mobile from, object targeted)
{
if (m_Key.Deleted || !m_Key.IsChildOf(from.Backpack))
if (_key.Deleted || !_key.IsChildOf(from.Backpack))
{
from.SendLocalizedMessage(501661); // That key is unreachable.
return;
@ -395,7 +313,7 @@ public class Key : Item
if (targeted is Key k)
{
if (k.m_KeyVal == 0)
if (k._keyValue == 0)
{
number = 501675; // This key is also blank.
}
@ -403,18 +321,18 @@ public class Key : Item
{
number = 501676; // You make a copy of the key.
m_Key.Description = k.Description;
m_Key.KeyValue = k.KeyValue;
m_Key.Link = k.Link;
m_Key.MaxRange = k.MaxRange;
_key.Description = k.Description;
_key.KeyValue = k.KeyValue;
_key.Link = k.Link;
_key.MaxRange = k.MaxRange;
}
else if (Utility.RandomDouble() <= 0.1) // 10% chance to destroy the key
else if (Utility.RandomDouble() < 0.1) // 10% chance to destroy the key
{
from.SendLocalizedMessage(501677); // You fail to make a copy of the key.
number = 501678; // The key was destroyed in the attempt.
m_Key.Delete();
_key.Delete();
}
else
{

View file

@ -1,207 +1,183 @@
using System.Collections.Generic;
using ModernUO.Serialization;
using Server.Targeting;
namespace Server.Items
namespace Server.Items;
[SerializationGenerator(1)]
public partial class KeyRing : Item
{
public class KeyRing : Item
private const int MaxKeys = 20; // List capacity will be 32
[SerializableField(0)]
private List<Key> _keys;
[Constructible]
public KeyRing() : base(0x1011)
{
public static readonly int MaxKeys = 20;
Weight = 1.0; // They seem to have no weight on OSI ?!
_keys = new List<Key>();
}
[Constructible]
public KeyRing() : base(0x1011)
public override bool OnDragDrop(Mobile from, Item dropped)
{
if (!IsChildOf(from.Backpack))
{
Weight = 1.0; // They seem to have no weight on OSI ?!
Keys = new List<Key>();
}
public KeyRing(Serial serial) : base(serial)
{
}
public List<Key> Keys { get; private set; }
public override bool OnDragDrop(Mobile from, Item dropped)
{
if (!IsChildOf(from.Backpack))
{
from.SendLocalizedMessage(1060640); // The item must be in your backpack to use it.
return false;
}
if (dropped is not Key key || key.KeyValue == 0)
{
from.SendLocalizedMessage(501689); // Only non-blank keys can be put on a keyring.
return false;
}
if (Keys.Count >= MaxKeys)
{
from.SendLocalizedMessage(1008138); // This keyring is full.
return false;
}
Add(key);
from.SendLocalizedMessage(501691); // You put the key on the keyring.
return true;
}
public override void OnDoubleClick(Mobile from)
{
if (!IsChildOf(from.Backpack))
{
from.SendLocalizedMessage(1060640); // The item must be in your backpack to use it.
return;
}
from.SendLocalizedMessage(501680); // What do you want to unlock?
from.Target = new InternalTarget(this);
}
public override void OnDelete()
{
base.OnDelete();
foreach (var key in Keys)
{
key.Delete();
}
Keys.Clear();
}
public void Add(Key key)
{
key.Internalize();
Keys.Add(key);
UpdateItemID();
}
public void Open(Mobile from)
{
if (Parent is not Container cont)
{
return;
}
for (var i = Keys.Count - 1; i >= 0; i--)
{
var key = Keys[i];
if (!key.Deleted && !cont.TryDropItem(from, key, true))
{
break;
}
Keys.RemoveAt(i);
}
UpdateItemID();
}
public void RemoveKeys(uint keyValue)
{
for (var i = Keys.Count - 1; i >= 0; i--)
{
var key = Keys[i];
if (key.KeyValue == keyValue)
{
key.Delete();
Keys.RemoveAt(i);
}
}
UpdateItemID();
}
public bool ContainsKey(uint keyValue)
{
foreach (var key in Keys)
{
if (key.KeyValue == keyValue)
{
return true;
}
}
from.SendLocalizedMessage(1060640); // The item must be in your backpack to use it.
return false;
}
private void UpdateItemID()
if (dropped is not Key key || key.KeyValue == 0)
{
if (Keys.Count < 1)
from.SendLocalizedMessage(501689); // Only non-blank keys can be put on a keyring.
return false;
}
if (Keys.Count >= MaxKeys)
{
from.SendLocalizedMessage(1008138); // This keyring is full.
return false;
}
Add(key);
from.SendLocalizedMessage(501691); // You put the key on the keyring.
return true;
}
public override void OnDoubleClick(Mobile from)
{
if (!IsChildOf(from.Backpack))
{
from.SendLocalizedMessage(1060640); // The item must be in your backpack to use it.
return;
}
from.SendLocalizedMessage(501680); // What do you want to unlock?
from.Target = new InternalTarget(this);
}
public override void OnDelete()
{
base.OnDelete();
foreach (var key in Keys)
{
key.Delete();
}
this.Clear(_keys);
}
public void Add(Key key)
{
key.Internalize();
this.Add(_keys, key);
UpdateItemID();
}
public void Open(Mobile from)
{
if (Parent is not Container cont)
{
return;
}
for (var i = _keys.Count - 1; i >= 0; i--)
{
var key = _keys[i];
if (!key.Deleted && !cont.TryDropItem(from, key, true))
{
ItemID = 0x1011;
break;
}
else if (Keys.Count < 3)
this.RemoveAt(_keys, i);
}
UpdateItemID();
}
public void RemoveKey(uint keyValue)
{
for (var i = _keys.Count - 1; i >= 0; i--)
{
var key = _keys[i];
if (key.KeyValue == keyValue)
{
ItemID = 0x1769;
key.Delete();
this.RemoveAt(_keys, i);
}
else if (Keys.Count < 5)
}
UpdateItemID();
}
public bool ContainsKey(uint keyValue)
{
foreach (var key in _keys)
{
if (key.KeyValue == keyValue)
{
ItemID = 0x176A;
return true;
}
}
return false;
}
private void UpdateItemID()
{
ItemID = _keys.Count switch
{
< 1 => 0x1011,
< 3 => 0x1769,
< 5 => 0x176A,
_ => 0x176B
};
}
private void Deserialize(IGenericReader reader, int version)
{
_keys = reader.ReadEntityList<Key>();
}
private class InternalTarget : Target
{
private KeyRing _keyRing;
public InternalTarget(KeyRing keyRing) : base(-1, false, TargetFlags.None) => _keyRing = keyRing;
protected override void OnTarget(Mobile from, object targeted)
{
if (_keyRing.Deleted || !_keyRing.IsChildOf(from.Backpack))
{
from.SendLocalizedMessage(1060640); // The item must be in your backpack to use it.
return;
}
if (_keyRing == targeted)
{
_keyRing.Open(from);
from.SendLocalizedMessage(501685); // You open the keyring.
}
else if (targeted is ILockable o)
{
foreach (var key in _keyRing.Keys)
{
if (key.UseOn(from, o))
{
return;
}
}
from.SendLocalizedMessage(1008140); // You do not have a key for that.
}
else
{
ItemID = 0x176B;
}
}
public override void Serialize(IGenericWriter writer)
{
base.Serialize(writer);
writer.WriteEncodedInt(0); // version
writer.Write(Keys);
}
public override void Deserialize(IGenericReader reader)
{
base.Deserialize(reader);
var version = reader.ReadEncodedInt();
Keys = reader.ReadEntityList<Key>();
}
private class InternalTarget : Target
{
private readonly KeyRing m_KeyRing;
public InternalTarget(KeyRing keyRing) : base(-1, false, TargetFlags.None) => m_KeyRing = keyRing;
protected override void OnTarget(Mobile from, object targeted)
{
if (m_KeyRing.Deleted || !m_KeyRing.IsChildOf(from.Backpack))
{
from.SendLocalizedMessage(1060640); // The item must be in your backpack to use it.
return;
}
if (m_KeyRing == targeted)
{
m_KeyRing.Open(from);
from.SendLocalizedMessage(501685); // You open the keyring.
}
else if (targeted is ILockable o)
{
foreach (var key in m_KeyRing.Keys)
{
if (key.UseOn(from, o))
{
return;
}
}
from.SendLocalizedMessage(1008140); // You do not have a key for that.
}
else
{
from.SendLocalizedMessage(501666); // You can't unlock that!
}
from.SendLocalizedMessage(501666); // You can't unlock that!
}
}
}

View file

@ -1,78 +1,60 @@
using System;
using System.Buffers.Binary;
using ModernUO.Serialization;
using Server.Network;
namespace Server.Items
namespace Server.Items;
[SerializationGenerator(0, false)]
public partial class LOSBlocker : Item
{
public class LOSBlocker : Item
private const ushort GMItemId = 0x36FF;
[Constructible]
public LOSBlocker() : base(0x21A2) => Movable = false;
public LOSBlocker(Serial serial) : base(serial)
{
private const ushort GMItemId = 0x36FF;
}
[Constructible]
public LOSBlocker() : base(0x21A2) => Movable = false;
public override string DefaultName => "no line of sight";
public LOSBlocker(Serial serial) : base(serial)
public static void Initialize()
{
TileData.ItemTable[0x21A2].Flags = TileFlag.Wall | TileFlag.NoShoot;
TileData.ItemTable[0x21A2].Height = 20;
}
public override void SendWorldPacketTo(NetState ns, ReadOnlySpan<byte> world = default)
{
var mob = ns.Mobile;
if (AccessLevel.GameMaster >= mob?.AccessLevel)
{
base.SendWorldPacketTo(ns, world);
return;
}
public override string DefaultName => "no line of sight";
SendGMItem(ns);
}
public static void Initialize()
private void SendGMItem(NetState ns)
{
// GM Packet
Span<byte> buffer = stackalloc byte[OutgoingEntityPackets.MaxWorldEntityPacketLength].InitializePacket();
int length;
if (ns.StygianAbyss)
{
TileData.ItemTable[0x21A2].Flags = TileFlag.Wall | TileFlag.NoShoot;
TileData.ItemTable[0x21A2].Height = 20;
length = OutgoingEntityPackets.CreateWorldEntity(buffer, this, ns.HighSeas);
BinaryPrimitives.WriteUInt16BigEndian(buffer[8..10], GMItemId);
}
else
{
length = OutgoingItemPackets.CreateWorldItem(buffer, this);
BinaryPrimitives.WriteUInt16BigEndian(buffer[7..9], GMItemId);
}
public override void SendWorldPacketTo(NetState ns, ReadOnlySpan<byte> world = default)
{
var mob = ns.Mobile;
if (AccessLevel.GameMaster >= mob?.AccessLevel)
{
base.SendWorldPacketTo(ns, world);
return;
}
SendGMItem(ns);
}
private void SendGMItem(NetState ns)
{
// GM Packet
Span<byte> buffer = stackalloc byte[OutgoingEntityPackets.MaxWorldEntityPacketLength].InitializePacket();
int length;
if (ns.StygianAbyss)
{
length = OutgoingEntityPackets.CreateWorldEntity(buffer, this, ns.HighSeas);
BinaryPrimitives.WriteUInt16BigEndian(buffer[8..10], GMItemId);
}
else
{
length = OutgoingItemPackets.CreateWorldItem(buffer, this);
BinaryPrimitives.WriteUInt16BigEndian(buffer[7..9], GMItemId);
}
ns.Send(buffer[..length]);
}
public override void Serialize(IGenericWriter writer)
{
base.Serialize(writer);
writer.Write(1);
}
public override void Deserialize(IGenericReader reader)
{
base.Deserialize(reader);
var version = reader.ReadInt();
if (version < 1 && ItemID == 0x2199)
{
ItemID = 0x21A2;
}
}
ns.Send(buffer[..length]);
}
}

View file

@ -1,206 +1,171 @@
using System;
using ModernUO.Serialization;
using Server.Factions;
using Server.Mobiles;
using Server.Network;
namespace Server.Items
namespace Server.Items;
public enum MoonstoneType
{
public enum MoonstoneType
Felucca,
Trammel
}
[SerializationGenerator(1, false)]
public partial class Moonstone : Item
{
[InvalidateProperties]
[SerializableField(0)]
[SerializableFieldAttr("[CommandProperty(AccessLevel.GameMaster)]")]
private MoonstoneType _type;
[Constructible]
public Moonstone(MoonstoneType type) : base(0xF8B)
{
Felucca,
Trammel
Weight = 1.0;
_type = type;
}
public class Moonstone : Item
public override int LabelNumber => 1041490 + (int)_type;
public override void OnSingleClick(Mobile from)
{
private MoonstoneType m_Type;
[Constructible]
public Moonstone(MoonstoneType type) : base(0xF8B)
if (IsChildOf(from.Backpack))
{
Weight = 1.0;
m_Type = type;
Hue = Utility.RandomBirdHue();
ProcessDelta();
from.SendLocalizedMessage(1005398); // The stone's substance shifts as you examine it.
}
public Moonstone(Serial serial) : base(serial)
base.OnSingleClick(from);
}
public override void OnDoubleClick(Mobile from)
{
if (!IsChildOf(from.Backpack))
{
from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
}
else if (from.Mounted)
{
from.SendLocalizedMessage(1005399); // You can not bury a stone while you sit on a mount.
}
else if (!from.Body.IsHuman)
{
from.SendLocalizedMessage(1005400); // You can not bury a stone in this form.
}
else if (Sigil.ExistsOn(from))
{
from.SendLocalizedMessage(1061632); // You can't do that while carrying the sigil.
}
else if (from.Map == GetTargetMap() || from.Map != Map.Trammel && from.Map != Map.Felucca)
{
from.SendLocalizedMessage(1005401); // You cannot bury the stone here.
}
else if (from is PlayerMobile mobile && mobile.Young)
{
mobile.SendLocalizedMessage(1049543); // You decide against traveling to Felucca while you are still young.
}
else if (from.Kills >= 5)
{
// The magic of the stone cannot be evoked by someone with blood on their hands.
from.SendLocalizedMessage(1005402);
}
else if (from.Criminal)
{
from.SendLocalizedMessage(1005403); // The magic of the stone cannot be evoked by the lawless.
}
else if (!Region.Find(from.Location, from.Map).IsDefault ||
!Region.Find(from.Location, GetTargetMap()).IsDefault)
{
from.SendLocalizedMessage(1005401); // You cannot bury the stone here.
}
else if (!GetTargetMap().CanFit(from.Location, 16))
{
from.SendLocalizedMessage(1005408); // Something is blocking the facet gate exit.
}
else
{
Movable = false;
MoveToWorld(from.Location, from.Map);
from.Animate(32, 5, 1, true, false, 0);
new SettleTimer(this, from.Location, from.Map, GetTargetMap(), from).Start();
}
}
public Map GetTargetMap() => _type == MoonstoneType.Felucca ? Map.Felucca : Map.Trammel;
private void Deserialize(IGenericReader reader, int version)
{
_type = (MoonstoneType)reader.ReadInt();
}
private class SettleTimer : Timer
{
private Mobile _caster;
private Point3D _location;
private Map _map;
private Item _stone;
private Map _targetMap;
private int _count;
public SettleTimer(Item stone, Point3D loc, Map map, Map targetMap, Mobile caster) : base(
TimeSpan.FromSeconds(2.5),
TimeSpan.FromSeconds(1.0)
)
{
_stone = stone;
_location = loc;
_map = map;
_targetMap = targetMap;
_caster = caster;
}
[CommandProperty(AccessLevel.GameMaster)]
public MoonstoneType Type
protected override void OnTick()
{
get => m_Type;
set
++_count;
if (_count == 1)
{
m_Type = value;
InvalidateProperties();
_stone.PublicOverheadMessage(MessageType.Regular, 0x3B2, 1005414); // The stone settles into the ground.
}
}
public override int LabelNumber => 1041490 + (int)m_Type;
public override void OnSingleClick(Mobile from)
{
if (IsChildOf(from.Backpack))
else if (_count >= 10)
{
Hue = Utility.RandomBirdHue();
ProcessDelta();
from.SendLocalizedMessage(1005398); // The stone's substance shifts as you examine it.
}
_stone.Location = new Point3D(_stone.X, _stone.Y, _stone.Z - 1);
base.OnSingleClick(from);
}
public override void OnDoubleClick(Mobile from)
{
if (!IsChildOf(from.Backpack))
{
from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
}
else if (from.Mounted)
{
from.SendLocalizedMessage(1005399); // You can not bury a stone while you sit on a mount.
}
else if (!from.Body.IsHuman)
{
from.SendLocalizedMessage(1005400); // You can not bury a stone in this form.
}
else if (Sigil.ExistsOn(from))
{
from.SendLocalizedMessage(1061632); // You can't do that while carrying the sigil.
}
else if (from.Map == GetTargetMap() || from.Map != Map.Trammel && from.Map != Map.Felucca)
{
from.SendLocalizedMessage(1005401); // You cannot bury the stone here.
}
else if (from is PlayerMobile mobile && mobile.Young)
{
mobile.SendLocalizedMessage(1049543); // You decide against traveling to Felucca while you are still young.
}
else if (from.Kills >= 5)
{
from.SendLocalizedMessage(
1005402
); // The magic of the stone cannot be evoked by someone with blood on their hands.
}
else if (from.Criminal)
{
from.SendLocalizedMessage(1005403); // The magic of the stone cannot be evoked by the lawless.
}
else if (!Region.Find(from.Location, from.Map).IsDefault ||
!Region.Find(from.Location, GetTargetMap()).IsDefault)
{
from.SendLocalizedMessage(1005401); // You cannot bury the stone here.
}
else if (!GetTargetMap().CanFit(from.Location, 16))
{
from.SendLocalizedMessage(1005408); // Something is blocking the facet gate exit.
}
else
{
Movable = false;
MoveToWorld(from.Location, from.Map);
from.Animate(32, 5, 1, true, false, 0);
new SettleTimer(this, from.Location, from.Map, GetTargetMap(), from).Start();
}
}
public Map GetTargetMap() => m_Type == MoonstoneType.Felucca ? Map.Felucca : Map.Trammel;
public override void Serialize(IGenericWriter writer)
{
base.Serialize(writer);
writer.Write(0); // version
writer.Write((int)m_Type);
}
public override void Deserialize(IGenericReader reader)
{
base.Deserialize(reader);
var version = reader.ReadInt();
switch (version)
{
case 0:
{
m_Type = (MoonstoneType)reader.ReadInt();
break;
}
}
}
private class SettleTimer : Timer
{
private readonly Mobile m_Caster;
private readonly Point3D m_Location;
private readonly Map m_Map;
private readonly Item m_Stone;
private readonly Map m_TargetMap;
private int m_Count;
public SettleTimer(Item stone, Point3D loc, Map map, Map targetMap, Mobile caster) : base(
TimeSpan.FromSeconds(2.5),
TimeSpan.FromSeconds(1.0)
)
{
m_Stone = stone;
m_Location = loc;
m_Map = map;
m_TargetMap = targetMap;
m_Caster = caster;
}
protected override void OnTick()
{
++m_Count;
if (m_Count == 1)
if (_count == 16)
{
m_Stone.PublicOverheadMessage(MessageType.Regular, 0x3B2, 1005414); // The stone settles into the ground.
}
else if (m_Count >= 10)
{
m_Stone.Location = new Point3D(m_Stone.X, m_Stone.Y, m_Stone.Z - 1);
if (m_Count == 16)
if (!Region.Find(_location, _map).IsDefault || !Region.Find(_location, _targetMap).IsDefault)
{
if (!Region.Find(m_Location, m_Map).IsDefault || !Region.Find(m_Location, m_TargetMap).IsDefault)
{
m_Stone.Movable = true;
m_Caster.AddToBackpack(m_Stone);
Stop();
return;
}
if (!m_TargetMap.CanFit(m_Location, 16))
{
m_Stone.Movable = true;
m_Caster.AddToBackpack(m_Stone);
Stop();
return;
}
var hue = m_Stone.Hue;
if (hue == 0)
{
hue = Utility.RandomBirdHue();
}
new MoonstoneGate(m_Location, m_TargetMap, m_Map, m_Caster, hue);
new MoonstoneGate(m_Location, m_Map, m_TargetMap, m_Caster, hue);
m_Stone.Delete();
_stone.Movable = true;
_caster.AddToBackpack(_stone);
Stop();
return;
}
if (!_targetMap.CanFit(_location, 16))
{
_stone.Movable = true;
_caster.AddToBackpack(_stone);
Stop();
return;
}
var hue = _stone.Hue;
if (hue == 0)
{
hue = Utility.RandomBirdHue();
}
new MoonstoneGate(_location, _targetMap, _map, _caster, hue);
new MoonstoneGate(_location, _map, _targetMap, _caster, hue);
_stone.Delete();
Stop();
}
}
}

View file

@ -1,87 +1,70 @@
using System;
using ModernUO.Serialization;
using Server.Engines.PartySystem;
namespace Server.Items
namespace Server.Items;
[SerializationGenerator(0, false)]
public partial class MoonstoneGate : Moongate
{
public class MoonstoneGate : Moongate
private Mobile _caster;
public MoonstoneGate(Point3D loc, Map map, Map targetMap, Mobile caster, int hue) : base(loc, targetMap)
{
private readonly Mobile m_Caster;
MoveToWorld(loc, map);
Dispellable = false;
Hue = hue;
public MoonstoneGate(Point3D loc, Map map, Map targetMap, Mobile caster, int hue) : base(loc, targetMap)
_caster = caster;
new InternalTimer(this).Start();
Effects.PlaySound(loc, map, 0x20E);
}
public override void CheckGate(Mobile m, int range)
{
if (m.Kills >= 5)
{
MoveToWorld(loc, map);
Dispellable = false;
Hue = hue;
m_Caster = caster;
new InternalTimer(this).Start();
Effects.PlaySound(loc, map, 0x20E);
return;
}
public MoonstoneGate(Serial serial) : base(serial)
var casterParty = Party.Get(_caster);
var userParty = Party.Get(m);
if (m == _caster || casterParty != null && userParty == casterParty)
{
}
public override void CheckGate(Mobile m, int range)
{
if (m.Kills >= 5)
{
return;
}
var casterParty = Party.Get(m_Caster);
var userParty = Party.Get(m);
if (m == m_Caster || casterParty != null && userParty == casterParty)
{
base.CheckGate(m, range);
}
}
public override void UseGate(Mobile m)
{
if (m.Kills >= 5)
{
return;
}
var casterParty = Party.Get(m_Caster);
var userParty = Party.Get(m);
if (m == m_Caster || casterParty != null && userParty == casterParty)
{
base.UseGate(m);
}
}
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();
Delete();
}
private class InternalTimer : Timer
{
private readonly Item m_Item;
public InternalTimer(Item item) : base(TimeSpan.FromSeconds(30.0)) => m_Item = item;
protected override void OnTick()
{
m_Item.Delete();
}
base.CheckGate(m, range);
}
}
public override void UseGate(Mobile m)
{
if (m.Kills >= 5)
{
return;
}
var casterParty = Party.Get(_caster);
var userParty = Party.Get(m);
if (m == _caster || casterParty != null && userParty == casterParty)
{
base.UseGate(m);
}
}
[AfterDeserialization(false)]
private void AfterDeserialization()
{
Delete();
}
private class InternalTimer : Timer
{
private Item _item;
public InternalTimer(Item item) : base(TimeSpan.FromSeconds(30.0)) => _item = item;
protected override void OnTick() => _item.Delete();
}
}

View file

@ -1,143 +1,103 @@
namespace Server.Items
using System;
using ModernUO.Serialization;
namespace Server.Items;
[SerializationGenerator(0, false)]
public partial class MorphItem : Item
{
public class MorphItem : Item
[SerializableField(1)]
[SerializableFieldAttr("[CommandProperty(AccessLevel.GameMaster)]")]
private int _inactiveItemId;
[SerializableField(2)]
[SerializableFieldAttr("[CommandProperty(AccessLevel.GameMaster)]")]
private int _activeItemId;
[Constructible]
public MorphItem(int inactiveItemID, int activeItemID, int range) : this(inactiveItemID, activeItemID, range, range)
{
private int m_InsideRange;
private int m_OutsideRange;
}
[Constructible]
public MorphItem(int inactiveItemID, int activeItemID, int range) : this(inactiveItemID, activeItemID, range, range)
[Constructible]
public MorphItem(int inactiveItemID, int activeItemID, int inRange, int outRange) : base(inactiveItemID)
{
Movable = false;
_inactiveItemId = inactiveItemID;
_activeItemId = activeItemID;
_insideRange = inRange;
_outsideRange = outRange;
}
[SerializableProperty(0)]
[CommandProperty(AccessLevel.GameMaster)]
public int OutsideRange
{
get => _outsideRange;
set => _outsideRange = Math.Clamp(value, 0, 18);
}
[SerializableProperty(3)]
[CommandProperty(AccessLevel.GameMaster)]
public int InsideRange
{
get => _insideRange;
set => _insideRange = Math.Clamp(value, 0, 18);
}
[CommandProperty(AccessLevel.GameMaster)]
public int CurrentRange => ItemID == _inactiveItemId ? _insideRange : _outsideRange;
public override bool HandlesOnMovement => true;
public override void OnMovement(Mobile m, Point3D oldLocation)
{
if (Utility.InRange(m.Location, Location, CurrentRange) || Utility.InRange(oldLocation, Location, CurrentRange))
{
}
[Constructible]
public MorphItem(int inactiveItemID, int activeItemID, int inRange, int outRange) : base(inactiveItemID)
{
Movable = false;
InactiveItemID = inactiveItemID;
ActiveItemID = activeItemID;
InsideRange = inRange;
OutsideRange = outRange;
}
public MorphItem(Serial serial) : base(serial)
{
}
[CommandProperty(AccessLevel.GameMaster)]
public int InactiveItemID { get; set; }
[CommandProperty(AccessLevel.GameMaster)]
public int ActiveItemID { get; set; }
[CommandProperty(AccessLevel.GameMaster)]
public int InsideRange
{
get => m_InsideRange;
set => m_InsideRange = value > 18 ? 18 :
value < 0 ? 0 : value;
}
[CommandProperty(AccessLevel.GameMaster)]
public int OutsideRange
{
get => m_OutsideRange;
set => m_OutsideRange = value > 18 ? 18 :
value < 0 ? 0 : value;
}
[CommandProperty(AccessLevel.GameMaster)]
public int CurrentRange => ItemID == InactiveItemID ? InsideRange : OutsideRange;
public override bool HandlesOnMovement => true;
public override void OnMovement(Mobile m, Point3D oldLocation)
{
if (Utility.InRange(m.Location, Location, CurrentRange) || Utility.InRange(oldLocation, Location, CurrentRange))
{
Refresh();
}
}
public override void OnMapChange()
{
if (!Deleted)
{
Refresh();
}
}
public override void OnLocationChange(Point3D oldLoc)
{
if (!Deleted)
{
Refresh();
}
}
public void Refresh()
{
var found = false;
var eable = GetMobilesInRange(CurrentRange);
foreach (var mob in eable)
{
if (!mob.Hidden || mob.AccessLevel <= AccessLevel.Player)
{
found = true;
break;
}
}
eable.Free();
ItemID = found ? ActiveItemID : InactiveItemID;
Visible = ItemID != 0x1;
}
public override void Serialize(IGenericWriter writer)
{
base.Serialize(writer);
writer.Write(1); // version
writer.Write(m_OutsideRange);
writer.Write(InactiveItemID);
writer.Write(ActiveItemID);
writer.Write(m_InsideRange);
}
public override void Deserialize(IGenericReader reader)
{
base.Deserialize(reader);
var version = reader.ReadInt();
switch (version)
{
case 1:
{
m_OutsideRange = reader.ReadInt();
goto case 0;
}
case 0:
{
InactiveItemID = reader.ReadInt();
ActiveItemID = reader.ReadInt();
m_InsideRange = reader.ReadInt();
if (version < 1)
{
m_OutsideRange = m_InsideRange;
}
break;
}
}
Timer.StartTimer(Refresh);
Refresh();
}
}
public override void OnMapChange()
{
if (!Deleted)
{
Refresh();
}
}
public override void OnLocationChange(Point3D oldLoc)
{
if (!Deleted)
{
Refresh();
}
}
public void Refresh()
{
var found = false;
var eable = GetMobilesInRange(CurrentRange);
foreach (var mob in eable)
{
if (!mob.Hidden || mob.AccessLevel <= AccessLevel.Player)
{
found = true;
break;
}
}
eable.Free();
ItemID = found ? _activeItemId : _inactiveItemId;
Visible = ItemID != 0x1;
}
[AfterDeserialization]
private void AfterDeserialization()
{
Refresh();
}
}

View file

@ -1,160 +1,139 @@
using System;
using ModernUO.Serialization;
using Server.Mobiles;
using Server.Network;
using Server.Targeting;
namespace Server.Items
namespace Server.Items;
[SerializationGenerator(0, false)]
public partial class OilCloth : Item, IScissorable, IDyable
{
public class OilCloth : Item, IScissorable, IDyable
[Constructible]
public OilCloth() : base(0x175D) => Hue = 2001;
public override int LabelNumber => 1041498; // oil cloth
public override double DefaultWeight => 1.0;
public bool Dye(Mobile from, DyeTub sender)
{
[Constructible]
public OilCloth() : base(0x175D) => Hue = 2001;
public OilCloth(Serial serial) : base(serial)
if (Deleted)
{
return false;
}
public override int LabelNumber => 1041498; // oil cloth
Hue = sender.DyedHue;
public override double DefaultWeight => 1.0;
return true;
}
public bool Dye(Mobile from, DyeTub sender)
public bool Scissor(Mobile from, Scissors scissors)
{
if (Deleted || !from.CanSee(this))
{
if (Deleted)
{
return false;
}
Hue = sender.DyedHue;
return true;
return false;
}
public bool Scissor(Mobile from, Scissors scissors)
ScissorHelper(from, new Bandage(), 1);
return true;
}
public override void OnDoubleClick(Mobile from)
{
if (IsChildOf(from.Backpack))
{
if (Deleted || !from.CanSee(this))
{
return false;
}
ScissorHelper(from, new Bandage(), 1);
return true;
from.BeginTarget(-1, false, TargetFlags.None, OnTarget);
from.SendLocalizedMessage(1005424); // Select the weapon or armor you wish to use the cloth on.
}
public override void OnDoubleClick(Mobile from)
else
{
if (IsChildOf(from.Backpack))
from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
}
}
public void OnTarget(Mobile from, object obj)
{
// TODO: Need details on how oil cloths should get consumed here
if (!IsChildOf(from.Backpack))
{
from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
}
else if (obj is Item item && item.RootParent != from)
{
from.SendLocalizedMessage(1005425); // You may only wipe down items you are holding or carrying.
}
else if (obj is BaseWeapon weapon)
{
if (weapon.Poison == null || weapon.PoisonCharges <= 0)
{
from.BeginTarget(-1, false, TargetFlags.None, OnTarget);
from.SendLocalizedMessage(1005424); // Select the weapon or armor you wish to use the cloth on.
// Hmmmm... this does not need to be cleaned.
from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1005422);
}
else
{
from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
if (weapon.PoisonCharges < 2)
{
weapon.PoisonCharges = 0;
}
else
{
weapon.PoisonCharges -= 2;
}
if (weapon.PoisonCharges > 0)
{
from.SendLocalizedMessage(1005423); // You have removed some of the caustic substance, but not all.
}
else
{
from.SendLocalizedMessage(1010497); // You have cleaned the item.
}
}
}
public void OnTarget(Mobile from, object obj)
else if (obj == from && obj is PlayerMobile pm)
{
// TODO: Need details on how oil cloths should get consumed here
if (!IsChildOf(from.Backpack))
if (pm.BodyMod == 183 || pm.BodyMod == 184)
{
from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
}
else if (obj is Item item && item.RootParent != from)
{
from.SendLocalizedMessage(1005425); // You may only wipe down items you are holding or carrying.
}
else if (obj is BaseWeapon weapon)
{
if (weapon.Poison == null || weapon.PoisonCharges <= 0)
{
from.LocalOverheadMessage(
MessageType.Regular,
0x3B2,
1005422
); // Hmmmm... this does not need to be cleaned.
}
else
{
if (weapon.PoisonCharges < 2)
{
weapon.PoisonCharges = 0;
}
else
{
weapon.PoisonCharges -= 2;
}
pm.SavagePaintExpiration = TimeSpan.Zero;
if (weapon.PoisonCharges > 0)
{
from.SendLocalizedMessage(1005423); // You have removed some of the caustic substance, but not all.
}
else
{
from.SendLocalizedMessage(1010497); // You have cleaned the item.
}
}
}
else if (obj == from && obj is PlayerMobile pm)
{
if (pm.BodyMod == 183 || pm.BodyMod == 184)
{
pm.SavagePaintExpiration = TimeSpan.Zero;
pm.BodyMod = 0;
pm.HueMod = -1;
pm.BodyMod = 0;
pm.HueMod = -1;
from.SendLocalizedMessage(1040006); // You wipe away all of your body paint.
from.SendLocalizedMessage(1040006); // You wipe away all of your body paint.
Consume();
}
else
{
from.LocalOverheadMessage(
MessageType.Regular,
0x3B2,
1005422
); // Hmmmm... this does not need to be cleaned.
}
}
else if (obj is BaseBeverage beverage)
{
if (beverage.Content == BeverageType.Liquor)
{
var bomb = new Firebomb(beverage.ItemID);
bomb.Name = beverage.Name;
beverage.ReplaceWith(bomb);
from.SendLocalizedMessage(1060580); // You prepare a firebomb.
Consume();
}
}
else if (obj is Firebomb)
{
from.SendLocalizedMessage(1060579); // That is already a firebomb!
Consume();
}
else
{
from.SendLocalizedMessage(1005426); // The cloth will not work on that.
// Hmmmm... this does not need to be cleaned.
from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1005422);
}
}
public override void Serialize(IGenericWriter writer)
else if (obj is BaseBeverage beverage)
{
base.Serialize(writer);
if (beverage.Content == BeverageType.Liquor)
{
var bomb = new Firebomb(beverage.ItemID)
{
Name = beverage.Name
};
writer.Write(0);
beverage.ReplaceWith(bomb);
from.SendLocalizedMessage(1060580); // You prepare a firebomb.
Consume();
}
}
public override void Deserialize(IGenericReader reader)
else if (obj is Firebomb)
{
base.Deserialize(reader);
var version = reader.ReadInt();
from.SendLocalizedMessage(1060579); // That is already a firebomb!
}
else
{
from.SendLocalizedMessage(1005426); // The cloth will not work on that.
}
}
}

View file

@ -1,216 +1,97 @@
namespace Server.Items
using ModernUO.Serialization;
namespace Server.Items;
[SerializationGenerator(0)]
public partial class OrigamiPaper : Item
{
public class OrigamiPaper : Item
[Constructible]
public OrigamiPaper() : base(0x2830)
{
[Constructible]
public OrigamiPaper() : base(0x2830)
{
}
public OrigamiPaper(Serial serial) : base(serial)
{
}
public override int LabelNumber => 1030288; // origami paper
public override void OnDoubleClick(Mobile from)
{
if (!IsChildOf(from.Backpack))
{
from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
}
else
{
Delete();
Item i = Utility.Random(from.BAC >= 5 ? 6 : 5) switch
{
0 => new OrigamiButterfly(),
1 => new OrigamiSwan(),
2 => new OrigamiFrog(),
3 => new OrigamiShape(),
4 => new OrigamiSongbird(),
5 => new OrigamiFish(),
_ => null
};
if (i != null)
{
from.AddToBackpack(i);
}
from.SendLocalizedMessage(1070822); // You fold the paper into an interesting shape.
}
}
public override void Serialize(IGenericWriter writer)
{
base.Serialize(writer);
writer.WriteEncodedInt(0);
}
public override void Deserialize(IGenericReader reader)
{
base.Deserialize(reader);
var version = reader.ReadEncodedInt();
}
}
public class OrigamiButterfly : Item
public override int LabelNumber => 1030288; // origami paper
public override void OnDoubleClick(Mobile from)
{
[Constructible]
public OrigamiButterfly() : base(0x2838) => LootType = LootType.Blessed;
public OrigamiButterfly(Serial serial) : base(serial)
if (!IsChildOf(from.Backpack))
{
from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
return;
}
public override int LabelNumber => 1030296; // a delicate origami butterfly
Delete();
public override void Serialize(IGenericWriter writer)
Item i = Utility.Random(from.BAC >= 5 ? 6 : 5) switch
{
base.Serialize(writer);
0 => new OrigamiButterfly(),
1 => new OrigamiSwan(),
2 => new OrigamiFrog(),
3 => new OrigamiShape(),
4 => new OrigamiSongbird(),
5 => new OrigamiFish(),
_ => null
};
writer.WriteEncodedInt(0);
if (i != null)
{
from.AddToBackpack(i);
}
public override void Deserialize(IGenericReader reader)
{
base.Deserialize(reader);
var version = reader.ReadEncodedInt();
}
}
public class OrigamiSwan : Item
{
[Constructible]
public OrigamiSwan() : base(0x2839) => LootType = LootType.Blessed;
public OrigamiSwan(Serial serial) : base(serial)
{
}
public override int LabelNumber => 1030297; // a delicate origami swan
public override void Serialize(IGenericWriter writer)
{
base.Serialize(writer);
writer.WriteEncodedInt(0);
}
public override void Deserialize(IGenericReader reader)
{
base.Deserialize(reader);
var version = reader.ReadEncodedInt();
}
}
public class OrigamiFrog : Item
{
[Constructible]
public OrigamiFrog() : base(0x283A) => LootType = LootType.Blessed;
public OrigamiFrog(Serial serial) : base(serial)
{
}
public override int LabelNumber => 1030298; // a delicate origami frog
public override void Serialize(IGenericWriter writer)
{
base.Serialize(writer);
writer.WriteEncodedInt(0);
}
public override void Deserialize(IGenericReader reader)
{
base.Deserialize(reader);
var version = reader.ReadEncodedInt();
}
}
public class OrigamiShape : Item
{
[Constructible]
public OrigamiShape() : base(0x283B) => LootType = LootType.Blessed;
public OrigamiShape(Serial serial) : base(serial)
{
}
public override int LabelNumber => 1030299; // an intricate geometric origami shape
public override void Serialize(IGenericWriter writer)
{
base.Serialize(writer);
writer.WriteEncodedInt(0);
}
public override void Deserialize(IGenericReader reader)
{
base.Deserialize(reader);
var version = reader.ReadEncodedInt();
}
}
public class OrigamiSongbird : Item
{
[Constructible]
public OrigamiSongbird() : base(0x283C) => LootType = LootType.Blessed;
public OrigamiSongbird(Serial serial) : base(serial)
{
}
public override int LabelNumber => 1030300; // a delicate origami songbird
public override void Serialize(IGenericWriter writer)
{
base.Serialize(writer);
writer.WriteEncodedInt(0);
}
public override void Deserialize(IGenericReader reader)
{
base.Deserialize(reader);
var version = reader.ReadEncodedInt();
}
}
public class OrigamiFish : Item
{
[Constructible]
public OrigamiFish() : base(0x283D) => LootType = LootType.Blessed;
public OrigamiFish(Serial serial) : base(serial)
{
}
public override int LabelNumber => 1030301; // a delicate origami fish
public override void Serialize(IGenericWriter writer)
{
base.Serialize(writer);
writer.WriteEncodedInt(0);
}
public override void Deserialize(IGenericReader reader)
{
base.Deserialize(reader);
var version = reader.ReadEncodedInt();
}
from.SendLocalizedMessage(1070822); // You fold the paper into an interesting shape.
}
}
[SerializationGenerator(0)]
public partial class OrigamiButterfly : Item
{
[Constructible]
public OrigamiButterfly() : base(0x2838) => LootType = LootType.Blessed;
public override int LabelNumber => 1030296; // a delicate origami butterfly
}
[SerializationGenerator(0)]
public partial class OrigamiSwan : Item
{
[Constructible]
public OrigamiSwan() : base(0x2839) => LootType = LootType.Blessed;
public override int LabelNumber => 1030297; // a delicate origami swan
}
[SerializationGenerator(0)]
public partial class OrigamiFrog : Item
{
[Constructible]
public OrigamiFrog() : base(0x283A) => LootType = LootType.Blessed;
public override int LabelNumber => 1030298; // a delicate origami frog
}
[SerializationGenerator(0)]
public partial class OrigamiShape : Item
{
[Constructible]
public OrigamiShape() : base(0x283B) => LootType = LootType.Blessed;
public override int LabelNumber => 1030299; // an intricate geometric origami shape
}
[SerializationGenerator(0)]
public partial class OrigamiSongbird : Item
{
[Constructible]
public OrigamiSongbird() : base(0x283C) => LootType = LootType.Blessed;
public override int LabelNumber => 1030300; // a delicate origami songbird
}
[SerializationGenerator(0)]
public partial class OrigamiFish : Item
{
[Constructible]
public OrigamiFish() : base(0x283D) => LootType = LootType.Blessed;
public override int LabelNumber => 1030301; // a delicate origami fish
}

File diff suppressed because it is too large Load diff

View file

@ -1,103 +1,82 @@
using ModernUO.Serialization;
using Server.Mobiles;
using Server.Multis;
namespace Server.Items
namespace Server.Items;
[SerializationGenerator(0, false)]
public partial class ContractOfEmployment : Item
{
public class ContractOfEmployment : Item
[Constructible]
public ContractOfEmployment() : base(0x14F0) => Weight = 1.0;
public override int LabelNumber => 1041243; // a contract of employment
public override void OnDoubleClick(Mobile from)
{
[Constructible]
public ContractOfEmployment() : base(0x14F0) => Weight = 1.0;
public ContractOfEmployment(Serial serial) : base(serial)
if (!IsChildOf(from.Backpack))
{
from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
}
public override int LabelNumber => 1041243; // a contract of employment
public override void Serialize(IGenericWriter writer)
else if (from.AccessLevel >= AccessLevel.GameMaster)
{
base.Serialize(writer);
from.SendLocalizedMessage(503248); // Your godly powers allow you to place this vendor whereever you wish.
writer.Write(0); // version
Mobile v = new PlayerVendor(from, BaseHouse.FindHouseAt(from));
v.Direction = from.Direction & Direction.Mask;
v.MoveToWorld(from.Location, from.Map);
v.SayTo(from, 503246); // Ah! it feels good to be working again.
Delete();
}
public override void Deserialize(IGenericReader reader)
else
{
base.Deserialize(reader);
var house = BaseHouse.FindHouseAt(from);
var version = reader.ReadInt();
}
public override void OnDoubleClick(Mobile from)
{
if (!IsChildOf(from.Backpack))
if (house == null)
{
from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
from.SendLocalizedMessage(503240); // Vendors can only be placed in houses.
}
else if (from.AccessLevel >= AccessLevel.GameMaster)
else if (!BaseHouse.NewVendorSystem && !house.IsFriend(from))
{
from.SendLocalizedMessage(503248); // Your godly powers allow you to place this vendor whereever you wish.
Mobile v = new PlayerVendor(from, BaseHouse.FindHouseAt(from));
v.Direction = from.Direction & Direction.Mask;
v.MoveToWorld(from.Location, from.Map);
v.SayTo(from, 503246); // Ah! it feels good to be working again.
Delete();
// You must ask the owner of this building to name you a friend of the household in order to place a vendor here.
from.SendLocalizedMessage(503242);
}
else if (BaseHouse.NewVendorSystem && !house.IsOwner(from))
{
// Only the house owner can directly place vendors. Please ask the house owner to offer you a vendor contract so that you may place a vendor in this house.
from.SendLocalizedMessage(1062423);
}
else if (!house.Public || !house.CanPlaceNewVendor())
{
// You cannot place this vendor or barkeep. Make sure the house is public and has sufficient storage available.
from.SendLocalizedMessage(503241);
}
else
{
var house = BaseHouse.FindHouseAt(from);
BaseHouse.IsThereVendor(from.Location, from.Map, out var vendor, out var contract);
if (house == null)
if (vendor)
{
from.SendLocalizedMessage(503240); // Vendors can only be placed in houses.
from.SendLocalizedMessage(1062677); // You cannot place a vendor or barkeep at this location.
}
else if (!BaseHouse.NewVendorSystem && !house.IsFriend(from))
else if (contract)
{
from.SendLocalizedMessage(
503242
); // You must ask the owner of this building to name you a friend of the household in order to place a vendor here.
}
else if (BaseHouse.NewVendorSystem && !house.IsOwner(from))
{
from.SendLocalizedMessage(
1062423
); // Only the house owner can directly place vendors. Please ask the house owner to offer you a vendor contract so that you may place a vendor in this house.
}
else if (!house.Public || !house.CanPlaceNewVendor())
{
from.SendLocalizedMessage(
503241
); // You cannot place this vendor or barkeep. Make sure the house is public and has sufficient storage available.
// You cannot place a vendor or barkeep on top of a rental contract!
from.SendLocalizedMessage(1062678);
}
else
{
BaseHouse.IsThereVendor(from.Location, from.Map, out var vendor, out var contract);
Mobile v = new PlayerVendor(from, house);
if (vendor)
{
from.SendLocalizedMessage(1062677); // You cannot place a vendor or barkeep at this location.
}
else if (contract)
{
from.SendLocalizedMessage(
1062678
); // You cannot place a vendor or barkeep on top of a rental contract!
}
else
{
Mobile v = new PlayerVendor(from, house);
v.Direction = from.Direction & Direction.Mask;
v.MoveToWorld(from.Location, from.Map);
v.Direction = from.Direction & Direction.Mask;
v.MoveToWorld(from.Location, from.Map);
v.SayTo(from, 503246); // Ah! it feels good to be working again.
v.SayTo(from, 503246); // Ah! it feels good to be working again.
Delete();
}
Delete();
}
}
}

View file

@ -1,42 +1,25 @@
using ModernUO.Serialization;
using Server.Network;
namespace Server.Items
namespace Server.Items;
[SerializationGenerator(0, false)]
public partial class PowerCrystal : Item
{
public class PowerCrystal : Item
[Constructible]
public PowerCrystal() : base(0x1F1C) => Weight = 1.0;
public override string DefaultName => "power crystal";
public override void OnDoubleClick(Mobile from)
{
[Constructible]
public PowerCrystal() : base(0x1F1C) => Weight = 1.0;
public PowerCrystal(Serial serial) : base(serial)
if (!from.InRange(GetWorldLocation(), 3))
{
from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that.
}
public override string DefaultName => "power crystal";
public override void OnDoubleClick(Mobile from)
else
{
if (!from.InRange(GetWorldLocation(), 3))
{
from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that.
}
else
{
from.SendAsciiMessage("This looks like part of a larger contraption.");
}
}
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();
from.SendAsciiMessage("This looks like part of a larger contraption.");
}
}
}

View file

@ -489,24 +489,34 @@ namespace Server.Items
switch (info.ButtonID)
{
case 1: // Left
newX = curNode.X - 1;
newY = curNode.Y;
break;
{
newX = curNode.X - 1;
newY = curNode.Y;
break;
}
case 2: // Up
newX = curNode.X;
newY = curNode.Y - 1;
break;
{
newX = curNode.X;
newY = curNode.Y - 1;
break;
}
case 3: // Right
newX = curNode.X + 1;
newY = curNode.Y;
break;
{
newX = curNode.X + 1;
newY = curNode.Y;
break;
}
case 4: // Down
newX = curNode.X;
newY = curNode.Y + 1;
break;
{
newX = curNode.X;
newY = curNode.Y + 1;
break;
}
default:
return;
{
return;
}
}
if (nextNode.X == newX && nextNode.Y == newY)

View file

@ -1,181 +1,140 @@
using ModernUO.Serialization;
using Server.Gumps;
using Server.Network;
namespace Server.Items
namespace Server.Items;
[SerializationGenerator(0, false)]
public abstract partial class PromotionalToken : Item
{
public abstract class PromotionalToken : Item
public PromotionalToken() : base(0x2AAA)
{
public PromotionalToken() : base(0x2AAA)
LootType = LootType.Blessed;
Light = LightType.Circle300;
Weight = 5.0;
}
public abstract TextDefinition ItemName { get; }
public abstract TextDefinition ItemReceiveMessage { get; }
public abstract TextDefinition ItemGumpName { get; }
public override int LabelNumber => 1070997; // A promotional token
public abstract Item CreateItemFor(Mobile from);
public override void GetProperties(IPropertyList list)
{
base.GetProperties(list);
if (ItemName != null)
{
LootType = LootType.Blessed;
Light = LightType.Circle300;
Weight = 5.0;
}
public PromotionalToken(Serial serial) : base(serial)
{
}
public abstract TextDefinition ItemName { get; }
public abstract TextDefinition ItemReceiveMessage { get; }
public abstract TextDefinition ItemGumpName { get; }
public override int LabelNumber => 1070997; // A promotional token
public abstract Item CreateItemFor(Mobile from);
public override void GetProperties(IPropertyList list)
{
base.GetProperties(list);
if (ItemName != null)
if (ItemName.Number > 0)
{
if (ItemName.Number > 0)
{
list.Add(1070998, ItemName.Number); // Use this to redeem<br>your ~1_PROMO~
}
else
{
list.Add(1070998, ItemName.String); // Use this to redeem<br>your ~1_PROMO~
}
list.Add(1070998, ItemName.Number); // Use this to redeem<br>your ~1_PROMO~
}
else
{
list.Add(1070998, ItemName.String); // Use this to redeem<br>your ~1_PROMO~
}
}
}
public override void OnDoubleClick(Mobile from)
public override void OnDoubleClick(Mobile from)
{
if (!IsChildOf(from.Backpack))
{
if (!IsChildOf(from.Backpack))
from.SendLocalizedMessage(1062334); // This item must be in your backpack to be used.
}
else
{
from.CloseGump<PromotionalTokenGump>();
from.SendGump(new PromotionalTokenGump(this));
}
}
public override void OnRemoved(IEntity parent)
{
Mobile m = null;
if (parent is Item item)
{
m = item.RootParent as Mobile;
}
else if (parent is Mobile mobile)
{
m = mobile;
}
m?.CloseGump<PromotionalTokenGump>();
}
private class PromotionalTokenGump : Gump
{
private readonly PromotionalToken m_Token;
public PromotionalTokenGump(PromotionalToken token) : base(10, 10)
{
m_Token = token;
AddPage(0);
AddBackground(0, 0, 240, 135, 0x2422);
AddHtmlLocalized(
15,
15,
210,
75,
1070972,
0x0,
true
); // Click "OKAY" to redeem the following promotional item:
TextDefinition.AddHtmlText(this, 15, 60, 210, 75, m_Token.ItemGumpName, false, false);
AddButton(160, 95, 0xF7, 0xF8, 1); // Okay
AddButton(90, 95, 0xF2, 0xF1, 0); // Cancel
}
public override void OnResponse(NetState sender, RelayInfo info)
{
if (info.ButtonID != 1)
{
return;
}
var from = sender.Mobile;
if (!m_Token.IsChildOf(from.Backpack))
{
from.SendLocalizedMessage(1062334); // This item must be in your backpack to be used.
}
else
{
from.CloseGump<PromotionalTokenGump>();
from.SendGump(new PromotionalTokenGump(this));
}
}
var i = m_Token.CreateItemFor(from);
public override void OnRemoved(IEntity parent)
{
Mobile m = null;
if (parent is Item item)
{
m = item.RootParent as Mobile;
}
else if (parent is Mobile mobile)
{
m = mobile;
}
m?.CloseGump<PromotionalTokenGump>();
}
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();
}
private class PromotionalTokenGump : Gump
{
private readonly PromotionalToken m_Token;
public PromotionalTokenGump(PromotionalToken token) : base(10, 10)
{
m_Token = token;
AddPage(0);
AddBackground(0, 0, 240, 135, 0x2422);
AddHtmlLocalized(
15,
15,
210,
75,
1070972,
0x0,
true
); // Click "OKAY" to redeem the following promotional item:
TextDefinition.AddHtmlText(this, 15, 60, 210, 75, m_Token.ItemGumpName, false, false);
AddButton(160, 95, 0xF7, 0xF8, 1); // Okay
AddButton(90, 95, 0xF2, 0xF1, 0); // Cancel
}
public override void OnResponse(NetState sender, RelayInfo info)
{
if (info.ButtonID != 1)
if (i != null)
{
return;
}
var from = sender.Mobile;
if (!m_Token.IsChildOf(from.Backpack))
{
from.SendLocalizedMessage(1062334); // This item must be in your backpack to be used.
}
else
{
var i = m_Token.CreateItemFor(from);
if (i != null)
{
from.BankBox.AddItem(i);
TextDefinition.SendMessageTo(from, m_Token.ItemReceiveMessage);
m_Token.Delete();
}
from.BankBox.AddItem(i);
TextDefinition.SendMessageTo(from, m_Token.ItemReceiveMessage);
m_Token.Delete();
}
}
}
}
public class SoulstoneFragmentToken : PromotionalToken
{
[Constructible]
public SoulstoneFragmentToken()
{
}
public SoulstoneFragmentToken(Serial serial) : base(serial)
{
}
public override TextDefinition ItemGumpName => 1070999; // <center>Soulstone Fragment</center>
public override TextDefinition ItemName => 1071000; // soulstone fragment
public override TextDefinition ItemReceiveMessage =>
1070976; // A soulstone fragment has been created in your bank box.
public override Item CreateItemFor(Mobile from)
{
if (from?.Account != null)
{
return new SoulstoneFragment(from.Account.ToString());
}
return null;
}
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();
}
}
}
[SerializationGenerator(0, false)]
public partial class SoulstoneFragmentToken : PromotionalToken
{
[Constructible]
public SoulstoneFragmentToken()
{
}
public override TextDefinition ItemGumpName => 1070999; // <center>Soulstone Fragment</center>
public override TextDefinition ItemName => 1071000; // soulstone fragment
// A soulstone fragment has been created in your bank box.
public override TextDefinition ItemReceiveMessage => 1070976;
public override Item CreateItemFor(Mobile from) =>
from?.Account != null ? new SoulstoneFragment(from.Account.ToString()) : null;
}

View file

@ -1,511 +1,494 @@
using System;
using System.Collections.Generic;
using ModernUO.Serialization;
using Server.Factions;
using Server.Gumps;
using Server.Mobiles;
using Server.Network;
using Server.Spells;
namespace Server.Items
namespace Server.Items;
[SerializationGenerator(0, false)]
public partial class PublicMoongate : Item
{
public class PublicMoongate : Item
[Constructible]
public PublicMoongate() : base(0xF6C)
{
[Constructible]
public PublicMoongate() : base(0xF6C)
Movable = false;
Light = LightType.Circle300;
}
public override bool ForceShowProperties => ObjectPropertyList.Enabled;
public override bool HandlesOnMovement => true;
public override void OnDoubleClick(Mobile from)
{
if (!from.Player)
{
Movable = false;
Light = LightType.Circle300;
return;
}
public PublicMoongate(Serial serial) : base(serial)
if (from.InRange(GetWorldLocation(), 1))
{
UseGate(from);
}
public override bool ForceShowProperties => ObjectPropertyList.Enabled;
public override bool HandlesOnMovement => true;
public override void OnDoubleClick(Mobile from)
else
{
if (!from.Player)
{
return;
}
if (from.InRange(GetWorldLocation(), 1))
{
UseGate(from);
}
else
{
from.SendLocalizedMessage(500446); // That is too far away.
}
}
public override bool OnMoveOver(Mobile m)
{
// Changed so criminals are not blocked by it.
if (m.Player)
{
UseGate(m);
}
return true;
}
public override void OnMovement(Mobile m, Point3D oldLocation)
{
if (m is PlayerMobile)
{
if (!Utility.InRange(m.Location, Location, 1) && Utility.InRange(oldLocation, Location, 1))
{
m.CloseGump<MoongateGump>();
}
}
}
public bool UseGate(Mobile m)
{
if (m.Criminal)
{
m.SendLocalizedMessage(1005561, "", 0x22); // Thou'rt a criminal and cannot escape so easily.
return false;
}
if (SpellHelper.CheckCombat(m))
{
m.SendLocalizedMessage(1005564, "", 0x22); // Wouldst thou flee during the heat of battle??
return false;
}
if (m.Spell != null)
{
m.SendLocalizedMessage(1049616); // You are too busy to do that at the moment.
return false;
}
m.CloseGump<MoongateGump>();
m.SendGump(new MoongateGump(m, this));
if (!m.Hidden || m.AccessLevel == AccessLevel.Player)
{
Effects.PlaySound(m.Location, m.Map, 0x20E);
}
return true;
}
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 static void Initialize()
{
CommandSystem.Register("MoonGen", AccessLevel.Administrator, MoonGen_OnCommand);
}
[Usage("MoonGen"), Description("Generates public moongates. Removes all old moongates.")]
public static void MoonGen_OnCommand(CommandEventArgs e)
{
DeleteAll();
var count = 0;
count += MoonGen(PMList.Trammel);
count += MoonGen(PMList.Felucca);
count += MoonGen(PMList.Ilshenar);
count += MoonGen(PMList.Malas);
count += MoonGen(PMList.Tokuno);
World.Broadcast(0x35, true, "{0} moongates generated.", count);
}
private static void DeleteAll()
{
var list = new List<Item>();
foreach (var item in World.Items.Values)
{
if (item is PublicMoongate)
{
list.Add(item);
}
}
foreach (var item in list)
{
item.Delete();
}
if (list.Count > 0)
{
World.Broadcast(0x35, true, "{0} moongates removed.", list.Count);
}
}
private static int MoonGen(PMList list)
{
foreach (var entry in list.Entries)
{
Item item = new PublicMoongate();
item.MoveToWorld(entry.Location, list.Map);
if (entry.Number == 1060642) // Umbra
{
item.Hue = 0x497;
}
}
return list.Entries.Length;
from.SendLocalizedMessage(500446); // That is too far away.
}
}
public class PMEntry
public override bool OnMoveOver(Mobile m)
{
public PMEntry(Point3D loc, int number)
// Changed so criminals are not blocked by it.
if (m.Player)
{
Location = loc;
Number = number;
UseGate(m);
}
public Point3D Location { get; }
public int Number { get; }
return true;
}
public class PMList
public override void OnMovement(Mobile m, Point3D oldLocation)
{
public static PMList Trammel =
new(
1012000,
1012012,
Map.Trammel,
new[]
{
new PMEntry(new Point3D(4467, 1283, 5), 1012003), // Moonglow
new PMEntry(new Point3D(1336, 1997, 5), 1012004), // Britain
new PMEntry(new Point3D(1499, 3771, 5), 1012005), // Jhelom
new PMEntry(new Point3D(771, 752, 5), 1012006), // Yew
new PMEntry(new Point3D(2701, 692, 5), 1012007), // Minoc
new PMEntry(new Point3D(1828, 2948, -20), 1012008), // Trinsic
new PMEntry(new Point3D(643, 2067, 5), 1012009), // Skara Brae
/* Dynamic Z for Magincia to support both old and new maps. */
new PMEntry(new Point3D(3563, 2139, Map.Trammel.GetAverageZ(3563, 2139)), 1012010), // (New) Magincia
new PMEntry(new Point3D(3450, 2677, 25), 1078098) // New Haven
}
);
public static PMList Felucca =
new(
1012001,
1012013,
Map.Felucca,
new[]
{
new PMEntry(new Point3D(4467, 1283, 5), 1012003), // Moonglow
new PMEntry(new Point3D(1336, 1997, 5), 1012004), // Britain
new PMEntry(new Point3D(1499, 3771, 5), 1012005), // Jhelom
new PMEntry(new Point3D(771, 752, 5), 1012006), // Yew
new PMEntry(new Point3D(2701, 692, 5), 1012007), // Minoc
new PMEntry(new Point3D(1828, 2948, -20), 1012008), // Trinsic
new PMEntry(new Point3D(643, 2067, 5), 1012009), // Skara Brae
/* Dynamic Z for Magincia to support both old and new maps. */
new PMEntry(new Point3D(3563, 2139, Map.Felucca.GetAverageZ(3563, 2139)), 1012010), // (New) Magincia
new PMEntry(new Point3D(2711, 2234, 0), 1019001) // Buccaneer's Den
}
);
public static PMList Ilshenar =
new(
1012002,
1012014,
Map.Ilshenar,
new[]
{
new PMEntry(new Point3D(1215, 467, -13), 1012015), // Compassion
new PMEntry(new Point3D(722, 1366, -60), 1012016), // Honesty
new PMEntry(new Point3D(744, 724, -28), 1012017), // Honor
new PMEntry(new Point3D(281, 1016, 0), 1012018), // Humility
new PMEntry(new Point3D(987, 1011, -32), 1012019), // Justice
new PMEntry(new Point3D(1174, 1286, -30), 1012020), // Sacrifice
new PMEntry(new Point3D(1532, 1340, -3), 1012021), // Spirituality
new PMEntry(new Point3D(528, 216, -45), 1012022), // Valor
new PMEntry(new Point3D(1721, 218, 96), 1019000) // Chaos
}
);
public static PMList Malas =
new(
1060643,
1062039,
Map.Malas,
new[]
{
new PMEntry(new Point3D(1015, 527, -65), 1060641), // Luna
new PMEntry(new Point3D(1997, 1386, -85), 1060642) // Umbra
}
);
public static PMList Tokuno =
new(
1063258,
1063415,
Map.Tokuno,
new[]
{
new PMEntry(new Point3D(1169, 998, 41), 1063412), // Isamu-Jima
new PMEntry(new Point3D(802, 1204, 25), 1063413), // Makoto-Jima
new PMEntry(new Point3D(270, 628, 15), 1063414) // Homare-Jima
}
);
public static PMList TerMur =
new(
1113602,
1113604,
Map.TerMur,
new[]
{
new PMEntry(new Point3D(850, 3525, -38), 1113603), // Royal City
}
);
public static PMList TerMurEodon =
new(
1113602,
1113604,
Map.TerMur,
new[]
{
new PMEntry(new Point3D(850, 3525, -38), 1113603), // Royal City
new PMEntry(new Point3D(719, 1863, 40), 1156262) // Valley of Eodon
}
);
public static PMList[] NoTrammelLists = { Felucca };
public static PMList[] T2ALists = { Trammel, Felucca };
public static PMList[] T2AListsYoung = { Trammel };
public static PMList[] LBRLists = { Trammel, Felucca, Ilshenar };
public static PMList[] LBRListsYoung = { Trammel, Ilshenar };
public static PMList[] AOSLists = { Trammel, Felucca, Ilshenar, Malas };
public static PMList[] AOSListsYoung = { Trammel, Ilshenar, Malas };
public static PMList[] SELists = { Trammel, Felucca, Ilshenar, Malas, Tokuno };
public static PMList[] SEListsYoung = { Trammel, Ilshenar, Malas, Tokuno };
public static PMList[] SALists = { Trammel, Felucca, Ilshenar, Malas, Tokuno, TerMur };
public static PMList[] SAListsYoung = { Trammel, Ilshenar, Malas, Tokuno, TerMur };
public static PMList[] TOLLists = { Trammel, Felucca, Ilshenar, Malas, Tokuno, TerMurEodon };
public static PMList[] TOLListsYoung = { Trammel, Ilshenar, Malas, Tokuno, TerMurEodon };
public static PMList[] RedLists = { Felucca };
public static PMList[] SigilLists = { Felucca };
public PMList(int number, int selNumber, Map map, PMEntry[] entries)
if (m is PlayerMobile)
{
Number = number;
SelNumber = selNumber;
Map = map;
Entries = entries;
if (!Utility.InRange(m.Location, Location, 1) && Utility.InRange(oldLocation, Location, 1))
{
m.CloseGump<MoongateGump>();
}
}
public int Number { get; }
public int SelNumber { get; }
public Map Map { get; }
public PMEntry[] Entries { get; }
}
public class MoongateGump : Gump
public bool UseGate(Mobile m)
{
private PMList[] _lists;
private Mobile _mobile;
private Item _moongate;
public MoongateGump(Mobile mobile, Item moongate) : base(100, 100)
if (m.Criminal)
{
_mobile = mobile;
_moongate = moongate;
m.SendLocalizedMessage(1005561, "", 0x22); // Thou'rt a criminal and cannot escape so easily.
return false;
}
PMList[] checkLists;
if (SpellHelper.CheckCombat(m))
{
m.SendLocalizedMessage(1005564, "", 0x22); // Wouldst thou flee during the heat of battle??
return false;
}
if (!mobile.Player)
if (m.Spell != null)
{
m.SendLocalizedMessage(1049616); // You are too busy to do that at the moment.
return false;
}
m.CloseGump<MoongateGump>();
m.SendGump(new MoongateGump(m, this));
if (!m.Hidden || m.AccessLevel == AccessLevel.Player)
{
Effects.PlaySound(m.Location, m.Map, 0x20E);
}
return true;
}
public static void Initialize()
{
CommandSystem.Register("MoonGen", AccessLevel.Administrator, MoonGen_OnCommand);
}
[Usage("MoonGen"), Description("Generates public moongates. Removes all old moongates.")]
public static void MoonGen_OnCommand(CommandEventArgs e)
{
DeleteAll();
var count = 0;
count += MoonGen(PMList.Trammel);
count += MoonGen(PMList.Felucca);
count += MoonGen(PMList.Ilshenar);
count += MoonGen(PMList.Malas);
count += MoonGen(PMList.Tokuno);
World.Broadcast(0x35, true, "{0} moongates generated.", count);
}
private static void DeleteAll()
{
var list = new List<Item>();
foreach (var item in World.Items.Values)
{
if (item is PublicMoongate)
{
checkLists = PMList.SELists;
}
else if (Sigil.ExistsOn(mobile))
{
checkLists = PMList.SigilLists;
}
else if (mobile.Kills >= 5)
{
checkLists = PMList.RedLists;
}
else
{
var flags = mobile.NetState?.Flags ?? ClientFlags.None;
var young = mobile is PlayerMobile { Young: true };
checkLists = Core.Expansion switch
{
>= Expansion.TOL when (flags & ClientFlags.TerMur) != 0 =>
young ? PMList.TOLListsYoung : PMList.TOLLists,
>= Expansion.SA when (flags & ClientFlags.TerMur) != 0 => young ? PMList.SAListsYoung : PMList.SALists,
>= Expansion.SE when (flags & ClientFlags.Tokuno) != 0 => young ? PMList.SEListsYoung : PMList.SELists,
>= Expansion.AOS when (flags & ClientFlags.Malas) != 0 => young ? PMList.AOSListsYoung : PMList.AOSLists,
>= Expansion.LBR when (flags & ClientFlags.Ilshenar) != 0 =>
young ? PMList.LBRListsYoung : PMList.LBRLists,
>= Expansion.T2A when (flags & ClientFlags.Trammel) != 0 =>
young ? PMList.T2AListsYoung : PMList.T2ALists,
_ => PMList.NoTrammelLists
};
}
_lists = new PMList[checkLists.Length];
for (var i = 0; i < _lists.Length; ++i)
{
_lists[i] = checkLists[i];
}
for (var i = 0; i < _lists.Length; ++i)
{
if (_lists[i].Map == mobile.Map)
{
(_lists[i], _lists[0]) = (_lists[0], _lists[i]);
break;
}
}
AddPage(0);
AddBackground(0, 0, 380, 280, 5054);
AddButton(10, 210, 4005, 4007, 1);
AddHtmlLocalized(45, 210, 140, 25, 1011036); // OKAY
AddButton(10, 235, 4005, 4007, 0);
AddHtmlLocalized(45, 235, 140, 25, 1011012); // CANCEL
AddHtmlLocalized(5, 5, 200, 20, 1012011); // Pick your destination:
for (var i = 0; i < checkLists.Length; ++i)
{
AddButton(10, 35 + i * 25, 2117, 2118, 0, GumpButtonType.Page, Array.IndexOf(_lists, checkLists[i]) + 1);
AddHtmlLocalized(30, 35 + i * 25, 150, 20, checkLists[i].Number);
}
for (var i = 0; i < _lists.Length; ++i)
{
RenderPage(i, Array.IndexOf(checkLists, _lists[i]));
list.Add(item);
}
}
private void RenderPage(int index, int offset)
foreach (var item in list)
{
var list = _lists[index];
item.Delete();
}
AddPage(index + 1);
if (list.Count > 0)
{
World.Broadcast(0x35, true, "{0} moongates removed.", list.Count);
}
}
AddButton(10, 35 + offset * 25, 2117, 2118, 0, GumpButtonType.Page, index + 1);
AddHtmlLocalized(30, 35 + offset * 25, 150, 20, list.SelNumber);
private static int MoonGen(PMList list)
{
foreach (var entry in list.Entries)
{
Item item = new PublicMoongate();
var entries = list.Entries;
item.MoveToWorld(entry.Location, list.Map);
for (var i = 0; i < entries.Length; ++i)
if (entry.Number == 1060642) // Umbra
{
AddRadio(200, 35 + i * 25, 210, 211, false, index * 100 + i);
AddHtmlLocalized(225, 35 + i * 25, 150, 20, entries[i].Number);
item.Hue = 0x497;
}
}
public override void OnResponse(NetState state, RelayInfo info)
return list.Entries.Length;
}
}
public class PMEntry
{
public PMEntry(Point3D loc, int number)
{
Location = loc;
Number = number;
}
public Point3D Location { get; }
public int Number { get; }
}
public class PMList
{
public static PMList Trammel =
new(
1012000,
1012012,
Map.Trammel,
new[]
{
new PMEntry(new Point3D(4467, 1283, 5), 1012003), // Moonglow
new PMEntry(new Point3D(1336, 1997, 5), 1012004), // Britain
new PMEntry(new Point3D(1499, 3771, 5), 1012005), // Jhelom
new PMEntry(new Point3D(771, 752, 5), 1012006), // Yew
new PMEntry(new Point3D(2701, 692, 5), 1012007), // Minoc
new PMEntry(new Point3D(1828, 2948, -20), 1012008), // Trinsic
new PMEntry(new Point3D(643, 2067, 5), 1012009), // Skara Brae
/* Dynamic Z for Magincia to support both old and new maps. */
new PMEntry(new Point3D(3563, 2139, Map.Trammel.GetAverageZ(3563, 2139)), 1012010), // (New) Magincia
new PMEntry(new Point3D(3450, 2677, 25), 1078098) // New Haven
}
);
public static PMList Felucca =
new(
1012001,
1012013,
Map.Felucca,
new[]
{
new PMEntry(new Point3D(4467, 1283, 5), 1012003), // Moonglow
new PMEntry(new Point3D(1336, 1997, 5), 1012004), // Britain
new PMEntry(new Point3D(1499, 3771, 5), 1012005), // Jhelom
new PMEntry(new Point3D(771, 752, 5), 1012006), // Yew
new PMEntry(new Point3D(2701, 692, 5), 1012007), // Minoc
new PMEntry(new Point3D(1828, 2948, -20), 1012008), // Trinsic
new PMEntry(new Point3D(643, 2067, 5), 1012009), // Skara Brae
/* Dynamic Z for Magincia to support both old and new maps. */
new PMEntry(new Point3D(3563, 2139, Map.Felucca.GetAverageZ(3563, 2139)), 1012010), // (New) Magincia
new PMEntry(new Point3D(2711, 2234, 0), 1019001) // Buccaneer's Den
}
);
public static PMList Ilshenar =
new(
1012002,
1012014,
Map.Ilshenar,
new[]
{
new PMEntry(new Point3D(1215, 467, -13), 1012015), // Compassion
new PMEntry(new Point3D(722, 1366, -60), 1012016), // Honesty
new PMEntry(new Point3D(744, 724, -28), 1012017), // Honor
new PMEntry(new Point3D(281, 1016, 0), 1012018), // Humility
new PMEntry(new Point3D(987, 1011, -32), 1012019), // Justice
new PMEntry(new Point3D(1174, 1286, -30), 1012020), // Sacrifice
new PMEntry(new Point3D(1532, 1340, -3), 1012021), // Spirituality
new PMEntry(new Point3D(528, 216, -45), 1012022), // Valor
new PMEntry(new Point3D(1721, 218, 96), 1019000) // Chaos
}
);
public static PMList Malas =
new(
1060643,
1062039,
Map.Malas,
new[]
{
new PMEntry(new Point3D(1015, 527, -65), 1060641), // Luna
new PMEntry(new Point3D(1997, 1386, -85), 1060642) // Umbra
}
);
public static PMList Tokuno =
new(
1063258,
1063415,
Map.Tokuno,
new[]
{
new PMEntry(new Point3D(1169, 998, 41), 1063412), // Isamu-Jima
new PMEntry(new Point3D(802, 1204, 25), 1063413), // Makoto-Jima
new PMEntry(new Point3D(270, 628, 15), 1063414) // Homare-Jima
}
);
public static PMList TerMur =
new(
1113602,
1113604,
Map.TerMur,
new[]
{
new PMEntry(new Point3D(850, 3525, -38), 1113603), // Royal City
}
);
public static PMList TerMurEodon =
new(
1113602,
1113604,
Map.TerMur,
new[]
{
new PMEntry(new Point3D(850, 3525, -38), 1113603), // Royal City
new PMEntry(new Point3D(719, 1863, 40), 1156262) // Valley of Eodon
}
);
public static PMList[] NoTrammelLists = { Felucca };
public static PMList[] T2ALists = { Trammel, Felucca };
public static PMList[] T2AListsYoung = { Trammel };
public static PMList[] LBRLists = { Trammel, Felucca, Ilshenar };
public static PMList[] LBRListsYoung = { Trammel, Ilshenar };
public static PMList[] AOSLists = { Trammel, Felucca, Ilshenar, Malas };
public static PMList[] AOSListsYoung = { Trammel, Ilshenar, Malas };
public static PMList[] SELists = { Trammel, Felucca, Ilshenar, Malas, Tokuno };
public static PMList[] SEListsYoung = { Trammel, Ilshenar, Malas, Tokuno };
public static PMList[] SALists = { Trammel, Felucca, Ilshenar, Malas, Tokuno, TerMur };
public static PMList[] SAListsYoung = { Trammel, Ilshenar, Malas, Tokuno, TerMur };
public static PMList[] TOLLists = { Trammel, Felucca, Ilshenar, Malas, Tokuno, TerMurEodon };
public static PMList[] TOLListsYoung = { Trammel, Ilshenar, Malas, Tokuno, TerMurEodon };
public static PMList[] RedLists = { Felucca };
public static PMList[] SigilLists = { Felucca };
public PMList(int number, int selNumber, Map map, PMEntry[] entries)
{
Number = number;
SelNumber = selNumber;
Map = map;
Entries = entries;
}
public int Number { get; }
public int SelNumber { get; }
public Map Map { get; }
public PMEntry[] Entries { get; }
}
public class MoongateGump : Gump
{
private PMList[] _lists;
private Mobile _mobile;
private Item _moongate;
public MoongateGump(Mobile mobile, Item moongate) : base(100, 100)
{
_mobile = mobile;
_moongate = moongate;
PMList[] checkLists;
if (!mobile.Player)
{
if (info.ButtonID == 0) // Cancel
{
return;
}
checkLists = PMList.SELists;
}
else if (Sigil.ExistsOn(mobile))
{
checkLists = PMList.SigilLists;
}
else if (mobile.Kills >= 5)
{
checkLists = PMList.RedLists;
}
else
{
var flags = mobile.NetState?.Flags ?? ClientFlags.None;
var young = mobile is PlayerMobile { Young: true };
if (_mobile.Deleted || _moongate.Deleted || _mobile.Map == null)
checkLists = Core.Expansion switch
{
return;
}
>= Expansion.TOL when (flags & ClientFlags.TerMur) != 0 =>
young ? PMList.TOLListsYoung : PMList.TOLLists,
>= Expansion.SA when (flags & ClientFlags.TerMur) != 0 => young ? PMList.SAListsYoung : PMList.SALists,
>= Expansion.SE when (flags & ClientFlags.Tokuno) != 0 => young ? PMList.SEListsYoung : PMList.SELists,
>= Expansion.AOS when (flags & ClientFlags.Malas) != 0 => young ? PMList.AOSListsYoung : PMList.AOSLists,
>= Expansion.LBR when (flags & ClientFlags.Ilshenar) != 0 =>
young ? PMList.LBRListsYoung : PMList.LBRLists,
>= Expansion.T2A when (flags & ClientFlags.Trammel) != 0 =>
young ? PMList.T2AListsYoung : PMList.T2ALists,
_ => PMList.NoTrammelLists
};
}
var switches = info.Switches;
_lists = new PMList[checkLists.Length];
if (switches.Length == 0)
{
return;
}
for (var i = 0; i < _lists.Length; ++i)
{
_lists[i] = checkLists[i];
}
var switchID = switches[0];
var listIndex = switchID / 100;
var listEntry = switchID % 100;
for (var i = 0; i < _lists.Length; ++i)
{
if (_lists[i].Map == mobile.Map)
{
(_lists[i], _lists[0]) = (_lists[0], _lists[i]);
break;
}
}
if (listIndex < 0 || listIndex >= _lists.Length)
{
return;
}
AddPage(0);
var list = _lists[listIndex];
AddBackground(0, 0, 380, 280, 5054);
if (listEntry < 0 || listEntry >= list.Entries.Length)
{
return;
}
AddButton(10, 210, 4005, 4007, 1);
AddHtmlLocalized(45, 210, 140, 25, 1011036); // OKAY
var entry = list.Entries[listEntry];
AddButton(10, 235, 4005, 4007, 0);
AddHtmlLocalized(45, 235, 140, 25, 1011012); // CANCEL
if (!_mobile.InRange(_moongate.GetWorldLocation(), 1) || _mobile.Map != _moongate.Map)
{
_mobile.SendLocalizedMessage(1019002); // You are too far away to use the gate.
}
else if (_mobile.Player && _mobile.Kills >= 5 && list.Map != Map.Felucca)
{
_mobile.SendLocalizedMessage(1019004); // You are not allowed to travel there.
}
else if (Sigil.ExistsOn(_mobile) && list.Map != Faction.Facet)
{
_mobile.SendLocalizedMessage(1019004); // You are not allowed to travel there.
}
else if (_mobile.Criminal)
{
_mobile.SendLocalizedMessage(1005561, "", 0x22); // Thou'rt a criminal and cannot escape so easily.
}
else if (SpellHelper.CheckCombat(_mobile))
{
_mobile.SendLocalizedMessage(1005564, "", 0x22); // Wouldst thou flee during the heat of battle??
}
else if (_mobile.Spell != null)
{
_mobile.SendLocalizedMessage(1049616); // You are too busy to do that at the moment.
}
else if (_mobile.Map == list.Map && _mobile.InRange(entry.Location, 1))
{
_mobile.SendLocalizedMessage(1019003); // You are already there.
}
else
{
BaseCreature.TeleportPets(_mobile, entry.Location, list.Map);
AddHtmlLocalized(5, 5, 200, 20, 1012011); // Pick your destination:
_mobile.Combatant = null;
_mobile.Warmode = false;
_mobile.Hidden = true;
for (var i = 0; i < checkLists.Length; ++i)
{
AddButton(10, 35 + i * 25, 2117, 2118, 0, GumpButtonType.Page, Array.IndexOf(_lists, checkLists[i]) + 1);
AddHtmlLocalized(30, 35 + i * 25, 150, 20, checkLists[i].Number);
}
_mobile.MoveToWorld(entry.Location, list.Map);
for (var i = 0; i < _lists.Length; ++i)
{
RenderPage(i, Array.IndexOf(checkLists, _lists[i]));
}
}
Effects.PlaySound(entry.Location, list.Map, 0x1FE);
}
private void RenderPage(int index, int offset)
{
var list = _lists[index];
AddPage(index + 1);
AddButton(10, 35 + offset * 25, 2117, 2118, 0, GumpButtonType.Page, index + 1);
AddHtmlLocalized(30, 35 + offset * 25, 150, 20, list.SelNumber);
var entries = list.Entries;
for (var i = 0; i < entries.Length; ++i)
{
AddRadio(200, 35 + i * 25, 210, 211, false, index * 100 + i);
AddHtmlLocalized(225, 35 + i * 25, 150, 20, entries[i].Number);
}
}
public override void OnResponse(NetState state, RelayInfo info)
{
if (info.ButtonID == 0) // Cancel
{
return;
}
if (_mobile.Deleted || _moongate.Deleted || _mobile.Map == null)
{
return;
}
var switches = info.Switches;
if (switches.Length == 0)
{
return;
}
var switchID = switches[0];
var listIndex = switchID / 100;
var listEntry = switchID % 100;
if (listIndex < 0 || listIndex >= _lists.Length)
{
return;
}
var list = _lists[listIndex];
if (listEntry < 0 || listEntry >= list.Entries.Length)
{
return;
}
var entry = list.Entries[listEntry];
if (!_mobile.InRange(_moongate.GetWorldLocation(), 1) || _mobile.Map != _moongate.Map)
{
_mobile.SendLocalizedMessage(1019002); // You are too far away to use the gate.
}
else if (_mobile.Player && _mobile.Kills >= 5 && list.Map != Map.Felucca)
{
_mobile.SendLocalizedMessage(1019004); // You are not allowed to travel there.
}
else if (Sigil.ExistsOn(_mobile) && list.Map != Faction.Facet)
{
_mobile.SendLocalizedMessage(1019004); // You are not allowed to travel there.
}
else if (_mobile.Criminal)
{
_mobile.SendLocalizedMessage(1005561, "", 0x22); // Thou'rt a criminal and cannot escape so easily.
}
else if (SpellHelper.CheckCombat(_mobile))
{
_mobile.SendLocalizedMessage(1005564, "", 0x22); // Wouldst thou flee during the heat of battle??
}
else if (_mobile.Spell != null)
{
_mobile.SendLocalizedMessage(1049616); // You are too busy to do that at the moment.
}
else if (_mobile.Map == list.Map && _mobile.InRange(entry.Location, 1))
{
_mobile.SendLocalizedMessage(1019003); // You are already there.
}
else
{
BaseCreature.TeleportPets(_mobile, entry.Location, list.Map);
_mobile.Combatant = null;
_mobile.Warmode = false;
_mobile.Hidden = true;
_mobile.MoveToWorld(entry.Location, list.Map);
Effects.PlaySound(entry.Location, list.Map, 0x1FE);
}
}
}

View file

@ -1,619 +1,209 @@
namespace Server.Items
using ModernUO.Serialization;
namespace Server.Items;
[SerializationGenerator(0, false)]
public partial class Rope : Item
{
public class Rope : Item
[Constructible]
public Rope(int amount = 1) : base(0x14F8)
{
[Constructible]
public Rope(int amount = 1) : base(0x14F8)
{
Stackable = true;
Weight = 1.0;
Amount = amount;
}
public Rope(Serial serial) : base(serial)
{
}
public override void Serialize(IGenericWriter writer)
{
base.Serialize(writer);
writer.Write(0);
}
public override void Deserialize(IGenericReader reader)
{
base.Deserialize(reader);
var version = reader.ReadInt();
}
}
public class IronWire : Item
{
[Constructible]
public IronWire(int amount = 1) : base(0x1876)
{
Stackable = true;
Weight = 5.0;
Amount = amount;
}
public IronWire(Serial serial) : base(serial)
{
}
public override void Serialize(IGenericWriter writer)
{
base.Serialize(writer);
writer.Write(0);
}
public override void Deserialize(IGenericReader reader)
{
base.Deserialize(reader);
var version = reader.ReadInt();
if (version < 1 && Weight == 2.0)
{
Weight = 5.0;
}
}
}
public class SilverWire : Item
{
[Constructible]
public SilverWire(int amount = 1) : base(0x1877)
{
Stackable = true;
Weight = 5.0;
Amount = amount;
}
public SilverWire(Serial serial) : base(serial)
{
}
public override void Serialize(IGenericWriter writer)
{
base.Serialize(writer);
writer.Write(1);
}
public override void Deserialize(IGenericReader reader)
{
base.Deserialize(reader);
var version = reader.ReadInt();
if (version < 1 && Weight == 2.0)
{
Weight = 5.0;
}
}
}
public class GoldWire : Item
{
[Constructible]
public GoldWire(int amount = 1) : base(0x1878)
{
Stackable = true;
Weight = 5.0;
Amount = amount;
}
public GoldWire(Serial serial) : base(serial)
{
}
public override void Serialize(IGenericWriter writer)
{
base.Serialize(writer);
writer.Write(1);
}
public override void Deserialize(IGenericReader reader)
{
base.Deserialize(reader);
var version = reader.ReadInt();
if (version < 1 && Weight == 2.0)
{
Weight = 5.0;
}
}
}
public class CopperWire : Item
{
[Constructible]
public CopperWire(int amount = 1) : base(0x1879)
{
Stackable = true;
Weight = 5.0;
Amount = amount;
}
public CopperWire(Serial serial) : base(serial)
{
}
public override void Serialize(IGenericWriter writer)
{
base.Serialize(writer);
writer.Write(1);
}
public override void Deserialize(IGenericReader reader)
{
base.Deserialize(reader);
var version = reader.ReadInt();
if (version < 1 && Weight == 2.0)
{
Weight = 5.0;
}
}
}
public class WhiteDriedFlowers : Item
{
[Constructible]
public WhiteDriedFlowers(int amount = 1) : base(0xC3C)
{
Stackable = true;
Weight = 1.0;
Amount = amount;
}
public WhiteDriedFlowers(Serial serial) : base(serial)
{
}
public override void Serialize(IGenericWriter writer)
{
base.Serialize(writer);
writer.Write(0);
}
public override void Deserialize(IGenericReader reader)
{
base.Deserialize(reader);
var version = reader.ReadInt();
}
}
public class GreenDriedFlowers : Item
{
[Constructible]
public GreenDriedFlowers(int amount = 1) : base(0xC3E)
{
Stackable = true;
Weight = 1.0;
Amount = amount;
}
public GreenDriedFlowers(Serial serial) : base(serial)
{
}
public override void Serialize(IGenericWriter writer)
{
base.Serialize(writer);
writer.Write(0);
}
public override void Deserialize(IGenericReader reader)
{
base.Deserialize(reader);
var version = reader.ReadInt();
}
}
public class DriedOnions : Item
{
[Constructible]
public DriedOnions(int amount = 1) : base(0xC40)
{
Stackable = true;
Weight = 1.0;
Amount = amount;
}
public DriedOnions(Serial serial) : base(serial)
{
}
public override void Serialize(IGenericWriter writer)
{
base.Serialize(writer);
writer.Write(0);
}
public override void Deserialize(IGenericReader reader)
{
base.Deserialize(reader);
var version = reader.ReadInt();
}
}
public class DriedHerbs : Item
{
[Constructible]
public DriedHerbs(int amount = 1) : base(0xC42)
{
Stackable = true;
Weight = 1.0;
Amount = amount;
}
public DriedHerbs(Serial serial) : base(serial)
{
}
public override void Serialize(IGenericWriter writer)
{
base.Serialize(writer);
writer.Write(0);
}
public override void Deserialize(IGenericReader reader)
{
base.Deserialize(reader);
var version = reader.ReadInt();
}
}
public class HorseShoes : Item
{
[Constructible]
public HorseShoes() : base(0xFB6) => Weight = 3.0;
public HorseShoes(Serial serial) : base(serial)
{
}
public override void Serialize(IGenericWriter writer)
{
base.Serialize(writer);
writer.Write(0);
}
public override void Deserialize(IGenericReader reader)
{
base.Deserialize(reader);
var version = reader.ReadInt();
}
}
public class ForgedMetal : Item
{
[Constructible]
public ForgedMetal() : base(0xFB8) => Weight = 5.0;
public ForgedMetal(Serial serial) : base(serial)
{
}
public override void Serialize(IGenericWriter writer)
{
base.Serialize(writer);
writer.Write(0);
}
public override void Deserialize(IGenericReader reader)
{
base.Deserialize(reader);
var version = reader.ReadInt();
}
}
public class Whip : Item
{
[Constructible]
public Whip() : base(0x166E) => Weight = 1.0;
public Whip(Serial serial) : base(serial)
{
}
public override void Serialize(IGenericWriter writer)
{
base.Serialize(writer);
writer.Write(0);
}
public override void Deserialize(IGenericReader reader)
{
base.Deserialize(reader);
var version = reader.ReadInt();
}
}
public class PaintsAndBrush : Item
{
[Constructible]
public PaintsAndBrush() : base(0xFC1) => Weight = 1.0;
public PaintsAndBrush(Serial serial) : base(serial)
{
}
public override void Serialize(IGenericWriter writer)
{
base.Serialize(writer);
writer.Write(0);
}
public override void Deserialize(IGenericReader reader)
{
base.Deserialize(reader);
var version = reader.ReadInt();
}
}
public class PenAndInk : Item
{
[Constructible]
public PenAndInk() : base(0xFBF) => Weight = 1.0;
public PenAndInk(Serial serial) : base(serial)
{
}
public override void Serialize(IGenericWriter writer)
{
base.Serialize(writer);
writer.Write(0);
}
public override void Deserialize(IGenericReader reader)
{
base.Deserialize(reader);
var version = reader.ReadInt();
}
}
public class ChiselsNorth : Item
{
[Constructible]
public ChiselsNorth() : base(0x1026) => Weight = 1.0;
public ChiselsNorth(Serial serial) : base(serial)
{
}
public override void Serialize(IGenericWriter writer)
{
base.Serialize(writer);
writer.WriteEncodedInt(0); // version
}
public override void Deserialize(IGenericReader reader)
{
base.Deserialize(reader);
var version = reader.ReadEncodedInt();
}
}
public class ChiselsWest : Item
{
[Constructible]
public ChiselsWest() : base(0x1027) => Weight = 1.0;
public ChiselsWest(Serial serial) : base(serial)
{
}
public override void Serialize(IGenericWriter writer)
{
base.Serialize(writer);
writer.WriteEncodedInt(0); // version
}
public override void Deserialize(IGenericReader reader)
{
base.Deserialize(reader);
var version = reader.ReadEncodedInt();
}
}
public class DirtyPan : Item
{
[Constructible]
public DirtyPan() : base(0x9E8) => Weight = 1.0;
public DirtyPan(Serial serial) : base(serial)
{
}
public override void Serialize(IGenericWriter writer)
{
base.Serialize(writer);
writer.WriteEncodedInt(0); // version
}
public override void Deserialize(IGenericReader reader)
{
base.Deserialize(reader);
var version = reader.ReadEncodedInt();
}
}
public class DirtySmallRoundPot : Item
{
[Constructible]
public DirtySmallRoundPot() : base(0x9E7) => Weight = 1.0;
public DirtySmallRoundPot(Serial serial) : base(serial)
{
}
public override void Serialize(IGenericWriter writer)
{
base.Serialize(writer);
writer.WriteEncodedInt(0); // version
}
public override void Deserialize(IGenericReader reader)
{
base.Deserialize(reader);
var version = reader.ReadEncodedInt();
}
}
public class DirtyPot : Item
{
[Constructible]
public DirtyPot() : base(0x9E6) => Weight = 1.0;
public DirtyPot(Serial serial) : base(serial)
{
}
public override void Serialize(IGenericWriter writer)
{
base.Serialize(writer);
writer.WriteEncodedInt(0); // version
}
public override void Deserialize(IGenericReader reader)
{
base.Deserialize(reader);
var version = reader.ReadEncodedInt();
}
}
public class DirtyRoundPot : Item
{
[Constructible]
public DirtyRoundPot() : base(0x9DF) => Weight = 1.0;
public DirtyRoundPot(Serial serial) : base(serial)
{
}
public override void Serialize(IGenericWriter writer)
{
base.Serialize(writer);
writer.WriteEncodedInt(0); // version
}
public override void Deserialize(IGenericReader reader)
{
base.Deserialize(reader);
var version = reader.ReadEncodedInt();
}
}
public class DirtyFrypan : Item
{
[Constructible]
public DirtyFrypan() : base(0x9DE) => Weight = 1.0;
public DirtyFrypan(Serial serial) : base(serial)
{
}
public override void Serialize(IGenericWriter writer)
{
base.Serialize(writer);
writer.WriteEncodedInt(0); // version
}
public override void Deserialize(IGenericReader reader)
{
base.Deserialize(reader);
var version = reader.ReadEncodedInt();
}
}
public class DirtySmallPot : Item
{
[Constructible]
public DirtySmallPot() : base(0x9DD) => Weight = 1.0;
public DirtySmallPot(Serial serial) : base(serial)
{
}
public override void Serialize(IGenericWriter writer)
{
base.Serialize(writer);
writer.WriteEncodedInt(0); // version
}
public override void Deserialize(IGenericReader reader)
{
base.Deserialize(reader);
var version = reader.ReadEncodedInt();
}
}
public class DirtyKettle : Item
{
[Constructible]
public DirtyKettle() : base(0x9DC) => Weight = 1.0;
public DirtyKettle(Serial serial) : base(serial)
{
}
public override void Serialize(IGenericWriter writer)
{
base.Serialize(writer);
writer.WriteEncodedInt(0); // version
}
public override void Deserialize(IGenericReader reader)
{
base.Deserialize(reader);
var version = reader.ReadEncodedInt();
}
Stackable = true;
Weight = 1.0;
Amount = amount;
}
}
[SerializationGenerator(0, false)]
public partial class IronWire : Item
{
[Constructible]
public IronWire(int amount = 1) : base(0x1876)
{
Stackable = true;
Weight = 5.0;
Amount = amount;
}
}
[SerializationGenerator(0, false)]
public partial class SilverWire : Item
{
[Constructible]
public SilverWire(int amount = 1) : base(0x1877)
{
Stackable = true;
Weight = 5.0;
Amount = amount;
}
}
[SerializationGenerator(0, false)]
public partial class GoldWire : Item
{
[Constructible]
public GoldWire(int amount = 1) : base(0x1878)
{
Stackable = true;
Weight = 5.0;
Amount = amount;
}
}
[SerializationGenerator(0, false)]
public partial class CopperWire : Item
{
[Constructible]
public CopperWire(int amount = 1) : base(0x1879)
{
Stackable = true;
Weight = 5.0;
Amount = amount;
}
}
[SerializationGenerator(0, false)]
public partial class WhiteDriedFlowers : Item
{
[Constructible]
public WhiteDriedFlowers(int amount = 1) : base(0xC3C)
{
Stackable = true;
Weight = 1.0;
Amount = amount;
}
}
[SerializationGenerator(0, false)]
public partial class GreenDriedFlowers : Item
{
[Constructible]
public GreenDriedFlowers(int amount = 1) : base(0xC3E)
{
Stackable = true;
Weight = 1.0;
Amount = amount;
}
}
[SerializationGenerator(0, false)]
public partial class DriedOnions : Item
{
[Constructible]
public DriedOnions(int amount = 1) : base(0xC40)
{
Stackable = true;
Weight = 1.0;
Amount = amount;
}
}
[SerializationGenerator(0, false)]
public partial class DriedHerbs : Item
{
[Constructible]
public DriedHerbs(int amount = 1) : base(0xC42)
{
Stackable = true;
Weight = 1.0;
Amount = amount;
}
}
[SerializationGenerator(0, false)]
public partial class HorseShoes : Item
{
[Constructible]
public HorseShoes() : base(0xFB6) => Weight = 3.0;
}
[SerializationGenerator(0, false)]
public partial class ForgedMetal : Item
{
[Constructible]
public ForgedMetal() : base(0xFB8) => Weight = 5.0;
}
[SerializationGenerator(0, false)]
public partial class Whip : Item
{
[Constructible]
public Whip() : base(0x166E) => Weight = 1.0;
}
[SerializationGenerator(0, false)]
public partial class PaintsAndBrush : Item
{
[Constructible]
public PaintsAndBrush() : base(0xFC1) => Weight = 1.0;
}
[SerializationGenerator(0, false)]
public partial class PenAndInk : Item
{
[Constructible]
public PenAndInk() : base(0xFBF) => Weight = 1.0;
}
[SerializationGenerator(0)]
public partial class ChiselsNorth : Item
{
[Constructible]
public ChiselsNorth() : base(0x1026) => Weight = 1.0;
}
[SerializationGenerator(0)]
public partial class ChiselsWest : Item
{
[Constructible]
public ChiselsWest() : base(0x1027) => Weight = 1.0;
}
[SerializationGenerator(0)]
public partial class DirtyPan : Item
{
[Constructible]
public DirtyPan() : base(0x9E8) => Weight = 1.0;
}
[SerializationGenerator(0)]
public partial class DirtySmallRoundPot : Item
{
[Constructible]
public DirtySmallRoundPot() : base(0x9E7) => Weight = 1.0;
}
[SerializationGenerator(0)]
public partial class DirtyPot : Item
{
[Constructible]
public DirtyPot() : base(0x9E6) => Weight = 1.0;
}
[SerializationGenerator(0)]
public partial class DirtyRoundPot : Item
{
[Constructible]
public DirtyRoundPot() : base(0x9DF) => Weight = 1.0;
}
[SerializationGenerator(0)]
public partial class DirtyFrypan : Item
{
[Constructible]
public DirtyFrypan() : base(0x9DE) => Weight = 1.0;
}
[SerializationGenerator(0)]
public partial class DirtySmallPot : Item
{
[Constructible]
public DirtySmallPot() : base(0x9DD) => Weight = 1.0;
}
[SerializationGenerator(0)]
public partial class DirtyKettle : Item
{
[Constructible]
public DirtyKettle() : base(0x9DC) => Weight = 1.0;
}

View file

@ -74,7 +74,6 @@
"type": "System.Collections.Generic.List\u003CServer.Accounting.AccountComment\u003E",
"rule": "ListMigrationRule",
"ruleArguments": [
"",
"Server.Accounting.AccountComment",
"SerializationMethodSignatureMigrationRule",
""
@ -85,7 +84,6 @@
"type": "System.Collections.Generic.List\u003CServer.Accounting.AccountTag\u003E",
"rule": "ListMigrationRule",
"ruleArguments": [
"",
"Server.Accounting.AccountTag",
"SerializationMethodSignatureMigrationRule",
""

View file

@ -47,7 +47,6 @@
"type": "System.Collections.Generic.List\u003Cint\u003E",
"rule": "ListMigrationRule",
"ruleArguments": [
"",
"int",
"PrimitiveTypeMigrationRule",
""

View file

@ -7,7 +7,6 @@
"type": "System.Collections.Generic.List\u003CServer.Items.AddonComponent\u003E",
"rule": "ListMigrationRule",
"ruleArguments": [
"",
"Server.Items.AddonComponent",
"SerializableInterfaceMigrationRule"
]

View file

@ -7,7 +7,6 @@
"type": "System.Collections.Generic.List\u003CServer.Items.AddonContainerComponent\u003E",
"rule": "ListMigrationRule",
"ruleArguments": [
"",
"Server.Items.AddonContainerComponent",
"SerializableInterfaceMigrationRule"
]

View file

@ -0,0 +1,38 @@
{
"version": 0,
"type": "Server.Items.BasePlayerBB",
"properties": [
{
"name": "Level",
"type": "Server.Multis.SecureLevel",
"rule": "EnumMigrationRule"
},
{
"name": "Title",
"type": "string",
"rule": "PrimitiveTypeMigrationRule",
"ruleArguments": [
""
]
},
{
"name": "Greeting",
"type": "Server.Items.PlayerBBMessage",
"rule": "RawSerializableMigrationRule",
"ruleArguments": [
"",
"@CanBeNull"
]
},
{
"name": "Messages",
"type": "System.Collections.Generic.List\u003CServer.Items.PlayerBBMessage\u003E",
"rule": "ListMigrationRule",
"ruleArguments": [
"Server.Items.PlayerBBMessage",
"RawSerializableMigrationRule",
""
]
}
]
}

View file

@ -15,7 +15,6 @@
"type": "System.Collections.Generic.List\u003CServer.Items.ReceiverCrystal\u003E",
"rule": "ListMigrationRule",
"ruleArguments": [
"",
"Server.Items.ReceiverCrystal",
"SerializableInterfaceMigrationRule"
]

View file

@ -0,0 +1,4 @@
{
"version": 0,
"type": "Server.Items.ChiselsNorth"
}

View file

@ -0,0 +1,4 @@
{
"version": 0,
"type": "Server.Items.ChiselsWest"
}

View file

@ -0,0 +1,4 @@
{
"version": 0,
"type": "Server.Items.ContractOfEmployment"
}

View file

@ -0,0 +1,4 @@
{
"version": 0,
"type": "Server.Items.CopperWire"
}

View file

@ -0,0 +1,4 @@
{
"version": 0,
"type": "Server.Items.DirtyFrypan"
}

View file

@ -0,0 +1,4 @@
{
"version": 0,
"type": "Server.Items.DirtyKettle"
}

View file

@ -0,0 +1,4 @@
{
"version": 0,
"type": "Server.Items.DirtyPan"
}

View file

@ -0,0 +1,4 @@
{
"version": 0,
"type": "Server.Items.DirtyPot"
}

View file

@ -0,0 +1,4 @@
{
"version": 0,
"type": "Server.Items.DirtyRoundPot"
}

View file

@ -0,0 +1,4 @@
{
"version": 0,
"type": "Server.Items.DirtySmallPot"
}

View file

@ -0,0 +1,4 @@
{
"version": 0,
"type": "Server.Items.DirtySmallRoundPot"
}

View file

@ -0,0 +1,4 @@
{
"version": 0,
"type": "Server.Items.DriedHerbs"
}

View file

@ -0,0 +1,4 @@
{
"version": 0,
"type": "Server.Items.DriedOnions"
}

View file

@ -0,0 +1,4 @@
{
"version": 0,
"type": "Server.Items.ForgedMetal"
}

View file

@ -0,0 +1,4 @@
{
"version": 0,
"type": "Server.Items.Gold"
}

View file

@ -0,0 +1,4 @@
{
"version": 0,
"type": "Server.Items.GoldWire"
}

View file

@ -0,0 +1,4 @@
{
"version": 0,
"type": "Server.Items.GreenDriedFlowers"
}

View file

@ -0,0 +1,4 @@
{
"version": 0,
"type": "Server.Items.Guillotine"
}

View file

@ -0,0 +1,4 @@
{
"version": 0,
"type": "Server.Items.HairDye"
}

View file

@ -0,0 +1,4 @@
{
"version": 0,
"type": "Server.Items.HorseShoes"
}

View file

@ -0,0 +1,4 @@
{
"version": 0,
"type": "Server.Items.HoveringWisp"
}

View file

@ -0,0 +1,4 @@
{
"version": 0,
"type": "Server.Items.InteriorDecorator"
}

View file

@ -0,0 +1,4 @@
{
"version": 0,
"type": "Server.Items.IronWire"
}

View file

@ -0,0 +1,35 @@
{
"version": 0,
"type": "Server.Items.Key",
"properties": [
{
"name": "MaxRange",
"type": "int",
"rule": "PrimitiveTypeMigrationRule",
"ruleArguments": [
""
]
},
{
"name": "Link",
"type": "Server.Item",
"rule": "SerializableInterfaceMigrationRule"
},
{
"name": "Description",
"type": "string",
"rule": "PrimitiveTypeMigrationRule",
"ruleArguments": [
""
]
},
{
"name": "KeyValue",
"type": "uint",
"rule": "PrimitiveTypeMigrationRule",
"ruleArguments": [
""
]
}
]
}

View file

@ -0,0 +1,15 @@
{
"version": 1,
"type": "Server.Items.KeyRing",
"properties": [
{
"name": "Keys",
"type": "System.Collections.Generic.List\u003CServer.Items.Key\u003E",
"rule": "ListMigrationRule",
"ruleArguments": [
"Server.Items.Key",
"SerializableInterfaceMigrationRule"
]
}
]
}

View file

@ -0,0 +1,4 @@
{
"version": 0,
"type": "Server.Items.LOSBlocker"
}

View file

@ -39,7 +39,6 @@
"type": "System.Collections.Generic.List\u003CServer.Point2D\u003E",
"rule": "ListMigrationRule",
"ruleArguments": [
"",
"Server.Point2D",
"PrimitiveUOTypeMigrationRule",
"Point2D"

View file

@ -0,0 +1,11 @@
{
"version": 1,
"type": "Server.Items.Moonstone",
"properties": [
{
"name": "Type",
"type": "Server.Items.MoonstoneType",
"rule": "EnumMigrationRule"
}
]
}

View file

@ -0,0 +1,4 @@
{
"version": 0,
"type": "Server.Items.MoonstoneGate"
}

View file

@ -0,0 +1,38 @@
{
"version": 0,
"type": "Server.Items.MorphItem",
"properties": [
{
"name": "OutsideRange",
"type": "int",
"rule": "PrimitiveTypeMigrationRule",
"ruleArguments": [
""
]
},
{
"name": "InactiveItemId",
"type": "int",
"rule": "PrimitiveTypeMigrationRule",
"ruleArguments": [
""
]
},
{
"name": "ActiveItemId",
"type": "int",
"rule": "PrimitiveTypeMigrationRule",
"ruleArguments": [
""
]
},
{
"name": "InsideRange",
"type": "int",
"rule": "PrimitiveTypeMigrationRule",
"ruleArguments": [
""
]
}
]
}

View file

@ -0,0 +1,4 @@
{
"version": 0,
"type": "Server.Items.OilCloth"
}

View file

@ -0,0 +1,4 @@
{
"version": 0,
"type": "Server.Items.OrigamiButterfly"
}

View file

@ -0,0 +1,4 @@
{
"version": 0,
"type": "Server.Items.OrigamiFish"
}

View file

@ -0,0 +1,4 @@
{
"version": 0,
"type": "Server.Items.OrigamiFrog"
}

View file

@ -0,0 +1,4 @@
{
"version": 0,
"type": "Server.Items.OrigamiPaper"
}

View file

@ -0,0 +1,4 @@
{
"version": 0,
"type": "Server.Items.OrigamiShape"
}

View file

@ -0,0 +1,4 @@
{
"version": 0,
"type": "Server.Items.OrigamiSongbird"
}

View file

@ -0,0 +1,4 @@
{
"version": 0,
"type": "Server.Items.OrigamiSwan"
}

View file

@ -0,0 +1,4 @@
{
"version": 0,
"type": "Server.Items.PaintsAndBrush"
}

View file

@ -0,0 +1,4 @@
{
"version": 0,
"type": "Server.Items.PenAndInk"
}

View file

@ -0,0 +1,4 @@
{
"version": 0,
"type": "Server.Items.PlayerBBEast"
}

View file

@ -0,0 +1,27 @@
{
"version": 0,
"type": "Server.Items.PlayerBBMessage",
"properties": [
{
"name": "Time",
"type": "System.DateTime",
"rule": "PrimitiveTypeMigrationRule",
"ruleArguments": [
""
]
},
{
"name": "Poster",
"type": "Server.Mobile",
"rule": "SerializableInterfaceMigrationRule"
},
{
"name": "Message",
"type": "string",
"rule": "PrimitiveTypeMigrationRule",
"ruleArguments": [
""
]
}
]
}

View file

@ -0,0 +1,4 @@
{
"version": 0,
"type": "Server.Items.PlayerBBSouth"
}

View file

@ -0,0 +1,4 @@
{
"version": 0,
"type": "Server.Items.PowerCrystal"
}

View file

@ -0,0 +1,4 @@
{
"version": 0,
"type": "Server.Items.PromotionalToken"
}

View file

@ -0,0 +1,4 @@
{
"version": 0,
"type": "Server.Items.PublicMoongate"
}

View file

@ -0,0 +1,4 @@
{
"version": 0,
"type": "Server.Items.Rope"
}

View file

@ -0,0 +1,4 @@
{
"version": 0,
"type": "Server.Items.SilverWire"
}

View file

@ -7,7 +7,6 @@
"type": "System.Collections.Generic.List\u003CServer.Mobile\u003E",
"rule": "ListMigrationRule",
"ruleArguments": [
"",
"Server.Mobile",
"SerializableInterfaceMigrationRule"
]

View file

@ -0,0 +1,4 @@
{
"version": 0,
"type": "Server.Items.SoulstoneFragmentToken"
}

View file

@ -7,7 +7,6 @@
"type": "System.Collections.Generic.List\u003CServer.Mobile\u003E",
"rule": "ListMigrationRule",
"ruleArguments": [
"",
"Server.Mobile",
"SerializableInterfaceMigrationRule"
]

View file

@ -0,0 +1,4 @@
{
"version": 0,
"type": "Server.Items.Whip"
}

View file

@ -0,0 +1,4 @@
{
"version": 0,
"type": "Server.Items.WhiteDriedFlowers"
}