Correct pet buff type logic to catch DS/Resists with other spell effects in them

This commit is contained in:
nytmyr
2025-01-31 15:40:47 -06:00
parent c5aa1ea06f
commit e5bcb6acfc
4 changed files with 64 additions and 7 deletions
+57
View File
@@ -2824,6 +2824,34 @@ bool IsResurrectSpell(uint16 spell_id)
return IsEffectInSpell(spell_id, SE_Revive);
}
bool IsResistanceBuffSpell(uint16 spell_id) {
if (!IsValidSpell(spell_id)) {
return false;
}
const auto& spell = spells[spell_id];
for (int i = 0; i < EFFECT_COUNT; i++) {
if (IsBlankSpellEffect(spell_id, i)) {
continue;
}
if (
spell.effect_id[i] == SE_ResistFire ||
spell.effect_id[i] == SE_ResistCold ||
spell.effect_id[i] == SE_ResistPoison ||
spell.effect_id[i] == SE_ResistDisease ||
spell.effect_id[i] == SE_ResistMagic ||
spell.effect_id[i] == SE_ResistCorruption ||
spell.effect_id[i] == SE_ResistAll
) {
return true;
}
}
return false;
}
bool IsResistanceOnlySpell(uint16 spell_id) {
if (!IsValidSpell(spell_id)) {
return false;
@@ -2876,6 +2904,35 @@ bool IsDamageShieldOnlySpell(uint16 spell_id) {
return true;
}
bool IsDamageShieldAndResistSpell(uint16 spell_id) {
if (!IsValidSpell(spell_id)) {
return false;
}
const auto& spell = spells[spell_id];
for (int i = 0; i < EFFECT_COUNT; i++) {
if (IsBlankSpellEffect(spell_id, i)) {
continue;
}
if (
spell.effect_id[i] != SE_DamageShield &&
spell.effect_id[i] != SE_ResistFire &&
spell.effect_id[i] != SE_ResistCold &&
spell.effect_id[i] != SE_ResistPoison &&
spell.effect_id[i] != SE_ResistDisease &&
spell.effect_id[i] != SE_ResistMagic &&
spell.effect_id[i] != SE_ResistCorruption &&
spell.effect_id[i] != SE_ResistAll
) {
return false;
}
}
return true;
}
bool IsHateSpell(uint16 spell_id) {
if (!IsValidSpell(spell_id)) {
return false;
+2
View File
@@ -1908,8 +1908,10 @@ bool IsLichSpell(uint16 spell_id);
bool IsInstantHealSpell(uint32 spell_id);
bool IsResurrectSpell(uint16 spell_id);
bool RequiresStackCheck(uint16 spell_type);
bool IsResistanceBuffSpell(uint16 spell_id);
bool IsResistanceOnlySpell(uint16 spell_id);
bool IsDamageShieldOnlySpell(uint16 spell_id);
bool IsDamageShieldAndResistSpell(uint16 spell_id);
bool IsHateSpell(uint16 spell_id);
#endif