Parsing EliteSro Chardata [ mostly done ]

07/07/2011 02:49 sarkoplata#1
Ok .. Well guys , i mostly parsed the elitesro chardata.
But i can't find out x and y coords , and im not sure if my quests part is true.
Here we go , i paste my code :
PHP Code:
Dim Pos As sPos
        Dim glr 
As UInt32
        Dim type 
As Byte
        bn
.ReadBytes(9' ? , model , volume
        Dim Level As Byte = bn.ReadByte
        bn.ReadByte() ' 
highest mastery level
        Dim EXP 
As UInt64 bn.ReadUInt64
        Dim spbar 
As UInt32 bn.ReadUInt32
        Dim Gold 
As UInt64 bn.ReadUInt64
        Dim SkillPoints 
As UInt32 bn.ReadUInt32
        Dim AP 
As UInt16 bn.ReadUInt16
        Dim BersPoints 
As Byte bn.ReadByte
        bn
.ReadUInt32()
        
Dim HP As UInt32 bn.ReadUInt32
        Dim MP 
As UInt32 bn.ReadUInt32

        bn
.ReadBytes(9)
        If (
AP 0Then
            Log
("You Have " AP " Arttiributive Points!")
        
End If

        
'Handle.MainChar._CharName = CharName
        Handle.MainChar._Level = Level
        Handle.MainChar._CurHp = HP
        Handle.MainChar._CurMp = MP
        Handle.MainChar._Sp = SkillPoints
        Handle.MainChar._Gold = Gold
        Handle.MainChar._Ap = AP
        Handle.MainChar._CurrExp = EXP
        Handle.MainChar._Berserk = BersPoints

        Dim InvSize As Byte = bn.ReadByte
        Dim ItemCount As Byte = bn.ReadByte

        For i = 0 To ItemCount - 1

            itemdata.Position(i) = bn.ReadByte
            Dim typeID As UInt32 = bn.ReadUInt32
            itemdata.typeID(typeID) = typeID
           
            If itemdata.pk2name(typeID).Contains("SN_ITEM_EU") Or itemdata.pk2name(typeID).Contains("SN_ITEM_CH") Then
                itemdata.pluslevel(typeID) = bn.ReadByte
                bn.ReadUInt64()
                itemdata.durability(typeID) = bn.ReadUInt32
                itemdata.bluecount(typeID) = bn.ReadByte

                For n = 0 To itemdata.bluecount(typeID) - 1
                    bn.ReadUInt32()
                    bn.ReadUInt32()
                Next

                Log("Item Found : " & itemdata.name(typeID).ToString & "[+" & itemdata.pluslevel(typeID) & "]")
            Else
                itemdata.amount(typeID) = bn.ReadUInt16
                Log("Item Found : " & itemdata.name(typeID).ToString & "Amount : " & itemdata.amount(typeID) & "]")
            End If
            Next

        bn.ReadBytes(3)
        Dim MasteryLevel As Byte
        Dim masteryname As String
        Dim wholemasteries As String = "Masteries : "
Masteries_:
        Do While bn.ReadByte = 1
            glr = bn.ReadUInt32
            MasteryLevel = bn.ReadByte
            Select Case glr
                Case 513
                    masteryname = "Warrior"
                Case 514
                    masteryname = "Wizard"
                Case 515
                    masteryname = "Rogue"
                Case 516
                    masteryname = "Warlock"
                Case 517
                    masteryname = "Bard"
                Case 518
                    masteryname = "Cleric"
            End Select
            wholemasteries = wholemasteries & masteryname & " [" & MasteryLevel & "] "
        Loop
        Log(wholemasteries)
        bn.ReadByte()

        '
## Skills
        
While bn.ReadByte 1
            Dim skillid 
As UInt32 bn.ReadUInt32()
            
Log("Skill Found : " LoadTextDatas.skilldata.name(skillid))
            
Loggers.AddSkills(LoadTextDatas.skilldata.name(skillid))
            
bn.ReadByte()
        
End While
        
'## End Skills

        Dim FinishedQuests As UInt16 = bn.ReadUInt16
        For n = 0 To FinishedQuests - 1
            bn.ReadUInt32()
        Next

        Dim alivequest As Byte = bn.ReadByte

        For x = 0 To alivequest - 1
            Dim questid As UInt32 = bn.ReadUInt32()
            bn.ReadUInt16()
            Dim flag As Byte = bn.ReadByte
            bn.ReadUInt32()
            Dim questnameLen As UInt16 = bn.ReadUInt16()
            Dim questname As String = bn.ReadChars(questnameLen)
            MsgBox(flag)
            If flag = 58 Then
                MsgBox("flagis58")
                bn.ReadBytes(9)
            Else
                bn.ReadBytes(5)
            End If
        Next

        Dim mainid As UInt32 = bn.ReadUInt32
        Dim Xsection As Byte = bn.ReadByte
        Dim Ysection As Byte = bn.ReadByte
        Dim Xcoord As Single = bn.ReadSingle
        Dim Zcoord As Single = bn.ReadSingle
        Dim Ycoord As Single = bn.ReadSingle

        sPos.x = (((Xsection - &H87) * &HC0) + (Xcoord / 10.0!))
        sPos.y = (((Ysection - &H5C) * &HC0) + (Ycoord / 10.0!))
        sPos.z = Zcoord

        //bn.ReadBytes(63)
      
        Dim charNameLen As UInt16 = bn.ReadUInt16
        Dim charName As String = bn.ReadChars(charNameLen)
        MsgBox(charName) 
If the place where i read the xyz coords are true, i always get -25920 for x... so i should read somewhere else but im stuck.Hope u'll helpme ^^
07/07/2011 09:24 kevin_owner#2
should be at the correct position if the quests are fine.
but you could also use edxSilkroadLoader and check out the long lines with I believe 14 bytes. after the quests and this is the one you're looking for. This line starts with 3 floats the x z and y position and then there is a short for the angle.