aboutsummaryrefslogtreecommitdiff
path: root/src/game/Unit.cpp
diff options
context:
space:
mode:
authorXanadu <none@none>2010-03-20 04:18:08 +0100
committerXanadu <none@none>2010-03-20 04:18:08 +0100
commit34fb5df5698470f19c733e34bd0c28450130a55f (patch)
treeeb453a6eb4065ec5bcf33c9eb24e30c10013f7ae /src/game/Unit.cpp
parent7a8dff70ed6ff534681a8e839f7b2d6a35fa7692 (diff)
Fixed KILL proc to occur for the unit that lands the killing blow, not for the loot recipient.
--HG-- branch : trunk
Diffstat (limited to 'src/game/Unit.cpp')
-rw-r--r--src/game/Unit.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 8608daa55fc..f95d58bbf88 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -14585,12 +14585,16 @@ void Unit::Kill(Unit *pVictim, bool durabilityLoss)
loot->generateMoneyLoot(creature->GetCreatureInfo()->mingold,creature->GetCreatureInfo()->maxgold);
}
+ }
- if (player->RewardPlayerAndGroupAtKill(pVictim))
- player->ProcDamageAndSpell(pVictim, PROC_FLAG_KILL, PROC_FLAG_KILLED, PROC_EX_NONE, 0);
- else
- player->ProcDamageAndSpell(pVictim, PROC_FLAG_NONE, PROC_FLAG_KILLED, PROC_EX_NONE, 0);
+ // Do KILL and KILLED procs. KILL proc is called only for the unit who landed the killing blow (or its owner - for pets) regardless of who tapped the victim
+ if (isPet())
+ {
+ if (Unit *owner = GetOwner())
+ owner->ProcDamageAndSpell(pVictim, PROC_FLAG_KILL, PROC_FLAG_KILLED, PROC_EX_NONE, 0);
}
+ else
+ ProcDamageAndSpell(pVictim, PROC_FLAG_KILL, PROC_FLAG_KILLED, PROC_EX_NONE, 0);
// Proc auras on death - must be before aura/combat remove
pVictim->ProcDamageAndSpell(NULL, PROC_FLAG_DEATH, PROC_FLAG_NONE, PROC_EX_NONE, 0, BASE_ATTACK, 0);