[8547] implemented scriptcall: CorpseRemoved(uint32 & /*respawnDelay*/)

it will be called when the corpse of the scripted creature
get's removed,
it's possible to adjust the next respawn inside the script
This commit is contained in:
balrok 2009-09-24 15:21:05 +02:00
parent 0208c54bc9
commit 1665077dc4
3 changed files with 9 additions and 2 deletions

View file

@ -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);

View file

@ -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; }

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "8546"
#define REVISION_NR "8547"
#endif // __REVISION_NR_H__