Shop  •   Avatar  •   FAQ  •   Search  •   Memberlist  •   Usergroups  •   Profile  •   Log in to check private messages  •   Log in  •  Register 

More Gold For Merchants Info
Post new topic   Reply to topic     Forum Index -> Customization & Modding
View previous topic :: View next topic  
Author Message
corsair91
Sailing Master
Posts: 8167



211162 Gold -

PostPosted: Fri Oct 08, 2021 10:07 pm    Post subject: More Gold For Merchants Info Reply with quote

More Gold For Merchants

https://web.archive.org/web/20071222180448/http://www.addictedforums.com/index.php?showtopic=4150


Has anyone put together a mod to tweak the amount of wealth merchants in general have? I'd like them to carry at least 10x what they do now, otherwise I'm constantly dumping tons of junk overboard needlessly.

Alternatively, if someone could point me in the right direction I'll fix it myself...

Thanks in advance all,

pyure

-----------------

x87bliss
Sep 9 2007


This isn't exactly what you wanted, but it should suffice. Let me know if it's good enough, if not I may be able to give a better effort into actually doing a 10x multiplier.

The below method will reprogram the game so that when you sell stuff to a merchant, you will get paid for it, but he will not lose the money. Basically it's infinite money for merchants. Although infinite is still a lot more than the 10x you asked for, it's a lot easier and you're still limited to only selling what you have.

Note - Possible Bug! If you do the below, a merchant will not lose money when you sell stuff to him, but he will still gain money when you buy from him. If you keep selling to then buying back then reselling again, back and forth, the merchant will rack up mad cash which eventually can lead to a wrap around - it will either happen when he gets to $2 billion or $4 billion depending on how the game treats the value. If you have that much time on your hands that you make that happen, I hope it does cause it to crash to give your life some excitement (IMG:style_emoticons/smileys/).gif) hehe

Prereqs: Make sure you have verison 1.02 - if not patch - if not possible, let me know
Step 1: Download XVI32 (or use your favorite hex-editor - just ask google for xvi32)
Step 2: Open Pirates!.exe
Step 3: File->Save As... Pirates!.exe.bak (create a backup in case you mess up)
Step 4: Press Ctrl+G, select "hexadecimal" and "absolute" and type in "E18C1" in the address box.
Step 5: Make sure you're in the hex view by clicking the value that is highlighted in the middle of the screen, it should be "29"
Step 6: Read three bytes starting from there, and make sure it's "29 55 10" if it's not, make sure you're in the right place, or ask for more help.
Step 7: Look at the status bar at the bottom, it will either say "insert" or "overwrite" toggle with your overwrite key until you are in overwrite mode.
Step 8: Replace "29 55 10" with "90 90 90" by typing over it. Again, make sure the 29 is highlighted before you type over it.
Step 9: File->Save As... Pirates!.exe (do save as, since save will save over the backup we made earlier)

After that is done, run the game, and test it to be sure.

Compatibility notes:
This is meant for version 1.02 only, if you have a different version, update or let me know if that's not possible.
This should not interfere with any trainers you may use. It can prevent future patches (like there will be any) from patching the exe file. If so, revert to your backup.


-----------------

Guarda Costas
Sep 13 2007

Can you do this (second poster)? It kind of sucks, true enough, when the merchants don't top 2500 gold.

-----------------


x87bliss
Sep 14 2007,

Thanks for showing interest. For a while I was starting to think nobody liked my EXE hacks :-X

Well, good news. I assume you already have v1.02. And I found a function that does the math to determine how much gold a merchant will have!

Best part is that since the game does math to figure it out, we can EASILY modify the math to give us exactly what we want!

Use the above instructions (previous post) as guidlines as to make a backup of Pirates!.exe, and for going to addresses, etc...

