TrinityCore
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 }
138};
139
141{
142 npc_raging_flames(Creature* creature) : ScriptedAI(creature) { }
143
144 void InitializeAI() override
145 {
146 me->SetCorpseDelay(20, true);
147 }
148
149 // It's more tricky actually
151 {
153
154 if (TempSummon* summon = me->ToTempSummon())
155 if (Creature* summoner = summon->GetSummonerCreatureBase())
156 if (summoner->IsAIEnabled())
157 if (Unit* target = summoner->AI()->SelectTarget(SelectTargetMethod::Random, 1, 100.0f, true, false))
158 AddThreat(target, 1000000.0f);
159 }
160
161 void JustAppeared() override
162 {
166
168
169 _scheduler.Schedule(15s, 25s, [this](TaskContext task)
170 {
173
174 task.Repeat(20s, 30s);
175 });
176 }
177
178 void Reset() override
179 {
181 }
182
183 void EnterEvadeMode(EvadeReason /*why*/) override
184 {
185 me->KillSelf();
186 }
187
188 void UpdateAI(uint32 diff) override
189 {
190 if (!UpdateVictim())
191 return;
192
193 _scheduler.Update(diff);
194 }
195
196private:
198};
199
200// 35268, 39346 - Inferno
202{
203 bool Validate(SpellInfo const* /*spell*/) override
204 {
206 }
207
208 void HandlePeriodic(AuraEffect const* aurEff)
209 {
210 CastSpellExtraArgs args(aurEff);
211 args.AddSpellBP0(aurEff->GetAmount());
213 }
214
215 void Register() override
216 {
218 }
219};
220
222{
226}
Texts
uint32_t uint32
Definition: Define.h:142
@ TYPEID_PLAYER
Definition: ObjectGuid.h:41
Spells
Definition: PlayerAI.cpp:32
bool roll_chance_i(int chance)
Definition: Random.h:59
#define RegisterSpellScript(spell_script)
Definition: ScriptMgr.h:1369
@ EFFECT_0
Definition: SharedDefines.h:30
@ SPELL_AURA_PERIODIC_TRIGGER_SPELL
#define AuraEffectPeriodicFn(F, I, N)
Definition: SpellScript.h:2046
EvadeReason
Definition: UnitAICommon.h:30
@ UNIT_STATE_CASTING
Definition: Unit.h:270
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:2045
Unit * GetTarget() const
void _JustReachedHome()
void JustEngagedWith(Unit *who) override
EventMap events
void _JustDied()
void DoZoneInCombat()
Definition: CreatureAI.h:161
virtual void EnterEvadeMode(EvadeReason why=EvadeReason::Other)
Definition: CreatureAI.cpp:219
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:56
bool UpdateVictim()
Definition: CreatureAI.cpp:245
Creature *const me
Definition: CreatureAI.h:61
void SetCorpseDelay(uint32 delay, bool ignoreCorpseDecayRatio=false)
Definition: Creature.h:104
uint32 ExecuteEvent()
Definition: EventMap.cpp:73
void Update(uint32 time)
Definition: EventMap.h:56
void Repeat(Milliseconds time)
Definition: EventMap.cpp:63
void ScheduleEvent(uint32 eventId, Milliseconds time, uint32 group=0, uint8 phase=0)
Definition: EventMap.cpp:36
TypeID GetTypeId() const
Definition: Object.h:173
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
Definition: SpellScript.h:162
TaskContext & Repeat(std::chrono::duration< Rep, Period > duration)
TaskScheduler & CancelAll()
TaskScheduler & Schedule(std::chrono::duration< Rep, Period > time, task_handler_t task)
TaskScheduler & Update(success_t const &callback=nullptr)
SpellCastResult DoCastSelf(uint32 spellId, CastSpellExtraArgs const &args={})
Definition: UnitAI.h:159
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition: UnitAI.cpp:180
Definition: Unit.h:627
TempSummon * ToTempSummon()
Definition: Unit.h:1756
Unit * GetVictim() const
Definition: Unit.h:715
bool HasUnitState(const uint32 f) const
Definition: Unit.h:732
void KillSelf(bool durabilityLoss=true, bool skipSettingDeathState=false)
Definition: Unit.h:921
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition: Object.cpp:2896
@ DATA_NETHERMANCER_SEPRETHREA
Definition: mechanar.h:33
#define RegisterMechanarCreatureAI(ai_name)
Definition: mechanar.h:50
CastSpellExtraArgs & AddSpellBP0(int32 val)
Definition: SpellDefines.h:475
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)