Trying to find out hpmp update packets .. see [Only registered and activated users can see links. Click Here To Register...]
Quote:
Trying to find out hpmp update packets .. see Request Server Listing ?
HP/MP Update AD 8A 4E 00 object id 04 type 1 02 type 2 FC 00 00 00 new value If type 2 = 3 or 5, then a trailing dword is added for MP value. Type 1: 10 increase 01 hp decrease 04 mp decrease Type 2: 01 hp 02 mp 03 hp & mp 04 ? 05 mob hp & mp
I have the same. I couldn't understand it from there..Quote:
From SREmu...Code:HP/MP Update AD 8A 4E 00 object id 04 type 1 02 type 2 FC 00 00 00 new value If type 2 = 3 or 5, then a trailing dword is added for MP value. Type 1: 10 increase 01 hp decrease 04 mp decrease Type 2: 01 hp 02 mp 03 hp & mp 04 ? 05 mob hp & mp
int objectid = packet.read_dword
byte type1 = packet.read_byte //increase or decrease, unnecessary atm...
byte type2 = packet.read_byte //hp or mp or hp&mp
switch type2
{
case 1 //hp
if objectid = me.objectid then
me.currenthp = packet.read_dword
elseif moblist.contains(objectid) then
moblist(objectid).currenthp = packet.read_dword
end if
case 2 //mp
if objectid = me.objectid then
me.currentmp = packet.read_dword
end if
case 3 //hp & mp
if objectid = me.objectid then
me.currenthp = packet.read_dword
me.currentmp = packet.read_dword
end if
}
Pservers doesnt support edx loader :(Quote:
Owh sorry I thought your were talking about the server list xD
kinda confusing title.
but if you want the hp and mp of your character and follow the updates you need to parse the 0x3013 or 0x34e5 packet if i am correct at least the big character data packet. one of the first bytes is the hp and mp and the stats packet which comes a bit after that one (idk the opcode) contains the current hp and mp.
now you need to do something which changes your hp like casting a pot and check the packets you logged to find the correct one which contains the hp and mp and with edx silkroad loader it'll already be parsed so all you need to do is read the packet.
Dim ms As New MemoryStream(data)
Dim bn As New BinaryReader(ms)
Dim objectid As UInt32 = bn.ReadUInt32
Dim i As Byte = bn.ReadByte
Dim type As Byte = bn.ReadByte
Select Case CByte((type - 1))
Case 0
hpcur = bn.ReadUInt32
Exit Select
Case 1
mpcur = bn.ReadUInt32
Exit Select
Case 2
hpcur = bn.ReadUInt32
mpcur = bn.ReadUInt32
Exit Select
Case 3
Dim b As Byte = bn.ReadByte
Exit Select
End Select