• 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!

Sneaky Trader mod - update and thoughts please

CatalinaThePirate

Unholy Terror,
Storm Modder
<img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/hi.gif" style="vertical-align:middle" emoid=":gday" border="0" alt="hi.gif" /> Mateys...

So I've got an array of items for my Sneaky Trader,

<img src="http://www.ganotherapyusa.com/extras/items_st.jpg" border="0" class="linked-image" /> <img src="http://www.ganotherapyusa.com/extras/item_map.jpg" border="0" class="linked-image" />

and I was contemplating putting them into the inititems list - and I stopped... Because this is somewhat complicated.

What I want:

1.) The items that the Sneaky Trader ("ST") will offer for sale are exclusive. No merchant will sell them.

2.) When you pay for these items from the ST, you'll see a buy price and a sell price - and of course the buy price (ST buying from you) will be less than you paid. Typical, like the merchants.

3.) IF you should decide to sell these items, you can do so at a loss to the ST, but you might also go to a merchant - who sometimes will give you more, and sometimes give you less - or maybe chase you out of his shop for trying to fence stolen goods.

4.) One of these items happens to be a schooner - so there will also have to be a thing like in #3 for the shipyard. I think in this case the ship will be in horrible shape and need to be fixed, or in beautiful condition and not need to be fixed. In any event, you may wish to sell this ship for a profit (or loss) too... That means shipyard. Again, there might be a part for the shipwright to chase you out of his shop because you are trying to sell him a stolen ship.

5.) You will have an option to bring suspicious items to the Captain of the Guard, to turn in as "Stolen", for a boost to your reputation. If you go to a merchant and sell them and make a hefty profit - it should be at a price - a hit to your rep for selling stolen merchandise.

6.) When you talk to townspeople there can be a part where you can ask about the trader. I want it to be so that the men hate him, but the women love him. Is there a way to designate an if/else in the dialog - if sex=male, then this dialog, else this dialog. CheckSex? <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/wink.gif" style="vertical-align:middle" emoid=";)" border="0" alt="wink.gif" />

7.) The pieces of the map that are in the smaller pic are meant to be a side quest item. I need a destination to a treasure - maybe on Khael Roa in the new areas??? <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/icon_wink.gif" style="vertical-align:middle" emoid=";)" border="0" alt="icon_wink.gif" />

This is going to be fun, but very involved. I think I'm crazy to try - but I suppose we already *knew* that! <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/biggrin.gif" style="vertical-align:middle" emoid=":D" border="0" alt="biggrin.gif" />

Let me have your thoughts on this. Thanks! <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" />
 
<img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/oops3.gif" style="vertical-align:middle" emoid=":eek:ops2" border="0" alt="oops3.gif" /> Aw thanks, Rico... <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/icon_mrgreen1.gif" style="vertical-align:middle" emoid=":cheeky" border="0" alt="icon_mrgreen1.gif" />

I was also thinking that returning stolen items could - MAYBE, maybe not - bring you a monetary reward too...
 
You mean bad guy, in selling the stolen items, yes, however take into account the hit to your rep if you do so. If you return the stolen items your rep will take a boost.

And remember, it's all random percentages, so you will never know what will happen - or whether it will be in your favor or not. <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/icon_wink.gif" style="vertical-align:middle" emoid=";)" border="0" alt="icon_wink.gif" />
 
Hmm, Ideas

1) Ye should be able to the bring the item/ship back to the original owner, for a big reward. But be careful, sometimes they can accuse you of stealing it. Then ye have to fight for your life. The items should be tied into nationality. EX. The Perfect Cardinals Guard could be returned to the governor of Falise De Fleur. Seeing as how thats tied into French heritage.

2) You could turn the sneaky trader into the local authorities. They throw him in the brig, and you get a huge reward, and a huge reputation boost. But when he gets out, he will (randomly) come for you. And he will (randomly) have friends. <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/icon_wink.gif" style="vertical-align:middle" emoid=";)" border="0" alt="icon_wink.gif" />
 
<!--`QuoteBegin-KevO44`+--><div class='quotetop'>QUOTE(KevO44)</div><div class='quotemain'><!--QuoteEBegin-->And he will (randomly) have friends. <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/icon_wink.gif" style="vertical-align:middle" emoid=";)" border="0" alt="icon_wink.gif" />[/quote] <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/laugh.gif" style="vertical-align:middle" emoid="xD:" border="0" alt="laugh.gif" /> Yessss, I like it! <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/laugh.gif" style="vertical-align:middle" emoid="xD:" border="0" alt="laugh.gif" />

