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:
Then remove also this line from Poison property (line 8280):
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 .
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 );
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 .