From 8a3be45af07b6f59bf866f44e16733c6cce1dbb4 Mon Sep 17 00:00:00 2001 From: Xfurry Date: Fri, 31 May 2013 11:58:02 +0100 Subject: [PATCH] [c12611] Implement virtual void HealedBy --- src/game/CreatureAI.h | 8 ++++++-- src/game/Unit.cpp | 4 ++++ src/shared/revision_nr.h | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/game/CreatureAI.h b/src/game/CreatureAI.h index 4ec8dc08b..913bc3a1b 100644 --- a/src/game/CreatureAI.h +++ b/src/game/CreatureAI.h @@ -102,8 +102,12 @@ class MANGOS_DLL_SPEC CreatureAI */ 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) diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 91a9c6b8d..18d263c15 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -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); } + // Script Event HealedBy + if (pVictim->GetTypeId() == TYPEID_UNIT && ((Creature*)pVictim)->AI()) + ((Creature*)pVictim)->AI()->HealedBy(this, addhealth); + return gain; } diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 6bbb63d7e..5ed854275 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "12610" + #define REVISION_NR "12611" #endif // __REVISION_NR_H__