diff Player.cpp @ 1611:8e99b4a7176f

Слияние
author Ritor1
date Sat, 14 Sep 2013 10:28:23 +0600
parents 4b79ff62df3a
children 434b796cdfd3
line wrap: on
line diff
--- a/Player.cpp	Sat Sep 14 10:28:13 2013 +0600
+++ b/Player.cpp	Sat Sep 14 10:28:23 2013 +0600
@@ -156,8 +156,6 @@
    30   // PLAYER_SKILL_PLATE
 };
 
-
-
 //----- (00490913) --------------------------------------------------------
 int PlayerCreation_GetUnspentAttributePointCount()
 {
@@ -1140,7 +1138,7 @@
 {
   unsigned __int16 v2; // ax@1
   int v5; // edi@7
-
+  return true;
   if (CheckHiredNPCSpeciality(Scholar))
     return true;
 
@@ -1406,49 +1404,49 @@
 //----- (0048C855) --------------------------------------------------------
 int Player::GetBaseStrength()
 {
-  return this->uMight + GetItemsBonus(CHARACTER_ATTRIBUTE_STRENGTH, 0);
+  return this->uMight + GetItemsBonus(CHARACTER_ATTRIBUTE_STRENGTH);
 }
 
 //----- (0048C86C) --------------------------------------------------------
 int Player::GetBaseIntelligence()
 {
-  return this->uIntelligence + GetItemsBonus(CHARACTER_ATTRIBUTE_INTELLIGENCE, 0);
+  return this->uIntelligence + GetItemsBonus(CHARACTER_ATTRIBUTE_INTELLIGENCE);
 }
 
 //----- (0048C883) --------------------------------------------------------
 int Player::GetBaseWillpower()
 {
-  return this->uWillpower + GetItemsBonus(CHARACTER_ATTRIBUTE_WILLPOWER, 0);
+  return this->uWillpower + GetItemsBonus(CHARACTER_ATTRIBUTE_WILLPOWER);
 }
 
 //----- (0048C89A) --------------------------------------------------------
 int Player::GetBaseEndurance()
 {
-  return this->uEndurance + GetItemsBonus(CHARACTER_ATTRIBUTE_ENDURANCE, 0);
+  return this->uEndurance + GetItemsBonus(CHARACTER_ATTRIBUTE_ENDURANCE);
 }
 
 //----- (0048C8B1) --------------------------------------------------------
 int Player::GetBaseAccuracy()
 {
-  return this->uAccuracy + GetItemsBonus(CHARACTER_ATTRIBUTE_ACCURACY, 0);
+  return this->uAccuracy + GetItemsBonus(CHARACTER_ATTRIBUTE_ACCURACY);
 }
 
 //----- (0048C8C8) --------------------------------------------------------
 int Player::GetBaseSpeed()
 {
-  return this->uSpeed + GetItemsBonus(CHARACTER_ATTRIBUTE_SPEED, 0);
+  return this->uSpeed + GetItemsBonus(CHARACTER_ATTRIBUTE_SPEED);
 }
 
 //----- (0048C8DF) --------------------------------------------------------
 int Player::GetBaseLuck()
 {
-  return this->uLuck + GetItemsBonus(CHARACTER_ATTRIBUTE_LUCK, 0);
+  return this->uLuck + GetItemsBonus(CHARACTER_ATTRIBUTE_LUCK);
 }
 
 //----- (0048C8F6) --------------------------------------------------------
 int Player::GetBaseLevel()
 {
-  return this->uLevel + GetItemsBonus(CHARACTER_ATTRIBUTE_LEVEL, 0);
+  return this->uLevel + GetItemsBonus(CHARACTER_ATTRIBUTE_LEVEL);
 }
 
 //----- (0048C90D) --------------------------------------------------------
@@ -1456,7 +1454,7 @@
 {
   return uLevel + sLevelModifier +
          GetMagicalBonus(CHARACTER_ATTRIBUTE_LEVEL) +
-         GetItemsBonus(CHARACTER_ATTRIBUTE_LEVEL, 0);
+         GetItemsBonus(CHARACTER_ATTRIBUTE_LEVEL);
 }
 
 //----- (0048C93C) --------------------------------------------------------
@@ -1527,7 +1525,7 @@
 
   auto uConditionMult = pConditionAttributeModifier[attrId][GetMajorConditionIdx()];
   int magicBonus = GetMagicalBonus(attrId);
-  int itemBonus = GetItemsBonus(attrId, 0);
+  int itemBonus = GetItemsBonus(attrId);
   return uConditionMult * uAgeingMultiplier * this->*attrValue / 100 / 100
     + magicBonus
     + itemBonus
@@ -1560,7 +1558,7 @@
  
   v2 = GetActualMight();
   v3 = GetParameterBonus(v2);
-  v4 = GetItemsBonus(CHARACTER_ATTRIBUTE_MELEE_DMG_MIN, 0) + v3;
+  v4 = GetItemsBonus(CHARACTER_ATTRIBUTE_MELEE_DMG_MIN) + v3;
   v5 = GetSkillBonus(CHARACTER_ATTRIBUTE_MELEE_DMG_BONUS) + v4;
   result = _melee_dmg_bonus + GetMagicalBonus(CHARACTER_ATTRIBUTE_MELEE_DMG_BONUS) + v5;
   if ( result < 1 )
@@ -1580,7 +1578,7 @@
 
   v2 = GetActualMight();
   v3 = GetParameterBonus(v2);
-  v4 = GetItemsBonus(CHARACTER_ATTRIBUTE_MELEE_DMG_MAX, 0) + v3;
+  v4 = GetItemsBonus(CHARACTER_ATTRIBUTE_MELEE_DMG_MAX) + v3;
   v5 = GetSkillBonus(CHARACTER_ATTRIBUTE_MELEE_DMG_BONUS) + v4;
   v6 = this->_melee_dmg_bonus + GetMagicalBonus(CHARACTER_ATTRIBUTE_MELEE_DMG_BONUS) + v5;
   result = 1;
@@ -1700,7 +1698,7 @@
   {
     v4 = GetActualAccuracy();
     v5 = GetParameterBonus(v4);
-    v6 = GetItemsBonus(CHARACTER_ATTRIBUTE_RANGED_ATTACK, 0) + v5;
+    v6 = GetItemsBonus(CHARACTER_ATTRIBUTE_RANGED_ATTACK) + v5;
     v7 = GetSkillBonus(CHARACTER_ATTRIBUTE_RANGED_ATTACK) + v6;
     v3 = this->_ranged_atk_bonus + GetMagicalBonus(CHARACTER_ATTRIBUTE_RANGED_ATTACK) + v7;
   }
@@ -1719,7 +1717,7 @@
   int v4; // edi@1
   int result; // eax@6
 
-  v2 = GetItemsBonus(CHARACTER_ATTRIBUTE_RANGED_DMG_MIN, 0);
+  v2 = GetItemsBonus(CHARACTER_ATTRIBUTE_RANGED_DMG_MIN);
   v3 = GetSkillBonus(CHARACTER_ATTRIBUTE_RANGED_DMG_BONUS) + v2;
   v4 = this->_ranged_dmg_bonus + GetMagicalBonus(CHARACTER_ATTRIBUTE_RANGED_DMG_BONUS) + v3;
   if ( v4 >= 1 )
@@ -1737,7 +1735,7 @@
   int v4; // edi@1
   int result; // eax@6
 
-  v2 = GetItemsBonus(CHARACTER_ATTRIBUTE_RANGED_DMG_MAX, 0);
+  v2 = GetItemsBonus(CHARACTER_ATTRIBUTE_RANGED_DMG_MAX);
   v3 = GetSkillBonus(CHARACTER_ATTRIBUTE_RANGED_DMG_BONUS) + v2;
   v4 = this->_ranged_dmg_bonus + GetMagicalBonus(CHARACTER_ATTRIBUTE_RANGED_DMG_BONUS) + v3;
   if ( v4 >= 1 )
@@ -1813,8 +1811,8 @@
   }
   else if (pEquipment.uMainHand >= 0 && (itemid == ITEM_BLASTER || itemid == ITEM_LASER_RIFLE))
   {
-    min_damage = GetItemsBonus(CHARACTER_ATTRIBUTE_MELEE_DMG_MIN, 1);
-    max_damage = GetItemsBonus(CHARACTER_ATTRIBUTE_MELEE_DMG_MAX, 1);
+    min_damage = GetItemsBonus(CHARACTER_ATTRIBUTE_MELEE_DMG_MIN, true);
+    max_damage = GetItemsBonus(CHARACTER_ATTRIBUTE_MELEE_DMG_MAX, true);
   }
   else
   {
@@ -1853,8 +1851,8 @@
     }
     else if (pEquipment.uMainHand >= 0 && (itemid == ITEM_BLASTER || itemid == ITEM_LASER_RIFLE))
     {
-      min_damage = GetItemsBonus(CHARACTER_ATTRIBUTE_MELEE_DMG_MIN, 1);
-      max_damage = GetItemsBonus(CHARACTER_ATTRIBUTE_MELEE_DMG_MAX, 1);
+      min_damage = GetItemsBonus(CHARACTER_ATTRIBUTE_MELEE_DMG_MIN, true);
+      max_damage = GetItemsBonus(CHARACTER_ATTRIBUTE_MELEE_DMG_MAX, true);
     }
     else
     {
@@ -2261,7 +2259,7 @@
   broke_armor = sHealth <= -10;
   if ( sHealth < 1 ) //
   {
-    if ( (sHealth + uEndurance + GetItemsBonus(CHARACTER_ATTRIBUTE_ENDURANCE, 0) >= 1)
+    if ( (sHealth + uEndurance + GetItemsBonus(CHARACTER_ATTRIBUTE_ENDURANCE) >= 1)
       || pPlayerBuffs[PLAYER_BUFF_PRESERVATION].uExpireTime > 0 )
     {
       SetCondUnconsciousWithBlockCheck(false);
@@ -2663,23 +2661,18 @@
   uint      weapon_recovery = base_recovery_times_per_weapon_type[0];
   if (bRangedAttack)
   {
-    if ( !HasItemEquipped(EQUIP_BOW) )
-      goto LABEL_17;
-    weapon = &pInventoryItemList[pEquipment.uBow - 1];
-    weapon_desc = &pItemsTable->pItems[weapon->uItemID];
-    weapon_recovery = base_recovery_times_per_weapon_type[weapon_desc->uSkillType];
-    goto LABEL_17;
-  }
-  else if ( IsUnarmed() == 1 )
-  {
-    if (GetActualSkillLevel(PLAYER_SKILL_UNARMED))
-    {
+    if ( HasItemEquipped(EQUIP_BOW) )
+    {
+      weapon = &pInventoryItemList[pEquipment.uBow - 1];
+      weapon_desc = &pItemsTable->pItems[weapon->uItemID];
+      weapon_recovery = base_recovery_times_per_weapon_type[weapon_desc->uSkillType];
+    }
+  }
+  else if ( IsUnarmed() == 1 && GetActualSkillLevel(PLAYER_SKILL_UNARMED) > 0)
+  {
       weapon_recovery = base_recovery_times_per_weapon_type[1];
-      goto LABEL_17;
-    }
-  }
-
-  if ( HasItemEquipped(EQUIP_MAIN_HAND) )
+  }
+  else if ( HasItemEquipped(EQUIP_MAIN_HAND) )
   {
     weapon = &pInventoryItemList[pEquipment.uMainHand - 1];
     weapon_desc = &pItemsTable->pItems[weapon->uItemID];
@@ -2705,58 +2698,43 @@
     }
   }
 
-LABEL_17:
   uint armour_recovery = 0;
   if ( HasItemEquipped(EQUIP_ARMOUR) )
   {
     auto armour_skill_type = pItemsTable->pItems[pInventoryItemList[pEquipment.uArmor - 1].uItemID].uSkillType;
     uint base_armour_recovery = base_recovery_times_per_weapon_type[armour_skill_type];
-
-    float armour_recovery_multipliers[4];
+    float multiplier;
+
     if (armour_skill_type == PLAYER_SKILL_LEATHER)
     {
-      armour_recovery_multipliers[0] = 1.0f;
-      armour_recovery_multipliers[1] = 0;
-      armour_recovery_multipliers[2] = 0;
-      armour_recovery_multipliers[3] = 0;
+      multiplier = GetArmorRecoveryMultiplierFromSkillLevel(armour_skill_type, 1.0f, 0, 0, 0);
     }
     else if (armour_skill_type == PLAYER_SKILL_CHAIN)
     {
-      armour_recovery_multipliers[0] = 1.0f;
-      armour_recovery_multipliers[1] = 0.5f;
-      armour_recovery_multipliers[2] = 0;
-      armour_recovery_multipliers[3] = 0;
+      multiplier = GetArmorRecoveryMultiplierFromSkillLevel(armour_skill_type, 1.0f, 0.5f, 0, 0);
     }
     else if (armour_skill_type == PLAYER_SKILL_PLATE)
     {
-      armour_recovery_multipliers[0] = 1.0f;
-      armour_recovery_multipliers[1] = 0.5f;
-      armour_recovery_multipliers[2] = 0.5f;
-      armour_recovery_multipliers[3] = 0;
+      multiplier = GetArmorRecoveryMultiplierFromSkillLevel(armour_skill_type, 1.0f, 0.5f, 0.5f, 0);
     }
     else
     {
       Error("Unknown armour type"); // what kind of armour is that?
-      armour_recovery_multipliers[0] = 1.0f;
-      armour_recovery_multipliers[1] = 1.0f;
-      armour_recovery_multipliers[2] = 1.0f;
-      armour_recovery_multipliers[3] = 1.0f;
-    }
-
-    uint skill_mastery = SkillToMastery(pActiveSkills[armour_skill_type]);
-    armour_recovery = base_armour_recovery * armour_recovery_multipliers[skill_mastery - 1];
+      multiplier = GetArmorRecoveryMultiplierFromSkillLevel(armour_skill_type, 1.0f, 1.0f, 1.0f, 1.0f);
+    }
+
+    armour_recovery = (uint)(base_armour_recovery * multiplier);
   }
 
   uint shield_recovery = 0;
   if (HasItemEquipped(EQUIP_OFF_HAND) && GetEquippedItemEquipType(EQUIP_OFF_HAND) == EQUIP_SHIELD)
   {
-    float shield_recovery_multipliers[4] = {1, 0, 0, 0};
-
     auto shield = &pInventoryItemList[pEquipment.uShield - 1];
     auto skill_type = pItemsTable->pItems[shield->uItemID].uSkillType;
 
     uint shield_base_recovery = base_recovery_times_per_weapon_type[skill_type];
-    shield_recovery = shield_base_recovery * SkillToMastery(pActiveSkills[skill_type]);
+    float multiplier = GetArmorRecoveryMultiplierFromSkillLevel(skill_type, 1.0f, 0, 0, 0);
+    shield_recovery = (uint)(shield_base_recovery * multiplier);
   }
 
   uint player_speed_recovery_reduction = GetParameterBonus(GetActualSpeed()),
@@ -2785,9 +2763,9 @@
     }
   }
 
