[c12611] Implement virtual void HealedBy

This commit is contained in:
Xfurry 2013-05-31 11:58:02 +01:00 committed by Antz
parent 662d4ac061
commit 8a3be45af0
3 changed files with 11 additions and 3 deletions

View file

@ -102,8 +102,12 @@ class MANGOS_DLL_SPEC CreatureAI
*/ */
virtual void JustReachedHome() {} virtual void JustReachedHome() {}
// Called at any heal cast/item used (call non implemented) /**
// virtual void HealBy(Unit * /*healer*/, uint32 /*amount_healed*/) {} * Called at any Heal received from any Unit
* @param pHealer Unit* which deals the heal
* @param uiHealedAmount Amount of healing received
*/
virtual void HealedBy(Unit * /*pHealer*/, uint32& /*uiHealedAmount*/) {}
/** /**
* Called at any Damage to any victim (before damage apply) * Called at any Damage to any victim (before damage apply)

View file

@ -6472,6 +6472,10 @@ int32 Unit::DealHeal(Unit* pVictim, uint32 addhealth, SpellEntry const* spellPro
((Player*)pVictim)->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HEALING_RECEIVED, addhealth); ((Player*)pVictim)->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HEALING_RECEIVED, addhealth);
} }
// Script Event HealedBy
if (pVictim->GetTypeId() == TYPEID_UNIT && ((Creature*)pVictim)->AI())
((Creature*)pVictim)->AI()->HealedBy(this, addhealth);
return gain; return gain;
} }

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "12610" #define REVISION_NR "12611"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__