Page 1 of 1

[1.13c] Infinite arrows / bolts / throwing weapons / tomes / keys

Posted: Sat Aug 04, 2018 5:49 am
by mrnorris
The following code edit makes arrows, bolts and throwing weapons not decrease in quantity when used.

Code: Select all

D2Game.A16BE

6FCC16BE  |. 4D             DEC EBP                      ;NOP this line
6FCC16BF  |. 79 0A          JNS SHORT D2Game.6FCC16CB
6FCC16C1  |. C74424 04 0100>MOV DWORD PTR SS:[ESP+4],1
6FCC16C9  |. 33ED           XOR EBP,EBP
6FCC16CB  |> 53             PUSH EBX
6FCC16CC  |. 57             PUSH EDI
6FCC16CD  |. 6A 00          PUSH 0
6FCC16CF  |. 55             PUSH EBP
6FCC16D0  |. 6A 46          PUSH 46
6FCC16D2  |. 56             PUSH ESI
6FCC16D3  |. E8 9A8DF6FF    CALL <JMP.&D2Common.#10887>

change to

6FCC16BE     90             NOP
6FCC16BF  |. 79 0A          JNS SHORT D2Game.6FCC16CB
6FCC16C1  |. C74424 04 0100>MOV DWORD PTR SS:[ESP+4],1
6FCC16C9  |. 33ED           XOR EBP,EBP
6FCC16CB  |> 53             PUSH EBX
6FCC16CC  |. 57             PUSH EDI
6FCC16CD  |. 6A 00          PUSH 0
6FCC16CF  |. 55             PUSH EBP
6FCC16D0  |. 6A 46          PUSH 46
6FCC16D2  |. 56             PUSH ESI
6FCC16D3  |. E8 9A8DF6FF    CALL <JMP.&D2Common.#10887>
There's also a small chance when melee attacking with a throwing weapon that its quantity is reduced. If you want to stop that, also apply this:

Code: Select all

D2Game.13033

6FC33028  |. 83FD 01        CMP EBP,1
6FC3302B  |. 6A 00          PUSH 0
6FC3302D  |. 0F8E 81000000  JLE D2Game.6FC330B4
6FC33033  |. 4D             DEC EBP                       ; NOP this line
6FC33034  |. 55             PUSH EBP
6FC33035  |. 6A 46          PUSH 46
6FC33037  |. 56             PUSH ESI
6FC33038  |. E8 3574FFFF    CALL <JMP.&D2Common.#10887>

change to:

6FC3302B  |. 6A 00          PUSH 0
6FC3302D  |. 0F8E 81000000  JLE D2Game.6FC330B4
6FC33033     90             NOP
6FC33034  |. 55             PUSH EBP
6FC33035  |. 6A 46          PUSH 46
6FC33037  |. 56             PUSH ESI
6FC33038  |. E8 3574FFFF    CALL <JMP.&D2Common.#10887>
The following code edit makes tomes and keys not decrease in quantity when used.

Code: Select all

D2Game.DA280 (tome of identify)

6FCFA280  |. 6A FF          PUSH -1     ; change to PUSH 0

D2Game.D9D22 (tome of town portal)

6FCF9D22  |. 6A FF          PUSH -1     ; change to PUSH 0

D2Game.D41D4 (keys)

6FCF41D4  |. 6A FF          PUSH -1     ; change to PUSH 0
If you made all those quantities infinite you may want to remove the quantity display of items in the description:

Code: Select all

D2Client.8D8DD

