Core/Spells: Removed a faulty aura handler

Closes #17590
This commit is contained in:
Krudor
2016-10-15 16:17:55 +02:00
committed by Shauren
parent 26de86177e
commit ad16014c7d
6 changed files with 330 additions and 27 deletions

View File

@@ -0,0 +1,15 @@
DELETE FROM `spell_script_names` WHERE `spell_id` IN (28200,29602,45040,90900,99947,118089,127271,127272,127274,127278,144671,145738,187213);
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
(28200, 'spell_item_talisman_of_ascendance'),
(29602, 'spell_item_jom_gabbar'),
(45040, 'spell_item_battle_trance'),
(90900, 'spell_item_world_queller_focus'),
(99947, 'spell_gen_face_rage'),
(118089, 'spell_item_water_strider'),
(127271, 'spell_item_water_strider'),
(127272, 'spell_item_water_strider'),
(127274, 'spell_item_water_strider'),
(127278, 'spell_item_water_strider'),
(144671, 'spell_item_brutal_kinship'),
(145738, 'spell_item_brutal_kinship'),
(187213, 'spell_gen_impatient_mind');

View File

@@ -1248,28 +1248,6 @@ void AuraEffect::HandleProc(AuraApplication* aurApp, ProcEventInfo& eventInfo)
GetBase()->CallScriptAfterEffectProcHandlers(this, aurApp, eventInfo);
}
void AuraEffect::CleanupTriggeredSpells(Unit* target)
{
uint32 tSpellId = GetSpellEffectInfo()->TriggerSpell;
if (!tSpellId)
return;
SpellInfo const* tProto = sSpellMgr->GetSpellInfo(tSpellId);
if (!tProto)
return;
if (tProto->GetDuration() != -1)
return;
// needed for spell 43680, maybe others
/// @todo is there a spell flag, which can solve this in a more sophisticated way?
if (GetSpellEffectInfo()->ApplyAuraName == SPELL_AURA_PERIODIC_TRIGGER_SPELL &&
uint32(m_spellInfo->GetDuration()) == GetSpellEffectInfo()->ApplyAuraPeriod)
return;
target->RemoveAurasDueToSpell(tSpellId, GetCasterGUID());
}
void AuraEffect::HandleShapeshiftBoosts(Unit* target, bool apply) const
{
uint32 spellId = 0;

View File

@@ -94,8 +94,6 @@ class TC_GAME_API AuraEffect
void HandleProc(AuraApplication* aurApp, ProcEventInfo& eventInfo);
void CleanupTriggeredSpells(Unit* target);
// add/remove SPELL_AURA_MOD_SHAPESHIFT (36) linked auras
void HandleShapeshiftBoosts(Unit* target, bool apply) const;

View File

@@ -147,9 +147,6 @@ void AuraApplication::_HandleEffect(uint8 effIndex, bool apply)
ASSERT(_effectMask & (1<<effIndex));
_effectMask &= ~(1<<effIndex);
aurEff->HandleEffect(this, AURA_EFFECT_HANDLE_REAL, false);
// Remove all triggered by aura spells vs unlimited duration
aurEff->CleanupTriggeredSpells(GetTarget());
}
SetNeedClientUpdate();

View File

@@ -4386,6 +4386,80 @@ class spell_gen_azgalor_rain_of_fire_hellfire_citadel : public SpellScriptLoader
}
};
enum AuraProcRemoveSpells
{
SPELL_FACE_RAGE = 99947,
SPELL_IMPATIENT_MIND = 187213
};
// 99947 - Face Rage
class spell_gen_face_rage : public SpellScriptLoader
{
public:
spell_gen_face_rage() : SpellScriptLoader("spell_gen_face_rage") { }
class spell_gen_face_rage_AuraScript : public AuraScript
{
PrepareAuraScript(spell_gen_face_rage_AuraScript);
bool Validate(SpellInfo const* /*spell*/) override
{
if (!sSpellMgr->GetSpellInfo(SPELL_FACE_RAGE))
return false;
return true;
}
void OnRemove(AuraEffect const* /*effect*/, AuraEffectHandleModes /*mode*/)
{
GetTarget()->RemoveAurasDueToSpell(GetSpellInfo()->GetEffect(EFFECT_2)->TriggerSpell);
}
void Register() override
{
OnEffectRemove += AuraEffectRemoveFn(spell_gen_face_rage_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_MOD_STUN, AURA_EFFECT_HANDLE_REAL);
}
};
AuraScript* GetAuraScript() const override
{
return new spell_gen_face_rage_AuraScript();
}
};
// 187213 - Impatient Mind
class spell_gen_impatient_mind : public SpellScriptLoader
{
public:
spell_gen_impatient_mind() : SpellScriptLoader("spell_gen_impatient_mind") { }
class spell_gen_impatient_mind_AuraScript : public AuraScript
{
PrepareAuraScript(spell_gen_impatient_mind_AuraScript);
bool Validate(SpellInfo const* /*spell*/) override
{
if (!sSpellMgr->GetSpellInfo(SPELL_IMPATIENT_MIND))
return false;
return true;
}
void OnRemove(AuraEffect const* effect, AuraEffectHandleModes /*mode*/)
{
GetTarget()->RemoveAurasDueToSpell(effect->GetSpellEffectInfo()->TriggerSpell);
}
void Register() override
{
OnEffectRemove += AuraEffectRemoveFn(spell_gen_impatient_mind_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL);
}
};
AuraScript* GetAuraScript() const override
{
return new spell_gen_impatient_mind_AuraScript();
}
};
void AddSC_generic_spell_scripts()
{
new spell_gen_absorb0_hitlimit1();
@@ -4480,4 +4554,6 @@ void AddSC_generic_spell_scripts()
new spell_gen_anetheron_summon_towering_infernal();
new spell_gen_mark_of_kazrogal_hellfire();
new spell_gen_azgalor_rain_of_fire_hellfire_citadel();
new spell_gen_face_rage();
new spell_gen_impatient_mind();
}

