mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-21 01:37:37 +01:00
[7703] Implement heal/damage total counters and related BG achievments. Author: Trazom
* ACHIEVEMENT_CRITERIA_TYPE_DAMAGE_DONE
* ACHIEVEMENT_CRITERIA_TYPE_HEALING_DONE
--HG--
branch : trunk
This commit is contained in:
@@ -665,6 +665,7 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa
|
||||
}
|
||||
}
|
||||
|
||||
killer->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_DAMAGE_DONE, damage, 0, pVictim);
|
||||
killer->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HIT_DEALT, damage);
|
||||
}
|
||||
|
||||
@@ -8168,12 +8169,9 @@ int32 Unit::DealHeal(Unit *pVictim, uint32 addhealth, SpellEntry const *spellPro
|
||||
if (BattleGround *bg = ((Player*)this)->GetBattleGround())
|
||||
bg->UpdatePlayerScore((Player*)this, SCORE_HEALING_DONE, gain);
|
||||
|
||||
// healing done is count ONLY if the target is a player.
|
||||
if (pVictim->GetTypeId()==TYPEID_PLAYER)
|
||||
{
|
||||
// use the actual gain, as the overheal shall not be counted.
|
||||
((Player*)this)->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HEALING_DONE, gain);
|
||||
}
|
||||
// use the actual gain, as the overheal shall not be counted, skip gain 0 (it ignored anyway in to criteria)
|
||||
if (gain)
|
||||
((Player*)this)->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HEALING_DONE, gain, 0, pVictim);
|
||||
|
||||
((Player*)this)->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HEAL_CASTED, addhealth);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user