aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAqua Deus <95978183+aquadeus@users.noreply.github.com>2023-01-02 21:47:54 +0100
committerGitHub <noreply@github.com>2023-01-02 21:47:54 +0100
commitb428f600b1e5cfd71e661f924a30d59f3970800d (patch)
tree6b819b09ccf3c6bd0d0f71bb89a6aa5c118cee67 /src
parent2eea58f26e8fe88f3294dca3d4a38d6a20d68e07 (diff)
Scripts/Evoker: Implement Glide (#28654)
Diffstat (limited to 'src')
-rw-r--r--src/server/scripts/Spells/spell_evoker.cpp79
-rw-r--r--src/server/scripts/Spells/spell_script_loader.cpp2
2 files changed, 81 insertions, 0 deletions
diff --git a/src/server/scripts/Spells/spell_evoker.cpp b/src/server/scripts/Spells/spell_evoker.cpp
new file mode 100644
index 00000000000..261f6671b0c
--- /dev/null
+++ b/src/server/scripts/Spells/spell_evoker.cpp
@@ -0,0 +1,79 @@
+/*
+ * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
+ *
+ * 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/>.
+ */
+
+/*
+ * Scripts for spells with SPELLFAMILY_EVOKER and SPELLFAMILY_GENERIC spells used by evoker players.
+ * Ordered alphabetically using scriptname.
+ * Scriptnames of files in this file should be prefixed with "spell_evo_".
+ */
+#include "Player.h"
+#include "ScriptMgr.h"
+#include "Spell.h"
+#include "SpellHistory.h"
+#include "SpellMgr.h"
+#include "SpellScript.h"
+
+enum EvokerSpells
+{
+ SPELL_EVOKER_GLIDE_KNOCKBACK = 358736,
+ SPELL_EVOKER_HOVER = 358267,
+ SPELL_EVOKER_SOAR_RACIAL = 369536
+};
+
+// 358733 - Glide (Racial)
+class spell_evo_glide : public SpellScript
+{
+ PrepareSpellScript(spell_evo_glide);
+
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ return ValidateSpellInfo({ SPELL_EVOKER_GLIDE_KNOCKBACK, SPELL_EVOKER_HOVER, SPELL_EVOKER_SOAR_RACIAL });
+ }
+
+ SpellCastResult CheckCast()
+ {
+ Unit* caster = GetCaster();
+
+ if (!caster->IsFalling())
+ return SPELL_FAILED_NOT_ON_GROUND;
+
+ return SPELL_CAST_OK;
+ }
+
+ void HandleCast()
+ {
+ Player* caster = GetCaster()->ToPlayer();
+ if (!caster)
+ return;
+
+ caster->CastSpell(caster, SPELL_EVOKER_GLIDE_KNOCKBACK, true);
+
+ caster->GetSpellHistory()->StartCooldown(sSpellMgr->AssertSpellInfo(SPELL_EVOKER_HOVER, GetCastDifficulty()), 0, nullptr, false, 250ms);
+ caster->GetSpellHistory()->StartCooldown(sSpellMgr->AssertSpellInfo(SPELL_EVOKER_SOAR_RACIAL, GetCastDifficulty()), 0, nullptr, false, 250ms);
+ }
+
+ void Register() override
+ {
+ OnCheckCast += SpellCheckCastFn(spell_evo_glide::CheckCast);
+ OnCast += SpellCastFn(spell_evo_glide::HandleCast);
+ }
+};
+
+void AddSC_evoker_spell_scripts()
+{
+ RegisterSpellScript(spell_evo_glide);
+}
diff --git a/src/server/scripts/Spells/spell_script_loader.cpp b/src/server/scripts/Spells/spell_script_loader.cpp
index c4c19b292ed..fa3d7c97bd3 100644
--- a/src/server/scripts/Spells/spell_script_loader.cpp
+++ b/src/server/scripts/Spells/spell_script_loader.cpp
@@ -19,6 +19,7 @@
void AddSC_deathknight_spell_scripts();
void AddSC_demon_hunter_spell_scripts();
void AddSC_druid_spell_scripts();
+void AddSC_evoker_spell_scripts();
void AddSC_generic_spell_scripts();
void AddSC_hunter_spell_scripts();
void AddSC_mage_spell_scripts();
@@ -39,6 +40,7 @@ void AddSpellsScripts()
AddSC_deathknight_spell_scripts();
AddSC_demon_hunter_spell_scripts();
AddSC_druid_spell_scripts();
+ AddSC_evoker_spell_scripts();
AddSC_generic_spell_scripts();
AddSC_hunter_spell_scripts();
AddSC_mage_spell_scripts();