mirror of
https://github.com/mangosfour/server.git
synced 2025-12-30 01:37:03 +00:00
[11778] Implement removal of spells that don't have appropriate SpellAuraInterruptFlags using proc system
Signed-off-by: Laise <fenrisse@gmail.com>
This commit is contained in:
parent
e3e39b5607
commit
83079e0b81
4 changed files with 24 additions and 53 deletions
|
|
@ -39,7 +39,7 @@ pAuraProcHandler AuraProcHandler[TOTAL_AURAS]=
|
|||
&Unit::HandleDummyAuraProc, // 4 SPELL_AURA_DUMMY
|
||||
&Unit::HandleNULLProc, // 5 SPELL_AURA_MOD_CONFUSE
|
||||
&Unit::HandleNULLProc, // 6 SPELL_AURA_MOD_CHARM
|
||||
&Unit::HandleNULLProc, // 7 SPELL_AURA_MOD_FEAR
|
||||
&Unit::HandleRemoveByDamageChanceProc, // 7 SPELL_AURA_MOD_FEAR
|
||||
&Unit::HandleNULLProc, // 8 SPELL_AURA_PERIODIC_HEAL
|
||||
&Unit::HandleNULLProc, // 9 SPELL_AURA_MOD_ATTACKSPEED
|
||||
&Unit::HandleNULLProc, // 10 SPELL_AURA_MOD_THREAT
|
||||
|
|
@ -58,7 +58,7 @@ pAuraProcHandler AuraProcHandler[TOTAL_AURAS]=
|
|||
&Unit::HandleNULLProc, // 23 SPELL_AURA_PERIODIC_TRIGGER_SPELL
|
||||
&Unit::HandleNULLProc, // 24 SPELL_AURA_PERIODIC_ENERGIZE
|
||||
&Unit::HandleNULLProc, // 25 SPELL_AURA_MOD_PACIFY
|
||||
&Unit::HandleNULLProc, // 26 SPELL_AURA_MOD_ROOT
|
||||
&Unit::HandleRemoveByDamageChanceProc, // 26 SPELL_AURA_MOD_ROOT
|
||||
&Unit::HandleNULLProc, // 27 SPELL_AURA_MOD_SILENCE
|
||||
&Unit::HandleNULLProc, // 28 SPELL_AURA_REFLECT_SPELLS
|
||||
&Unit::HandleNULLProc, // 29 SPELL_AURA_MOD_STAT
|
||||
|
|
@ -92,7 +92,7 @@ pAuraProcHandler AuraProcHandler[TOTAL_AURAS]=
|
|||
&Unit::HandleSpellCritChanceAuraProc, // 57 SPELL_AURA_MOD_SPELL_CRIT_CHANCE
|
||||
&Unit::HandleNULLProc, // 58 SPELL_AURA_MOD_INCREASE_SWIM_SPEED
|
||||
&Unit::HandleNULLProc, // 59 SPELL_AURA_MOD_DAMAGE_DONE_CREATURE
|
||||
&Unit::HandleNULLProc, // 60 SPELL_AURA_MOD_PACIFY_SILENCE
|
||||
&Unit::HandleRemoveByDamageChanceProc, // 60 SPELL_AURA_MOD_PACIFY_SILENCE
|
||||
&Unit::HandleNULLProc, // 61 SPELL_AURA_MOD_SCALE
|
||||
&Unit::HandleNULLProc, // 62 SPELL_AURA_PERIODIC_HEALTH_FUNNEL
|
||||
&Unit::HandleNULLProc, // 63 unused (3.0.8a-3.2.2a) old SPELL_AURA_PERIODIC_MANA_FUNNEL
|
||||
|
|
@ -4059,3 +4059,19 @@ SpellAuraProcResult Unit::HandleModResistanceAuraProc(Unit* /*pVictim*/, uint32
|
|||
|
||||
return SPELL_AURA_PROC_OK;
|
||||
}
|
||||
|
||||
SpellAuraProcResult Unit::HandleRemoveByDamageChanceProc(Unit* pVictim, uint32 damage, Aura* triggeredByAura, SpellEntry const *procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown)
|
||||
{
|
||||
// The chance to dispel an aura depends on the damage taken with respect to the casters level.
|
||||
uint32 max_dmg = getLevel() > 8 ? 25 * getLevel() - 150 : 50;
|
||||
float chance = float(damage) / max_dmg * 100.0f;
|
||||
if (roll_chance_f(chance))
|
||||
{
|
||||
triggeredByAura->SetInUse(true);
|
||||
RemoveAurasByCasterSpell(triggeredByAura->GetId(), triggeredByAura->GetCasterGuid());
|
||||
triggeredByAura->SetInUse(false);
|
||||
return SPELL_AURA_PROC_OK;
|
||||
}
|
||||
|
||||
return SPELL_AURA_PROC_FAILED;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue