You could use a single store opening script to be called from the conversation (and the same line of the conversation). In the script itself, have it check the PC's character level with GetHitDice(), then check the merchant NPC for the tag of the level-dependent store (stored as string integers) and open that one.
Example:
NPC: Sam the Sword Seller
- on Sam, you set a variable for each PC level (or range of levels)
- - PC_SHOP_LVL_1 string samswordsellerlvl1
- - PC_SHOP_LVL_2 string samswordsellerlvl1
- - PC_SHOP_LVL_3 string samswordsellerlvl1
- - PC_SHOP_LVL_4 string samswordsellerlvl1
- - PC_SHOP_LVL_5 string samswordsellerlvl1
- - PC_SHOP_LVL_6 string samswordsellerlvl6
- - PC_SHOP_LVL_7 string samswordsellerlvl6
- - PC_SHOP_LVL_8 string samswordsellerlvl6
- in Sam's converstion, on the line that says something like "Yes, I want to buy something."
- - script that opens the store:
- - - checks PC Speaker's level
- - - checks OBJECT_SELF for level-dependent string variable (the store's tag)
- - - opens appropriate store for the PC
Notes:
By moving this all into the shop opening script, you save module resource space (with that whole 16k limit thing). Using this method, you're only adding three resources (1 conversation file, 1 script source file, and 1 compiled script file). If you want to go the generic route, you can use the script and conversation for multiple merchants (which is why I recommend using variables on the NPC shopkeeper, rather than storing the shop tags within the script itself).
I recommend making an "empty" merchant blueprint in the custom palette, then using that to make Sam's 1st store. Change the store name and tag, fill in inventory that won't change. Then copy that store for the next level, changing inventory and tag. Then copy again for the next one, and so on. Stores in the palette generally just uselessly take up valuable module resource space unless you've got a scripted event somewhere that "creates" a store in any location (such as various "shop genies").
Good luck!
Modifié par The Amethyst Dragon, 27 avril 2011 - 04:45 .