OnOpenStore
The script attached to this event occurs whenever a merchant is opened.
Trigger
When a merchant is opened by a PC.
Function(s)
GetLastOpenedBy() - returns the PC the store was opened for.
Remarks
For new store objects there is no script is attached to this event by default. On standard stores the script "nw_d1_startstore" is set, which (invalidly) uses SpeakString to debug the event.
This event is too late to apply appraise skill checks. For doing appraise checks Bioware created the function gplotAppraiseOpenStore which is in nw_i0_plot.nss and wraps functionality of OpenStore to open the store from a Conversation Action Script. See an example script like nw_d1_shoparcane.nss for an example.
Stores reorder their stock pages - ie sort by item type - when an item is added to a store by a player or script (eg CreateObject). They are not reordered when things are removed (brought) from the store. If you want to rearrange items back to default you could add a single item, although note the processing time for sorting very large stores is pretty slow, being around O(n^2) speed (where n is the number of items already in that page).
See Also
| functions: |