fix(Scripts/TempleOfAhnQiraj): Aggro Drones. (#12737)

* fix(Scripts/Temple of AhnQiraj): Aggro Drones.

Fixes #12716

* fix build

Co-authored-by: Angelo Venturini <nefertum.dev@protonmail.com>
This commit is contained in:
UltraNix
2022-08-27 14:44:52 +02:00
committed by GitHub
parent ba3640255b
commit 0f0beb0148
2 changed files with 38 additions and 0 deletions

View File

@@ -17,6 +17,7 @@
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "SpellScript.h"
#include "temple_of_ahnqiraj.h"
#include "TaskScheduler.h"
@@ -150,7 +151,40 @@ private:
bool _enraged;
};
enum NPCs
{
NPC_VEKNISS_DRONE = 15300
};
class spell_aggro_drones : public SpellScript
{
PrepareSpellScript(spell_aggro_drones);
void HandleDummy(SpellEffIndex /*effIndex*/)
{
if (Unit* caster = GetCaster())
{
if (Creature* target = GetHitCreature())
{
if (target->GetEntry() == NPC_VEKNISS_DRONE)
{
if (Unit* victim = caster->GetVictim())
{
target->AI()->AttackStart(victim);
}
}
}
}
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_aggro_drones::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
void AddSC_temple_of_ahnqiraj()
{
RegisterTempleOfAhnQirajCreatureAI(npc_anubisath_defender);
RegisterSpellScript(spell_aggro_drones);
}