aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/updates/world/2014_07_07_03_world_spell_misc.sql7
-rw-r--r--src/server/game/Entities/Unit/Unit.cpp25
-rw-r--r--src/server/scripts/Spells/spell_shaman.cpp38
3 files changed, 45 insertions, 25 deletions
diff --git a/sql/updates/world/2014_07_07_03_world_spell_misc.sql b/sql/updates/world/2014_07_07_03_world_spell_misc.sql
new file mode 100644
index 00000000000..8e200267797
--- /dev/null
+++ b/sql/updates/world/2014_07_07_03_world_spell_misc.sql
@@ -0,0 +1,7 @@
+DELETE FROM `spell_script_names` WHERE `spell_id`=70811;
+INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
+(70811,'spell_sha_item_t10_elemental_2p_bonus');
+
+DELETE FROM `spell_proc_event` WHERE `entry`=70811;
+INSERT INTO `spell_proc_event` (`entry`, `SchoolMask`, `SpellFamilyName`, `SpellFamilyMask0`, `SpellFamilyMask1`, `SpellFamilyMask2`, `procFlags`, `procEx`, `ppmRate`, `CustomChance`, `Cooldown`) VALUES
+(70811, 0, 11, 3, 0, 0, 0, 0, 0, 0, 0);
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index 72c1a071487..902d99d888b 100644
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -6889,31 +6889,6 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
}
break;
}
- // Item - Shaman T10 Elemental 2P Bonus
- case 70811:
- {
- // Lightning Bolt & Chain Lightning
- if (procSpell->SpellFamilyFlags[0] & 0x3)
- {
- if (ToPlayer()->HasSpellCooldown(16166))
- {
- uint32 newCooldownDelay = ToPlayer()->GetSpellCooldownDelay(16166);
- if (newCooldownDelay < 3)
- newCooldownDelay = 0;
- else
- newCooldownDelay -= 2;
- ToPlayer()->AddSpellCooldown(16166, 0, uint32(time(NULL) + newCooldownDelay));
-
- WorldPacket data(SMSG_MODIFY_COOLDOWN, 4+8+4);
- data << uint32(16166); // Spell ID
- data << uint64(GetGUID()); // Player GUID
- data << int32(-2000); // Cooldown mod in milliseconds
- ToPlayer()->GetSession()->SendPacket(&data);
- return true;
- }
- }
- return false;
- }
// Item - Shaman T10 Elemental 4P Bonus
case 70817:
{
diff --git a/src/server/scripts/Spells/spell_shaman.cpp b/src/server/scripts/Spells/spell_shaman.cpp
index 61ff79c505e..a1c2d0e1d1c 100644
--- a/src/server/scripts/Spells/spell_shaman.cpp
+++ b/src/server/scripts/Spells/spell_shaman.cpp
@@ -34,6 +34,7 @@ enum ShamanSpells
SPELL_SHAMAN_BIND_SIGHT = 6277,
SPELL_SHAMAN_CLEANSING_TOTEM_EFFECT = 52025,
SPELL_SHAMAN_EARTH_SHIELD_HEAL = 379,
+ SPELL_SHAMAN_ELEMENTAL_MASTERY = 16166,
SPELL_SHAMAN_EXHAUSTION = 57723,
SPELL_SHAMAN_FIRE_NOVA_R1 = 1535,
SPELL_SHAMAN_FIRE_NOVA_TRIGGERED_R1 = 8349,
@@ -767,6 +768,42 @@ class spell_sha_item_mana_surge : public SpellScriptLoader
}
};
+// 70811 - Item - Shaman T10 Elemental 2P Bonus
+class spell_sha_item_t10_elemental_2p_bonus : public SpellScriptLoader
+{
+ public:
+ spell_sha_item_t10_elemental_2p_bonus() : SpellScriptLoader("spell_sha_item_t10_elemental_2p_bonus") { }
+
+ class spell_sha_item_t10_elemental_2p_bonus_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_sha_item_t10_elemental_2p_bonus_AuraScript);
+
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_ELEMENTAL_MASTERY))
+ return false;
+ return true;
+ }
+
+ void HandleEffectProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/)
+ {
+ PreventDefaultAction();
+ if (Player* target = GetTarget()->ToPlayer())
+ target->ModifySpellCooldown(SPELL_SHAMAN_ELEMENTAL_MASTERY, -aurEff->GetAmount());
+ }
+
+ void Register() override
+ {
+ OnEffectProc += AuraEffectProcFn(spell_sha_item_t10_elemental_2p_bonus_AuraScript::HandleEffectProc, EFFECT_0, SPELL_AURA_DUMMY);
+ }
+ };
+
+ AuraScript* GetAuraScript() const override
+ {
+ return new spell_sha_item_t10_elemental_2p_bonus_AuraScript();
+ }
+};
+
// 60103 - Lava Lash
class spell_sha_lava_lash : public SpellScriptLoader
{
@@ -989,6 +1026,7 @@ void AddSC_shaman_spell_scripts()
new spell_sha_item_lightning_shield();
new spell_sha_item_lightning_shield_trigger();
new spell_sha_item_mana_surge();
+ new spell_sha_item_t10_elemental_2p_bonus();
new spell_sha_lava_lash();
new spell_sha_mana_spring_totem();
new spell_sha_mana_tide_totem();