• New Horizons on Maelstrom
    Maelstrom New Horizons


    Visit our website www.piratehorizons.com to quickly find download links for the newest versions of our New Horizons mods Beyond New Horizons and Maelstrom New Horizons!

Medium Priority Making Use of More Unique Trader Types

Pieter Boelen

Navigation Officer
Administrator
Storm Modder
Hearts of Oak Donator
If we want to have the Blade Care Kit sold by blacksmiths only, the following pieces of code are relevant.
PROGRAM\InternalSettings.h:
Code:
// Itemtrader type defines (STRING)
#define IT_TYPE_GENERAL         "General"   // general trader type, catchall default
#define IT_TYPE_STORE         "Store"     // shopkeeper type
#define IT_TYPE_STALL         "Stall"     // item trader type
#define IT_TYPE_SNEAKY         "Sneaky Trader" // vegabonds and special wandering traders
#define IT_TYPE_BLACKSMITH       "Smith"
#define IT_TYPE_JEWELER         "Jeweler"
#define IT_TYPE_TAILOR         "Tailor"
#define IT_TYPE_BOOKSELLER       "Bookseller"
#define IT_TYPE_MAPMAKER       "Mapmaker"
#define IT_TYPE_CURIO         "Curio"
#define IT_TYPE_TATTOO         "Tattooist"
#define IT_TYPE_MEDICAL         "Apothecary"
And especially the use of IT_TYPE_BLACKSMITH in PROGRAM\ITEMS\items_utilite.c .

Still trying to figure out how to use this in a non-messy way though.
We can do a manual GiveItem2Character in that function, but that would not be pretty.
 
Managed to find out some good stuff!!

Did the following things:
1. Set the "bladekit" to skipsell = false, rare = 1.00 and minlevel = 1 to ensure it shows up as much as possible
2. In PROGRAM\ITEMS\initItems.c:
Code:
  case "clock2"  : genitm.groupID = CLOCK_ITEM_TYPE;  break;  // PB: Clock
   case "bladekit": genitm.groupID = IT_TYPE_BLACKSMITH; break;  // PB: Blade Care Kit - ADD THIS LINE!
3. In PROGRAM\ITEMS\items_utilite.c:
Code:
        itmt.(tmpstr) = IT_TYPE_BLACKSMITH;
         itmt.(tmpstr).qty = 1000.0; // 1.0 - CHANGE THIS LINE FOR TESTING!

Testing in the game at player level 20:
Regular trader has 22 Blade Care Kits
Item trader has 8 Blade Care Kits
Blacksmith has 5751 Blade Care Kits!!!

So while it seems I cannot prevent regular and item traders from having items defined as IT_TYPE_BLACKSMITH,
I can force the Blacksmith to have a whooole lot more of them.

Now of course these values were far exaggerated for testing purposes.
But with some tweaking, we could set this up so that Blacksmiths do have a much higher chance of carrying these items.

@Grey Roger, would you mind experimenting with this a bit and see if you can find some numbers for rare, minlevel and the Blacksmith "qty" modifier that seem right?

Also, we could create some additional types of item traders. In fact, they are already defined:
Code:
#define IT_TYPE_BLACKSMITH       "Smith"
#define IT_TYPE_JEWELER         "Jeweler"
#define IT_TYPE_TAILOR         "Tailor"
#define IT_TYPE_BOOKSELLER       "Bookseller"
#define IT_TYPE_MAPMAKER       "Mapmaker"
#define IT_TYPE_CURIO         "Curio"
#define IT_TYPE_TATTOO         "Tattooist"
#define IT_TYPE_MEDICAL         "Apothecary"
Now I know these aren't really actually used, but would it not be cool to actually have a specialized Map Maker and Book Seller somewhere in the Caribbean?

Is there any point in having a Jeweler? Considering that usually you would SELL that kind of stuff and not BUY it?

Tailor, Tattooist and Apothecary seem a bit unnecessary right now, since none of them actually work as item traders right now.

And what would "Curio" be supposed to do? What kind of items could we get sold there?

Would be interesting for role-playing to have more differences between the various trader types, though.
That would make different characters in different towns more special, no?

By the way, we do already have some sort of "Sneaky Traders".
The ones you encounter randomly in towns are quite likely to sell items out of the Special Weapon Assembly Kit, eg. Borgiablades, Stinkpots, etc.
 
I agree with this but shall we move this to 3.4 also?
 
None of this involves a lot of rewriting of existing code, so it should be safe to do it now as well.
Most important here is the actual balancing. Could be take quite some tweaking, so on that account, perhaps it is indeed better to wait.

For now, what I would propose is to use the rarity value at 0.20 as @Grey Roger suggests.
I would like to keep the genitm.groupID = IT_TYPE_BLACKSMITH change though, which makes this item more common at blacksmiths at least.
 
I'm completly fine with that :).
I still wanna see how the IT_TYPE works first. Could we for example define groups which are exclusively to a certain type and some which just have it more. That would make it more interesting :).
Also I think it would be better actually to define the Item trader group and have certain Item Types set to them instead of have this set at the item.
So Say you have the item trader shopkeerp, he sells all types.
but the item trader bookshop only sells items of the book type etc.
 
Right now, it looks like the chances of a certain item showing up does depend on trader type,
eg. I convinced the Blacksmith to have a lot more Blade Care Kits than the other traders.
But the he was also happily selling a whole bunch of "Cooking With Albatross" books, which I do not think we want.

It does make sense to me to have certain items linked to certain trader types.
But it would be even better if some items would be EXCLUSIVE to those trader types as you suggest.
Right now, that is clearly not the case.
 
