#include "inc_item_tools"
#include "prc_x2_itemprop"
void main()
    {
    object oItem = GetItemActivated();
    string sTag = GetTag (oItem);
    object oPC = GetItemActivator();
    object oTarget = GetItemActivatedTarget();
    int iBonus,iStat;
    string sResRef;
    object oSkin = GetItemInSlot(INVENTORY_SLOT_CARMOUR,oPC);
    // Determine Bonus
    if (sTag == "miscb092"
     || sTag == "miscb093"
     || sTag == "miscb094"
     || sTag == "miscb095"
     || sTag == "miscb096"
     || sTag == "miscb097")
        iBonus = 1;
    else if (sTag == "miscc045"
          || sTag == "miscc046"
          || sTag == "miscc047"
          || sTag == "miscc048"
          || sTag == "miscc049"
          || sTag == "miscc050")
        iBonus = 2;
    else if (sTag == "miscc066"
          || sTag == "miscc067"
          || sTag == "miscc068"
          || sTag == "miscc069"
          || sTag == "miscc070"
          || sTag == "miscc071")
        iBonus = 3;
    else if (sTag == "miscc081"
          || sTag == "miscc082"
          || sTag == "miscc083"
          || sTag == "miscc084"
          || sTag == "miscc085"
          || sTag == "miscc086")
        iBonus = 4;
    else if (sTag == "miscc088"
          || sTag == "miscc089"
          || sTag == "miscc090"
          || sTag == "miscc091"
          || sTag == "miscc092"
          || sTag == "miscc093")
        iBonus = 5;
    else
        {
        FloatingTextStringOnCreature("ERROR IN BOOK",oPC);
        }
    //Determine Stat
    if (sTag == "miscb092"
     || sTag == "miscc045"
     || sTag == "miscc066"
     || sTag == "miscc081"
     || sTag == "miscc088")
        iStat =  ABILITY_CONSTITUTION;
    else if (sTag == "miscb093"
          || sTag == "miscc046"
          || sTag == "miscc067"
          || sTag == "miscc082"
          || sTag == "miscc089")
        iStat = ABILITY_STRENGTH;
    else if (sTag == "miscb094"
          || sTag == "miscc047"
          || sTag == "miscc068"
          || sTag == "miscc083"
          || sTag == "miscc090")
        iStat = ABILITY_DEXTERITY;
    else if (sTag == "miscb095"
          || sTag == "miscc048"
          || sTag == "miscc069"
          || sTag == "miscc084"
          || sTag == "miscc091")
        iStat = ABILITY_INTELLIGENCE;
    else if (sTag == "miscb096"
          || sTag == "miscc049"
          || sTag == "miscc070"
          || sTag == "miscc085"
          || sTag == "miscc092")
        iStat = ABILITY_CHARISMA;
    else if (sTag == "miscb097"
          || sTag == "miscc050"
          || sTag == "miscc071"
          || sTag == "miscc086"
          || sTag == "miscc093")
        iStat = ABILITY_WISDOM;
    // Apply proprerties to PC Skin
    itemproperty ipItem = ItemPropertyAbilityBonus(iStat,iBonus);
    IPSafeAddItemProperty(oSkin,ipItem);
    }
