mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-22 12:18:27 +00:00
Correct pet buff type logic to catch DS/Resists with other spell effects in them
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user