mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-18 16:38:42 +01:00
Core/Spell Add Spell Script Needed for quest Torch Tossing/More Torch Tossing
Updated
This commit is contained in:
3
sql/updates/world/2015_08_29_00_world.sql
Normal file
3
sql/updates/world/2015_08_29_00_world.sql
Normal file
@@ -0,0 +1,3 @@
|
||||
DELETE FROM `spell_script_names` WHERE `spell_id`=45724;
|
||||
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
|
||||
(45724, 'spell_midsummer_braziers_hit');
|
||||
@@ -824,6 +824,60 @@ class spell_brewfest_barker_bunny : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
enum TorchSpells
|
||||
{
|
||||
SPELL_TORCH_TOSSING_TRAINING = 45716,
|
||||
SPELL_TORCH_TOSSING_PRACTICE = 46630,
|
||||
SPELL_TORCH_TOSSING_TRAINING_SUCCESS_ALLIANCE = 45719,
|
||||
SPELL_TORCH_TOSSING_TRAINING_SUCCESS_HORDE = 46651,
|
||||
SPELL_BRAZIERS_HIT = 45724
|
||||
};
|
||||
|
||||
// 45724 - Braziers Hit!
|
||||
class spell_midsummer_braziers_hit : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_midsummer_braziers_hit() : SpellScriptLoader("spell_midsummer_braziers_hit") { }
|
||||
|
||||
class spell_midsummer_braziers_hit_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_midsummer_braziers_hit_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_TORCH_TOSSING_TRAINING) || !sSpellMgr->GetSpellInfo(SPELL_TORCH_TOSSING_PRACTICE))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
Player* player = GetTarget()->ToPlayer();
|
||||
if (!player)
|
||||
return;
|
||||
|
||||
if ((player->HasAura(SPELL_TORCH_TOSSING_TRAINING) && GetStackAmount() == 8) || (player->HasAura(SPELL_TORCH_TOSSING_PRACTICE) && GetStackAmount() == 20))
|
||||
{
|
||||
if (player->GetTeam() == ALLIANCE)
|
||||
player->CastSpell(player, SPELL_TORCH_TOSSING_TRAINING_SUCCESS_ALLIANCE, true);
|
||||
else if (player->GetTeam() == HORDE)
|
||||
player->CastSpell(player, SPELL_TORCH_TOSSING_TRAINING_SUCCESS_HORDE, true);
|
||||
Remove();
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
AfterEffectApply += AuraEffectApplyFn(spell_midsummer_braziers_hit_AuraScript::HandleEffectApply, EFFECT_0, SPELL_AURA_DUMMY, AuraEffectHandleModes(AURA_EFFECT_HANDLE_REAPPLY));
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_midsummer_braziers_hit_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_holiday_spell_scripts()
|
||||
{
|
||||
// Love is in the Air
|
||||
@@ -850,4 +904,6 @@ void AddSC_holiday_spell_scripts()
|
||||
new spell_brewfest_relay_race_intro_force_player_to_throw();
|
||||
new spell_brewfest_dismount_ram();
|
||||
new spell_brewfest_barker_bunny();
|
||||
//Midsummer Fire Festival
|
||||
new spell_midsummer_braziers_hit();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user