mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Scripts/Quest: Script spell for quest "Fumping"
Updates https://github.com/TrinityCore/TrinityCore/issues/11418
This commit is contained in:
@@ -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');
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user