View File

@@ -2802,6 +2802,240 @@ public:
}
};
enum AuraProcRemoveSpells
{
SPELL_TALISMAN_OF_ASCENDANCE = 28200,
SPELL_JOM_GABBAR = 29602,
SPELL_BATTLE_TRANCE = 45040,
SPELL_WORLD_QUELLER_FOCUS = 90900,
SPELL_AZURE_WATER_STRIDER = 118089,
SPELL_CRIMSON_WATER_STRIDER = 127271,
SPELL_ORANGE_WATER_STRIDER = 127272,
SPELL_JADE_WATER_STRIDER = 127274,
SPELL_GOLDEN_WATER_STRIDER = 127278,
SPELL_BRUTAL_KINSHIP_1 = 144671,
SPELL_BRUTAL_KINSHIP_2 = 145738
};
// 28200 - Ascendance
class spell_item_talisman_of_ascendance : public SpellScriptLoader
{
public:
spell_item_talisman_of_ascendance() : SpellScriptLoader("spell_item_talisman_of_ascendance") { }
class spell_item_talisman_of_ascendance_AuraScript : public AuraScript
{
PrepareAuraScript(spell_item_talisman_of_ascendance_AuraScript);
bool Validate(SpellInfo const* /*spell*/) override
{
if (!sSpellMgr->GetSpellInfo(SPELL_TALISMAN_OF_ASCENDANCE))
return false;
return true;
}
void OnRemove(AuraEffect const* effect, AuraEffectHandleModes /*mode*/)
{
GetTarget()->RemoveAurasDueToSpell(effect->GetSpellEffectInfo()->TriggerSpell);
}
void Register() override
{
OnEffectRemove += AuraEffectRemoveFn(spell_item_talisman_of_ascendance_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL);
}
};
AuraScript* GetAuraScript() const override
{
return new spell_item_talisman_of_ascendance_AuraScript();
}
};
// 29602 - Jom Gabbar
class spell_item_jom_gabbar : public SpellScriptLoader
{
public:
spell_item_jom_gabbar() : SpellScriptLoader("spell_item_jom_gabbar") { }
class spell_item_jom_gabbar_AuraScript : public AuraScript
{
PrepareAuraScript(spell_item_jom_gabbar_AuraScript);
bool Validate(SpellInfo const* /*spell*/) override
{
if (!sSpellMgr->GetSpellInfo(SPELL_JOM_GABBAR))
return false;
return true;
}
void OnRemove(AuraEffect const* effect, AuraEffectHandleModes /*mode*/)
{
GetTarget()->RemoveAurasDueToSpell(effect->GetSpellEffectInfo()->TriggerSpell);
}
void Register() override
{
OnEffectRemove += AuraEffectRemoveFn(spell_item_jom_gabbar_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL);
}
};
AuraScript* GetAuraScript() const override
{
return new spell_item_jom_gabbar_AuraScript();
}
};
// 45040 - Battle Trance
class spell_item_battle_trance : public SpellScriptLoader
{
public:
spell_item_battle_trance() : SpellScriptLoader("spell_item_battle_trance") { }
class spell_item_battle_trance_AuraScript : public AuraScript
{
PrepareAuraScript(spell_item_battle_trance_AuraScript);
bool Validate(SpellInfo const* /*spell*/) override
{
if (!sSpellMgr->GetSpellInfo(SPELL_BATTLE_TRANCE))
return false;
return true;
}
void OnRemove(AuraEffect const* effect, AuraEffectHandleModes /*mode*/)
{
GetTarget()->RemoveAurasDueToSpell(effect->GetSpellEffectInfo()->TriggerSpell);
}
void Register() override
{
OnEffectRemove += AuraEffectRemoveFn(spell_item_battle_trance_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL);
}
};
AuraScript* GetAuraScript() const override
{
return new spell_item_battle_trance_AuraScript();
}
};
// 90900 - World-Queller Focus
class spell_item_world_queller_focus : public SpellScriptLoader
{
public:
spell_item_world_queller_focus() : SpellScriptLoader("spell_item_world_queller_focus") { }
class spell_item_world_queller_focus_AuraScript : public AuraScript
{
PrepareAuraScript(spell_item_world_queller_focus_AuraScript);
bool Validate(SpellInfo const* /*spell*/) override
{
if (!sSpellMgr->GetSpellInfo(SPELL_WORLD_QUELLER_FOCUS))
return false;
return true;
}
void OnRemove(AuraEffect const* effect, AuraEffectHandleModes /*mode*/)
{
GetTarget()->RemoveAurasDueToSpell(effect->GetSpellEffectInfo()->TriggerSpell);
}
void Register() override
{
OnEffectRemove += AuraEffectRemoveFn(spell_item_world_queller_focus_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL);
}
};
AuraScript* GetAuraScript() const override
{
return new spell_item_world_queller_focus_AuraScript();
}
};
// 118089 - Azure Water Strider
// 127271 - Crimson Water Strider
// 127272 - Orange Water Strider
// 127274 - Jade Water Strider
// 127278 - Golden Water Strider
class spell_item_water_strider : public SpellScriptLoader
{
public:
spell_item_water_strider() : SpellScriptLoader("spell_item_water_strider") { }
class spell_item_water_strider_AuraScript : public AuraScript
{
PrepareAuraScript(spell_item_water_strider_AuraScript);
bool Validate(SpellInfo const* /*spell*/) override
{
if (!sSpellMgr->GetSpellInfo(SPELL_AZURE_WATER_STRIDER))
return false;
if (!sSpellMgr->GetSpellInfo(SPELL_CRIMSON_WATER_STRIDER))
return false;
if (!sSpellMgr->GetSpellInfo(SPELL_ORANGE_WATER_STRIDER))
return false;
if (!sSpellMgr->GetSpellInfo(SPELL_JADE_WATER_STRIDER))
return false;
if (!sSpellMgr->GetSpellInfo(SPELL_GOLDEN_WATER_STRIDER))
return false;
return true;
}
void OnRemove(AuraEffect const* /*effect*/, AuraEffectHandleModes /*mode*/)
{
GetTarget()->RemoveAurasDueToSpell(GetSpellInfo()->GetEffect(EFFECT_1)->TriggerSpell);
}
void Register() override
{
OnEffectRemove += AuraEffectRemoveFn(spell_item_water_strider_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_MOUNTED, AURA_EFFECT_HANDLE_REAL);
}
};
AuraScript* GetAuraScript() const override
{
return new spell_item_water_strider_AuraScript();
}
};
// 144671 - Brutal Kinship
// 145738 - Brutal Kinship
class spell_item_brutal_kinship : public SpellScriptLoader
{
public:
spell_item_brutal_kinship() : SpellScriptLoader("spell_item_brutal_kinship") { }
class spell_item_brutal_kinship_AuraScript : public AuraScript
{
PrepareAuraScript(spell_item_brutal_kinship_AuraScript);
bool Validate(SpellInfo const* /*spell*/) override
{
if (!sSpellMgr->GetSpellInfo(SPELL_BRUTAL_KINSHIP_1))
return false;
if (!sSpellMgr->GetSpellInfo(SPELL_BRUTAL_KINSHIP_2))
return false;
return true;
}
void OnRemove(AuraEffect const* effect, AuraEffectHandleModes /*mode*/)
{
GetTarget()->RemoveAurasDueToSpell(effect->GetSpellEffectInfo()->TriggerSpell);
}
void Register() override
{
OnEffectRemove += AuraEffectRemoveFn(spell_item_brutal_kinship_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL);
}
};
AuraScript* GetAuraScript() const override
{
return new spell_item_brutal_kinship_AuraScript();
}
};
void AddSC_item_spell_scripts()
{
// 23074 Arcanite Dragonling
@@ -2874,4 +3108,9 @@ void AddSC_item_spell_scripts()
new spell_item_toy_train_set_pulse();
new spell_item_artifical_stamina();
new spell_item_artifical_damage();
new spell_item_talisman_of_ascendance();
new spell_item_battle_trance();
new spell_item_world_queller_focus();
new spell_item_water_strider();
new spell_item_brutal_kinship();
}