-  uint v41 = 0;
-  if (pPlayerBuffs[PLAYER_BUFF_7].uExpireTime > 0)
-    v41 = 25;
+  uint hasteRecoveryReduction = 0;
+  if (pPlayerBuffs[PLAYER_BUFF_7].uExpireTime > 0 || pParty->pPartyBuffs[PARTY_BUFF_HASTE].uExpireTime > 0 )
+    hasteRecoveryReduction = 25;
 
   uint weapon_enchantment_recovery_reduction = 0;
   if ( weapon  )
@@ -2798,13 +2776,12 @@
       weapon_enchantment_recovery_reduction = 20;
   }
 
-
   int recovery = weapon_recovery +
                  armour_recovery +
                  shield_recovery
                  - armsmaster_recovery_reduction
                  - weapon_enchantment_recovery_reduction
-                 - v41
+                 - hasteRecoveryReduction
                  - sword_axe_bow_recovery_reduction
                  - player_speed_recovery_reduction;
 
@@ -2813,6 +2790,22 @@
   return recovery;
 }
 
+
+//----- new --------------------------------------------------------
+float Player::GetArmorRecoveryMultiplierFromSkillLevel( unsigned char armour_skill_type, float mult1, float mult2, float mult3, float mult4 )
+{
+  uint skill_mastery = SkillToMastery(pActiveSkills[armour_skill_type]);
+  switch (skill_mastery)
+  {
+    case 1: return mult1; break;
+    case 2: return mult2; break;
+    case 3: return mult3; break;
+    case 4: return mult4; break;
+  }
+  Error("Unexpected input value: %d", armour_skill_type);
+  return 0;
+}
+
 //----- (0048E4F8) --------------------------------------------------------
 int Player::GetMaxHealth()
 {
@@ -2825,10 +2818,8 @@
   v6 = uFullHealthBonus
      + pBaseHealthByClass[classType / 4]
      + GetSkillBonus(CHARACTER_ATTRIBUTE_HEALTH)
-     + GetItemsBonus(CHARACTER_ATTRIBUTE_HEALTH, 0) + v4;
-  if (v6 <= 0)
-    return 1;
-  return v6;
+     + GetItemsBonus(CHARACTER_ATTRIBUTE_HEALTH) + v4;
+  return max(1, v6);
 }
 
 //----- (0048E565) --------------------------------------------------------
@@ -2842,7 +2833,6 @@
   int v7; // esi@6
   int v8; // esi@6
   int v9; // esi@6
-  int result; // eax@7
   
   switch (classType)
   {
@@ -2891,7 +2881,7 @@
       break;
   }
   v7 = pBaseManaPerLevelByClass[classType] * (GetActualLevel() + v3);
-  v8 = GetItemsBonus(CHARACTER_ATTRIBUTE_MANA, 0) + v7;
+  v8 = GetItemsBonus(CHARACTER_ATTRIBUTE_MANA) + v7;
   v9 = uFullManaBonus
       + pBaseManaByClass[classType / 4]
   + GetSkillBonus(CHARACTER_ATTRIBUTE_MANA)
@@ -2902,53 +2892,39 @@
 //----- (0048E656) --------------------------------------------------------
 int Player::GetBaseAC()
 {
-  Player *v1; // edi@1
   int v2; // eax@1
   int v3; // esi@1
   int v4; // esi@1
   int v5; // esi@1
-  int result; // eax@2
-
-  v1 = this;
+
   v2 = GetActualSpeed();
   v3 = GetParameterBonus(v2);
-  v4 = GetItemsBonus(CHARACTER_ATTRIBUTE_AC_BONUS, 0) + v3;
+  v4 = GetItemsBonus(CHARACTER_ATTRIBUTE_AC_BONUS) + v3;
   v5 = GetSkillBonus(CHARACTER_ATTRIBUTE_AC_BONUS) + v4;
-  if ( v5 >= 1 )
-    result = v5;
-  else
-    result = 0;
-  return result;
+  return max(0, v5);
 }
 
 //----- (0048E68F) --------------------------------------------------------
 int Player::GetActualAC()
 {
-  Player *v1; // edi@1
   int v2; // eax@1
   int v3; // esi@1
   int v4; // esi@1
   int v5; // esi@1
   int v6; // esi@1
-  int result; // eax@2
-
-  v1 = this;
+
   v2 = GetActualSpeed();
   v3 = GetParameterBonus(v2);
-  v4 = GetItemsBonus(CHARACTER_ATTRIBUTE_AC_BONUS, 0) + v3;
+  v4 = GetItemsBonus(CHARACTER_ATTRIBUTE_AC_BONUS) + v3;
   v5 = GetSkillBonus(CHARACTER_ATTRIBUTE_AC_BONUS) + v4;
-  v6 = v1->sACModifier + GetMagicalBonus(CHARACTER_ATTRIBUTE_AC_BONUS) + v5;
-  if ( v6 >= 1 )
-    result = v6;
-  else
-    result = 0;
-  return result;
+  v6 = this->sACModifier + GetMagicalBonus(CHARACTER_ATTRIBUTE_AC_BONUS) + v5;
+  return max(0, v6);
 }
 
 //----- (0048E6DC) --------------------------------------------------------
 unsigned int Player::GetBaseAge()
 {
-  return ((__int64)(pParty->uTimePlayed * 0.234375) / 60 / 60 / 24) / 7 / 4 / 12 - uBirthYear + game_starting_year;
+  return (unsigned int)(((__int64)(pParty->uTimePlayed * 0.234375) / 60 / 60 / 24) / 7 / 4 / 12 - uBirthYear + game_starting_year);
 }
 
 //----- (0048E72C) --------------------------------------------------------
