diff options
| author | maximius <none@none> | 2009-10-09 20:48:55 -0700 |
|---|---|---|
| committer | maximius <none@none> | 2009-10-09 20:48:55 -0700 |
| commit | b4c7a2514d9844fccc46fc78aee0b34d1b26161e (patch) | |
| tree | 6721c91c521fc3aa86dd6786877b1742b77b0e2c /src/game/Player.cpp | |
| parent | 3ccc348b099467441bb954147cd997fb42861951 (diff) | |
*Blackfathom Deeps - Event: Aku'mai, by Tartalo
*Split Personality Achivement, by Destalker
*Halls of Lightning Fixes, by Destalker
Volkhan fixes + Achievement
Ionar Fix - without this he resets each time he is invisible, spamming sparks
Arcing Burn - should be a debuff (and stackable, stackable part NYI :/)
*Naxxramas - Thaddius - the aura shall affect only the character without the proper aura, by Trazom
*Naxxramas - Kelthuzad - some timer adjustments (may need verification or tweaking) by Cass
*Merges by Stryker, thanks to all authors and testers.
[8458] Re-implement SPELL_AURA_MOD_TARGET_ARMOR_PCT in more porper way for weapon dependent cases. Author: VladimirMangos
[8459] Avoid mutiply apply weapon dependent armor penetration bonus for each weapon. Author: VladimirMangos
[8529] check rune cost only if spell has PowerType == POWER_RUNE. Patch provided by yavi. Author: Ambal
[8532] Fixed situation where some items like 42947 were not giving spell power bonus. By: Ambal
[8533] Not remove timed quest and correctly fail when time runs out. Add function to remove timed quest instead of direct access to set. Author: NoFantasy
[8536] Fixed spell 62776. By: Ambal
[8539] Check pet aura range at area aura update. By: Ambal
[8546] Implement battleground bonusweekends call to arms. Also fix typo in auctionmgr. Author: balrok
[8547] Implemented scriptcall: CorpseRemoved(uint32 & /*respawnDelay*/) it will be called when the corpse of the scripted creature get's removed, it's possible to adjust the next respawn inside the script. Author: balrok
[8561] Replace another auras code call by explicit code
[8566] avoid singleton-lock when accessing BattleGroundMGR::isBGWeekend() Proposed by vladimir. Comitter: balrok
--HG--
branch : trunk
Diffstat (limited to 'src/game/Player.cpp')
| -rw-r--r-- | src/game/Player.cpp | 48 |
1 files changed, 31 insertions, 17 deletions
diff --git a/src/game/Player.cpp b/src/game/Player.cpp index e2c9b875c7c..de731b5c5b5 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -449,6 +449,7 @@ Player::Player (WorldSession *session): Unit(), m_achievementMgr(this), m_reputa m_baseSpellPower = 0; m_baseFeralAP = 0; m_baseManaRegen = 0; + m_armorPenetrationPct = 0.0f; // Honor System m_lastHonorUpdateTime = time(NULL); @@ -5287,7 +5288,7 @@ void Player::ApplyRatingMod(CombatRating cr, int32 value, bool apply) break; case CR_ARMOR_PENETRATION: if(affectStats) - UpdateArmorPenetration(amount); + UpdateArmorPenetration(); break; } } @@ -7083,6 +7084,13 @@ void Player::_ApplyItemBonuses(ItemPrototype const *proto, uint8 slot, bool appl } } + // Apply Spell Power from ScalingStatValue if set + if(ssv) + { + if (int32 spellbonus = ssv->getSpellBonus(proto->ScalingStatValue)) + ApplySpellPowerBonus(spellbonus, apply); + } + // If set ScalingStatValue armor get it or use item armor uint32 armor = proto->Armor; if (ssv) @@ -11043,9 +11051,15 @@ Item* Player::EquipItem( uint16 pos, Item *pItem, bool update ) // update expertise and armor penetration - passive auras may need it if( slot == EQUIPMENT_SLOT_MAINHAND ) + { UpdateExpertise(BASE_ATTACK); + UpdateArmorPenetration(); + } else if( slot == EQUIPMENT_SLOT_OFFHAND ) + { UpdateExpertise(OFF_ATTACK); + UpdateArmorPenetration(); + } switch(slot) { @@ -11195,6 +11209,7 @@ void Player::RemoveItem( uint8 bag, uint8 slot, bool update ) } UpdateExpertise(BASE_ATTACK); + UpdateArmorPenetration(); } else if( slot == EQUIPMENT_SLOT_OFFHAND ) UpdateExpertise(OFF_ATTACK); @@ -11204,7 +11219,7 @@ void Player::RemoveItem( uint8 bag, uint8 slot, bool update ) case EQUIPMENT_SLOT_MAINHAND: case EQUIPMENT_SLOT_OFFHAND: case EQUIPMENT_SLOT_RANGED: - RecalculateRating(CR_ARMOR_PENETRATION); + UpdateArmorPenetration(); default: break; } @@ -11321,15 +11336,21 @@ void Player::DestroyItem( uint8 bag, uint8 slot, bool update ) case EQUIPMENT_SLOT_MAINHAND: case EQUIPMENT_SLOT_OFFHAND: case EQUIPMENT_SLOT_RANGED: - RecalculateRating(CR_ARMOR_PENETRATION); + UpdateArmorPenetration(); default: break; } - if ( slot == EQUIPMENT_SLOT_MAINHAND ) + if( slot == EQUIPMENT_SLOT_MAINHAND ) + { UpdateExpertise(BASE_ATTACK); + UpdateArmorPenetration(); + } else if( slot == EQUIPMENT_SLOT_OFFHAND ) + { UpdateExpertise(OFF_ATTACK); + UpdateArmorPenetration(); + } // equipment visual show SetVisibleItemSlot(slot, NULL); @@ -13216,9 +13237,7 @@ void Player::RewardQuest( Quest const *pQuest, uint32 reward, Object* questGiver } } - //if( qInfo->HasSpecialFlag( QUEST_FLAGS_TIMED ) ) - // SetTimedQuest( 0 ); - m_timedquests.erase(pQuest->GetQuestId()); + RemoveTimedQuest(quest_id); if (pQuest->GetRewChoiceItemsCount() > 0) { @@ -13430,6 +13449,7 @@ void Player::FailQuest(uint32 questId) { QuestStatusData& q_status = mQuestStatus[questId]; + RemoveTimedQuest(questId); q_status.m_timer = 0; SendQuestTimerFailed(questId); @@ -13655,12 +13675,12 @@ bool Player::SatisfyQuestStatus( Quest const* qInfo, bool msg ) return true; } -bool Player::SatisfyQuestTimed( Quest const* qInfo, bool msg ) +bool Player::SatisfyQuestTimed(Quest const* qInfo, bool msg) { - if ( (find(m_timedquests.begin(), m_timedquests.end(), qInfo->GetQuestId()) != m_timedquests.end()) && qInfo->HasFlag(QUEST_TRINITY_FLAGS_TIMED) ) + if (m_timedquests.empty() && qInfo->HasFlag(QUEST_TRINITY_FLAGS_TIMED)) { - if( msg ) - SendCanTakeQuestResponse( INVALIDREASON_QUEST_ONLY_ONE_TIMED ); + if (msg) + SendCanTakeQuestResponse(INVALIDREASON_QUEST_ONLY_ONE_TIMED); return false; } return true; @@ -13888,12 +13908,6 @@ void Player::SetQuestStatus(uint32 quest_id, QuestStatus status) { if (Quest const* qInfo = objmgr.GetQuestTemplate(quest_id)) { - if (status == QUEST_STATUS_NONE || status == QUEST_STATUS_INCOMPLETE || status == QUEST_STATUS_COMPLETE || status == QUEST_STATUS_FAILED) - { - if (qInfo->HasFlag(QUEST_TRINITY_FLAGS_TIMED)) - m_timedquests.erase(qInfo->GetQuestId()); - } - QuestStatusData& q_status = mQuestStatus[quest_id]; q_status.m_status = status; |
