Jump to content
Reag

Merchant to require multiple different items

Recommended Posts

Hello!

Having a merchant that can exchange one item for another is great!

I'd propose, that having the option to require more different items could allow people to create a rudimentary "crafting" with their merchants.

Share this post


Link to post
On 7/29/2023 at 8:21 AM, Reag said:

Hello!

Having a merchant that can exchange one item for another is great!

I'd propose, that having the option to require more different items could allow people to create a rudimentary "crafting" with their merchants.

I can't speak on behalf of the Merchant addon & it's author, they may be interested in adding this. I'll pass it along.

 

In the meantime: You can replicate this using Gossip & Arcanum spells!

TL;DR is: you would create an ArcSpell that checks if you have the required crafting items, removes them, and then adds your final item. Then you can add this spell to an NPC gossip with some flavor text (i.e., "Craft a Sword" or whatever). 

Longer version:

  1. Create an ArcSpell with the Name, Description, and CommID you want. See the Arcanum User Guide for more info/help here.
  2. Make the first action a "Stop This ArcSpell If..." with a delay of 0, and set the input script as...
    • if (GetItemCount(itemID1) >= #numberRequired and GetItemCount(itemID2) >= #numberRequired) then return false; else print("You don't have the required items to craft this."); return true; end
    • Make sure to add in your item ID's and the number of each you need to craft. If you need more than two items, just add another "and GetItemCount(itemID) >= #numberRequired" after the last one in the script above [ but before that last closing parenthesis, ), after the numberRequired ].
    • Feel free to adjust the print message to be more specific or worded how you want - this is just to clarify that the spell didn't 'fail' to cast because of some other issue, just that they didn't have the needed items.
  3. Add new actions now at 0.1 delay to remove each item and the quantity of that item.
  4. Add a final action for adding your crafted item.
  5. Optional: Add an action to show a message that they successfully crafted the item.

MEwmZ8k.png

j0R3peR.gif

Share this post


Link to post

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×