Jump to content

How to add items to merchants by scripting?


Satyrist

Recommended Posts

Posted

How do you add an item to a merchant by a quest script? I've tried using AddItem to add the item to the merchant's container reference, but the added items never show up!  :@

Posted

Don't know.

But in some quests in which you must buy a item from a merchant you ask for and buy the item by dialogue. ( so no new item in the merchant's Container)

 

Perhaps the Problem is the Oblivion save, after you have visited the merchant all is in your game save so you must wait 3 days (without too visit the merchant) before the item shows up. (don't know if that's true)

? perhaps works a script that disable the original Container and adds a new Container with original and your items.

Posted

oh !      like the thieves merchant  .      you need to be in the thieves guild to be able to sell stollen things !     you might look at those particular scripts .

Posted

Oblivion merchants who sell playerhouse addons get a new chest with the addon papers.

e.g. the Skingrad merchant has 3 merchant chests.

 

So don't add new item in the chest , add a new chest.

Posted

Maybe it's too late... sorry for that but anyway, you can add items to vendor chests via script. Probably to avoid conflict, or maybe because even you can't predict who will be the target vendor.

It works like this: (from one of my private plugins)

Begin MenuMode 1009

	if rMerchant == GetActiveMenuRef 1009
		return
	endif
	
	Let rMerchant := GetActiveMenuRef 1009
	Let rClass := rMerchant.GetClass
	
	if MerchEnchanter != rClass && MerchAlchemist != rClass
		return
	endif

	Let rContainer := rMerchant.GetMerchantContainer
	if 0 == rContainer.GetItemCount aaerCrystalBall
		rContainer.AddItem aaerCrystalBall 1
	endif

End
Posted

Thanks movomo, that was similar to what I was trying to do, unfortunately silly me was using the wrong reference  :blush: , it works now.

 

But Im going to remember your script for future reference.

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...