@@ -2960,155 +2936,100 @@
 //----- (0048E73F) --------------------------------------------------------
 int Player::GetBaseResistance(enum CHARACTER_ATTRIBUTE_TYPE a2)
 {
-  Player *v2; // ebx@1
-  signed int v3; // esi@1
-  enum CHARACTER_RACE v4; // eax@1
-  signed int v5; // edi@8
-  char v6; // zf@9
   int v7; // esi@20
-  int result; // eax@21
-  signed int v9; // [sp-4h] [bp-10h]@11
-
-  v2 = this;
-  v3 = 0;
-  v4 = GetRace();
-  if ( a2 == CHARACTER_ATTRIBUTE_RESIST_FIRE )
-  {
-    v5 = 0;
-    goto LABEL_16;
-  }
-  if ( a2 == CHARACTER_ATTRIBUTE_RESIST_AIR )
-  {
-    v5 = 1;
-LABEL_16:
-    v6 = v4 == 2;
-    goto LABEL_17;
-  }
-  if ( a2 == CHARACTER_ATTRIBUTE_RESIST_WATER )
-  {
-    v6 = v4 == 3;
-    v5 = 2;
-    goto LABEL_17;
-  }
-  if ( a2 == CHARACTER_ATTRIBUTE_RESIST_EARTH )
-  {
-    v5 = 3;
-    v6 = v4 == 3;
-    goto LABEL_17;
-  }
-  if ( a2 == CHARACTER_ATTRIBUTE_RESIST_MIND )
-  {
-    v5 = 7;
-    if ( v4 != 1 )
-      goto LABEL_20;
-    v9 = 10;
-LABEL_19:
-    v3 = v9;
-    goto LABEL_20;
-  }
-  if ( a2 == CHARACTER_ATTRIBUTE_RESIST_BODY || a2 == 33 )
-  {
-    v5 = 8;
-    v6 = v4 == 0;
-LABEL_17:
-    if ( !v6 )
-      goto LABEL_20;
-    v9 = 5;
-    goto LABEL_19;
-  }
-  v5 = 0;
-LABEL_20:
-  v7 = GetItemsBonus(a2, 0) + v3;
-  if ( v2->classType != PLAYER_CLASS_LICH || (result = 200, v7 + *(&v2->sResFireBase + v5) <= 200) )
-    result = v7 + *(&v2->sResFireBase + v5);
-  return result;
+  int racialBonus = 0;
+  __int16* resStat;
+
+  switch (a2)
+  {
+    case CHARACTER_ATTRIBUTE_RESIST_FIRE:
+      resStat = &sResFireBase;
+      if (IsRaceGoblin())
+        racialBonus = 5;
+      break;
+    case CHARACTER_ATTRIBUTE_RESIST_AIR:
+      resStat = &sResAirBase;
+      if (IsRaceGoblin())
+        racialBonus = 5;
+      break;
+    case  CHARACTER_ATTRIBUTE_RESIST_WATER:
+      resStat = &sResWaterBase;
+      if (IsRaceDwarf())
+        racialBonus = 5;
+      break;
+    case CHARACTER_ATTRIBUTE_RESIST_EARTH:
+      resStat = &sResEarthBase;
+      if (IsRaceDwarf())
+        racialBonus = 5;
+    break;
+    case CHARACTER_ATTRIBUTE_RESIST_MIND:
+      resStat = &sResMindBase;
+      if (IsRaceElf())
+        racialBonus = 10;
+      break;
+    case CHARACTER_ATTRIBUTE_RESIST_BODY:
+    case CHARACTER_ATTRIBUTE_RESIST_SPIRIT:
+      resStat = &sResBodyBase;
+      if (IsRaceHuman())
+        racialBonus = 5;
+      break;
+  }
+  v7 = GetItemsBonus(a2) + racialBonus;
+  return v7 + *resStat;
 }
 
 //----- (0048E7D0) --------------------------------------------------------
 int Player::GetActualResistance(enum CHARACTER_ATTRIBUTE_TYPE a2)
 {
-  signed int v2; // edi@1
-  Player *v3; // esi@1
-  enum CHARACTER_RACE v4; // ebx@1
-  char v6; // zf@18
-  int v7; // ebx@28
-  int result; // eax@28
-  signed int v9; // [sp+10h] [bp-8h]@1
-  signed int v10; // [sp+14h] [bp-4h]@1
-
-  v2 = 0;
-  v3 = this;
-  v10 = 0;
-  v9 = 0;
-  v4 = GetRace();
+  signed int v10 = 0; // [sp+14h] [bp-4h]@1
+  __int16* resStat;
+  int result;
+  int baseRes;
+
+  int leatherArmorSkillLevel = GetActualSkillLevel(PLAYER_SKILL_LEATHER);
   if ( CheckHiredNPCSpeciality(Enchanter) )
     v10 = 20;
   if ( (a2 == CHARACTER_ATTRIBUTE_RESIST_FIRE
      || a2 == CHARACTER_ATTRIBUTE_RESIST_AIR
      || a2 == CHARACTER_ATTRIBUTE_RESIST_WATER
      || a2 == CHARACTER_ATTRIBUTE_RESIST_EARTH)
-    && SkillToMastery(v3->pActiveSkills[9]) == 4
+    && SkillToMastery(leatherArmorSkillLevel) == 4
     && HasItemEquipped(EQUIP_ARMOUR)
     && GetEquippedItemSkillType(EQUIP_ARMOUR) == PLAYER_SKILL_LEATHER )
-    v10 += v3->pActiveSkills[9] & 0x3F;
-  if ( a2 == CHARACTER_ATTRIBUTE_RESIST_FIRE )
-    goto LABEL_25;
-  if ( a2 == CHARACTER_ATTRIBUTE_RESIST_AIR )
-  {
-    v2 = 1;
-LABEL_25:
-    v6 = v4 == 2;
-LABEL_26:
-    if ( v6 )
-      v9 = 5;
-    goto LABEL_28;
-  }
-  if ( a2 == CHARACTER_ATTRIBUTE_RESIST_WATER )
-  {
-    v6 = v4 == 3;
-    v2 = 2;
-    goto LABEL_26;
-  }
-  if ( a2 == CHARACTER_ATTRIBUTE_RESIST_EARTH )
-  {
-    v2 = 3;
-    if ( v4 == 3 )
-      v10 += 5;
-  }
-  else
-  {
-    if ( a2 != CHARACTER_ATTRIBUTE_RESIST_MIND )
-    {
-      if ( a2 != CHARACTER_ATTRIBUTE_RESIST_BODY && a2 != 33 )
-        goto LABEL_28;
-      v2 = 8;
-      v6 = v4 == 0;
-      goto LABEL_26;
-    }
-    v2 = 7;
-    if ( v4 == 1 )
-      v9 = 10;
-  }
-LABEL_28:
-  v7 = GetItemsBonus(a2, 0);
-  result = v10 + GetMagicalBonus(a2) + v7 + v9 + *(&v3->sResFireBonus + v2) + *(&v3->sResFireBase + v2);
-  if ( v3->classType == PLAYER_CLASS_LICH )
-  {
-    if ( result > 200 )
-      result = 200;
-  }
+    v10 += leatherArmorSkillLevel & 0x3F;
+  switch (a2)
+  {
+  case CHARACTER_ATTRIBUTE_RESIST_FIRE:
+    resStat = &sResFireBonus;
+    break;
+  case CHARACTER_ATTRIBUTE_RESIST_AIR:
+    resStat = &sResAirBonus;
+    break;
+  case  CHARACTER_ATTRIBUTE_RESIST_WATER:
+    resStat = &sResWaterBonus;
+    break;
+  case CHARACTER_ATTRIBUTE_RESIST_EARTH:
+    resStat = &sResEarthBonus;
+    break;
+  case CHARACTER_ATTRIBUTE_RESIST_MIND:
+    resStat = &sResMindBonus;
+    break;
+  case CHARACTER_ATTRIBUTE_RESIST_BODY:
+  case CHARACTER_ATTRIBUTE_RESIST_SPIRIT:
+    resStat = &sResBodyBonus;
+    break;
+  }
+  baseRes = GetBaseResistance(a2);
+  result = v10 + GetMagicalBonus(a2) + baseRes + *(resStat);
   return result;
 }
 
 //----- (0048E8F5) --------------------------------------------------------
 bool Player::Recover(int dt)
 {
-  //Player *v2; // esi@1
-  signed __int64 v3; // qax@1
-  //bool result; // eax@4
-
-  //v2 = this;
-  v3 = (signed __int64)((double)(dt * _48EA46_calc_special_bonus_by_items(17)) * 0.01 + (double)dt);
+  int v3; // qax@1
+
+  v3 = (int)(dt * GetSpecialItemBonus(17) * 0.01 + dt);
 
   Log::Warning(L"Recover(dt = %u/%u - %u", dt, (uint)v3, (uint)uTimeToRecovery);
 
@@ -3161,866 +3082,312 @@
 
 //----- (0048EA1B) --------------------------------------------------------
 int Player::GetParameterBonus( int player_parameter )
-    {
+{
   int i; // eax@1
   i = 0;
   while (param_to_bonus_table[i])
-      { 
-      if (player_parameter >= param_to_bonus_table[i])
-          break;
-      ++i;    
-      }   
+  { 
+    if (player_parameter >= param_to_bonus_table[i])
+      break;
+    ++i;    
+  }   
   return parameter_to_bonus_value[i];
 }
 
 //----- (0048EA46) --------------------------------------------------------
-int Player::_48EA46_calc_special_bonus_by_items(int a2)
+int Player::GetSpecialItemBonus( int enchantmentId )
 {
   int inv_indx; // eax@3
 
-  for (int i=EQUIP_OFF_HAND; i<EQUIP_BOOK; ++i )
-      {
-      if ( !HasItemEquipped((ITEM_EQUIP_TYPE)i) )
-          continue;
+  for (int i = EQUIP_OFF_HAND; i < EQUIP_BOOK; ++i )
+  {
+    if ( HasItemEquipped((ITEM_EQUIP_TYPE)i) )
+    {
       inv_indx = pEquipment.pIndices[i]  - 1;
-      if (a2==17)
-          {
-          if ((pInventoryItemList[inv_indx].uSpecEnchantmentType==17)||(pInventoryItemList[inv_indx].uItemID==533)) //Elven Chainmail+Increases rate of Recovery
-              return 50;
-          }
-      if (a2==24)
-          {
-          if (pInventoryItemList[inv_indx].uSpecEnchantmentType==24) //Increased Knockback.
-              return 5;
-          }
+      if (enchantmentId == 17)
+      {
+        if ((pInventoryItemList[inv_indx].uSpecEnchantmentType == 17) || (pInventoryItemList[inv_indx].uItemID == 533)) //Elven Chainmail+Increases rate of Recovery
+          return 50;
       }
+      if (enchantmentId == 24) 
+      {
+        if (pInventoryItemList[inv_indx].uSpecEnchantmentType == 24) //Increased Knockback.
+          return 5;
+      }
+    }
+  }
   return 0;
 }
 
 //----- (0048EAAE) --------------------------------------------------------
-int Player::GetItemsBonus(CHARACTER_ATTRIBUTE_TYPE attr, int a3)
-{
-  CHARACTER_ATTRIBUTE_TYPE v3; // esi@1
- // signed int v4; // eax@1
+int Player::GetItemsBonus( enum CHARACTER_ATTRIBUTE_TYPE attr, bool getOnlyMainHandDmg /*= false*/ )
+{
   int v5; // edi@1
-  Player *v6; // ebx@1
-  Player *v8; // ecx@48
   int v9; // eax@49
-  int v10; // edx@49
-  Player *v11; // ecx@55
-  int v12; // eax@56
-  int v13; // edx@56
   int v14; // ecx@58
   int v15; // eax@58
-  Player *v16; // ecx@61
   int v17; // eax@62
-  Player *v18; // ecx@66
-  int v19; // eax@67
   int v20; // eax@69
-  Player *v21; // ecx@75
   int v22; // eax@76
   int v23; // edx@76
-  //int v24; // eax@79
   int v25; // ecx@80
   int v26; // edi@80
-  Player *v27; // ecx@84
-  int v28; // eax@85
-  int v29; // edx@85
-  Player *v30; // ecx@96
   int v31; // ebp@97
   int v32; // eax@98
   unsigned int v33; // eax@100
-  int v34; // eax@103
-  char v35; // zf@104
-  char v36; // zf@107
-  unsigned __int8 v37; // zf@119
-  char v38; // sf@119
-  unsigned __int8 v39; // of@119
-  char v40; // zf@122
-  char v41; // zf@145
-  char v42; // zf@164
-  char v43; // zf@173
-  char v44; // zf@189
-  char v45; // zf@198
-  char v46; // zf@239
-  int v47; // eax@268
-  int v48; // eax@269
-  int v49; // eax@291
-  char v50; // zf@295
-  int v51; // eax@306
-  int v52; // eax@307
-  char v53; // zf@312
-  char v54; // zf@336
-  char v55; // zf@348
   int v56; // eax@365
   int v57; // ebx@368
   signed int v58; // [sp-4h] [bp-20h]@10
-  signed int v59; // [sp-4h] [bp-20h]@71
-  signed int v60; // [sp-4h] [bp-20h]@347
   int v61; // [sp+10h] [bp-Ch]@1
   int v62; // [sp+14h] [bp-8h]@1
-  int v63; // [sp+18h] [bp-4h]@101
-  ItemGen *attra; // [sp+20h] [bp+4h]@101
-  unsigned int v65; // [sp+24h] [bp+8h]@95
+  ItemGen *currEquippedItem; // [sp+20h] [bp+4h]@101
   bool no_skills;
 
-  v3 = attr;
   v5 = 0;
-  v6 = this;
   v62 = 0;
   v61 = 0;
-
   
   no_skills=false;
   switch (attr)
+  {
+    case  CHARACTER_ATTRIBUTE_SKILL_ALCHEMY:      v58 = PLAYER_SKILL_ALCHEMY;      break;
+    case  CHARACTER_ATTRIBUTE_SKILL_STEALING:     v58 = PLAYER_SKILL_STEALING;     break;
+    case  CHARACTER_ATTRIBUTE_SKILL_TRAP_DISARM:  v58 = PLAYER_SKILL_TRAP_DISARM;  break;
+    case  CHARACTER_ATTRIBUTE_SKILL_ITEM_ID:      v58 = PLAYER_SKILL_ITEM_ID;      break;
+    case  CHARACTER_ATTRIBUTE_SKILL_MONSTER_ID:   v58 = PLAYER_SKILL_MONSTER_ID;   break;
+    case  CHARACTER_ATTRIBUTE_SKILL_ARMSMASTER:   v58 = PLAYER_SKILL_ARMSMASTER;   break;
+    case  CHARACTER_ATTRIBUTE_SKILL_DODGE:        v58 = PLAYER_SKILL_DODGE;        break;
+    case  CHARACTER_ATTRIBUTE_SKILL_UNARMED:      v58 = PLAYER_SKILL_UNARMED;      break;
+    case  CHARACTER_ATTRIBUTE_SKILL_FIRE:         v58 = PLAYER_SKILL_FIRE;         break;
+    case  CHARACTER_ATTRIBUTE_SKILL_AIR:          v58 = PLAYER_SKILL_AIR;          break;
+    case  CHARACTER_ATTRIBUTE_SKILL_WATER:        v58 = PLAYER_SKILL_WATER;        break;
+    case  CHARACTER_ATTRIBUTE_SKILL_EARTH:        v58 = PLAYER_SKILL_EARTH;        break;
+    case  CHARACTER_ATTRIBUTE_SKILL_SPIRIT:       v58 = PLAYER_SKILL_SPIRIT;       break;
+    case  CHARACTER_ATTRIBUTE_SKILL_MIND:         v58 = PLAYER_SKILL_MIND;         break;
+    case  CHARACTER_ATTRIBUTE_SKILL_BODY:         v58 = PLAYER_SKILL_BODY;         break;
+    case  CHARACTER_ATTRIBUTE_SKILL_LIGHT:        v58 = PLAYER_SKILL_LIGHT;        break;
+    case  CHARACTER_ATTRIBUTE_SKILL_DARK:         v58 = PLAYER_SKILL_DARK;         break;
+    case  CHARACTER_ATTRIBUTE_SKILL_MEDITATION:   v58 = PLAYER_SKILL_MEDITATION;   break;
+    case  CHARACTER_ATTRIBUTE_SKILL_BOW:          v58 = PLAYER_SKILL_BOW;          break;
+    case  CHARACTER_ATTRIBUTE_SKILL_SHIELD:       v58 = PLAYER_SKILL_SHIELD;       break;
+    case  CHARACTER_ATTRIBUTE_SKILL_LEARNING:     v58 = PLAYER_SKILL_LEARNING;     break;
+    default:
+      no_skills=true;
+  }
+  if (!no_skills)
+  {
+    if ( !this->pActiveSkills[v58] )
+      return 0;
+  }
+
+  switch(attr)      //TODO would be nice to move these into separate functions
+  {
+    case CHARACTER_ATTRIBUTE_RANGED_DMG_BONUS:
+    case CHARACTER_ATTRIBUTE_RANGED_ATTACK:
+      if ( HasItemEquipped(EQUIP_BOW) )
+        v5 = pItemsTable->pItems[this->pOwnItems[this->pEquipment.uBow-1].uItemID].uDamageMod;
+      return v5;
+      break;
+
+    case CHARACTER_ATTRIBUTE_RANGED_DMG_MIN:
+      if ( !HasItemEquipped(EQUIP_BOW) )
+        return 0;
+      v57 = this->pOwnItems[this->pEquipment.uBow-1].uItemID;
+      v5 = pItemsTable->pItems[v57].uDamageMod;
+      v56 = pItemsTable->pItems[v57].uDamageDice;
+      return v5 + v56;
+      break;
+
+    case CHARACTER_ATTRIBUTE_RANGED_DMG_MAX:
+      if ( !HasItemEquipped(EQUIP_BOW) )
+        return 0;
+      v20 = this->pOwnItems[this->pEquipment.uBow-1].uItemID;
+      v5 = pItemsTable->pItems[v20].uDamageDice * pItemsTable->pItems[v20].uDamageRoll;
+      v56 = pItemsTable->pItems[v20].uDamageMod;
+      return v5 + v56;
+
+    case CHARACTER_ATTRIBUTE_LEVEL: 
+      if ( !Player::HasEnchantedItemEquipped(25) )
+        return 0;
+      return 5;
+      break;
+
+    case CHARACTER_ATTRIBUTE_MELEE_DMG_MAX:
+      if ( IsUnarmed() )
       {
-  case  CHARACTER_ATTRIBUTE_SKILL_ALCHEMY:      v58 = PLAYER_SKILL_ALCHEMY;      break;
-  case  CHARACTER_ATTRIBUTE_SKILL_STEALING:     v58 = PLAYER_SKILL_STEALING;     break;
-  case  CHARACTER_ATTRIBUTE_SKILL_TRAP_DISARM:  v58 = PLAYER_SKILL_TRAP_DISARM;  break;
-  case  CHARACTER_ATTRIBUTE_SKILL_ITEM_ID:      v58 = PLAYER_SKILL_ITEM_ID;      break;
-  case  CHARACTER_ATTRIBUTE_SKILL_MONSTER_ID:   v58 = PLAYER_SKILL_MONSTER_ID;   break;
-  case  CHARACTER_ATTRIBUTE_SKILL_ARMSMASTER:   v58 = PLAYER_SKILL_ARMSMASTER;   break;
-  case  CHARACTER_ATTRIBUTE_SKILL_DODGE:        v58 = PLAYER_SKILL_DODGE;        break;
-  case  CHARACTER_ATTRIBUTE_SKILL_UNARMED:      v58 = PLAYER_SKILL_UNARMED;      break;
-  case  CHARACTER_ATTRIBUTE_SKILL_FIRE:         v58 = PLAYER_SKILL_FIRE;         break;
-  case  CHARACTER_ATTRIBUTE_SKILL_AIR:          v58 = PLAYER_SKILL_AIR;          break;
-  case  CHARACTER_ATTRIBUTE_SKILL_WATER:        v58 = PLAYER_SKILL_WATER;        break;
-  case  CHARACTER_ATTRIBUTE_SKILL_EARTH:        v58 = PLAYER_SKILL_EARTH;        break;
-  case  CHARACTER_ATTRIBUTE_SKILL_SPIRIT:       v58 = PLAYER_SKILL_SPIRIT;       break;
-  case  CHARACTER_ATTRIBUTE_SKILL_MIND:         v58 = PLAYER_SKILL_MIND;         break;
-  case  CHARACTER_ATTRIBUTE_SKILL_BODY:         v58 = PLAYER_SKILL_BODY;         break;
-  case  CHARACTER_ATTRIBUTE_SKILL_LIGHT:        v58 = PLAYER_SKILL_LIGHT;        break;
-  case  CHARACTER_ATTRIBUTE_SKILL_DARK:         v58 = PLAYER_SKILL_DARK;         break;
-  case  CHARACTER_ATTRIBUTE_SKILL_MEDITATION:   v58 = PLAYER_SKILL_MEDITATION;   break;
-  case  CHARACTER_ATTRIBUTE_SKILL_BOW:          v58 = PLAYER_SKILL_BOW;          break;
-  case  CHARACTER_ATTRIBUTE_SKILL_SHIELD:       v58 = PLAYER_SKILL_SHIELD;       break;
-  case  CHARACTER_ATTRIBUTE_SKILL_LEARNING:     v58 = PLAYER_SKILL_LEARNING;     break;
-  default:
-      no_skills=true;
+        return 3;
       }
-  if (!no_skills)
+      else
       {
-      if ( !this->pActiveSkills[v58] )
+        if ( this->HasItemEquipped(EQUIP_MAIN_HAND) )
+        {
+          v22 = this->GetEquippedItemEquipType(EQUIP_MAIN_HAND);
+          if ( v22 >= 0 && v22 <= 2)
+          {
+            v23 = this->pOwnItems[this->pEquipment.uMainHand].uItemID;
+            v26 = pItemsTable->pItems[v23].uDamageRoll;
+            if ( this->pEquipment.uShield || pItemsTable->pItems[v23].uSkillType != 4 )
+            {
+              v25 = pItemsTable->pItems[v23].uDamageDice;
+            }
+            else
+            {
+              v25 = pItemsTable->pItems[v23].uDamageDice + 1;
+            }
+            v5 = pItemsTable->pItems[v23].uDamageMod + v25 * v26;
+          }
+        }
+        if ( getOnlyMainHandDmg || !this->HasItemEquipped(EQUIP_OFF_HAND) ||  (GetEquippedItemEquipType(EQUIP_OFF_HAND) < 0 && GetEquippedItemEquipType(EQUIP_OFF_HAND) > 2))
+        {
+            return v5;
+        }
+        else
+        {
+          v23 = this->pOwnItems[this->pEquipment.uShield].uItemID;
+          v15 = pItemsTable->pItems[v23].uDamageMod;
+          v14 = pItemsTable->pItems[v23].uDamageDice * pItemsTable->pItems[v23].uDamageRoll;
+          return v5 + v15 + v14;
+        }
+      }
+    break;
+
+    case CHARACTER_ATTRIBUTE_MELEE_DMG_BONUS:
+    case CHARACTER_ATTRIBUTE_ATTACK:
+      if ( IsUnarmed() )
+      {
         return 0;
       }
-
-  if ( (signed int)attr > 28 )
-  {
-    if ( (signed int)attr < 29 )
-      return v5 + v62 + v61;
-    if ( (signed int)attr <= CHARACTER_ATTRIBUTE_RANGED_DMG_BONUS )
-    {
-      if ( HasItemEquipped(EQUIP_BOW) )
-        v5 = pItemsTable->pItems[v6->pOwnItems[v6->pEquipment.uBow-1].uItemID].uDamageMod;
-      return v5 + v62 + v61;
-    }
-    if ( attr == CHARACTER_ATTRIBUTE_RANGED_DMG_MIN )
-    {
-      if ( !HasItemEquipped(EQUIP_BOW) )
-        return v5 + v62 + v61;
-      v57 = v6->pOwnItems[v6->pEquipment.uBow-1].uItemID;
-      v5 = pItemsTable->pItems[v57].uDamageMod;
-      v56 = pItemsTable->pItems[v57].uDamageDice;
-      v5 += v56;
-      return v5 + v62 + v61;
-    }
-    if ( attr == CHARACTER_ATTRIBUTE_RANGED_DMG_MAX )
-    {
-      if ( !HasItemEquipped(EQUIP_BOW) )
-        return v5 + v62 + v61;
-      v20 = v6->pOwnItems[v6->pEquipment.uBow-1].uItemID;
-      v5 = pItemsTable->pItems[v20].uDamageDice * pItemsTable->pItems[v20].uDamageRoll;
-LABEL_365:
-      v56 = pItemsTable->pItems[v20].uDamageMod;
-LABEL_366:
-      v5 += v56;
-      return v5 + v62 + v61;
-    }
-    if ( (signed int)attr <= 33 || (signed int)attr > 46 )
-      return v5 + v62 + v61;
-LABEL_95:
-    v65 = 0;
-    while ( 1 )
-    {
-      if ( !HasItemEquipped((ITEM_EQUIP_TYPE)v65) )
-        goto LABEL_361;
-      v31 = *(&v6->pEquipment.uShield + v65) - 1;
-      if ( v3 == 9 )
+      if ( this->HasItemEquipped(EQUIP_MAIN_HAND) )
+      {
+        v17 = this->GetEquippedItemEquipType(EQUIP_MAIN_HAND);
+        if ( v17 >= 0 && v17 <= 2)
+        {
+          v5 = pItemsTable->pItems[this->pOwnItems[this->pEquipment.uMainHand-1].uItemID].uDamageMod;
+        }
+      }
+      if ( getOnlyMainHandDmg || !this->HasItemEquipped(EQUIP_OFF_HAND) || (this->GetEquippedItemEquipType(EQUIP_OFF_HAND) < 0) || this->GetEquippedItemEquipType(EQUIP_OFF_HAND) > 2 )
+        return v5;
+      else
       {
-        v32 = GetEquippedItemEquipType((ITEM_EQUIP_TYPE)v65);
-        if ( v32 >= 3 )
+        v20 = this->pOwnItems[this->pEquipment.uShield - 1].uItemID;
+        v56 = pItemsTable->pItems[v20].uDamageMod;
+        return v5 + v56;
+      }
+      break;
+
+    case CHARACTER_ATTRIBUTE_MELEE_DMG_MIN:
+      if ( IsUnarmed() )
+      {
+        return 1;
+      }
+      if ( this->HasItemEquipped(EQUIP_MAIN_HAND) )
+      {
+        v9 = this->GetEquippedItemEquipType(EQUIP_MAIN_HAND);
+        if ( v9 >= 0 && v9 <= 2)
         {
-          if ( v32 <= 11 )
+          v5 = pItemsTable->pItems[this->pOwnItems[this->pEquipment.uMainHand].uItemID].uDamageDice +
+            pItemsTable->pItems[this->pOwnItems[this->pEquipment.uMainHand].uItemID].uDamageMod;
+          if ( !this->pEquipment.uShield && pItemsTable->pItems[this->pOwnItems[this->pEquipment.uMainHand].uItemID].uSkillType == 4)
           {
-            v33 = v6->pInventoryItemList[v31].uItemID;
-            v5 += pItemsTable->pItems[v33].uDamageDice + pItemsTable->pItems[v33].uDamageMod;
+            ++v5;
           }
         }
       }
-      v63 = (int)((char *)v6 + 36 * v31);
-      attra = (ItemGen *)(v63 + 532);
-      if ( pItemsTable->IsMaterialNonCommon((ItemGen *)(v63 + 532)) == 1
-        && !pItemsTable->IsMaterialSpecial(attra) )
+
+      if ( getOnlyMainHandDmg || !this->HasItemEquipped(EQUIP_OFF_HAND) || (this->GetEquippedItemEquipType(EQUIP_OFF_HAND) < 0) || this->GetEquippedItemEquipType(EQUIP_OFF_HAND) > 2 )
       {
-        v34 = attra->uItemID;
-        switch ( attra->uItemID )
-        {
-          case 0x1F4u:
-            v35 = v3 == 5;
-            goto LABEL_105;
-          case 0x1F5u:
-            v36 = v3 == 0;
-            goto LABEL_108;
-          case 0x1F6u:
-            if ( v3 == 21 )
-              v61 += 10;
-            v36 = v3 == 2;
-            goto LABEL_108;
-          case 0x1F7u:
-            if ( v3 == 17 )
-              v61 += 5;
-            if ( v3 == 18 )
-              v61 += 5;
-            v36 = v3 == 6;
-            goto LABEL_108;
-          case 0x1F8u:
-            goto LABEL_118;
-          case 0x1F9u:
-            v40 = v3 == 3;
-            goto LABEL_123;
-          case 0x1FAu:
-            v35 = v3 == 10;
-            goto LABEL_105;
-          case 0x1FEu:
-            v35 = v3 == 4;
-            goto LABEL_105;
-          case 0x1FFu:
-            if ( v3 == 23 )
-              v61 += 10;
-            if ( v3 == 22 )
-              v61 += 10;
-            goto LABEL_361;
-          case 0x200u:
-            if ( v3 == 36 )
-            {
-              LOBYTE(v34) = LOBYTE(v6->pActiveSkills[14]);
-              v62 = ((unsigned int)v34 >> 1) & 0x1F;
-            }
-            v36 = v3 == 5;
-LABEL_108:
-            if ( v36 )
-              v5 += 40;
-            goto LABEL_361;
-          case 0x201u:
-            if ( v3 == 39 )
-            {
-              LOBYTE(v34) = LOBYTE(v6->pActiveSkills[17]);
-              v34 = ((unsigned int)v34 >> 1) & 0x1F;
-              v62 = v34;
-            }
-            goto LABEL_136;
-          case 0x202u:
-            if ( !v3 )
-              v5 += 150;
-            if ( v3 == 1 )
-              v5 -= 40;
-            if ( v3 == 2 )
-              v5 -= 40;
-            goto LABEL_145;
-          case 0x203u:
-            if ( v3 == 42 )
-            {
-              LOBYTE(v34) = LOBYTE(v6->pActiveSkills[20]);
-              v62 = ((unsigned int)v34 >> 1) & 0x1F;
-            }
-            if ( v3 == 43 )
-              v61 += 15;
-            goto LABEL_361;
-          case 0x204u:
-            if ( v3 == 17 )
-              v61 += 5;
-            if ( v3 == 18 )
-              v61 += 5;
-            if ( v3 == 6 )
-              v5 += 50;
-            if ( v3 == 11 || v3 == 10 || v3 == 12 || v3 == 13 || v3 == 33 || v3 == 14 )
-              goto LABEL_166;
-            v42 = v3 == 15;
-            goto LABEL_165;
-          case 0x205u:
-            if ( v3 == 18 )
-              v61 += 5;
-            goto LABEL_361;
-          case 0x206u:
-            if ( !v3 )
-              v5 += 100;
-            if ( v3 == 3 )
-              v5 += 100;
-            v43 = v3 == 9;
-            goto LABEL_174;
-          case 0x207u:
-            if ( v3 == 45 )
-              v61 += 5;
-            if ( v3 == 15 )
-              v5 -= 10;
-            v42 = v3 == 14;
-LABEL_165:
-            if ( v42 )
-LABEL_166:
-              v5 -= 10;
-            goto LABEL_361;
-          case 0x208u:
-            v35 = v3 == 3;
-            goto LABEL_105;
-          case 0x209u:
-            if ( v3 == 2 )
-              v5 += 15;
-            if ( !v3 )
-              v5 += 15;
-            v41 = v3 == 6;
-            goto LABEL_146;
-          case 0x20Au:
-            if ( v3 == 46 )
-              v61 += 15;
-            v44 = v3 == 3;
-            goto LABEL_190;
-          case 0x20Bu:
-            if ( v3 == 34 )
-            {
-              LOBYTE(v34) = LOBYTE(v6->pActiveSkills[12]);
-              v62 = ((unsigned int)v34 >> 1) & 0x1F;
-            }
-            if ( v3 == 12 )
-              v5 += 50;
-            if ( v3 == 2 )
-              v5 += 30;
-            v45 = v3 == 9;
-            goto LABEL_199;
-          case 0x20Cu:
-            if ( !v3 )
-              v5 += 75;
-            goto LABEL_145;
-          case 0x20Du:
-            if ( v3 == 5 )
-              v5 += 50;
-            if ( v3 == 6 )
-              v5 += 50;
-            if ( v3 == 11 || v3 == 10 || v3 == 12 || v3 == 13 || v3 == 33 || v3 == 14 )
-              goto LABEL_374;
-            v43 = v3 == 15;
-LABEL_174:
-            if ( v43 )
-LABEL_374:
-              v5 -= 15;
-            goto LABEL_361;
-          case 0x20Eu:
-            if ( v3 == 4 )
-              v5 += 150;
-            if ( v3 == 44 )
-              v61 += 5;
-            if ( v3 == 9 )
-              v5 -= 25;
-            goto LABEL_361;
-          case 0x20Fu:
-            if ( v3 == 39 )
-            {
-              LOBYTE(v34) = LOBYTE(v6->pActiveSkills[17]);
-              v34 = ((unsigned int)v34 >> 1) & 0x1F;
-              v62 = v34;
-            }
-            if ( v3 == 40 )
-            {
-              LOBYTE(v34) = LOBYTE(v6->pActiveSkills[18]);
-              v62 = ((unsigned int)v34 >> 1) & 0x1F;
-            }
-LABEL_145:
-            v41 = v3 == 5;
-LABEL_146:
-            if ( v41 )
-              v5 -= 40;
-            goto LABEL_361;
-          case 0x210u:
-            if ( v3 == 38 )
-            {
-              LOBYTE(v34) = LOBYTE(v6->pActiveSkills[16]);
-              v62 = ((unsigned int)v34 >> 1) & 0x1F;
-            }
-            if ( !v3 )
-              v5 += 75;
-            v44 = v3 == 11;
-LABEL_190:
-            if ( v44 )
-              v5 -= 50;
-            goto LABEL_361;
-          case 0x211u:
-            if ( v3 == 5 )
-              v5 += 100;
-            if ( v3 == 4 )
-              v5 += 50;
-            v35 = v3 == 11;
-LABEL_105:
-            if ( v35 )
-              v5 += 50;
-            goto LABEL_361;
-          case 0x212u:
-            if ( v3 == 1 )
-              v5 -= 20;
-            v45 = v3 == 2;
-LABEL_199:
-            if ( v45 )
-              v5 -= 20;
-            goto LABEL_361;
-          case 0x214u:
-            if ( v3 == 1 )
-              v5 += 15;
-            v46 = v3 == 2;
-            goto LABEL_240;
-          case 0x215u:
-            if ( v3 == 5 )
-              v5 += 15;
-            v46 = v3 == 4;
-            goto LABEL_240;
-          case 0x216u:
-            if ( v3 == 10 )
-              v5 += 30;
-            if ( !v3 )
-              v5 += 15;
-            goto LABEL_315;
-          case 0x217u:
-            if ( v3 == 21 )
-              v61 += 5;
-            if ( !v3 )
-              v5 += 15;
-            goto LABEL_253;
-          case 0x218u:
-            goto LABEL_253;
-          default:
-            goto LABEL_361;
-        }
-        goto LABEL_361;
-      }
-      if ( *(int *)(v63 + 536) == v3 + 1 )
-      {
-        if ( (signed int)v3 >= 0 )
-        {
-          if ( (signed int)v3 <= 15 )
-          {
-            v5 += *((int *)v6->pConditions + 9 * v31 + 135);
-          }
-          else
-          {
-            if ( (signed int)v3 <= 23 && v5 < *((int *)v6->pConditions + 9 * v31 + 135) )
-              v5 = *((int *)v6->pConditions + 9 * v31 + 135);
-          }
-        }
-        goto LABEL_361;
-      }
-      v34 = *(int *)(v63 + 544);
-      if ( v34 > 48 )
-      {
-        switch ( v34 )
-        {
-          case 54:
-            goto LABEL_315;
-          case 49:
-            if ( v3 == 6 )
-              goto LABEL_121;
-            v50 = v3 == 1;
-            goto LABEL_296;
-          case 51:
-            if ( v3 != 5 && v3 != 1 )
-              goto LABEL_309;
-            goto LABEL_121;
-          case 52:
-            if ( v3 == 3 )
-              goto LABEL_121;
-            v50 = v3 == 4;
-            goto LABEL_296;
-          case 53:
-            if ( !v3 )
-              goto LABEL_121;
-            v50 = v3 == 2;
-            goto LABEL_296;
-          case 55:
-            v46 = v3 == 6;
-            goto LABEL_240;
-          case 56:
-            if ( !v3 )
-              goto LABEL_351;
-            v53 = v3 == 3;
-            goto LABEL_350;
-          case 57:
-            if ( v3 == 1 )
-              goto LABEL_351;
-            v53 = v3 == 2;
-            goto LABEL_350;
-          case 50:
-            if ( v3 == 10 )
-              v5 += 30;
-            goto LABEL_361;
-          case 60:
-            if ( v3 != 23 )
-              goto LABEL_336;
-            if ( v5 >= 3 )
-              goto LABEL_361;
-            v5 = 3;
-LABEL_336:
-            v54 = v3 == 22;
-            goto LABEL_345;
-          case 61:
-            if ( v3 != 17 )
-              goto LABEL_340;
-            if ( v5 >= 3 )
-              goto LABEL_361;
-            v5 = 3;
-LABEL_340:
-            v54 = v3 == 18;
-            goto LABEL_345;
-          case 62:
-            if ( v3 != 19 )
-              goto LABEL_344;
-            if ( v5 >= 3 )
-              goto LABEL_361;
-            v5 = 3;
-LABEL_344:
-            v54 = v3 == 20;
-LABEL_345:
-            if ( !v54 )
-              goto LABEL_361;
-            if ( v5 >= 3 )
-              goto LABEL_361;
-            v60 = 3;
-            goto LABEL_360;
-          case 67:
-            v55 = v3 == 18;
-            goto LABEL_357;
-          case 68:
-            v53 = v3 == 9;
-            goto LABEL_350;
-          case 69:
-            if ( v3 == 11 )
-              v5 += 20;
-            break;
-          case 70:
-            if ( v3 == 12 )
-              v5 += 10;
-            v55 = v3 == 16;
-LABEL_357:
-            if ( v55 && v5 < 2 )
-            {
-              v60 = 2;
-LABEL_360:
-              v5 = v60;
-            }
-            break;
-          default:
-            goto LABEL_361;
-        }
-        goto LABEL_361;
-      }
-      if ( v34 == 48 )
-      {
-        if ( v3 == 9 )
-          v5 += 5;
-LABEL_315:
-        v46 = v3 == 3;
-LABEL_240:
-        if ( v46 )
-          v5 += 15;
-        goto LABEL_361;
-      }
-      if ( v34 > 32 )
-      {
-        if ( v34 > 44 )
-        {
-          v51 = v34 - 45;
-          if ( !v51 )
-          {
-            if ( v3 == 5 )
-              goto LABEL_351;
-            v53 = v3 == 4;
-LABEL_350:
-            if ( v53 )
-LABEL_351:
-              v5 += 5;
-            goto LABEL_361;
-          }
-          v52 = v51 - 1;
-          if ( !v52 )
-          {
-            v40 = v3 == 0;
-LABEL_123:
-            if ( v40 )
-              v5 += 25;
-            goto LABEL_361;
-          }
-          if ( v52 == 1 )
-          {
-LABEL_309:
-            v50 = v3 == 8;
-            goto LABEL_296;
-          }
-        }
-        else
-        {
-          if ( v34 == 44 )
-          {
-            v50 = v3 == 7;
-            goto LABEL_296;
-          }
-          v34 -= 33;
-          if ( !v34 )
-          {
-            if ( v3 != 38 )
-              goto LABEL_361;
-            LOBYTE(v34) = LOBYTE(v6->pActiveSkills[16]);
-            goto LABEL_138;
-          }
-          --v34;
-          if ( !v34 )
-          {
-            if ( v3 != 36 )
-              goto LABEL_361;
-            LOBYTE(v34) = LOBYTE(v6->pActiveSkills[14]);
-            goto LABEL_138;
-          }
-          v49 = v34 - 8;
-          if ( !v49 )
-          {
-            if ( (signed int)v3 >= 0 && (signed int)v3 <= 15 )
-              ++v5;
-            goto LABEL_361;
-          }
-          if ( v49 == 1 )
-          {
-            if ( v3 != 3 && v3 != 7 )
-            {
-              v50 = v3 == 9;
-LABEL_296:
-              if ( !v50 )
-                goto LABEL_361;
-            }
-LABEL_121:
-            v5 += 10;
-            goto LABEL_361;
-          }
-        }
+        return v5;
       }
       else
       {
-        if ( v34 == 32 )
+        v14 = pItemsTable->pItems[this->pOwnItems[this->pEquipment.uShield].uItemID].uDamageMod;
+        v15 = pItemsTable->pItems[this->pOwnItems[this->pEquipment.uShield].uItemID].uDamageDice;
+        return v5 + v15 + v14;
+      }
+      break;
+
+    case   CHARACTER_ATTRIBUTE_STRENGTH:
+    case   CHARACTER_ATTRIBUTE_INTELLIGENCE:
+    case   CHARACTER_ATTRIBUTE_WILLPOWER:
+    case   CHARACTER_ATTRIBUTE_ENDURANCE:
+    case   CHARACTER_ATTRIBUTE_ACCURACY:
+    case   CHARACTER_ATTRIBUTE_SPEED:
+    case   CHARACTER_ATTRIBUTE_LUCK:
+    case   CHARACTER_ATTRIBUTE_HEALTH:
+    case   CHARACTER_ATTRIBUTE_MANA:
+    case   CHARACTER_ATTRIBUTE_AC_BONUS:
+
+    case   CHARACTER_ATTRIBUTE_RESIST_FIRE:
+    case   CHARACTER_ATTRIBUTE_RESIST_AIR:
+    case   CHARACTER_ATTRIBUTE_RESIST_WATER:
+    case   CHARACTER_ATTRIBUTE_RESIST_EARTH:
+    case   CHARACTER_ATTRIBUTE_RESIST_MIND:
+    case   CHARACTER_ATTRIBUTE_RESIST_BODY:        
+    case   CHARACTER_ATTRIBUTE_RESIST_SPIRIT:
+
+    case   CHARACTER_ATTRIBUTE_SKILL_ALCHEMY:
+    case   CHARACTER_ATTRIBUTE_SKILL_STEALING:
+    case   CHARACTER_ATTRIBUTE_SKILL_TRAP_DISARM:
+    case   CHARACTER_ATTRIBUTE_SKILL_ITEM_ID:
+    case   CHARACTER_ATTRIBUTE_SKILL_MONSTER_ID:
+    case   CHARACTER_ATTRIBUTE_SKILL_ARMSMASTER:
+    case   CHARACTER_ATTRIBUTE_SKILL_DODGE:
+    case   CHARACTER_ATTRIBUTE_SKILL_UNARMED:
+
+    case   CHARACTER_ATTRIBUTE_SKILL_FIRE:
+    case   CHARACTER_ATTRIBUTE_SKILL_AIR:
+    case   CHARACTER_ATTRIBUTE_SKILL_WATER:
+    case   CHARACTER_ATTRIBUTE_SKILL_EARTH:
+    case   CHARACTER_ATTRIBUTE_SKILL_SPIRIT:
+    case   CHARACTER_ATTRIBUTE_SKILL_MIND:
+    case   CHARACTER_ATTRIBUTE_SKILL_BODY:
+    case   CHARACTER_ATTRIBUTE_SKILL_LIGHT:
+    case   CHARACTER_ATTRIBUTE_SKILL_DARK:
+    case   CHARACTER_ATTRIBUTE_SKILL_MEDITATION:
+    case   CHARACTER_ATTRIBUTE_SKILL_BOW:
+    case   CHARACTER_ATTRIBUTE_SKILL_SHIELD:
+    case   CHARACTER_ATTRIBUTE_SKILL_LEARNING:
+      for (int i = 0; i < 16; i++)
+      {
+        if ( HasItemEquipped((ITEM_EQUIP_TYPE)i) )
         {
-          if ( v3 != 39 )
-            goto LABEL_361;
-          LOBYTE(v34) = LOBYTE(v6->pActiveSkills[17]);
-          goto LABEL_138;
-        }
-        if ( v34 > 28 )
-        {
-          v34 -= 29;
-          if ( v34 )
+          v31 = this->pEquipment.pIndices[i] - 1;
+          currEquippedItem = &this->pInventoryItemList[v31];
+          if ( attr == CHARACTER_ATTRIBUTE_AC_BONUS )
           {
-            --v34;
-            if ( v34 )
+            v32 = GetEquippedItemEquipType((ITEM_EQUIP_TYPE)i);
+            if ( v32 >= 3 && v32 <= 11 )
             {
-              --v34;
-              if ( v34 || v3 != 41 )
-                goto LABEL_361;
-              LOBYTE(v34) = LOBYTE(v6->pActiveSkills[19]);
+              v33 = currEquippedItem->uItemID;
+              v5 += pItemsTable->pItems[v33].uDamageDice + pItemsTable->pItems[v33].uDamageMod;
             }
-            else
+          }
+          if ( pItemsTable->IsMaterialNonCommon((ItemGen *)(currEquippedItem))
+            && !pItemsTable->IsMaterialSpecial(currEquippedItem) )
+          {
+            currEquippedItem->GetItemBonusArtifact(this, attr, &v62);
+          }
+          else if ( currEquippedItem->uEnchantmentType != 0 )
+          {
+            if (currEquippedItem->IsRegularEnchanmentForAttribute(attr))
             {
-              if ( v3 != 34 )
-                goto LABEL_361;
-              LOBYTE(v34) = LOBYTE(v6->pActiveSkills[12]);
+              if ( attr > CHARACTER_ATTRIBUTE_RESIST_BODY && v5 < currEquippedItem->m_enchantmentStrength )
+                v5 = currEquippedItem->m_enchantmentStrength;
+              else
+                v5 += currEquippedItem->m_enchantmentStrength;
             }
           }
           else
           {
-            if ( v3 != 37 )
-              goto LABEL_361;
-            LOBYTE(v34) = LOBYTE(v6->pActiveSkills[15]);
-          }
-          goto LABEL_138;
-        }
-        if ( v34 == 28 )
-        {
-LABEL_136:
-          if ( v3 == 42 )
-          {
-            LOBYTE(v34) = LOBYTE(v6->pActiveSkills[20]);
-LABEL_138:
-            v62 = ((unsigned int)v34 >> 1) & 0x1F;
-            goto LABEL_361;
-          }
-        }
-        else
-        {
-          v47 = v34 - 1;
-          if ( v47 )
-          {
-            v48 = v47 - 1;
-            if ( v48 )
-            {
-              v34 = v48 - 24;
-              if ( v34 )
-              {
-                --v34;
-                if ( v34 || v3 != 40 )
-                  goto LABEL_361;
-                LOBYTE(v34) = LOBYTE(v6->pActiveSkills[18]);
-              }
-              else
-              {
-                if ( v3 != 35 )
-                  goto LABEL_361;
-                LOBYTE(v34) = LOBYTE(v6->pActiveSkills[13]);
-              }
-              goto LABEL_138;
-            }
-LABEL_118:
-            if ( (signed int)v3 < 0 )
-              goto LABEL_361;
-            v39 = __OFSUB__((int)v3, 6);
-            v37 = v3 == 6;
-            v38 = v3 - 6 < 0;
-          }
-          else
-          {
-LABEL_253:
-            if ( (signed int)v3 < 10 )
-              goto LABEL_361;
-            v39 = __OFSUB__((int)v3, 15);
-            v37 = v3 == 15;
-            v38 = v3 - 15 < 0;
-          }
-          if ( (unsigned __int8)(v38 ^ v39) | v37 )
-            goto LABEL_121;
-        }
-      }
-LABEL_361:
-      ++v65;
-      if ( (signed int)v65 >= 16 )
-        return v5 + v62 + v61;
-    }
-  }
-  if ( attr == CHARACTER_ATTRIBUTE_MELEE_DMG_MAX )
-  {
-    if ( IsUnarmed() != 1 )
-    {
-      if ( v6->HasItemEquipped(EQUIP_MAIN_HAND) )
-      {
-        v22 = this->GetEquippedItemEquipType(EQUIP_MAIN_HAND);
-        if ( v22 >= 0 )
-        {
-          if ( v22 <= 2 )
-          {
-			  v23 = this->pOwnItems[this->pEquipment.uMainHand].uItemID;
-            if ( v6->pEquipment.uShield || pItemsTable->pItems[v23].uSkillType != 4 )
-            {
-              v26 = pItemsTable->pItems[v23].uDamageRoll;
-              v25 = pItemsTable->pItems[v23].uDamageDice;
-            }
-            else
-            {
-              v25 = pItemsTable->pItems[v23].uDamageRoll;
-              v26 = pItemsTable->pItems[v23].uDamageDice + 1;
-            }
-            v5 = pItemsTable->pItems[v23].uDamageMod + v25 * v26;
+            currEquippedItem->GetItemBonusSpecialEnchantment(this, attr, &v5, &v61);
           }
         }
       }
-      
-      if ( a3 || !v6->HasItemEquipped(EQUIP_OFF_HAND) )
-          {
-
-          v28 = v6->GetEquippedItemEquipType(EQUIP_OFF_HAND);
-          if ((v28 < 0) || v28 > 2 )
-              return v5 + v62 + v61;
-        }
-      v15 = pItemsTable->pItems[v23].uDamageMod;
-      v14 = pItemsTable->pItems[v23].uDamageDice * pItemsTable->pItems[v23].uDamageRoll;
-      v5 += v15 + v14;
       return v5 + v62 + v61;
-    }
-    v59 = 3;
-LABEL_74:
-    v5 = v59;
-    return v5 + v62 + v61;
-  }
-  if ( (signed int)attr < 0 )
-    return v5 + v62 + v61;
-  if ( (signed int)attr <= CHARACTER_ATTRIBUTE_SKILL_UNARMED )
-    goto LABEL_95;
-  if ( attr == CHARACTER_ATTRIBUTE_LEVEL )
-      {
-      if ( !Player::HasEnchantedItemEquipped(25) )
-          return v5 + v62 + v61;
-      v5 = 5;
-      return v5 + v62 + v61;
-      }
-  if ( (signed int)attr <= CHARACTER_ATTRIBUTE_LEVEL )
-    return v5 + v62 + v61;
-  if ( (signed int)attr <= CHARACTER_ATTRIBUTE_MELEE_DMG_BONUS )
-  {
-    if ( IsUnarmed() == 1 )
-    {
-      v5 = 0;
-      return v5 + v62 + v61;
-    }
-    if ( v6->HasItemEquipped(EQUIP_MAIN_HAND) )
-    {
-      v17 = this->GetEquippedItemEquipType(EQUIP_MAIN_HAND);
-      if ( v17 >= 0 )
-      {
-        if ( v17 <= 2 )
-          v5 = pItemsTable->pItems[v6->pOwnItems[v6->pEquipment.uMainHand-1].uItemID].uDamageMod;
-      }
-    }
-    if ( a3 || !v6->HasItemEquipped(EQUIP_OFF_HAND) || (v19 = v6->GetEquippedItemEquipType(EQUIP_OFF_HAND), v19 < 0) || v19 > 2 )
-      return v5 + v62 + v61;
-    v20 = v6->pOwnItems[v6->pEquipment.uShield - 1].uItemID;
-    v56 = pItemsTable->pItems[v20].uDamageMod;
-    v5 += v56;
-    return v5 + v62 + v61;
-  }
-  if ( attr == CHARACTER_ATTRIBUTE_MELEE_DMG_MIN )
-  {
-    if ( IsUnarmed() == 1 )
-    {
-      v5 = 1;
-      return v5 + v62 + v61;
-    }
-    if ( v6->HasItemEquipped(EQUIP_MAIN_HAND) )
-    {
-      v9 = this->GetEquippedItemEquipType(EQUIP_MAIN_HAND);
-      if ( v9 >= 0 )
-      {
-        if ( v9 <= 2 )
-        {
-          v5 = pItemsTable->pItems[this->pOwnItems[this->pEquipment.uMainHand].uItemID].uDamageDice +
-                 pItemsTable->pItems[this->pOwnItems[this->pEquipment.uMainHand].uItemID].uDamageMod;
-          if ( !v6->pEquipment.uShield )
-          {
-            if ( pItemsTable->pItems[this->pOwnItems[this->pEquipment.uMainHand].uItemID].uSkillType == 4 )
-              ++v5;
-          }
-        }
-      }
-    }
-    
-    if ( a3 || !v6->HasItemEquipped(EQUIP_OFF_HAND))
-        {
-        v12 = v6->GetEquippedItemEquipType(EQUIP_OFF_HAND);
-        if  ((v12 < 0) || v12 > 2 )
-                return v5 + v62 + v61;
-        }
-    v14 = pItemsTable->pItems[this->pOwnItems[this->pEquipment.uShield].uItemID].uDamageMod;
-    v15 = pItemsTable->pItems[this->pOwnItems[this->pEquipment.uShield].uItemID].uDamageDice;
-LABEL_88:
-    v5 += v15 + v14;
-  }
-  return v5 + v62 + v61;
+      break;
+    default:
+      return 0;
+    }
 }
 
 //----- (0048F73C) --------------------------------------------------------
@@ -4137,7 +3504,7 @@
         bonus_value = 6;
       if ( CheckHiredNPCSpeciality(Sage) )
         bonus_value += 6;
-      bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_MONSTER_ID, 0);
+      bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_MONSTER_ID);
     }
     break;
 
@@ -4147,7 +3514,7 @@
           bonus_value = 2;
         if ( CheckHiredNPCSpeciality(Weaponsmaster) )
           bonus_value += 3;
-      bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_ARMSMASTER, 0);
+      bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_ARMSMASTER);
     }
     break;
 
@@ -4155,7 +3522,7 @@
     {
       if (CheckHiredNPCSpeciality(Burglar))
           bonus_value = 8;
-      bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_STEALING, 0);
+      bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_STEALING);
     }
     break;
 
@@ -4166,7 +3533,7 @@
           bonus_value = 4;
         if ( CheckHiredNPCSpeciality(Apothecary) )
           bonus_value += 8;
-        bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_ALCHEMY, 0);
+        bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_ALCHEMY);
     }
     break;
 
@@ -4178,7 +3545,7 @@
           bonus_value += 15;
         if ( CheckHiredNPCSpeciality(Scholar) )
           bonus_value += 5;
-      bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_LEARNING, 0);
+      bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_LEARNING);
     }
     break;
 
@@ -4186,7 +3553,7 @@
     {
       if (CheckHiredNPCSpeciality(Monk) )
         bonus_value = 2;
-      bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_UNARMED, 0);
+      bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_UNARMED);
     }
     break;
 
@@ -4194,15 +3561,15 @@
     {
       if ( CheckHiredNPCSpeciality(Monk) )
         bonus_value = 2;
-      bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_DODGE, 0);
+      bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_DODGE);
     }
     break;
     
     case PLAYER_SKILL_BOW:
-      bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_BOW, 0);
+      bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_BOW);
     break;
     case PLAYER_SKILL_SHIELD:
-      bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_SHIELD, 0);
+      bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_SHIELD);
     break;
 
     case PLAYER_SKILL_EARTH:
@@ -4214,7 +3581,7 @@
             bonus_value += 4;
           if ( classType == PLAYER_CLASS_WARLOCK && PartyHasDragon() )
             bonus_value += 3;
-      bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_EARTH, 0);
+      bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_EARTH);
     break;
     case PLAYER_SKILL_FIRE:
       if ( CheckHiredNPCSpeciality(Apprentice) )
@@ -4225,7 +3592,7 @@
             bonus_value += 4;
           if ( classType == PLAYER_CLASS_WARLOCK && PartyHasDragon() )
             bonus_value += 3;
-      bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_FIRE, 0);
+      bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_FIRE);
     break;
     case PLAYER_SKILL_AIR:
       if ( CheckHiredNPCSpeciality(Apprentice) )
@@ -4236,7 +3603,7 @@
             bonus_value += 4;
           if ( classType == PLAYER_CLASS_WARLOCK && PartyHasDragon() )
             bonus_value += 3;
-      bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_AIR, 0);
+      bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_AIR);
     break;
     case PLAYER_SKILL_WATER:
       if ( CheckHiredNPCSpeciality(Apprentice) )
@@ -4247,7 +3614,7 @@
             bonus_value += 4;
           if ( classType == PLAYER_CLASS_WARLOCK && PartyHasDragon() )
             bonus_value += 3;
