aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/base/world_database.sql2
-rw-r--r--sql/updates/9144_world_spell_script_names.sql5
-rw-r--r--src/server/game/Spells/SpellEffects.cpp15
-rw-r--r--src/server/scripts/Spells/spell_paladin.cpp5
-rw-r--r--src/server/scripts/Spells/spell_warrior.cpp73
5 files changed, 78 insertions, 22 deletions
diff --git a/sql/base/world_database.sql b/sql/base/world_database.sql
index 713b7d98fb9..e9d3669e8af 100644
--- a/sql/base/world_database.sql
+++ b/sql/base/world_database.sql
@@ -14683,6 +14683,8 @@ LOCK TABLES `spell_script_names` WRITE;
/*!40000 ALTER TABLE `spell_script_names` DISABLE KEYS */;
INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
-- warrior
+( 12975,'spell_warr_last_stand'),
+( 21977,'spell_warr_warriors_wrath'),
-- paladin
( 20425, 'spell_pal_judgement_of_command'),
(-20473, 'spell_pal_holy_shock'),
diff --git a/sql/updates/9144_world_spell_script_names.sql b/sql/updates/9144_world_spell_script_names.sql
new file mode 100644
index 00000000000..ef3c4179713
--- /dev/null
+++ b/sql/updates/9144_world_spell_script_names.sql
@@ -0,0 +1,5 @@
+DELETE FROM `spell_script_names` WHERE `spell_id`=21977 AND `ScriptName`='spell_warr_warriors_wrath';
+DELETE FROM `spell_script_names` WHERE `spell_id`=12975 AND `ScriptName`='spell_warr_last_stand';
+INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
+(12975,'spell_warr_last_stand'),
+(21977,'spell_warr_warriors_wrath');
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
index 4dd3d267809..94340cdb3a8 100644
--- a/src/server/game/Spells/SpellEffects.cpp
+++ b/src/server/game/Spells/SpellEffects.cpp
@@ -1571,21 +1571,6 @@ void Spell::EffectDummy(uint32 i)
}
switch(m_spellInfo->Id)
{
- // Warrior's Wrath
- case 21977:
- {
- if (!unitTarget)
- return;
- m_caster->CastSpell(unitTarget, 21887, true);// spell mod
- return;
- }
- // Last Stand
- case 12975:
- {
- int32 healthModSpellBasePoints0 = int32(m_caster->GetMaxHealth()*0.3);
- m_caster->CastCustomSpell(m_caster, 12976, &healthModSpellBasePoints0, NULL, NULL, true, NULL);
- return;
- }
// Bloodthirst
case 23881:
{
diff --git a/src/server/scripts/Spells/spell_paladin.cpp b/src/server/scripts/Spells/spell_paladin.cpp
index 970923c6a37..0889106684b 100644
--- a/src/server/scripts/Spells/spell_paladin.cpp
+++ b/src/server/scripts/Spells/spell_paladin.cpp
@@ -37,7 +37,7 @@ enum PaladinSpells
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;
@@ -82,10 +82,11 @@ SpellScript * GetSpellScript_spell_pal_blessing_of_faith()
class spell_pal_holy_shock_SpellScript : public SpellScript
{
- bool Validate(SpellEntry const * spellEntry)
+ bool Validate(SpellEntry const *spellEntry)
{
if (!sSpellStore.LookupEntry(PALADIN_SPELL_HOLY_SHOCK_R1))
return false;
+
// can't use other spell than holy shock due to spell_ranks dependency
if (spellmgr.GetFirstSpellInChain(PALADIN_SPELL_HOLY_SHOCK_R1) != spellmgr.GetFirstSpellInChain(spellEntry->Id))
return false;
diff --git a/src/server/scripts/Spells/spell_warrior.cpp b/src/server/scripts/Spells/spell_warrior.cpp
index dbd7901dc09..7d674a9b7db 100644
--- a/src/server/scripts/Spells/spell_warrior.cpp
+++ b/src/server/scripts/Spells/spell_warrior.cpp
@@ -23,14 +23,77 @@
#include "ScriptPCH.h"
+enum WarriorSpells
+{
+ WARRIOR_SPELL_LAST_STAND_TRIGGERED = 12976,
+ WARRIOR_SPELL_WARRIORS_WRATH_TRIGGERED = 21887,
+};
+
+class spell_warr_last_stand_SpellScript : public SpellScript
+{
+ bool Validate(SpellEntry const *spellEntry)
+ {
+ if (!sSpellStore.LookupEntry(WARRIOR_SPELL_LAST_STAND_TRIGGERED))
+ return false;
+ return true;
+ }
+
+ void HandleDummy(SpellEffIndex effIndex)
+ {
+ int32 healthModSpellBasePoints0 = int32(GetCaster()->GetMaxHealth() * 0.3);
+ GetCaster()->CastCustomSpell(GetCaster(), WARRIOR_SPELL_LAST_STAND_TRIGGERED, &healthModSpellBasePoints0, NULL, NULL, true, NULL);
+ }
+
+ void Register()
+ {
+ // add dummy effect spell handler to Last Stand
+ EffectHandlers += EffectHandlerFn(spell_warr_last_stand_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ }
+};
+
+SpellScript * GetSpellScript_spell_warr_last_stand()
+{
+ return new spell_warr_last_stand_SpellScript();
+}
+
+class spell_warr_warriors_wrath_SpellScript : public SpellScript
+{
+ bool Validate(SpellEntry const *spellEntry)
+ {
+ if (!sSpellStore.LookupEntry(WARRIOR_SPELL_WARRIORS_WRATH_TRIGGERED))
+ return false;
+ return true;
+ }
+
+ void HandleDummy(SpellEffIndex effIndex)
+ {
+ if (Unit *unitTarget = GetHitUnit())
+ GetCaster()->CastSpell(unitTarget, WARRIOR_SPELL_WARRIORS_WRATH_TRIGGERED, true);
+ }
+
+ void Register()
+ {
+ // add dummy effect spell handler to Warrior's Wrath
+ EffectHandlers += EffectHandlerFn(spell_warr_warriors_wrath_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ }
+};
+
+SpellScript * GetSpellScript_spell_warr_warriors_wrath()
+{
+ return new spell_warr_warriors_wrath_SpellScript();
+}
+
void AddSC_warrior_spell_scripts()
{
- //Script *newscript;
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name = "spell_warr_last_stand";
+ newscript->GetSpellScript = &GetSpellScript_spell_warr_last_stand;
+ newscript->RegisterSelf();
- /*
newscript = new Script;
- newscript->Name = "spell_warr_";
- newscript->GetSpellScript = &GetSpellScript_spell_warr_;
+ newscript->Name = "spell_warr_warriors_wrath";
+ newscript->GetSpellScript = &GetSpellScript_spell_warr_warriors_wrath;
newscript->RegisterSelf();
- */
} \ No newline at end of file