mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 16:37:01 +00:00
[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:
parent
6756fff93a
commit
3332ed72a6
3 changed files with 10 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue