aboutsummaryrefslogtreecommitdiff
path: root/src/game/Unit.cpp
diff options
context:
space:
mode:
authormaximius <none@none>2009-09-13 00:01:35 -0700
committermaximius <none@none>2009-09-13 00:01:35 -0700
commiteef5abe6e1931eeae91d3a1ed68a3bf44237dea2 (patch)
treeb4d2edf33613bfefe67bd534b0e3fe9622617ff7 /src/game/Unit.cpp
parentc61bb37a0e80aae1dc24618782647c43d2feb174 (diff)
*Event Hooks (OnLogin, OnLogout, OnPVPKill) by Hawthorne
*Boss Emote Command for DB Scripts by XTElite1 --HG-- branch : trunk
Diffstat (limited to 'src/game/Unit.cpp')
-rw-r--r--src/game/Unit.cpp9
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)
{