Skip to content

Instantly share code, notes, and snippets.

@SymbolixDEV
Created May 29, 2013 07:37
Show Gist options
  • Save SymbolixDEV/5668579 to your computer and use it in GitHub Desktop.
Save SymbolixDEV/5668579 to your computer and use it in GitHub Desktop.
Curse of doom
diff --git a/sql/updates/world/2012_06_14_09_world_spell_script_names.sql b/sql/updates/world/2012_06_14_09_world_spell_script_names.sql
new file mode 100644
index 0000000..f14e44e
--- /dev/null
+++ b/sql/updates/world/2012_06_14_09_world_spell_script_names.sql
@@ -0,0 +1,3 @@
+DELETE FROM `spell_script_names` WHERE `spell_id`=-603;
+INSERT INTO `spell_script_names` (`spell_id` ,`ScriptName`) VALUES
+(-603,'spell_warl_curse_of_doom');
diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp
index 9456a21..a1ac698 100755
--- a/src/server/game/Spells/Auras/SpellAuras.cpp
+++ b/src/server/game/Spells/Auras/SpellAuras.cpp
@@ -1373,17 +1373,8 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
case SPELLFAMILY_WARLOCK:
if (!caster)
break;
- // Curse of Doom
- if (GetSpellInfo()->SpellFamilyFlags[1] & 0x02)
- {
- if (removeMode == AURA_REMOVE_BY_DEATH)
- {
- if (caster->GetTypeId() == TYPEID_PLAYER && caster->ToPlayer()->isHonorOrXPTarget(target))
- caster->CastSpell(target, 18662, true, NULL, GetEffect(0));
- }
- }
// Improved Fear
- else if (GetSpellInfo()->SpellFamilyFlags[1] & 0x00000400)
+ if (GetSpellInfo()->SpellFamilyFlags[1] & 0x00000400)
{
if (AuraEffect* aurEff = caster->GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_WARLOCK, 98, 0))
{
diff --git a/src/server/scripts/Spells/spell_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp
index 1b24a9e..be10efc 100644
--- a/src/server/scripts/Spells/spell_warlock.cpp
+++ b/src/server/scripts/Spells/spell_warlock.cpp
@@ -39,6 +39,7 @@ enum WarlockSpells
WARLOCK_DEMONIC_CIRCLE_ALLOW_CAST = 62388,
WARLOCK_HAUNT_HEAL = 48210,
WARLOCK_UNSTABLE_AFFLICTION_DISPEL = 31117,
+ WARLOCK_CURSE_OF_DOOM_EFFECT = 18662,
};
class spell_warl_banish : public SpellScriptLoader
@@ -625,6 +626,52 @@ class spell_warl_unstable_affliction : public SpellScriptLoader
}
};
+class spell_warl_curse_of_doom : public SpellScriptLoader
+{
+ public:
+ spell_warl_curse_of_doom() : SpellScriptLoader("spell_warl_curse_of_doom") { }
+
+ class spell_warl_curse_of_doom_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_warl_curse_of_doom_AuraScript);
+
+ bool Validate(SpellInfo const* /*spell*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(WARLOCK_CURSE_OF_DOOM_EFFECT))
+ return false;
+ return true;
+ }
+
+ bool Load()
+ {
+ return GetCaster() && GetCaster()->GetTypeId() == TYPEID_PLAYER;
+ }
+
+ void OnRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
+ {
+ if (!GetCaster())
+ return;
+
+ AuraRemoveMode removeMode = GetTargetApplication()->GetRemoveMode();
+ if (removeMode != AURA_REMOVE_BY_DEATH || !IsExpired())
+ return;
+
+ if (GetCaster()->ToPlayer()->isHonorOrXPTarget(GetTarget()))
+ GetCaster()->CastSpell(GetTarget(), WARLOCK_CURSE_OF_DOOM_EFFECT, true, NULL, aurEff);
+ }
+
+ void Register()
+ {
+ AfterEffectRemove += AuraEffectRemoveFn(spell_warl_curse_of_doom_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE, AURA_EFFECT_HANDLE_REAL);
+ }
+ };
+
+ AuraScript* GetAuraScript() const
+ {
+ return new spell_warl_curse_of_doom_AuraScript();
+ }
+};
+
void AddSC_warlock_spell_scripts()
{
new spell_warl_banish();
@@ -639,4 +686,5 @@ void AddSC_warlock_spell_scripts()
new spell_warl_demonic_circle_teleport();
new spell_warl_haunt();
new spell_warl_unstable_affliction();
+ new spell_warl_curse_of_doom();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment