diff --git a/src/game/Creature.cpp b/src/game/Creature.cpp index c407f733d..d6c25141d 100644 --- a/src/game/Creature.cpp +++ b/src/game/Creature.cpp @@ -160,7 +160,11 @@ void Creature::RemoveCorpse() setDeathState(DEAD); ObjectAccessor::UpdateObjectVisibility(this); loot.clear(); - m_respawnTime = time(NULL) + m_respawnDelay; + uint32 respawnDelay = m_respawnDelay; + if (AI()) + AI()->CorpseRemoved(respawnDelay); + + m_respawnTime = time(NULL) + respawnDelay; float x,y,z,o; GetRespawnCoord(x, y, z, &o); diff --git a/src/game/CreatureAI.h b/src/game/CreatureAI.h index 778c2c6d1..a9857eb2a 100644 --- a/src/game/CreatureAI.h +++ b/src/game/CreatureAI.h @@ -109,6 +109,9 @@ class MANGOS_DLL_SPEC CreatureAI // Is unit visible for MoveInLineOfSight virtual bool IsVisible(Unit *) const { return false; } + // called when the corpse of this creature gets removed + virtual void CorpseRemoved(uint32 & /*respawnDelay*/) {} + // Called when victim entered water and creature can not enter water virtual bool canReachByRangeAttack(Unit*) { return false; } diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 9754a3804..1bd7e517b 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 "8546" + #define REVISION_NR "8547" #endif // __REVISION_NR_H__