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
23
enum
NoxxionSpells
24
{
25
SPELL_TOXIC_VOLLEY
= 21687,
26
SPELL_UPPERCUT
= 22916,
27
SPELL_SUMMON_SPAWNS_DUMMY
= 21708,
28
SPELL_SUMMON_SPAWNS
= 21707
29
};
30
31
// 13282 - Noxxion
32
struct
boss_noxxion
:
public
ScriptedAI
33
{
34
boss_noxxion
(
Creature
* creature) :
ScriptedAI
(creature) { }
35
36
void
Reset
()
override
37
{
38
_scheduler
.
CancelAll
();
39
}
40
41
void
JustEngagedWith
(
Unit
*
/*who*/
)
override
42
{
43
_scheduler
44
.
SetValidator
([
this
]
45
{
46
return
!
me
->
HasUnitState
(
UNIT_STATE_CASTING
);
47
})
48
.Schedule(5s, 10s, [
this
](
TaskContext
task)
49
{
50
DoCastSelf
(
SPELL_TOXIC_VOLLEY
);
51
task.
Repeat
(15s, 20s);
52
})
53
.Schedule(15s, 20s, [
this
](
TaskContext
task)
54
{
55
DoCastVictim
(
SPELL_UPPERCUT
);
56
task.
Repeat
(20s, 30s);
57
})
58
.Schedule(30s, 40s, [
this
](
TaskContext
task)
59
{
60
DoCastSelf
(
SPELL_SUMMON_SPAWNS_DUMMY
);
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
{
72
DoMeleeAttackIfReady
();
73
});
74
}
75
76
private
:
77
TaskScheduler
_scheduler
;
78
};
79
80
// 21708 - Summon Noxxion's Spawns
81
class
spell_noxxion_summon_spawns
:
public
AuraScript
82
{
83
PrepareAuraScript
(
spell_noxxion_summon_spawns
);
84
85
bool
Validate
(
SpellInfo
const
*
/*spellInfo*/
)
override
86
{
87
return
ValidateSpellInfo
({
SPELL_SUMMON_SPAWNS
});
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
109
void
Register
()
override
110
{
111
AfterEffectApply
+=
AuraEffectApplyFn
(
spell_noxxion_summon_spawns::AfterApply
,
EFFECT_0
,
SPELL_AURA_DUMMY
,
AURA_EFFECT_HANDLE_REAL
);
112
AfterEffectRemove
+=
AuraEffectApplyFn
(
spell_noxxion_summon_spawns::AfterRemove
,
EFFECT_0
,
SPELL_AURA_DUMMY
,
AURA_EFFECT_HANDLE_REAL
);
113
}
114
};
115
116
void
AddSC_boss_noxxion
()
117
{
118
RegisterMaraudonCreatureAI
(
boss_noxxion
);
119
RegisterSpellScript
(
spell_noxxion_summon_spawns
);
120
}
uint32
uint32_t uint32
Definition
Define.h:133
ScriptMgr.h
RegisterSpellScript
#define RegisterSpellScript(spell_script)
Definition
ScriptMgr.h:1128
ScriptedCreature.h
EFFECT_0
@ EFFECT_0
Definition
SharedDefines.h:31
AuraEffectHandleModes
AuraEffectHandleModes
Definition
SpellAuraDefines.h:47
AURA_EFFECT_HANDLE_REAL
@ AURA_EFFECT_HANDLE_REAL
Definition
SpellAuraDefines.h:49
SPELL_AURA_DUMMY
@ SPELL_AURA_DUMMY
Definition
SpellAuraDefines.h:84
SpellScript.h
AuraEffectApplyFn
#define AuraEffectApplyFn(F, I, N, M)
Definition
SpellScript.h:801
REACT_PASSIVE
@ REACT_PASSIVE
Definition
UnitDefines.h:408
REACT_AGGRESSIVE
@ REACT_AGGRESSIVE
Definition
UnitDefines.h:410
UNIT_FLAG_UNINTERACTIBLE
@ UNIT_FLAG_UNINTERACTIBLE
Definition
UnitDefines.h:160
UNIT_STATE_CASTING
@ UNIT_STATE_CASTING
Definition
Unit.h:235
AddSC_boss_noxxion
void AddSC_boss_noxxion()
Definition
boss_noxxion.cpp:116
NoxxionSpells
NoxxionSpells
Definition
boss_noxxion.cpp:24
SPELL_SUMMON_SPAWNS
@ SPELL_SUMMON_SPAWNS
Definition
boss_noxxion.cpp:28
SPELL_SUMMON_SPAWNS_DUMMY
@ SPELL_SUMMON_SPAWNS_DUMMY
Definition
boss_noxxion.cpp:27
SPELL_UPPERCUT
@ SPELL_UPPERCUT
Definition
boss_noxxion.cpp:26
SPELL_TOXIC_VOLLEY
@ SPELL_TOXIC_VOLLEY
Definition
boss_noxxion.cpp:25
AuraEffect
Definition
SpellAuraEffects.h:29
AuraScript
Definition
SpellScript.h:574
AuraScript::AfterEffectRemove
HookList< EffectApplyHandler > AfterEffectRemove
Definition
SpellScript.h:811
AuraScript::AfterEffectApply
HookList< EffectApplyHandler > AfterEffectApply
Definition
SpellScript.h:800
AuraScript::GetTarget
Unit * GetTarget() const
Definition
SpellScript.cpp:1304
CreatureAI::UpdateVictim
bool UpdateVictim()
Definition
CreatureAI.cpp:240
CreatureAI::me
Creature *const me
Definition
CreatureAI.h:82
Creature
Definition
Creature.h:62
SpellInfo
Definition
SpellInfo.h:285
TaskContext
Definition
TaskScheduler.h:392
TaskContext::Repeat
TaskContext & Repeat(std::chrono::duration< _Rep, _Period > const &duration)
Definition
TaskScheduler.h:462
TaskScheduler
Definition
TaskScheduler.h:48
TaskScheduler::CancelAll
TaskScheduler & CancelAll()
Definition
TaskScheduler.cpp:45
TaskScheduler::Update
TaskScheduler & Update(success_t const &callback=EmptyCallback)
Definition
TaskScheduler.cpp:27
TaskScheduler::SetValidator
TaskScheduler & SetValidator(P &&predicate)
Sets a validator which is asked if tasks are allowed to be executed.
Definition
TaskScheduler.h:190
UnitAI::DoMeleeAttackIfReady
void DoMeleeAttackIfReady()
Definition
UnitAI.cpp:54
UnitAI::DoCastSelf
SpellCastResult DoCastSelf(uint32 spellId, CastSpellExtraArgs const &args={})
Definition
UnitAI.h:241
UnitAI::DoCastVictim
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition
UnitAI.cpp:166
Unit
Definition
Unit.h:769
Unit::HasUnitState
bool HasUnitState(const uint32 f) const
Definition
Unit.h:876
_SpellScript::ValidateSpellInfo
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
Definition
SpellScript.h:145
spell_noxxion_summon_spawns
Definition
boss_noxxion.cpp:82
spell_noxxion_summon_spawns::Validate
bool Validate(SpellInfo const *) override
Definition
boss_noxxion.cpp:85
spell_noxxion_summon_spawns::AfterApply
void AfterApply(AuraEffect const *, AuraEffectHandleModes)
Definition
boss_noxxion.cpp:90
spell_noxxion_summon_spawns::Register
void Register() override
Definition
boss_noxxion.cpp:109
spell_noxxion_summon_spawns::AfterRemove
void AfterRemove(AuraEffect const *, AuraEffectHandleModes)
Definition
boss_noxxion.cpp:100
spell_noxxion_summon_spawns::PrepareAuraScript
PrepareAuraScript(spell_noxxion_summon_spawns)
maraudon.h
RegisterMaraudonCreatureAI
#define RegisterMaraudonCreatureAI(ai_name)
Definition
maraudon.h:31
ScriptedAI
Definition
ScriptedCreature.h:132
boss_noxxion
Definition
boss_noxxion.cpp:33
boss_noxxion::boss_noxxion
boss_noxxion(Creature *creature)
Definition
boss_noxxion.cpp:34
boss_noxxion::JustEngagedWith
void JustEngagedWith(Unit *) override
Definition
boss_noxxion.cpp:41
boss_noxxion::UpdateAI
void UpdateAI(uint32 diff) override
Definition
boss_noxxion.cpp:65
boss_noxxion::_scheduler
TaskScheduler _scheduler
Definition
boss_noxxion.cpp:77
boss_noxxion::Reset
void Reset() override
Definition
boss_noxxion.cpp:36
server
scripts
Kalimdor
Maraudon
boss_noxxion.cpp
Generated on Sun May 10 2026 02:30:20 for TrinityCore by
1.9.8