aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/base/world_database.sql2
-rw-r--r--sql/updates/9447_world_spell_script_names.sql3
-rw-r--r--src/server/scripts/Spells/spell_paladin.cpp224
-rw-r--r--src/server/scripts/Spells/spell_warlock.cpp36
4 files changed, 135 insertions, 130 deletions
diff --git a/sql/base/world_database.sql b/sql/base/world_database.sql
index d44b6641b06..eb34af2f546 100644
--- a/sql/base/world_database.sql
+++ b/sql/base/world_database.sql
@@ -14747,6 +14747,7 @@ INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
( 12975,'spell_warr_last_stand'),
-- paladin
( 20425, 'spell_pal_judgement_of_command'),
+( 63521, 'spell_pal_guarded_by_the_light'),
(-20473, 'spell_pal_holy_shock'),
( 37877, 'spell_pal_blessing_of_faith'),
-- hunter
@@ -14781,7 +14782,6 @@ INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
( -6201, 'spell_warl_create_healthstone'),
( 47193, 'spell_warl_demonic_empowerment'),
( 47422, 'spell_warl_everlasting_affliction'),
-( 63521, 'spell_warl_guarded_by_the_light'),
-- druid
( 54846, 'spell_dru_glyph_of_starfire');
/*!40000 ALTER TABLE `spell_script_names` ENABLE KEYS */;
diff --git a/sql/updates/9447_world_spell_script_names.sql b/sql/updates/9447_world_spell_script_names.sql
new file mode 100644
index 00000000000..da7930b61c3
--- /dev/null
+++ b/sql/updates/9447_world_spell_script_names.sql
@@ -0,0 +1,3 @@
+DELETE FROM `spell_script_names` WHERE `spell_id`=20425 AND `ScriptName`='spell_warl_judgement_of_command';
+DELETE FROM `spell_script_names` WHERE `spell_id`=20425 AND `ScriptName`='spell_pal_judgement_of_command';
+INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES (20425, 'spell_pal_judgement_of_command');
diff --git a/src/server/scripts/Spells/spell_paladin.cpp b/src/server/scripts/Spells/spell_paladin.cpp
index 53e85693526..1bac2afe0eb 100644
--- a/src/server/scripts/Spells/spell_paladin.cpp
+++ b/src/server/scripts/Spells/spell_paladin.cpp
@@ -22,9 +22,12 @@
*/
#include "ScriptPCH.h"
+#include "SpellAuraEffects.h"
enum PaladinSpells
{
+ PALADIN_SPELL_DIVINE_PLEA = 54428,
+
PALADIN_SPELL_HOLY_SHOCK_R1 = 20473,
PALADIN_SPELL_HOLY_SHOCK_R1_DAMAGE = 25912,
PALADIN_SPELL_HOLY_SHOCK_R1_HEALING = 25914,
@@ -37,138 +40,173 @@ enum PaladinSpells
class spell_pal_blessing_of_faith : public SpellHandlerScript
{
- public:
- spell_pal_blessing_of_faith() : SpellHandlerScript("spell_pal_blessing_of_faith") { }
+public:
+ spell_pal_blessing_of_faith() : SpellHandlerScript("spell_pal_blessing_of_faith") { }
- class spell_pal_blessing_of_faith_SpellScript : public SpellScript
+ class spell_pal_blessing_of_faith_SpellScript : public SpellScript
+ {
+ bool Validate(SpellEntry const *spellEntry)
{
- bool Validate(SpellEntry const *spellEntry)
- {
- if (!sSpellStore.LookupEntry(SPELL_BLESSING_OF_LOWER_CITY_DRUID))
- return false;
- if (!sSpellStore.LookupEntry(SPELL_BLESSING_OF_LOWER_CITY_PALADIN))
- return false;
- if (!sSpellStore.LookupEntry(SPELL_BLESSING_OF_LOWER_CITY_PRIEST))
- return false;
- if (!sSpellStore.LookupEntry(SPELL_BLESSING_OF_LOWER_CITY_SHAMAN))
- return false;
- return true;
- }
+ if (!sSpellStore.LookupEntry(SPELL_BLESSING_OF_LOWER_CITY_DRUID))
+ return false;
+ if (!sSpellStore.LookupEntry(SPELL_BLESSING_OF_LOWER_CITY_PALADIN))
+ return false;
+ if (!sSpellStore.LookupEntry(SPELL_BLESSING_OF_LOWER_CITY_PRIEST))
+ return false;
+ if (!sSpellStore.LookupEntry(SPELL_BLESSING_OF_LOWER_CITY_SHAMAN))
+ return false;
+ return true;
+ }
- void HandleDummy(SpellEffIndex effIndex)
+ void HandleDummy(SpellEffIndex effIndex)
+ {
+ if (Unit *unitTarget = GetHitUnit())
{
- if (Unit *unitTarget = GetHitUnit())
+ uint32 spell_id = 0;
+ switch(unitTarget->getClass())
{
- uint32 spell_id = 0;
- switch(unitTarget->getClass())
- {
- case CLASS_DRUID: spell_id = SPELL_BLESSING_OF_LOWER_CITY_DRUID; break;
- case CLASS_PALADIN: spell_id = SPELL_BLESSING_OF_LOWER_CITY_PALADIN; break;
- case CLASS_PRIEST: spell_id = SPELL_BLESSING_OF_LOWER_CITY_PRIEST; break;
- case CLASS_SHAMAN: spell_id = SPELL_BLESSING_OF_LOWER_CITY_SHAMAN; break;
- default: return; // ignore for non-healing classes
- }
-
- GetCaster()->CastSpell(GetCaster(), spell_id, true);
+ case CLASS_DRUID: spell_id = SPELL_BLESSING_OF_LOWER_CITY_DRUID; break;
+ case CLASS_PALADIN: spell_id = SPELL_BLESSING_OF_LOWER_CITY_PALADIN; break;
+ case CLASS_PRIEST: spell_id = SPELL_BLESSING_OF_LOWER_CITY_PRIEST; break;
+ case CLASS_SHAMAN: spell_id = SPELL_BLESSING_OF_LOWER_CITY_SHAMAN; break;
+ default: return; // ignore for non-healing classes
}
- }
- void Register()
- {
- // add dummy effect spell handler to Blessing of Faith
- EffectHandlers += EffectHandlerFn(spell_pal_blessing_of_faith_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ GetCaster()->CastSpell(GetCaster(), spell_id, true);
}
- };
+ }
- SpellScript *GetSpellScript() const
+ void Register()
{
- return new spell_pal_blessing_of_faith_SpellScript();
+ // add dummy effect spell handler to Blessing of Faith
+ EffectHandlers += EffectHandlerFn(spell_pal_blessing_of_faith_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
+ };
+
+ SpellScript *GetSpellScript() const
+ {
+ return new spell_pal_blessing_of_faith_SpellScript();
+ }
};
-class spell_pal_holy_shock : public SpellHandlerScript
+// 63521 Guarded by The Light
+class spell_pal_guarded_by_the_light : public SpellHandlerScript
{
- public:
- spell_pal_holy_shock() : SpellHandlerScript("spell_pal_holy_shock") { }
+public:
+ spell_pal_guarded_by_the_light() : SpellHandlerScript("spell_pal_guarded_by_the_light") { }
- class spell_pal_holy_shock_SpellScript : public SpellScript
+ class spell_pal_guarded_by_the_light_SpellScript : public SpellScript
+ {
+ bool Validate(SpellEntry const * spellEntry)
{
- bool Validate(SpellEntry const *spellEntry)
- {
- if (!sSpellStore.LookupEntry(PALADIN_SPELL_HOLY_SHOCK_R1))
- return false;
+ if (!sSpellStore.LookupEntry(PALADIN_SPELL_DIVINE_PLEA))
+ return false;
+ return true;
+ }
- // can't use other spell than holy shock due to spell_ranks dependency
- if (sSpellMgr.GetFirstSpellInChain(PALADIN_SPELL_HOLY_SHOCK_R1) != sSpellMgr.GetFirstSpellInChain(spellEntry->Id))
- return false;
+ void HandleScriptEffect(SpellEffIndex effIndex)
+ {
+ // Divine Plea
+ if (Aura* aura = GetCaster()->GetAura(PALADIN_SPELL_DIVINE_PLEA))
+ aura->RefreshDuration();
+ }
- uint8 rank = sSpellMgr.GetSpellRank(spellEntry->Id);
- if (!sSpellMgr.GetSpellWithRank(PALADIN_SPELL_HOLY_SHOCK_R1_DAMAGE, rank, true))
- return false;
- if (!sSpellMgr.GetSpellWithRank(PALADIN_SPELL_HOLY_SHOCK_R1_HEALING, rank, true))
- return false;
+ void Register()
+ {
+ EffectHandlers += EffectHandlerFn(spell_pal_guarded_by_the_light_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
+ }
+ };
- return true;
- }
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_pal_guarded_by_the_light_SpellScript();
+ }
+};
- void HandleDummy(SpellEffIndex effIndex)
- {
- if (Unit *unitTarget = GetHitUnit())
- {
- Unit *caster = GetCaster();
+class spell_pal_holy_shock : public SpellHandlerScript
+{
+public:
+ spell_pal_holy_shock() : SpellHandlerScript("spell_pal_holy_shock") { }
- uint8 rank = sSpellMgr.GetSpellRank(GetSpellInfo()->Id);
+ class spell_pal_holy_shock_SpellScript : public SpellScript
+ {
+ bool Validate(SpellEntry const *spellEntry)
+ {
+ if (!sSpellStore.LookupEntry(PALADIN_SPELL_HOLY_SHOCK_R1))
+ return false;
- if (caster->IsFriendlyTo(unitTarget))
- caster->CastSpell(unitTarget, sSpellMgr.GetSpellWithRank(PALADIN_SPELL_HOLY_SHOCK_R1_HEALING, rank), true, 0);
- else
- caster->CastSpell(unitTarget, sSpellMgr.GetSpellWithRank(PALADIN_SPELL_HOLY_SHOCK_R1_DAMAGE, rank), true, 0);
- }
- }
+ // can't use other spell than holy shock due to spell_ranks dependency
+ if (sSpellMgr.GetFirstSpellInChain(PALADIN_SPELL_HOLY_SHOCK_R1) != sSpellMgr.GetFirstSpellInChain(spellEntry->Id))
+ return false;
- void Register()
+ uint8 rank = sSpellMgr.GetSpellRank(spellEntry->Id);
+ if (!sSpellMgr.GetSpellWithRank(PALADIN_SPELL_HOLY_SHOCK_R1_DAMAGE, rank, true))
+ return false;
+ if (!sSpellMgr.GetSpellWithRank(PALADIN_SPELL_HOLY_SHOCK_R1_HEALING, rank, true))
+ return false;
+
+ return true;
+ }
+
+ void HandleDummy(SpellEffIndex effIndex)
+ {
+ if (Unit *unitTarget = GetHitUnit())
{
- // add dummy effect spell handler to Holy Shock
- EffectHandlers += EffectHandlerFn(spell_pal_holy_shock_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ Unit *caster = GetCaster();
+
+ uint8 rank = sSpellMgr.GetSpellRank(GetSpellInfo()->Id);
+
+ if (caster->IsFriendlyTo(unitTarget))
+ caster->CastSpell(unitTarget, sSpellMgr.GetSpellWithRank(PALADIN_SPELL_HOLY_SHOCK_R1_HEALING, rank), true, 0);
+ else
+ caster->CastSpell(unitTarget, sSpellMgr.GetSpellWithRank(PALADIN_SPELL_HOLY_SHOCK_R1_DAMAGE, rank), true, 0);
}
- };
+ }
- SpellScript *GetSpellScript() const
+ void Register()
{
- return new spell_pal_holy_shock_SpellScript();
+ // add dummy effect spell handler to Holy Shock
+ EffectHandlers += EffectHandlerFn(spell_pal_holy_shock_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
+ };
+
+ SpellScript *GetSpellScript() const
+ {
+ return new spell_pal_holy_shock_SpellScript();
+ }
};
class spell_pal_judgement_of_command : public SpellHandlerScript
{
- public:
- spell_pal_judgement_of_command() : SpellHandlerScript("spell_pal_judgement_of_command") { }
+public:
+ spell_pal_judgement_of_command() : SpellHandlerScript("spell_pal_judgement_of_command") { }
- class spell_pal_judgement_of_command_SpellScript : public SpellScript
+ class spell_pal_judgement_of_command_SpellScript : public SpellScript
+ {
+ void HandleDummy(SpellEffIndex effIndex)
{
- void HandleDummy(SpellEffIndex effIndex)
- {
- if (Unit *unitTarget = GetHitUnit())
- if (SpellEntry const* spell_proto = sSpellStore.LookupEntry(GetEffectValue()))
- GetCaster()->CastSpell(unitTarget, spell_proto, true, NULL);
- }
-
- void Register()
- {
- // add dummy effect spell handler to Judgement of Command
- EffectHandlers += EffectHandlerFn(spell_pal_judgement_of_command_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
- }
- };
+ if (Unit *unitTarget = GetHitUnit())
+ if (SpellEntry const* spell_proto = sSpellStore.LookupEntry(GetEffectValue()))
+ GetCaster()->CastSpell(unitTarget, spell_proto, true, NULL);
+ }
- SpellScript *GetSpellScript() const
+ void Register()
{
- return new spell_pal_judgement_of_command_SpellScript();
+ // add dummy effect spell handler to Judgement of Command
+ EffectHandlers += EffectHandlerFn(spell_pal_judgement_of_command_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
+ };
+
+ SpellScript *GetSpellScript() const
+ {
+ return new spell_pal_judgement_of_command_SpellScript();
+ }
};
void AddSC_paladin_spell_scripts()
{
- new spell_pal_blessing_of_faith;
- new spell_pal_holy_shock;
- new spell_pal_judgement_of_command;
+ new spell_pal_blessing_of_faith();
+ new spell_pal_guarded_by_the_light();
+ new spell_pal_holy_shock();
+ new spell_pal_judgement_of_command();
}
diff --git a/src/server/scripts/Spells/spell_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp
index b330fd0daab..f13c35b3b54 100644
--- a/src/server/scripts/Spells/spell_warlock.cpp
+++ b/src/server/scripts/Spells/spell_warlock.cpp
@@ -27,7 +27,6 @@
enum WarlockSpells
{
- WARLOCK_DIVINE_PLEA = 54428,
WARLOCK_DEMONIC_EMPOWERMENT_SUCCUBUS = 54435,
WARLOCK_DEMONIC_EMPOWERMENT_VOIDWALKER = 54443,
WARLOCK_DEMONIC_EMPOWERMENT_FELGUARD = 54508,
@@ -134,40 +133,6 @@ public:
}
};
-// 63521 Guarded by The Light
-class spell_warl_guarded_by_the_light : public SpellHandlerScript
-{
-public:
- spell_warl_guarded_by_the_light() : SpellHandlerScript("spell_warl_guarded_by_the_light") { }
-
- class spell_warl_guarded_by_the_light_SpellScript : public SpellScript
- {
- bool Validate(SpellEntry const * spellEntry)
- {
- if (!sSpellStore.LookupEntry(WARLOCK_DIVINE_PLEA))
- return false;
- return true;
- }
-
- void HandleScriptEffect(SpellEffIndex effIndex)
- {
- // Divine Plea
- if (Aura* aura = GetCaster()->GetAura(WARLOCK_DIVINE_PLEA))
- aura->RefreshDuration();
- }
-
- void Register()
- {
- EffectHandlers += EffectHandlerFn(spell_warl_guarded_by_the_light_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
- }
- };
-
- SpellScript* GetSpellScript() const
- {
- return new spell_warl_guarded_by_the_light_SpellScript();
- }
-};
-
// 6201 Create Healthstone (and ranks)
class spell_warl_create_healthstone : public SpellHandlerScript
{
@@ -238,6 +203,5 @@ void AddSC_warlock_spell_scripts()
{
new spell_warl_demonic_empowerment();
new spell_warl_everlasting_affliction();
- new spell_warl_guarded_by_the_light();
new spell_warl_create_healthstone();
}