Merge branch 'master' into Playerbot

This commit is contained in:
Yunfan Li
2025-03-29 17:25:52 +08:00
22 changed files with 219 additions and 36 deletions
+2 -2
View File
@@ -20474,10 +20474,10 @@ void Unit::PetSpellFail(SpellInfo const* spellInfo, Unit* target, uint32 result)
}
}
int32 Unit::CalculateAOEDamageReduction(int32 damage, uint32 schoolMask, Unit* caster) const
int32 Unit::CalculateAOEDamageReduction(int32 damage, uint32 schoolMask, bool npcCaster) const
{
damage = int32(float(damage) * GetTotalAuraMultiplierByMiscMask(SPELL_AURA_MOD_AOE_DAMAGE_AVOIDANCE, schoolMask));
if (caster && caster->IsCreature())
if (npcCaster)
damage = int32(float(damage) * GetTotalAuraMultiplierByMiscMask(SPELL_AURA_MOD_CREATURE_AOE_DAMAGE_AVOIDANCE, schoolMask));
return damage;
+1 -1
View File
@@ -1187,7 +1187,7 @@ public:
uint32 SpellDamageBonusTaken(Unit* caster, SpellInfo const* spellProto, uint32 pdamage, DamageEffectType damagetype, uint32 stack = 1);
// AOE damages
int32 CalculateAOEDamageReduction(int32 damage, uint32 schoolMask, Unit* caster) const;
int32 CalculateAOEDamageReduction(int32 damage, uint32 schoolMask, bool npcCaster) const;
// Armor reduction
static bool IsDamageReducedByArmor(SpellSchoolMask damageSchoolMask, SpellInfo const* spellInfo = nullptr, uint8 effIndex = MAX_SPELL_EFFECTS);
@@ -6692,9 +6692,17 @@ void AuraEffect::HandlePeriodicDamageAurasTick(Unit* target, Unit* caster) const
damage = Unit::SpellCriticalDamageBonus(caster, m_spellInfo, damage, target);
// Auras reducing damage from AOE spells
if (GetSpellInfo()->Effects[GetEffIndex()].IsAreaAuraEffect() || GetSpellInfo()->Effects[GetEffIndex()].IsTargetingArea() || GetSpellInfo()->Effects[GetEffIndex()].Effect == SPELL_EFFECT_PERSISTENT_AREA_AURA) // some persistent area auras have targets like A=53 B=28
if (!GetSpellInfo()->HasAttribute(SPELL_ATTR4_IGNORE_DAMAGE_TAKEN_MODIFIERS))
{
damage = target->CalculateAOEDamageReduction(damage, GetSpellInfo()->SchoolMask, caster);
if (GetSpellInfo()->Effects[GetEffIndex()].IsAreaAuraEffect() ||
GetSpellInfo()->Effects[GetEffIndex()].IsTargetingArea() ||
GetSpellInfo()->Effects[GetEffIndex()].Effect == SPELL_EFFECT_PERSISTENT_AREA_AURA || // some persistent area auras have targets like A=53 B=28
GetSpellInfo()->HasAttribute(SPELL_ATTR5_TREAT_AS_AREA_EFFECT) ||
GetSpellInfo()->HasAttribute(SPELL_ATTR7_TREAT_AS_NPC_AOE))
{
bool npcCaster = (caster && !caster->IsControlledByPlayer()) || GetSpellInfo()->HasAttribute(SPELL_ATTR7_TREAT_AS_NPC_AOE);
damage = target->CalculateAOEDamageReduction(damage, GetSpellInfo()->SchoolMask, npcCaster);
}
}
int32 dmg = damage;
+2 -1
View File
@@ -8352,7 +8352,8 @@ void Spell::DoAllEffectOnLaunchTarget(TargetInfo& targetInfo, float* multiplier)
// Xinef: Area Auras, AoE Targetting spells AND Chain Target spells (cleave etc.)
if (m_spellInfo->Effects[i].IsAreaAuraEffect() || m_spellInfo->Effects[i].IsTargetingArea() || (m_spellInfo->Effects[i].ChainTarget > 1 && m_spellInfo->DmgClass != SPELL_DAMAGE_CLASS_MAGIC))
{
m_damage = unit->CalculateAOEDamageReduction(m_damage, m_spellInfo->SchoolMask, m_caster);
bool npcCaster = (m_caster && !m_caster->IsControlledByPlayer()) || GetSpellInfo()->HasAttribute(SPELL_ATTR7_TREAT_AS_NPC_AOE);
m_damage = unit->CalculateAOEDamageReduction(m_damage, m_spellInfo->SchoolMask, npcCaster);
if (m_caster->IsPlayer())
{
uint32 targetAmount = m_UniqueTargetInfo.size();
@@ -4885,6 +4885,25 @@ void SpellMgr::LoadSpellInfoCorrections()
spellInfo->Effects[EFFECT_2].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_TARGET_ENEMY);
});
// Felmyst Strafe (Top)
ApplySpellFix({ 45585 }, [](SpellInfo* spellInfo)
{
spellInfo->MaxAffectedTargets = 3;
spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_70_YARDS);
});
// Felmyst Strafe (Middle, Bottom)
ApplySpellFix({ 45633, 45635 }, [](SpellInfo* spellInfo)
{
spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_70_YARDS);
});
// Encapsulate
ApplySpellFix({ 45662 }, [](SpellInfo* spellInfo)
{
spellInfo->AttributesEx7 |= SPELL_ATTR7_TREAT_AS_NPC_AOE;
});
for (uint32 i = 0; i < GetSpellInfoStoreSize(); ++i)
{
SpellInfo* spellInfo = mSpellInfoMap[i];