Nihlathek Portal Fix#2

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
devurandom
Forum Regular
Angel
Posts: 532
Joined: Sat Mar 07, 2015 9:07 pm
United States of America

Nihlathek Portal Fix#2

Post by devurandom » Mon Jun 19, 2017 7:29 am

Nilathek Portal fix that works... no multiple portals, you don't have to talk to Anya
It works flawless (as it should) before/after quest is finished.

Code: Select all

[1.13d]

//JMP PATCH @ 0x1FF27

	JZ SHORT GOODEXIT
	MOV EAX,DWORD PTR[ESP+0x14]		// pPlayer @ esp+0x14
	PUSH EAX
	CALL NilPortalFix				// Quests_CheckFlag is quest complete ?
	TEST EAX,EAX
	JNZ SHORT GOODEXIT
	JMP D2GP_NilPortRetJmp2			// 0x1FFEC Quest not started skip portal flag

GOODEXIT:
	JMP D2GP_NilPortRetJmp1 		// 0x1FF2D


Unfortunately I can't post Code for NilPortalFix "Call" because I'm not allowed.

Forbidden

You don't have permission to access /forum/posting.php on this server.

Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.

User avatar
thaison
Dark Alliance Beta Test
Crusader
Posts: 53
Joined: Fri Apr 03, 2015 11:59 am
Location: Viet Nam
Vietnam

Re: Nihlathek Portal Fix#2

Post by thaison » Sat Oct 14, 2017 6:12 am

[1.13c]

Code: Select all

PATCH_JMP - 0x5AE67

__asm
{
	je Code1
	mov eax, [ESP+0x14]
	push eax
	call D2COMMON_QUESTS_CheckFlag     //#10174
	test eax, eax
	jnz Code1
	jmp Nihlathek_Portal_Fix_II     //0x5AF2C
Code1:
	jmp Nihlathek_Portal_Fix_I     //0x5AE6D
}


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

Re: Nihlathek Portal Fix#2

Post by devurandom » Sat Oct 14, 2017 11:01 am

thaison" wrote:[1.13c]

Code: Select all

PATCH_JMP - 0x5AE67
__asm
{
	je Code1
	mov eax, [ESP+0x14]
	push eax
	call D2COMMON_QUESTS_CheckFlag     //#10174
	test eax, eax
	jnz Code1
	jmp Nihlathek_Portal_Fix_II     //0x5AF2C
Code1:
	jmp Nihlathek_Portal_Fix_I     //0x5AE6D
}

Your code will crash... or fail. Quests_CheckFlags takes 3 arguments.

NilPortalFix expands pPlayer to get -> QuestFlag* pQuest.
From that it checks Quests_CheckFlags, if the Nihlathak quest reward is pending or quest completed ... function returns true or false.

User avatar
thaison
Dark Alliance Beta Test
Crusader
Posts: 53
Joined: Fri Apr 03, 2015 11:59 am
Location: Viet Nam
Vietnam

Re: Nihlathek Portal Fix#2

Post by thaison » Sat Oct 14, 2017 12:08 pm

devurandom" wrote:
thaison" wrote:[1.13c]

Code: Select all

PATCH_JMP - 0x5AE67
__asm
{
	je Code1
	mov eax, [ESP+0x14]
	push eax
	call D2COMMON_QUESTS_CheckFlag     //#10174
	test eax, eax
	jnz Code1
	jmp Nihlathek_Portal_Fix_II     //0x5AF2C
Code1:
	jmp Nihlathek_Portal_Fix_I     //0x5AE6D
}

Your code will crash... or fail. Quests_CheckFlags takes 3 arguments.

NilPortalFix expands pPlayer to get -> QuestFlag* pQuest.
From that it checks Quests_CheckFlags, if the Nihlathak quest reward is pending or quest completed ... function returns true or false.
I did on my mod, it works very well.

Image

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

Re: Nihlathek Portal Fix#2

Post by devurandom » Sat Oct 14, 2017 8:19 pm

My code does not open the Nihlathak portal before the quest is started.
The portal remains open after Nihlathak quest is completed, or reward is pending.
Both conditions will close the portal in vanilla d2, if I recall correctly.

I haven't checked your code, but if it does all that correctly, then it's better than what I posted.

Post Reply

Return to “Code Editing”