[Spells] Update to IsCombatProc checks (#1741)

* Update spells.cpp

* Update spells.cpp

* Update spells.cpp

* Update spells.cpp
This commit is contained in:
KayenEQ 2021-11-13 14:47:42 -05:00 committed by GitHub
parent cef352f0ac
commit 776449aa3d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5669,21 +5669,36 @@ bool Mob::FindType(uint16 type, bool bOffensive, uint16 threshold) {
bool Mob::IsCombatProc(uint16 spell_id) {
if (RuleB(Spells, FocusCombatProcs))
if (RuleB(Spells, FocusCombatProcs)) {
return false;
}
if(spell_id == SPELL_UNKNOWN)
if (spell_id == SPELL_UNKNOWN) {
return(false);
}
if ((spells[spell_id].cast_time == 0) && (spells[spell_id].recast_time == 0) && (spells[spell_id].recovery_time == 0))
{
for (int i = 0; i < MAX_PROCS; i++){
if (PermaProcs[i].spellID == spell_id || SpellProcs[i].spellID == spell_id
|| RangedProcs[i].spellID == spell_id){
if (PermaProcs[i].spellID == spell_id ||
SpellProcs[i].spellID == spell_id ||
RangedProcs[i].spellID == spell_id ||
DefensiveProcs[i].spellID == spell_id){
return true;
}
}
if (IsClient()) {
for (int i = 0; i < MAX_AA_PROCS; i += 4) {
if (aabonuses.SpellProc[i + 1] == spell_id ||
aabonuses.RangedProc[i + 1] == spell_id ||
aabonuses.DefensiveProc[i + 1] == spell_id) {
return true;
}
}
}
}
return false;