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!

Fix for poison issue with SA 2D client

Smjert

Sorceror
Fix for poison issue with SA 2D client

The health bar status isn't updated anymore with the flag byte in MobileMoving, MobileIncoming etc but with packet 0x17 (used also with KR).

The "guide" for this packet says:

When character is poisoned (green health bar), flag is determined as: 0 – remove poison, > 0 – poison level

byte ID (17)
byte[2] Packet Size
dword Mobile Serial
word 1
word Status Color (1 = Green, 2 = Yellow, others = Red)
word Flag (0 = Remove Status Color, 1 = Enable Status Color)

First of all we have to remove these lines from Mobile.cs, GetPacketFlags function:
Code:
if( m_Poison != null )
flags |= 0x04;


Then remove also this line from Poison property (line 8280):
Code:
Delta( MobileDelta.Flags );
since we don't have to update it with MobileMoving or other packets.

This way when you're poisoned and not mounted you don't run anymore as if you are mounted.

Then to update the status bar you have to implement packet 0x17 and for instance send it in function OnPoisoned (StatusColor = 1, Flag should be PoisonLevel + 1, since i think it's Enable + PoisonLevel) and when it worn off you send it again (StatusColor = 1, Flag = 0).
The same thing it is for the other status (yellow bar etc).

This system works also with the older client (< 7), i dunno anyway the "last" client that support it.
Hope this helps ;).
 

nibbio

Sorceror
Are you sure that the "flag" is a word?

i tryed with that settings but the packet doesn't seem to work.

with "byte" instead of "word" the packet works; maybe this is the correct type of field
 

Jeff

Lord
Isn't this already fixed in the SVN?

Revision: 385
Author: mark
Date: 9:33:01 PM, Saturday, October 03, 2009
Message:
character creation, healthbar (poison/yellow), etc
----
Modified : /devel/Scripts/Misc/RaceDefinitions.cs
Modified : /devel/Server/Mobile.cs
Modified : /devel/Server/Network/NetState.cs
Modified : /devel/Server/Network/PacketHandlers.cs
Modified : /devel/Server/Network/Packets.cs
 
Top