Ok, the last problem (got everything else working):
void RemakeShield(object oPC, int nMode)
{
int nSlot = INVENTORY_SLOT_LEFTHAND;
object oItem = GetItemInSlot(nSlot, oPC);
int nCurrApp = GetItemAppearance(oItem, ITEM_APPR_TYPE_SIMPLE_MODEL, 0);
object oNew;
int nBaseType = GetBaseItemType(oItem);
int nMin = StringToInt(Get2DAString("baseitems", "MinRange", nBaseType));
int nMax = StringToInt(Get2DAString("baseitems", "MaxRange", nBaseType));
do
{
if(nMode == 0) nCurrApp++;
else nCurrApp--;
if(nCurrApp > nMax) nCurrApp = nMin;
if(nCurrApp < nMin) nCurrApp = nMax;
oNew = CopyItemAndModify(oItem, ITEM_APPR_TYPE_SIMPLE_MODEL, 0, nCurrApp, TRUE);
}
The script cycles through all the "_SIMPLE_MODEL" appearances:
http://i.imgur.com/W2GAsKC.jpgHow to restrict it to the base item type appearances?