Advertisement
TATATATRATATATA

Untitled

Oct 3rd, 2019
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.66 KB | None | 0 0
  1. --- This script allows you to change headmodel of your manager to one of the existing scanned headmodels like Lampard or Klopp.
  2. --- Make a backup save before you apply this just to be safe. Join this discord for help: https://discord.gg/QFyHUxe
  3. --- It may take a few mins. Cheat Engine will stop responding and it's normal behaviour. Wait until you get 'Done' message.
  4.  
  5. --- HOW TO USE:
  6. --- 1. Activate FIFA Database Tables script
  7. --- 2. Load your career.
  8. --- 3. In Cheat Engine click on "Memory View" button.
  9. --- 4. Press "CTRL + L" to open lua engine
  10. --- 5. Then press "CTRL + O" and open this script
  11. --- 6. Click on 'Execute' button to execute script and wait for 'done' message box. It may take a few minutes, and the cheat engine will stop responding.
  12.  
  13. --- AUTHOR: ARANAKTU
  14.  
  15. require 'lua/consts';
  16.  
  17. -- EDIT
  18.  
  19. local user_teamid = 10
  20. local manager_from_teamid = 10
  21.  
  22. -- END
  23.  
  24. local comp_desc = get_components_description_manager_edit()
  25.  
  26. local fields_to_edit = {
  27. "BodyTypeEdit",
  28. "EthnicityEdit",
  29. "EyebrowcodeEdit",
  30. "EyecolorcodeEdit",
  31. "FaceposerpresetEdit",
  32. "FacialhaircolorcodeEdit",
  33. "FacialhairtypecodeEdit",
  34. "GenderEdit",
  35. "HaircolorcodeEdit",
  36. "HairstylecodeEdit",
  37. "HairtypecodeEdit",
  38. "HashighqualityheadEdit",
  39. "HeadassetidEdit",
  40. "HeadclasscodeEdit",
  41. "HeadtypecodeEdit",
  42. "HeadvariationEdit",
  43. "HeightEdit",
  44. "ManageridEdit",
  45. "NationalityEdit",
  46. "OutfitidEdit",
  47. "PersonalityidEdit",
  48. "SeasonaloutfitidEdit",
  49. "SideburnscodeEdit",
  50. "SkintonecodeEdit",
  51. "SkintypecodeEdit",
  52. "WeightEdit"
  53. }
  54.  
  55. local columns = {
  56. firstname = 1,
  57. commonname = 2,
  58. surname = 3,
  59. skintypecode = 4,
  60. bodytypecode = 5,
  61. haircolorcode = 6,
  62. facialhairtypecode = 7,
  63. managerid = 8,
  64. hairtypecode = 9,
  65. headtypecode = 10,
  66. height = 11,
  67. seasonaloutfitid = 12,
  68. weight = 13,
  69. hashighqualityhead = 14,
  70. gender = 15,
  71. headassetid = 16,
  72. ethnicity = 17,
  73. faceposerpreset = 18,
  74. teamid = 19,
  75. eyebrowcode = 20,
  76. eyecolorcode = 21,
  77. personalityid = 22,
  78. headclasscode = 23,
  79. nationality = 24,
  80. sideburnscode = 25,
  81. headvariation = 26,
  82. skintonecode = 27,
  83. outfitid = 28,
  84. hairstylecode = 29,
  85. facialhaircolorcode = 30,
  86. }
  87.  
  88. -- manager table
  89. local sizeOf = 0x10C -- Size of one record in manager database table (0x10C)
  90.  
  91. -- iterate over all managers in 'manager' database table
  92. local i = 0
  93. local current_teamid = 0
  94.  
  95. local teamid_record = ADDR_LIST.getMemoryRecordByID(comp_desc['TeamidEdit']['id'])
  96. local success = false
  97. while true do
  98. if i >= 900 then
  99. break
  100. end
  101.  
  102. local current_teamid = bAnd(bShr(readInteger(string.format('[%s]+%X', 'firstptrManager', teamid_record.getOffset(0)+(i*sizeOf))), teamid_record.Binary.Startbit), (bShl(1, teamid_record.Binary.Size) - 1))
  103.  
  104. if (current_teamid + 1) == user_teamid then
  105. writeQword('ptrManager', readPointer('firstptrManager') + i*sizeOf)
  106. local managers_file_path = "other/manager.csv"
  107. for line in io.lines(managers_file_path) do
  108. local values = split(line, ',')
  109. if manager_from_teamid == tonumber(values[columns['teamid']]) then
  110. for j=1, #fields_to_edit do
  111. ADDR_LIST.getMemoryRecordByID(comp_desc[fields_to_edit[j]]['id']).Value = values[columns[comp_desc[fields_to_edit[j]]['db_col']]] - comp_desc[fields_to_edit[j]]['modifier']
  112. end
  113. end
  114. end
  115. success = true
  116. end
  117.  
  118. i = i + 1
  119.  
  120. end
  121.  
  122. if success then
  123. showMessage("Done")
  124. else
  125. showMessage("Something went wrong... :(")
  126. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement