[1.13c] Fixed Gamble cost

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
Tomkomaster
Posts: 76
Joined: Thu Feb 07, 2008 1:15 am
Slovakia

[1.13c] Fixed Gamble cost

Post by Tomkomaster » Sun Feb 10, 2019 5:00 pm

Hi

I've created some new items via misc.txt, and wanted to be able to gamble for them. However, the game creates very high gold costs for them. Wanted to try to set the Gamblecost column, but it doesn't work. Has anyone a fix for that? (the game uses the gamblecost column, like for rings and amulets, but for all items) I've searched the forum, but found only codes for older versions of the game.

User avatar
Tomkomaster
Posts: 76
Joined: Thu Feb 07, 2008 1:15 am
Slovakia

Re: [1.13c] Fixed Gamble cost

Post by Tomkomaster » Mon Feb 18, 2019 3:10 pm

Anyone?

User avatar
jessedazebra
Posts: 98
Joined: Sun Nov 11, 2012 9:46 am
Russia

Re: [1.13c] Fixed Gamble cost

Post by jessedazebra » Mon Feb 18, 2019 3:49 pm

Correct me if I'm wrong, but I think that rings and amulets are the only hardcoded items and gamblecost column doesn't do anything for other items. Maybe lowering overall item's cost will help?
Edit: I found this topic and there was the code posted by Myhrginoc. So here's the code for 1.13c:
All you need to do is to change JE to JMP in D2Common.

This:

Code: Select all

000248C4   0F84 76010000    JE 00024A40
to this:

Code: Select all

000248C4   E9 77010000    JMP 00024A40
I tested it and it works as it should. ;)
Image

User avatar
Tomkomaster
Posts: 76
Joined: Thu Feb 07, 2008 1:15 am
Slovakia

Re: [1.13c] Fixed Gamble cost

Post by Tomkomaster » Tue Feb 19, 2019 8:34 am

Yes, this is exactly what I wanted!!! Thank you jessedazebra :)

User avatar
karlock
Posts: 31
Joined: Mon Mar 16, 2015 1:16 pm

Re: [1.13c] Fixed Gamble cost

Post by karlock » Tue Feb 19, 2019 3:06 pm

jessedazebra wrote:
Mon Feb 18, 2019 3:49 pm

Code: Select all

000248C4   0F84 76010000    JE 00024A40
to this:

Code: Select all

000248C4   E9 77010000    JMP 00024A40
I tested it and it works as it should. ;)
Replace function in 1.13d, d2common.6FD93100

Code: Select all

int __stdcall D2COMMON_GetItemGamblePrice(UnitAny* pItem, int nPlayerLevel)
{
	//calculate the price
	return price;
}
See attachment, the full function.
Attachments
GetItemGamblePrice.7z
(898 Bytes) Downloaded 15 times

Post Reply

Return to “Code Editing”