diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/server/game/Spells/SpellEffects.cpp | 15 | ||||
| -rw-r--r-- | src/server/scripts/Spells/spell_paladin.cpp | 5 | ||||
| -rw-r--r-- | src/server/scripts/Spells/spell_warrior.cpp | 73 |
3 files changed, 71 insertions, 22 deletions
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 |
