From f757e93da5cd24f74e11a4a547fe71e00c0edca6 Mon Sep 17 00:00:00 2001 From: Kitzunu <24550914+Kitzunu@users.noreply.github.com> Date: Sat, 28 Oct 2023 10:54:03 +0200 Subject: [PATCH] refactor(Core/Misc): Make DeathState enum class (#17607) --- src/server/game/AI/CoreAI/TotemAI.h | 2 +- .../game/AI/ScriptedAI/ScriptedEscortAI.cpp | 4 +- .../game/Battlegrounds/Battleground.cpp | 2 +- .../Battlegrounds/Zones/BattlegroundAV.cpp | 2 +- .../game/Entities/Creature/Creature.cpp | 48 +++++++++---------- .../Entities/Creature/TemporarySummon.cpp | 12 ++--- src/server/game/Entities/Pet/Pet.cpp | 10 ++-- src/server/game/Entities/Player/Player.cpp | 12 ++--- .../game/Entities/Player/PlayerStorage.cpp | 2 +- .../game/Entities/Player/PlayerUpdates.cpp | 2 +- src/server/game/Entities/Unit/Unit.cpp | 24 +++++----- src/server/game/Entities/Unit/Unit.h | 18 +++---- src/server/game/Handlers/CharacterHandler.cpp | 2 +- src/server/game/Handlers/MiscHandler.cpp | 2 +- src/server/game/Handlers/PetHandler.cpp | 2 +- src/server/game/Scripting/MapScripts.cpp | 2 +- .../game/Spells/Auras/SpellAuraEffects.cpp | 2 +- src/server/game/Spells/Spell.cpp | 2 +- src/server/game/Spells/SpellEffects.cpp | 4 +- src/server/scripts/Commands/cs_npc.cpp | 6 +-- .../Karazhan/boss_chess_event.cpp | 4 +- .../Karazhan/instance_karazhan.cpp | 2 +- .../ScarletEnclave/chapter2.cpp | 2 +- .../EasternKingdoms/ZulAman/boss_hexlord.cpp | 2 +- .../EasternKingdoms/ZulAman/boss_zuljin.cpp | 2 +- .../EasternKingdoms/zone_undercity.cpp | 2 +- .../BattleForMountHyjal/boss_anetheron.cpp | 2 +- .../BattleForMountHyjal/boss_azgalor.cpp | 2 +- .../BattleForMountHyjal/hyjal_trash.cpp | 4 +- .../instance_culling_of_stratholme.cpp | 2 +- .../instance_old_hillsbrad.cpp | 2 +- .../scripts/Kalimdor/zone_moonglade.cpp | 6 +-- .../boss_deathbringer_saurfang.cpp | 2 +- .../IcecrownCitadel/icecrown_citadel.cpp | 2 +- .../Ulduar/HallsOfStone/boss_sjonnir.cpp | 2 +- .../Ulduar/HallsOfStone/brann_bronzebeard.cpp | 2 +- .../Northrend/Ulduar/Ulduar/boss_auriaya.cpp | 2 +- .../Northrend/Ulduar/Ulduar/boss_freya.cpp | 2 +- .../Ulduar/Ulduar/instance_ulduar.cpp | 2 +- .../scripts/Northrend/zone_grizzly_hills.cpp | 2 +- src/server/scripts/Northrend/zone_zuldrak.cpp | 2 +- .../SerpentShrine/boss_lady_vashj.cpp | 2 +- .../Outland/TempestKeep/Eye/boss_kaelthas.cpp | 2 +- .../Outland/zone_blades_edge_mountains.cpp | 2 +- src/server/scripts/Spells/spell_item.cpp | 2 +- .../scripts/World/npc_stave_of_ancients.cpp | 2 +- src/server/scripts/World/npcs_special.cpp | 4 +- 47 files changed, 112 insertions(+), 112 deletions(-) diff --git a/src/server/game/AI/CoreAI/TotemAI.h b/src/server/game/AI/CoreAI/TotemAI.h index 36639a006..91de5e2ea 100644 --- a/src/server/game/AI/CoreAI/TotemAI.h +++ b/src/server/game/AI/CoreAI/TotemAI.h @@ -50,7 +50,7 @@ public: KillMagnetEvent(Unit& self) : _self(self) { } bool Execute(uint64 /*e_time*/, uint32 /*p_time*/) override { - _self.setDeathState(JUST_DIED); + _self.setDeathState(DeathState::JustDied); return true; } diff --git a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp index 7369277d5..88e33c93c 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp @@ -259,7 +259,7 @@ void npc_escortAI::UpdateAI(uint32 diff) if (m_bCanInstantRespawn) { - me->setDeathState(JUST_DIED); + me->setDeathState(DeathState::JustDied); me->Respawn(); } else @@ -299,7 +299,7 @@ void npc_escortAI::UpdateAI(uint32 diff) { if (m_bCanInstantRespawn) { - me->setDeathState(JUST_DIED); + me->setDeathState(DeathState::JustDied); me->Respawn(); } else diff --git a/src/server/game/Battlegrounds/Battleground.cpp b/src/server/game/Battlegrounds/Battleground.cpp index 82ed79027..0216c5be2 100644 --- a/src/server/game/Battlegrounds/Battleground.cpp +++ b/src/server/game/Battlegrounds/Battleground.cpp @@ -1635,7 +1635,7 @@ bool Battleground::AddSpiritGuide(uint32 type, float x, float y, float z, float if (Creature* creature = AddCreature(entry, type, x, y, z, o)) { - creature->setDeathState(DEAD); + creature->setDeathState(DeathState::Dead); creature->SetGuidValue(UNIT_FIELD_CHANNEL_OBJECT, creature->GetGUID()); // aura /// @todo: Fix display here diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp index ca5191964..d9369ec48 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp @@ -339,7 +339,7 @@ Creature* BattlegroundAV::AddAVCreature(uint16 cinfoid, uint16 type) //else wander_distance will be 15, so creatures move maximum=10 //creature->SetDefaultMovementType(RANDOM_MOTION_TYPE); creature->GetMotionMaster()->Initialize(); - creature->setDeathState(JUST_DIED); + creature->setDeathState(DeathState::JustDied); creature->Respawn(); //TODO: find a way to add a motionmaster without killing the creature (i //just copied this code from a gm-command diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index 1d2ef9dfb..36cb2c154 100644 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -316,7 +316,7 @@ void Creature::DisappearAndDie() //SetVisibility(VISIBILITY_OFF); //ObjectAccessor::UpdateObjectVisibility(this); if (IsAlive()) - setDeathState(JUST_DIED, true); + setDeathState(DeathState::JustDied, true); RemoveCorpse(false, true); } @@ -342,11 +342,11 @@ void Creature::SearchFormation() void Creature::RemoveCorpse(bool setSpawnTime, bool skipVisibility) { - if (getDeathState() != CORPSE) + if (getDeathState() != DeathState::Corpse) return; m_corpseRemoveTime = GameTime::GetGameTime().count(); - setDeathState(DEAD); + setDeathState(DeathState::Dead); RemoveAllAuras(); if (!skipVisibility) // pussywizard DestroyForNearbyPlayers(); // pussywizard: previous UpdateObjectVisibility() @@ -604,15 +604,15 @@ void Creature::Update(uint32 diff) switch (m_deathState) { - case JUST_RESPAWNED: + case DeathState::JustRespawned: // Must not be called, see Creature::setDeathState JUST_RESPAWNED -> ALIVE promoting. - LOG_ERROR("entities.unit", "Creature ({}) in wrong state: JUST_RESPAWNED (4)", GetGUID().ToString()); + LOG_ERROR("entities.unit", "Creature ({}) in wrong state: DeathState::JustRespawned (4)", GetGUID().ToString()); break; - case JUST_DIED: + case DeathState::JustDied: // Must not be called, see Creature::setDeathState JUST_DIED -> CORPSE promoting. - LOG_ERROR("entities.unit", "Creature ({}) in wrong state: JUST_DEAD (1)", GetGUID().ToString()); + LOG_ERROR("entities.unit", "Creature ({}) in wrong state: DeathState::JustDead (1)", GetGUID().ToString()); break; - case DEAD: + case DeathState::Dead: { time_t now = GameTime::GetGameTime().count(); if (m_respawnTime <= now) @@ -654,11 +654,11 @@ void Creature::Update(uint32 diff) } break; } - case CORPSE: + case DeathState::Corpse: { Unit::Update(diff); // deathstate changed on spells update, prevent problems - if (m_deathState != CORPSE) + if (m_deathState != DeathState::Corpse) break; if (m_groupLootTimer && lootingGroupLowGUID) @@ -683,7 +683,7 @@ void Creature::Update(uint32 diff) } break; } - case ALIVE: + case DeathState::Alive: { Unit::Update(diff); @@ -1720,12 +1720,12 @@ bool Creature::LoadCreatureFromDB(ObjectGuid::LowType spawnId, Map* map, bool ad m_wanderDistance = data->wander_distance; m_respawnDelay = data->spawntimesecs; - m_deathState = ALIVE; + m_deathState = DeathState::Alive; m_respawnTime = GetMap()->GetCreatureRespawnTime(m_spawnId); if (m_respawnTime) // respawn on Update { - m_deathState = DEAD; + m_deathState = DeathState::Dead; if (CanFly()) { float tz = map->GetHeight(GetPhaseMask(), data->posX, data->posY, data->posZ, true, MAX_FALL_DISTANCE); @@ -1755,7 +1755,7 @@ bool Creature::LoadCreatureFromDB(ObjectGuid::LowType spawnId, Map* map, bool ad SetPower(POWER_MANA, GetMaxPower(POWER_MANA)); } - SetHealth(m_deathState == ALIVE ? curhealth : 0); + SetHealth(m_deathState == DeathState::Alive ? curhealth : 0); // checked at creature_template loading m_defaultMovementType = MovementGeneratorType(data->movementType); @@ -1950,7 +1950,7 @@ void Creature::setDeathState(DeathState s, bool despawn) { Unit::setDeathState(s, despawn); - if (s == JUST_DIED) + if (s == DeathState::JustDied) { _lastDamagedTime.reset(); @@ -1984,9 +1984,9 @@ void Creature::setDeathState(DeathState s, bool despawn) if (needsFalling) GetMotionMaster()->MoveFall(0, true); - Unit::setDeathState(CORPSE, despawn); + Unit::setDeathState(DeathState::Corpse, despawn); } - else if (s == JUST_RESPAWNED) + else if (s == DeathState::JustRespawned) { //if (IsPet()) // setActive(true); @@ -2008,7 +2008,7 @@ void Creature::setDeathState(DeathState s, bool despawn) ClearUnitState(uint32(UNIT_STATE_ALL_STATE & ~(UNIT_STATE_IGNORE_PATHFINDING | UNIT_STATE_NO_ENVIRONMENT_UPD))); SetMeleeDamageSchool(SpellSchools(cinfo->dmgschool)); - Unit::setDeathState(ALIVE, despawn); + Unit::setDeathState(DeathState::Alive, despawn); Motion_Initialize(); LoadCreaturesAddon(true); @@ -2024,14 +2024,14 @@ void Creature::Respawn(bool force) if (force) { if (IsAlive()) - setDeathState(JUST_DIED); - else if (getDeathState() != CORPSE) - setDeathState(CORPSE); + setDeathState(DeathState::JustDied); + else if (getDeathState() != DeathState::Corpse) + setDeathState(DeathState::Corpse); } RemoveCorpse(false, false); - if (getDeathState() == DEAD) + if (getDeathState() == DeathState::Dead) { if (m_spawnId) { @@ -2059,7 +2059,7 @@ void Creature::Respawn(bool force) loot.clear(); SelectLevel(); - setDeathState(JUST_RESPAWNED); + setDeathState(DeathState::JustRespawned); // MDic - Acidmanifesto // Do not override transform auras @@ -2106,7 +2106,7 @@ void Creature::ForcedDespawn(uint32 timeMSToDespawn, Seconds forceRespawnTimer) } if (IsAlive()) - setDeathState(JUST_DIED, true); + setDeathState(DeathState::JustDied, true); // Xinef: set new respawn time, ignore corpse decay time... RemoveCorpse(true); diff --git a/src/server/game/Entities/Creature/TemporarySummon.cpp b/src/server/game/Entities/Creature/TemporarySummon.cpp index 69bd080dd..673eedc92 100644 --- a/src/server/game/Entities/Creature/TemporarySummon.cpp +++ b/src/server/game/Entities/Creature/TemporarySummon.cpp @@ -67,7 +67,7 @@ void TempSummon::Update(uint32 diff) { Creature::Update(diff); - if (m_deathState == DEAD) + if (m_deathState == DeathState::Dead) { UnSummon(); return; @@ -107,7 +107,7 @@ void TempSummon::Update(uint32 diff) } case TEMPSUMMON_TIMED_DESPAWN_OOC_ALIVE: { - if (!IsInCombat() && m_deathState != CORPSE) + if (!IsInCombat() && m_deathState != DeathState::Corpse) { if (m_timer <= diff) { @@ -124,7 +124,7 @@ void TempSummon::Update(uint32 diff) } case TEMPSUMMON_CORPSE_TIMED_DESPAWN: { - if (m_deathState == CORPSE) + if (m_deathState == DeathState::Corpse) { if (m_timer <= diff) { @@ -139,7 +139,7 @@ void TempSummon::Update(uint32 diff) case TEMPSUMMON_CORPSE_DESPAWN: { // if m_deathState is DEAD, CORPSE was skipped - if (m_deathState == CORPSE) + if (m_deathState == DeathState::Corpse) { UnSummon(); return; @@ -154,7 +154,7 @@ void TempSummon::Update(uint32 diff) case TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN: { // if m_deathState is DEAD, CORPSE was skipped - if (m_deathState == CORPSE) + if (m_deathState == DeathState::Corpse) { UnSummon(); return; @@ -395,7 +395,7 @@ bool Minion::IsGuardianPet() const void Minion::setDeathState(DeathState s, bool despawn) { Creature::setDeathState(s, despawn); - if (s == JUST_DIED && IsGuardianPet()) + if (s == DeathState::JustDied && IsGuardianPet()) if (Unit* owner = GetOwner()) if (owner->GetTypeId() == TYPEID_PLAYER && owner->GetMinionGUID() == GetGUID()) for (Unit::ControlSet::const_iterator itr = owner->m_Controlled.begin(); itr != owner->m_Controlled.end(); ++itr) diff --git a/src/server/game/Entities/Pet/Pet.cpp b/src/server/game/Entities/Pet/Pet.cpp index 2b7f0570c..297aca795 100644 --- a/src/server/game/Entities/Pet/Pet.cpp +++ b/src/server/game/Entities/Pet/Pet.cpp @@ -472,7 +472,7 @@ bool Pet::LoadPetFromDB(Player* owner, uint32 petEntry, uint32 petnumber, bool c else { if (!curHealth && getPetType() == HUNTER_PET) - setDeathState(JUST_DIED); + setDeathState(DeathState::JustDied); else { SetHealth(curHealth > GetMaxHealth() ? GetMaxHealth() : curHealth); @@ -616,7 +616,7 @@ void Pet::DeleteFromDB(ObjectGuid::LowType guidlow) void Pet::setDeathState(DeathState s, bool /*despawn = false*/) // overwrite virtual Creature::setDeathState and Unit::setDeathState { Creature::setDeathState(s); - if (getDeathState() == CORPSE) + if (getDeathState() == DeathState::Corpse) { if (getPetType() == HUNTER_PET) { @@ -632,7 +632,7 @@ void Pet::setDeathState(DeathState s, bool /*despawn = false*/) //SetUnitFlag(UNIT_FLAG_STUNNED); } } - else if (getDeathState() == ALIVE) + else if (getDeathState() == DeathState::Alive) { //RemoveUnitFlag(UNIT_FLAG_STUNNED); CastPetAuras(true); @@ -651,7 +651,7 @@ void Pet::Update(uint32 diff) switch (m_deathState) { - case CORPSE: + case DeathState::Corpse: { if (getPetType() != HUNTER_PET || m_corpseRemoveTime <= GameTime::GetGameTime().count()) { @@ -660,7 +660,7 @@ void Pet::Update(uint32 diff) } break; } - case ALIVE: + case DeathState::Alive: { // unsummon pet that lost owner Player* owner = GetOwner(); diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index bc64ae0a3..fa78bdd34 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -1010,7 +1010,7 @@ void Player::setDeathState(DeathState s, bool /*despawn = false*/) bool cur = IsAlive(); - if (s == JUST_DIED) + if (s == DeathState::JustDied) { if (!cur) { @@ -1025,7 +1025,7 @@ void Player::setDeathState(DeathState s, bool /*despawn = false*/) clearResurrectRequestData(); - //FIXME: is pet dismissed at dying or releasing spirit? if second, add setDeathState(DEAD) to HandleRepopRequestOpcode and define pet unsummon here with (s == DEAD) + //FIXME: is pet dismissed at dying or releasing spirit? if second, add setDeathState(DeathState::Dead) to HandleRepopRequestOpcode and define pet unsummon here with (s == DEAD) RemovePet(nullptr, PET_SAVE_NOT_IN_SLOT, true); // save value before aura remove in Unit::setDeathState @@ -1045,7 +1045,7 @@ void Player::setDeathState(DeathState s, bool /*despawn = false*/) ResetAchievementCriteria(ACHIEVEMENT_CRITERIA_CONDITION_NO_DEATH, 0); } // xinef: enable passive area auras! - else if (s == ALIVE) + else if (s == DeathState::Alive) ClearUnitState(UNIT_STATE_ISOLATED); Unit::setDeathState(s); @@ -1054,7 +1054,7 @@ void Player::setDeathState(DeathState s, bool /*despawn = false*/) ArenaSpectator::SendCommand_UInt32Value(FindMap(), GetGUID(), "STA", IsAlive() ? 1 : 0); // restore resurrection spell id for player after aura remove - if (s == JUST_DIED && cur && ressSpellId) + if (s == DeathState::JustDied && cur && ressSpellId) SetUInt32Value(PLAYER_SELF_RES_SPELL, ressSpellId); if (IsAlive() && !cur) @@ -4396,7 +4396,7 @@ void Player::ResurrectPlayer(float restore_percent, bool applySickness) if (GetSession()->IsARecruiter() || (GetSession()->GetRecruiterId() != 0)) SetDynamicFlag(UNIT_DYNFLAG_REFER_A_FRIEND); - setDeathState(ALIVE); + setDeathState(DeathState::Alive); SetMovement(MOVE_LAND_WALK); SetMovement(MOVE_UNROOT); SetWaterWalking(false); @@ -4463,7 +4463,7 @@ void Player::KillPlayer() StopMirrorTimers(); //disable timers(bars) - setDeathState(CORPSE); + setDeathState(DeathState::Corpse); //SetUnitFlag(UNIT_FLAG_NOT_IN_PVP); ReplaceAllDynamicFlags(UNIT_DYNFLAG_NONE); diff --git a/src/server/game/Entities/Player/PlayerStorage.cpp b/src/server/game/Entities/Player/PlayerStorage.cpp index 6a20fea94..f4aede788 100644 --- a/src/server/game/Entities/Player/PlayerStorage.cpp +++ b/src/server/game/Entities/Player/PlayerStorage.cpp @@ -5454,7 +5454,7 @@ bool Player::LoadFromDB(ObjectGuid playerGuid, CharacterDatabaseQueryHolder cons // add ghost flag (must be after aura load: PLAYER_FLAGS_GHOST set in aura) if (HasPlayerFlag(PLAYER_FLAGS_GHOST)) { - m_deathState = DEAD; + m_deathState = DeathState::Dead; AddUnitState(UNIT_STATE_ISOLATED); } diff --git a/src/server/game/Entities/Player/PlayerUpdates.cpp b/src/server/game/Entities/Player/PlayerUpdates.cpp index f36708d46..4c8ad5ac0 100644 --- a/src/server/game/Entities/Player/PlayerUpdates.cpp +++ b/src/server/game/Entities/Player/PlayerUpdates.cpp @@ -311,7 +311,7 @@ void Player::Update(uint32 p_time) RegenerateAll(); } - if (m_deathState == JUST_DIED) + if (m_deathState == DeathState::JustDied) KillPlayer(); if (m_nextSave) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 06ef9593b..0c6dce0f1 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -247,7 +247,7 @@ Unit::Unit(bool isWorldObject) : WorldObject(isWorldObject), m_rootTimes = 0; m_state = 0; - m_deathState = ALIVE; + m_deathState = DeathState::Alive; for (uint8 i = 0; i < CURRENT_MAX_SPELL; ++i) m_currentSpells[i] = nullptr; @@ -4535,7 +4535,7 @@ void Unit::_UnapplyAura(AuraApplicationMap::iterator& i, AuraRemoveMode removeMo if (aurApp->GetRemoveMode() == AURA_REMOVE_BY_EXPIRE && IsTotem() && GetGUID() == aura->GetCasterGUID()) { if (ToTotem()->GetSpell() == aura->GetId() && ToTotem()->GetTotemType() == TOTEM_PASSIVE) - ToTotem()->setDeathState(JUST_DIED); + ToTotem()->setDeathState(DeathState::JustDied); } // Remove aurastates only if were not found @@ -14497,7 +14497,7 @@ void Unit::setDeathState(DeathState s, bool despawn) // death state needs to be updated before RemoveAllAurasOnDeath() calls HandleChannelDeathItem(..) so that // it can be used to check creation of death items (such as soul shards). - if (s != ALIVE && s != JUST_RESPAWNED) + if (s != DeathState::Alive && s != DeathState::JustRespawned) { CombatStop(); GetThreatMgr().ClearAllThreat(); @@ -14512,7 +14512,7 @@ void Unit::setDeathState(DeathState s, bool despawn) RemoveAllAurasOnDeath(); } - if (s == JUST_DIED) + if (s == DeathState::JustDied) { // remove aurastates allowing special moves ClearAllReactives(); @@ -14541,7 +14541,7 @@ void Unit::setDeathState(DeathState s, bool despawn) if (ZoneScript* zoneScript = GetZoneScript() ? GetZoneScript() : (ZoneScript*)GetInstanceScript()) zoneScript->OnUnitDeath(this); } - else if (s == JUST_RESPAWNED) + else if (s == DeathState::JustRespawned) { RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE); // clear skinnable for creature and player (at battleground) } @@ -15420,9 +15420,9 @@ void Unit::SetLevel(uint8 lvl, bool showLevelChange) void Unit::SetHealth(uint32 val) { - if (getDeathState() == JUST_DIED) + if (getDeathState() == DeathState::JustDied) val = 0; - else if (GetTypeId() == TYPEID_PLAYER && getDeathState() == DEAD) + else if (GetTypeId() == TYPEID_PLAYER && getDeathState() == DeathState::Dead) val = 1; else { @@ -18086,12 +18086,12 @@ void Unit::Kill(Unit* killer, Unit* victim, bool durabilityLoss, WeaponAttackTyp if (!spiritOfRedemption) { - LOG_DEBUG("entities.unit", "SET JUST_DIED"); - victim->setDeathState(JUST_DIED); + LOG_DEBUG("entities.unit", "SET DeathState::JustDied"); + victim->setDeathState(DeathState::JustDied); } // Inform pets (if any) when player kills target) - // MUST come after victim->setDeathState(JUST_DIED); or pet next target + // MUST come after victim->setDeathState(DeathState::JustDied); or pet next target // selection will get stuck on same target and break pet react state if (player) { @@ -20105,8 +20105,8 @@ void Unit::_ExitVehicle(Position const* exitPosition) if (HasUnitTypeMask(UNIT_MASK_ACCESSORY)) { // Vehicle just died, we die too - if (vehicleBase->getDeathState() == JUST_DIED) - setDeathState(JUST_DIED); + if (vehicleBase->getDeathState() == DeathState::JustDied) + setDeathState(DeathState::JustDied); // If for other reason we as minion are exiting the vehicle (ejected, master dismounted) - unsummon else { diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index bdd2a0891..a28cc6396 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -311,13 +311,13 @@ enum BaseModType #define MOD_END (PCT_MOD+1) -enum DeathState +enum class DeathState : uint8 { - ALIVE = 0, - JUST_DIED = 1, - CORPSE = 2, - DEAD = 3, - JUST_RESPAWNED = 4, + Alive = 0, + JustDied = 1, + Corpse = 2, + Dead = 3, + JustRespawned = 4, }; enum UnitState @@ -1817,9 +1817,9 @@ public: void BuildHeartBeatMsg(WorldPacket* data) const; - [[nodiscard]] bool IsAlive() const { return (m_deathState == ALIVE); }; - [[nodiscard]] bool isDying() const { return (m_deathState == JUST_DIED); }; - [[nodiscard]] bool isDead() const { return (m_deathState == DEAD || m_deathState == CORPSE); }; + [[nodiscard]] bool IsAlive() const { return (m_deathState == DeathState::Alive); }; + [[nodiscard]] bool isDying() const { return (m_deathState == DeathState::JustDied); }; + [[nodiscard]] bool isDead() const { return (m_deathState == DeathState::Dead || m_deathState == DeathState::Corpse); }; DeathState getDeathState() { return m_deathState; }; virtual void setDeathState(DeathState s, bool despawn = false); // overwrited in Creature/Player/Pet diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp index 9ad51f4cd..d55e1ecae 100644 --- a/src/server/game/Handlers/CharacterHandler.cpp +++ b/src/server/game/Handlers/CharacterHandler.cpp @@ -937,7 +937,7 @@ void WorldSession::HandlePlayerLoginFromDB(LoginQueryHolder const& holder) pCurrChar->LoadCorpse(holder.GetPreparedResult(PLAYER_LOGIN_QUERY_LOAD_CORPSE_LOCATION)); // setting Ghost+speed if dead - if (pCurrChar->m_deathState != ALIVE) + if (pCurrChar->m_deathState != DeathState::Alive) { // not blizz like, we must correctly save and load player instead... if (pCurrChar->getRace() == RACE_NIGHTELF) diff --git a/src/server/game/Handlers/MiscHandler.cpp b/src/server/game/Handlers/MiscHandler.cpp index 9cfad00e6..51d78c57e 100644 --- a/src/server/game/Handlers/MiscHandler.cpp +++ b/src/server/game/Handlers/MiscHandler.cpp @@ -69,7 +69,7 @@ void WorldSession::HandleRepopRequestOpcode(WorldPacket& recv_data) // creatures can kill players // so if the server is lagging enough the player can // release spirit after he's killed but before he is updated - if (GetPlayer()->getDeathState() == JUST_DIED) + if (GetPlayer()->getDeathState() == DeathState::JustDied) { LOG_DEBUG("network", "HandleRepopRequestOpcode: got request after player {} ({}) was killed and before he was updated", GetPlayer()->GetName(), GetPlayer()->GetGUID().ToString()); diff --git a/src/server/game/Handlers/PetHandler.cpp b/src/server/game/Handlers/PetHandler.cpp index 102b2088c..3d283f5ed 100644 --- a/src/server/game/Handlers/PetHandler.cpp +++ b/src/server/game/Handlers/PetHandler.cpp @@ -301,7 +301,7 @@ void WorldSession::HandlePetActionHelper(Unit* pet, ObjectGuid guid1, uint32 spe GetPlayer()->RemovePet(pet->ToPet(), PET_SAVE_AS_DELETED); else //dismissing a summoned pet is like killing them (this prevents returning a soulshard...) - pet->setDeathState(CORPSE); + pet->setDeathState(DeathState::Corpse); } else if (pet->HasUnitTypeMask(UNIT_MASK_MINION | UNIT_MASK_SUMMON | UNIT_MASK_GUARDIAN | UNIT_MASK_CONTROLABLE_GUARDIAN)) { diff --git a/src/server/game/Scripting/MapScripts.cpp b/src/server/game/Scripting/MapScripts.cpp index bd31e8dcf..2dfc18641 100644 --- a/src/server/game/Scripting/MapScripts.cpp +++ b/src/server/game/Scripting/MapScripts.cpp @@ -824,7 +824,7 @@ void Map::ScriptsProcess() LOG_ERROR("maps.script", "{} creature is already dead ({})", step.script->GetDebugInfo(), cSource->GetGUID().ToString()); else { - cSource->setDeathState(JUST_DIED); + cSource->setDeathState(DeathState::JustDied); if (step.script->Kill.RemoveCorpse == 1) cSource->RemoveCorpse(); } diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index f8749091f..7b8b88dc1 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -1755,7 +1755,7 @@ void AuraEffect::HandleSpiritOfRedemption(AuraApplication const* aurApp, uint8 m // die at aura end else if (target->IsAlive()) // call functions which may have additional effects after chainging state of unit - target->setDeathState(JUST_DIED); + target->setDeathState(DeathState::JustDied); // xinef: damage immunity spell, not needed because of 93 aura (adds non_attackable state) // xinef: probably blizzard added it just in case in wotlk (id > 46000) diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index ba67b873c..5649bcdbf 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -4514,7 +4514,7 @@ void Spell::finish(bool ok) if (spellInfo && spellInfo->SpellIconID == 2056) { LOG_DEBUG("spells.aura", "Statue {} is unsummoned in spell {} finish", m_caster->GetGUID().ToString(), m_spellInfo->Id); - m_caster->setDeathState(JUST_DIED); + m_caster->setDeathState(DeathState::JustDied); return; } } diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index da94ce4ed..e26e296fc 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -3829,7 +3829,7 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex) caster->RewardPlayerAndGroupAtEvent(18388, unitTarget); if (Creature* target = unitTarget->ToCreature()) { - target->setDeathState(CORPSE); + target->setDeathState(DeathState::Corpse); target->RemoveCorpse(); } } @@ -5247,7 +5247,7 @@ void Spell::EffectResurrectPet(SpellEffIndex /*effIndex*/) pet->Relocate(x, y, z, player->GetOrientation()); // This is needed so SaveStayPosition() will get the proper coords. pet->ReplaceAllDynamicFlags(UNIT_DYNFLAG_NONE); pet->RemoveUnitFlag(UNIT_FLAG_SKINNABLE); - pet->setDeathState(ALIVE); + pet->setDeathState(DeathState::Alive); pet->ClearUnitState(uint32(UNIT_STATE_ALL_STATE & ~(UNIT_STATE_POSSESSED))); // xinef: just in case pet->SetHealth(pet->CountPctFromMaxHealth(damage)); pet->SetDisplayId(pet->GetNativeDisplayId()); diff --git a/src/server/scripts/Commands/cs_npc.cpp b/src/server/scripts/Commands/cs_npc.cpp index 3db1a22fe..94ad998c6 100644 --- a/src/server/scripts/Commands/cs_npc.cpp +++ b/src/server/scripts/Commands/cs_npc.cpp @@ -768,7 +768,7 @@ public: if (creature->IsAlive()) // dead creature will reset movement generator at respawn { - creature->setDeathState(JUST_DIED); + creature->setDeathState(DeathState::JustDied); creature->Respawn(); } } @@ -920,7 +920,7 @@ public: if (creature->IsAlive()) // dead creature will reset movement generator at respawn { - creature->setDeathState(JUST_DIED); + creature->setDeathState(DeathState::JustDied); creature->Respawn(); } @@ -994,7 +994,7 @@ public: if (creature->IsAlive()) // dead creature will reset movement generator at respawn { - creature->setDeathState(JUST_DIED); + creature->setDeathState(DeathState::JustDied); creature->Respawn(); } diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_chess_event.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_chess_event.cpp index 5f40a5155..a7bfacc5c 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_chess_event.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_chess_event.cpp @@ -506,7 +506,7 @@ struct npc_echo_of_medivh : public ScriptedAI piece->CombatStop(); piece->SetUnitFlag(UNIT_FLAG_NOT_SELECTABLE); - piece->setDeathState(JUST_RESPAWNED); + piece->setDeathState(DeathState::JustRespawned); piece->SetHealth(piece->GetMaxHealth()); break; } @@ -528,7 +528,7 @@ struct npc_echo_of_medivh : public ScriptedAI piece->CombatStop(); piece->SetUnitFlag(UNIT_FLAG_NOT_SELECTABLE); - piece->setDeathState(JUST_RESPAWNED); + piece->setDeathState(DeathState::JustRespawned); piece->SetHealth(piece->GetMaxHealth()); break; } diff --git a/src/server/scripts/EasternKingdoms/Karazhan/instance_karazhan.cpp b/src/server/scripts/EasternKingdoms/Karazhan/instance_karazhan.cpp index 5e595c568..56f7de24c 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/instance_karazhan.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/instance_karazhan.cpp @@ -265,7 +265,7 @@ public: if (Creature* piece = instance->GetCreature(chessPieceGUID)) { piece->RemoveAllAuras(); - piece->setDeathState(JUST_RESPAWNED); + piece->setDeathState(DeathState::JustRespawned); piece->SetHealth(piece->GetMaxHealth()); float x, y, z, o; piece->GetHomePosition(x, y, z, o); diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp index f63817878..6ee4ac80d 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp @@ -741,7 +741,7 @@ public: break; case 11: Talk(EMOTE_DIES); - me->setDeathState(JUST_DIED); + me->setDeathState(DeathState::JustDied); me->SetHealth(0); return; } diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp index af90c050c..1253017b8 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp @@ -360,7 +360,7 @@ public: Creature* creature = (ObjectAccessor::GetCreature((*me), AddGUID[i])); if (!creature || !creature->IsAlive()) { - if (creature) creature->setDeathState(DEAD); + if (creature) creature->setDeathState(DeathState::Dead); creature = me->SummonCreature(AddEntry[i], Pos_X[i], POS_Y, POS_Z, ORIENT, TEMPSUMMON_DEAD_DESPAWN, 0); if (creature) AddGUID[i] = creature->GetGUID(); } diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp index a30560278..0f464806c 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp @@ -285,7 +285,7 @@ public: if (Unit* temp = ObjectAccessor::GetUnit(*me, SpiritGUID[i])) { temp->SetVisible(false); - temp->setDeathState(DEAD); + temp->setDeathState(DeathState::Dead); } } SpiritGUID[i].Clear(); diff --git a/src/server/scripts/EasternKingdoms/zone_undercity.cpp b/src/server/scripts/EasternKingdoms/zone_undercity.cpp index 27cc04c2b..354c2bd97 100644 --- a/src/server/scripts/EasternKingdoms/zone_undercity.cpp +++ b/src/server/scripts/EasternKingdoms/zone_undercity.cpp @@ -1300,7 +1300,7 @@ public: { khanokGUID = temp->GetGUID(); if (Creature* khanok = ObjectAccessor::GetCreature(*me, khanokGUID)) - khanok->setDeathState(JUST_DIED); + khanok->setDeathState(DeathState::JustDied); } if (Unit* temp = me->SummonCreature(NPC_PUTRESS, AllianceSpawn[12].x, AllianceSpawn[12].y, AllianceSpawn[12].z, TEMPSUMMON_MANUAL_DESPAWN)) { diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp index ad49d80be..e349dedf0 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp @@ -238,7 +238,7 @@ public: Creature* boss = ObjectAccessor::GetCreature(*me, AnetheronGUID); if (!boss || boss->isDead()) { - me->setDeathState(JUST_DIED); + me->setDeathState(DeathState::JustDied); me->RemoveCorpse(); return; } diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp index f6f9ba85d..6fbdbaa29 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp @@ -245,7 +245,7 @@ public: Creature* boss = ObjectAccessor::GetCreature(*me, AzgalorGUID); if (!boss || boss->isDead()) { - me->setDeathState(JUST_DIED); + me->setDeathState(DeathState::JustDied); me->RemoveCorpse(); return; } diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp index 23f49476c..51d059dd2 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp @@ -584,7 +584,7 @@ public: { if ((faction == 0 && LastOverronPos == 17) || (faction == 1 && LastOverronPos == 21)) { - me->setDeathState(DEAD); + me->setDeathState(DeathState::Dead); me->RemoveCorpse(); } } @@ -685,7 +685,7 @@ public: me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_ATTACK_UNARMED); if ((faction == 0 && LastOverronPos == 17) || (faction == 1 && LastOverronPos == 21)) { - me->setDeathState(DEAD); + me->setDeathState(DeathState::Dead); me->RemoveCorpse(); } } diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/instance_culling_of_stratholme.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/instance_culling_of_stratholme.cpp index 55166324f..001fbcb5a 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/instance_culling_of_stratholme.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/instance_culling_of_stratholme.cpp @@ -224,7 +224,7 @@ public: if (!arthas->IsAlive()) { EnsureGridLoaded(); - arthas->setDeathState(DEAD); + arthas->setDeathState(DeathState::Dead); arthas->Respawn(); } else diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/instance_old_hillsbrad.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/instance_old_hillsbrad.cpp index b771a3bce..fdf579cc5 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/instance_old_hillsbrad.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/instance_old_hillsbrad.cpp @@ -264,7 +264,7 @@ public: EnsureGridLoaded(); thrall->SetVisible(false); Reposition(thrall); - thrall->setDeathState(DEAD); + thrall->setDeathState(DeathState::Dead); thrall->Respawn(); thrall->SetVisible(true); SaveToDB(); diff --git a/src/server/scripts/Kalimdor/zone_moonglade.cpp b/src/server/scripts/Kalimdor/zone_moonglade.cpp index e9b37b509..1afaa3e13 100644 --- a/src/server/scripts/Kalimdor/zone_moonglade.cpp +++ b/src/server/scripts/Kalimdor/zone_moonglade.cpp @@ -387,7 +387,7 @@ public: if (!PlayerGUID) { - me->setDeathState(JUST_DIED); + me->setDeathState(DeathState::JustDied); return; } @@ -408,7 +408,7 @@ public: Player* player = ObjectAccessor::GetPlayer(*me, PlayerGUID); if (!player || player->GetQuestStatus(10965) == QUEST_STATUS_NONE) { - me->setDeathState(JUST_DIED); + me->setDeathState(DeathState::JustDied); return; } @@ -532,7 +532,7 @@ public: player->TalkedToCreature(me->GetEntry(), me->GetGUID()); PlayerGUID.Clear(); Reset(); - me->setDeathState(JUST_DIED); + me->setDeathState(DeathState::JustDied); break; } break; diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp index d3536b906..1c8a70b33 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp @@ -646,7 +646,7 @@ public: { deathbringer->CastSpell(me, SPELL_RIDE_VEHICLE, true); deathbringer->SetUnitFlag(UNIT_FLAG_NOT_SELECTABLE); - deathbringer->setDeathState(ALIVE); + deathbringer->setDeathState(DeathState::Alive); } _events.ScheduleEvent(EVENT_OUTRO_HORDE_4, 1000); _events.ScheduleEvent(EVENT_OUTRO_HORDE_5, 4000); diff --git a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp index 251b2b31e..d9ca0f992 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp @@ -1257,7 +1257,7 @@ public: { if (spell->Id == SPELL_REVIVE_CHAMPION && !IsUndead) { - me->setDeathState(JUST_RESPAWNED); + me->setDeathState(DeathState::JustRespawned); uint32 newEntry = 0; switch (me->GetEntry()) { diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_sjonnir.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_sjonnir.cpp index 81986bf23..7c4215d81 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_sjonnir.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_sjonnir.cpp @@ -153,7 +153,7 @@ public: if (Creature* brann = ObjectAccessor::GetCreature(*me, pInstance->GetGuidData(NPC_BRANN))) { - brann->setDeathState(JUST_DIED); + brann->setDeathState(DeathState::JustDied); brann->Respawn(); brann->AI()->DoAction(5); } diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfStone/brann_bronzebeard.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfStone/brann_bronzebeard.cpp index 708f58891..7c4f991f6 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfStone/brann_bronzebeard.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfStone/brann_bronzebeard.cpp @@ -601,7 +601,7 @@ public: { if (Creature* brann = ObjectAccessor::GetCreature(*me, pInstance->GetGuidData(NPC_BRANN))) { - brann->setDeathState(JUST_DIED); + brann->setDeathState(DeathState::JustDied); brann->Respawn(); brann->AI()->DoAction(5); } diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp index 1efdf49d3..f968a7f0f 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp @@ -384,7 +384,7 @@ public: { if (param == ACTION_FERAL_RESPAWN) { - me->setDeathState(JUST_RESPAWNED); + me->setDeathState(DeathState::JustRespawned); if (Player* target = SelectTargetFromPlayerList(200)) AttackStart(target); diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp index b135c2183..17920a8a5 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp @@ -1109,7 +1109,7 @@ public: { if (_isTrio && param == ACTION_RESPAWN_TRIO) { - me->setDeathState(JUST_RESPAWNED); + me->setDeathState(DeathState::JustRespawned); Reset(); } } diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp index df114d77d..1b73cc425 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp @@ -316,7 +316,7 @@ public: { creature->SetDisableGravity(true); creature->SetPosition(creature->GetHomePosition()); - creature->setDeathState(JUST_DIED); + creature->setDeathState(DeathState::JustDied); creature->StopMovingOnCurrentPos(); } break; diff --git a/src/server/scripts/Northrend/zone_grizzly_hills.cpp b/src/server/scripts/Northrend/zone_grizzly_hills.cpp index 255c4a4d5..26ea9d7b3 100644 --- a/src/server/scripts/Northrend/zone_grizzly_hills.cpp +++ b/src/server/scripts/Northrend/zone_grizzly_hills.cpp @@ -158,7 +158,7 @@ public: if (Mrfloppy->isDead()) { me->GetMotionMaster()->MovePoint(0, Mrfloppy->GetPositionX(), Mrfloppy->GetPositionY(), Mrfloppy->GetPositionZ()); - Mrfloppy->setDeathState(ALIVE); + Mrfloppy->setDeathState(DeathState::Alive); Mrfloppy->GetMotionMaster()->MoveFollow(me, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE); Talk(SAY_VICTORY3); } diff --git a/src/server/scripts/Northrend/zone_zuldrak.cpp b/src/server/scripts/Northrend/zone_zuldrak.cpp index 41473712e..51f44e548 100644 --- a/src/server/scripts/Northrend/zone_zuldrak.cpp +++ b/src/server/scripts/Northrend/zone_zuldrak.cpp @@ -686,7 +686,7 @@ public: me->DespawnOrUnsummon(); } else - me->setDeathState(JUST_DIED); + me->setDeathState(DeathState::JustDied); } } } diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp index b496d3e25..1e4354987 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp @@ -373,7 +373,7 @@ public: if (!Vashj || !Vashj->IsAlive() || CAST_AI(boss_lady_vashj::boss_lady_vashjAI, Vashj->ToCreature()->AI())->Phase != 3) { // remove - me->setDeathState(DEAD); + me->setDeathState(DeathState::Dead); me->RemoveCorpse(); me->SetFaction(FACTION_FRIENDLY); } diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp index d5d4de468..e02f2a244 100644 --- a/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp +++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp @@ -214,7 +214,7 @@ public: if (summon->GetSpawnId()) { summon->SetReactState(REACT_PASSIVE); - summon->setDeathState(JUST_RESPAWNED); + summon->setDeathState(DeathState::JustRespawned); summon->SetUnitFlag(UNIT_FLAG_NOT_SELECTABLE); } } diff --git a/src/server/scripts/Outland/zone_blades_edge_mountains.cpp b/src/server/scripts/Outland/zone_blades_edge_mountains.cpp index a58dcd50b..f43d1027d 100644 --- a/src/server/scripts/Outland/zone_blades_edge_mountains.cpp +++ b/src/server/scripts/Outland/zone_blades_edge_mountains.cpp @@ -325,7 +325,7 @@ public: if (id == 0) { - me->setDeathState(JUST_DIED); + me->setDeathState(DeathState::JustDied); me->RemoveCorpse(); me->SetHealth(0); } diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp index 584e389bb..f70e2c21f 100644 --- a/src/server/scripts/Spells/spell_item.cpp +++ b/src/server/scripts/Spells/spell_item.cpp @@ -2805,7 +2805,7 @@ class spell_item_shimmering_vessel : public SpellScript void HandleDummy(SpellEffIndex /* effIndex */) { if (Creature* target = GetHitCreature()) - target->setDeathState(JUST_RESPAWNED); + target->setDeathState(DeathState::JustRespawned); } void Register() override diff --git a/src/server/scripts/World/npc_stave_of_ancients.cpp b/src/server/scripts/World/npc_stave_of_ancients.cpp index 130d72b6a..4f01542af 100644 --- a/src/server/scripts/World/npc_stave_of_ancients.cpp +++ b/src/server/scripts/World/npc_stave_of_ancients.cpp @@ -577,7 +577,7 @@ public: Precious()->RemoveCorpse(false, false); Precious()->SetPosition(current); Precious()->SetHomePosition(current); - Precious()->setDeathState(JUST_RESPAWNED); + Precious()->setDeathState(DeathState::JustRespawned); Precious()->UpdateObjectVisibility(true); } diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp index 7a13b6881..d6e223dd7 100644 --- a/src/server/scripts/World/npcs_special.cpp +++ b/src/server/scripts/World/npcs_special.cpp @@ -1006,7 +1006,7 @@ public: { if (guid != savedPatient->GetGUID()) // Don't kill the last guy we just saved if (Creature* patient = ObjectAccessor::GetCreature(*me, guid)) - patient->setDeathState(JUST_DIED); + patient->setDeathState(DeathState::JustDied); } } @@ -1155,7 +1155,7 @@ public: { me->RemoveUnitFlag(UNIT_FLAG_IN_COMBAT); me->SetUnitFlag(UNIT_FLAG_NOT_SELECTABLE); - me->setDeathState(JUST_DIED); + me->setDeathState(DeathState::JustDied); me->SetDynamicFlag(32); if (DoctorGUID)