Advertisement
TATATATRATATATA

Untitled

Nov 3rd, 2019
471
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.15 KB | None | 0 0
  1. --- This script allows you to change headmodel of your manager to one of the existing scanned headmodels of real players like Giggs or Henry.
  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 = 0
  21. local playerid = 0
  22. -- END
  23.  
  24. if user_teamid == 0 then
  25. showMessage("Change user_teamid first")
  26. elseif playerid == 0 then
  27. showMessage("Change playerid first")
  28. end
  29.  
  30. local comp_desc = get_components_description_manager_edit()
  31.  
  32. local fields_to_edit = {
  33. "BodyTypeEdit",
  34. "EyebrowcodeEdit",
  35. "EyecolorcodeEdit",
  36. "FaceposerpresetEdit",
  37. "FacialhaircolorcodeEdit",
  38. "FacialhairtypecodeEdit",
  39. "GenderEdit",
  40. "HaircolorcodeEdit",
  41. "HairstylecodeEdit",
  42. "HairtypecodeEdit",
  43. "HashighqualityheadEdit",
  44. "HeadassetidEdit",
  45. "HeadclasscodeEdit",
  46. "HeadtypecodeEdit",
  47. "HeadvariationEdit",
  48. "HeightEdit",
  49. "NationalityEdit",
  50. "SideburnscodeEdit",
  51. "SkintonecodeEdit",
  52. "SkintypecodeEdit",
  53. "WeightEdit"
  54. }
  55.  
  56. local columns = {
  57. firstnameid = 1,
  58. lastnameid = 2,
  59. playerjerseynameid = 3,
  60. commonnameid = 4,
  61. skintypecode = 5,
  62. trait2 = 6,
  63. bodytypecode = 7,
  64. haircolorcode = 8,
  65. facialhairtypecode = 9,
  66. curve = 10,
  67. jerseystylecode = 11,
  68. agility = 12,
  69. tattooback = 13,
  70. accessorycode4 = 14,
  71. gksavetype = 15,
  72. positioning = 16,
  73. tattooleftarm = 17,
  74. hairtypecode = 18,
  75. standingtackle = 19,
  76. preferredposition3 = 20,
  77. longpassing = 21,
  78. penalties = 22,
  79. animfreekickstartposcode = 23,
  80. animpenaltieskickstylecode = 24,
  81. isretiring = 25,
  82. longshots = 26,
  83. gkdiving = 27,
  84. interceptions = 28,
  85. shoecolorcode2 = 29,
  86. crossing = 30,
  87. potential = 31,
  88. gkreflexes = 32,
  89. finishingcode1 = 33,
  90. reactions = 34,
  91. composure = 35,
  92. vision = 36,
  93. contractvaliduntil = 37,
  94. animpenaltiesapproachcode = 38,
  95. finishing = 39,
  96. dribbling = 40,
  97. slidingtackle = 41,
  98. accessorycode3 = 42,
  99. accessorycolourcode1 = 43,
  100. headtypecode = 44,
  101. sprintspeed = 45,
  102. height = 46,
  103. hasseasonaljersey = 47,
  104. tattoohead = 48,
  105. preferredposition2 = 49,
  106. strength = 50,
  107. shoetypecode = 51,
  108. birthdate = 52,
  109. preferredposition1 = 53,
  110. tattooleftleg = 54,
  111. ballcontrol = 55,
  112. shotpower = 56,
  113. trait1 = 57,
  114. socklengthcode = 58,
  115. weight = 59,
  116. hashighqualityhead = 60,
  117. gkglovetypecode = 61,
  118. tattoorightarm = 62,
  119. balance = 63,
  120. gender = 64,
  121. headassetid = 65,
  122. gkkicking = 66,
  123. internationalrep = 67,
  124. animpenaltiesmotionstylecode = 68,
  125. shortpassing = 69,
  126. freekickaccuracy = 70,
  127. skillmoves = 71,
  128. faceposerpreset = 72,
  129. usercaneditname = 73,
  130. avatarpomid = 74,
  131. attackingworkrate = 75,
  132. finishingcode2 = 76,
  133. aggression = 77,
  134. acceleration = 78,
  135. headingaccuracy = 79,
  136. iscustomized = 80,
  137. eyebrowcode = 81,
  138. runningcode2 = 82,
  139. modifier = 83,
  140. gkhandling = 84,
  141. eyecolorcode = 85,
  142. jerseysleevelengthcode = 86,
  143. accessorycolourcode3 = 87,
  144. accessorycode1 = 88,
  145. playerjointeamdate = 89,
  146. headclasscode = 90,
  147. defensiveworkrate = 91,
  148. tattoofront = 92,
  149. nationality = 93,
  150. preferredfoot = 94,
  151. sideburnscode = 95,
  152. weakfootabilitytypecode = 96,
  153. jumping = 97,
  154. personality = 98,
  155. gkkickstyle = 99,
  156. stamina = 100,
  157. playerid = 101,
  158. marking = 102,
  159. accessorycolourcode4 = 103,
  160. gkpositioning = 104,
  161. headvariation = 105,
  162. skillmoveslikelihood = 106,
  163. skintonecode = 107,
  164. shortstyle = 108,
  165. overallrating = 109,
  166. smallsidedshoetypecode = 110,
  167. emotion = 111,
  168. runstylecode = 112,
  169. jerseyfit = 113,
  170. accessorycode2 = 114,
  171. shoedesigncode = 115,
  172. shoecolorcode1 = 116,
  173. hairstylecode = 117,
  174. animpenaltiesstartposcode = 118,
  175. runningcode1 = 119,
  176. preferredposition4 = 120,
  177. volleys = 121,
  178. accessorycolourcode2 = 122,
  179. tattoorightleg = 123,
  180. facialhaircolorcode = 124
  181. }
  182.  
  183. -- manager table
  184. local sizeOf = 0x10C -- Size of one record in manager database table (0x10C)
  185.  
  186. -- iterate over all managers in 'manager' database table
  187. local i = 0
  188. local current_teamid = 0
  189.  
  190. local teamid_record = ADDR_LIST.getMemoryRecordByID(comp_desc['TeamidEdit']['id'])
  191.  
  192. if teamid_record.Value == '??' then
  193. showMessage("Error\nActivate FIFA Database Tables script and reload your career save")
  194. return
  195. end
  196.  
  197. local success = false
  198.  
  199. function change_vals()
  200. local fut_players_file_path = "other/fut/base_fut_players.csv"
  201. for line in io.lines(fut_players_file_path) do
  202. local values = split(line, ',')
  203. if playerid == tonumber(values[columns['playerid']]) then
  204. -- Fix women headassetid
  205. if values[columns['headassetid']] == '0' then
  206. values[columns['headassetid']] = values[columns['playerid']]
  207. end
  208.  
  209. for j=1, #fields_to_edit do
  210. local rec = ADDR_LIST.getMemoryRecordByID(comp_desc[fields_to_edit[j]]['id'])
  211. if rec.Value == '??' then
  212. showMessage("Error\nActivate FIFA Database Tables script and reload your career save")
  213. return
  214. end
  215. rec.Value = math.floor(values[columns[comp_desc[fields_to_edit[j]]['db_col']]] - comp_desc[fields_to_edit[j]]['modifier'])
  216. end
  217. ADDR_LIST.getMemoryRecordByID(comp_desc['EthnicityEdit']['id']).Value = math.floor(values[columns['skintonecode']] - comp_desc['EthnicityEdit']['modifier'])
  218.  
  219. -- +1 in game
  220. ADDR_LIST.getMemoryRecordByID(comp_desc['ManageridEdit']['id']).Value = 99998
  221. return true
  222. end
  223. end
  224. return false
  225. end
  226.  
  227. local reason = "Invalid Teamid"
  228. while true do
  229. if i >= 1800 then
  230. break
  231. end
  232.  
  233. 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))
  234.  
  235. if (current_teamid + 1) == user_teamid then
  236. writeQword('ptrManager', readPointer('firstptrManager') + i*sizeOf)
  237. if change_vals() then
  238. success = true
  239. else
  240. reason = 'Invalid Playerid'
  241. end
  242. end
  243.  
  244. i = i + 1
  245.  
  246. end
  247.  
  248. if success then
  249. showMessage("Done")
  250. else
  251. showMessage("Something went wrong... :(\n" .. reason)
  252. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement