fix(Scripts/RuinsOfAhnQiraj): Implement Rajaxx waves (#12513)

This commit is contained in:
Skjalf
2022-07-25 12:12:08 -03:00
committed by GitHub
parent accb01f180
commit cd3151df40
8 changed files with 288 additions and 24 deletions

View File

@@ -381,3 +381,40 @@ void CreatureGroup::LeaderMoveTo(float x, float y, float z, bool run)
}
}
}
void CreatureGroup::RespawnFormation(bool force)
{
for (auto const& itr : m_members)
{
if (itr.first && !itr.first->IsAlive())
{
itr.first->Respawn(force);
}
}
}
bool CreatureGroup::IsFormationInCombat()
{
for (auto const& itr : m_members)
{
if (itr.first && itr.first->IsInCombat())
{
return true;
}
}
return false;
}
bool CreatureGroup::IsAnyMemberAlive()
{
for (auto const& itr : m_members)
{
if (itr.first && itr.first->IsAlive())
{
return true;
}
}
return false;
}

View File

@@ -109,6 +109,9 @@ public:
void LeaderMoveTo(float x, float y, float z, bool run);
void MemberEngagingTarget(Creature* member, Unit* target);
void MemberEvaded(Creature* member);
void RespawnFormation(bool force = false);
[[nodiscard]] bool IsFormationInCombat();
[[nodiscard]] bool IsAnyMemberAlive();
private:
Creature* m_leader; //Important do not forget sometimes to work with pointers instead synonims :D:D