Scripts/Quest: Script spell for quest "Fumping"

Updates https://github.com/TrinityCore/TrinityCore/issues/11418
This commit is contained in:
Nyeriah
2014-09-16 17:49:16 -03:00
parent 7d1d55124c
commit 2a262aad21
2 changed files with 51 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
--
DELETE FROM `spell_script_names` WHERE `spell_id` = 39238;
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
(39238, 'spell_q10929_fumping');

View File

@@ -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();
}