TrinityCore
Loading...
Searching...
No Matches
boss_noxxion.cpp
Go to the documentation of this file.
1/*
2 * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#include "ScriptMgr.h"
19#include "maraudon.h"
20#include "ScriptedCreature.h"
21#include "SpellScript.h"
22
30
31// 13282 - Noxxion
32struct boss_noxxion : public ScriptedAI
33{
34 boss_noxxion(Creature* creature) : ScriptedAI(creature) { }
35
36 void Reset() override
37 {
39 }
40
41 void JustEngagedWith(Unit* /*who*/) override
42 {
44 .SetValidator([this]
45 {
47 })
48 .Schedule(5s, 10s, [this](TaskContext task)
49 {
51 task.Repeat(15s, 20s);
52 })
53 .Schedule(15s, 20s, [this](TaskContext task)
54 {
56 task.Repeat(20s, 30s);
57 })
58 .Schedule(30s, 40s, [this](TaskContext task)
59 {
61 task.Repeat(50s, 60s);
62 });
63 }
64
65 void UpdateAI(uint32 diff) override
66 {
67 if (!UpdateVictim())
68 return;
69
70 _scheduler.Update(diff, [this]
71 {
73 });
74 }
75
76private:
78};
79
80// 21708 - Summon Noxxion's Spawns
82{
84
85 bool Validate(SpellInfo const* /*spellInfo*/) override
86 {
88 }
89
90 void AfterApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
91 {
92 if (Creature* target = GetTarget()->ToCreature())
93 {
94 target->SetReactState(REACT_PASSIVE);
95 target->SetUnitFlag(UNIT_FLAG_UNINTERACTIBLE);
96 target->CastSpell(target, SPELL_SUMMON_SPAWNS, true);
97 }
98 }
99
100 void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
101 {
102 if (Creature* target = GetTarget()->ToCreature())
103 {
104 target->SetReactState(REACT_AGGRESSIVE);
105 target->RemoveUnitFlag(UNIT_FLAG_UNINTERACTIBLE);
106 }
107 }
108
114};
115
uint32_t uint32
Definition Define.h:133
#define RegisterSpellScript(spell_script)
Definition ScriptMgr.h:1128
@ EFFECT_0
AuraEffectHandleModes
@ AURA_EFFECT_HANDLE_REAL
@ SPELL_AURA_DUMMY
#define AuraEffectApplyFn(F, I, N, M)
@ REACT_PASSIVE
@ REACT_AGGRESSIVE
@ UNIT_FLAG_UNINTERACTIBLE
@ UNIT_STATE_CASTING
Definition Unit.h:235
void AddSC_boss_noxxion()
NoxxionSpells
@ SPELL_SUMMON_SPAWNS
@ SPELL_SUMMON_SPAWNS_DUMMY
@ SPELL_UPPERCUT
@ SPELL_TOXIC_VOLLEY
HookList< EffectApplyHandler > AfterEffectRemove
HookList< EffectApplyHandler > AfterEffectApply
Unit * GetTarget() const
bool UpdateVictim()
Creature *const me
Definition CreatureAI.h:82
TaskContext & Repeat(std::chrono::duration< _Rep, _Period > const &duration)
TaskScheduler & CancelAll()
TaskScheduler & Update(success_t const &callback=EmptyCallback)
TaskScheduler & SetValidator(P &&predicate)
Sets a validator which is asked if tasks are allowed to be executed.
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:54
SpellCastResult DoCastSelf(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.h:241
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.cpp:166
Definition Unit.h:769
bool HasUnitState(const uint32 f) const
Definition Unit.h:876
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
bool Validate(SpellInfo const *) override
void AfterApply(AuraEffect const *, AuraEffectHandleModes)
void AfterRemove(AuraEffect const *, AuraEffectHandleModes)
PrepareAuraScript(spell_noxxion_summon_spawns)
#define RegisterMaraudonCreatureAI(ai_name)
Definition maraudon.h:31
boss_noxxion(Creature *creature)
void JustEngagedWith(Unit *) override
void UpdateAI(uint32 diff) override
TaskScheduler _scheduler
void Reset() override