corpse packet fixes
This commit is contained in:
parent
2a9b547f7b
commit
5e2fb90a53
2 changed files with 87 additions and 3 deletions
|
|
@ -866,10 +866,18 @@ namespace Server.Items
|
|||
{
|
||||
base.SendInfoTo( state, sendOplPacket );
|
||||
|
||||
if ( ItemID == 0x2006 )
|
||||
if (((Body)Amount).IsHuman && ItemID == 0x2006)
|
||||
{
|
||||
state.Send( new CorpseContent( state.Mobile, this ) );
|
||||
state.Send( new CorpseEquip( state.Mobile, this ) );
|
||||
if (state.ContainerGridLines)
|
||||
{
|
||||
state.Send(new CorpseContent6017(state.Mobile, this));
|
||||
}
|
||||
else
|
||||
{
|
||||
state.Send(new CorpseContent(state.Mobile, this));
|
||||
}
|
||||
|
||||
state.Send(new CorpseEquip(state.Mobile, this));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -122,4 +122,80 @@ namespace Server.Network
|
|||
m_Stream.Write( (ushort)written );
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class CorpseContent6017 : Packet
|
||||
{
|
||||
public CorpseContent6017(Mobile beholder, Corpse beheld)
|
||||
: base(0x3C)
|
||||
{
|
||||
List<Item> items = beheld.EquipItems;
|
||||
int count = items.Count;
|
||||
|
||||
if (beheld.Hair != null && beheld.Hair.ItemID > 0)
|
||||
count++;
|
||||
if (beheld.FacialHair != null && beheld.FacialHair.ItemID > 0)
|
||||
count++;
|
||||
|
||||
EnsureCapacity(5 + (count * 20));
|
||||
|
||||
long pos = m_Stream.Position;
|
||||
|
||||
int written = 0;
|
||||
|
||||
m_Stream.Write((ushort)0);
|
||||
|
||||
for (int i = 0; i < items.Count; ++i)
|
||||
{
|
||||
Item child = items[i];
|
||||
|
||||
if (!child.Deleted && child.Parent == beheld && beholder.CanSee(child))
|
||||
{
|
||||
m_Stream.Write((int)child.Serial);
|
||||
m_Stream.Write((ushort)child.ItemID);
|
||||
m_Stream.Write((byte)0); // signed, itemID offset
|
||||
m_Stream.Write((ushort)child.Amount);
|
||||
m_Stream.Write((short)child.X);
|
||||
m_Stream.Write((short)child.Y);
|
||||
m_Stream.Write((byte)0); // Grid Location?
|
||||
m_Stream.Write((int)beheld.Serial);
|
||||
m_Stream.Write((ushort)child.Hue);
|
||||
|
||||
++written;
|
||||
}
|
||||
}
|
||||
|
||||
if (beheld.Hair != null && beheld.Hair.ItemID > 0)
|
||||
{
|
||||
m_Stream.Write((int)HairInfo.FakeSerial(beheld.Owner) - 2);
|
||||
m_Stream.Write((ushort)beheld.Hair.ItemID);
|
||||
m_Stream.Write((byte)0); // signed, itemID offset
|
||||
m_Stream.Write((ushort)1);
|
||||
m_Stream.Write((short)0);
|
||||
m_Stream.Write((short)0);
|
||||
m_Stream.Write((byte)0); // Grid Location?
|
||||
m_Stream.Write((int)beheld.Serial);
|
||||
m_Stream.Write((ushort)beheld.Hair.Hue);
|
||||
|
||||
++written;
|
||||
}
|
||||
|
||||
if (beheld.FacialHair != null && beheld.FacialHair.ItemID > 0)
|
||||
{
|
||||
m_Stream.Write((int)FacialHairInfo.FakeSerial(beheld.Owner) - 2);
|
||||
m_Stream.Write((ushort)beheld.FacialHair.ItemID);
|
||||
m_Stream.Write((byte)0); // signed, itemID offset
|
||||
m_Stream.Write((ushort)1);
|
||||
m_Stream.Write((short)0);
|
||||
m_Stream.Write((short)0);
|
||||
m_Stream.Write((byte)0); // Grid Location?
|
||||
m_Stream.Write((int)beheld.Serial);
|
||||
m_Stream.Write((ushort)beheld.FacialHair.Hue);
|
||||
|
||||
++written;
|
||||
}
|
||||
|
||||
m_Stream.Seek(pos, SeekOrigin.Begin);
|
||||
m_Stream.Write((ushort)written);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue