Re: distribution, I'd recommend keeping the name separate. You have to keep the UID separate - that's true even between different versions of the mod.
Re: Priority, like Darkliath said, you can't over-prioritize a cheap item or the AI will never sell it for a better item. This is true of conditional priorityfunctions as well. If you gave Nimoth 100 priority and all of the artifacts 50 priority, Nimoth would never be sold under any circumstances, which isn't necessarily desirable.
If anything, you could use conditional priorityfunctions to start the priority very high for basic items like Nimoth, Banded, Scaled Helm, Vlemish, etc, and then lower their priority to a normal level once the AI is high enough level and/or has a full or nearly-full inventory. I'd recommend looking at some of the formulaic priority returns I've done for citadel upgrades, so you can incorporate both level and number of free slots into the resulting priority.
Getting a demigod's level is as simple as unit:GetLevel(), and here's an AIGlobals utility function for getting the number of free inventory slots for a particular item type for use in PriorityFunctions - throw this near the top of the file:
- local ValidateInventory = import('/lua/common/ValidateInventory.lua')
- --Returns number of free slots for the provided item name's inventory type
- function NumFreeSlots(unit, itemName)
- return ValidateInventory.NumFreeSlots(unit.Inventory[Items[itemName].InventoryType]) or 0
..and make sure itemName is a string corresponding to the name of the item, case-sensitive, e.g. for Nimoth, 'Item_Chest_030'.
Edit: Nevermind, I see that the artifact/Godplate priorityfunctions are intended to prevent them from being sold back once bought - that makes sense.