aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/updates/world/2013_07_22_01_world_spell_script_misc_434.sql7
-rw-r--r--src/server/game/Entities/Unit/Unit.cpp17
-rw-r--r--src/server/scripts/Spells/spell_warrior.cpp53
3 files changed, 60 insertions, 17 deletions
diff --git a/sql/updates/world/2013_07_22_01_world_spell_script_misc_434.sql b/sql/updates/world/2013_07_22_01_world_spell_script_misc_434.sql
new file mode 100644
index 00000000000..0d768c8163c
--- /dev/null
+++ b/sql/updates/world/2013_07_22_01_world_spell_script_misc_434.sql
@@ -0,0 +1,7 @@
+DELETE FROM `spell_script_names` WHERE `spell_id`=58387;
+INSERT INTO `spell_script_names`(`spell_id`, `ScriptName`) VALUES
+(58387,'spell_warr_glyph_of_sunder_armor');
+
+DELETE FROM `spell_proc_event` WHERE `entry`=58387;
+INSERT INTO `spell_proc_event` (`entry`, `SchoolMask`, `SpellFamilyName`, `SpellFamilyMask0`, `SpellFamilyMask1`, `SpellFamilyMask2`, `procFlags`, `procEx`, `ppmRate`, `CustomChance`, `Cooldown`) VALUES
+(58387, 0, 4, 16384, 64, 0, 16, 0, 0, 100, 0);
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index 4a4401d14be..f119be464dd 100644
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -5431,23 +5431,6 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
break;
}
}
- case SPELLFAMILY_WARRIOR:
- {
- // Glyph of Sunder Armor
- if (dummySpell->Id == 58387)
- {
- if (!victim || !victim->IsAlive() || !procSpell)
- return false;
-
- target = SelectNearbyTarget(victim);
- if (!target)
- return false;
-
- triggered_spell_id = 58567;
- break;
- }
- break;
- }
case SPELLFAMILY_WARLOCK:
{
// Seed of Corruption
diff --git a/src/server/scripts/Spells/spell_warrior.cpp b/src/server/scripts/Spells/spell_warrior.cpp
index ad287e04a6d..56da8ced4e1 100644
--- a/src/server/scripts/Spells/spell_warrior.cpp
+++ b/src/server/scripts/Spells/spell_warrior.cpp
@@ -49,6 +49,7 @@ enum WarriorSpells
SPELL_WARRIOR_SECOUND_WIND_TRIGGER_RANK_2 = 29842,
SPELL_WARRIOR_SHIELD_SLAM = 23922,
SPELL_WARRIOR_SLAM = 50782,
+ SPELL_WARRIOR_SUNDER_ARMOR = 58567,
SPELL_WARRIOR_SWEEPING_STRIKES_EXTRA_ATTACK = 26654,
SPELL_WARRIOR_TAUNT = 355,
SPELL_WARRIOR_UNRELENTING_ASSAULT_RANK_1 = 46859,
@@ -312,6 +313,57 @@ class spell_warr_execute : public SpellScriptLoader
}
};
+// 58387 - Glyph of Sunder Armor
+class spell_warr_glyph_of_sunder_armor : public SpellScriptLoader
+{
+ public:
+ spell_warr_glyph_of_sunder_armor() : SpellScriptLoader("spell_warr_glyph_of_sunder_armor") { }
+
+ class spell_warr_glyph_of_sunder_armor_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_warr_glyph_of_sunder_armor_AuraScript);
+
+ bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_WARRIOR_SUNDER_ARMOR))
+ return false;
+ return true;
+ }
+
+ bool Load() OVERRIDE
+ {
+ _target = NULL;
+ return true;
+ }
+
+ bool CheckProc(ProcEventInfo& eventInfo)
+ {
+ _target = GetTarget()->SelectNearbyTarget(eventInfo.GetProcTarget());
+ return _target;
+ }
+
+ void HandleEffectProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/)
+ {
+ PreventDefaultAction();
+ GetTarget()->CastSpell(_target, SPELL_WARRIOR_SUNDER_ARMOR, true, NULL, aurEff);
+ }
+
+ void Register() OVERRIDE
+ {
+ DoCheckProc += AuraCheckProcFn(spell_warr_glyph_of_sunder_armor_AuraScript::CheckProc);
+ OnEffectProc += AuraEffectProcFn(spell_warr_glyph_of_sunder_armor_AuraScript::HandleEffectProc, EFFECT_0, SPELL_AURA_DUMMY);
+ }
+
+ private:
+ Unit * _target;
+ };
+
+ AuraScript* GetAuraScript() const OVERRIDE
+ {
+ return new spell_warr_glyph_of_sunder_armor_AuraScript();
+ }
+};
+
// 59725 - Improved Spell Reflection
class spell_warr_improved_spell_reflection : public SpellScriptLoader
{
@@ -971,6 +1023,7 @@ void AddSC_warrior_spell_scripts()
new spell_warr_concussion_blow();
new spell_warr_deep_wounds();
new spell_warr_execute();
+ new spell_warr_glyph_of_sunder_armor();
new spell_warr_improved_spell_reflection();
new spell_warr_intimidating_shout();
new spell_warr_last_stand();