mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-29 21:32:52 +01:00
Core/Spells: Fix Curse of Doom (thx to Warpten / joschiwald for helping)
This commit is contained in:
@@ -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');
|
||||
@@ -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))
|
||||
{
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user