comparison Player.cpp @ 1708:f8414042db1f

Moving NZIArray to a separate class, fixing a few inventory bugs
author Grumpy7
date Mon, 23 Sep 2013 07:07:06 +0200
parents ef42788fef1d
children 8251e59fd7c1
comparison
equal deleted inserted replaced
1702:5cbd88f8a2eb 1708:f8414042db1f
3137 if ( this->HasItemEquipped(EQUIP_MAIN_HAND) ) 3137 if ( this->HasItemEquipped(EQUIP_MAIN_HAND) )
3138 { 3138 {
3139 v22 = this->GetEquippedItemEquipType(EQUIP_MAIN_HAND); 3139 v22 = this->GetEquippedItemEquipType(EQUIP_MAIN_HAND);
3140 if ( v22 >= 0 && v22 <= 2) 3140 if ( v22 >= 0 && v22 <= 2)
3141 { 3141 {
3142 v23 = this->pOwnItems[this->pEquipment.uMainHand].uItemID; 3142 v23 = this->pOwnItems[this->pEquipment.uMainHand - 1].uItemID;
3143 v26 = pItemsTable->pItems[v23].uDamageRoll; 3143 v26 = pItemsTable->pItems[v23].uDamageRoll;
3144 if ( this->pEquipment.uShield || pItemsTable->pItems[v23].uSkillType != 4 ) 3144 if ( this->pEquipment.uShield || pItemsTable->pItems[v23].uSkillType != 4 )
3145 { 3145 {
3146 v25 = pItemsTable->pItems[v23].uDamageDice; 3146 v25 = pItemsTable->pItems[v23].uDamageDice;
3147 } 3147 }
3150 v25 = pItemsTable->pItems[v23].uDamageDice + 1; 3150 v25 = pItemsTable->pItems[v23].uDamageDice + 1;
3151 } 3151 }
3152 v5 = pItemsTable->pItems[v23].uDamageMod + v25 * v26; 3152 v5 = pItemsTable->pItems[v23].uDamageMod + v25 * v26;
3153 } 3153 }
3154 } 3154 }
3155 if ( getOnlyMainHandDmg || !this->HasItemEquipped(EQUIP_OFF_HAND) || (GetEquippedItemEquipType(EQUIP_OFF_HAND) < 0 && GetEquippedItemEquipType(EQUIP_OFF_HAND) > 2)) 3155 if ( getOnlyMainHandDmg || !this->HasItemEquipped(EQUIP_OFF_HAND) || (GetEquippedItemEquipType(EQUIP_OFF_HAND) < 0 || GetEquippedItemEquipType(EQUIP_OFF_HAND) > 2))
3156 { 3156 {
3157 return v5; 3157 return v5;
3158 } 3158 }
3159 else 3159 else
3160 { 3160 {
3161 v23 = this->pOwnItems[this->pEquipment.uShield].uItemID; 3161 v23 = this->pOwnItems[this->pEquipment.uShield - 1].uItemID;
3162 v15 = pItemsTable->pItems[v23].uDamageMod; 3162 v15 = pItemsTable->pItems[v23].uDamageMod;
3163 v14 = pItemsTable->pItems[v23].uDamageDice * pItemsTable->pItems[v23].uDamageRoll; 3163 v14 = pItemsTable->pItems[v23].uDamageDice * pItemsTable->pItems[v23].uDamageRoll;
3164 return v5 + v15 + v14; 3164 return v5 + v15 + v14;
3165 } 3165 }
3166 } 3166 }
3198 if ( this->HasItemEquipped(EQUIP_MAIN_HAND) ) 3198 if ( this->HasItemEquipped(EQUIP_MAIN_HAND) )
3199 { 3199 {
3200 v9 = this->GetEquippedItemEquipType(EQUIP_MAIN_HAND); 3200 v9 = this->GetEquippedItemEquipType(EQUIP_MAIN_HAND);
3201 if ( v9 >= 0 && v9 <= 2) 3201 if ( v9 >= 0 && v9 <= 2)
3202 { 3202 {
3203 v5 = pItemsTable->pItems[this->pOwnItems[this->pEquipment.uMainHand].uItemID].uDamageDice + 3203 v5 = pItemsTable->pItems[this->pOwnItems[this->pEquipment.uMainHand - 1].uItemID].uDamageDice +
3204 pItemsTable->pItems[this->pOwnItems[this->pEquipment.uMainHand].uItemID].uDamageMod; 3204 pItemsTable->pItems[this->pOwnItems[this->pEquipment.uMainHand - 1].uItemID].uDamageMod;
3205 if ( !this->pEquipment.uShield && pItemsTable->pItems[this->pOwnItems[this->pEquipment.uMainHand].uItemID].uSkillType == 4) 3205 if ( !this->pEquipment.uShield && pItemsTable->pItems[this->pOwnItems[this->pEquipment.uMainHand - 1].uItemID].uSkillType == 4)
3206 { 3206 {
3207 ++v5; 3207 ++v5;
3208 } 3208 }
3209 } 3209 }
3210 } 3210 }
3771 } 3771 }
3772 for (int i = 0; i < 16; i++) 3772 for (int i = 0; i < 16; i++)
3773 { 3773 {
3774 if ( this->HasItemEquipped((ITEM_EQUIP_TYPE)i) ) 3774 if ( this->HasItemEquipped((ITEM_EQUIP_TYPE)i) )
3775 { 3775 {
3776 int currItemId = this->pInventoryItemList[this->pEquipment.pIndices[i]].uItemID; 3776 int currItemId = this->pInventoryItemList[this->pEquipment.pIndices[i] - 1].uItemID;
3777 if ( pItemsTable->pItems[currItemId].uEquipType == EQUIP_MAIN_HAND || pItemsTable->pItems[currItemId].uEquipType == EQUIP_OFF_HAND ) 3777 if ( pItemsTable->pItems[currItemId].uEquipType == EQUIP_MAIN_HAND || pItemsTable->pItems[currItemId].uEquipType == EQUIP_OFF_HAND )
3778 { 3778 {
3779 PLAYER_SKILL_TYPE currItemSkillType = (PLAYER_SKILL_TYPE)pItemsTable->pItems[currItemId].uSkillType; 3779 PLAYER_SKILL_TYPE currItemSkillType = (PLAYER_SKILL_TYPE)pItemsTable->pItems[currItemId].uSkillType;
3780 int currItemSkillLevel = this->GetActualSkillLevel(currItemSkillType); 3780 int currItemSkillLevel = this->GetActualSkillLevel(currItemSkillType);
3781 int baseSkillBonus; 3781 int baseSkillBonus;