I think, though, that I'm going to keep this guy somewhat simple - relatively speaking, of course - so that if anyone wishes to mod him into something, they can do it...

In other words, if you have any quest ideas after this guy is put into the game, use the characters and go for it! <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/onya.gif" style="vertical-align:middle" emoid=":onya" border="0" alt="onya.gif" />

That's rather what I intended with Armand, from the Fred Bob quest... He'll be back!!! <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/keith.gif" style="vertical-align:middle" emoid=":keith" border="0" alt="keith.gif" />
 
Armand. I miss that guy. What about his annoying wife. <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/laugh.gif" style="vertical-align:middle" emoid="xD:" border="0" alt="laugh.gif" /> Will she make a comeback?
 
Haha, yes, Estrella! I thought she'd be perfect as an inkeeper on a remote island... Hiding from the Spanish Navy.

Ironically, when I was with the PMT we (Grumblepunk and I) were supposed to be working on an island that would have been perfect for this idea.

<img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/rolleyes.gif" style="vertical-align:middle" emoid=":rolleyes:" border="0" alt="rolleyes.gif" /> Oh well. Sometimes the choices you make can be difficult - I decided not to stay on with the PMT, thus the island is probably being built by someone else... <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/tongue.gif" style="vertical-align:middle" emoid=":blah:" border="0" alt="tongue.gif" /> No matter. <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/icon_wink.gif" style="vertical-align:middle" emoid=";)" border="0" alt="icon_wink.gif" />

Maybe if we can finally get the Russian Morgan mod translated, we can take advantage of their extra islands &tc... Or put something on Khael Roa...

I don't expect to mod it myself... So if someone else wants to take it on, they're welcome...
 
heya cat,

