Scripts/Quest: Update 'Burning to Help' & 'A Cleansing Song' (#27849)

(cherry picked from commit 3d6cc67caf26ddf81ea967064f508f8c8569c278)
This commit is contained in:
offl
2022-03-26 15:48:03 +01:00
committed by Shauren
parent 6a5a39dda0
commit b105dc4c8f
3 changed files with 130 additions and 72 deletions
@@ -0,0 +1,8 @@
--
UPDATE `spell_script_names` SET `ScriptName` = 'spell_sholazar_take_sputum_sample' WHERE `ScriptName` = 'spell_q12683_take_sputum_sample';
DELETE FROM `spell_script_names` WHERE `ScriptName` = 'spell_sholazar_sputum_collected';
INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
(52306,'spell_sholazar_sputum_collected');
UPDATE `spell_script_names` SET `ScriptName` = 'spell_sholazar_song_of_cleansing' WHERE `ScriptName` = 'spell_q12735_song_of_cleansing';
@@ -662,6 +662,125 @@ class spell_q12611_deathbolt : public SpellScript
}
};
/*######
## Quest 12683: Burning to Help
######*/
enum BurningToHelp
{
SPELL_HYDRA_SPUTUM = 52307
};
// 52308 - Take Sputum Sample
class spell_sholazar_take_sputum_sample : public SpellScript
{
PrepareSpellScript(spell_sholazar_take_sputum_sample);
bool Validate(SpellInfo const* spellInfo) override
{
return spellInfo->GetEffects().size() > EFFECT_1 && ValidateSpellInfo(
{
uint32(spellInfo->GetEffect(EFFECT_0).CalcValue()),
uint32(spellInfo->GetEffect(EFFECT_1).CalcValue())
});
}
SpellCastResult CheckCast()
{
if (!GetCaster()->HasAura(uint32(GetEffectInfo(EFFECT_1).CalcValue())))
return SPELL_FAILED_CASTER_AURASTATE;
return SPELL_CAST_OK;
}
void HandleDummy(SpellEffIndex /*effIndex*/)
{
GetCaster()->CastSpell(GetCaster(), uint32(GetEffectValue()));
}
void Register() override
{
OnCheckCast += SpellCheckCastFn(spell_sholazar_take_sputum_sample::CheckCast);
OnEffectHit += SpellEffectFn(spell_sholazar_take_sputum_sample::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
// 52306 - Sputum Collected
class spell_sholazar_sputum_collected : public SpellScript
{
PrepareSpellScript(spell_sholazar_sputum_collected);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_HYDRA_SPUTUM });
}
void HandleScript(SpellEffIndex /*effIndex*/)
{
GetCaster()->RemoveAurasDueToSpell(SPELL_HYDRA_SPUTUM);
}
void Register() override
{
OnEffectHit += SpellEffectFn(spell_sholazar_sputum_collected::HandleScript, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
/*######
## Quest 12735: A Cleansing Song
######*/
enum ACleansingSong
{
SPELL_SUMMON_SPIRIT_ATHA = 52954,
SPELL_SUMMON_SPIRIT_HAKHALAN = 52958,
SPELL_SUMMON_SPIRIT_KOOSU = 52959,
AREA_BITTERTIDE_LAKE = 4385,
AREA_RIVERS_HEART = 4290,
AREA_WINTERGRASP_RIVER = 4388
};
// 52941 - Song of Cleansing
class spell_sholazar_song_of_cleansing : public SpellScript
{
PrepareSpellScript(spell_sholazar_song_of_cleansing);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo(
{
SPELL_SUMMON_SPIRIT_ATHA,
SPELL_SUMMON_SPIRIT_HAKHALAN,
SPELL_SUMMON_SPIRIT_KOOSU
});
}
void HandleScript(SpellEffIndex /*effIndex*/)
{
Unit* caster = GetCaster();
switch (caster->GetAreaId())
{
case AREA_BITTERTIDE_LAKE:
caster->CastSpell(caster, SPELL_SUMMON_SPIRIT_ATHA);
break;
case AREA_RIVERS_HEART:
caster->CastSpell(caster, SPELL_SUMMON_SPIRIT_HAKHALAN);
break;
case AREA_WINTERGRASP_RIVER:
caster->CastSpell(caster, SPELL_SUMMON_SPIRIT_KOOSU);
break;
default:
break;
}
}
void Register() override
{
OnEffectHit += SpellEffectFn(spell_sholazar_song_of_cleansing::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
void AddSC_sholazar_basin()
{
RegisterCreatureAI(npc_engineer_helice);
@@ -672,4 +791,7 @@ void AddSC_sholazar_basin()
new spell_q12589_shoot_rjr();
new npc_haiphoon();
RegisterSpellScript(spell_q12611_deathbolt);
RegisterSpellScript(spell_sholazar_take_sputum_sample);
RegisterSpellScript(spell_sholazar_sputum_collected);
RegisterSpellScript(spell_sholazar_song_of_cleansing);
}
-72
View File
@@ -536,35 +536,6 @@ class spell_q12634_despawn_fruit_tosser : public SpellScript
}
};
// http://www.wowhead.com/quest=12683 Burning to Help
// 52308 - Take Sputum Sample
class spell_q12683_take_sputum_sample : public SpellScript
{
PrepareSpellScript(spell_q12683_take_sputum_sample);
bool Validate(SpellInfo const* spellInfo) override
{
return spellInfo->GetEffects().size() > EFFECT_1;
}
void HandleDummy(SpellEffIndex /*effIndex*/)
{
uint32 reqAuraId = GetEffectInfo(EFFECT_1).CalcValue();
Unit* caster = GetCaster();
if (caster->HasAuraEffect(reqAuraId, 0))
{
uint32 spellId = GetEffectValue();
caster->CastSpell(caster, spellId, true);
}
}
void Register() override
{
OnEffectHit += SpellEffectFn(spell_q12683_take_sputum_sample::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
// http://www.wowhead.com/quest=12851 Going Bearback
enum Quest12851Data
{
@@ -892,47 +863,6 @@ class spell_q12066_bunny_kill_credit : public SpellScript
}
};
enum ACleansingSong
{
SPELL_SUMMON_SPIRIT_ATAH = 52954,
SPELL_SUMMON_SPIRIT_HAKHALAN = 52958,
SPELL_SUMMON_SPIRIT_KOOSU = 52959,
AREA_BITTERTIDELAKE = 4385,
AREA_RIVERSHEART = 4290,
AREA_WINTERGRASPRIVER = 4388,
};
// 52941 - Song of Cleansing
class spell_q12735_song_of_cleansing : public SpellScript
{
PrepareSpellScript(spell_q12735_song_of_cleansing);
void HandleScript(SpellEffIndex /*effIndex*/)
{
Unit* caster = GetCaster();
switch (caster->GetAreaId())
{
case AREA_BITTERTIDELAKE:
caster->CastSpell(caster, SPELL_SUMMON_SPIRIT_ATAH);
break;
case AREA_RIVERSHEART:
caster->CastSpell(caster, SPELL_SUMMON_SPIRIT_HAKHALAN);
break;
case AREA_WINTERGRASPRIVER:
caster->CastSpell(caster, SPELL_SUMMON_SPIRIT_KOOSU);
break;
default:
break;
}
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_q12735_song_of_cleansing::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
enum DefendingWyrmrestTemple
{
SPELL_SUMMON_WYRMREST_DEFENDER = 49207
@@ -2286,7 +2216,6 @@ void AddSC_quest_spell_scripts()
RegisterSpellScript(spell_q11730_ultrasonic_screwdriver);
RegisterSpellScript(spell_q12459_seeds_of_natures_wrath);
RegisterSpellScript(spell_q12634_despawn_fruit_tosser);
RegisterSpellScript(spell_q12683_take_sputum_sample);
RegisterSpellScript(spell_q12851_going_bearback);
RegisterSpellScript(spell_q10041_q10040_who_are_they);
RegisterSpellScript(spell_q12659_ahunaes_knife);
@@ -2297,7 +2226,6 @@ void AddSC_quest_spell_scripts()
RegisterSpellScript(spell_q14112_14145_chum_the_water);
RegisterSpellScript(spell_q9452_cast_net);
RegisterSpellScript(spell_q12066_bunny_kill_credit);
RegisterSpellScript(spell_q12735_song_of_cleansing);
RegisterSpellScript(spell_q12372_cast_from_gossip_trigger);
RegisterSpellScript(spell_q12372_destabilize_azure_dragonshrine_dummy);
RegisterSpellScript(spell_q11010_q11102_q11023_aggro_check_aura);