[1.14d] Force High Affixes for Rare Items

This forum is for discussions on how to edit what can not be edited through the txt files, needless to say this isn't about battle net hacking.

Moderators: Nefarius, Havvoric

Post Reply
FearedBliss
Posts: 82
Joined: Sat Oct 16, 2010 4:29 pm
United States of America

[1.14d] Force High Affixes for Rare Items

Post by FearedBliss » Sun Mar 18, 2018 2:14 am

Thanks goes to devurandom and others for providing 1.13d offsets. This allowed me to track down the 1.14d equivalents. The 1.14d code is slightly different than the 1.13d equivalent. The change for the rare weapons/armors/amulets/rings is basically the same. However, Blizzard did some pretty massive refactoring for the jewel section of the code. They are now calling another function that does some other calculations. This new function has 37 references. However, it isn't necessary for us to use this function. The code basically calls the function to get the max # of affixes that it will attempt to generate. We can directly set the EAX register to 4. After this, the code will run a loop that while it is less than the EAX register (Which we forced it to 4), it will attempt to generate an affix for this item (I believe this is what the code does).

For 1.14d, you basically want to make sure that you are ultimately setting the [EBP-20] address to the number that you want. For jewels I set it to 4, and for other items I used 7 (Instead of 6 - the 1.13d fix from devurandom & co used this). I used 7 because after I observed the register after a many rare item generations in the normal game, I would see that the max number used was 7.

To force the rare affix function many times, I just changed my TreasureClass and made chests always drop rings/amulets/weapons/armors/jewels that are rare (rare column 1024). Thus, even with vanilla code, I was getting jewels that sometimes had higher affixes than 4. I don't want to spend too much time on this since it seems more than good enough with the following fixes:

Code: Select all


Offset: 1C1C8C

Force Weapons/Armors/Rings/Amulets to have high affixes:

005C1C8C | B9 C5 90 C6 6A           | MOV ECX,6AC690C5                                               |
005C1C91 | F7 E1                    | MUL ECX                                                        |

To:

005C1C8C | B9 06 00 00 00           | MOV EDX,7                                                      |
005C1C91 | EB 1B                    | JMP game.5C1CAE                                                |

Force Jewels to have high affixes:

Offset: 1C1C80

From:
005C1C80 | E8 FB 05 EB FF           | CALL <game.sub_472280>                                         |

To:

005C1C80 | B8 04 00 00 00           | MOV EAX,4                                                      |

FearedBliss
Posts: 82
Joined: Sat Oct 16, 2010 4:29 pm
United States of America

Re: [1.14d] Force High Affixes for Rare Items

Post by FearedBliss » Sun Mar 18, 2018 2:16 am

There was a slight bug in my original code where I wrote:

Code: Select all

005C1C8C | B9 06 00 00 00           | MOV ECX,6
It should be

Code: Select all

005C1C8C | B9 06 00 00 00           | MOV EDX,7  
EDX being the register that's used to set the [EBP-20] address which is the address that's actually used.
I used 7 instead of 6 since that's the highest number I saw the game use under normal circumstances after many rare item generation attempts.

User avatar
devurandom
Forum Regular
Angel
Posts: 897
Joined: Sat Mar 07, 2015 9:07 pm
United States of America

Re: [1.14d] Force High Affixes for Rare Items

Post by devurandom » Sun Mar 18, 2018 9:03 am

6 is the max value for affixes. I think you're reading the array lookup value.
The array has [0-7] lookup values, but the max value in the array is 6.
;)

Code: Select all

005C1CA1    83E0 07       AND EAX,00000007
005C1CA4    8957 04       MOV DWORD PTR DS:[EDI+4],EDX
005C1CA7    8B1485 14306E MOV EDX,DWORD PTR DS:[EAX*4+6E3014]
005C1CAE    8955 E0       MOV DWORD PTR SS:[LOCAL.8],EDX


006E3014  03 00 00 00|04 00 00 00|04 00 00 00|05 00 00 00|
006E3024  05 00 00 00|05 00 00 00|06 00 00 00|06 00 00 00|

Force 4 affix rares on jewels
Force 6 affix rares on weapons/armor rings/amulets

Code: Select all

[1.14d] - Game.0x1C1C79

Code Section


005C1C79    6A 02              PUSH 2
005C1C7B    8D53 03            LEA EDX,[EBX+3]
005C1C7E    8BCF               MOV ECX,EDI
005C1C80    E8 FB05EBFF        CALL 00472280
005C1C85    8945 E0            MOV DWORD PTR SS:[LOCAL.8],EAX  <---

Local.8 is where we need to force variable to 4 or 6 depending on item type.

005C1C88    EB 27              JMP SHORT 005C1CB1
005C1C8A    8B07               MOV EAX,DWORD PTR DS:[EDI]
005C1C8C    B9 C590C66A        MOV ECX,6AC690C5


Force 4 affix rares on jewels 

ChangeTo


005C1C79    BA 04000000  MOV EDX,4
005C1C7E    EB 2E        JMP SHORT 005C1CAE


Force 6 affix rares on weapons/armor rings/amulets


005C1C8A    BA 06000000  MOV EDX,6
005C1C8F    EB 1D        JMP SHORT 005C1CAE


Assembly Reference | 1.13d Code Edits | UVLoD | BaseMod Plugin

Fiat paper money is the most elaborate and well devised form of slavery the world has ever seen..

FearedBliss
Posts: 82
Joined: Sat Oct 16, 2010 4:29 pm
United States of America

Re: [1.14d] Force High Affixes for Rare Items

Post by FearedBliss » Sun Mar 18, 2018 11:29 pm

The number I'm speaking about is the value that is used in the loop cycle when generating each affix. So basically when you set the register to 4 for the jewels, that exact value is stored at lets say address [EBP-20], then address [EBP-20] is used as the top value for the loop cycle to generate affix. The "7" is also the value that is stored at the same exact address and used for the same loop.

User avatar
devurandom
Forum Regular
Angel
Posts: 897
Joined: Sat Mar 07, 2015 9:07 pm
United States of America

Re: [1.14d] Force High Affixes for Rare Items

Post by devurandom » Sun Mar 18, 2018 11:41 pm

Right.. 6 or 7 both work in your example. each case returns 6, but it is more confusing.
Assembly Reference | 1.13d Code Edits | UVLoD | BaseMod Plugin

Fiat paper money is the most elaborate and well devised form of slavery the world has ever seen..

FearedBliss
Posts: 82
Joined: Sat Oct 16, 2010 4:29 pm
United States of America

Re: [1.14d] Force High Affixes for Rare Items

Post by FearedBliss » Sun Mar 18, 2018 11:50 pm

Ah ok I see. I'll use 7 since that was the max one I observed in normal play after the EDX calculation code ran, but if it returns 6 as well, then it doesn't matter. I'll try to keep it to the max observable value though ;D.

Post Reply

Return to “Code Editing”