I'd definitely like to see this make its way into Build 14 still in some form at least.
It would help out with game balancing and also ensure that visiting different areas in the game is actually worthwhile.
You shouldn't be able to get all special stuff in one town.
 
I think this will be part of the dynamic economyy which I would like to have in 14
 
I think this will be part of the dynamic economyy which I would like to have in 14
If so, we would have to tread with care there.
Some of our regular players like to do a lot of trading and we don't want to mess them up. (Again... :facepalm)

But it should be OK if we do some proper internal testing on that between us and those who are willing to help with it.
Then we can roll it out only after we have caught any potential serious issues that could cause unfortunate grievances.
 
I'm pretty sure that item is already how @Jack Rackham wants it. It's his gun in his storyline. He probably wouldn't appreciate me changing that.... :rolleyes:
The same is true of the rifle from "Bartolomeu", though it is @Bartolomeu o Portugues you risk offending there. :p Whereas the one from the Maltese Abbey is not associated with any quest. So if any is to be sellable, that's the one.

And it's occurred to me that Santos' journals should not be sellable to just any trader. They're just old notebooks, nothing interesting - except to the right reader. They should only be sellable to a sneaky trader.
 
The same is true of the rifle from "Bartolomeu", though it is @Bartolomeu o Portugues you risk offending there. :p Whereas the one from the Maltese Abbey is not associated with any quest. So if any is to be sellable, that's the one.
At least for the Bartolomeu one I know it is used in one quest scene and not technically needed afterwards. It is also by far the most overpowered weapon in the game.
Anyway, I have now set them to ALL not be sell-able.

And it's occurred to me that Santos' journals should not be sellable to just any trader. They're just old notebooks, nothing interesting - except to the right reader. They should only be sellable to a sneaky trader.
I can give you no guarantees that this is going to work:
Code:
  switch(id)
  {
  case "lockpick": genitm.groupID = LOCKPICK_ITEM_TYPE;      // PB: Lockpick
            genitm.sneaky = true;          break;  // PB: Sneaky Trader
  case "Santos_Journal1": genitm.sneaky = true;      break;  // PB: Sneaky Trader
  case "Santos_Journal2": genitm.sneaky = true;      break;  // PB: Sneaky Trader
 
Nope, that doesn't work at all. In fact, no matter what I do, I can NOT get the Journal to show up in the itemtrade interface at all.
I already skiptrade, skiprand, skipequip and skipsell to 0 and removed the "sneaky" attribute for good measure.
That makes it as much a normal item as any other. Not working.
Then I tried to convince it show up in other ways by diving deep into the code. Still no luck.
I'm giving up on this one. @Levis, any thoughts? :modding
 
Problem: You cannot sell the "Santos_Journal1" item to traders.
Already tried:
Code:
n = InitItem(n,"Santos_Journal1", "",  4,  8, 0.10,  5,  3000,  0,  0,  0, 1,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0, 0, 0, 0); // Mateus Santos' Journal
Note the four zeros at the end instead of ones.

Also removed the "sneaky" attribute from the item (is already not there in the last upload, because I just added it for testing purposes).
In interface itemstrade.c commented out the use of these functions (in two spots):
Code:
    if(!TraderUseItem(&refTrader, itemName)) continue; // NK itemtrade 05-04-02 skip qty <=0 items.
     if (!IsTradeItem(itemname)) continue; // KK
Eventually the item did appear, but not without errors.
Modified both functions to always return true. Item still didn't show up. I'm lost. :facepalm
 
Basically we what want is that items with "sneaky" attribute can be sold only to Sneaky Traders, which is to include the "Santos_Journal1" and "Santos_Journal2" items.
Right now they do SELL those items and can buy the ones you just got yourself from them (I tested that).

If you're willing to look into that anyway, would you also be willing to set up a new INDIAN_TRADER_TYPE who sells only items with the .indian attribute?
And also prevent other traders from selling those?

This may have some impact in that certain idols won't be sold anymore.
But you can still find them and buy them from the soon-to-be-special second item trader at Aruba.
Then we can add that attribute to the indian weapon too, as well as the quiver and such so you can actually get those when you want to.
 
Other related wishes would be to have these trader types actually do something:
Code:
#define IT_TYPE_GENERAL         "General"   // general trader type, catchall default
#define IT_TYPE_STORE         "Store"     // shopkeeper type
#define IT_TYPE_STALL         "Stall"     // item trader type
#define IT_TYPE_SNEAKY         "Sneaky Trader" // vagabonds and special wandering traders
#define IT_TYPE_BLACKSMITH       "Smith"
#define IT_TYPE_JEWELER         "Jeweler"
#define IT_TYPE_TAILOR         "Tailor"
#define IT_TYPE_BOOKSELLER       "Bookseller"
#define IT_TYPE_MAPMAKER       "Mapmaker"
#define IT_TYPE_CURIO         "Curio"
#define IT_TYPE_TATTOO         "Tattooist"
#define IT_TYPE_MEDICAL         "Apothecary"
Most important there are the Bookseller and Mapmaker, I think.
That could give a purpose to the Turks Library and could also help to ensure you can buy ALL maps at least somewhere.
I know sometimes maps like to show up just fine during play. And then sometimes they really don't. :facepalm
 
Cheers! If you can figure out a bit of the basis, perhaps I can expand on it further.
But right now my efforts on it seem to have not worked, so it looks like I'll be needing some help at least.
 
going to take a look at this next week, so if people have any requests about this please post them now ;).

Need to look into how it really works but I want to see if its able to define some kind of templates for the different trader types and have them set specific items or items groups on a higher rarity or lower one.
So you could for example set it so a bookseller only sells book items etc.
 
Back
Top