diff --git a/src/game/InstanceData.h b/src/game/InstanceData.h index d45f8c99c..f3e68efcc 100644 --- a/src/game/InstanceData.h +++ b/src/game/InstanceData.h @@ -57,6 +57,9 @@ class MANGOS_DLL_SPEC InstanceData //Called when a player successfully enters the instance (after really added to map) virtual void OnPlayerEnter(Player *) {} + //Called when a player dies inside instance + virtual void OnPlayerDeath(Player *) {} + //Called when a player leaves the instance (before really removed from map (or possibly world)) virtual void OnPlayerLeave(Player *) {} diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 398948287..261394b34 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -37,6 +37,7 @@ #include "MapManager.h" #include "MapInstanced.h" #include "InstanceSaveMgr.h" +#include "InstanceData.h" #include "GridNotifiers.h" #include "GridNotifiersImpl.h" #include "CellImpl.h" @@ -1508,10 +1509,15 @@ void Player::setDeathState(DeathState s) // passive spell if(!ressSpellId) ressSpellId = GetResurrectionSpellId(); + GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_DEATH_AT_MAP, 1); GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_DEATH, 1); GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_DEATH_IN_DUNGEON, 1); + + if (InstanceData* mapInstance = this->GetInstanceData()) + mapInstance->OnPlayerDeath(this); } + Unit::setDeathState(s); // restore resurrection spell id for player after aura remove diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index bdf5b52b0..c96b1d9f1 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 "10392" + #define REVISION_NR "10393" #endif // __REVISION_NR_H__