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 "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
55
57{
59
60 void Reset() override
61 {
62 _Reset();
64 }
65
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(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
219};
220
uint32_t uint32
Definition Define.h:154
@ TYPEID_PLAYER
Definition ObjectGuid.h:44
Spells
Definition PlayerAI.cpp:32
bool roll_chance(T chance)
Definition Random.h:55
#define RegisterSpellScript(spell_script)
Definition ScriptMgr.h:1383
@ EFFECT_0
@ SPELL_AURA_PERIODIC_TRIGGER_SPELL
#define AuraEffectPeriodicFn(F, I, N)
EvadeReason
@ UNIT_STATE_CASTING
Definition Unit.h:276
void AddSC_boss_nethermancer_sepethrea()
@ SPELL_INVIS_STEALTH_DETECTION
@ SPELL_RAGING_FLAMES_AREA_AURA
SpellEffectValue GetAmount() const
HookList< EffectPeriodicHandler > OnEffectPeriodic
Unit * GetTarget() const
TypeID GetTypeId() const
Definition BaseEntity.h:166
void _JustReachedHome()
void JustEngagedWith(Unit *who) override
EventMap events
void DoZoneInCombat()
Definition CreatureAI.h:169
virtual void EnterEvadeMode(EvadeReason why=EvadeReason::Other)
bool UpdateVictim()
Creature *const me
Definition CreatureAI.h:63
void SetCorpseDelay(uint32 delay, bool ignoreCorpseDecayRatio=false)
Definition Creature.h:118
uint32 ExecuteEvent()
Definition EventMap.cpp:77
void Update(uint32 time)
Definition EventMap.h:61
void Repeat(Milliseconds time)
Definition EventMap.cpp:67
void ScheduleEvent(uint32 eventId, Milliseconds time, uint32 group=0, uint8 phase=0)
Definition EventMap.cpp:40
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
TaskContext & Repeat(TaskScheduler::duration_t duration)
TaskScheduler & CancelAll()
TaskScheduler & Schedule(duration_t time, task_handler_t task)
TaskScheduler & Update()
Update the scheduler to the current time.
SpellCastResult DoCastSelf(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.h:160
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.cpp:180
Definition Unit.h:635
TempSummon * ToTempSummon()
Definition Unit.h:1828
Unit * GetVictim() const
Definition Unit.h:726
bool HasUnitState(const uint32 f) const
Definition Unit.h:743
void KillSelf(bool durabilityLoss=true, bool skipSettingDeathState=false)
Definition Unit.h:936
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition Object.cpp:2217
@ DATA_NETHERMANCER_SEPRETHREA
Definition mechanar.h:33
#define RegisterMechanarCreatureAI(ai_name)
Definition mechanar.h:50
CastSpellExtraArgs & AddSpellBP0(SpellEffectValue 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 KilledUnit(Unit *victim) override
void EnterEvadeMode(EvadeReason) override
void UpdateAI(uint32 diff) override
npc_raging_flames(Creature *creature)