here is the script i wrote for the bartering mannequin:
Spoiler Scriptname DCVR_BPR_MannequinBarterScript extends Actor ObjectReference Property MerchantChest AutoMiscObject Property Gold001 AutoFormList Property DisplayOutfit AutoEvent OnCellAttach() RegisterForSingleUpdate(0.1)EndEventEvent OnActivate(ObjectReference akActionRef) UnequipAll() ShowBarterMenu() RegisterForSingleUpdate(0.1)EndEventEvent OnItemAdded(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer) If (akSourceContainer == Game.GetPlayer()) && (akBaseItem != Gold001) RemoveItem(akBaseItem, aiItemCount, True, MerchantChest) EndIfEndEventEvent OnUpdate() EnableAI(True) MoveTo(GetLinkedRef()) EnableAI(False) EquipCurrentArmor() RemoveItem(Gold001, GetItemCount(Gold001), True, MerchantChest)EndEventFunction EquipCurrentArmor() Int i = 0 Int n = DisplayOutfit.GetSize() While (i < n) EquipItem(DisplayOutfit.GetAt(i)) i += 1 EndWhileEndFunction
setup:
1. make a duplicate mannequin NPC that is only for store displays
2. attach the above script to the store mannequin
3. fill the properties
- MerchantChest points to your store's merchant chest
- for the formlist DisplayOutfit, create a new formlist and drag/drop the armor into it the same way you would for an outfit. don't put any weapons or other non-armors into this list. point the property to your new formlist
* Note, if you want to use multiple mannequins all with different starting outfits, do not fill this property on the actor base. create separate formlist outfits, and fill the properties on each reference after you place them into the cell
4. (optional) duplicate the mannequinactivator trigger box thing, rename it something like Store Display, and fill in the text override to Browse. this makes it so that when the player mouses over this mannequin, instead of "Activate Mannequin" it will say "Browse Store Display"
5. link everything up the same way you would a normal mannequin
how it all wortks:
when you enter the cell, the mannequin will outfit itself with all of the items specified in the formlist. when you activate the mannequin, it will open up its own barter menu. unfortunately since the mannequin is not a legit merchant, it wont have any starting gold. but once you start trading with it, it will have gold for that session only.
if the player purchases the armor off the mannequin, the gold stays in the bartering menu for the length it is open, the player can sell other crap back to the mannequin, but it will be immediately sent to the real merchant container. after the player is finished, the mannequin will re-outfit itself with a new set of the armor. all of the transacted gold will return to the original merchant container.