comparison Player.cpp @ 1605:434b796cdfd3

Player::GetMagicalBonus cleaned up, identified a few player only effect spells used in mm6
author Grumpy7
date Sat, 14 Sep 2013 06:46:12 +0200
parents 4b79ff62df3a
children 8e3c6d7631f1
comparison
equal deleted inserted replaced
1604:4b79ff62df3a 1605:434b796cdfd3
2762 armsmaster_recovery_reduction *= 2; 2762 armsmaster_recovery_reduction *= 2;
2763 } 2763 }
2764 } 2764 }
2765 2765
2766 uint hasteRecoveryReduction = 0; 2766 uint hasteRecoveryReduction = 0;
2767 if (pPlayerBuffs[PLAYER_BUFF_7].uExpireTime > 0 || pParty->pPartyBuffs[PARTY_BUFF_HASTE].uExpireTime > 0 ) 2767 if (pPlayerBuffs[PLAYER_BUFF_HASTE].uExpireTime > 0 || pParty->pPartyBuffs[PARTY_BUFF_HASTE].uExpireTime > 0 )
2768 hasteRecoveryReduction = 25; 2768 hasteRecoveryReduction = 25;
2769 2769
2770 uint weapon_enchantment_recovery_reduction = 0; 2770 uint weapon_enchantment_recovery_reduction = 0;
2771 if ( weapon ) 2771 if ( weapon )
2772 { 2772 {
3391 } 3391 }
3392 3392
3393 //----- (0048F73C) -------------------------------------------------------- 3393 //----- (0048F73C) --------------------------------------------------------
3394 int Player::GetMagicalBonus(enum CHARACTER_ATTRIBUTE_TYPE a2) 3394 int Player::GetMagicalBonus(enum CHARACTER_ATTRIBUTE_TYPE a2)
3395 { 3395 {
3396 int result; // eax@1 3396 int v3 = 0; // eax@4
3397 int v3; // eax@4 3397 int v4 = 0; // ecx@5
3398 int v4; // ecx@5 3398
3399
3400 switch (a2)
3401 {
3402 case CHARACTER_ATTRIBUTE_LEVEL: return 0;
3403 }
3404
3405 result = 0;
3406 if ( (signed int)a2 > 10 )
3407 {
3408 if ( (signed int)a2 <= 15 )
3409 {
3410 switch ( a2 )
3411 {
3412 case CHARACTER_ATTRIBUTE_RESIST_BODY:
3413 v3 = this->pPlayerBuffs[2].uPower;
3414 v4 = pParty->pPartyBuffs[PARTY_BUFF_RESIST_BODY].uPower;
3415 break;
3416 case CHARACTER_ATTRIBUTE_RESIST_AIR:
3417 v3 = this->pPlayerBuffs[0].uPower;
3418 v4 = pParty->pPartyBuffs[PARTY_BUFF_RESIST_AIR].uPower;
3419 break;
3420 case CHARACTER_ATTRIBUTE_RESIST_WATER:
3421 v3 = this->pPlayerBuffs[22].uPower;
3422 v4 = pParty->pPartyBuffs[PARTY_BUFF_RESIST_WATER].uPower;
3423 break;
3424 case CHARACTER_ATTRIBUTE_RESIST_EARTH:
3425 v3 = this->pPlayerBuffs[3].uPower;
3426 v4 = pParty->pPartyBuffs[PARTY_BUFF_RESIST_EARTH].uPower;
3427 break;
3428 default:
3429 if ( a2 != 14 )
3430 return result;
3431 v3 = this->pPlayerBuffs[9].uPower;
3432 v4 = pParty->pPartyBuffs[PARTY_BUFF_RESIST_MIND].uPower;
3433 break;
3434 }
3435 return v4 + v3;
3436 }
3437 if ( a2 != CHARACTER_ATTRIBUTE_ATTACK )
3438 {
3439 if ( a2 == CHARACTER_ATTRIBUTE_MELEE_DMG_BONUS )
3440 {
3441 v3 = this->pPlayerBuffs[8].uPower;
3442 v4 = pParty->pPartyBuffs[PARTY_BUFF_HEROISM].uPower;
3443 return v4 + v3;
3444 }
3445 if ( a2 != CHARACTER_ATTRIBUTE_RANGED_ATTACK )
3446 return result;
3447 }
3448 return this->pPlayerBuffs[1].uPower;
3449 }
3450 if ( a2 == 10 )
3451 {
3452 v3 = this->pPlayerBuffs[5].uPower;
3453 v4 = pParty->pPartyBuffs[PARTY_BUFF_RESIST_FIRE].uPower;
3454 return v4 + v3;
3455 }
3456 switch ( a2 ) 3399 switch ( a2 )
3457 { 3400 {
3401 case CHARACTER_ATTRIBUTE_RESIST_FIRE:
3402 v3 = this->pPlayerBuffs[PLAYER_BUFF_RESIST_FIRE].uPower;
3403 v4 = pParty->pPartyBuffs[PARTY_BUFF_RESIST_FIRE].uPower;
3404 break;
3405 case CHARACTER_ATTRIBUTE_RESIST_AIR:
3406 v3 = this->pPlayerBuffs[PLAYER_BUFF_RESIST_AIR].uPower;
3407 v4 = pParty->pPartyBuffs[PARTY_BUFF_RESIST_AIR].uPower;
3408 break;
3409 case CHARACTER_ATTRIBUTE_RESIST_BODY:
3410 v3 = this->pPlayerBuffs[PLAYER_BUFF_RESIST_BODY].uPower;
3411 v4 = pParty->pPartyBuffs[PARTY_BUFF_RESIST_BODY].uPower;
3412 break;
3413 case CHARACTER_ATTRIBUTE_RESIST_WATER:
3414 v3 = this->pPlayerBuffs[PLAYER_BUFF_RESIST_WATER].uPower;
3415 v4 = pParty->pPartyBuffs[PARTY_BUFF_RESIST_WATER].uPower;
3416 break;
3417 case CHARACTER_ATTRIBUTE_RESIST_EARTH:
3418 v3 = this->pPlayerBuffs[PLAYER_BUFF_RESIST_EARTH].uPower;
3419 v4 = pParty->pPartyBuffs[PARTY_BUFF_RESIST_EARTH].uPower;
3420 break;
3421 case CHARACTER_ATTRIBUTE_RESIST_MIND:
3422 v3 = this->pPlayerBuffs[PLAYER_BUFF_RESIST_MIND].uPower;
3423 v4 = pParty->pPartyBuffs[PARTY_BUFF_RESIST_MIND].uPower;
3424 break;
3425 case CHARACTER_ATTRIBUTE_ATTACK:
3426 case CHARACTER_ATTRIBUTE_RANGED_ATTACK:
3427 v3 = this->pPlayerBuffs[PLAYER_BUFF_BLESS].uPower; //only player effect spell in both VI and VII
3428 break;
3429 case CHARACTER_ATTRIBUTE_MELEE_DMG_BONUS:
3430 v3 = this->pPlayerBuffs[PLAYER_BUFF_HEROISM].uPower;
3431 v4 = pParty->pPartyBuffs[PARTY_BUFF_HEROISM].uPower;
3432 break;
3458 case CHARACTER_ATTRIBUTE_STRENGTH: 3433 case CHARACTER_ATTRIBUTE_STRENGTH:
3459 v3 = pPlayerBuffs[19].uPower; 3434 v3 = pPlayerBuffs[PLAYER_BUFF_STRENGTH].uPower;
3460 goto LABEL_5; 3435 v4 = pParty->pPartyBuffs[PARTY_BUFF_DAY_OF_GODS].uPower;
3436 break;
3461 case CHARACTER_ATTRIBUTE_INTELLIGENCE: 3437 case CHARACTER_ATTRIBUTE_INTELLIGENCE:
3462 v3 = pPlayerBuffs[17].uPower; 3438 v3 = pPlayerBuffs[PLAYER_BUFF_INTELLIGENCE].uPower;
3463 goto LABEL_5; 3439 v4 = pParty->pPartyBuffs[PARTY_BUFF_DAY_OF_GODS].uPower;
3440 break;
3464 case CHARACTER_ATTRIBUTE_WILLPOWER: 3441 case CHARACTER_ATTRIBUTE_WILLPOWER:
3465 v3 = pPlayerBuffs[20].uPower; 3442 v3 = pPlayerBuffs[PLAYER_BUFF_WILLPOWER].uPower;
3466 goto LABEL_5; 3443 v4 = pParty->pPartyBuffs[PARTY_BUFF_DAY_OF_GODS].uPower;
3444 break;
3467 case CHARACTER_ATTRIBUTE_ENDURANCE: 3445 case CHARACTER_ATTRIBUTE_ENDURANCE:
3468 v3 = pPlayerBuffs[16].uPower; 3446 v3 = pPlayerBuffs[PLAYER_BUFF_ENDURANCE].uPower;
3469 goto LABEL_5; 3447 v4 = pParty->pPartyBuffs[PARTY_BUFF_DAY_OF_GODS].uPower;
3448 break;
3470 case CHARACTER_ATTRIBUTE_ACCURACY: 3449 case CHARACTER_ATTRIBUTE_ACCURACY:
3471 v3 = pPlayerBuffs[15].uPower; 3450 v3 = pPlayerBuffs[PLAYER_BUFF_ACCURACY].uPower;
3472 goto LABEL_5; 3451 v4 = pParty->pPartyBuffs[PARTY_BUFF_DAY_OF_GODS].uPower;
3452 break;
3473 case CHARACTER_ATTRIBUTE_SPEED: 3453 case CHARACTER_ATTRIBUTE_SPEED:
3474 v3 = pPlayerBuffs[21].uPower; 3454 v3 = pPlayerBuffs[PLAYER_BUFF_SPEED].uPower;
3475 goto LABEL_5; 3455 v4 = pParty->pPartyBuffs[PARTY_BUFF_DAY_OF_GODS].uPower;
3456 break;
3476 case CHARACTER_ATTRIBUTE_LUCK: 3457 case CHARACTER_ATTRIBUTE_LUCK:
3477 v3 = pPlayerBuffs[18].uPower; 3458 v3 = pPlayerBuffs[PLAYER_BUFF_LUCK].uPower;
3478 LABEL_5:
3479 v4 = pParty->pPartyBuffs[PARTY_BUFF_DAY_OF_GODS].uPower; 3459 v4 = pParty->pPartyBuffs[PARTY_BUFF_DAY_OF_GODS].uPower;
3480 return v4 + v3; 3460 break;
3481 case CHARACTER_ATTRIBUTE_AC_BONUS: 3461 case CHARACTER_ATTRIBUTE_AC_BONUS:
3482 v3 = this->pPlayerBuffs[14].uPower; 3462 v3 = this->pPlayerBuffs[PLAYER_BUFF_STONESKIN].uPower;
3483 v4 = pParty->pPartyBuffs[PARTY_BUFF_STONE_SKIN].uPower; 3463 v4 = pParty->pPartyBuffs[PARTY_BUFF_STONE_SKIN].uPower;
3484 return v4 + v3; 3464 break;
3485 default: 3465 }
3486 return result; 3466 return v3 + v4;
3487 }
3488 return result;
3489 } 3467 }
3490 3468
3491 //----- (0048F882) -------------------------------------------------------- 3469 //----- (0048F882) --------------------------------------------------------
3492 int Player::GetActualSkillLevel( PLAYER_SKILL_TYPE uSkillType ) 3470 int Player::GetActualSkillLevel( PLAYER_SKILL_TYPE uSkillType )
3493 { 3471 {