1) Goto address "1109A" (note that's hex)
2) Read 7 bytes, they should be "8B C2 C1 E8 1F 03 C2"
3) Change "8B C2 C1 E8 1F 03 C2" to "8D 04 92 D1 E0 90 90"
(The above changes it to a 10x multiplier, you can leave the last 2 bytes "03 C2" as they were, instead of "90 90", for an 11x multiplier)

Technical Explanation:
This is the normal code of the function.

11093 - b8 56 55 55 55 - mov eax, 55555556 (stores a constant into EAX)
11098 - f7 e9 - imul ecx (eax * ecx, stores answer HIDWORD into EDX, LODWORD into EAX)
------ basically the above math gets the gold the merchant has into EDX.
1109A - 8b c2 - mov eax, edx (copies the gold from EDX into EAX)
1109C - c1 e8 1f - shr eax, 1f (shift all bits of EAX right 31 times - effectively makes EAX 0, unless it was negative, then it'd be 1, but negative numbers SHOULD NOT occur)
41109F - 03 C2 - add eax, edx (add edx to eax - given the above step, basically the same as mov eax, edx)

------ After we change the function by editing the EXE

11093 - Same as above, we didn't change this
11098 - Same as above, we didn't change this
1109A - 8D 04 92 - lea eax,[edx+edx*4]
------ Remember above it copied the gold from edx to eax, this instruction takes edx+edx*4 (or edx*5) and stores it into eax. So so far, we have a 5x multiplier
1109D - D1 E0 - shl eax, 1
------ This shifts all bits of EAX to the left onces - effectively multiplies it by 2. Note this 2x with the previous 5x multipliers results in a 10x multiplication.
1109F - 03 C2 - add eax, edx (optional)
------ This is where the option above came in (either orignal "03 C2" or "90 90"). This would just add edx to eax again, for an effective 11x multiplier. If you put "90 90" here, it would be two instructions of "nop" - short for "no opcode" i.e. do nothing.


-----------------

phalzyr
Sep 24 2007

My trainer has an option to make rich/well stocked merchants. They'll have 100,000 gold when you go into them... If you are not comfortable with exe hacking (IMG:style_emoticons/smileys/).gif)


-----------------


VM68
Nov 14 2007

I have version 1.02, but when I open up XVI32, it only goes up to four placements in the .exe file (0-9C30). So when I press CTRL+G to find the codes, I can't due to they are 5 in length and tells me it can't find the code.


I even did select Hex and absolute, but in the search box a $ sign pops up with the code (I try deleting it, but it comes back after I click out of the box). Not sure what else I can do to edit the money issue.
Back to top
View user's profile Send private message
fleetp
Boatswain
Posts: 3722



36055 Gold -

PostPosted: Fri Oct 08, 2021 10:37 pm    Post subject: Reply with quote

If somebody wants to increase merchant wealth, I recommend using phalzyr's trainer rather than modding the exe file.
Back to top
View user's profile Send private message Send e-mail
Pirate
Helmsman
Posts: 5589



109759 Gold -

PostPosted: Sat Oct 09, 2021 1:38 am    Post subject: Reply with quote

Something like my larger city mod would give most merchants more money as I used Havana for all the cities. One way to make awesome cities is to use the trainer to make a city rich and make the soldiers numerous populations etc. Save the game then take the city string out of the saved game then replace it over the original city in the exe. I had rich cities so numerous that I would still have over a hundred cutthroats wanting me to hire them in the tavern. Usually the richer a city the less people are looking for work but it takes a hell of a lot of population to get that many looking for work in a tavern. Go ahead fool around with it it’s a awesome experience.
Back to top
View user's profile Send private message
Guardacostas
Gunner
Posts: 966



10041 Gold -

PostPosted: Sun Oct 10, 2021 12:43 am    Post subject: Reply with quote

Gone are the days of sacking Panama for 120,000 gold. or are they...

Increased gold across the board but same amount of gold to keep a crew happy. That way you can divide the plunder like 3 times and have more gaming time to do the other stuff
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Customization & Modding All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group