# HG changeset patch # User Grumpy7 # Date 1378794664 -7200 # Node ID bb2378f5876705ce5e872505ecf6bd6b1aeb00e3 # Parent 11bb463837b1ca57e2f6f30db2d93cfd9e298f31 Player::GetItemsBonus removed majority of labels diff -r 11bb463837b1 -r bb2378f58767 CastSpellInfo.cpp --- a/CastSpellInfo.cpp Tue Sep 10 04:16:54 2013 +0200 +++ b/CastSpellInfo.cpp Tue Sep 10 08:31:04 2013 +0200 @@ -1949,7 +1949,7 @@ v245->uItemID <= 134 && v245->uSpecEnchantmentType == 0 && v245->uEnchantmentType == 0 && - v245->_bonus_strength== 0 && + v245->m_enchantmentStrength== 0 && !v245->IsBroken() ) { if ( v245->GetValue() < 450 || @@ -1982,7 +1982,7 @@ } v255 = 10;//pItemsTable->field_116D8[17]; v256 = 10;//pItemsTable->field_116D8[16]; - v245->_bonus_strength = v256 + rand() % (v255 - v256 + 1); + v245->m_enchantmentStrength = v256 + rand() % (v255 - v256 + 1); v245->uAttributes |= 0x20u; _50C9A8_item_enchantment_timer = 256; LODWORD(v727) = 1; diff -r 11bb463837b1 -r bb2378f58767 Items.cpp --- a/Items.cpp Tue Sep 10 04:16:54 2013 +0200 +++ b/Items.cpp Tue Sep 10 08:31:04 2013 +0200 @@ -256,7 +256,7 @@ this->uAttributes = 0; this->uNumCharges = 0; this->uSpecEnchantmentType = 0; - this->_bonus_strength = 0; + this->m_enchantmentStrength = 0; this->uEnchantmentType = 0; this->uItemID = 0; this->uBodyAnchor = 0; @@ -1255,7 +1255,7 @@ { pItem->uEnchantmentType = pItems[pItem->uItemID]._bonus_type; pItem->uSpecEnchantmentType = pItems[pItem->uItemID]._additional_value; - pItem->_bonus_strength = pItems[pItem->uItemID]._bonus_strength; + pItem->m_enchantmentStrength = pItems[pItem->uItemID]._bonus_strength; } } @@ -1444,7 +1444,7 @@ if ( this->uAttributes & ITEM_TEMP_BONUS || pItemsTable->IsMaterialNonCommon(this) ) return uBaseValue; if (uEnchantmentType ) - return uBaseValue + 100 * _bonus_strength;; + return uBaseValue + 100 * m_enchantmentStrength;; if (uSpecEnchantmentType ) { bonus = pItemsTable->pSpecialEnchantments[uSpecEnchantmentType].iTreasureLevel; @@ -1798,12 +1798,12 @@ ++out_item->uEnchantmentType; v33 = rand() % (bonus_ranges[v6].maxR - bonus_ranges[v6].minR + 1); - out_item->_bonus_strength = v33 + bonus_ranges[v6].minR; + out_item->m_enchantmentStrength = v33 + bonus_ranges[v6].minR; v32 = out_item->uEnchantmentType - 1; if ( v32 == 21 || v32 == 22 || v32 == 23 ) //Armsmaster skill, Dodge skill, Unarmed skill - out_item->_bonus_strength = out_item->_bonus_strength/2; - if ( out_item->_bonus_strength <= 0 ) - out_item->_bonus_strength = 1; + out_item->m_enchantmentStrength = out_item->m_enchantmentStrength/2; + if ( out_item->m_enchantmentStrength <= 0 ) + out_item->m_enchantmentStrength = 1; return; } diff -r 11bb463837b1 -r bb2378f58767 Items.h --- a/Items.h Tue Sep 10 04:16:54 2013 +0200 +++ b/Items.h Tue Sep 10 08:31:04 2013 +0200 @@ -186,7 +186,7 @@ int uItemID; //0 int uEnchantmentType; //4 - int _bonus_strength; //8 + int m_enchantmentStrength; //8 int uSpecEnchantmentType; // 25 +5 levels //0c // 16 Drain Hit Points from target. // 35 Increases chance of disarming. diff -r 11bb463837b1 -r bb2378f58767 Player.cpp --- a/Player.cpp Tue Sep 10 04:16:54 2013 +0200 +++ b/Player.cpp Tue Sep 10 08:31:04 2013 +0200 @@ -3108,7 +3108,7 @@ inv_indx = pEquipment.pIndices[i] - 1; if (enchantmentId == 17) { - if ((pInventoryItemList[inv_indx].uSpecEnchantmentType==17) || (pInventoryItemList[inv_indx].uItemID == 533)) //Elven Chainmail+Increases rate of Recovery + if ((pInventoryItemList[inv_indx].uSpecEnchantmentType == 17) || (pInventoryItemList[inv_indx].uItemID == 533)) //Elven Chainmail+Increases rate of Recovery return 50; } if (enchantmentId == 24) @@ -3124,10 +3124,8 @@ //----- (0048EAAE) -------------------------------------------------------- int Player::GetItemsBonus( enum CHARACTER_ATTRIBUTE_TYPE attr, bool getOnlyMainHandDmg /*= false*/ ) { - CHARACTER_ATTRIBUTE_TYPE v3; // esi@1 // signed int v4; // eax@1 int v5; // edi@1 - Player *v6; // ebx@1 Player *v8; // ecx@48 int v9; // eax@49 int v10; // edx@49 @@ -3188,61 +3186,57 @@ unsigned int v65; // [sp+24h] [bp+8h]@95 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: + { + 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; - } + { + if ( !this->pActiveSkills[v58] ) + 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 ( attr == CHARACTER_ATTRIBUTE_RANGED_DMG_BONUS || attr == CHARACTER_ATTRIBUTE_RANGED_ATTACK) { if ( HasItemEquipped(EQUIP_BOW) ) - v5 = pItemsTable->pItems[v6->pOwnItems[v6->pEquipment.uBow-1].uItemID].uDamageMod; + v5 = pItemsTable->pItems[this->pOwnItems[this->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; + v57 = this->pOwnItems[this->pEquipment.uBow-1].uItemID; v5 = pItemsTable->pItems[v57].uDamageMod; v56 = pItemsTable->pItems[v57].uDamageDice; v5 += v56; @@ -3252,11 +3246,9 @@ { if ( !HasItemEquipped(EQUIP_BOW) ) return v5 + v62 + v61; - v20 = v6->pOwnItems[v6->pEquipment.uBow-1].uItemID; + v20 = this->pOwnItems[this->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; } @@ -3268,20 +3260,17 @@ { if ( !HasItemEquipped((ITEM_EQUIP_TYPE)v65) ) goto LABEL_361; - v31 = *(&v6->pEquipment.uShield + v65) - 1; - if ( v3 == 9 ) + v31 = this->pEquipment.pIndices[v65] - 1; + if ( attr == CHARACTER_ATTRIBUTE_AC_BONUS ) { v32 = GetEquippedItemEquipType((ITEM_EQUIP_TYPE)v65); - if ( v32 >= 3 ) + if ( v32 >= 3 && v32 <= 11 ) { - if ( v32 <= 11 ) - { - v33 = v6->pInventoryItemList[v31].uItemID; - v5 += pItemsTable->pItems[v33].uDamageDice + pItemsTable->pItems[v33].uDamageMod; - } + v33 = this->pInventoryItemList[v31].uItemID; + v5 += pItemsTable->pItems[v33].uDamageDice + pItemsTable->pItems[v33].uDamageMod; } } - v63 = (int)((char *)v6 + 36 * v31); + v63 = (int)((char *)this + 36 * v31); attra = (ItemGen *)(v63 + 532); if ( pItemsTable->IsMaterialNonCommon((ItemGen *)(v63 + 532)) == 1 && !pItemsTable->IsMaterialSpecial(attra) ) @@ -3289,351 +3278,480 @@ 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 ) + case ITEM_ARTIFACT_PUCK: + v35 = attr == 5; + if ( v35 ) + v5 += 50; + goto LABEL_361; + case ITEM_ARTIFACT_IRON_FEATHER: + v36 = attr == 0; + if ( v36 ) + v5 += 40; + goto LABEL_361; + case ITEM_ARTIFACT_WALLACE: + if ( attr == 21 ) v61 += 10; - v36 = v3 == 2; - goto LABEL_108; - case 0x1F7u: - if ( v3 == 17 ) - v61 += 5; - if ( v3 == 18 ) + v36 = attr == 2; + if ( v36 ) + v5 += 40; + goto LABEL_361; + case ITEM_ARTIFACT_CORSAIR: + if ( attr == 17 ) 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 ( attr == 18 ) + v61 += 5; + v36 = attr == 6; if ( v36 ) v5 += 40; goto LABEL_361; - case 0x201u: - if ( v3 == 39 ) + case ITEM_ARTICACT_GOVERNONS_ARMOR: + if (attr <= 6) { - LOBYTE(v34) = LOBYTE(v6->pActiveSkills[17]); + v5 += 10; + goto LABEL_361; + } + case ITEM_ARTIFACT_YORUBA: + v40 = attr == 3; + if ( v40 ) + v5 += 25; + goto LABEL_361; + case ITEM_ARTIFACT_SPLITTER: + v35 = attr == 10; + if ( v35 ) + v5 += 50; + goto LABEL_361; + case ITEM_ARTEFACT_ULLYSES: + v35 = attr == 4; + if ( v35 ) + v5 += 50; + goto LABEL_361; + case ITEM_ARTEFACT_HANDS_OF_THE_MASTER: + if ( attr == 23 ) + v61 += 10; + if ( attr == 22 ) + v61 += 10; + goto LABEL_361; + case ITEM_ARTIFACT_LEAGUE_BOOTS: + if ( attr == 36 ) + { + LOBYTE(v34) = LOBYTE(this->pActiveSkills[14]); + v62 = ((unsigned int)v34 >> 1) & 0x1F; + } + v36 = attr == 5; + if ( v36 ) + v5 += 40; + goto LABEL_361; + case ITEM_ARTIFACT_RULERS_RING: + if ( attr == 39 ) + { + LOBYTE(v34) = LOBYTE(this->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 ) + if ( attr == 42 ) { - LOBYTE(v34) = LOBYTE(v6->pActiveSkills[20]); + LOBYTE(v34) = LOBYTE(this->pActiveSkills[20]); v62 = ((unsigned int)v34 >> 1) & 0x1F; } - if ( v3 == 43 ) + goto LABEL_361; + case ITEM_RELIC_MASH: + if ( !attr ) + v5 += 150; + if ( attr == 1 ) + v5 -= 40; + if ( attr == 2 ) + v5 -= 40; + v41 = attr == 5; + if ( v41 ) + v5 -= 40; + goto LABEL_361; + case ITEM_RELIC_ETHRICS_STAFF: + if ( attr == 42 ) + { + LOBYTE(v34) = LOBYTE(this->pActiveSkills[20]); + v62 = ((unsigned int)v34 >> 1) & 0x1F; + } + if ( attr == 43 ) v61 += 15; goto LABEL_361; - case 0x204u: - if ( v3 == 17 ) + case ITEM_RELIC_HARECS_LEATHER: + if ( attr == 17 ) v61 += 5; - if ( v3 == 18 ) + if ( attr == 18 ) v61 += 5; - if ( v3 == 6 ) + if ( attr == 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 ) + if ( attr == 11 || attr == 10 || attr == 12 || attr == 13 || attr == 33 || attr == 14 ) + { + v5 -= 10; + goto LABEL_361; + } + v42 = attr == 15; + if ( v42 ) + v5 -= 10; + goto LABEL_361; + case ITEM_RELIC_OLD_NICK: + if ( attr == 18 ) v61 += 5; goto LABEL_361; - case 0x206u: - if ( !v3 ) + case ITEM_RELIC_AMUCK: + if ( !attr ) v5 += 100; - if ( v3 == 3 ) + if ( attr == 3 ) v5 += 100; - v43 = v3 == 9; - goto LABEL_174; - case 0x207u: - if ( v3 == 45 ) + v43 = attr == 9; + if ( v43 ) + v5 -= 15; + goto LABEL_361; + case ITEM_RELIC_GLORY_SHIELD: + if ( attr == 45 ) v61 += 5; - if ( v3 == 15 ) + if ( attr == 15 ) v5 -= 10; - v42 = v3 == 14; -LABEL_165: + v42 = attr == 14; if ( v42 ) -LABEL_166: v5 -= 10; goto LABEL_361; - case 0x208u: - v35 = v3 == 3; - goto LABEL_105; - case 0x209u: - if ( v3 == 2 ) + case ITEM_RELIC_KELEBRIM: + v35 = attr == 3; + if ( v35 ) + v5 += 50; + goto LABEL_361; + case ITEM_RELIC_TALEDONS_HELM: + if ( attr == 2 ) v5 += 15; - if ( !v3 ) + if ( !attr ) v5 += 15; - v41 = v3 == 6; - goto LABEL_146; - case 0x20Au: - if ( v3 == 46 ) + v41 = attr == 6; + if ( v41 ) + v5 -= 40; + goto LABEL_361; + case ITEM_RELIC_SCHOLARS_CAP: + if ( attr == 46 ) v61 += 15; - v44 = v3 == 3; - goto LABEL_190; - case 0x20Bu: - if ( v3 == 34 ) + v44 = attr == 3; + if ( v44 ) + v5 -= 50; + goto LABEL_361; + case ITEM_RELIC_PHYNAXIAN_CROWN: + if ( attr == 34 ) { - LOBYTE(v34) = LOBYTE(v6->pActiveSkills[12]); + LOBYTE(v34) = LOBYTE(this->pActiveSkills[12]); v62 = ((unsigned int)v34 >> 1) & 0x1F; } - if ( v3 == 12 ) + if ( attr == 12 ) v5 += 50; - if ( v3 == 2 ) + if ( attr == 2 ) v5 += 30; - v45 = v3 == 9; - goto LABEL_199; - case 0x20Cu: - if ( !v3 ) + v45 = attr == 9; + if ( v45 ) + v5 -= 20; + goto LABEL_361; + case ITEM_RILIC_TITANS_BELT: + if ( !attr ) v5 += 75; - goto LABEL_145; - case 0x20Du: - if ( v3 == 5 ) - v5 += 50; - if ( v3 == 6 ) + v41 = attr == 5; + if ( v41 ) + v5 -= 40; + goto LABEL_361; + case ITEM_RELIC_TWILIGHT: + if ( attr == CHARACTER_ATTRIBUTE_SPEED ) v5 += 50; - if ( v3 == 11 || v3 == 10 || v3 == 12 || v3 == 13 || v3 == 33 || v3 == 14 ) - goto LABEL_374; - v43 = v3 == 15; -LABEL_174: + if ( attr == CHARACTER_ATTRIBUTE_LUCK ) + v5 += 50; + if ( attr == CHARACTER_ATTRIBUTE_RESIST_AIR || attr == CHARACTER_ATTRIBUTE_RESIST_FIRE || attr == CHARACTER_ATTRIBUTE_RESIST_WATER || attr == CHARACTER_ATTRIBUTE_RESIST_EARTH || attr == CHARACTER_ATTRIBUTE_RESIST_SPIRIT || attr == CHARACTER_ATTRIBUTE_RESIST_MIND ) + { + v5 -= 15; + goto LABEL_361; + } + v43 = attr == 15; if ( v43 ) -LABEL_374: v5 -= 15; goto LABEL_361; - case 0x20Eu: - if ( v3 == 4 ) + case ITEM_RELIC_ANIA_SELVING: + if ( attr == CHARACTER_ATTRIBUTE_ACCURACY ) v5 += 150; - if ( v3 == 44 ) + if ( attr == CHARACTER_ATTRIBUTE_SKILL_BOW ) v61 += 5; - if ( v3 == 9 ) + if ( attr == CHARACTER_ATTRIBUTE_AC_BONUS ) v5 -= 25; goto LABEL_361; - case 0x20Fu: - if ( v3 == 39 ) + case ITEM_RELIC_JUSTICE: + if ( attr == 39 ) { - LOBYTE(v34) = LOBYTE(v6->pActiveSkills[17]); + LOBYTE(v34) = LOBYTE(this->pActiveSkills[17]); v34 = ((unsigned int)v34 >> 1) & 0x1F; v62 = v34; } - if ( v3 == 40 ) + if ( attr == 40 ) { - LOBYTE(v34) = LOBYTE(v6->pActiveSkills[18]); + LOBYTE(v34) = LOBYTE(this->pActiveSkills[18]); v62 = ((unsigned int)v34 >> 1) & 0x1F; } -LABEL_145: - v41 = v3 == 5; -LABEL_146: + v41 = attr == 5; if ( v41 ) v5 -= 40; goto LABEL_361; - case 0x210u: - if ( v3 == 38 ) + case ITEM_RELIC_MEKORIGS_HAMMER: + if ( attr == 38 ) { - LOBYTE(v34) = LOBYTE(v6->pActiveSkills[16]); + LOBYTE(v34) = LOBYTE(this->pActiveSkills[16]); v62 = ((unsigned int)v34 >> 1) & 0x1F; } - if ( !v3 ) + if ( !attr ) v5 += 75; - v44 = v3 == 11; -LABEL_190: + v44 = attr == 11; if ( v44 ) v5 -= 50; goto LABEL_361; - case 0x211u: - if ( v3 == 5 ) + case ITEM_ARTIFACT_HERMES_SANDALS: + if ( attr == 5 ) v5 += 100; - if ( v3 == 4 ) + if ( attr == 4 ) v5 += 50; - v35 = v3 == 11; -LABEL_105: + v35 = attr == 11; if ( v35 ) v5 += 50; goto LABEL_361; - case 0x212u: - if ( v3 == 1 ) + case ITEM_ARTIFACT_CLOAK_OF_THE_SHEEP: + if ( attr == 1 ) v5 -= 20; - v45 = v3 == 2; -LABEL_199: + v45 = attr == 2; if ( v45 ) v5 -= 20; goto LABEL_361; - case 0x214u: - if ( v3 == 1 ) + case ITEM_ARTIFACT_MINDS_EYE: + if ( attr == 1 ) + v5 += 15; + v46 = attr == 2; + if ( v46 ) v5 += 15; - v46 = v3 == 2; - goto LABEL_240; - case 0x215u: - if ( v3 == 5 ) + goto LABEL_361; + case ITEM_ELVEN_CHAINMAIL: + if ( attr == 5 ) + v5 += 15; + v46 = attr == 4; + if ( v46 ) + v5 += 15; + goto LABEL_361; + case ITEM_FORGE_GAUNTLETS: + if ( attr == 10 ) + v5 += 30; + if ( !attr ) v5 += 15; - v46 = v3 == 4; - goto LABEL_240; - case 0x216u: - if ( v3 == 10 ) - v5 += 30; - if ( !v3 ) + v46 = attr == 3; + if ( v46 ) + v5 += 15; + goto LABEL_361; + case ITEM_ARTIFACT_HEROS_BELT: + if ( attr == 21 ) + v61 += 5; + if ( !attr ) v5 += 15; - goto LABEL_315; - case 0x217u: - if ( v3 == 21 ) - v61 += 5; - if ( !v3 ) - v5 += 15; - goto LABEL_253; - case 0x218u: - goto LABEL_253; + if (attr >= 10 && attr <= 15) + { + v5 += 10; + } + goto LABEL_361; + case ITEM_ARTIFACT_LADYS_ESCORT: + if (attr >= 10 && attr <= 15) + { + v5 += 10; + goto LABEL_361; + } default: goto LABEL_361; } goto LABEL_361; } - if ( *(int *)(v63 + 536) == v3 + 1 ) + if ( this->pOwnItems[v65].uEnchantmentType == attr + 1 ) { - if ( (signed int)v3 >= 0 ) + if ( attr >= CHARACTER_ATTRIBUTE_STRENGTH ) { - if ( (signed int)v3 <= 15 ) + if ( attr <= CHARACTER_ATTRIBUTE_RESIST_BODY ) { - v5 += *((int *)v6->pConditions + 9 * v31 + 135); + v5 += this->pOwnItems[v65].m_enchantmentStrength; } else { - if ( (signed int)v3 <= 23 && v5 < *((int *)v6->pConditions + 9 * v31 + 135) ) - v5 = *((int *)v6->pConditions + 9 * v31 + 135); + if ( attr <= CHARACTER_ATTRIBUTE_SKILL_UNARMED && v5 < this->pOwnItems[v65].m_enchantmentStrength ) + v5 = this->pOwnItems[v65].m_enchantmentStrength; } } goto LABEL_361; } - v34 = *(int *)(v63 + 544); + v34 = this->pOwnItems[v65].uSpecEnchantmentType; if ( v34 > 48 ) { switch ( v34 ) { case 54: - goto LABEL_315; + v46 = attr == 3; + if ( v46 ) + v5 += 15; + goto LABEL_361; case 49: - if ( v3 == 6 ) - goto LABEL_121; - v50 = v3 == 1; - goto LABEL_296; + if ( attr == 6 ) + { + v5 += 10; + goto LABEL_361; + } + v50 = attr == 1; + if (v50) + v5 += 10; + goto LABEL_361; case 51: - if ( v3 != 5 && v3 != 1 ) - goto LABEL_309; - goto LABEL_121; + if ( attr != 5 && attr != 1 ) + { + v50 = attr == 8; + if (v50) + v5 += 10; + goto LABEL_361; + } + v5 += 10; + goto LABEL_361; case 52: - if ( v3 == 3 ) - goto LABEL_121; - v50 = v3 == 4; - goto LABEL_296; + if ( attr == 3 ) + { + v5 += 10; + goto LABEL_361; + } + v50 = attr == 4; + if (v50) + v5 += 10; + goto LABEL_361; case 53: - if ( !v3 ) - goto LABEL_121; - v50 = v3 == 2; - goto LABEL_296; + if ( !attr ) + { + v5 += 10; + goto LABEL_361; + } + v50 = attr == 2; + if (v50) + v5 += 10; + goto LABEL_361; case 55: - v46 = v3 == 6; - goto LABEL_240; + v46 = attr == 6; + if ( v46 ) + v5 += 15; + goto LABEL_361; case 56: - if ( !v3 ) - goto LABEL_351; - v53 = v3 == 3; - goto LABEL_350; + if ( !attr ) + { + v5 += 5; + goto LABEL_361; + } + v53 = attr == 3; + if ( v53 ) + v5 += 5; + goto LABEL_361; case 57: - if ( v3 == 1 ) - goto LABEL_351; - v53 = v3 == 2; - goto LABEL_350; + if ( attr == 1 ) + { + v5 += 5; + goto LABEL_361; + } + v53 = attr == 2; + if ( v53 ) + v5 += 5; + goto LABEL_361; case 50: - if ( v3 == 10 ) + if ( attr == 10 ) v5 += 30; goto LABEL_361; case 60: - if ( v3 != 23 ) - goto LABEL_336; + if ( attr != 23 ) + { + v54 = attr == 22; + if ( !v54 ) + goto LABEL_361; + if ( v5 >= 3 ) + goto LABEL_361; + v60 = 3; + v5 = v60; + break; + } 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: + v54 = attr == 22; if ( !v54 ) goto LABEL_361; if ( v5 >= 3 ) goto LABEL_361; v60 = 3; - goto LABEL_360; + v5 = v60; + break; + case 61: + if ( attr != 17 ) + { + v54 = attr == 18; + if ( !v54 ) + goto LABEL_361; + if ( v5 >= 3 ) + goto LABEL_361; + v60 = 3; + v5 = v60; + break; + } + if ( v5 >= 3 ) + goto LABEL_361; + v5 = 3; + v54 = attr == 18; + if ( !v54 ) + goto LABEL_361; + if ( v5 >= 3 ) + goto LABEL_361; + v60 = 3; + v5 = v60; + break; + case 62: + if ( attr != 19 ) + { + v54 = attr == 20; + if ( !v54 ) + goto LABEL_361; + if ( v5 >= 3 ) + goto LABEL_361; + v60 = 3; + v5 = v60; + break; + } + if ( v5 >= 3 ) + goto LABEL_361; + v5 = 3; + v54 = attr == 20; + if ( !v54 ) + goto LABEL_361; + if ( v5 >= 3 ) + goto LABEL_361; + v60 = 3; + v5 = v60; + break; case 67: - v55 = v3 == 18; - goto LABEL_357; + v55 = attr == 18; + if ( v55 && v5 < 2 ) + { + v60 = 2; + v5 = v60; + } + break; case 68: - v53 = v3 == 9; - goto LABEL_350; + v53 = attr == 9; + if ( v53 ) + v5 += 5; + goto LABEL_361; case 69: - if ( v3 == 11 ) + if ( attr == 11 ) v5 += 20; break; case 70: - if ( v3 == 12 ) + if ( attr == 12 ) v5 += 10; - v55 = v3 == 16; -LABEL_357: + v55 = attr == 16; if ( v55 && v5 < 2 ) { v60 = 2; -LABEL_360: v5 = v60; } break; @@ -3644,11 +3762,9 @@ } if ( v34 == 48 ) { - if ( v3 == 9 ) + if ( attr == 9 ) v5 += 5; -LABEL_315: - v46 = v3 == 3; -LABEL_240: + v46 = attr == 3; if ( v46 ) v5 += 15; goto LABEL_361; @@ -3660,71 +3776,72 @@ v51 = v34 - 45; if ( !v51 ) { - if ( v3 == 5 ) - goto LABEL_351; - v53 = v3 == 4; -LABEL_350: + if ( attr == 5 ) + v5 += 5; + goto LABEL_361; + v53 = attr == 4; if ( v53 ) -LABEL_351: v5 += 5; goto LABEL_361; } v52 = v51 - 1; if ( !v52 ) { - v40 = v3 == 0; -LABEL_123: + v40 = attr == 0; if ( v40 ) v5 += 25; goto LABEL_361; } if ( v52 == 1 ) { -LABEL_309: - v50 = v3 == 8; - goto LABEL_296; + v50 = attr == 8; + if (v50) + v5 += 10; + goto LABEL_361; } } else { if ( v34 == 44 ) { - v50 = v3 == 7; - goto LABEL_296; + v50 = attr == 7; + if (v50) + v5 += 10; + goto LABEL_361; } v34 -= 33; if ( !v34 ) { - if ( v3 != 38 ) + if ( attr != 38 ) goto LABEL_361; - LOBYTE(v34) = LOBYTE(v6->pActiveSkills[16]); - goto LABEL_138; + LOBYTE(v34) = LOBYTE(this->pActiveSkills[16]); + v62 = ((unsigned int)v34 >> 1) & 0x1F; + goto LABEL_361; } --v34; if ( !v34 ) { - if ( v3 != 36 ) + if ( attr != 36 ) goto LABEL_361; - LOBYTE(v34) = LOBYTE(v6->pActiveSkills[14]); - goto LABEL_138; + LOBYTE(v34) = LOBYTE(this->pActiveSkills[14]); + v62 = ((unsigned int)v34 >> 1) & 0x1F; + goto LABEL_361; } v49 = v34 - 8; if ( !v49 ) { - if ( (signed int)v3 >= 0 && (signed int)v3 <= 15 ) + if ( (signed int)attr >= 0 && (signed int)attr <= 15 ) ++v5; goto LABEL_361; } if ( v49 == 1 ) { - if ( v3 != 3 && v3 != 7 ) + if ( attr != 3 && attr != 7 ) { - v50 = v3 == 9; -LABEL_296: + v50 = attr == 9; if ( !v50 ) goto LABEL_361; } -LABEL_121: v5 += 10; goto LABEL_361; } @@ -3734,10 +3851,11 @@ { if ( v34 == 32 ) { - if ( v3 != 39 ) + if ( attr != 39 ) goto LABEL_361; - LOBYTE(v34) = LOBYTE(v6->pActiveSkills[17]); - goto LABEL_138; + LOBYTE(v34) = LOBYTE(this->pActiveSkills[17]); + v62 = ((unsigned int)v34 >> 1) & 0x1F; + goto LABEL_361; } if ( v34 > 28 ) { @@ -3748,32 +3866,31 @@ if ( v34 ) { --v34; - if ( v34 || v3 != 41 ) + if ( v34 || attr != 41 ) goto LABEL_361; - LOBYTE(v34) = LOBYTE(v6->pActiveSkills[19]); + LOBYTE(v34) = LOBYTE(this->pActiveSkills[19]); } else { - if ( v3 != 34 ) + if ( attr != 34 ) goto LABEL_361; - LOBYTE(v34) = LOBYTE(v6->pActiveSkills[12]); + LOBYTE(v34) = LOBYTE(this->pActiveSkills[12]); } } else { - if ( v3 != 37 ) + if ( attr != 37 ) goto LABEL_361; - LOBYTE(v34) = LOBYTE(v6->pActiveSkills[15]); + LOBYTE(v34) = LOBYTE(this->pActiveSkills[15]); } - goto LABEL_138; + v62 = ((unsigned int)v34 >> 1) & 0x1F; + goto LABEL_361; } if ( v34 == 28 ) { -LABEL_136: - if ( v3 == 42 ) + if ( attr == 42 ) { - LOBYTE(v34) = LOBYTE(v6->pActiveSkills[20]); -LABEL_138: + LOBYTE(v34) = LOBYTE(this->pActiveSkills[20]); v62 = ((unsigned int)v34 >> 1) & 0x1F; goto LABEL_361; } @@ -3790,36 +3907,33 @@ if ( v34 ) { --v34; - if ( v34 || v3 != 40 ) + if ( v34 || attr != 40 ) goto LABEL_361; - LOBYTE(v34) = LOBYTE(v6->pActiveSkills[18]); + LOBYTE(v34) = LOBYTE(this->pActiveSkills[18]); } else { - if ( v3 != 35 ) + if ( attr != 35 ) goto LABEL_361; - LOBYTE(v34) = LOBYTE(v6->pActiveSkills[13]); + LOBYTE(v34) = LOBYTE(this->pActiveSkills[13]); } - goto LABEL_138; + v62 = ((unsigned int)v34 >> 1) & 0x1F; + goto LABEL_361; } -LABEL_118: - if ( (signed int)v3 < 0 ) + if (attr >= 0 && attr <= 6) + { + v5 += 10; goto LABEL_361; - v39 = __OFSUB__((int)v3, 6); - v37 = v3 == 6; - v38 = v3 - 6 < 0; + } } else { -LABEL_253: - if ( (signed int)v3 < 10 ) + if (attr >= 10 && attr <= 15) + { + v5 += 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: @@ -3832,7 +3946,7 @@ { if ( IsUnarmed() != 1 ) { - if ( v6->HasItemEquipped(EQUIP_MAIN_HAND) ) + if ( this->HasItemEquipped(EQUIP_MAIN_HAND) ) { v22 = this->GetEquippedItemEquipType(EQUIP_MAIN_HAND); if ( v22 >= 0 ) @@ -3840,7 +3954,7 @@ if ( v22 <= 2 ) { v23 = this->pOwnItems[this->pEquipment.uMainHand].uItemID; - if ( v6->pEquipment.uShield || pItemsTable->pItems[v23].uSkillType != 4 ) + if ( this->pEquipment.uShield || pItemsTable->pItems[v23].uSkillType != 4 ) { v26 = pItemsTable->pItems[v23].uDamageRoll; v25 = pItemsTable->pItems[v23].uDamageDice; @@ -3855,10 +3969,10 @@ } } - if ( getOnlyMainHandDmg || !v6->HasItemEquipped(EQUIP_OFF_HAND) ) + if ( getOnlyMainHandDmg || !this->HasItemEquipped(EQUIP_OFF_HAND) ) { - v28 = v6->GetEquippedItemEquipType(EQUIP_OFF_HAND); + v28 = this->GetEquippedItemEquipType(EQUIP_OFF_HAND); if ((v28 < 0) || v28 > 2 ) return v5 + v62 + v61; } @@ -3868,7 +3982,6 @@ return v5 + v62 + v61; } v59 = 3; -LABEL_74: v5 = v59; return v5 + v62 + v61; } @@ -3892,18 +4005,18 @@ v5 = 0; return v5 + v62 + v61; } - if ( v6->HasItemEquipped(EQUIP_MAIN_HAND) ) + if ( this->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; + v5 = pItemsTable->pItems[this->pOwnItems[this->pEquipment.uMainHand-1].uItemID].uDamageMod; } } - if ( getOnlyMainHandDmg || !v6->HasItemEquipped(EQUIP_OFF_HAND) || (v19 = v6->GetEquippedItemEquipType(EQUIP_OFF_HAND), v19 < 0) || v19 > 2 ) + if ( getOnlyMainHandDmg || !this->HasItemEquipped(EQUIP_OFF_HAND) || (v19 = this->GetEquippedItemEquipType(EQUIP_OFF_HAND), v19 < 0) || v19 > 2 ) return v5 + v62 + v61; - v20 = v6->pOwnItems[v6->pEquipment.uShield - 1].uItemID; + v20 = this->pOwnItems[this->pEquipment.uShield - 1].uItemID; v56 = pItemsTable->pItems[v20].uDamageMod; v5 += v56; return v5 + v62 + v61; @@ -3915,7 +4028,7 @@ v5 = 1; return v5 + v62 + v61; } - if ( v6->HasItemEquipped(EQUIP_MAIN_HAND) ) + if ( this->HasItemEquipped(EQUIP_MAIN_HAND) ) { v9 = this->GetEquippedItemEquipType(EQUIP_MAIN_HAND); if ( v9 >= 0 ) @@ -3924,7 +4037,7 @@ { v5 = pItemsTable->pItems[this->pOwnItems[this->pEquipment.uMainHand].uItemID].uDamageDice + pItemsTable->pItems[this->pOwnItems[this->pEquipment.uMainHand].uItemID].uDamageMod; - if ( !v6->pEquipment.uShield ) + if ( !this->pEquipment.uShield ) { if ( pItemsTable->pItems[this->pOwnItems[this->pEquipment.uMainHand].uItemID].uSkillType == 4 ) ++v5; @@ -3933,15 +4046,14 @@ } } - if ( getOnlyMainHandDmg || !v6->HasItemEquipped(EQUIP_OFF_HAND)) + if ( getOnlyMainHandDmg || !this->HasItemEquipped(EQUIP_OFF_HAND)) { - v12 = v6->GetEquippedItemEquipType(EQUIP_OFF_HAND); + v12 = this->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; diff -r 11bb463837b1 -r bb2378f58767 UI/UIPopup.cpp --- a/UI/UIPopup.cpp Tue Sep 10 04:16:54 2013 +0200 +++ b/UI/UIPopup.cpp Tue Sep 10 08:31:04 2013 +0200 @@ -439,12 +439,12 @@ else if ( inspect_item->uEnchantmentType ) { sprintf(out_text + 200, "%s: %s +%d", pGlobalTXT_LocalizationStrings[210], - pItemsTable->pEnchantments[inspect_item->uEnchantmentType-1].pBonusStat, inspect_item->_bonus_strength); //"Special" + pItemsTable->pEnchantments[inspect_item->uEnchantmentType-1].pBonusStat, inspect_item->m_enchantmentStrength); //"Special" } else if ( inspect_item->uSpecEnchantmentType ) { sprintf(out_text + 200, "%s: %s", pGlobalTXT_LocalizationStrings[210], - pItemsTable->pSpecialEnchantments[inspect_item->uSpecEnchantmentType-1].pBonusStatement, inspect_item->_bonus_strength); + pItemsTable->pSpecialEnchantments[inspect_item->uSpecEnchantmentType-1].pBonusStatement, inspect_item->m_enchantmentStrength); } else if ( inspect_item->uNumCharges )