fix(Scripts/EasternKingdoms): Add quest requirement to Orbaz Bloodbane's Ebon Hold portal (#22443)
Co-authored-by: Kitzunu <24550914+Kitzunu@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,4 @@
|
|||||||
|
--
|
||||||
|
DELETE FROM `spell_script_names` WHERE `spell_id` = 53099 AND `ScriptName` = 'spell_portal_effect_acherus';
|
||||||
|
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES(53099, 'spell_portal_effect_acherus');
|
||||||
|
DELETE FROM `spell_scripts` WHERE `id`=53099 AND `effIndex`=0;
|
||||||
@@ -1027,6 +1027,44 @@ class spell_chapter2_persuasive_strike : public SpellScript
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum AcherusPortal
|
||||||
|
{
|
||||||
|
SPELL_PORTAL_EFFECT_ACHERUS = 53098,
|
||||||
|
QUEST_SCARLET_ARMIES_APPROACH = 12757
|
||||||
|
};
|
||||||
|
|
||||||
|
class spell_portal_effect_acherus : public SpellScript
|
||||||
|
{
|
||||||
|
PrepareSpellScript(spell_portal_effect_acherus);
|
||||||
|
|
||||||
|
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||||
|
{
|
||||||
|
return ValidateSpellInfo({ SPELL_PORTAL_EFFECT_ACHERUS });
|
||||||
|
}
|
||||||
|
|
||||||
|
SpellCastResult CheckCast()
|
||||||
|
{
|
||||||
|
Unit* target = GetExplTargetUnit();
|
||||||
|
if (target && target->IsPlayer() && target->ToPlayer()->HasQuest(QUEST_SCARLET_ARMIES_APPROACH))
|
||||||
|
return SPELL_CAST_OK;
|
||||||
|
|
||||||
|
return SPELL_FAILED_DONT_REPORT;
|
||||||
|
}
|
||||||
|
|
||||||
|
void HandleScriptEffect(SpellEffIndex /*effIndex*/)
|
||||||
|
{
|
||||||
|
if (Unit* caster = GetCaster())
|
||||||
|
if (Player* player = GetHitPlayer())
|
||||||
|
caster->CastSpell(player, GetEffectValue(), true);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Register() override
|
||||||
|
{
|
||||||
|
OnCheckCast += SpellCheckCastFn(spell_portal_effect_acherus::CheckCast);
|
||||||
|
OnEffectHitTarget += SpellEffectFn(spell_portal_effect_acherus::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
void AddSC_the_scarlet_enclave_c2()
|
void AddSC_the_scarlet_enclave_c2()
|
||||||
{
|
{
|
||||||
new npc_scarlet_courier();
|
new npc_scarlet_courier();
|
||||||
@@ -1035,4 +1073,5 @@ void AddSC_the_scarlet_enclave_c2()
|
|||||||
new npc_acherus_necromancer();
|
new npc_acherus_necromancer();
|
||||||
new npc_gothik_the_harvester();
|
new npc_gothik_the_harvester();
|
||||||
RegisterSpellScript(spell_chapter2_persuasive_strike);
|
RegisterSpellScript(spell_chapter2_persuasive_strike);
|
||||||
|
RegisterSpellScript(spell_portal_effect_acherus);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user