posted 02-21-19 12:19 PM EDT (US)   

In order to be able to change a unit to another one when gold medail is reached, I explored the way of the Dragon Growth'ability, instead of Morph's way that I have read the good and interesting jobs in others topics.
In AoWSM.exe (*), I found these lines (by GHex - Linux):

Line 0022D5E0 : ... B8 64 00 00 00 E8
Line 0022D5F0 : 14 37 DD FF 83 E8 19 72 0C 83 E8 19 72 27 83 E8
Line 0022D600 : 19 72 42 EB 60 A1 74 A4 6C 00 8B 00 8B 40 6C BA
Line 0022D610 : 26 00 00 00 E8 97 9A EB FF 8B D0 8B 45 F8 E8 5D
Line 0022D620 : D3 E8 FF EB 5E A1 74 A4 6C 00 8B 00 8B 40 6C BA
Line 0022D630 : 13 01 00 00 E8 77 9A EB FF 8B D0 8B 45 F8 E8 3D
Line 0022D640 : D3 E8 FF EB 3E A1 74 A4 6C 00 8B 00 8B 40 6C BA
Line 0022D650 : 15 01 00 00 E8 57 9A EB FF 8B D0 8B 45 F8 E8 1D
Line 0022D660 : D3 E8 FF EB 1E A1 74 A4 6C 00 8B 00 8B 40 6C BA
Line 0022D670 : DE 00 00 00 E8 37 9A EB FF 8B D0 8B 45 F8 E8 FD
Line 0022d680 : D2 E8 FF 55 ...

1. 26 00 00 00 ; 13 01 00 00 ; 15 01 00 00 and DE 00 00 00 are the ID of the red dragon, black dragon, gold dragon and ice dragon. By changing all these by 00 00 00 00, the young dragon transform himself to a halberdier when he reach the gold medail(tested).
2. The three 19h in the lines 0022D5F0 and 0022D600 means 25d in decimal. They correspond to the probabilities'borders of arrival for each of the four dragons (tested to).
3. If I understand well, for each of the four dragon's sequences there is two calls of sub-programmes with "97 9A EB FF" and "5D D3 E8 FF" addresses. They probably execute the change to the new form and determine the new position of the new unit. But I can't explore them because I don't know what I must subtract to them to determine the locations (and anyway, FFEB9A97 and FFE8D35D are out of range)

Advantage : The changes work.
Disadvantages :
-The new unit appear near the case of the ancient, not in the same. But that's minor.
-It can apply for a unique unit if we cancel the probability's effect (by changing the first 19h by 64h and only the first dragon's ID).
To go further, it will be interesting to create a long jump or sub-routine to the end of the .exe's file or in a sufficient empty space (**) in order to be able to apply this for other units. But some information are needed, as the variable(s) where the infos of the current unit are stored, including his ID.

Sorry if my english is maybe not very good. Otherwise, I hope I have understand correctly this piece of op-code.

(*) After patch 1.4 + UPatchV15. In the native AoWSM.exe, these lines are around 0022B140
(**) Because space is needed and if we stagger in the file, the program will surely crash by probably new false jumps.