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
BossAI
33
{
34
boss_noxxion
(
Creature
* creature) :
BossAI
(creature,
BOSS_NOXXION
) { }
35
36
void
JustEngagedWith
(
Unit
* who)
override
37
{
38
BossAI::JustEngagedWith
(who);
39
40
scheduler
41
.
Schedule
(5s, 10s, [
this
](
TaskContext
& task)
42
{
43
DoCastSelf
(
SPELL_TOXIC_VOLLEY
);
44
task.
Repeat
(15s, 20s);
45
})
46
.Schedule(15s, 20s, [
this
](
TaskContext
& task)
47
{
48
DoCastVictim
(
SPELL_UPPERCUT
);
49
task.
Repeat
(20s, 30s);
50
})
51
.Schedule(30s, 40s, [
this
](
TaskContext
& task)
52
{
53
DoCastSelf
(
SPELL_SUMMON_SPAWNS_DUMMY
);
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
68
class
spell_noxxion_summon_spawns
:
public
AuraScript
69
{
70
bool
Validate
(
SpellInfo
const
*
/*spellInfo*/
)
override
71
{
72
return
ValidateSpellInfo
({
SPELL_SUMMON_SPAWNS
});
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
94
void
Register
()
override
95
{
96
AfterEffectApply
+=
AuraEffectApplyFn
(
spell_noxxion_summon_spawns::AfterApply
,
EFFECT_0
,
SPELL_AURA_DUMMY
,
AURA_EFFECT_HANDLE_REAL
);
97
AfterEffectRemove
+=
AuraEffectApplyFn
(
spell_noxxion_summon_spawns::AfterRemove
,
EFFECT_0
,
SPELL_AURA_DUMMY
,
AURA_EFFECT_HANDLE_REAL
);
98
}
99
};
100
101
void
AddSC_boss_noxxion
()
102
{
103
RegisterMaraudonCreatureAI
(
boss_noxxion
);
104
RegisterSpellScript
(
spell_noxxion_summon_spawns
);
105
}
uint32
uint32_t uint32
Definition
Define.h:154
ScriptMgr.h
RegisterSpellScript
#define RegisterSpellScript(spell_script)
Definition
ScriptMgr.h:1383
ScriptedCreature.h
EFFECT_0
@ EFFECT_0
Definition
SharedDefines.h:30
AuraEffectHandleModes
AuraEffectHandleModes
Definition
SpellAuraDefines.h:41
AURA_EFFECT_HANDLE_REAL
@ AURA_EFFECT_HANDLE_REAL
Definition
SpellAuraDefines.h:43
SPELL_AURA_DUMMY
@ SPELL_AURA_DUMMY
Definition
SpellAuraDefines.h:91
SpellScript.h
AuraEffectApplyFn
#define AuraEffectApplyFn(F, I, N, M)
Definition
SpellScript.h:1688
REACT_PASSIVE
@ REACT_PASSIVE
Definition
UnitDefines.h:443
REACT_AGGRESSIVE
@ REACT_AGGRESSIVE
Definition
UnitDefines.h:445
AddSC_boss_noxxion
void AddSC_boss_noxxion()
Definition
boss_noxxion.cpp:101
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:30
AuraScript
Definition
SpellScript.h:1013
AuraScript::AfterEffectRemove
HookList< EffectApplyHandler > AfterEffectRemove
Definition
SpellScript.h:1698
AuraScript::AfterEffectApply
HookList< EffectApplyHandler > AfterEffectApply
Definition
SpellScript.h:1687
AuraScript::GetTarget
Unit * GetTarget() const
Definition
SpellScript.cpp:1211
BossAI
Definition
ScriptedCreature.h:313
BossAI::JustEngagedWith
void JustEngagedWith(Unit *who) override
Definition
ScriptedCreature.h:334
BossAI::scheduler
TaskScheduler scheduler
Definition
ScriptedCreature.h:353
CreatureAI::UpdateVictim
bool UpdateVictim()
Definition
CreatureAI.cpp:244
Creature
Definition
Creature.h:82
SpellInfo
Definition
SpellInfo.h:324
SpellScriptBase::ValidateSpellInfo
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
Definition
SpellScript.h:212
TaskContext
Definition
TaskScheduler.h:370
TaskContext::Repeat
TaskContext & Repeat(TaskScheduler::duration_t duration)
Definition
TaskScheduler.cpp:319
TaskScheduler::Schedule
TaskScheduler & Schedule(duration_t time, task_handler_t task)
Definition
TaskScheduler.h:265
TaskScheduler::Update
TaskScheduler & Update()
Update the scheduler to the current time.
Definition
TaskScheduler.cpp:38
UnitAI::DoCastSelf
SpellCastResult DoCastSelf(uint32 spellId, CastSpellExtraArgs const &args={})
Definition
UnitAI.h:160
UnitAI::DoCastVictim
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition
UnitAI.cpp:172
Unit
Definition
Unit.h:647
spell_noxxion_summon_spawns
Definition
boss_noxxion.cpp:69
spell_noxxion_summon_spawns::Validate
bool Validate(SpellInfo const *) override
Definition
boss_noxxion.cpp:70
spell_noxxion_summon_spawns::AfterApply
void AfterApply(AuraEffect const *, AuraEffectHandleModes)
Definition
boss_noxxion.cpp:75
spell_noxxion_summon_spawns::Register
void Register() override
Definition
boss_noxxion.cpp:94
spell_noxxion_summon_spawns::AfterRemove
void AfterRemove(AuraEffect const *, AuraEffectHandleModes)
Definition
boss_noxxion.cpp:85
maraudon.h
BOSS_NOXXION
@ BOSS_NOXXION
Definition
maraudon.h:27
RegisterMaraudonCreatureAI
#define RegisterMaraudonCreatureAI(ai_name)
Definition
maraudon.h:53
boss_noxxion
Definition
boss_noxxion.cpp:33
boss_noxxion::JustEngagedWith
void JustEngagedWith(Unit *who) override
Definition
boss_noxxion.cpp:36
boss_noxxion::boss_noxxion
boss_noxxion(Creature *creature)
Definition
boss_noxxion.cpp:34
boss_noxxion::UpdateAI
void UpdateAI(uint32 diff) override
Definition
boss_noxxion.cpp:58
server
scripts
Kalimdor
Maraudon
boss_noxxion.cpp
Generated by
1.9.8