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 BossAI
33{
34 boss_noxxion(Creature* creature) : BossAI(creature, BOSS_NOXXION) { }
35
36 void JustEngagedWith(Unit* who) override
37 {
39
41 .Schedule(5s, 10s, [this](TaskContext& task)
42 {
44 task.Repeat(15s, 20s);
45 })
46 .Schedule(15s, 20s, [this](TaskContext& task)
47 {
49 task.Repeat(20s, 30s);
50 })
51 .Schedule(30s, 40s, [this](TaskContext& task)
52 {
54 task.Repeat(50s, 60s);
55 });
56 }
57
58 void UpdateAI(uint32 diff) override
59 {
60 if (!UpdateVictim())
61 return;
62
63 scheduler.Update(diff);
64 }
65};
66
67// 21708 - Summon Noxxion's Spawns
69{
70 bool Validate(SpellInfo const* /*spellInfo*/) override
71 {
73 }
74
75 void AfterApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
76 {
77 if (Creature* target = GetTarget()->ToCreature())
78 {
79 target->SetReactState(REACT_PASSIVE);
80 target->SetUninteractible(true);
81 target->CastSpell(target, SPELL_SUMMON_SPAWNS, true);
82 }
83 }
84
85 void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
86 {
87 if (Creature* target = GetTarget()->ToCreature())
88 {
89 target->SetReactState(REACT_AGGRESSIVE);
90 target->SetUninteractible(false);
91 }
92 }
93
99};
100
uint32_t uint32
Definition Define.h:154
#define RegisterSpellScript(spell_script)
Definition ScriptMgr.h:1383
@ EFFECT_0
AuraEffectHandleModes
@ AURA_EFFECT_HANDLE_REAL
@ SPELL_AURA_DUMMY
#define AuraEffectApplyFn(F, I, N, M)
@ REACT_PASSIVE
@ REACT_AGGRESSIVE
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
void JustEngagedWith(Unit *who) override
TaskScheduler scheduler
bool UpdateVictim()
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
TaskContext & Repeat(TaskScheduler::duration_t duration)
TaskScheduler & Schedule(duration_t time, task_handler_t task)
TaskScheduler & Update()
Update the scheduler to the current time.
SpellCastResult DoCastSelf(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.h:160
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.cpp:172
Definition Unit.h:647
bool Validate(SpellInfo const *) override
void AfterApply(AuraEffect const *, AuraEffectHandleModes)
void AfterRemove(AuraEffect const *, AuraEffectHandleModes)
@ BOSS_NOXXION
Definition maraudon.h:27
#define RegisterMaraudonCreatureAI(ai_name)
Definition maraudon.h:53
void JustEngagedWith(Unit *who) override
boss_noxxion(Creature *creature)
void UpdateAI(uint32 diff) override