Scripts/Quest: Rework 'The Perfect Dissemblance' (12260) & 'A Fall From Grace' (12274) & Bombard the Ballistae (12232) & Without a Prayer (12254) (#28013)

Closes #26750

(cherry picked from commit ee9e4ac33e)
This commit is contained in:
offl
2022-06-09 20:43:13 +03:00
committed by Shauren
parent 2e0afa7bca
commit fcc08ffb22
2 changed files with 425 additions and 0 deletions

View File

@@ -746,6 +746,139 @@ class spell_dragonblight_high_executor_branding_iron : public SpellScript
}
};
/*######
## Quest 12260: The Perfect Dissemblance
######*/
enum ThePerfectDissemblance
{
SPELL_BANSHEES_MAGIC_MIRROR = 48648
};
// 48692 - The Perfect Dissemblance: Quest Completion Script
class spell_dragonblight_cancel_banshees_magic_mirror : public SpellScript
{
PrepareSpellScript(spell_dragonblight_cancel_banshees_magic_mirror);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_BANSHEES_MAGIC_MIRROR });
}
void HandleScript(SpellEffIndex /*effIndex*/)
{
GetCaster()->RemoveAurasDueToSpell(SPELL_BANSHEES_MAGIC_MIRROR);
}
void Register() override
{
OnEffectHit += SpellEffectFn(spell_dragonblight_cancel_banshees_magic_mirror::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
/*######
## Quest 12274: A Fall From Grace
######*/
enum AFallFromGrace
{
SPELL_PRIEST_IMAGE_FEMALE = 48761,
SPELL_PRIEST_IMAGE_MALE = 48763
};
// 48762 - A Fall from Grace: Scarlet Raven Priest Image - Master
class spell_dragonblight_scarlet_raven_priest_image_master : public SpellScript
{
PrepareSpellScript(spell_dragonblight_scarlet_raven_priest_image_master);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_PRIEST_IMAGE_FEMALE, SPELL_PRIEST_IMAGE_MALE });
}
void HandleAfterHit()
{
if (Player* target = GetHitUnit()->ToPlayer())
target->CastSpell(target, target->GetNativeGender() == GENDER_FEMALE ? SPELL_PRIEST_IMAGE_FEMALE : SPELL_PRIEST_IMAGE_MALE);
}
void Register() override
{
AfterHit += SpellHitFn(spell_dragonblight_scarlet_raven_priest_image_master::HandleAfterHit);
}
};
// 48769 - A Fall from Grace: Quest Completion Script
class spell_dragonblight_cancel_scarlet_raven_priest_image : public SpellScript
{
PrepareSpellScript(spell_dragonblight_cancel_scarlet_raven_priest_image);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_PRIEST_IMAGE_FEMALE, SPELL_PRIEST_IMAGE_MALE });
}
void HandleScript(SpellEffIndex /*effIndex*/)
{
GetCaster()->RemoveAurasDueToSpell(SPELL_PRIEST_IMAGE_FEMALE);
GetCaster()->RemoveAurasDueToSpell(SPELL_PRIEST_IMAGE_MALE);
}
void Register() override
{
OnEffectHit += SpellEffectFn(spell_dragonblight_cancel_scarlet_raven_priest_image::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
/*######
## Quest 12232: Bombard the Ballistae
######*/
enum BombardTheBallistae
{
SPELL_BALLISTA_BOW = 48351,
SPELL_BALLISTA_FRAME = 48352,
SPELL_BALLISTA_MISSILE = 48353,
SPELL_BALLISTA_WHEEL = 48354,
SPELL_BALLISTA_KNOCKBACK = 52687
};
// 48347 - Bombard the Ballistae: FX Master
class spell_dragonblight_bombard_the_ballistae_fx_master : public SpellScript
{
PrepareSpellScript(spell_dragonblight_bombard_the_ballistae_fx_master);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo(
{
SPELL_BALLISTA_BOW,
SPELL_BALLISTA_FRAME,
SPELL_BALLISTA_MISSILE,
SPELL_BALLISTA_WHEEL,
SPELL_BALLISTA_KNOCKBACK
});
}
void HandleScript(SpellEffIndex /*effIndex*/)
{
Unit* caster = GetCaster();
caster->CastSpell(caster, SPELL_BALLISTA_BOW);
caster->CastSpell(caster, SPELL_BALLISTA_FRAME);
caster->CastSpell(caster, SPELL_BALLISTA_MISSILE);
caster->CastSpell(caster, SPELL_BALLISTA_WHEEL);
caster->CastSpell(caster, SPELL_BALLISTA_WHEEL);
caster->CastSpell(caster, SPELL_BALLISTA_WHEEL);
caster->CastSpell(caster, SPELL_BALLISTA_WHEEL);
caster->CastSpell(caster, SPELL_BALLISTA_KNOCKBACK);
}
void Register() override
{
OnEffectHit += SpellEffectFn(spell_dragonblight_bombard_the_ballistae_fx_master::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
void AddSC_dragonblight()
{
RegisterCreatureAI(npc_commander_eligor_dawnbringer);
@@ -757,4 +890,8 @@ void AddSC_dragonblight()
RegisterSpellScript(spell_dragonblight_moti_hourglass_cast_see_invis_on_master);
RegisterSpellScript(spell_dragonblight_call_out_injured_soldier);
RegisterSpellScript(spell_dragonblight_high_executor_branding_iron);
RegisterSpellScript(spell_dragonblight_cancel_banshees_magic_mirror);
RegisterSpellScript(spell_dragonblight_scarlet_raven_priest_image_master);
RegisterSpellScript(spell_dragonblight_cancel_scarlet_raven_priest_image);
RegisterSpellScript(spell_dragonblight_bombard_the_ballistae_fx_master);
}