diff options
Diffstat (limited to 'src/game/Unit.cpp')
-rw-r--r-- | src/game/Unit.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index e73f8ec80de..607018cd8cb 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -53,6 +53,7 @@ #include "TemporarySummon.h" #include "Vehicle.h" #include "Transports.h" +#include "ScriptCalls.h" #include <math.h> @@ -778,6 +779,14 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa ((Player*)pVictim)->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_TOTAL_DAMAGE_RECEIVED, health); Kill(pVictim, durabilityLoss); + + //Hook for OnPVPKill Event + if (pVictim->GetTypeId() == TYPEID_PLAYER && this->GetTypeId() == TYPEID_PLAYER) + { + Player *killer = ((Player*)this); + Player *killed = ((Player*)pVictim); + Script->OnPVPKill(killer, killed); + } } else // if (health <= damage) { |