diff options
-rw-r--r-- | sql/updates/world/master/2019_08_17_00_world.sql | 1 | ||||
-rw-r--r-- | src/server/game/Entities/Unit/Unit.cpp | 4 | ||||
-rw-r--r-- | src/server/game/Spells/Auras/SpellAuras.cpp | 10 | ||||
-rw-r--r-- | src/server/game/Spells/Auras/SpellAuras.h | 2 | ||||
-rw-r--r-- | src/server/game/Spells/SpellMgr.cpp | 14 | ||||
-rw-r--r-- | src/server/game/Spells/SpellMgr.h | 1 |
6 files changed, 18 insertions, 14 deletions
diff --git a/sql/updates/world/master/2019_08_17_00_world.sql b/sql/updates/world/master/2019_08_17_00_world.sql new file mode 100644 index 00000000000..0cee45faee3 --- /dev/null +++ b/sql/updates/world/master/2019_08_17_00_world.sql @@ -0,0 +1 @@ +ALTER TABLE `spell_proc` ADD `DisableEffectsMask` int(10) unsigned NOT NULL DEFAULT '0' AFTER `AttributesMask`; diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 53fa6416c32..7249fdecca6 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -10308,7 +10308,7 @@ void Unit::GetProcAurasTriggeredOnEvent(AuraApplicationProcContainer& aurasTrigg for (AuraApplication* aurApp : *procAuras) { ASSERT(aurApp->GetTarget() == this); - if (uint32 procEffectMask = aurApp->GetBase()->IsProcTriggeredOnEvent(aurApp, eventInfo, now)) + if (uint32 procEffectMask = aurApp->GetBase()->GetProcEffectMask(aurApp, eventInfo, now)) { aurApp->GetBase()->PrepareProcToTrigger(aurApp, eventInfo, now); aurasTriggeringProc.emplace_back(procEffectMask, aurApp); @@ -10320,7 +10320,7 @@ void Unit::GetProcAurasTriggeredOnEvent(AuraApplicationProcContainer& aurasTrigg { for (AuraApplicationMap::iterator itr = GetAppliedAuras().begin(); itr != GetAppliedAuras().end(); ++itr) { - if (uint32 procEffectMask = itr->second->GetBase()->IsProcTriggeredOnEvent(itr->second, eventInfo, now)) + if (uint32 procEffectMask = itr->second->GetBase()->GetProcEffectMask(itr->second, eventInfo, now)) { itr->second->GetBase()->PrepareProcToTrigger(itr->second, eventInfo, now); aurasTriggeringProc.emplace_back(procEffectMask, itr->second); diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp index bcf64d299cb..2d44d1f8259 100644 --- a/src/server/game/Spells/Auras/SpellAuras.cpp +++ b/src/server/game/Spells/Auras/SpellAuras.cpp @@ -1669,7 +1669,7 @@ void Aura::PrepareProcToTrigger(AuraApplication* aurApp, ProcEventInfo& eventInf SetLastProcSuccessTime(now); } -uint32 Aura::IsProcTriggeredOnEvent(AuraApplication* aurApp, ProcEventInfo& eventInfo, std::chrono::steady_clock::time_point now) const +uint32 Aura::GetProcEffectMask(AuraApplication* aurApp, ProcEventInfo& eventInfo, std::chrono::steady_clock::time_point now) const { SpellProcEntry const* procEntry = sSpellMgr->GetSpellProcEntry(GetId()); // only auras with spell proc entry can trigger proc @@ -1728,10 +1728,10 @@ uint32 Aura::IsProcTriggeredOnEvent(AuraApplication* aurApp, ProcEventInfo& even // At least one effect has to pass checks to proc aura uint32 procEffectMask = 0; - for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) - if (aurApp->HasEffect(i)) - if (GetEffect(i)->CheckEffectProc(aurApp, eventInfo)) - procEffectMask |= (1 << i); + for (uint32 i = 0; i < MAX_SPELL_EFFECTS; ++i) + if (procEffectMask & (1u << i)) + if ((procEntry->DisableEffectsMask & (1u << i)) || !GetEffect(i)->CheckEffectProc(aurApp, eventInfo)) + procEffectMask &= ~(1u << i); if (!procEffectMask) return 0; diff --git a/src/server/game/Spells/Auras/SpellAuras.h b/src/server/game/Spells/Auras/SpellAuras.h index 18e701eef0c..0be5e9d4afb 100644 --- a/src/server/game/Spells/Auras/SpellAuras.h +++ b/src/server/game/Spells/Auras/SpellAuras.h @@ -245,7 +245,7 @@ class TC_GAME_API Aura bool IsUsingCharges() const { return m_isUsingCharges; } void SetUsingCharges(bool val) { m_isUsingCharges = val; } void PrepareProcToTrigger(AuraApplication* aurApp, ProcEventInfo& eventInfo, std::chrono::steady_clock::time_point now); - uint32 IsProcTriggeredOnEvent(AuraApplication* aurApp, ProcEventInfo& eventInfo, std::chrono::steady_clock::time_point now) const; + uint32 GetProcEffectMask(AuraApplication* aurApp, ProcEventInfo& eventInfo, std::chrono::steady_clock::time_point now) const; float CalcProcChance(SpellProcEntry const& procEntry, ProcEventInfo& eventInfo) const; void TriggerProcOnEvent(uint32 procEffectMask, AuraApplication* aurApp, ProcEventInfo& eventInfo); float CalcPPMProcChance(Unit* actor) const; diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 3dccae606f4..190eee167dc 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -1279,8 +1279,8 @@ void SpellMgr::LoadSpellProcs() // 0 1 2 3 4 5 6 QueryResult result = WorldDatabase.Query("SELECT SpellId, SchoolMask, SpellFamilyName, SpellFamilyMask0, SpellFamilyMask1, SpellFamilyMask2, SpellFamilyMask3, " - // 7 8 9 10 11 12 13 14 15 - "ProcFlags, SpellTypeMask, SpellPhaseMask, HitMask, AttributesMask, ProcsPerMinute, Chance, Cooldown, Charges FROM spell_proc"); + // 7 8 9 10 11 12 13 14 15 16 + "ProcFlags, SpellTypeMask, SpellPhaseMask, HitMask, AttributesMask, DisableEffectsMask, ProcsPerMinute, Chance, Cooldown, Charges FROM spell_proc"); uint32 count = 0; if (result) @@ -1330,10 +1330,11 @@ void SpellMgr::LoadSpellProcs() baseProcEntry.SpellPhaseMask = fields[9].GetUInt32(); baseProcEntry.HitMask = fields[10].GetUInt32(); baseProcEntry.AttributesMask = fields[11].GetUInt32(); - baseProcEntry.ProcsPerMinute = fields[12].GetFloat(); - baseProcEntry.Chance = fields[13].GetFloat(); - baseProcEntry.Cooldown = Milliseconds(fields[14].GetUInt32()); - baseProcEntry.Charges = fields[15].GetUInt8(); + baseProcEntry.DisableEffectsMask = fields[12].GetUInt32(); + baseProcEntry.ProcsPerMinute = fields[13].GetFloat(); + baseProcEntry.Chance = fields[14].GetFloat(); + baseProcEntry.Cooldown = Milliseconds(fields[15].GetUInt32()); + baseProcEntry.Charges = fields[16].GetUInt8(); while (spellInfo) { @@ -1599,6 +1600,7 @@ void SpellMgr::LoadSpellProcs() } procEntry.AttributesMask = 0; + procEntry.DisableEffectsMask = 0; if (spellInfo->ProcFlags & PROC_FLAG_KILL) procEntry.AttributesMask |= PROC_ATTR_REQ_EXP_OR_HONOR; if (addTriggerFlag) diff --git a/src/server/game/Spells/SpellMgr.h b/src/server/game/Spells/SpellMgr.h index ac0788a4823..3d669486432 100644 --- a/src/server/game/Spells/SpellMgr.h +++ b/src/server/game/Spells/SpellMgr.h @@ -270,6 +270,7 @@ struct SpellProcEntry uint32 SpellPhaseMask; // if nonzero - bitmask for matching phase of a spellcast on which proc occurs, see enum ProcFlagsSpellPhase uint32 HitMask; // if nonzero - bitmask for matching proc condition based on hit result, see enum ProcFlagsHit uint32 AttributesMask; // bitmask, see ProcAttributes + uint32 DisableEffectsMask;// bitmask float ProcsPerMinute; // if nonzero - chance to proc is equal to value * aura caster's weapon speed / 60 float Chance; // if nonzero - owerwrite procChance field for given Spell.dbc entry, defines chance of proc to occur, not used if ProcsPerMinute set Milliseconds Cooldown; // if nonzero - cooldown in secs for aura proc, applied to aura |