Skip to content

Commit 9aedd9b

Browse files
committed
Scripts/Mechanar: Update Sepethrea
1 parent 9746b68 commit 9aedd9b

4 files changed

Lines changed: 91 additions & 53 deletions

File tree

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
-- Sepethrea
2+
DELETE FROM `creature_text` WHERE `CreatureID` = 19221;
3+
INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES
4+
(19221,0,0,"Don't value your life very much, do you?",14,0,100,0,0,11186,19959,0,"Sepethrea SAY_AGGRO"),
5+
(19221,1,0,"And don't come back!",14,0,100,0,0,11187,19961,0,"Sepethrea SAY_SLAY_1"),
6+
(19221,1,1,"Endala finel endal!",14,0,100,0,0,11188,19962,0,"Sepethrea SAY_SLAY_2"),
7+
(19221,2,0,"Think you can take the heat?",14,0,100,0,0,11189,19963,0,"Sepethrea SAY_DRAGONS_BREATH_1"),
8+
(19221,2,1,"Anar'endal dracon!",14,0,100,0,0,11190,19964,0,"Sepethrea SAY_DRAGONS_BREATH_2"),
9+
(19221,3,0,"I am not alone.",14,0,100,0,0,11191,19965,0,"Sepethrea SAY_SUMMON"),
10+
(19221,4,0,"Anu... bala belore...alon.",14,0,100,0,0,11192,19966,0,"Sepethrea SAY_DEATH");
11+
12+
DELETE FROM `spell_script_names` WHERE `ScriptName` = 'spell_nethermancer_sepethrea_arcane_blast';
13+
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
14+
(35314, 'spell_nethermancer_sepethrea_arcane_blast');

src/server/scripts/Outland/TempestKeep/Mechanar/boss_nethermancer_sepethrea.cpp

Lines changed: 75 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -15,36 +15,45 @@
1515
* with this program. If not, see <http://www.gnu.org/licenses/>.
1616
*/
1717

18+
/*
19+
* Timers requires to be revisited
20+
*/
21+
1822
#include "ScriptMgr.h"
1923
#include "mechanar.h"
2024
#include "ScriptedCreature.h"
2125
#include "SpellAuraEffects.h"
2226
#include "SpellInfo.h"
2327
#include "SpellScript.h"
24-
#include "TemporarySummon.h"
2528

2629
enum SepethreaTexts
2730
{
2831
SAY_AGGRO = 0,
29-
SAY_SUMMON = 1, // Was never used or used under unknown conditions
32+
SAY_SLAY = 1,
3033
SAY_DRAGONS_BREATH = 2,
31-
SAY_SLAY = 3,
34+
SAY_SUMMON = 3, // Was never used or used under unknown conditions
3235
SAY_DEATH = 4
3336
};
3437

3538
enum SepethreaSpells
3639
{
40+
// Sepethrea - Initial
3741
SPELL_FROST_ATTACK = 45196, // This is definitely spell added in TBC but did it replaced both 35264 and 39086 or only normal version?
3842
SPELL_SUMMON_RAGING_FLAMES = 35275,
39-
SPELL_QUELL_RAGING_FLAMES = 35277,
43+
44+
// Sepethrea - Combat
4045
SPELL_ARCANE_BLAST = 35314,
4146
SPELL_DRAGONS_BREATH = 35250,
4247

48+
// Sepethrea - Combat - Misc
49+
SPELL_QUELL_RAGING_FLAMES = 35277,
50+
4351
// Raging Flames
44-
SPELL_RAGING_FLAMES_DUMMY = 35274, // NYI, no clue what it can do
4552
SPELL_RAGING_FLAMES_AREA_AURA = 35281,
4653
SPELL_INVIS_STEALTH_DETECTION = 18950,
4754
SPELL_INFERNO = 35268,
55+
56+
// Scripts
4857
SPELL_INFERNO_DAMAGE = 35283
4958
};
5059

