[1.13c] Force an item to appear in the gamble window every time
Moderators: Nefarius, Havvoric
[1.13c] Force an item to appear in the gamble window every time
Hello!
I am a newbie when it comes to code editing and I've been wondering how to force an item to appear in the gamble window.
For example, I want at least 1 jewel to appear every time in the gamble window. How can I force that (just like amulets and rings are forced to appear).
Thanks in advance!
EDIT: I've enabled jewels in gamble.txt already but I realize the chance for it to appear is very slim
I am a newbie when it comes to code editing and I've been wondering how to force an item to appear in the gamble window.
For example, I want at least 1 jewel to appear every time in the gamble window. How can I force that (just like amulets and rings are forced to appear).
Thanks in advance!
EDIT: I've enabled jewels in gamble.txt already but I realize the chance for it to appear is very slim
- devurandom
- Angel
- Posts: 897
- Joined: Sat Mar 07, 2015 9:07 pm
Re: [1.13c] Force an item to appear in the gamble window every time
The way Rings/Amulets are forced in Gamble screen is done in the loop that generates gamble items.
2 globals store the (EDIT CORRECTION) item Record for rin and amu. you'd have to do it like its done there & also check the loop count, cause those are the first items that get created.
You can find that code loop by looking at the code edit for increasing the number of items on gamble screen.
a simpler way is just to add the item to gamble.txt, but it won't guarantee that the item will get spawn every time on gamble screen.
2 globals store the (EDIT CORRECTION) item Record for rin and amu. you'd have to do it like its done there & also check the loop count, cause those are the first items that get created.
You can find that code loop by looking at the code edit for increasing the number of items on gamble screen.
a simpler way is just to add the item to gamble.txt, but it won't guarantee that the item will get spawn every time on gamble screen.
Last edited by devurandom on Fri Jul 26, 2019 9:20 am, edited 1 time in total.
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..
Fiat paper money is the most elaborate and well devised form of slavery the world has ever seen..
Re: [1.13c] Force an item to appear in the gamble window every time
"code edit for increasing the number of items on the gamble screen" ? Is that to be found in the Knowledge Base ? I searched in the Code Editing forum and in the knowledge base but I cant seem to find anything like that.
- devurandom
- Angel
- Posts: 897
- Joined: Sat Mar 07, 2015 9:07 pm
Re: [1.13c] Force an item to appear in the gamble window every time
Look for Whist code edit collection I think its in there.
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..
Fiat paper money is the most elaborate and well devised form of slavery the world has ever seen..
Re: [1.13c] Force an item to appear in the gamble window every time
I found his thread with the link to the code edits but it appears his website is no longer being actively hosted (Chrome gives me a "Can't find Server IP Adress" error). Can anybody here provide a link to the code edits?devurandom wrote: ↑Wed Jul 24, 2019 7:37 amLook for Whist code edit collection I think its in there.
- devurandom
- Angel
- Posts: 897
- Joined: Sat Mar 07, 2015 9:07 pm
Re: [1.13c] Force an item to appear in the gamble window every time
it is linked in that thread, you'll have to look further down.
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..
Fiat paper money is the most elaborate and well devised form of slavery the world has ever seen..
Re: [1.13c] Force an item to appear in the gamble window every time
Thanks, I found it.
Is this the supposed code I should look for? It is in a file called Gamble.asm and it doesn't look like an Assembler loop to me. It changes the amount of items in the gamble window but thats it.
Code: Select all
D2Game.dll - BE611
027BE611 837C24 14 0E CMP DWORD PTR SS:[ESP+14],0E
- devurandom
- Angel
- Posts: 897
- Joined: Sat Mar 07, 2015 9:07 pm
Re: [1.13c] Force an item to appear in the gamble window every time
devurandom wrote: ↑Tue Jul 23, 2019 9:18 pmYou can find that code loop by looking at the code edit for increasing the number of items on gamble screen.
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..
Fiat paper money is the most elaborate and well devised form of slavery the world has ever seen..
Re: [1.13c] Force an item to appear in the gamble window every time
Code: Select all
JL 000BE382
This is where that offset brings me. Should any of this (when transformed to decimal) direct me towards an item code or something? I can only understand that a lot of values are being moved around between registers.
- devurandom
- Angel
- Posts: 897
- Joined: Sat Mar 07, 2015 9:07 pm
Re: [1.13c] Force an item to appear in the gamble window every time
This is the part of the code that you'd be interested in:
Code: Select all
000BE44C ║► │8B4424 14 ║MOV EAX,DWORD PTR SS:[LOCAL.5] LoopCount
000BE450 ║· │83F8 02 ║CMP EAX,2
000BE453 ║·▼│7D 10 ║JGE SHORT 6FCDE465
000BE455 ║· │85C0 ║TEST EAX,EAX
000BE457 ║· │8B35 801FD36F ║MOV ESI,DWORD PTR DS:[6FD31F80] nRecord gnGambleRin
000BE45D ║·▼│74 06 ║JZ SHORT 6FCDE465
000BE45F ║· │8B35 7C1FD36F ║MOV ESI,DWORD PTR DS:[6FD31F7C] nRecord gnGambleAmu
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..
Fiat paper money is the most elaborate and well devised form of slavery the world has ever seen..
-
- Posts: 58
- Joined: Fri Mar 09, 2018 10:43 pm
Re: [1.13c] Force an item to appear in the gamble window every time
How could one figure out what the value would be for any other item than Rings and Amulets ? I believe the information isnt inside D2Game.dlldevurandom wrote: ↑Fri Jul 26, 2019 2:36 amThis is the part of the code that you'd be interested in:
Code: Select all
000BE44C ║► │8B4424 14 ║MOV EAX,DWORD PTR SS:[LOCAL.5] LoopCount
000BE450 ║· │83F8 02 ║CMP EAX,2
000BE453 ║·▼│7D 10 ║JGE SHORT 6FCDE465
000BE455 ║· │85C0 ║TEST EAX,EAX
000BE457 ║· │8B35 801FD36F ║MOV ESI,DWORD PTR DS:[6FD31F80] nRecord gnGambleRin
000BE45D ║·▼│74 06 ║JZ SHORT 6FCDE465
000BE45F ║· │8B35 7C1FD36F ║MOV ESI,DWORD PTR DS:[6FD31F7C] nRecord gnGambleAmu
- devurandom
- Angel
- Posts: 897
- Joined: Sat Mar 07, 2015 9:07 pm
Re: [1.13c] Force an item to appear in the gamble window every time
further up its done in D2Game.dll like so:
Code: Select all
000BE2FF ║► │A1 7C1FD36F MOV EAX,DWORD PTR DS:[6FD31F7C] gGambleAmu
000BE304 ║· │85C0 TEST EAX,EAX
000BE306 ║·▼│75 0F JNZ SHORT 6FCDE317
000BE308 ║· │68 7C1FD36F PUSH OFFSET 6FD31F7C ; ╓Arg2 = D2Game.6FD31F7C
000BE30D ║· │68 616D7520 PUSH 20756D61 ; ║Arg1 = 20756D61 Amu
000BE312 ║· │E8 2BC7F4FF CALL <JMP.&D2Common.#10450> ; └D2Common.#10450
GetItemRecordFromCode
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..
Fiat paper money is the most elaborate and well devised form of slavery the world has ever seen..
-
- Posts: 58
- Joined: Fri Mar 09, 2018 10:43 pm
Re: [1.13c] Force an item to appear in the gamble window every time
Thanks a lot! That was very helpfuldevurandom wrote: ↑Fri Aug 23, 2019 4:01 amfurther up its done in D2Game.dll like so:
Code: Select all
000BE2FF ║► │A1 7C1FD36F MOV EAX,DWORD PTR DS:[6FD31F7C] gGambleAmu 000BE304 ║· │85C0 TEST EAX,EAX 000BE306 ║·▼│75 0F JNZ SHORT 6FCDE317 000BE308 ║· │68 7C1FD36F PUSH OFFSET 6FD31F7C ; ╓Arg2 = D2Game.6FD31F7C 000BE30D ║· │68 616D7520 PUSH 20756D61 ; ║Arg1 = 20756D61 Amu 000BE312 ║· │E8 2BC7F4FF CALL <JMP.&D2Common.#10450> ; └D2Common.#10450 GetItemRecordFromCode
- devurandom
- Angel
- Posts: 897
- Joined: Sat Mar 07, 2015 9:07 pm
Re: [1.13c] Force an item to appear in the gamble window every time
Cheers
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..
Fiat paper money is the most elaborate and well devised form of slavery the world has ever seen..
-
- Posts: 58
- Joined: Fri Mar 09, 2018 10:43 pm
Re: [1.13c] Force an item to appear in the gamble window every time
Where could find an empty space to jump to to add some custom code inside D2Game ?
I've tried two location that caused an instant crash up entering gamble screen.
Unless the issue is because I cant add a JMP at BE2FF with a JMP to come back to the default code
I've tried two location that caused an instant crash up entering gamble screen.
Unless the issue is because I cant add a JMP at BE2FF with a JMP to come back to the default code
- devurandom
- Angel
- Posts: 897
- Joined: Sat Mar 07, 2015 9:07 pm
Re: [1.13c] Force an item to appear in the gamble window every time
You can take a call and turn it into a long jump, then execute the missing call at the location of the long jump in the first command, with the args still on the stack. Next add your new code and jump back where you need to go.
Jumps and calls are the safest way to inject new code cause they're already in the dll's .reloc section.
Jumps and calls are the safest way to inject new code cause they're already in the dll's .reloc section.
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..
Fiat paper money is the most elaborate and well devised form of slavery the world has ever seen..