aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/Spells
diff options
context:
space:
mode:
authorNaios <naios-dev@live.de>2016-02-21 02:37:33 +0100
committerNaios <naios-dev@live.de>2016-02-21 15:36:41 +0100
commit5534915f743c707c07cb977bca67c2ff15487597 (patch)
tree18787b9191a3a5c47d9a1d3a9775d99ad4b612f2 /src/server/scripts/Spells
parent3829a73e141132674962e51afe2e02664c9a1871 (diff)
Core/Scripts: Split the huge scriptloader into smaller pieces
* Each subdirectory contains it's own translation unit now which is responsible for loading it's directory * Improves merging & decoupling between 3.3.5 <-> 6.x * Removes unused Battleground loader * Ref #15671
Diffstat (limited to 'src/server/scripts/Spells')
-rw-r--r--src/server/scripts/Spells/CMakeLists.txt30
-rw-r--r--src/server/scripts/Spells/spell_script_loader.cpp52
2 files changed, 52 insertions, 30 deletions
diff --git a/src/server/scripts/Spells/CMakeLists.txt b/src/server/scripts/Spells/CMakeLists.txt
deleted file mode 100644
index 7434d98cf49..00000000000
--- a/src/server/scripts/Spells/CMakeLists.txt
+++ /dev/null
@@ -1,30 +0,0 @@
-# Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
-#
-# This file is free software; as a special exception the author gives
-# unlimited permission to copy and/or distribute it, with or without
-# modifications, as long as this notice is preserved.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
-# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
-set(scripts_STAT_SRCS
- ${scripts_STAT_SRCS}
- Spells/spell_shaman.cpp
- Spells/spell_hunter.cpp
- Spells/spell_rogue.cpp
- Spells/spell_druid.cpp
- Spells/spell_dk.cpp
- Spells/spell_quest.cpp
- Spells/spell_warrior.cpp
- Spells/spell_generic.cpp
- Spells/spell_warlock.cpp
- Spells/spell_priest.cpp
- Spells/spell_mage.cpp
- Spells/spell_paladin.cpp
- Spells/spell_item.cpp
- Spells/spell_holiday.cpp
- Spells/spell_pet.cpp
-)
-
-message(" -> Prepared: Spells")
diff --git a/src/server/scripts/Spells/spell_script_loader.cpp b/src/server/scripts/Spells/spell_script_loader.cpp
new file mode 100644
index 00000000000..b2c8d6663fa
--- /dev/null
+++ b/src/server/scripts/Spells/spell_script_loader.cpp
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+// This is where scripts' loading functions should be declared:
+void AddSC_deathknight_spell_scripts();
+void AddSC_druid_spell_scripts();
+void AddSC_generic_spell_scripts();
+void AddSC_hunter_spell_scripts();
+void AddSC_mage_spell_scripts();
+void AddSC_paladin_spell_scripts();
+void AddSC_priest_spell_scripts();
+void AddSC_rogue_spell_scripts();
+void AddSC_shaman_spell_scripts();
+void AddSC_warlock_spell_scripts();
+void AddSC_warrior_spell_scripts();
+void AddSC_quest_spell_scripts();
+void AddSC_item_spell_scripts();
+void AddSC_holiday_spell_scripts();
+
+// The name of this function should match:
+// void Add${NameOfDirectory}Scripts()
+void AddSpellsScripts()
+{
+ AddSC_deathknight_spell_scripts();
+ AddSC_druid_spell_scripts();
+ AddSC_generic_spell_scripts();
+ AddSC_hunter_spell_scripts();
+ AddSC_mage_spell_scripts();
+ AddSC_paladin_spell_scripts();
+ AddSC_priest_spell_scripts();
+ AddSC_rogue_spell_scripts();
+ AddSC_shaman_spell_scripts();
+ AddSC_warlock_spell_scripts();
+ AddSC_warrior_spell_scripts();
+ AddSC_quest_spell_scripts();
+ AddSC_item_spell_scripts();
+ AddSC_holiday_spell_scripts();
+}