parent
11227391d3
commit
d9f417ee19
17 changed files with 1084 additions and 381 deletions
|
|
@ -57,336 +57,6 @@ namespace Server.Network
|
|||
Inspecific = 5
|
||||
}
|
||||
|
||||
/*public enum CMEFlags
|
||||
{
|
||||
None = 0x00,
|
||||
Locked = 0x01,
|
||||
Arrow = 0x02,
|
||||
x0004 = 0x04,
|
||||
Color = 0x20,
|
||||
x0040 = 0x40,
|
||||
x0080 = 0x80
|
||||
}*/
|
||||
|
||||
public sealed class DamagePacketOld : Packet
|
||||
{
|
||||
public DamagePacketOld(Mobile m, int amount) : base(0xBF)
|
||||
{
|
||||
EnsureCapacity(11);
|
||||
|
||||
Stream.Write((short)0x22);
|
||||
Stream.Write((byte)1);
|
||||
Stream.Write(m.Serial);
|
||||
|
||||
if (amount > 255)
|
||||
amount = 255;
|
||||
else if (amount < 0)
|
||||
amount = 0;
|
||||
|
||||
Stream.Write((byte)amount);
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class DamagePacket : Packet
|
||||
{
|
||||
public DamagePacket(Mobile m, int amount) : base(0x0B, 7)
|
||||
{
|
||||
Stream.Write(m.Serial);
|
||||
|
||||
if (amount > 0xFFFF)
|
||||
amount = 0xFFFF;
|
||||
else if (amount < 0)
|
||||
amount = 0;
|
||||
|
||||
Stream.Write((ushort)amount);
|
||||
}
|
||||
|
||||
/*public DamagePacket( Mobile m, int amount ) : base( 0xBF )
|
||||
{
|
||||
EnsureCapacity( 11 );
|
||||
|
||||
m_Stream.Write( (short) 0x22 );
|
||||
m_Stream.Write( (byte) 1 );
|
||||
m_Stream.Write( (int) m.Serial );
|
||||
|
||||
if (amount > 255)
|
||||
amount = 255;
|
||||
else if (amount < 0)
|
||||
amount = 0;
|
||||
|
||||
m_Stream.Write( (byte)amount );
|
||||
}*/
|
||||
}
|
||||
|
||||
public sealed class CancelArrow : Packet
|
||||
{
|
||||
public CancelArrow() : base(0xBA, 6)
|
||||
{
|
||||
Stream.Write((byte)0);
|
||||
Stream.Write((short)-1);
|
||||
Stream.Write((short)-1);
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class SetArrow : Packet
|
||||
{
|
||||
public SetArrow(int x, int y) : base(0xBA, 6)
|
||||
{
|
||||
Stream.Write((byte)1);
|
||||
Stream.Write((short)x);
|
||||
Stream.Write((short)y);
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class CancelArrowHS : Packet
|
||||
{
|
||||
public CancelArrowHS(int x, int y, Serial s) : base(0xBA, 10)
|
||||
{
|
||||
Stream.Write((byte)0);
|
||||
Stream.Write((short)x);
|
||||
Stream.Write((short)y);
|
||||
Stream.Write(s);
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class SetArrowHS : Packet
|
||||
{
|
||||
public SetArrowHS(int x, int y, Serial s) : base(0xBA, 10)
|
||||
{
|
||||
Stream.Write((byte)1);
|
||||
Stream.Write((short)x);
|
||||
Stream.Write((short)y);
|
||||
Stream.Write(s);
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class DisplaySecureTrade : Packet
|
||||
{
|
||||
public DisplaySecureTrade(Mobile them, Container first, Container second, string name)
|
||||
: base(0x6F)
|
||||
{
|
||||
name ??= "";
|
||||
|
||||
EnsureCapacity(18 + name.Length);
|
||||
|
||||
Stream.Write((byte)0); // Display
|
||||
Stream.Write(them.Serial);
|
||||
Stream.Write(first.Serial);
|
||||
Stream.Write(second.Serial);
|
||||
Stream.Write(true);
|
||||
|
||||
Stream.WriteAsciiFixed(name, 30);
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class CloseSecureTrade : Packet
|
||||
{
|
||||
public CloseSecureTrade(Container cont)
|
||||
: base(0x6F)
|
||||
{
|
||||
EnsureCapacity(8);
|
||||
|
||||
Stream.Write((byte)1); // Close
|
||||
Stream.Write(cont.Serial);
|
||||
}
|
||||
}
|
||||
|
||||
public enum TradeFlag : byte
|
||||
{
|
||||
Display = 0x0,
|
||||
Close = 0x1,
|
||||
Update = 0x2,
|
||||
UpdateGold = 0x3,
|
||||
UpdateLedger = 0x4
|
||||
}
|
||||
|
||||
public sealed class UpdateSecureTrade : Packet
|
||||
{
|
||||
public UpdateSecureTrade(Container cont, bool first, bool second)
|
||||
: this(cont, TradeFlag.Update, first ? 1 : 0, second ? 1 : 0)
|
||||
{
|
||||
}
|
||||
|
||||
public UpdateSecureTrade(Container cont, TradeFlag flag, int first, int second)
|
||||
: base(0x6F)
|
||||
{
|
||||
EnsureCapacity(17);
|
||||
|
||||
Stream.Write((byte)flag);
|
||||
Stream.Write(cont.Serial);
|
||||
Stream.Write(first);
|
||||
Stream.Write(second);
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class SecureTradeEquip : Packet
|
||||
{
|
||||
public SecureTradeEquip(Item item, Mobile m) : base(0x25, 20)
|
||||
{
|
||||
Stream.Write(item.Serial);
|
||||
Stream.Write((short)item.ItemID);
|
||||
Stream.Write((byte)0);
|
||||
Stream.Write((short)item.Amount);
|
||||
Stream.Write((short)item.X);
|
||||
Stream.Write((short)item.Y);
|
||||
Stream.Write(m.Serial);
|
||||
Stream.Write((short)item.Hue);
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class SecureTradeEquip6017 : Packet
|
||||
{
|
||||
public SecureTradeEquip6017(Item item, Mobile m) : base(0x25, 21)
|
||||
{
|
||||
Stream.Write(item.Serial);
|
||||
Stream.Write((short)item.ItemID);
|
||||
Stream.Write((byte)0);
|
||||
Stream.Write((short)item.Amount);
|
||||
Stream.Write((short)item.X);
|
||||
Stream.Write((short)item.Y);
|
||||
Stream.Write((byte)0); // Grid Location?
|
||||
Stream.Write(m.Serial);
|
||||
Stream.Write((short)item.Hue);
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class MapPatches : Packet
|
||||
{
|
||||
public MapPatches() : base(0xBF)
|
||||
{
|
||||
EnsureCapacity(9 + 4 * 8);
|
||||
|
||||
Stream.Write((short)0x0018);
|
||||
|
||||
Stream.Write(4);
|
||||
|
||||
Stream.Write(Map.Felucca.Tiles.Patch.StaticBlocks);
|
||||
Stream.Write(Map.Felucca.Tiles.Patch.LandBlocks);
|
||||
|
||||
Stream.Write(Map.Trammel.Tiles.Patch.StaticBlocks);
|
||||
Stream.Write(Map.Trammel.Tiles.Patch.LandBlocks);
|
||||
|
||||
Stream.Write(Map.Ilshenar.Tiles.Patch.StaticBlocks);
|
||||
Stream.Write(Map.Ilshenar.Tiles.Patch.LandBlocks);
|
||||
|
||||
Stream.Write(Map.Malas.Tiles.Patch.StaticBlocks);
|
||||
Stream.Write(Map.Malas.Tiles.Patch.LandBlocks);
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class ObjectHelpResponse : Packet
|
||||
{
|
||||
public ObjectHelpResponse(IEntity e, string text) : base(0xB7)
|
||||
{
|
||||
EnsureCapacity(9 + text.Length * 2);
|
||||
|
||||
Stream.Write(e.Serial);
|
||||
Stream.WriteBigUniNull(text);
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class VendorBuyContent : Packet
|
||||
{
|
||||
public VendorBuyContent(List<BuyItemState> list)
|
||||
: base(0x3c)
|
||||
{
|
||||
EnsureCapacity(list.Count * 19 + 5);
|
||||
|
||||
Stream.Write((short)list.Count);
|
||||
|
||||
// The client sorts these by their X/Y value.
|
||||
// OSI sends these in weird order. X/Y highest to lowest and serial lowest to highest
|
||||
// These are already sorted by serial (done by the vendor class) but we have to send them by x/y
|
||||
// (the x74 packet is sent in 'correct' order.)
|
||||
for (var i = list.Count - 1; i >= 0; --i)
|
||||
{
|
||||
var bis = list[i];
|
||||
|
||||
Stream.Write(bis.MySerial);
|
||||
Stream.Write((ushort)bis.ItemID);
|
||||
Stream.Write((byte)0); // itemid offset
|
||||
Stream.Write((ushort)bis.Amount);
|
||||
Stream.Write((short)(i + 1)); // x
|
||||
Stream.Write((short)1); // y
|
||||
Stream.Write(bis.ContainerSerial);
|
||||
Stream.Write((ushort)bis.Hue);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class VendorBuyContent6017 : Packet
|
||||
{
|
||||
public VendorBuyContent6017(List<BuyItemState> list) : base(0x3c)
|
||||
{
|
||||
EnsureCapacity(list.Count * 20 + 5);
|
||||
|
||||
Stream.Write((short)list.Count);
|
||||
|
||||
// The client sorts these by their X/Y value.
|
||||
// OSI sends these in weird order. X/Y highest to lowest and serial loewst to highest
|
||||
// These are already sorted by serial (done by the vendor class) but we have to send them by x/y
|
||||
// (the x74 packet is sent in 'correct' order.)
|
||||
for (var i = list.Count - 1; i >= 0; --i)
|
||||
{
|
||||
var bis = list[i];
|
||||
|
||||
Stream.Write(bis.MySerial);
|
||||
Stream.Write((ushort)bis.ItemID);
|
||||
Stream.Write((byte)0); // itemid offset
|
||||
Stream.Write((ushort)bis.Amount);
|
||||
Stream.Write((short)(i + 1)); // x
|
||||
Stream.Write((short)1); // y
|
||||
Stream.Write((byte)0); // Grid Location?
|
||||
Stream.Write(bis.ContainerSerial);
|
||||
Stream.Write((ushort)bis.Hue);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class DisplayBuyList : Packet
|
||||
{
|
||||
public DisplayBuyList(Mobile vendor) : base(0x24, 7)
|
||||
{
|
||||
Stream.Write(vendor.Serial);
|
||||
Stream.Write((short)0x30); // buy window id?
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class DisplayBuyListHS : Packet
|
||||
{
|
||||
public DisplayBuyListHS(Mobile vendor) : base(0x24, 9)
|
||||
{
|
||||
Stream.Write(vendor.Serial);
|
||||
Stream.Write((short)0x30); // buy window id?
|
||||
Stream.Write((short)0x00);
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class VendorBuyList : Packet
|
||||
{
|
||||
public VendorBuyList(Mobile vendor, List<BuyItemState> list)
|
||||
: base(0x74)
|
||||
{
|
||||
EnsureCapacity(256);
|
||||
|
||||
Stream.Write(!(vendor.FindItemOnLayer(Layer.ShopBuy) is Container buyPack) ? Serial.MinusOne : buyPack.Serial);
|
||||
|
||||
Stream.Write((byte)list.Count);
|
||||
|
||||
for (var i = 0; i < list.Count; ++i)
|
||||
{
|
||||
var bis = list[i];
|
||||
|
||||
Stream.Write(bis.Price);
|
||||
|
||||
var desc = bis.Description ?? "";
|
||||
|
||||
Stream.Write((byte)(desc.Length + 1));
|
||||
Stream.WriteAsciiNull(desc);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class VendorSellList : Packet
|
||||
{
|
||||
public VendorSellList(Mobile shopkeeper, ICollection<SellItemState> sis) : base(0x9E)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue