Skip to content

How to get armor type? (light, medium, heavy, cloth)


GetBaseItemType() just returns : BASE_ITEM_ARMOR for all types of armors. How do you determine if armor is in category of cloth, light, medium or heavy ?

Comments

  • KamirynKamiryn Member Posts: 74
    For items of type BASE_ITEM_ARMOR you can use
    int nTorso = GetItemAppearance(oItem, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_TORSO);
    
    to get the torso model. With the torso model you can get the base AC with
    int nAC = FloatToInt(StringToFloat(Get2DAString("parts_chest", "ACBONUS", nTorso)));
    
    and with the AC you can determine the category:
    switch (nAC)
    {
    case 0: // clothing
    	break;
    case 1:
    case 2:
    case 3: // light armor
    	break;
    case 4:
    case 5: // medium armor
    	break;
    default: // heavy armor
    	break;	
    }
    
    Also you can use "armor.2da" to get other stats like max DEX bonus, AC check penalty, Arcane Failure %, weight, base cost, ...:
    nDexBonus = StringToInt(Get2DAString("armor", "DEXBONUS", nAC));
    nWeight = StringToInt(Get2DAString("armor", "WEIGHT", nAC));
    ...
    
  • ReachPWReachPW Member Posts: 27
    Great, I'll try that, thanks!
Sign In or Register to comment.