From fb950c00ee64860ca818465ea93abb144fbaafc6 Mon Sep 17 00:00:00 2001 From: Manuel Date: Mon, 24 Jan 2011 18:56:06 -0300 Subject: [PATCH] Core/ZoneScript: Implemented OnCreatureDeath function. Signed-off-by: Manuel --- src/server/game/Entities/Creature/Creature.cpp | 3 +++ src/server/game/Maps/ZoneScript.h | 2 ++ 2 files changed, 5 insertions(+) diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index 13e3234412f..81fef99cf26 100755 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -1525,6 +1525,9 @@ void Creature::setDeathState(DeathState s) if (m_formation && m_formation->getLeader() == this) m_formation->FormationReset(true); + if (ZoneScript* zoneScript = GetZoneScript()) + zoneScript->OnCreatureDeath(this); + if ((canFly() || IsFlying()) && FallGround()) return; diff --git a/src/server/game/Maps/ZoneScript.h b/src/server/game/Maps/ZoneScript.h index d9e8d132831..0147e333f41 100755 --- a/src/server/game/Maps/ZoneScript.h +++ b/src/server/game/Maps/ZoneScript.h @@ -38,6 +38,8 @@ class ZoneScript virtual void OnGameObjectCreate(GameObject *) {} virtual void OnGameObjectRemove(GameObject *) {} + virtual void OnCreatureDeath(Creature* /*creature*/) {} + //All-purpose data storage 64 bit virtual uint64 GetData64(uint32 /*DataId*/) { return 0; } virtual void SetData64(uint32 /*DataId*/, uint64 /*Value*/) {}