the code for giving items to traders is currently in quests_reaction.c in a function called GiveItemToTrader; this is rerun every day and decides what items the trader has for sale (i moved it into a separate file for the blacksmith interface mod but most of you won't have that change. it makes it much easier to edit the function though. quests_reaction.c is full of random functions like that <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/happy.gif" style="vertical-align:middle" emoid="^_^" border="0" alt="happy.gif" /> )

the code skips any item that has the property <b>skiptrade</b> set, so if you don't want an item to appear in stores, just add <b>itm.skiptrade = true;</b> to the item definition in initItems.c. (the items should still be sellable <i>to</i>traders but not buyable <i>from</i> them.)

for your sneaky trader you could copy that entire function and rename it GiveItemToSneakyTrader. you could then alter it as much as you like, to select only the items you want it to. one way of doing this would be:
  • have the 'sneakytrader' property (note that exclamation mark, which makes it negative).
  • in the definition of each of your items, add the line <b>itm.sneakytrader = true;</b> to set that property. now, only items you give that property will be given to sneaky traders.
  • in the sneaky trader's dialogue, add the following node, which will open the item trade screen. i just copied it directly from a normal storekeeper's dialogue, but changed GiveItemToTrader to GiveItemToSneakyTrader:


    • <!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->  case "items":

           if (npchar.quest.item_date != lastspeak_date)

           {

         GiveItemToSneakyTrader(npchar);

         npchar.quest.item_date = lastspeak_date;

           }



           Diag.CurrentNode = Diag.TempNode;

           NPChar.quest.meeting = NPC_Meeting;

           DialogExit();

           LaunchItemsTrade(NPChar);

       break;<!--c2--></div><!--ec2-->

      tell me if any of that didn't make sense, or if you try it and it doesn't work (i haven't tested it... o_o )

      <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/happy.gif" style="vertical-align:middle" emoid="^_^" border="0" alt="happy.gif" />
 
First, the bottom section of Build Readme.rtf should help; there's extensive docs on the new items system (but probably not extensive enough! <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /> ).

1. Set property skiptrade = true for all the items so they won't be stocked by merchants. Oh, and set the other skips true too, so they won't be in random boxes (I assume you don't want to get them randomly) and they won't be counted as weapons.

2. No change necessary. Unless of course you have 10 commerce. If you want the buy/sell ratio to be _fixed_, you'll have to add a special case to itemstrade.c that overrides the normal ratio calc if the trader is your new char.

3. You'll need to randomly change the price of the item after you leave the sneaky trader. I.e. set an exit quest after talking with him and buying the goods, that then goes to items[getitemindex(youritem)].price and sets it to some random value above or below what it was before.

Also, you should when adding the items to inititems.c add special attribute itm.stolen = true.
Then, in each merchant's dialog, you need to add a check when asking to look at items to see if the player has any items with flag stolen = true.
example:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->    ref itm;

    bool stolen = false;

    for(int n = 0; n < GetAttributesNum(pchar.items); n++)

    {

 Items_FindItem(GetAttributeName(GetAttribute(pchar.items,n)), &itm);

 if(CheckAttribute(itm.stolen)) { if(sti(itm.stolen)) stolen = true; break; }

    }<!--c2--></div><!--ec2-->

stolen will be true if pchar has any items that count as stolen. You can then set up dialog text and branches based on that.

Note that if the sneaky trader sells you a _normal_ item, i.e. one defined in inititems _without_ the stolen = true attribute, it won't count.

4. Hmm. Do you want to add a new ship to ships_init, or use an existing one? If the former, you can add a stolen attribute like for items, if the latter you'll have to set a _character_ property.

Oh, for these you can probably use the existing dialog I set up for if you're not friendly with the nation and the shopkeeper/shipwright calls for guards.

5. The guard is easy, you can do that with dialog. The rep hit on selling is tough. You'll have to edit the interface files and check for whether what's sold is stolen.

6. Ah, new thread! We need to revamp that...

7. Sounds good to me. Set up a quest that checks for having all four items, then changes pchar's portrait (i.e. facied) to a big version of the map until you find the treasure (that way you can combine all four 128 squares). Making the destination, you can use CCC's new locs tut I think.

Sounds good indeed! Best of luck, and keep us posted, and fire away if you get stuck/need ideas! <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" />
 
Ooh, good call Kieron!

Though, why not (mwahaha) rewrite the whole darn func so it's passed a string giving trade type.

Like, GiveItemsToTrader(char, "blacksmith") will only give `itm-has`-`attrib-blacksmith` items.
Ditto "merchant", "sneakytrader", `what-have`-you.

This has been your daily `anti-hard`-coding plea. <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" />
 
<!--`QuoteBegin-CatalinaThePirate`+--><div class='quotetop'>QUOTE(CatalinaThePirate)</div><div class='quotemain'><!--QuoteEBegin-->CheckSex?  ;)[/quote]

<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->string CheckSex(ref char)

{

    switch(char.sex)

    {

 case "male":

     return "yes, please";

 break;



 case "female":

     return "but do you really love me?";

 break;

    }

}<!--c2--></div><!--ec2-->
 
<!--`QuoteBegin-NathanKell`+--><div class='quotetop'>QUOTE(NathanKell)</div><div class='quotemain'><!--QuoteEBegin-->Ooh, good call Kieron!

Though, why not (mwahaha) rewrite the whole darn func so it's passed a string giving trade type.

Like, GiveItemsToTrader(char, "blacksmith") will only give `itm-has`-`attrib-blacksmith` items.
Ditto "merchant", "sneakytrader", `what-have`-you.

This has been your daily `anti-hard`-coding plea. <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" />[/quote]

yeh, i did rewrite the whole function as GiveItemsToBlacksmith, and did feel a pang of coding guilt... <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/unsure.gif" style="vertical-align:middle" emoid=":?" border="0" alt="unsure.gif" /> if the blacksmith interface comes into use i promise to redo that <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/happy.gif" style="vertical-align:middle" emoid="^_^" border="0" alt="happy.gif" />
 
<!--`QuoteBegin-Kieron`+--><div class='quotetop'>QUOTE(Kieron)</div><div class='quotemain'><!--QuoteEBegin--><!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->string CheckSex(ref char)

{

    switch(char.sex)

    {

 case "male":

     return "yes, please";

 break;



 case "female":

     return "but do you really love me?";

 break;

    }

}<!--c2--></div><!--ec2-->[/quote] <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/mybad.gif" style="vertical-align:middle" emoid=":facepalm" border="0" alt="mybad.gif" /> <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/laugh.gif" style="vertical-align:middle" emoid="xD:" border="0" alt="laugh.gif" /> <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/laugh.gif" style="vertical-align:middle" emoid="xD:" border="0" alt="laugh.gif" /> <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/laugh.gif" style="vertical-align:middle" emoid="xD:" border="0" alt="laugh.gif" /> <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/laugh.gif" style="vertical-align:middle" emoid="xD:" border="0" alt="laugh.gif" /> <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/laugh.gif" style="vertical-align:middle" emoid="xD:" border="0" alt="laugh.gif" />

You are too much, Kieron! <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/laugh.gif" style="vertical-align:middle" emoid="xD:" border="0" alt="laugh.gif" />
 
whaddidowhaddido? <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/happy.gif" style="vertical-align:middle" emoid="^_^" border="0" alt="happy.gif" />

of course the coder in me was screaming to make that more complicated... like with a default: case... and... and... *gets knocked out by frying pan wielded by cat*
 
LOL, more likely a belaying pin, matey! <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/laugh.gif" style="vertical-align:middle" emoid="xD:" border="0" alt="laugh.gif" /> Classic, just classic!!! <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/laugh.gif" style="vertical-align:middle" emoid="xD:" border="0" alt="laugh.gif" />

I'm sorry, I was "flying" through here before and landed just long enough to enjoy that little code joke - but shame on me, I did not take a moment to say THANK YOU to both you AND NK for providing thoughts on this mod. <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/oops3.gif" style="vertical-align:middle" emoid=":eek:ops2" border="0" alt="oops3.gif" />

So THANK YOU!!! <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/par-ty.gif" style="vertical-align:middle" emoid=":cheers" border="0" alt="par-ty.gif" /> <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/onya.gif" style="vertical-align:middle" emoid=":onya" border="0" alt="onya.gif" /> <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/icon_praise.gif" style="vertical-align:middle" emoid=":bow" border="0" alt="icon_praise.gif" /> <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/beer2.gif" style="vertical-align:middle" emoid=":beer" border="0" alt="beer2.gif" /> Have an ale! <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/icon_mrgreen1.gif" style="vertical-align:middle" emoid=":cheeky" border="0" alt="icon_mrgreen1.gif" />
 
Hmm.
bool ismale(ref chr)
{ if(CheckAttribute(chr,"sex")) if(chr.sex == "woman") return false; return true; }

But Kieron's is better. <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/laugh.gif" style="vertical-align:middle" emoid="xD:" border="0" alt="laugh.gif" />
 
<img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/icon_eek.gif" style="vertical-align:middle" emoid=":shock:" border="0" alt="icon_eek.gif" /> <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/laugh.gif" style="vertical-align:middle" emoid="xD:" border="0" alt="laugh.gif" /> You *both* are too much! <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/laugh.gif" style="vertical-align:middle" emoid="xD:" border="0" alt="laugh.gif" />

Hee hee, I have to share this - I just got a `t-shirt` from Jinx Hackwear that says, "I am your webmaster, you must [SUBMIT]" (is a button)

Fun site: <a href="http://www.jinx.com" target="_blank">http://www.jinx.com</a> All you coders will love this stuff. <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/laugh.gif" style="vertical-align:middle" emoid="xD:" border="0" alt="laugh.gif" />
 
LOL, neat shirt.

You may not believe this, but I wrote that function <i>straight</i>. I didn't notice the joke in it 'til you brought it up.

Programmers need to get out more, I guess. <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/laugh.gif" style="vertical-align:middle" emoid="xD:" border="0" alt="laugh.gif" />
 
<img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/icon_eek.gif" style="vertical-align:middle" emoid=":shock:" border="0" alt="icon_eek.gif" /> Oh dear, poor Nathan, yes, go outside, meet some nice girls, INTERFACE!!! <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/keith.gif" style="vertical-align:middle" emoid=":keith" border="0" alt="keith.gif" />

<img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/icon_wink.gif" style="vertical-align:middle" emoid=";)" border="0" alt="icon_wink.gif" /> Just kidding... <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/laugh.gif" style="vertical-align:middle" emoid="xD:" border="0" alt="laugh.gif" />

I really do like that shirt, yes... Very appropriate. Although I've usually made a joke that I'm not a webMASTER, I'm a `DOMAIN-natrix`! <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/w00t.gif" style="vertical-align:middle" emoid=":woot" border="0" alt="w00t.gif" />

Or just a webmaven. That works best. <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/icon_mrgreen1.gif" style="vertical-align:middle" emoid=":cheeky" border="0" alt="icon_mrgreen1.gif" />
 
<!--`QuoteBegin-NathanKell`+--><div class='quotetop'>QUOTE(NathanKell)</div><div class='quotemain'><!--QuoteEBegin-->You may not believe this, but I wrote that function <i>straight</i>. I didn't notice the joke in it 'til you brought it up.[/quote]

what joke? i don't get it <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/unsure.gif" style="vertical-align:middle" emoid=":?" border="0" alt="unsure.gif" />
 
Back
Top