RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Corpse Hair/Facial bug with client 6.0.1.7 [SVN-313]

Kamron

Knight
I apologize for such a long delay. There is STILL a bug with Hair/Facial hair in RunUO SVN 313 with clients above 6.0.1.7. This is an updated version of my previous thread. You can only fix this by doing the core modification.

Go to Server\Items\Container.cs - Look for this code

Code:
			if ( state != null && state.IsPost6017 )
				state.Send( new ContainerContent6017( state.Mobile, this ) );
			else
				state.Send( new ContainerContent( state.Mobile, this ) );

Change it to

Code:
			SendContentTo( to.NetState );

Now underneath that function where you made the replacement, add this new function:
Code:
		public virtual void SendContentTo( NetState state )
		{
			if ( state != null && state.IsPost6017 )
				state.Send( new ContainerContent6017( state.Mobile, this ) );
			else
				state.Send( new ContainerContent( state.Mobile, this ) );
		}

Now go to Scripts\Items\Misc\Corpses\Corpse.cs and find this code:
Code:
		public override void SendInfoTo( NetState state, bool sendOplPacket )
		{
			base.SendInfoTo( state, sendOplPacket );

			if ( ItemID == 0x2006 )
			{
				state.Send( new CorpseContent( state.Mobile, this ) );
				state.Send( new CorpseEquip( state.Mobile, this ) );
			}
		}

Replace that whole function with this:
Code:
		public override void SendContentTo( NetState state )
		{
			if ( state != null && state.IsPost6017 )
				state.Send( new CorpseContent6017( state.Mobile, this ) );
			else
				state.Send( new CorpseContent( state.Mobile, this ) );

			if ( ItemID == 0x2006 )
				state.Send( new CorpseEquip( state.Mobile, this ) );
		}

		public override void SendInfoTo( NetState state, bool sendOplPacket )
		{
			base.SendInfoTo( state, sendOplPacket );

			if ( ItemID == 0x2006 )
			{
				if ( state != null && state.IsPost6017 )
					state.Send( new CorpseEquipContent6017( state.Mobile, this ) );
				else
					state.Send( new CorpseEquipContent( state.Mobile, this ) );

				state.Send( new CorpseEquip( state.Mobile, this ) );
			}
		}

Finally, replace the file in Scripts\Items\Misc\Corpses\Packets.cs with the one provided for download.

You're done!
 

Attachments

  • Packets.cs
    9.8 KB · Views: 35

Kamron

Knight
I updated this to fix a bug with 3rd party programs listing the items in a corpse when the player should not know the contents.
 

kegmeister

Sorceror
Thanks for posting this.

You didn't specify but from what i understand this also fixes the bug in which corpses appear naked until you double click them, unless you were on-screen when the player/npc died. Is there anything else that this fixes?

If those are the only fixes, do you need to have a core modification at all? Instead of changing Container.cs, what if you add this to Corpse.cs:
Code:
		public override void DisplayTo( Mobile to )
		{
			base.DisplayTo( to );
			if ( ItemID == 0x2006 )
				to.Send( new CorpseEquip( to, this ) );
		}

The packets are different in that the corpse equipment would be sent after the property list, but it seems to work okay for me, perhaps you can verify?
 

Kamron

Knight
If you do not use the core modification then the corpse will lose its hair instead of being completely naked. You can use the DisplayTo as well. I will test it, but I do not have an AOS shard ready to test the order. I believe the order must be Content, Equip, OPL. I could be wrong.

Also the code above fixes a problem where 3rd party tools will be able to see loot in the corpse when they technically should only see what is equipped.

EDIT: Apparently the latest version that I copied/pasted, had the wrong modifications in it. I changed it accordingly. I apologize for the that. If you would like to test the DisplayTo, please do. Keep in mind that you must send the CorpseContent packet as well even though you are using base.DisplayTo, because the CorpseContent includes the virtual hair. If you call base.DisplayTo, you will be sending the old packets and the new packets, which will be a "dirty" fix.
 

Koksi

Sorceror
I can`t understand why you need this packet:

Code:
	public sealed class CorpseContent6017 : Packet
	{
		public CorpseContent6017( Mobile beholder, Corpse beheld )
			: base( 0x3C )
		{
			List<Item> items = beheld.Items;
			int count = items.Count;

I was used only this and i think i don`t have problems for now.
Code:
List<Item> items = beheld.EquipItems;
 

Kamron

Knight
Koksi;806420 said:
I can`t understand why you need this packet:

Code:
	public sealed class CorpseContent6017 : Packet
	{
		public CorpseContent6017( Mobile beholder, Corpse beheld )
			: base( 0x3C )
		{
			List<Item> items = beheld.Items;
			int count = items.Count;

I was used only this and i think i don`t have problems for now.
Code:
List<Item> items = beheld.EquipItems;

Because if you read the normal CorpseContent packet, it is missing the grid location.
 
Top