TrinityCore
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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 "SpellScript.h"
23#include "TemporarySummon.h"
24
26{
28 SAY_SUMMON = 1, // Was never used or used under unknown conditions
31 SAY_DEATH = 4
32};
33
35{
36 SPELL_FROST_ATTACK = 45196, // This is definitely spell added in TBC but did it replaced both 35264 and 39086 or only normal version?
41
42 // Raging Flames
43 SPELL_RAGING_FLAMES_DUMMY = 35274, // NYI, no clue what it can do
48};
49
51{
54};
55
57{
59
60 void Reset() override
61 {
62 _Reset();
64 }
65
66 void JustEngagedWith(Unit* who) override
67 {
73 }
74
75 void KilledUnit(Unit* victim) override
76 {
77 if (victim->GetTypeId() == TYPEID_PLAYER)
79 }
80
81 void EnterEvadeMode(EvadeReason why) override
82 {
83 // 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
86 }
87
88 void JustReachedHome() override
89 {
92 }
93
94 void JustDied(Unit* /*killer*/) override
95 {
96 _JustDied();
99 }
100
101 // Despawn is handled by spell, don't store anything
102 void JustSummoned(Creature* /*summon*/) override { }
103
104 void UpdateAI(uint32 diff) override
105 {
106 if (!UpdateVictim())
107 return;
108
109 events.Update(diff);
110
112 return;
113
114 while (uint32 eventId = events.ExecuteEvent())
115 {
116 switch (eventId)
117 {
120 if (GetThreat(me->GetVictim()))
122 events.Repeat(15s, 25s);
123 break;
126 events.Repeat(25s, 35s);
127 if (roll_chance_i(50))
129 break;
130 default:
131 break;
132 }
133
135 return;
136 }
137
139 }
140};
141
143{
144 npc_raging_flames(Creature* creature) : ScriptedAI(creature) { }
145
146 void InitializeAI() override
147 {
148 me->SetCorpseDelay(20, true);
149 }
150
151 // It's more tricky actually
153 {
155
156 if (TempSummon* summon = me->ToTempSummon())
157 if (Creature* summoner = summon->GetSummonerCreatureBase())
158 if (summoner->IsAIEnabled())
159 if (Unit* target = summoner->AI()->SelectTarget(SelectTargetMethod::Random, 1, 100.0f, true, false))
160 AddThreat(target, 1000000.0f);
161 }
162
163 void JustAppeared() override
164 {
168
170
171 _scheduler.Schedule(15s, 25s, [this](TaskContext task)
172 {
175
176 task.Repeat(20s, 30s);
177 });
178 }
179
180 void Reset() override
181 {
183 }
184
185 void EnterEvadeMode(EvadeReason /*why*/) override
186 {
187 me->KillSelf();
188 }
189
190 void UpdateAI(uint32 diff) override
191 {
192 if (!UpdateVictim())
193 return;
194
195 _scheduler.Update(diff);
196
198 }
199
200private:
202};
203
204// 35268, 39346 - Inferno
206{
208
209 bool Validate(SpellInfo const* /*spell*/) override
210 {
212 }
213
214 void HandlePeriodic(AuraEffect const* aurEff)
215 {
216 CastSpellExtraArgs args(aurEff);
217 args.AddSpellBP0(aurEff->GetAmount());
219 }
220
221 void Register() override
222 {
224 }
225};
226
228{
232}
uint32_t uint32
Definition: Define.h:133
@ TYPEID_PLAYER
Definition: ObjectGuid.h:39
Spells
Definition: PlayerAI.cpp:32
bool roll_chance_i(int chance)
Definition: Random.h:59
#define RegisterSpellScript(spell_script)
Definition: ScriptMgr.h:1129
@ EFFECT_0
Definition: SharedDefines.h:31
@ SPELL_AURA_PERIODIC_TRIGGER_SPELL
#define AuraEffectPeriodicFn(F, I, N)
Definition: SpellScript.h:815
@ UNIT_STATE_CASTING
Definition: Unit.h:235
Events
void AddSC_boss_nethermancer_sepethrea()
@ SPELL_INVIS_STEALTH_DETECTION
@ SPELL_RAGING_FLAMES_AREA_AURA
@ SPELL_SUMMON_RAGING_FLAMES
int32 GetAmount() const
HookList< EffectPeriodicHandler > OnEffectPeriodic
Definition: SpellScript.h:814
Unit * GetTarget() const
void _JustReachedHome()
void JustEngagedWith(Unit *who) override
EventMap events
void _JustDied()
void DoZoneInCombat(Creature *creature=nullptr)
Definition: CreatureAI.cpp:73
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:48
bool UpdateVictim()
Definition: CreatureAI.cpp:240
Creature *const me
Definition: CreatureAI.h:81
virtual void EnterEvadeMode(EvadeReason why=EVADE_REASON_OTHER)
Definition: CreatureAI.cpp:214
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:92
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:62
SpellCastResult DoCastSelf(uint32 spellId, CastSpellExtraArgs const &args={})
Definition: UnitAI.h:241
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition: UnitAI.cpp:174
Definition: Unit.h:769
void KillSelf(bool durabilityLoss=true)
Definition: Unit.h:1021
TempSummon * ToTempSummon()
Definition: Unit.h:1794
Unit * GetVictim() const
Definition: Unit.h:857
bool HasUnitState(const uint32 f) const
Definition: Unit.h:874
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition: Object.cpp:2831
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
Definition: SpellScript.h:145
PrepareAuraScript(spell_nethermancer_sepethrea_inferno)
@ DATA_NETHERMANCER_SEPRETHREA
Definition: mechanar.h:33
#define RegisterMechanarCreatureAI(ai_name)
Definition: mechanar.h:50
CastSpellExtraArgs & AddSpellBP0(int32 val)
Definition: SpellDefines.h:350
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 JustEngagedWith(Unit *who) override
void KilledUnit(Unit *victim) override
void EnterEvadeMode(EvadeReason) override
void UpdateAI(uint32 diff) override
npc_raging_flames(Creature *creature)