aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/Kalimdor
diff options
context:
space:
mode:
authoroffl <11556157+offl@users.noreply.github.com>2021-11-01 18:10:09 +0200
committerShauren <shauren.trinity@gmail.com>2022-03-21 00:18:17 +0100
commit3fbc9d796d2bb5553fd83c652d0e1539de9ec09e (patch)
treebbdd65af9ef1ce54e64e1e8e234a78769d217183 /src/server/scripts/Kalimdor
parentd013a8251f096755523fb5eaafa95fb191556926 (diff)
Scripts/Misc: Migrate Operation Gnomeregan & Zalazane's Fall scripts to own files (#27163)
(cherry picked from commit d42c89aa04e58f74069ac1fdda94d7fbba1a7a52)
Diffstat (limited to 'src/server/scripts/Kalimdor')
-rw-r--r--src/server/scripts/Kalimdor/zone_durotar.cpp47
1 files changed, 18 insertions, 29 deletions
diff --git a/src/server/scripts/Kalimdor/zone_durotar.cpp b/src/server/scripts/Kalimdor/zone_durotar.cpp
index 9b4e1e43687..53125ed1a27 100644
--- a/src/server/scripts/Kalimdor/zone_durotar.cpp
+++ b/src/server/scripts/Kalimdor/zone_durotar.cpp
@@ -15,11 +15,11 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptMgr.h"
#include "CreatureAIImpl.h"
#include "GameObject.h"
#include "MotionMaster.h"
#include "Player.h"
+#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "SpellInfo.h"
#include "SpellScript.h"
@@ -125,41 +125,30 @@ enum VoodooSpells
};
// 17009 - Voodoo
-class spell_voodoo : public SpellScriptLoader
+class spell_voodoo : public SpellScript
{
- public:
- spell_voodoo() : SpellScriptLoader("spell_voodoo") { }
-
- class spell_voodoo_SpellScript : public SpellScript
- {
- PrepareSpellScript(spell_voodoo_SpellScript);
-
- bool Validate(SpellInfo const* /*spellInfo*/) override
- {
- return ValidateSpellInfo({ SPELL_BREW, SPELL_GHOSTLY, SPELL_HEX1, SPELL_HEX2, SPELL_HEX3, SPELL_GROW, SPELL_LAUNCH });
- }
+ PrepareSpellScript(spell_voodoo);
- void HandleDummy(SpellEffIndex /*effIndex*/)
- {
- uint32 spellid = RAND(SPELL_BREW, SPELL_GHOSTLY, RAND(SPELL_HEX1, SPELL_HEX2, SPELL_HEX3), SPELL_GROW, SPELL_LAUNCH);
- if (Unit* target = GetHitUnit())
- GetCaster()->CastSpell(target, spellid, false);
- }
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ return ValidateSpellInfo({ SPELL_BREW, SPELL_GHOSTLY, SPELL_HEX1, SPELL_HEX2, SPELL_HEX3, SPELL_GROW, SPELL_LAUNCH });
+ }
- void Register() override
- {
- OnEffectHitTarget += SpellEffectFn(spell_voodoo_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
- }
- };
+ void HandleDummy(SpellEffIndex /*effIndex*/)
+ {
+ uint32 spellid = RAND(SPELL_BREW, SPELL_GHOSTLY, RAND(SPELL_HEX1, SPELL_HEX2, SPELL_HEX3), SPELL_GROW, SPELL_LAUNCH);
+ if (Unit* target = GetHitUnit())
+ GetCaster()->CastSpell(target, spellid, false);
+ }
- SpellScript* GetSpellScript() const override
- {
- return new spell_voodoo_SpellScript();
- }
+ void Register() override
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_voodoo::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ }
};
void AddSC_durotar()
{
new npc_lazy_peon();
- new spell_voodoo();
+ RegisterSpellScript(spell_voodoo);
}