mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Scripts/Midsummer: Burning hot pole dance (#17445)
* Scripts/Midsummer: Burning hot pole dance By zwerg, closes #6876
This commit is contained in:
10
sql/updates/world/3.3.5/2016_99_99_99_world_.sql
Normal file
10
sql/updates/world/3.3.5/2016_99_99_99_world_.sql
Normal file
@@ -0,0 +1,10 @@
|
||||
-- Link Dancer Check Aura and Visual to Ribbon Pole Channel
|
||||
DELETE FROM `spell_linked_spell` WHERE `spell_trigger` IN (29531,45390);
|
||||
INSERT INTO `spell_linked_spell` (`spell_trigger`,`spell_effect`,`type`,`comment`) VALUES
|
||||
(29531,45390,0, 'Ribbon Pole - Dancer Check Aura'),
|
||||
(45390,45406,2, 'Ribbon Pole - Periodic Visual');
|
||||
|
||||
-- Spell Script
|
||||
DELETE FROM `spell_script_names` WHERE `spell_id`=45390;
|
||||
INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
|
||||
(45390, 'spell_gen_ribbon_pole_dancer_check');
|
||||
@@ -1183,6 +1183,70 @@ class spell_midsummer_braziers_hit : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
enum RibbonPoleData
|
||||
{
|
||||
SPELL_HAS_FULL_MIDSUMMER_SET = 58933,
|
||||
SPELL_BURNING_HOT_POLE_DANCE = 58934,
|
||||
SPELL_RIBBON_DANCE = 29175,
|
||||
GO_RIBBON_POLE = 181605,
|
||||
};
|
||||
|
||||
class spell_gen_ribbon_pole_dancer_check : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_gen_ribbon_pole_dancer_check() : SpellScriptLoader("spell_gen_ribbon_pole_dancer_check") { }
|
||||
|
||||
class spell_gen_ribbon_pole_dancer_check_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_gen_ribbon_pole_dancer_check_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_HAS_FULL_MIDSUMMER_SET)
|
||||
|| !sSpellMgr->GetSpellInfo(SPELL_RIBBON_DANCE)
|
||||
|| !sSpellMgr->GetSpellInfo(SPELL_BURNING_HOT_POLE_DANCE))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void PeriodicTick(AuraEffect const* /*aurEff*/)
|
||||
{
|
||||
Unit* target = GetTarget();
|
||||
|
||||
// check if aura needs to be removed
|
||||
if (!target->FindNearestGameObject(GO_RIBBON_POLE, 20.0f) || !target->HasUnitState(UNIT_STATE_CASTING))
|
||||
{
|
||||
target->InterruptNonMeleeSpells(false);
|
||||
target->RemoveAurasDueToSpell(GetId());
|
||||
return;
|
||||
}
|
||||
|
||||
// set xp buff duration
|
||||
if (Aura* aur = target->GetAura(SPELL_RIBBON_DANCE))
|
||||
{
|
||||
aur->SetMaxDuration(std::min(3600000, aur->GetMaxDuration() + 180000));
|
||||
aur->RefreshDuration();
|
||||
|
||||
// reward achievement criteria
|
||||
if (aur->GetMaxDuration() == 3600000 && target->HasAura(SPELL_HAS_FULL_MIDSUMMER_SET))
|
||||
target->CastSpell(target, SPELL_BURNING_HOT_POLE_DANCE, true);
|
||||
}
|
||||
else
|
||||
target->AddAura(SPELL_RIBBON_DANCE, target);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_gen_ribbon_pole_dancer_check_AuraScript::PeriodicTick, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_gen_ribbon_pole_dancer_check_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_holiday_spell_scripts()
|
||||
{
|
||||
// Love is in the Air
|
||||
@@ -1219,4 +1283,5 @@ void AddSC_holiday_spell_scripts()
|
||||
new spell_brewfest_barker_bunny();
|
||||
// Midsummer Fire Festival
|
||||
new spell_midsummer_braziers_hit();
|
||||
new spell_gen_ribbon_pole_dancer_check();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user