fix(Scripts/MagtheridonsLair): fix Magtheridon's Quake spell (#16730)
* fix(Core/Magtheridon): fix Magtheridon's Quake spell * missing sql
This commit is contained in:
@@ -0,0 +1,5 @@
|
|||||||
|
--
|
||||||
|
DELETE FROM `spell_linked_spell` WHERE `spell_trigger` = 30658 AND `spell_effect` = 30571;
|
||||||
|
DELETE FROM `spell_script_names` WHERE `ScriptName` = ('spell_magtheridon_quake');
|
||||||
|
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
|
||||||
|
(30658, 'spell_magtheridon_quake');
|
||||||
@@ -49,6 +49,7 @@ enum Spells
|
|||||||
SPELL_SHADOW_GRASP_VISUAL = 30166,
|
SPELL_SHADOW_GRASP_VISUAL = 30166,
|
||||||
SPELL_MIND_EXHAUSTION = 44032,
|
SPELL_MIND_EXHAUSTION = 44032,
|
||||||
SPELL_QUAKE = 30657,
|
SPELL_QUAKE = 30657,
|
||||||
|
SPELL_QUAKE_KNOCKBACK = 30571,
|
||||||
SPELL_COLLAPSE_DAMAGE = 36449,
|
SPELL_COLLAPSE_DAMAGE = 36449,
|
||||||
SPELL_CAMERA_SHAKE = 36455,
|
SPELL_CAMERA_SHAKE = 36455,
|
||||||
SPELL_DEBRIS_VISUAL = 30632,
|
SPELL_DEBRIS_VISUAL = 30632,
|
||||||
@@ -77,14 +78,9 @@ private:
|
|||||||
ObjectGuid _targetGUID;
|
ObjectGuid _targetGUID;
|
||||||
};
|
};
|
||||||
|
|
||||||
class boss_magtheridon : public CreatureScript
|
struct boss_magtheridon : public BossAI
|
||||||
{
|
{
|
||||||
public:
|
boss_magtheridon(Creature* creature) : BossAI(creature, TYPE_MAGTHERIDON)
|
||||||
boss_magtheridon() : CreatureScript("boss_magtheridon") { }
|
|
||||||
|
|
||||||
struct boss_magtheridonAI : public BossAI
|
|
||||||
{
|
|
||||||
boss_magtheridonAI(Creature* creature) : BossAI(creature, TYPE_MAGTHERIDON)
|
|
||||||
{
|
{
|
||||||
scheduler.SetValidator([this]
|
scheduler.SetValidator([this]
|
||||||
{
|
{
|
||||||
@@ -94,7 +90,7 @@ public:
|
|||||||
|
|
||||||
void Reset() override
|
void Reset() override
|
||||||
{
|
{
|
||||||
_Reset();
|
BossAI::Reset();
|
||||||
_currentPhase = 0;
|
_currentPhase = 0;
|
||||||
_recentlySpoken = false;
|
_recentlySpoken = false;
|
||||||
scheduler.Schedule(90s, [this](TaskContext context)
|
scheduler.Schedule(90s, [this](TaskContext context)
|
||||||
@@ -102,12 +98,13 @@ public:
|
|||||||
Talk(SAY_TAUNT);
|
Talk(SAY_TAUNT);
|
||||||
context.Repeat(90s);
|
context.Repeat(90s);
|
||||||
});
|
});
|
||||||
me->CastSpell(me, SPELL_SHADOW_CAGE, true);
|
DoCastSelf(SPELL_SHADOW_CAGE, true);
|
||||||
me->SetReactState(REACT_PASSIVE);
|
me->SetReactState(REACT_PASSIVE);
|
||||||
me->SetUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
|
me->SetUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
|
||||||
me->SetImmuneToPC(true);
|
me->SetImmuneToPC(true);
|
||||||
|
|
||||||
ScheduleHealthCheckEvent(30, [&] {
|
ScheduleHealthCheckEvent(30, [&]
|
||||||
|
{
|
||||||
_currentPhase = 1;
|
_currentPhase = 1;
|
||||||
Talk(SAY_PHASE3);
|
Talk(SAY_PHASE3);
|
||||||
me->GetMotionMaster()->Clear();
|
me->GetMotionMaster()->Clear();
|
||||||
@@ -137,7 +134,7 @@ public:
|
|||||||
|
|
||||||
void KilledUnit(Unit* /*victim*/) override
|
void KilledUnit(Unit* /*victim*/) override
|
||||||
{
|
{
|
||||||
if(!_recentlySpoken)
|
if (!_recentlySpoken)
|
||||||
{
|
{
|
||||||
Talk(SAY_SLAY);
|
Talk(SAY_SLAY);
|
||||||
_recentlySpoken = true;
|
_recentlySpoken = true;
|
||||||
@@ -149,15 +146,15 @@ public:
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void JustDied(Unit* /*killer*/) override
|
void JustDied(Unit* killer) override
|
||||||
{
|
{
|
||||||
_JustDied();
|
|
||||||
Talk(SAY_DEATH);
|
Talk(SAY_DEATH);
|
||||||
|
BossAI::JustDied(killer);
|
||||||
}
|
}
|
||||||
|
|
||||||
void JustEngagedWith(Unit* /*who*/) override
|
void JustEngagedWith(Unit* who) override
|
||||||
{
|
{
|
||||||
_JustEngagedWith();
|
BossAI::JustEngagedWith(who);
|
||||||
Talk(SAY_EMOTE_BEGIN);
|
Talk(SAY_EMOTE_BEGIN);
|
||||||
|
|
||||||
scheduler.Schedule(60s, [this](TaskContext /*context*/)
|
scheduler.Schedule(60s, [this](TaskContext /*context*/)
|
||||||
@@ -184,7 +181,7 @@ public:
|
|||||||
context.Repeat(11s, 39s);
|
context.Repeat(11s, 39s);
|
||||||
}).Schedule(40s, [this](TaskContext context)
|
}).Schedule(40s, [this](TaskContext context)
|
||||||
{
|
{
|
||||||
me->CastSpell(me, SPELL_QUAKE); //needs fixes with custom spell
|
DoCastSelf(SPELL_QUAKE); //needs fixes with custom spell
|
||||||
scheduler.Schedule(7s, [this](TaskContext /*context*/)
|
scheduler.Schedule(7s, [this](TaskContext /*context*/)
|
||||||
{
|
{
|
||||||
DoCastSelf(SPELL_BLAST_NOVA);
|
DoCastSelf(SPELL_BLAST_NOVA);
|
||||||
@@ -223,26 +220,15 @@ public:
|
|||||||
DoMeleeAttackIfReady();
|
DoMeleeAttackIfReady();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private:
|
|
||||||
|
private:
|
||||||
bool _recentlySpoken;
|
bool _recentlySpoken;
|
||||||
uint8 _currentPhase;
|
uint8 _currentPhase;
|
||||||
};
|
|
||||||
|
|
||||||
CreatureAI* GetAI(Creature* creature) const override
|
|
||||||
{
|
|
||||||
return GetMagtheridonsLairAI<boss_magtheridonAI>(creature);
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class spell_magtheridon_blaze : public SpellScriptLoader
|
class spell_magtheridon_blaze : public SpellScript
|
||||||
{
|
{
|
||||||
public:
|
PrepareSpellScript(spell_magtheridon_blaze);
|
||||||
spell_magtheridon_blaze() : SpellScriptLoader("spell_magtheridon_blaze") { }
|
|
||||||
|
|
||||||
class spell_magtheridon_blaze_SpellScript : public SpellScript
|
|
||||||
{
|
|
||||||
PrepareSpellScript(spell_magtheridon_blaze_SpellScript);
|
|
||||||
|
|
||||||
void HandleScriptEffect(SpellEffIndex /*effIndex*/)
|
void HandleScriptEffect(SpellEffIndex /*effIndex*/)
|
||||||
{
|
{
|
||||||
@@ -252,24 +238,13 @@ public:
|
|||||||
|
|
||||||
void Register() override
|
void Register() override
|
||||||
{
|
{
|
||||||
OnEffectHitTarget += SpellEffectFn(spell_magtheridon_blaze_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
OnEffectHitTarget += SpellEffectFn(spell_magtheridon_blaze::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
SpellScript* GetSpellScript() const override
|
|
||||||
{
|
|
||||||
return new spell_magtheridon_blaze_SpellScript();
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class spell_magtheridon_shadow_grasp : public SpellScriptLoader
|
class spell_magtheridon_shadow_grasp : public AuraScript
|
||||||
{
|
{
|
||||||
public:
|
PrepareAuraScript(spell_magtheridon_shadow_grasp);
|
||||||
spell_magtheridon_shadow_grasp() : SpellScriptLoader("spell_magtheridon_shadow_grasp") { }
|
|
||||||
|
|
||||||
class spell_magtheridon_shadow_grasp_AuraScript : public AuraScript
|
|
||||||
{
|
|
||||||
PrepareAuraScript(spell_magtheridon_shadow_grasp_AuraScript)
|
|
||||||
|
|
||||||
void HandleDummyApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
void HandleDummyApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||||
{
|
{
|
||||||
@@ -288,21 +263,32 @@ public:
|
|||||||
|
|
||||||
void Register() override
|
void Register() override
|
||||||
{
|
{
|
||||||
OnEffectApply += AuraEffectApplyFn(spell_magtheridon_shadow_grasp_AuraScript::HandleDummyApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
OnEffectApply += AuraEffectApplyFn(spell_magtheridon_shadow_grasp::HandleDummyApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||||
OnEffectRemove += AuraEffectRemoveFn(spell_magtheridon_shadow_grasp_AuraScript::HandleDummyRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
OnEffectRemove += AuraEffectRemoveFn(spell_magtheridon_shadow_grasp::HandleDummyRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||||
OnEffectRemove += AuraEffectRemoveFn(spell_magtheridon_shadow_grasp_AuraScript::HandlePeriodicRemove, EFFECT_1, SPELL_AURA_PERIODIC_DAMAGE, AURA_EFFECT_HANDLE_REAL);
|
OnEffectRemove += AuraEffectRemoveFn(spell_magtheridon_shadow_grasp::HandlePeriodicRemove, EFFECT_1, SPELL_AURA_PERIODIC_DAMAGE, AURA_EFFECT_HANDLE_REAL);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
AuraScript* GetAuraScript() const override
|
class spell_magtheridon_quake : public SpellScript
|
||||||
|
{
|
||||||
|
PrepareSpellScript(spell_magtheridon_quake);
|
||||||
|
|
||||||
|
void HandleHit()
|
||||||
{
|
{
|
||||||
return new spell_magtheridon_shadow_grasp_AuraScript();
|
if (urand(0, 3) == 0)
|
||||||
|
GetCaster()->CastSpell(GetCaster(), SPELL_QUAKE_KNOCKBACK, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Register() override
|
||||||
|
{
|
||||||
|
OnHit += SpellHitFn(spell_magtheridon_quake::HandleHit);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
void AddSC_boss_magtheridon()
|
void AddSC_boss_magtheridon()
|
||||||
{
|
{
|
||||||
new boss_magtheridon();
|
RegisterMagtheridonsLairCreatureAI(boss_magtheridon);
|
||||||
new spell_magtheridon_blaze();
|
RegisterSpellScript(spell_magtheridon_blaze);
|
||||||
new spell_magtheridon_shadow_grasp();
|
RegisterSpellScript(spell_magtheridon_shadow_grasp);
|
||||||
|
RegisterSpellScript(spell_magtheridon_quake);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -62,4 +62,6 @@ inline AI* GetMagtheridonsLairAI(T* obj)
|
|||||||
return GetInstanceAI<AI>(obj, MagtheridonsLairScriptName);
|
return GetInstanceAI<AI>(obj, MagtheridonsLairScriptName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define RegisterMagtheridonsLairCreatureAI(ai_name) RegisterCreatureAIWithFactory(ai_name, GetMagtheridonsLairAI)
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user