Core/Spells: Corrected SPELL_ATTR8_MASTERY_AFFECTS_POINTS attribute implementation, it is no longer used to restrict if the spell should be cast or not (SpecializationSpells.db2 takes care of that)
Port From (https://github.com/TrinityCore/TrinityCore/commit/2a4c7c1e27ac5236874a8fd5315abee196ab4c9a)
This commit is contained in:
@@ -1885,7 +1885,7 @@ namespace Framework.Constants
|
||||
RaidMarker = 0x4000000, // 26 Probably Spell No Need Learn To Cast
|
||||
Unk27 = 0x8000000, // 27
|
||||
NotInBgOrArena = 0x10000000, // 28
|
||||
MasterySpecialization = 0x20000000, // 29
|
||||
MasteryAffectPoints = 0x20000000, // 29
|
||||
Unk30 = 0x40000000, // 30
|
||||
AttackIgnoreImmuneToPCFlag = 0x80000000 // 31
|
||||
}
|
||||
|
||||
@@ -2278,9 +2278,6 @@ namespace Game.Entities
|
||||
bool need_cast = (spellInfo.Stances == 0 || (form != 0 && Convert.ToBoolean(spellInfo.Stances & (1ul << ((int)form - 1)))) ||
|
||||
(form == 0 && spellInfo.HasAttribute(SpellAttr2.NotNeedShapeshift)));
|
||||
|
||||
if (spellInfo.HasAttribute(SpellAttr8.MasterySpecialization))
|
||||
need_cast &= IsCurrentSpecMasterySpell(spellInfo);
|
||||
|
||||
// Check EquippedItemClass
|
||||
// passive spells which apply aura and have an item requirement are to be added manually, instead of casted
|
||||
if (spellInfo.EquippedItemClass >= 0)
|
||||
@@ -2300,15 +2297,6 @@ namespace Game.Entities
|
||||
return need_cast && (spellInfo.CasterAuraState == 0 || HasAuraState(spellInfo.CasterAuraState));
|
||||
}
|
||||
|
||||
public bool IsCurrentSpecMasterySpell(SpellInfo spellInfo)
|
||||
{
|
||||
ChrSpecializationRecord chrSpec = CliDB.ChrSpecializationStorage.LookupByKey(GetPrimarySpecialization());
|
||||
if (chrSpec != null)
|
||||
return spellInfo.Id == chrSpec.MasterySpellID[0] || spellInfo.Id == chrSpec.MasterySpellID[1];
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public void AddStoredAuraTeleportLocation(uint spellId)
|
||||
{
|
||||
StoredAuraTeleportLocation storedLocation = new();
|
||||
|
||||
@@ -74,7 +74,7 @@ namespace Game.Spells
|
||||
// default amount calculation
|
||||
int amount = 0;
|
||||
|
||||
if (!m_spellInfo.HasAttribute(SpellAttr8.MasterySpecialization) || MathFunctions.fuzzyEq(GetSpellEffectInfo().BonusCoefficient, 0.0f))
|
||||
if (!m_spellInfo.HasAttribute(SpellAttr8.MasteryAffectPoints) || MathFunctions.fuzzyEq(GetSpellEffectInfo().BonusCoefficient, 0.0f))
|
||||
amount = GetSpellEffectInfo().CalcValue(caster, m_baseAmount, GetBase().GetOwner().ToUnit(), GetBase().GetCastItemId(), GetBase().GetCastItemLevel());
|
||||
else if (caster != null && caster.IsTypeId(TypeId.Player))
|
||||
amount = (int)(caster.ToPlayer().m_activePlayerData.Mastery * GetSpellEffectInfo().BonusCoefficient);
|
||||
@@ -774,10 +774,6 @@ namespace Game.Spells
|
||||
if (spellInfo == null || !(spellInfo.IsPassive() || spellInfo.HasAttribute(SpellAttr0.HiddenClientside)))
|
||||
continue;
|
||||
|
||||
// always valid?
|
||||
if (spellInfo.HasAttribute(SpellAttr8.MasterySpecialization) && !plrTarget.IsCurrentSpecMasterySpell(spellInfo))
|
||||
continue;
|
||||
|
||||
if (Convert.ToBoolean(spellInfo.Stances & (1ul << (GetMiscValue() - 1))))
|
||||
target.CastSpell(target, pair.Key, new CastSpellExtraArgs(this));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user