@@ -68,30 +77,30 @@ struct boss_nethermancer_sepethrea : public BossAI
6877
void JustEngagedWith(Unit* who) override
6978
{
7079
BossAI::JustEngagedWith(who);
71-
events.ScheduleEvent(EVENT_ARCANE_BLAST, 15s, 25s);
72-
events.ScheduleEvent(EVENT_DRAGONS_BREATH, 20s, 30s);
80+
7381
Talk(SAY_AGGRO);
82+
7483
DoCastSelf(SPELL_SUMMON_RAGING_FLAMES);
84+
85+
events.ScheduleEvent(EVENT_ARCANE_BLAST, 15s, 25s);
86+
events.ScheduleEvent(EVENT_DRAGONS_BREATH, 20s, 30s);
7587
}
7688

77-
void OnSpellCast(SpellInfo const* spell) override
89+
void OnSpellCast(SpellInfo const* spellInfo) override
7890
{
79-
if (spell->Id == SPELL_DRAGONS_BREATH)
91+
if (spellInfo->Id == SPELL_DRAGONS_BREATH)
8092
if (roll_chance_i(50))
8193
Talk(SAY_DRAGONS_BREATH);
8294
}
8395

84-
void KilledUnit(Unit* victim) override
85-
{
86-
if (victim->GetTypeId() == TYPEID_PLAYER)
87-
Talk(SAY_SLAY);
88-
}
96+
// Despawn is handled by spell, don't store anything
97+
void JustSummoned(Creature* /*summon*/) override { }
8998

9099
void EnterEvadeMode(EvadeReason why) override
91100
{
92101
// 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
93-
DoCastSelf(SPELL_QUELL_RAGING_FLAMES, true);
94-
ScriptedAI::EnterEvadeMode(why);
102+
DoCastSelf(SPELL_QUELL_RAGING_FLAMES);
103+
BossAI::EnterEvadeMode(why);
95104
}
96105

97106
void JustReachedHome() override
@@ -100,16 +109,19 @@ struct boss_nethermancer_sepethrea : public BossAI
100109
DoCastSelf(SPELL_FROST_ATTACK);
101110
}
102111

112+
void KilledUnit(Unit* victim) override
113+
{
114+
if (victim->GetTypeId() == TYPEID_PLAYER)
115+
Talk(SAY_SLAY);
116+
}
117+
103118
void JustDied(Unit* /*killer*/) override
104119
{
105120
_JustDied();
106121
Talk(SAY_DEATH);
107-
DoCastSelf(SPELL_QUELL_RAGING_FLAMES, true);
122+
DoCastSelf(SPELL_QUELL_RAGING_FLAMES);
108123
}
109124