6FB3D8DD  |. 8BCE           MOV ECX,ESI
6FB3D8DF  |. FF15 B8EAB76F  CALL DWORD PTR DS:[<&D2Lang.?strcpy@Unic>

change to:

6FB3D8DD  |. EB 06          JMP SHORT D2Client.6FB3D8E5
6FB3D8DF  |  90             NOP
6FB3D8E0  |  90             DB 90
6FB3D8E1  |. 90909090       DD 90909090

Code: Select all

D2Client.8D91E

6FB3D91E  |. FFD7           CALL EDI                          ; NOP this
6FB3D920  |. 8D5424 18      LEA EDX,DWORD PTR SS:[ESP+18]
6FB3D924  |. 8BCE           MOV ECX,ESI
6FB3D926  |. FFD7           CALL EDI                          ; NOP this
6FB3D928  |. 8BD3           MOV EDX,EBX
6FB3D92A  |. 8BCE           MOV ECX,ESI
6FB3D92C  |. FFD7           CALL EDI                          ; NOP this

Code: Select all

D2Client.9270D

6FB4270D  |. FFD3           CALL EBX                      ; NOP this
6FB4270F  |. 8BD7           MOV EDX,EDI
6FB42711  |. 8BCE           MOV ECX,ESI
6FB42713  |. FFD3           CALL EBX                      ; NOP this
6FB42715  |. B9 9E080000    MOV ECX,89E
6FB4271A  |. E8 CDAAF7FF    CALL <JMP.&D2Lang.#10003>
6FB4271F  |. 8BD0           MOV EDX,EAX
6FB42721  |. 8BCE           MOV ECX,ESI
6FB42723  |. FFD3           CALL EBX                      ; NOP this
6FB42725  |. 8BD7           MOV EDX,EDI
6FB42727  |. 8BCE           MOV ECX,ESI
6FB42729  |. FFD3           CALL EBX                      ; NOP this
To remove the quantity display in the right/left click throwing skill icon:

Code: Select all

D2Client.3E745

6FAEE745  |. 6A 00          PUSH 0
6FAEE747  |. 6A 46          PUSH 46
6FAEE749  |. 56             PUSH ESI
6FAEE74A  |. E8 77DAFCFF    CALL <JMP.&D2Common.#10973>

change to:

6FAEE745  |. 31C0           XOR EAX,EAX
6FAEE747  |. 90             NOP
6FAEE748  |. 90             NOP
6FAEE749  |. 90             NOP
6FAEE74A  |. 90             NOP
6FAEE74B  |. 90             NOP
6FAEE74C  |. 90             NOP
6FAEE74D  |. 90             NOP
6FAEE74E  |. 90             NOP

Re: [1.13c] Infinite arrows / bolts / throwing weapons

Posted: Sat Aug 04, 2018 6:34 am
by jessedazebra
Wow! That's a really good find. I've always wanted to make infinite arrows/bolts, thanks.

Re: [1.13c] Infinite arrows / bolts / throwing weapons

Posted: Sat Aug 04, 2018 7:50 am
by mrnorris
Hey, no problem. Btw, I just edited the main post including a code edit to remove the quantity display. Hope nothing got messed up but it seems to work well.

Re: [1.13c] Infinite arrows / bolts / throwing weapons

Posted: Sat Aug 04, 2018 8:53 am
by jessedazebra
I was just thinking about removing the quantity string through itemstatcost.txt and then I realized it's hardcoded :D
So, thanks again for the code, seems like it works just fine!
Image

Re: [1.13c] Infinite arrows / bolts / throwing weapons / tomes / keys

Posted: Thu Sep 20, 2018 5:40 am
by csguak
Hello, thank you for sharing this beautiful find. :D

However, I ran into one small problem.
When I assign the town portal skill, the skill counter keep decreasing when I use, even though the scroll number of the book in the inventory remains constant.
I am not sure what is going on??

Re: [1.13c] Infinite arrows / bolts / throwing weapons / tomes / keys

Posted: Fri Oct 05, 2018 5:35 am
by mrnorris
Hi csguak and sorry about the delay.

I just tested the right-click skill icon display and it's indeed decreasing. I forgot to consider this.

I'll try to find a workaround if I have some time.

Re: [1.13c] Infinite arrows / bolts / throwing weapons / tomes / keys

Posted: Sat Feb 23, 2019 11:19 pm
by hellfreezer
Hey guys, I know this is pretty old but I am hoping someone can help me. All of the code edits worked for me except for the keys and for the quantity to not go down when using a throwing weapon as melee, is something missing?

Re: [1.13c] Infinite arrows / bolts / throwing weapons / tomes / keys

Posted: Sun Aug 09, 2020 12:39 am
by kain_abel_666
Has anyone located these in 1.10f?

Re: [1.13c] Infinite arrows / bolts / throwing weapons / tomes / keys

Posted: Wed Dec 22, 2021 9:06 am
by karlock
For 1.10 infinite arrows

Code: Select all

0x6FD11340 d2game.dll
unknown.png
unknown.png (11.5 KiB) Viewed 1278 times
NOP "4F"