aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/updates/world/master/2017_11_18_02_world.sql8
-rw-r--r--src/server/scripts/Spells/spell_dh.cpp46
2 files changed, 53 insertions, 1 deletions
diff --git a/sql/updates/world/master/2017_11_18_02_world.sql b/sql/updates/world/master/2017_11_18_02_world.sql
new file mode 100644
index 00000000000..a08c3671b04
--- /dev/null
+++ b/sql/updates/world/master/2017_11_18_02_world.sql
@@ -0,0 +1,8 @@
+-- Proc Chaos Strike only by its two damage spells and only if they are critical hits
+DELETE FROM `spell_proc` WHERE `SpellId`= 197125;
+INSERT INTO `spell_proc` (`SpellId`, `SchoolMask`, `SpellFamilyName`, `SpellFamilyMask0`, `SpellFamilyMask1`, `SpellFamilyMask2`, `SpellFamilyMask3`, `ProcFlags`, `SpellPhaseMask`, `HitMask`, `AttributesMask`, `Chance`, `Cooldown`, `Charges`) VALUES
+(197125, 0x0, 107, 0x4000, 0x0, 0x0, 0x80000000, 0x0, 0x2, 0x2, 0x2, 0, 0, 0);
+
+DELETE FROM `spell_script_names` WHERE `spell_id`= 197125;
+INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
+(197125, 'spell_dh_chaos_strike');
diff --git a/src/server/scripts/Spells/spell_dh.cpp b/src/server/scripts/Spells/spell_dh.cpp
index 16060569313..163844630b5 100644
--- a/src/server/scripts/Spells/spell_dh.cpp
+++ b/src/server/scripts/Spells/spell_dh.cpp
@@ -16,11 +16,55 @@
*/
/*
- * Scripts for spells with SPELLFAMILY_DEMONHUNTER and SPELLFAMILY_GENERIC spells used by deathknight players.
+ * Scripts for spells with SPELLFAMILY_DEMONHUNTER and SPELLFAMILY_GENERIC spells used by demon hunter players.
* Ordered alphabetically using scriptname.
* Scriptnames of files in this file should be prefixed with "spell_dh_".
*/
+#include "ScriptMgr.h"
+#include "SpellAuraEffects.h"
+#include "SpellMgr.h"
+#include "SpellScript.h"
+
+enum DemonHunterSpells
+{
+ SPELL_CHAOS_STRIKE_ENERGIZE = 193840,
+};
+
+// 197125 - Chaos Strike
+class spell_dh_chaos_strike : public SpellScriptLoader
+{
+ public:
+ spell_dh_chaos_strike() : SpellScriptLoader("spell_dh_chaos_strike") { }
+
+ class spell_dh_chaos_strike_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_dh_chaos_strike_AuraScript);
+
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ return ValidateSpellInfo({ SPELL_CHAOS_STRIKE_ENERGIZE });
+ }
+
+ void HandleEffectProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/)
+ {
+ PreventDefaultAction();
+ GetTarget()->CastCustomSpell(SPELL_CHAOS_STRIKE_ENERGIZE, SPELLVALUE_BASE_POINT0, aurEff->GetAmount(), GetTarget(), true, nullptr, aurEff);
+ }
+
+ void Register() override
+ {
+ OnEffectProc += AuraEffectProcFn(spell_dh_chaos_strike_AuraScript::HandleEffectProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
+ }
+ };
+
+ AuraScript* GetAuraScript() const override
+ {
+ return new spell_dh_chaos_strike_AuraScript();
+ }
+};
+
void AddSC_demon_hunter_spell_scripts()
{
+ new spell_dh_chaos_strike();
}