110-
// Despawn is handled by spell, don't store anything
111-
void JustSummoned(Creature* /*summon*/) override { }
112-
113125
void UpdateAI(uint32 diff) override
114126
{
115127
if (!UpdateVictim())
@@ -126,8 +138,6 @@ struct boss_nethermancer_sepethrea : public BossAI
126138
{
127139
case EVENT_ARCANE_BLAST:
128140
DoCastVictim(SPELL_ARCANE_BLAST);
129-
if (GetThreat(me->GetVictim()))
130-
ModifyThreatByPercent(me->GetVictim(), -50);
131141
events.Repeat(15s, 25s);
132142
break;
133143
case EVENT_DRAGONS_BREATH:
@@ -149,47 +159,44 @@ struct boss_nethermancer_sepethrea : public BossAI
149159
// 20481 - Raging Flames
150160
struct npc_raging_flames : public ScriptedAI
151161
{
152-
npc_raging_flames(Creature* creature) : ScriptedAI(creature) { }
162+
using ScriptedAI::ScriptedAI;
153163

154164
void InitializeAI() override
155165
{
156166
me->SetCorpseDelay(20, true);
157167
}
158168

159-
// It's more tricky actually
160-
void FixateRandomTarget()
161-
{
162-
ResetThreatList();
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-
171169
void JustAppeared() override
172170
{
173171
DoZoneInCombat();
172+
174173
DoCastSelf(SPELL_RAGING_FLAMES_AREA_AURA);
175174
DoCastSelf(SPELL_INVIS_STEALTH_DETECTION);
176-
177-
FixateRandomTarget();
178-
179-
_scheduler.Schedule(15s, 25s, [this](TaskContext task)
180-
{
181-
DoCastSelf(SPELL_INFERNO);
182-
FixateRandomTarget();
183-
184-
task.Repeat(20s, 30s);
185-
});
186175
}
187176

188177
void Reset() override
189178
{
190179
_scheduler.CancelAll();
191180
}
192181

182+
void JustEngagedWith(Unit* /*who*/) override
183+
{
184+
_scheduler
185+
.Schedule(15s, 25s, [this](TaskContext task)
186+
{
187+
DoCastSelf(SPELL_INFERNO);
188+
task.Repeat(20s, 30s);
189+
})
190+
.Schedule(0s, [this](TaskContext task)
191+
{
192+
ResetThreatList();
193+
194+
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100.0f))
195+
AddThreat(target, 1000000.0f);
196+
task.Repeat(10s, 20s);
197+
});
198+
}
199+
193200
void EnterEvadeMode(EvadeReason /*why*/) override
194201
{
195202
me->KillSelf();
@@ -209,32 +216,49 @@ struct npc_raging_flames : public ScriptedAI
209216
TaskScheduler _scheduler;
210217
};
211218

219+
// 35314 - Arcane Blast
220+
class spell_nethermancer_sepethrea_arcane_blast : public SpellScript
221+
{
222+
PrepareSpellScript(spell_nethermancer_sepethrea_arcane_blast);
223+
224+
void HandleAfterHit()
225+
{
226+
if (GetCaster()->CanHaveThreatList())
227+
GetCaster()->GetThreatManager().ModifyThreatByPercent(GetHitUnit(), -50);
228+
}
229+
230+
void Register() override
231+
{
232+
AfterHit += SpellHitFn(spell_nethermancer_sepethrea_arcane_blast::HandleAfterHit);
233+
}
234+
};
235+
212236
// 35268, 39346 - Inferno
213237
class spell_nethermancer_sepethrea_inferno : public AuraScript
214238
{
215239
PrepareAuraScript(spell_nethermancer_sepethrea_inferno);
216240

217-
bool Validate(SpellInfo const* /*spell*/) override
241+
bool Validate(SpellInfo const* /*spellInfo*/) override
218242
{
219243
return ValidateSpellInfo({ SPELL_INFERNO_DAMAGE });
220244
}
221245

222-
void HandlePeriodic(AuraEffect const* aurEff)
246+
void OnPeriodic(AuraEffect const* aurEff)
223247
{
224-
CastSpellExtraArgs args(aurEff);
225-
args.AddSpellBP0(aurEff->GetAmount());
226-
GetTarget()->CastSpell(GetTarget(), SPELL_INFERNO_DAMAGE, args);
248+
GetTarget()->CastSpell(nullptr, SPELL_INFERNO_DAMAGE, CastSpellExtraArgs()
249+
.AddSpellMod(SPELLVALUE_BASE_POINT0, aurEff->GetAmount()));
227250
}
228251

229252
void Register() override
230253
{
231-
OnEffectPeriodic += AuraEffectPeriodicFn(spell_nethermancer_sepethrea_inferno::HandlePeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
254+
OnEffectPeriodic += AuraEffectPeriodicFn(spell_nethermancer_sepethrea_inferno::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
232255
}
233256
};
234257

235258
void AddSC_boss_nethermancer_sepethrea()
236259
{
237260
RegisterMechanarCreatureAI(boss_nethermancer_sepethrea);
238261
RegisterMechanarCreatureAI(npc_raging_flames);
262+
RegisterSpellScript(spell_nethermancer_sepethrea_arcane_blast);
239263
RegisterSpellScript(spell_nethermancer_sepethrea_inferno);
240264
}

src/server/scripts/Outland/TempestKeep/Mechanar/instance_mechanar.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#include "InstanceScript.h"
2020
#include "mechanar.h"
2121

22-
static DoorData const doorData[] =
22+
static constexpr DoorData doorData[] =
2323
{
2424
{ GO_DOOR_MOARG_1, DATA_GATEWATCHER_IRON_HAND, DOOR_TYPE_PASSAGE },
2525
{ GO_DOOR_MOARG_2, DATA_GATEWATCHER_GYROKILL, DOOR_TYPE_PASSAGE },

src/server/scripts/Outland/TempestKeep/Mechanar/mechanar.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#define MechanarScriptName "instance_mechanar"
2424
#define DataHeader "MR"
2525

26-
uint32 const EncounterCount = 5;
26+
uint32 constexpr EncounterCount = 5;
2727

2828
enum MRDataTypes
2929
{

0 commit comments

Comments
 (0)