aboutsummaryrefslogtreecommitdiff
path: root/src/game/Unit.cpp
diff options
context:
space:
mode:
authormegamage <none@none>2009-04-23 22:07:37 -0500
committermegamage <none@none>2009-04-23 22:07:37 -0500
commitd4c15bb11a5c42cfdd3faee6922c5a0560bdbc83 (patch)
treef396253712190aaea2683625fd3f4e0639f3bb29 /src/game/Unit.cpp
parente99139797140b9d96fea0594330b4e6f41832a72 (diff)
[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
Diffstat (limited to 'src/game/Unit.cpp')
-rw-r--r--src/game/Unit.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 6cb446af503..97bd836f5de 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -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);
}