mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-21 20:56:23 +00:00
fix(Scripts/RuinsOfAhnQiraj): Implement Rajaxx waves (#12513)
This commit is contained in:
@@ -27,6 +27,7 @@
|
||||
#include "Vehicle.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "Language.h"
|
||||
#include "ZoneScript.h"
|
||||
|
||||
class PhasedRespawn : public BasicEvent
|
||||
{
|
||||
@@ -308,6 +309,9 @@ bool CreatureAI::_EnterEvadeMode(EvadeReason /*why*/)
|
||||
me->SetLastDamagedTime(0);
|
||||
me->SetCannotReachTarget();
|
||||
|
||||
if (ZoneScript* zoneScript = me->GetZoneScript() ? me->GetZoneScript() : (ZoneScript*)me->GetInstanceScript())
|
||||
zoneScript->OnCreatureEvade(me);
|
||||
|
||||
if (me->IsInEvadeMode())
|
||||
{
|
||||
return false;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -39,6 +39,7 @@ public:
|
||||
virtual void OnGameObjectRemove(GameObject*) { }
|
||||
|
||||
virtual void OnUnitDeath(Unit*) { }
|
||||
virtual void OnCreatureEvade(Creature*) { }
|
||||
|
||||
//All-purpose data storage 64 bit
|
||||
virtual ObjectGuid GetGuidData(uint32 /*DataId*/) const { return ObjectGuid::Empty; }
|
||||
|
||||
Reference in New Issue
Block a user