aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoroffl <11556157+offl@users.noreply.github.com>2021-04-12 16:03:13 +0300
committerGitHub <noreply@github.com>2021-04-12 15:03:13 +0200
commit5cddcc75f2107b6dd18b087f5993632a375aa202 (patch)
treebb5b7d87a431293636fe9ebf93c5364d25002224 /src
parentba7f11c5f68cff714aacc54f0afb86fd0fe78ba3 (diff)
Scripts/Zone: Update Feralas zone file (#26367)
Co-authored-by: offl <offl@users.noreply.github.com>
Diffstat (limited to 'src')
-rw-r--r--src/server/scripts/Kalimdor/zone_feralas.cpp67
1 files changed, 21 insertions, 46 deletions
diff --git a/src/server/scripts/Kalimdor/zone_feralas.cpp b/src/server/scripts/Kalimdor/zone_feralas.cpp
index 2754c3e1725..0776e2be9c0 100644
--- a/src/server/scripts/Kalimdor/zone_feralas.cpp
+++ b/src/server/scripts/Kalimdor/zone_feralas.cpp
@@ -15,64 +15,39 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-/* ScriptData
-SDName: Feralas
-SD%Complete: 100
-SDComment: Quest support: 2987
-SDCategory: Feralas
-EndScriptData */
-
-/* ContentData
-spell_gordunni_trap
-EndContentData */
-
#include "ScriptMgr.h"
#include "GameObject.h"
-#include "Player.h"
-#include "ScriptedEscortAI.h"
-#include "ScriptedGossip.h"
-#include "SpellInfo.h"
#include "SpellScript.h"
-#include "WorldSession.h"
-
-/*######
-## spell_gordunni_trap
-######*/
enum GordunniTrapSpells
{
SPELL_GORDUNNI_DIRT_MOUND_CHEST = 11756,
- SPELL_GORDUNNI_DIRT_MOUND_JUNK = 19394
+ SPELL_GORDUNNI_DIRT_MOUND_JUNK = 19394
};
-class spell_gordunni_trap : public SpellScriptLoader
+// 19395 - Gordunni Trap
+class spell_gordunni_trap : public SpellScript
{
- public:
- spell_gordunni_trap() : SpellScriptLoader("spell_gordunni_trap") { }
-
- class spell_gordunni_trap_SpellScript : public SpellScript
- {
- PrepareSpellScript(spell_gordunni_trap_SpellScript);
-
- void HandleDummy()
- {
- GameObject* caster = GetGObjCaster();
- caster->CastSpell(caster, urand(0, 1) ? SPELL_GORDUNNI_DIRT_MOUND_CHEST : SPELL_GORDUNNI_DIRT_MOUND_JUNK);
- }
-
- void Register() override
- {
- OnCast += SpellCastFn(spell_gordunni_trap_SpellScript::HandleDummy);
- }
- };
-
- SpellScript* GetSpellScript() const override
- {
- return new spell_gordunni_trap_SpellScript();
- }
+ PrepareSpellScript(spell_gordunni_trap);
+
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ return ValidateSpellInfo({ SPELL_GORDUNNI_DIRT_MOUND_CHEST, SPELL_GORDUNNI_DIRT_MOUND_JUNK });
+ }
+
+ void HandleDummy()
+ {
+ GameObject* caster = GetGObjCaster();
+ caster->CastSpell(caster, urand(0, 1) ? SPELL_GORDUNNI_DIRT_MOUND_CHEST : SPELL_GORDUNNI_DIRT_MOUND_JUNK);
+ }
+
+ void Register() override
+ {
+ OnCast += SpellCastFn(spell_gordunni_trap::HandleDummy);
+ }
};
void AddSC_feralas()
{
- new spell_gordunni_trap();
+ RegisterSpellScript(spell_gordunni_trap);
}