TrinityCore
Loading...
Searching...
No Matches
boss_nethermancer_sepethrea.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/*
19 * Timers requires to be revisited
20 */
21
22#include "ScriptMgr.h"
23#include "mechanar.h"
24#include "ScriptedCreature.h"
25#include "SpellAuraEffects.h"
26#include "SpellInfo.h"
27#include "SpellScript.h"
28
30{
34 SAY_SUMMON = 3, // Was never used or used under unknown conditions
35 SAY_DEATH = 4
36};
37
39{
40 // Sepethrea - Initial
41 SPELL_FROST_ATTACK = 45196, // This is definitely spell added in TBC but did it replaced both 35264 and 39086 or only normal version?
43
44 // Sepethrea - Combat
47
48 // Sepethrea - Combat - Misc
50
51 // Raging Flames
55
56 // Scripts
58};
59
65
66// 19221 - Nethermancer Sepethrea
68{
70
71 void Reset() override
72 {
73 _Reset();
75 }
76
88
89 void OnSpellCast(SpellInfo const* spellInfo) override
90 {
91 if (spellInfo->Id == SPELL_DRAGONS_BREATH)
92 if (roll_chance_i(50))
94 }
95
96 // Despawn is handled by spell, don't store anything
97 void JustSummoned(Creature* /*summon*/) override { }
98
99 void EnterEvadeMode(EvadeReason why) override
100 {
101 // Fails probably because target is in evade mode (yes, she kills them on evade too). We'll kill them directly in their script for now
104 }
105
106 void JustReachedHome() override
107 {
110 }
111
112 void KilledUnit(Unit* victim) override
113 {
114 if (victim->GetTypeId() == TYPEID_PLAYER)
115 Talk(SAY_SLAY);
116 }
117
118 void JustDied(Unit* /*killer*/) override
119 {
120 _JustDied();
123 }
124
125 void UpdateAI(uint32 diff) override
126 {
127 if (!UpdateVictim())
128 return;
129
130 events.Update(diff);
131
133 return;
134
135 while (uint32 eventId = events.ExecuteEvent())
136 {
137 switch (eventId)
138 {
141 events.Repeat(15s, 25s);
142 break;
145 events.Repeat(25s, 35s);
146 break;
147 default:
148 break;
149 }
150
152 return;
153 }
154
156 }
157};
158
159// 20481 - Raging Flames
161{
163
164 void InitializeAI() override
165 {
166 me->SetCorpseDelay(20, true);
167 }
168
176
177 void Reset() override
178 {
180 }
181
182 void JustEngagedWith(Unit* /*who*/) override
183 {
185 .Schedule(15s, 25s, [this](TaskContext task)
186 {
188 task.Repeat(20s, 30s);
189 })
190 .Schedule(0s, [this](TaskContext task)
191 {
193
194 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100.0f))
195 AddThreat(target, 1000000.0f);
196 task.Repeat(10s, 20s);
197 });
198 }
199
200 void EnterEvadeMode(EvadeReason /*why*/) override
201 {
202 me->KillSelf();
203 }
204
205 void UpdateAI(uint32 diff) override
206 {
207 if (!UpdateVictim())
208 return;
209
210 _scheduler.Update(diff);
211
213 }
214
215private:
217};
218
219// 35314 - Arcane Blast
235
236// 35268, 39346 - Inferno
257
uint32_t uint32
Definition Define.h:133
@ TYPEID_PLAYER
Definition ObjectGuid.h:39
bool roll_chance_i(int chance)
Definition Random.h:59
#define RegisterSpellScript(spell_script)
Definition ScriptMgr.h:1128
@ EFFECT_0
@ SPELL_AURA_PERIODIC_TRIGGER_SPELL
@ SPELLVALUE_BASE_POINT0
#define AuraEffectPeriodicFn(F, I, N)
#define SpellHitFn(F)
@ UNIT_STATE_CASTING
Definition Unit.h:249
void AddSC_boss_nethermancer_sepethrea()
@ SPELL_INVIS_STEALTH_DETECTION
@ SPELL_RAGING_FLAMES_AREA_AURA
int32 GetAmount() const
HookList< EffectPeriodicHandler > OnEffectPeriodic
Unit * GetTarget() const
void _JustReachedHome()
void JustEngagedWith(Unit *who) override
EventMap events
void DoZoneInCombat(Creature *creature=nullptr)
bool UpdateVictim()
Creature *const me
Definition CreatureAI.h:82
virtual void EnterEvadeMode(EvadeReason why=EVADE_REASON_OTHER)
void SetCorpseDelay(uint32 delay, bool ignoreCorpseDecayRatio=false)
Definition Creature.h:98
void Update(uint32 time)
Definition EventMap.h:67
void Repeat(Milliseconds time)
Definition EventMap.cpp:63
EventId ExecuteEvent()
Definition EventMap.cpp:73
void ScheduleEvent(EventId eventId, Milliseconds time, GroupIndex group=0u, PhaseIndex phase=0u)
Definition EventMap.cpp:36
TypeID GetTypeId() const
Definition Object.h:93
uint32 Id
Definition SpellInfo.h:289
Unit * GetCaster() const
HookList< HitHandler > AfterHit
Unit * GetHitUnit() const
TaskContext & Repeat(std::chrono::duration< _Rep, _Period > const &duration)
TaskScheduler & CancelAll()
TaskScheduler & Schedule(std::chrono::duration< _Rep, _Period > const &time, task_handler_t const &task)
TaskScheduler & Update(success_t const &callback=EmptyCallback)
void ModifyThreatByPercent(Unit *target, int32 percent)
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
Unit * SelectTarget(SelectTargetMethod targetType, uint32 offset=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition UnitAI.cpp:96
Definition Unit.h:783
void KillSelf(bool durabilityLoss=true)
Definition Unit.h:1037
ThreatManager & GetThreatManager()
Definition Unit.h:1169
bool HasUnitState(const uint32 f) const
Definition Unit.h:890
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition Object.cpp:2833
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
PrepareSpellScript(spell_nethermancer_sepethrea_arcane_blast)
PrepareAuraScript(spell_nethermancer_sepethrea_inferno)
@ DATA_NETHERMANCER_SEPRETHREA
Definition mechanar.h:33
#define RegisterMechanarCreatureAI(ai_name)
Definition mechanar.h:50
ScriptedAI(Creature *creature)
void ResetThreatList(Unit *who=nullptr)
void AddThreat(Unit *victim, float amount, Unit *who=nullptr)
void EnterEvadeMode(EvadeReason why) override
void OnSpellCast(SpellInfo const *spellInfo) override
void EnterEvadeMode(EvadeReason) override
void UpdateAI(uint32 diff) override
void JustEngagedWith(Unit *) override