Advertisement
TATATATRATATATA

Untitled

Oct 7th, 2019
657
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.76 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/GUI/forms/playerseditorform/consts';
  16. require 'lua/consts';
  17.  
  18. -- EDIT
  19.  
  20. local user_teamid = 46 --- Lazio
  21. local manager_from_teamid = 240 --- Atl. Madrid Manager (Diego Simeone)
  22.  
  23. -- END
  24.  
  25. local comp_desc = get_components_description_manager_edit()
  26.  
  27. local fields_to_edit = {
  28. "BodyTypeEdit",
  29. "EthnicityEdit",
  30. "EyebrowcodeEdit",
  31. "EyecolorcodeEdit",
  32. "FaceposerpresetEdit",
  33. "FacialhaircolorcodeEdit",
  34. "FacialhairtypecodeEdit",
  35. "GenderEdit",
  36. "HaircolorcodeEdit",
  37. "HairstylecodeEdit",
  38. "HairtypecodeEdit",
  39. "HashighqualityheadEdit",
  40. "HeadassetidEdit",
  41. "HeadclasscodeEdit",
  42. "HeadtypecodeEdit",
  43. "HeadvariationEdit",
  44. "HeightEdit",
  45. "ManageridEdit",
  46. "NationalityEdit",
  47. "OutfitidEdit",
  48. "PersonalityidEdit",
  49. "SeasonaloutfitidEdit",
  50. "SideburnscodeEdit",
  51. "SkintonecodeEdit",
  52. "SkintypecodeEdit",
  53. "WeightEdit"
  54. }
  55.  
  56. local columns = {
  57. firstname = 1,
  58. commonname = 2,
  59. surname = 3,
  60. skintypecode = 4,
  61. bodytypecode = 5,
  62. haircolorcode = 6,
  63. facialhairtypecode = 7,
  64. managerid = 8,
  65. hairtypecode = 9,
  66. headtypecode = 10,
  67. height = 11,
  68. seasonaloutfitid = 12,
  69. weight = 13,
  70. hashighqualityhead = 14,
  71. gender = 15,
  72. headassetid = 16,
  73. ethnicity = 17,
  74. faceposerpreset = 18,
  75. teamid = 19,
  76. eyebrowcode = 20,
  77. eyecolorcode = 21,
  78. personalityid = 22,
  79. headclasscode = 23,
  80. nationality = 24,
  81. sideburnscode = 25,
  82. headvariation = 26,
  83. skintonecode = 27,
  84. outfitid = 28,
  85. hairstylecode = 29,
  86. facialhaircolorcode = 30,
  87. }
  88.  
  89. -- manager table
  90. local sizeOf = 0x10C -- Size of one record in manager database table (0x10C)
  91.  
  92. -- iterate over all managers in 'manager' database table
  93. local i = 0
  94. local current_teamid = 0
  95.  
  96. local teamid_record = ADDR_LIST.getMemoryRecordByID(comp_desc['TeamidEdit']['id'])
  97. local success = false
  98. while true do
  99. if i >= 900 then
  100. break
  101. end
  102.  
  103. 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))
  104.  
  105. if (current_teamid + 1) == user_teamid then
  106. writeQword('ptrManager', readPointer('firstptrManager') + i*sizeOf)
  107. local managers_file_path = "other/manager.csv"
  108. for line in io.lines(managers_file_path) do
  109. local values = split(line, ',')
  110. if manager_from_teamid == tonumber(values[columns['teamid']]) then
  111. for j=1, #fields_to_edit do
  112. 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']
  113. end
  114. end
  115. end
  116. success = true
  117. end
  118.  
  119. i = i + 1
  120.  
  121. end
  122.  
  123. if success then
  124. showMessage("Done")
  125. else
  126. showMessage("Something went wrong... :(")
  127. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement