[8649] Implement SPELL_AURA_MECHANIC_IMMUNITY_MASK (147) and related cleanups.

* Always use machanic masks in form (1 << (mech-1)), fix all cases.
* Imppement SPELL_AURA_MECHANIC_IMMUNITY_MASK (mostly boss/elite spells).

Note: db stored mechannic masks already stored in proper format so not affected.
This commit is contained in:
VladimirMangos 2009-10-15 20:44:30 +04:00
parent 369e50e068
commit a4d61a6988
11 changed files with 158 additions and 119 deletions

View file

@ -3309,23 +3309,33 @@ DiminishingGroup GetDiminishingReturnsGroupForSpell(SpellEntry const* spellproto
// Get by mechanic
uint32 mechanic = GetAllSpellMechanicMask(spellproto);
if (mechanic == MECHANIC_NONE) return DIMINISHING_NONE;
if (mechanic & ((1<<MECHANIC_STUN) |
(1<<MECHANIC_SHACKLE))) return triggered ? DIMINISHING_TRIGGER_STUN : DIMINISHING_CONTROL_STUN;
if (mechanic & (1<<MECHANIC_SLEEP)) return DIMINISHING_FREEZE_SLEEP;
if (mechanic & (1<<MECHANIC_POLYMORPH)) return DIMINISHING_POLYMORPH_GOUGE_SAP;
if (mechanic & (1<<MECHANIC_ROOT)) return triggered ? DIMINISHING_TRIGGER_ROOT : DIMINISHING_CONTROL_ROOT;
if (mechanic & ((1<<MECHANIC_FEAR) |
(1<<MECHANIC_TURN))) return DIMINISHING_FEAR_BLIND;
if (mechanic & (1<<MECHANIC_CHARM)) return DIMINISHING_CHARM;
if (mechanic & (1<<MECHANIC_SILENCE)) return DIMINISHING_SILENCE;
if (mechanic & (1<<MECHANIC_DISARM)) return DIMINISHING_DISARM;
if (mechanic & (1<<MECHANIC_FREEZE)) return DIMINISHING_FREEZE_SLEEP;
if (mechanic & ((1<<MECHANIC_KNOCKOUT) |
(1<<MECHANIC_SAPPED))) return DIMINISHING_POLYMORPH_GOUGE_SAP;
if (mechanic & (1<<MECHANIC_BANISH)) return DIMINISHING_BANISH;
if (mechanic & (1<<MECHANIC_HORROR)) return DIMINISHING_DEATHCOIL;
if (!mechanic)
return DIMINISHING_NONE;
if (mechanic & ((1<<(MECHANIC_STUN-1))|(1<<(MECHANIC_SHACKLE-1))))
return triggered ? DIMINISHING_TRIGGER_STUN : DIMINISHING_CONTROL_STUN;
if (mechanic & (1<<(MECHANIC_SLEEP-1)))
return DIMINISHING_FREEZE_SLEEP;
if (mechanic & (1<<(MECHANIC_POLYMORPH-1)))
return DIMINISHING_POLYMORPH_GOUGE_SAP;
if (mechanic & (1<<(MECHANIC_ROOT-1)))
return triggered ? DIMINISHING_TRIGGER_ROOT : DIMINISHING_CONTROL_ROOT;
if (mechanic & ((1<<(MECHANIC_FEAR-1))|(1<<(MECHANIC_TURN-1))))
return DIMINISHING_FEAR_BLIND;
if (mechanic & (1<<(MECHANIC_CHARM-1)))
return DIMINISHING_CHARM;
if (mechanic & (1<<(MECHANIC_SILENCE-1)))
return DIMINISHING_SILENCE;
if (mechanic & (1<<(MECHANIC_DISARM-1)))
return DIMINISHING_DISARM;
if (mechanic & (1<<(MECHANIC_FREEZE-1)))
return DIMINISHING_FREEZE_SLEEP;
if (mechanic & ((1<<(MECHANIC_KNOCKOUT-1))|(1<<(MECHANIC_SAPPED-1))))
return DIMINISHING_POLYMORPH_GOUGE_SAP;
if (mechanic & (1<<(MECHANIC_BANISH-1)))
return DIMINISHING_BANISH;
if (mechanic & (1<<(MECHANIC_HORROR-1)))
return DIMINISHING_DEATHCOIL;
return DIMINISHING_NONE;
}