-      bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_WATER, 0);
+      bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_WATER);
     break;
     case PLAYER_SKILL_SPIRIT:
           if ( CheckHiredNPCSpeciality(Acolyte2) )
@@ -4256,7 +3623,7 @@
             bonus_value += 3;
           if ( CheckHiredNPCSpeciality(Prelate) )
             bonus_value += 4;
-      bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_SPIRIT, 0);
+      bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_SPIRIT);
     break;
     case PLAYER_SKILL_MIND:
           if ( CheckHiredNPCSpeciality(Acolyte2) )
@@ -4265,7 +3632,7 @@
             bonus_value += 3;
           if ( CheckHiredNPCSpeciality(Prelate) )
             bonus_value += 4;
-      bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_MIND, 0);
+      bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_MIND);
     break;
     case PLAYER_SKILL_BODY:
           if ( CheckHiredNPCSpeciality(Acolyte2) )
@@ -4274,14 +3641,14 @@
             bonus_value += 3;
           if ( CheckHiredNPCSpeciality(Prelate) )
             bonus_value += 4;
-      bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_BODY, 0);
+      bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_BODY);
     break;
     case PLAYER_SKILL_LIGHT:
-      bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_LIGHT, 0);
+      bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_LIGHT);
     break;
     case PLAYER_SKILL_DARK:
     {
-      bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_DARK, 0);
+      bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_DARK);
     }
     break;
 
@@ -4308,10 +3675,10 @@
     break;
 
     case PLAYER_SKILL_ITEM_ID:
-      bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_ITEM_ID, 0);
+      bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_ITEM_ID);
       break;
     case PLAYER_SKILL_MEDITATION:
-      bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_MEDITATION, 0);
+      bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_MEDITATION);
     break;
     case PLAYER_SKILL_TRAP_DISARM:
     {
@@ -4321,7 +3688,7 @@
         bonus_value += 6;
       if ( CheckHiredNPCSpeciality(Burglar) )
         bonus_value += 8;
-      bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_TRAP_DISARM, 0);
+      bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_TRAP_DISARM);
     }
     break;
   }
@@ -8991,4 +8358,4 @@
 void Player::SetCondUnconsciousWithBlockCheck( int blockable )
 {
   SetCondition(Condition_Dead, blockable);
-}
\ No newline at end of file
+}