We treat armor with ac over 3 as having enough metal components to count as metal. This excludes studded leather and hide. The following code has consts for cep items. If you don't use them, you can remove them. I include the const values at the top.
const int BASE_ITEM_CEP_HEAVYPICK = 301;
const int BASE_ITEM_CEP_LIGHTPICK = 302;
const int BASE_ITEM_CEP_SAI = 303;
const int BASE_ITEM_CEP_FALCHION = 305;
const int BASE_ITEM_CEP_ASSASSINDAGGER = 309;
const int BASE_ITEM_CEP_KATAR = 310;
const int BASE_ITEM_CEP_HEAVYMACE = 317;
const int BASE_ITEM_CEP_MAUL = 318;
const int BASE_ITEM_CEP_MERCURIALLONGSWORD = 319;
const int BASE_ITEM_CEP_MERCURIALGREATSWORD = 320;
const int BASE_ITEM_CEP_DOUBLESCIMITAR = 321;
const int BASE_ITEM_CEP_GOAD = 322;
const int BASE_ITEM_CEP_WINDFIREWHEEL = 323;
const int BASE_ITEM_CEP_DOUBLEPICK = 324;
int GetItemACBase (object oItem) {
if (!GetIsObjectValid(oItem))
return 0;
switch (GetBaseItemType(oItem)) {
case BASE_ITEM_SMALLSHIELD:
return 1;
case BASE_ITEM_LARGESHIELD:
return 2;
case BASE_ITEM_TOWERSHIELD:
return 3;
case BASE_ITEM_ARMOR:
break;
default:
return 0;
}
int bID = GetIdentified(oItem);
SetIdentified(oItem, FALSE);
int nBaseAC = 0;
switch (GetGoldPieceValue(oItem)) {
case 5: nBaseAC = 1; break; // Padded
case 10: nBaseAC = 2; break; // Leather
case 15: nBaseAC = 3; break; // Studded Leather / Hide
case 100: nBaseAC = 4; break; // Chain Shirt / Scale Mail
case 150: nBaseAC = 5; break; // Chainmail / Breastplate
case 200: nBaseAC = 6; break; // Splint Mail / Banded Mail
case 600: nBaseAC = 7; break; // Half Plate
case 1500: nBaseAC = 8; break; // Full Plate
}
SetIdentified(oItem, bID);
return nBaseAC;
}
int GetItemIsMetal (object oItem) {
switch (GetBaseItemType(oItem)) {
case BASE_ITEM_ARMOR:
if (GetItemACBase(oItem) > 3)
return TRUE;
break;
case BASE_ITEM_SMALLSHIELD:
case BASE_ITEM_LARGESHIELD:
case BASE_ITEM_TOWERSHIELD:
return TRUE;
case BASE_ITEM_BASTARDSWORD:
case BASE_ITEM_BATTLEAXE:
case BASE_ITEM_DAGGER:
case BASE_ITEM_DIREMACE:
case BASE_ITEM_DOUBLEAXE:
case BASE_ITEM_DWARVENWARAXE:
case BASE_ITEM_GREATAXE:
case BASE_ITEM_GREATSWORD:
case BASE_ITEM_HALBERD:
case BASE_ITEM_HANDAXE:
case BASE_ITEM_HEAVYFLAIL:
case BASE_ITEM_KAMA:
case BASE_ITEM_KATANA:
case BASE_ITEM_KUKRI:
case BASE_ITEM_LIGHTFLAIL:
case BASE_ITEM_LIGHTHAMMER:
case BASE_ITEM_LIGHTMACE:
case BASE_ITEM_LONGSWORD:
case BASE_ITEM_MORNINGSTAR:
case BASE_ITEM_RAPIER:
case BASE_ITEM_SCIMITAR:
case BASE_ITEM_SCYTHE:
case BASE_ITEM_SHORTSPEAR:
case BASE_ITEM_SHORTSWORD:
case BASE_ITEM_SICKLE:
case BASE_ITEM_TRIDENT:
case BASE_ITEM_TWOBLADEDSWORD:
case BASE_ITEM_WARHAMMER:
return TRUE;
case BASE_ITEM_CEP_ASSASSINDAGGER:
case BASE_ITEM_CEP_DOUBLEPICK:
case BASE_ITEM_CEP_DOUBLESCIMITAR:
case BASE_ITEM_CEP_FALCHION:
case BASE_ITEM_CEP_GOAD:
case BASE_ITEM_CEP_HEAVYMACE:
case BASE_ITEM_CEP_HEAVYPICK:
case BASE_ITEM_CEP_KATAR:
case BASE_ITEM_CEP_LIGHTPICK:
case BASE_ITEM_CEP_MERCURIALGREATSWORD:
case BASE_ITEM_CEP_MERCURIALLONGSWORD:
case BASE_ITEM_CEP_MAUL:
case BASE_ITEM_CEP_SAI:
case BASE_ITEM_CEP_WINDFIREWHEEL:
return TRUE;
}
return FALSE;
}
Funky