The CopyItemAndModify() function, among other things, allows one to create a copy of a simple item with a different inventory icon. It uses an index number to determine which item icon the new item will have. Those numbers correspond (as best I can tell) to the order the icons appear in the Toolset for a given baseitem type. For instance, if I use CopyItemAndModify on a ring and use 1 as the index, the new ring will look like a gold ring, the first inventory icon for rings.
Is there a way for a script to determine how many icons there are for a particular base item? It will change depending on HAKs, etc. For instance, I think CEP takes the ring index up to 238. But, how would I know that without opening up the HAK files and counting all of the icons whose names start with iit_ring_?
(BTW, the CopyItemAndModify() function doesn’t fail to produce an object if it is given an index that is out of range. It seems to use a default icon. So, using that function in a loop until it fails to generate a valid object doesn’t work.)
Is this information in a 2DA somewhere? Is there a nice way of determining it? Preferably within NWScript at runtime?