comparison Player.cpp @ 906:23655ae9cd18

Слияние
author Ritor1
date Fri, 19 Apr 2013 18:11:28 +0600
parents 4dc2252e0b03
children 897b10712a1a
comparison
equal deleted inserted replaced
905:6daea87a3fe3 906:23655ae9cd18
254 254
255 v1 = 0; 255 v1 = 0;
256 v2 = &this->pEquipment; 256 v2 = &this->pEquipment;
257 while ( 1 ) 257 while ( 1 )
258 { 258 {
259 result = v2->uOffHand; 259 result = v2->uShield;
260 if ( v2->uOffHand ) 260 if ( v2->uShield )
261 { 261 {
262 result = *(int *)&this->pInventoryItems[result-1]; 262 result = *(int *)&this->pInventoryItems[result-1];
263 if ( result ) 263 if ( result )
264 { 264 {
265 if ( result != 64 && result != 65 ) 265 if ( result != 64 && result != 65 )
1211 if ( a3 != 1 ) 1211 if ( a3 != 1 )
1212 goto LABEL_40; 1212 goto LABEL_40;
1213 if ( SHIDWORD(pParty->pPartyBuffs[13].uExpireTime) >= 0 1213 if ( SHIDWORD(pParty->pPartyBuffs[13].uExpireTime) >= 0
1214 && (SHIDWORD(pParty->pPartyBuffs[13].uExpireTime) > 0 || LODWORD(pParty->pPartyBuffs[13].uExpireTime) > 0) ) 1214 && (SHIDWORD(pParty->pPartyBuffs[13].uExpireTime) > 0 || LODWORD(pParty->pPartyBuffs[13].uExpireTime) > 0) )
1215 goto LABEL_10; 1215 goto LABEL_10;
1216 if ( v3->HasEnchantedItemEquipped(18) || v9->WearsItem(505, 3) || v10->WearsItem(530, 6) ) 1216 if ( v3->HasEnchantedItemEquipped(18) || v3->WearsItem(505, 3) || v3->WearsItem(530, 6) )
1217 goto LABEL_76; 1217 goto LABEL_76;
1218 LABEL_40: 1218 LABEL_40:
1219 v26 = 0; 1219 v26 = 0;
1220 v23 = 28; 1220 v23 = 28;
1221 goto LABEL_81; 1221 goto LABEL_81;
1538 if ( v2 != -1 ) 1538 if ( v2 != -1 )
1539 { 1539 {
1540 v4 = v2 + 1; 1540 v4 = v2 + 1;
1541 v5 = (char *)this + 36 * v2; 1541 v5 = (char *)this + 36 * v2;
1542 v6 = &byte_4E8394[pItemsTable->pItems[uItemID].uEquipType + 4]; 1542 v6 = &byte_4E8394[pItemsTable->pItems[uItemID].uEquipType + 4];
1543 *(&this->pEquipment.uOffHand + (unsigned __int8)*v6) = v4; 1543 *(&this->pEquipment.uShield + (unsigned __int8)*v6) = v4;
1544 *((int *)v5 + 133) = uItemID; 1544 *((int *)v5 + 133) = uItemID;
1545 v5[556] = *v6 + 1; 1545 v5[556] = *v6 + 1;
1546 } 1546 }
1547 return 0; 1547 return 0;
1548 } 1548 }
2785 { 2785 {
2786 v6 = (ItemGen *)&v5->pInventoryItems[v5->pEquipment.uMainHand-1]; 2786 v6 = (ItemGen *)&v5->pInventoryItems[v5->pEquipment.uMainHand-1];
2787 v7 = v6->uItemID; 2787 v7 = v6->uItemID;
2788 v8 = v6->uItemID; 2788 v8 = v6->uItemID;
2789 v9 = pItemsTable->pItems[v8].uDamageDice; 2789 v9 = pItemsTable->pItems[v8].uDamageDice;
2790 if ( pItemsTable->pItems[v8].uSkillType == PLAYER_SKILL_SPEAR && !v5->pEquipment.uOffHand ) 2790 if ( pItemsTable->pItems[v8].uSkillType == PLAYER_SKILL_SPEAR && !v5->pEquipment.uShield )
2791 ++v9; 2791 ++v9;
2792 v30 = pItemsTable->pItems[v8].uDamageRoll; 2792 v30 = pItemsTable->pItems[v8].uDamageRoll;
2793 if ( v9 > 0 ) 2793 if ( v9 > 0 )
2794 { 2794 {
2795 v33 = v9; 2795 v33 = v9;
2853 v29 = 0; 2853 v29 = 0;
2854 if ( !a3 ) 2854 if ( !a3 )
2855 { 2855 {
2856 if ( v5->HasItemEquipped((ITEM_EQUIP_TYPE)0) ) 2856 if ( v5->HasItemEquipped((ITEM_EQUIP_TYPE)0) )
2857 { 2857 {
2858 v15 = (ItemGen *)&v5->pInventoryItems[v5->pEquipment.uOffHand-1]; 2858 v15 = (ItemGen *)&v5->pInventoryItems[v5->pEquipment.uShield - 1];
2859 v16 = v15->uItemID; 2859 v16 = v15->uItemID;
2860 v17 = v15->uItemID; 2860 v17 = v15->uItemID;
2861 if ( pItemsTable->pItems[v17].uEquipType != 4 ) 2861 if ( pItemsTable->pItems[v17].uEquipType != 4 )
2862 { 2862 {
2863 v31 = pItemsTable->pItems[v17].uDamageRoll; 2863 v31 = pItemsTable->pItems[v17].uDamageRoll;
3318 } 3318 }
3319 } 3319 }
3320 } 3320 }
3321 if ( resistance == 4 ) 3321 if ( resistance == 4 )
3322 { 3322 {
3323 v14 = v3->pEquipment.uBody; 3323 v14 = v3->pEquipment.uArmor;
3324 if ( v14 ) 3324 if ( v14 )
3325 { 3325 {
3326 if ( !(v3->field_1F5[36 * v14 + 15] & 2) ) 3326 if ( !(v3->field_1F5[36 * v14 + 15] & 2) )
3327 { 3327 {
3328 v15 = GetEquippedItemSkillType(EQUIP_ARMOUR) - 10; 3328 v15 = GetEquippedItemSkillType(EQUIP_ARMOUR) - 10;
3683 if ( v3->sHealth > 0 ) 3683 if ( v3->sHealth > 0 )
3684 v3->sHealth = 0; 3684 v3->sHealth = 0;
3685 } 3685 }
3686 if ( v6 ) 3686 if ( v6 )
3687 { 3687 {
3688 v7 = v3->pEquipment.uBody; 3688 v7 = v3->pEquipment.uArmor;
3689 if ( v7 ) 3689 if ( v7 )
3690 { 3690 {
3691 v8 = &v3->field_1F5[36 * v7 + 15]; 3691 v8 = &v3->field_1F5[36 * v7 + 15];
3692 v9 = *(int *)v8; 3692 v9 = *(int *)v8;
3693 if ( !(BYTE1(v9) & 2) ) 3693 if ( !(BYTE1(v9) & 2) )
3813 do 3813 do
3814 { 3814 {
3815 if ( HasItemEquipped((ITEM_EQUIP_TYPE)v14) ) 3815 if ( HasItemEquipped((ITEM_EQUIP_TYPE)v14) )
3816 { 3816 {
3817 if ( v15 == EQUIP_ARMOUR ) 3817 if ( v15 == EQUIP_ARMOUR )
3818 v46[v4++] = LOBYTE(v5->pEquipment.uBody) - 1; 3818 v46[v4++] = LOBYTE(v5->pEquipment.uArmor) - 1;
3819 if ( (!v15 || v15 == 1) && GetEquippedItemEquipType((ITEM_EQUIP_TYPE)v15) == 4 ) 3819 if ( (!v15 || v15 == 1) && GetEquippedItemEquipType((ITEM_EQUIP_TYPE)v15) == 4 )
3820 v46[v4++] = *((char *)&v5->pEquipment.uOffHand + 4 * v15) - 1; 3820 v46[v4++] = *((char *)&v5->pEquipment.uShield + 4 * v15) - 1;
3821 } 3821 }
3822 v14 = v15 + 1; 3822 v14 = v15 + 1;
3823 } 3823 }
3824 while ( v14 < 16 ); 3824 while ( v14 < 16 );
3825 goto LABEL_36; 3825 goto LABEL_36;
3831 { 3831 {
3832 if ( v17 == 2 ) 3832 if ( v17 == 2 )
3833 v46[v4++] = LOBYTE(v5->pEquipment.uBow) - 1; 3833 v46[v4++] = LOBYTE(v5->pEquipment.uBow) - 1;
3834 if ( (!v17 || v17 == 1) 3834 if ( (!v17 || v17 == 1)
3835 && (!GetEquippedItemEquipType((ITEM_EQUIP_TYPE)v17) || GetEquippedItemEquipType((ITEM_EQUIP_TYPE)v17) == 1) ) 3835 && (!GetEquippedItemEquipType((ITEM_EQUIP_TYPE)v17) || GetEquippedItemEquipType((ITEM_EQUIP_TYPE)v17) == 1) )
3836 v46[v4++] = *((char *)&v5->pEquipment.uOffHand + 4 * v17) - 1; 3836 v46[v4++] = *((char *)&v5->pEquipment.uShield + 4 * v17) - 1;
3837 } 3837 }
3838 v16 = v17 + 1; 3838 v16 = v17 + 1;
3839 } 3839 }
3840 while ( v16 < 16 ); 3840 while ( v16 < 16 );
3841 LABEL_36: 3841 LABEL_36:
4105 else 4105 else
4106 weapon_recovery = base_recovery_times_per_weapon_type[weapon_desc->uSkillType]; 4106 weapon_recovery = base_recovery_times_per_weapon_type[weapon_desc->uSkillType];
4107 } 4107 }
4108 if (HasItemEquipped(EQUIP_OFF_HAND) && GetEquippedItemEquipType(EQUIP_OFF_HAND) != EQUIP_SHIELD) // ADD: shield check because shield recovery is added later and can be accidentally doubled 4108 if (HasItemEquipped(EQUIP_OFF_HAND) && GetEquippedItemEquipType(EQUIP_OFF_HAND) != EQUIP_SHIELD) // ADD: shield check because shield recovery is added later and can be accidentally doubled
4109 { 4109 {
4110 auto v12 = &pInventoryItems[pEquipment.uOffHand - 1]; 4110 auto v12 = &pInventoryItems[pEquipment.uShield - 1];
4111 auto v12_desc = &pItemsTable->pItems[v12->uItemID]; 4111 auto v12_desc = &pItemsTable->pItems[v12->uItemID];
4112 if (base_recovery_times_per_weapon_type[v12_desc->uSkillType] > weapon_recovery) 4112 if (base_recovery_times_per_weapon_type[v12_desc->uSkillType] > weapon_recovery)
4113 { 4113 {
4114 weapon = &pInventoryItems[pEquipment.uOffHand - 1]; 4114 weapon = &pInventoryItems[pEquipment.uShield - 1];
4115 weapon_desc = &pItemsTable->pItems[weapon->uItemID]; 4115 weapon_desc = &pItemsTable->pItems[weapon->uItemID];
4116 weapon_recovery = base_recovery_times_per_weapon_type[pItemsTable->pItems[weapon->uItemID].uSkillType]; 4116 weapon_recovery = base_recovery_times_per_weapon_type[pItemsTable->pItems[weapon->uItemID].uSkillType];
4117 } 4117 }
4118 } 4118 }
4119 4119
4120 LABEL_17: 4120 LABEL_17:
4121 uint armour_recovery = 0; 4121 uint armour_recovery = 0;
4122 if ( HasItemEquipped(EQUIP_ARMOUR) ) 4122 if ( HasItemEquipped(EQUIP_ARMOUR) )
4123 { 4123 {
4124 auto armour_skill_type = pItemsTable->pItems[pInventoryItems[pEquipment.uBody - 1].uItemID].uSkillType; 4124 auto armour_skill_type = pItemsTable->pItems[pInventoryItems[pEquipment.uArmor - 1].uItemID].uSkillType;
4125 uint base_armour_recovery = base_recovery_times_per_weapon_type[armour_skill_type]; 4125 uint base_armour_recovery = base_recovery_times_per_weapon_type[armour_skill_type];
4126 4126
4127 float armour_recovery_multipliers[4]; 4127 float armour_recovery_multipliers[4];
4128 if (armour_skill_type == PLAYER_SKILL_LEATHER) 4128 if (armour_skill_type == PLAYER_SKILL_LEATHER)
4129 { 4129 {
4162 uint shield_recovery = 0; 4162 uint shield_recovery = 0;
4163 if (HasItemEquipped(EQUIP_OFF_HAND) && GetEquippedItemEquipType(EQUIP_OFF_HAND) == EQUIP_SHIELD) 4163 if (HasItemEquipped(EQUIP_OFF_HAND) && GetEquippedItemEquipType(EQUIP_OFF_HAND) == EQUIP_SHIELD)
4164 { 4164 {
4165 float shield_recovery_multipliers[4] = {1, 0, 0, 0}; 4165 float shield_recovery_multipliers[4] = {1, 0, 0, 0};
4166 4166
4167 auto shield = &pInventoryItems[pEquipment.uOffHand - 1]; 4167 auto shield = &pInventoryItems[pEquipment.uShield - 1];
4168 auto skill_type = pItemsTable->pItems[shield->uItemID].uSkillType; 4168 auto skill_type = pItemsTable->pItems[shield->uItemID].uSkillType;
4169 4169
4170 uint shield_base_recovery = base_recovery_times_per_weapon_type[skill_type]; 4170 uint shield_base_recovery = base_recovery_times_per_weapon_type[skill_type];
4171 shield_recovery = shield_base_recovery * SkillToMastery(pActiveSkills[skill_type]); 4171 shield_recovery = shield_base_recovery * SkillToMastery(pActiveSkills[skill_type]);
4172 } 4172 }
4837 v65 = 0; 4837 v65 = 0;
4838 while ( 1 ) 4838 while ( 1 )
4839 { 4839 {
4840 if ( !HasItemEquipped((ITEM_EQUIP_TYPE)v65) ) 4840 if ( !HasItemEquipped((ITEM_EQUIP_TYPE)v65) )
4841 goto LABEL_361; 4841 goto LABEL_361;
4842 v31 = *(&v6->pEquipment.uOffHand + v65) - 1; 4842 v31 = *(&v6->pEquipment.uShield + v65) - 1;
4843 if ( v3 == 9 ) 4843 if ( v3 == 9 )
4844 { 4844 {
4845 v32 = GetEquippedItemEquipType((ITEM_EQUIP_TYPE)v65); 4845 v32 = GetEquippedItemEquipType((ITEM_EQUIP_TYPE)v65);
4846 if ( v32 >= 3 ) 4846 if ( v32 >= 3 )
4847 { 4847 {
5409 if ( v22 >= 0 ) 5409 if ( v22 >= 0 )
5410 { 5410 {
5411 if ( v22 <= 2 ) 5411 if ( v22 <= 2 )
5412 { 5412 {
5413 v23 = this->pInventoryItems[this->pEquipment.uMainHand].uItemID; 5413 v23 = this->pInventoryItems[this->pEquipment.uMainHand].uItemID;
5414 if ( v6->pEquipment.uOffHand || pItemsTable->pItems[v23].uSkillType != 4 ) 5414 if ( v6->pEquipment.uShield || pItemsTable->pItems[v23].uSkillType != 4 )
5415 { 5415 {
5416 v24 = v23; 5416 v24 = v23;
5417 v26 = pItemsTable->pItems[v23].uDamageRoll; 5417 v26 = pItemsTable->pItems[v23].uDamageRoll;
5418 v25 = pItemsTable->pItems[v23].uDamageDice; 5418 v25 = pItemsTable->pItems[v23].uDamageDice;
5419 } 5419 }
5459 v5 = pItemsTable->pItems[*(int *)&v6->pInventoryItems[v6->pEquipment.uMainHand-1]].uDamageMod; 5459 v5 = pItemsTable->pItems[*(int *)&v6->pInventoryItems[v6->pEquipment.uMainHand-1]].uDamageMod;
5460 } 5460 }
5461 } 5461 }
5462 if ( a3 || !v6->HasItemEquipped(EQUIP_OFF_HAND) || (v19 = v6->GetEquippedItemEquipType(EQUIP_OFF_HAND), v19 < 0) || v19 > 2 ) 5462 if ( a3 || !v6->HasItemEquipped(EQUIP_OFF_HAND) || (v19 = v6->GetEquippedItemEquipType(EQUIP_OFF_HAND), v19 < 0) || v19 > 2 )
5463 return v5 + v62 + v61; 5463 return v5 + v62 + v61;
5464 v20 = *(int *)&v6->pInventoryItems[v6->pEquipment.uOffHand-1]; 5464 v20 = *(int *)&v6->pInventoryItems[v6->pEquipment.uShield - 1];
5465 goto LABEL_365; 5465 goto LABEL_365;
5466 } 5466 }
5467 if ( attr == 27 ) 5467 if ( attr == 27 )
5468 { 5468 {
5469 if ( IsUnarmed() == 1 ) 5469 if ( IsUnarmed() == 1 )
5477 if ( v9 >= 0 ) 5477 if ( v9 >= 0 )
5478 { 5478 {
5479 if ( v9 <= 2 ) 5479 if ( v9 <= 2 )
5480 { 5480 {
5481 v5 = pItemsTable->pItems[this->pInventoryItems[this->pEquipment.uMainHand].uItemID].uDamageDice + pItemsTable->pItems[this->pInventoryItems[this->pEquipment.uMainHand].uItemID].uDamageMod; 5481 v5 = pItemsTable->pItems[this->pInventoryItems[this->pEquipment.uMainHand].uItemID].uDamageDice + pItemsTable->pItems[this->pInventoryItems[this->pEquipment.uMainHand].uItemID].uDamageMod;
5482 if ( !v6->pEquipment.uOffHand ) 5482 if ( !v6->pEquipment.uShield )
5483 { 5483 {
5484 if ( pItemsTable->pItems[this->pInventoryItems[this->pEquipment.uMainHand].uItemID].uSkillType == 4 ) 5484 if ( pItemsTable->pItems[this->pInventoryItems[this->pEquipment.uMainHand].uItemID].uSkillType == 4 )
5485 ++v5; 5485 ++v5;
5486 } 5486 }
5487 } 5487 }
5488 } 5488 }
5489 } 5489 }
5490 if ( a3 || !v6->HasItemEquipped(EQUIP_OFF_HAND) || (v12 = v6->GetEquippedItemEquipType(EQUIP_OFF_HAND), v12 < 0) || v12 > 2 ) 5490 if ( a3 || !v6->HasItemEquipped(EQUIP_OFF_HAND) || (v12 = v6->GetEquippedItemEquipType(EQUIP_OFF_HAND), v12 < 0) || v12 > 2 )
5491 return v5 + v62 + v61; 5491 return v5 + v62 + v61;
5492 v14 = pItemsTable->pItems[this->pInventoryItems[this->pEquipment.uOffHand].uItemID].uDamageMod; 5492 v14 = pItemsTable->pItems[this->pInventoryItems[this->pEquipment.uShield].uItemID].uDamageMod;
5493 v15 = pItemsTable->pItems[this->pInventoryItems[this->pEquipment.uOffHand].uItemID].uDamageDice; 5493 v15 = pItemsTable->pItems[this->pInventoryItems[this->pEquipment.uShield].uItemID].uDamageDice;
5494 LABEL_88: 5494 LABEL_88:
5495 v5 += v15 + v14; 5495 v5 += v15 + v14;
5496 } 5496 }
5497 return v5 + v62 + v61; 5497 return v5 + v62 + v61;
5498 } 5498 }
6188 v71 = (ITEM_EQUIP_TYPE)0; 6188 v71 = (ITEM_EQUIP_TYPE)0;
6189 v68 = 16; 6189 v68 = 16;
6190 v69 = &v2->pEquipment; 6190 v69 = &v2->pEquipment;
6191 do 6191 do
6192 { 6192 {
6193 if ( !v69->uOffHand || (v42 = (int)((char *)v2 + 36 * v69->uOffHand), *(char *)(v42 + 516) & 2) ) 6193 if ( !v69->uShield || (v42 = (int)((char *)v2 + 36 * v69->uShield), *(char *)(v42 + 516) & 2) )
6194 goto LABEL_117; 6194 goto LABEL_117;
6195 v43 = (PLAYER_SKILL_TYPE)pItemsTable->pItems[*(int *)(v42 + 496)].uSkillType; 6195 v43 = (PLAYER_SKILL_TYPE)pItemsTable->pItems[*(int *)(v42 + 496)].uSkillType;
6196 v44 = pItemsTable->pItems[*(int *)(v42 + 496)].uSkillType; 6196 v44 = pItemsTable->pItems[*(int *)(v42 + 496)].uSkillType;
6197 if ( !v44 ) 6197 if ( !v44 )
6198 { 6198 {