aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAokromes <Aokromes@users.noreply.github.com>2016-06-26 00:27:19 +0200
committerGitHub <noreply@github.com>2016-06-26 00:27:19 +0200
commitb0e5f6de47e85e1ca7cd3cc54dcf31fddac71a9f (patch)
treee1a3066a12d5c0cfa8bba9ed7d8edbf70492fb6e /src
parentfdf0092ac24a27f1e95ffeb4f0257404998980ee (diff)
Scripts/Midsummer: Burning hot pole dance (#17445)
* Scripts/Midsummer: Burning hot pole dance By zwerg, closes #6876
Diffstat (limited to 'src')
-rw-r--r--src/server/scripts/Spells/spell_holiday.cpp65
1 files changed, 65 insertions, 0 deletions
diff --git a/src/server/scripts/Spells/spell_holiday.cpp b/src/server/scripts/Spells/spell_holiday.cpp
index 6442eb8acca..73347ff1163 100644
--- a/src/server/scripts/Spells/spell_holiday.cpp
+++ b/src/server/scripts/Spells/spell_holiday.cpp
@@ -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();
}