Scripts/Quests: scripted Launch Quest spells and use them to launch the 'A Personal Summon' quests when entering Stormwind or Orgrimmar

This commit is contained in:
Ovahlord committed 2020-09-26 19:57:05 +02:00
1 parent 941194018d
commit 35b07faf2b
2 files changed
+46

No files matched your search

@@ -0,0 +1,9 @@
DELETE FROM `spell_script_names` WHERE `ScriptName`= 'spell_gen_launch_quest_aura';
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
(93081, 'spell_gen_launch_quest_aura'),
(93216, 'spell_gen_launch_quest_aura');
DELETE FROM `spell_area` WHERE `spell` IN (93081, 93216);
INSERT INTO `spell_area` (`spell`, `area`, `gender`, `flags`) VALUES
(93081, 1637, 2, 1),
(93216, 1519, 2, 1);
@@ -5298,6 +5298,42 @@ class spell_gen_zero_energy_zero_regen : public AuraScript
}
};
enum LaunchQuestAura
{
SPELL_LAUNCH_QUEST_PERSONAL_SUMMONS_HORDE = 93079,
SPELL_LAUNCH_QUEST_PERSONAL_SUMMONS_ALLIANCE = 93217,
};
// 93081 - Launch Quest Aura
// 93216 - Launch Quest Aura
class spell_gen_launch_quest_aura : public AuraScript
{
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo(
{
SPELL_LAUNCH_QUEST_PERSONAL_SUMMONS_HORDE,
SPELL_LAUNCH_QUEST_PERSONAL_SUMMONS_ALLIANCE
});
}
// According to sniffs the quests are being launched when the aura expires, not when it gets applied.
void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
Player* player = GetTarget()->ToPlayer();
if (!player)
return;
uint32 spellId = player->GetTeamId() == TEAM_ALLIANCE ? SPELL_LAUNCH_QUEST_PERSONAL_SUMMONS_ALLIANCE : SPELL_LAUNCH_QUEST_PERSONAL_SUMMONS_HORDE;
GetTarget()->CastSpell(GetTarget(), spellId);
}
void Register() override
{
AfterEffectRemove.Register(&spell_gen_launch_quest_aura::AfterRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
}
};
void AddSC_generic_spell_scripts()
{
new spell_gen_absorb0_hitlimit1();
@@ -5348,6 +5384,7 @@ void AddSC_generic_spell_scripts()
new spell_gen_increase_stats_buff("spell_mage_arcane_brilliance");
new spell_gen_increase_stats_buff("spell_mage_dalaran_brilliance");
new spell_gen_interrupt();
RegisterSpellScript(spell_gen_launch_quest_aura);
new spell_gen_lifebloom("spell_hexlord_lifebloom", SPELL_HEXLORD_MALACRASS_LIFEBLOOM_FINAL_HEAL);
new spell_gen_lifebloom("spell_tur_ragepaw_lifebloom", SPELL_TUR_RAGEPAW_LIFEBLOOM_FINAL_HEAL);
new spell_gen_lifebloom("spell_cenarion_scout_lifebloom", SPELL_CENARION_SCOUT_LIFEBLOOM_FINAL_HEAL);