public ObjectInfoPacket(PacketReader reader)
: base(0x1A, "ObjectInfoPacket")
{
Serial = reader.ReadInt32();
ItemID = reader.ReadUInt16();
Amount = (ushort)(((Serial & 0x80000000) == 0x80000000) ? reader.ReadUInt16() : 0);
X = reader.ReadInt16();
Y = reader.ReadInt16();
Direction = (byte)(((X & 0x8000) == 0x8000) ? reader.ReadByte() : 0);
Z = reader.ReadSByte();
Hue = (ushort)(((Y & 0x8000) == 0x8000) ? reader.ReadUInt16() : 0);
Flags = (byte)(((Y & 0x4000) == 0x4000) ? reader.ReadByte() : 0);
// sanitize values
Serial = (int)(Serial & 0x7FFFFFFF);
ItemID = (ushort)(ItemID & 0x7FFF);
X = (short)(X & 0x7FFF);
Y = (short)(Y & 0x3FFF);
}
public GetPlayerStatusPacket(byte type, Serial serial)
: base(0x34, "Get Player Status", 10)
{
Stream.Write(0xEDEDEDED);//Unknown
Stream.Write((byte)type);
Stream.Write(serial);
}
public ZinagaPants(Serial serial): base(serial)
{
DefineMods();
if ( Parent != null && this.Parent is Mobile )
SetMods( (Mobile)Parent );
}
public PartyHealthTrackerGump(PartyMember member)
: base(member.Serial, 0)
{
while (UserInterface.GetControl<MobileHealthTrackerGump>() != null)
{
UserInterface.GetControl<MobileHealthTrackerGump>(member.Serial).Dispose();
}
IsMoveable = false;
IsUncloseableWithRMB = true;
m_Serial = member.Serial;
//AddControl(m_Background = new ResizePic(this, 0, 0, 3000, 131, 48));//I need opacity %1 background
AddControl(m_Name = new TextLabel(this, 1, 0, 1, member.Name));
//m_Background.MouseDoubleClickEvent += Background_MouseDoubleClickEvent; //maybe private message calling?
m_BarBGs = new GumpPic[3];
int sameX = 15;
int sameY = 3;
if (WorldModel.Entities.GetPlayerEntity().Serial != member.Serial)//you can't send a message to self
{
AddControl(btnPrivateMsg = new Button(this, 0, 20, 11401, 11402, ButtonTypes.Activate, member.Serial, 0));//private party message / use bandage ??
}
AddControl(m_BarBGs[0] = new GumpPic(this, sameX, 15 + sameY, 9750, 0));
AddControl(m_BarBGs[1] = new GumpPic(this, sameX, 24 + sameY, 9750, 0));
AddControl(m_BarBGs[2] = new GumpPic(this, sameX, 33 + sameY, 9750, 0));
m_Bars = new GumpPicWithWidth[3];
AddControl(m_Bars[0] = new GumpPicWithWidth(this, sameX, 15 + sameY, 40, 0, 1f));//I couldn't find correct visual
AddControl(m_Bars[1] = new GumpPicWithWidth(this, sameX, 24 + sameY, 9751, 0, 1f));//I couldn't find correct visual
AddControl(m_Bars[2] = new GumpPicWithWidth(this, sameX, 33 + sameY, 41, 0, 1f));//I couldn't find correct visual
// bars should not handle mouse input, pass it to the background gump.
for (int i = 0; i < m_BarBGs.Length; i++)//???
{
m_Bars[i].HandlesMouseInput = false;
}
}
public SwingPacket(PacketReader reader)
: base(0x2F, "Swing")
{
m_flag = reader.ReadByte();
m_attacker = reader.ReadInt32();
m_defender = reader.ReadInt32();
}
public UpdateHealthPacket(PacketReader reader)
: base(0xA1, "Update Health")
{
m_serial = reader.ReadInt32();
m_max = reader.ReadInt16();
m_current = reader.ReadInt16();
}
public DropToLayerPacket(Serial itemSerial, byte layer, Serial playerSerial)
: base(0x13, "Drop To Layer", 10)
{
Stream.Write(itemSerial);
Stream.Write((byte)layer);
Stream.Write(playerSerial);
}
public OpenContainerPacket(PacketReader reader)
: base(0x24, "Open Container")
{
m_serial = reader.ReadInt32();
m_gumpId = reader.ReadUInt16();
reader.ReadUInt16();
}
public BeltOfTheMagi( Serial serial ) : base( serial )
{
DefineMods();
if ( Parent != null && this.Parent is Mobile )
SetMods( (Mobile)Parent );
}
public TopMenu(Serial serial)
: base(serial, 0)
{
// maximized view
AddControl(new ResizePic(this, 1, 0, 0, 9200, 610, 27));
AddControl(new Button(this, 1, 5, 3, 5540, 5542, 0, 2, 0));
((Button)LastControl).GumpOverID = 5541;
// buttons are 2443 small, 2445 big
// 30, 93, 201, 309, 417, 480, 543
// map, paperdollB, inventoryB, journalB, chat, help, < ? >
AddControl(new Button(this, 1, 30, 3, 2443, 2443, ButtonTypes.Activate, 0, (int)Buttons.Map));
((Button)LastControl).Caption = "<basefont color=#000000>Map";
AddControl(new Button(this, 1, 93, 3, 2445, 2445, ButtonTypes.Activate, 0, (int)Buttons.Paperdoll));
((Button)LastControl).Caption = "<basefont color=#000000>Paperdoll";
AddControl(new Button(this, 1, 201, 3, 2445, 2445, ButtonTypes.Activate, 0, (int)Buttons.Inventory));
((Button)LastControl).Caption = "<basefont color=#000000>Inventory";
AddControl(new Button(this, 1, 309, 3, 2445, 2445, ButtonTypes.Activate, 0, (int)Buttons.Journal));
((Button)LastControl).Caption = "<basefont color=#000000>Journal";
AddControl(new Button(this, 1, 417, 3, 2443, 2443, ButtonTypes.Activate, 0, (int)Buttons.Chat));
((Button)LastControl).Caption = "<basefont color=#000000>Chat";
AddControl(new Button(this, 1, 480, 3, 2443, 2443, ButtonTypes.Activate, 0, (int)Buttons.Help));
((Button)LastControl).Caption = "<basefont color=#000000>Help";
AddControl(new Button(this, 1, 543, 3, 2443, 2443, ButtonTypes.Activate, 0, (int)Buttons.Question));
((Button)LastControl).Caption = "<basefont color=#000000>Debug";
// minimized view
AddControl(new ResizePic(this, 2, 0, 0, 9200, 30, 27));
AddControl(new Button(this, 2, 5, 3, 5537, 5539, 0, 1, 0));
((Button)LastControl).GumpOverID = 5538;
}
public AlligatorBelt( Serial serial ) : base( serial )
{
DefineMods();
if ( Parent != null && this.Parent is Mobile )
SetMods( (Mobile)Parent );
}
public Mobile(Serial serial)
: base(serial)
{
m_equipment = new MobileEquipment(this);
m_animation = new MobileAnimation(this);
m_movement.RequiresUpdate = true;
}
public CloakOfTheGodlyTailor(Serial serial): base(serial)
{
DefineMods();
if ( Parent != null && this.Parent is Mobile )
SetMods( (Mobile)Parent );
}
public CustomHousePacket(PacketReader reader)
: base(0xD8, "Custom House Packet")
{
byte CompressionType = reader.ReadByte();
if (CompressionType != 3)
{
_houseSerial = Serial.Null;
return;
}
reader.ReadByte(); // unknown, always 0?
_houseSerial = reader.ReadInt32();
_revisionHash = reader.ReadInt32();
// this is for compression type 3 only
int bufferLength = reader.ReadInt16();
int trueBufferLength = reader.ReadInt16();
_numPlanes = reader.ReadByte();
// end compression type 3
_planes = new CustomHousePlane[_numPlanes];
for (int i = 0; i < _numPlanes; i++)
{
_planes[i] = new CustomHousePlane(reader);
}
}
public EquipmentEntry(Serial serial, ushort gumpId, byte layer, ushort hue)
{
Serial = serial;
GumpId = gumpId;
Layer = layer;
Hue = hue;
}
public QuestGumpRequestPacket(Serial serial)
: base(0xD7, "Quest gump request")
{
Stream.Write(serial);
Stream.Write((ushort)0x0032);
Stream.Write((byte)0x00);
}
public DruidCloak( Serial serial ) : base( serial )
{
DefineMods();
if ( Parent != null && this.Parent is Mobile )
SetMods( (Mobile)Parent );
}
public ContextMenuResponsePacket(Serial serial, short responseIndex)
: base(0xBF, "Context Menu Response")
{
Stream.Write((short)0x15); // subcommand 0x15, response to context menu
Stream.Write((int)serial);
Stream.Write((short)responseIndex);
}
public Odinshirt(Serial serial): base(serial)
{
DefineMods();
if ( Parent != null && this.Parent is Mobile )
SetMods( (Mobile)Parent );
}
public PartyAcceptPacket(Serial invitingPartyLeader)
: base(0xbf, "Party Join Accept")
{
Stream.Write((short)6);
Stream.Write((byte)8);
Stream.Write(invitingPartyLeader);
}
public UpdateStaminaPacket(PacketReader reader)
: base(0xA3, "Update Stamina")
{
m_serial = reader.ReadInt32();
m_max = reader.ReadInt16();
m_current = reader.ReadInt16();
}
public MobileQueryPacket(StatusType type, Serial serial)
: base(0x34, "Get Player Status", 10)
{
Stream.Write(0xEDEDEDED); // always 0xEDEDEDED in legacy client
Stream.Write((byte)type);
Stream.Write(serial);
}
public SashOfMight(Serial serial) : base(serial)
{
//DefineMods();
//if ( Parent != null && this.Parent is Mobile )
// SetMods( (Mobile)Parent );
}
public void ValueTest()
{
Serial target = new Serial(); // TODO: 初始化为适当的值
long actual;
actual = target.Value;
Assert.Inconclusive( "验证此测试方法的正确性。" );
}
public DeathAnimationPacket(PacketReader reader)
: base(0xAF, "Death Animation")
{
PlayerSerial = reader.ReadInt32();
CorpseSerial = reader.ReadInt32();
reader.ReadInt32(); // unknown - all zero's.
}
public FanalaonBoots(Serial serial): base(serial)
{
DefineMods();
if ( Parent != null && this.Parent is Mobile )
SetMods( (Mobile)Parent );
}
public CloakOfTheNecromancer( Serial serial ) : base( serial )
{
DefineMods();
if ( Parent != null && this.Parent is Mobile )
SetMods( (Mobile)Parent );
}
public ObjectPropertyListPacket(PacketReader reader)
: base(0xD6, "Object Property List")
{
reader.ReadInt16(); // Always 0x0001
m_serial = reader.ReadInt32();
reader.ReadInt16(); // Always 0x0000
m_hash = reader.ReadInt32();
m_clilocs = new List<int>();
m_arguments = new List<string>();
// Loop of all the item/creature's properties to display in the order to display them. The name is always the first entry.
int clilocId = reader.ReadInt32();
while (clilocId != 0)
{
m_clilocs.Add(clilocId);
int textLength = reader.ReadUInt16();
string args = string.Empty;
if (textLength > 0)
{
args = reader.ReadUnicodeStringReverse(textLength / 2);
}
m_arguments.Add(args);
clilocId = reader.ReadInt32();
}
}
public SpellbookData(Serial serial, ushort itemID, ushort bookTypePacketID, ulong spellBitFields)
{
Serial = serial;
ItemID = itemID;
SpellsBitfield = spellBitFields;
switch (bookTypePacketID)
{
case 1:
BookType = SpellBookTypes.Magic;
break;
case 101:
BookType = SpellBookTypes.Necromancer;
break;
case 201:
BookType = SpellBookTypes.Chivalry;
break;
case 401:
BookType = SpellBookTypes.Bushido;
break;
case 501:
BookType = SpellBookTypes.Ninjitsu;
break;
case 601:
BookType = SpellBookTypes.Spellweaving;
break;
default:
BookType = SpellBookTypes.Unknown;
return;
}
}
public GuildGumpRequestPacket(Serial serial)
: base(0xD7, "Guild gump request")
{
Stream.Write(serial);
Stream.Write((ushort)0x0028);
Stream.Write((byte)0x0A);
}