[10393] Add script call for InstanceData, OnPlayerDeath

Called when a player really dies and also unrelated to the source of the death (for example a player can die indirectly from some mob ability, but must be registered. Achievements, other special events)

Signed-off-by: NoFantasy <nofantasy@nf.no>
This commit is contained in:
NoFantasy 2010-08-21 13:19:24 +02:00
parent 6756fff93a
commit 3332ed72a6
3 changed files with 10 additions and 1 deletions

View file

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