ModernUO/Projects/UOContent/Items/Special/Solen Items/MessageHelper.cs
Kamron Batman b6cd408623
Updates Message Packets (#321)
### API Breaking Change
Combined `AsciiMessage` and `UnicodeMessage` into a single function that takes two arguments, `bool ascii` and `string lang`. Lang can be null (or anything) if ascii is true. 

- [X] Changes message packets
- [X] Cleans up some code
- [X] Uses benchmarks to determine if the spanwriter + copyfrom
2020-11-20 21:50:13 -08:00

22 lines
738 B
C#

using Server.Network;
namespace Server
{
public static class MessageHelper
{
public static void SendLocalizedMessageTo(Item from, Mobile to, int number, int hue)
{
SendLocalizedMessageTo(from, to, number, "", hue);
}
public static void SendLocalizedMessageTo(Item from, Mobile to, int number, string args, int hue)
{
to.NetState.SendMessageLocalized(from.Serial, from.ItemID, MessageType.Regular, hue, 3, number, "", args);
}
public static void SendMessageTo(Item from, Mobile to, string text, int hue)
{
to.NetState.SendMessage(from.Serial, from.ItemID, MessageType.Regular, hue, 3, false, "ENU", "", text);
}
}
}