mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-15 10:00:28 +00:00
refactor(Core/Spells): Implement QAston Proc System (#11079)
* . * sql * . * . * 1 * 2 * 3 * 4 * 5 * 6 * 7 * 8 * 9 * 10 * 11 * 12 * 13 * 14 * 15 * Update spell_item.cpp * Update Unit.cpp * 16 * 17 * 18 * 19 * 20 * 21 * Update Unit.cpp * REVERT UltraNIX Commit * 22 * 23 * . * . * . * warrior * warlock * shaman rogue priest paladin mage * spell item * hunter * druid * dk * war * error style * Update rev_1647677899565690722.sql * Update rev_1647677899565690722.sql * Update rev_1647677899565690722.sql * . * DOND DEL ME WAD DO DO * error 2 * . * . * . * FIX * Update SpellInfoCorrections.cpp * Update SpellInfoCorrections.cpp * . * ja genau * Update .gitignore * . * . * ., * . * . * . * . * Update Unit.cpp
This commit is contained in:
committed by
GitHub
parent
5189b43a28
commit
cbd3fd0967
@@ -524,7 +524,7 @@ float SpellEffectInfo::CalcValueMultiplier(Unit* caster, Spell* spell) const
|
||||
{
|
||||
float multiplier = ValueMultiplier;
|
||||
if (Player* modOwner = (caster ? caster->GetSpellModOwner() : nullptr))
|
||||
modOwner->ApplySpellMod(_spellInfo->Id, SPELLMOD_VALUE_MULTIPLIER, multiplier, spell);
|
||||
modOwner->ApplySpellMod<SPELLMOD_VALUE_MULTIPLIER>(_spellInfo->Id, multiplier, spell);
|
||||
return multiplier;
|
||||
}
|
||||
|
||||
@@ -532,7 +532,7 @@ float SpellEffectInfo::CalcDamageMultiplier(Unit* caster, Spell* spell) const
|
||||
{
|
||||
float multiplier = DamageMultiplier;
|
||||
if (Player* modOwner = (caster ? caster->GetSpellModOwner() : nullptr))
|
||||
modOwner->ApplySpellMod(_spellInfo->Id, SPELLMOD_DAMAGE_MULTIPLIER, multiplier, spell);
|
||||
modOwner->ApplySpellMod<SPELLMOD_DAMAGE_MULTIPLIER>(_spellInfo->Id, multiplier, spell);
|
||||
return multiplier;
|
||||
}
|
||||
|
||||
@@ -552,7 +552,7 @@ float SpellEffectInfo::CalcRadius(Unit* caster, Spell* spell) const
|
||||
radius += RadiusEntry->RadiusPerLevel * caster->getLevel();
|
||||
radius = std::min(radius, RadiusEntry->RadiusMax);
|
||||
if (Player* modOwner = caster->GetSpellModOwner())
|
||||
modOwner->ApplySpellMod(_spellInfo->Id, SPELLMOD_RADIUS, radius, spell);
|
||||
modOwner->ApplySpellMod<SPELLMOD_RADIUS>(_spellInfo->Id, radius, spell);
|
||||
}
|
||||
|
||||
return radius;
|
||||
@@ -831,7 +831,7 @@ SpellInfo::SpellInfo(SpellEntry const* spellEntry)
|
||||
SpellVisual = spellEntry->SpellVisual;
|
||||
SpellIconID = spellEntry->SpellIconID;
|
||||
ActiveIconID = spellEntry->ActiveIconID;
|
||||
SpellPriority = spellEntry->SpellPriority;
|
||||
Priority = spellEntry->SpellPriority;
|
||||
SpellName = spellEntry->SpellName;
|
||||
Rank = spellEntry->Rank;
|
||||
MaxTargetLevel = spellEntry->MaxTargetLevel;
|
||||
@@ -1268,6 +1268,26 @@ bool SpellInfo::IsAutoRepeatRangedSpell() const
|
||||
return AttributesEx2 & SPELL_ATTR2_AUTO_REPEAT;
|
||||
}
|
||||
|
||||
bool SpellInfo::IsAffected(uint32 familyName, flag96 const& familyFlags) const
|
||||
{
|
||||
if (!familyName)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (familyName != SpellFamilyName)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (familyFlags && !(familyFlags & SpellFamilyFlags))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool SpellInfo::IsAffectedBySpellMods() const
|
||||
{
|
||||
return !(AttributesEx3 & SPELL_ATTR3_IGNORE_CASTER_MODIFIERS);
|
||||
@@ -1292,15 +1312,7 @@ bool SpellInfo::IsAffectedBySpellMod(SpellModifier const* mod) const
|
||||
return true;
|
||||
}
|
||||
|
||||
// False if affect_spell == nullptr or spellFamily not equal
|
||||
if (affectSpell->SpellFamilyName != SpellFamilyName)
|
||||
return false;
|
||||
|
||||
// true
|
||||
if (mod->mask & SpellFamilyFlags)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
return IsAffected(affectSpell->SpellFamilyName, mod->mask);
|
||||
}
|
||||
|
||||
bool SpellInfo::CanPierceImmuneAura(SpellInfo const* aura) const
|
||||
@@ -2311,7 +2323,7 @@ float SpellInfo::GetMaxRange(bool positive, Unit* caster, Spell* spell) const
|
||||
range = RangeEntry->RangeMax[0];
|
||||
if (caster)
|
||||
if (Player* modOwner = caster->GetSpellModOwner())
|
||||
modOwner->ApplySpellMod(Id, SPELLMOD_RANGE, range, spell);
|
||||
modOwner->ApplySpellMod<SPELLMOD_RANGE>(Id, range, spell);
|
||||
return range;
|
||||
}
|
||||
|
||||
@@ -2446,7 +2458,7 @@ int32 SpellInfo::CalcPowerCost(Unit const* caster, SpellSchoolMask schoolMask, S
|
||||
|
||||
// Apply cost mod by spell
|
||||
if (Player* modOwner = caster->GetSpellModOwner())
|
||||
modOwner->ApplySpellMod(Id, SPELLMOD_COST, powerCost, spell);
|
||||
modOwner->ApplySpellMod<SPELLMOD_COST>(Id, powerCost, spell);
|
||||
|
||||
if (!caster->IsControlledByPlayer())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user