mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-17 02:50:29 +00:00
refactor(Core/Misc): Make DeathState enum class (#17607)
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -741,7 +741,7 @@ public:
|
||||
break;
|
||||
case 11:
|
||||
Talk(EMOTE_DIES);
|
||||
me->setDeathState(JUST_DIED);
|
||||
me->setDeathState(DeathState::JustDied);
|
||||
me->SetHealth(0);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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))
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -224,7 +224,7 @@ public:
|
||||
if (!arthas->IsAlive())
|
||||
{
|
||||
EnsureGridLoaded();
|
||||
arthas->setDeathState(DEAD);
|
||||
arthas->setDeathState(DeathState::Dead);
|
||||
arthas->Respawn();
|
||||
}
|
||||
else
|
||||
|
||||
@@ -264,7 +264,7 @@ public:
|
||||
EnsureGridLoaded();
|
||||
thrall->SetVisible(false);
|
||||
Reposition(thrall);
|
||||
thrall->setDeathState(DEAD);
|
||||
thrall->setDeathState(DeathState::Dead);
|
||||
thrall->Respawn();
|
||||
thrall->SetVisible(true);
|
||||
SaveToDB();
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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())
|
||||
{
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -1109,7 +1109,7 @@ public:
|
||||
{
|
||||
if (_isTrio && param == ACTION_RESPAWN_TRIO)
|
||||
{
|
||||
me->setDeathState(JUST_RESPAWNED);
|
||||
me->setDeathState(DeathState::JustRespawned);
|
||||
Reset();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -316,7 +316,7 @@ public:
|
||||
{
|
||||
creature->SetDisableGravity(true);
|
||||
creature->SetPosition(creature->GetHomePosition());
|
||||
creature->setDeathState(JUST_DIED);
|
||||
creature->setDeathState(DeathState::JustDied);
|
||||
creature->StopMovingOnCurrentPos();
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -686,7 +686,7 @@ public:
|
||||
me->DespawnOrUnsummon();
|
||||
}
|
||||
else
|
||||
me->setDeathState(JUST_DIED);
|
||||
me->setDeathState(DeathState::JustDied);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -325,7 +325,7 @@ public:
|
||||
|
||||
if (id == 0)
|
||||
{
|
||||
me->setDeathState(JUST_DIED);
|
||||
me->setDeathState(DeathState::JustDied);
|
||||
me->RemoveCorpse();
|
||||
me->SetHealth(0);
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user