Advertisement
Guest User

Untitled

a guest
Aug 30th, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.42 KB | None | 0 0
  1. Sub HandleClassesData(ByVal Index As Long, ByRef data() As Byte, ByVal StartAddR As Long, ByVal ExtraVar As Long)
  2. Dim n As Long
  3. Dim I As Long
  4. Dim z As Long, X As Long
  5. Dim Buffer As buffer_t
  6.  
  7. Call init_buf(Buffer)
  8. write_bytes Buffer, data()
  9. n = 1
  10. n = n + 1
  11.  
  12. For I = 1 To MAX_CLASSES
  13.  
  14. If read_str(Buffer, Class(I).Name) < 0 Then Exit Sub
  15. If read_long(Buffer, Class(I).Vital(Vitals.HP)) < 0 Then Exit Sub
  16. If read_long(Buffer, Class(I).Vital(Vitals.MP)) < 0 Then Exit Sub
  17.  
  18. ' get array size
  19. If read_long(Buffer, z) < 0 Then Exit Sub
  20. ' redim array
  21. ReDim Class(I).MaleSprite(0 To z)
  22. ' loop-receive data
  23. For X = 0 To z
  24. If read_long(Buffer, Class(I).MaleSprite(X)) < 0 Then Exit Sub
  25. Next
  26.  
  27. ' get array size
  28. If read_long(Buffer, z) < 0 Then Exit Sub
  29. ' redim array
  30. ReDim Class(I).FemaleSprite(0 To X)
  31. ' loop-receive data
  32. For X = 0 To z
  33. If read_long(Buffer, Class(I).FemaleSprite(X)) < 0 Then Exit Sub
  34. Next
  35.  
  36. For X = 1 To Stats.Stat_Count - 1
  37. If read_byte(Buffer, Class(I).stat(X)) < 0 Then Exit Sub
  38. ' clng(Class(I).stat(X))
  39. Next
  40.  
  41.  
  42. n = n + 10
  43. Next
  44.  
  45. term_buf Buffer
  46.  
  47. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement