mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 07:37:01 +00:00
[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:
parent
0208c54bc9
commit
1665077dc4
3 changed files with 9 additions and 2 deletions
|
|
@ -160,7 +160,11 @@ void Creature::RemoveCorpse()
|
||||||
setDeathState(DEAD);
|
setDeathState(DEAD);
|
||||||
ObjectAccessor::UpdateObjectVisibility(this);
|
ObjectAccessor::UpdateObjectVisibility(this);
|
||||||
loot.clear();
|
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;
|
float x,y,z,o;
|
||||||
GetRespawnCoord(x, y, z, &o);
|
GetRespawnCoord(x, y, z, &o);
|
||||||
|
|
|
||||||
|
|
@ -109,6 +109,9 @@ class MANGOS_DLL_SPEC CreatureAI
|
||||||
// Is unit visible for MoveInLineOfSight
|
// Is unit visible for MoveInLineOfSight
|
||||||
virtual bool IsVisible(Unit *) const { return false; }
|
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
|
// Called when victim entered water and creature can not enter water
|
||||||
virtual bool canReachByRangeAttack(Unit*) { return false; }
|
virtual bool canReachByRangeAttack(Unit*) { return false; }
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "8546"
|
#define REVISION_NR "8547"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue