diff options
author | Shauren <shauren.trinity@gmail.com> | 2019-08-17 17:42:58 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2019-08-17 17:42:58 +0200 |
commit | 677663139cd130be502d5854d7ab7d1aebdf494c (patch) | |
tree | 7ec3583a03469e7ce08e99660daa451f6a917302 /src/server/game/Spells/SpellMgr.cpp | |
parent | ea16c4ac9fcbef26ce28865212af904e2a0f6db8 (diff) |
Core/Spells: Removed PROC_ATTR_DISABLE_EFF_* attributes and store that in a separate column
Diffstat (limited to 'src/server/game/Spells/SpellMgr.cpp')
-rw-r--r-- | src/server/game/Spells/SpellMgr.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 73105006fe5..0d1d18b66a0 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -1529,8 +1529,8 @@ void SpellMgr::LoadSpellProcs() // 0 1 2 3 4 5 QueryResult result = WorldDatabase.Query("SELECT SpellId, SchoolMask, SpellFamilyName, SpellFamilyMask0, SpellFamilyMask1, SpellFamilyMask2, " - // 6 7 8 9 10 11 12 13 14 - "ProcFlags, SpellTypeMask, SpellPhaseMask, HitMask, AttributesMask, ProcsPerMinute, Chance, Cooldown, Charges FROM spell_proc"); + // 6 7 8 9 10 11 12 13 14 15 + "ProcFlags, SpellTypeMask, SpellPhaseMask, HitMask, AttributesMask, DisableEffectsMask, ProcsPerMinute, Chance, Cooldown, Charges FROM spell_proc"); uint32 count = 0; if (result) @@ -1579,10 +1579,11 @@ void SpellMgr::LoadSpellProcs() baseProcEntry.SpellPhaseMask = fields[8].GetUInt32(); baseProcEntry.HitMask = fields[9].GetUInt32(); baseProcEntry.AttributesMask = fields[10].GetUInt32(); - baseProcEntry.ProcsPerMinute = fields[11].GetFloat(); - baseProcEntry.Chance = fields[12].GetFloat(); - baseProcEntry.Cooldown = Milliseconds(fields[13].GetUInt32()); - baseProcEntry.Charges = fields[14].GetUInt8(); + baseProcEntry.DisableEffectsMask = fields[11].GetUInt32(); + baseProcEntry.ProcsPerMinute = fields[12].GetFloat(); + baseProcEntry.Chance = fields[13].GetFloat(); + baseProcEntry.Cooldown = Milliseconds(fields[14].GetUInt32()); + baseProcEntry.Charges = fields[15].GetUInt8(); while (spellInfo) { @@ -1634,8 +1635,8 @@ void SpellMgr::LoadSpellProcs() if (procEntry.HitMask && !(procEntry.ProcFlags & TAKEN_HIT_PROC_FLAG_MASK || (procEntry.ProcFlags & DONE_HIT_PROC_FLAG_MASK && (!procEntry.SpellPhaseMask || procEntry.SpellPhaseMask & (PROC_SPELL_PHASE_HIT | PROC_SPELL_PHASE_FINISH))))) TC_LOG_ERROR("sql.sql", "The `spell_proc` table entry for spellId %u has `HitMask` value defined, but it will not be used for defined `ProcFlags` and `SpellPhaseMask` values.", spellInfo->Id); for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) - if ((procEntry.AttributesMask & (PROC_ATTR_DISABLE_EFF_0 << i)) && !spellInfo->Effects[i].IsAura()) - TC_LOG_ERROR("sql.sql", "The `spell_proc` table entry for spellId %u has Attribute PROC_ATTR_DISABLE_EFF_%u, but effect %u is not an aura effect", spellInfo->Id, static_cast<uint32>(i), static_cast<uint32>(i)); + if ((procEntry.DisableEffectsMask & (1u << i)) && !spellInfo->Effects[i].IsAura()) + TC_LOG_ERROR("sql.sql", "The `spell_proc` table entry for spellId %u has DisableEffectsMask with effect %u, but effect %u is not an aura effect", spellInfo->Id, static_cast<uint32>(i), static_cast<uint32>(i)); if (procEntry.AttributesMask & PROC_ATTR_REQ_SPELLMOD) { bool found = false; @@ -1866,12 +1867,11 @@ void SpellMgr::LoadSpellProcs() } procEntry.AttributesMask = 0; + procEntry.DisableEffectsMask = nonProcMask; if (spellInfo->ProcFlags & PROC_FLAG_KILL) procEntry.AttributesMask |= PROC_ATTR_REQ_EXP_OR_HONOR; if (addTriggerFlag) procEntry.AttributesMask |= PROC_ATTR_TRIGGERED_CAN_PROC; - if (nonProcMask) - procEntry.AttributesMask |= nonProcMask * PROC_ATTR_DISABLE_EFF_0; procEntry.ProcsPerMinute = 0; procEntry.Chance = spellInfo->ProcChance; |