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#include "ScriptMgr.h"
19#include "mechanar.h"
20#include "ScriptedCreature.h"
21#include "SpellAuraEffects.h"
22#include "SpellInfo.h"
23#include "SpellScript.h"
24#include "TemporarySummon.h"
25
27{
29 SAY_SUMMON = 1, // Was never used or used under unknown conditions
32 SAY_DEATH = 4
33};
34
36{
37 SPELL_FROST_ATTACK = 45196, // This is definitely spell added in TBC but did it replaced both 35264 and 39086 or only normal version?
42
43 // Raging Flames
44 SPELL_RAGING_FLAMES_DUMMY = 35274, // NYI, no clue what it can do
49};
50
56
57// 19221 - Nethermancer Sepethrea
59{
61
62 void Reset() override
63 {
64 _Reset();
66 }
67
76
77 void OnSpellCast(SpellInfo const* spell) override
78 {
79 if (spell->Id == SPELL_DRAGONS_BREATH)
80 if (roll_chance_i(50))
82 }
83
84 void KilledUnit(Unit* victim) override
85 {
86 if (victim->GetTypeId() == TYPEID_PLAYER)
88 }
89
90 void EnterEvadeMode(EvadeReason why) override
91 {
92 // 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
95 }
96
97 void JustReachedHome() override
98 {
101 }
102
103 void JustDied(Unit* /*killer*/) override
104 {
105 _JustDied();
108 }
109
110 // Despawn is handled by spell, don't store anything
111 void JustSummoned(Creature* /*summon*/) override { }
112
113 void UpdateAI(uint32 diff) override
114 {
115 if (!UpdateVictim())
116 return;
117
118 events.Update(diff);
119
121 return;
122
123 while (uint32 eventId = events.ExecuteEvent())
124 {
125 switch (eventId)
126 {
129 if (GetThreat(me->GetVictim()))
131 events.Repeat(15s, 25s);
132 break;
135 events.Repeat(25s, 35s);
136 break;
137 default:
138 break;
139 }
140
142 return;
143 }
144
146 }
147};
148
149// 20481 - Raging Flames
151{
152 npc_raging_flames(Creature* creature) : ScriptedAI(creature) { }
153
154 void InitializeAI() override
155 {
156 me->SetCorpseDelay(20, true);
157 }
158
159 // It's more tricky actually
161 {
163
164 if (TempSummon* summon = me->ToTempSummon())
165 if (Creature* summoner = summon->GetSummonerCreatureBase())
166 if (summoner->IsAIEnabled())
167 if (Unit* target = summoner->AI()->SelectTarget(SelectTargetMethod::Random, 1, 100.0f, true, false))
168 AddThreat(target, 1000000.0f);
169 }
170
171 void JustAppeared() override
172 {
176
178
179 _scheduler.Schedule(15s, 25s, [this](TaskContext task)
180 {
183
184 task.Repeat(20s, 30s);
185 });
186 }
187
188 void Reset() override
189 {
191 }
192
193 void EnterEvadeMode(EvadeReason /*why*/) override
194 {
195 me->KillSelf();
196 }
197
198 void UpdateAI(uint32 diff) override
199 {
200 if (!UpdateVictim())
201 return;
202
203 _scheduler.Update(diff);
204
206 }
207
208private:
210};
211
212// 35268, 39346 - Inferno
234
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
#define AuraEffectPeriodicFn(F, I, N)
@ UNIT_STATE_CASTING
Definition Unit.h:235
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:89
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
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 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
void KillSelf(bool durabilityLoss=true)
Definition Unit.h:1023
TempSummon * ToTempSummon()
Definition Unit.h:1794
Unit * GetVictim() const
Definition Unit.h:859
bool HasUnitState(const uint32 f) const
Definition Unit.h:876
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition Object.cpp:2832
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
PrepareAuraScript(spell_nethermancer_sepethrea_inferno)
@ DATA_NETHERMANCER_SEPRETHREA
Definition mechanar.h:33
#define RegisterMechanarCreatureAI(ai_name)
Definition mechanar.h:50
CastSpellExtraArgs & AddSpellBP0(int32 val)
float GetThreat(Unit const *victim, Unit const *who=nullptr)
void ModifyThreatByPercent(Unit *victim, int32 pct, Unit *who=nullptr)
void ResetThreatList(Unit *who=nullptr)
void AddThreat(Unit *victim, float amount, Unit *who=nullptr)
void EnterEvadeMode(EvadeReason why) override
void OnSpellCast(SpellInfo const *spell) override
void KilledUnit(Unit *victim) override
void EnterEvadeMode(EvadeReason) override
void UpdateAI(uint32 diff) override
npc_raging_flames(Creature *creature)