mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-29 13:22:48 +01:00
Scripts/Naxxramas: Fix achievement The Immortal / The Undying (#27937)
(cherry picked from commit ea41ef261e)
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
#include "Map.h"
|
||||
#include "naxxramas.h"
|
||||
#include "TemporarySummon.h"
|
||||
#include <sstream>
|
||||
|
||||
BossBoundaryData const boundaries =
|
||||
{
|
||||
@@ -124,7 +125,7 @@ class instance_naxxramas : public InstanceMapScript
|
||||
hadSapphironBirth = false;
|
||||
CurrentWingTaunt = SAY_KELTHUZAD_FIRST_WING_TAUNT;
|
||||
|
||||
playerDied = 0;
|
||||
playerDied = false;
|
||||
}
|
||||
|
||||
void OnCreatureCreate(Creature* creature) override
|
||||
@@ -249,9 +250,9 @@ class instance_naxxramas : public InstanceMapScript
|
||||
|
||||
void OnUnitDeath(Unit* unit) override
|
||||
{
|
||||
if (unit->GetTypeId() == TYPEID_PLAYER && IsEncounterInProgress())
|
||||
if (!playerDied && unit->IsPlayer() && IsEncounterInProgress())
|
||||
{
|
||||
playerDied = 1;
|
||||
playerDied = true;
|
||||
SaveToDB();
|
||||
}
|
||||
|
||||
@@ -551,6 +552,18 @@ class instance_naxxramas : public InstanceMapScript
|
||||
return false;
|
||||
}
|
||||
|
||||
void WriteSaveDataMore(std::ostringstream& data) override
|
||||
{
|
||||
data << uint32(playerDied ? 1 : 0);
|
||||
}
|
||||
|
||||
void ReadSaveDataMore(std::istringstream& data) override
|
||||
{
|
||||
uint32 tmpState;
|
||||
data >> tmpState;
|
||||
playerDied = tmpState != 0;
|
||||
}
|
||||
|
||||
protected:
|
||||
/* The Arachnid Quarter */
|
||||
// Anub'rekhan
|
||||
@@ -596,7 +609,7 @@ class instance_naxxramas : public InstanceMapScript
|
||||
uint8 CurrentWingTaunt;
|
||||
|
||||
/* The Immortal / The Undying */
|
||||
uint32 playerDied;
|
||||
bool playerDied;
|
||||
|
||||
EventMap events;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user