aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNyeriah <sarah.trysan@live.com>2014-09-16 17:49:16 -0300
committerNyeriah <sarah.trysan@live.com>2014-09-16 17:49:16 -0300
commit2a262aad21f7f9205a49769fd39c207c7ff59768 (patch)
tree0fe54e9498a616a90891d1cc142800d722d05b0f /src
parent7d1d55124c1e289748d2afefae896c97f710e57b (diff)
Scripts/Quest: Script spell for quest "Fumping"
Updates https://github.com/TrinityCore/TrinityCore/issues/11418
Diffstat (limited to 'src')
-rw-r--r--src/server/scripts/Spells/spell_quest.cpp47
1 files changed, 47 insertions, 0 deletions
diff --git a/src/server/scripts/Spells/spell_quest.cpp b/src/server/scripts/Spells/spell_quest.cpp
index 00ce2cb280e..9c65567fe7f 100644
--- a/src/server/scripts/Spells/spell_quest.cpp
+++ b/src/server/scripts/Spells/spell_quest.cpp
@@ -2348,6 +2348,52 @@ class spell_q14100_q14111_make_player_destroy_totems : public SpellScriptLoader
}
};
+enum Fumping
+{
+ SPELL_SUMMON_SAND_GNOME = 39240,
+ SPELL_SUMMON_BONE_SLICER = 39241
+};
+
+// 39238 - Fumping
+class spell_q10929_fumping : SpellScriptLoader
+{
+ public:
+ spell_q10929_fumping() : SpellScriptLoader("spell_q10929_fumping") { }
+
+ class spell_q10929_fumpingAuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_q10929_fumpingAuraScript);
+
+ bool Validate(SpellInfo const* /*spell*/) override
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_SUMMON_SAND_GNOME))
+ return false;
+ if (!sSpellMgr->GetSpellInfo(SPELL_SUMMON_BONE_SLICER))
+ return false;
+ return true;
+ }
+
+ void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ {
+ if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE)
+ return;
+
+ if (Unit* caster = GetCaster())
+ caster->CastSpell(caster, urand(SPELL_SUMMON_SAND_GNOME, SPELL_SUMMON_BONE_SLICER), true);
+ }
+
+ void Register() override
+ {
+ OnEffectRemove += AuraEffectRemoveFn(spell_q10929_fumpingAuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
+ }
+ };
+
+ AuraScript* GetAuraScript() const override
+ {
+ return new spell_q10929_fumpingAuraScript();
+ }
+};
+
void AddSC_quest_spell_scripts()
{
new spell_q55_sacred_cleansing();
@@ -2405,4 +2451,5 @@ void AddSC_quest_spell_scripts()
new spell_q12919_gymers_throw();
new spell_q13400_illidan_kill_master();
new spell_q14100_q14111_make_player_destroy_totems();
+ new spell_q10929_fumping();
}