mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-16 02:20:27 +00:00
fix(Scripts/Temple of AhnQiraj): Qiraji Champion. (#12965)
This commit is contained in:
@@ -15,9 +15,11 @@
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "CreatureGroups.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "Player.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "TaskScheduler.h"
|
||||
#include "temple_of_ahnqiraj.h"
|
||||
|
||||
ObjectData const creatureData[] =
|
||||
@@ -69,6 +71,8 @@ public:
|
||||
uint32 BugTrioDeathCount;
|
||||
uint32 CthunPhase;
|
||||
|
||||
TaskScheduler scheduler;
|
||||
|
||||
void Initialize() override
|
||||
{
|
||||
BugTrioDeathCount = 0;
|
||||
@@ -140,6 +144,37 @@ public:
|
||||
InstanceScript::OnGameObjectCreate(go);
|
||||
}
|
||||
|
||||
void OnUnitDeath(Unit* unit) override
|
||||
{
|
||||
switch (unit->GetEntry())
|
||||
{
|
||||
case NPC_QIRAJI_SLAYER:
|
||||
case NPC_QIRAJI_MINDSLAYER:
|
||||
if (Creature* creature = unit->ToCreature())
|
||||
{
|
||||
if (CreatureGroup* formation = creature->GetFormation())
|
||||
{
|
||||
scheduler.Schedule(100ms, [formation](TaskContext /*context*/)
|
||||
{
|
||||
if (!formation->IsAnyMemberAlive(true))
|
||||
{
|
||||
if (Creature* leader = formation->GetLeader())
|
||||
{
|
||||
if (leader->IsAlive())
|
||||
{
|
||||
leader->AI()->SetData(0, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
uint32 GetData(uint32 type) const override
|
||||
{
|
||||
switch (type)
|
||||
@@ -217,6 +252,11 @@ public:
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void Update(uint32 diff) override
|
||||
{
|
||||
scheduler.Update(diff);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -75,7 +75,10 @@ enum Creatures
|
||||
NPC_VEKNILASH = 15275,
|
||||
NPC_OURO = 15517,
|
||||
NPC_OURO_SPAWNER = 15957,
|
||||
NPC_SARTURA = 15516
|
||||
NPC_SARTURA = 15516,
|
||||
|
||||
NPC_QIRAJI_SLAYER = 15250,
|
||||
NPC_QIRAJI_MINDSLAYER = 15246
|
||||
};
|
||||
|
||||
enum ObjectsAQ40
|
||||
|
||||
Reference in New Issue
Block a user