[1.10 & 1.13c & 1.13d] Custom red portal to any location [same act] created by missile - fix

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
User avatar
Nizari
Senior Moderator
Paladin
Posts: 107
Joined: Fri Feb 16, 2018 11:39 pm
Poland

[1.10 & 1.13c & 1.13d] Custom red portal to any location [same act] created by missile - fix

Post by Nizari » Tue Oct 27, 2020 12:06 pm

A few days, I got asked on our discord about red portals. I have replied they can be used by cairnstones missile function (won't describe it in here, as this is just the fix).
Right, you can use this method to create red portal with skill, missile and thus as ctc on death effect and such. The possibilites are vast. There is only one, well, actually 2 problems about it. First is the portal naming which will always cause the portal created in 'departure' spot to be called of ' no level name' (unless you change the string of it to Mysterious portal of whatever). Naming in destination location will always be prooper.
The second problem is the fact that such portal would give you a crash when used in placfes other than act 1, arcane sanctuary, canyon of the magi, barricade1, barricade2, barricadesnow and Nihlathak's temple entrance.
Just to be precise - the mentioned crash would occur only when entering the unnamed portal: creation place ---> destination. You can use it without worries destination ---> creation place.

Anyway, enough of explaining what the problem is. Thanks to Firehawk (credits about this one goes to him), here is the fix to all of mentioned problems:

1.10:

Code: Select all

6FD13D9A   8B4E 14          MOV ECX,DWORD PTR DS:[ESI+14]
6FD13D9D   56               PUSH ESI
6FD13D9E   8841 04          MOV BYTE PTR DS:[ECX+4],AL
6FD13DA1   E8 727A0000      CALL <JMP.&D2Common.#10427>
TO:

Code: Select all

6FD13D9A   E9 B12C0100      JMP D2Game.6FD26A50
6FD13D9F   90               NOP
6FD13DA0   90               NOP
6FD13DA1   E8 727A0000      CALL <JMP.&D2Common.#10427>
ADD (this is in empty space):

Code: Select all

6FD26A50   8B4E 14          MOV ECX,DWORD PTR DS:[ESI+14]
6FD26A53   8841 04          MOV BYTE PTR DS:[ECX+4],AL
6FD26A56   8B4424 30        MOV EAX,DWORD PTR SS:[ESP+30]
6FD26A5A   8B4D 14          MOV ECX,DWORD PTR SS:[EBP+14]
6FD26A5D   8841 04          MOV BYTE PTR DS:[ECX+4],AL
6FD26A60   56               PUSH ESI
6FD26A61  ^E9 3BD3FEFF      JMP D2Game.6FD13DA1
_______________________________________________________________________________________________

1.13c:

Code: Select all

6FCC246C  |> 8B4E 14        MOV ECX,DWORD PTR DS:[ESI+14]
6FCC246F  |. 56             PUSH ESI
6FCC2470  |. 8841 04        MOV BYTE PTR DS:[ECX+4],AL
6FCC2473  |. E8 688AF6FF    CALL <JMP.&D2Common.#10258>
TO

Code: Select all

6FCC246C     E9 44550500    JMP D2Game.6FD179B5
6FCC2471     90             NOP
6FCC2472     90             NOP
6FCC2473  |. E8 688AF6FF    CALL <JMP.&D2Common.#10258>
ADD (this is in empty space):

Code: Select all

6FD179B5     8B4E 14        MOV ECX,DWORD PTR DS:[ESI+14]
6FD179B8     8841 04        MOV BYTE PTR DS:[ECX+4],AL
6FD179BB     8B4424 30      MOV EAX,DWORD PTR SS:[ESP+30]
6FD179BF     8B4D 14        MOV ECX,DWORD PTR SS:[EBP+14]
6FD179C2     8841 04        MOV BYTE PTR DS:[ECX+4],AL
6FD179C5     56             PUSH ESI
6FD179C6    ^E9 A8AAFAFF    JMP D2Game.6FCC2473
_______________________________________________________________________________________________

1.13d:

Code: Select all

6FC360CE  |> 8B4E 14        MOV ECX,DWORD PTR DS:[ESI+14]
6FC360D1  |. 56             PUSH ESI
6FC360D2  |. 8841 04        MOV BYTE PTR DS:[ECX+4],AL
6FC360D5  |. E8 2445FFFF    CALL <JMP.&D2Common.#10040>
TO:

Code: Select all

6FC360CE     E9 321A0E00    JMP D2Game.6FD17B05
6FC360D3     90             NOP
6FC360D4     90             NOP
6FC360D5  |. E8 2445FFFF    CALL <JMP.&D2Common.#10040>
ADD (this is in empty space):

Code: Select all

6FD17B05     8B4E 14        MOV ECX,DWORD PTR DS:[ESI+14]
6FD17B08     8841 04        MOV BYTE PTR DS:[ECX+4],AL
6FD17B0B     8B4424 30      MOV EAX,DWORD PTR SS:[ESP+30]
6FD17B0F     8B4D 14        MOV ECX,DWORD PTR SS:[EBP+14]
6FD17B12     8841 04        MOV BYTE PTR DS:[ECX+4],AL
6FD17B15     56             PUSH ESI
6FD17B16    ^E9 BAE5F1FF    JMP D2Game.6FC360D5

User avatar
Conqueror
Posts: 52
Joined: Mon Oct 23, 2017 8:03 pm
Argentina

Re: [1.10 & 1.13c & 1.13d] Custom red portal to any location [same act] created by missile - fix

Post by Conqueror » Tue Oct 27, 2020 3:43 pm

Thanks for this info!

How can I limit the use of the skill/missile to cast it in a specific location and that it can't be casted anywhere else?

User avatar
Lurix
Dark Alliance Beta Test
Champion of the Light
Posts: 496
Joined: Tue Aug 31, 2010 9:30 am
Location: Birmingham, UK
Bulgaria

Re: [1.10 & 1.13c & 1.13d] Custom red portal to any location [same act] created by missile - fix

Post by Lurix » Tue Oct 27, 2020 5:34 pm

Conqueror wrote:
Tue Oct 27, 2020 3:43 pm
Thanks for this info!

How can I limit the use of the skill/missile to cast it in a specific location and that it can't be casted anywhere else?
Imo your best option is using the missile as death-skill on a specific monster, preferebly a superuniqe.
You can position the monster at your area of choice, that's exactly how I'm using this feature as well.

User avatar
Conqueror
Posts: 52
Joined: Mon Oct 23, 2017 8:03 pm
Argentina

Re: [1.10 & 1.13c & 1.13d] Custom red portal to any location [same act] created by missile - fix

Post by Conqueror » Wed Oct 28, 2020 12:58 am

That is very useful too. Thanks for the idea.

I was thinking about the option to use CltClc1 in Missiles instead of PAR4, to add functions like:

if act 1 -> X portal
if act 2 -> Y portal
if a particular sector -> secret portal

Example, you place an invisible monster with an invisible aura that gives you a stat, then when you position yourself in that area, the stat gives you access to a secret portal, for example in a Town (like Harrogath).

I was looking for a way to replace the ID Level reading from Par4 to CltClc1 (changing a DWORD PTR DS:[ESI+38] to DWORD PTR DS:[ESI+84])

viewtopic.php?f=8&t=61189

User avatar
Conqueror
Posts: 52
Joined: Mon Oct 23, 2017 8:03 pm
Argentina

Re: [1.10 & 1.13c & 1.13d] Custom red portal to any location [same act] created by missile - fix

Post by Conqueror » Wed Oct 28, 2020 7:19 pm

Lurix wrote:
Tue Oct 27, 2020 5:34 pm
Conqueror wrote:
Tue Oct 27, 2020 3:43 pm
Thanks for this info!

How can I limit the use of the skill/missile to cast it in a specific location and that it can't be casted anywhere else?
Imo your best option is using the missile as death-skill on a specific monster, preferebly a superuniqe.
You can position the monster at your area of choice, that's exactly how I'm using this feature as well.
I'm sorry to bother you. Can you check if the towns portals work for you? Because with these modifications, I realized that the blue portals don't work.

User avatar
Nizari
Senior Moderator
Paladin
Posts: 107
Joined: Fri Feb 16, 2018 11:39 pm
Poland

Re: [1.10 & 1.13c & 1.13d] Custom red portal to any location [same act] created by missile - fix

Post by Nizari » Thu Oct 29, 2020 12:02 am

As you already know, the error was caused by some plugins you use, this code edit does nothing wrong to normal town portals :)

User avatar
Conqueror
Posts: 52
Joined: Mon Oct 23, 2017 8:03 pm
Argentina

Re: [1.10 & 1.13c & 1.13d] Custom red portal to any location [same act] created by missile - fix

Post by Conqueror » Thu Oct 29, 2020 12:37 am

It is true. I forgot Dreamlands modified that function before :lol:

Post Reply

Return to “Code Editing”