mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-31 13:16:39 +00:00
fix resistbuffs and damageshields spell type checks
This commit is contained in:
+2
-19
@@ -3214,14 +3214,6 @@ bool IsResistanceOnlySpell(uint16 spell_id) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool IsDamageShieldOnlySpell(uint16 spell_id) {
|
bool IsDamageShieldOnlySpell(uint16 spell_id) {
|
||||||
if (SpellEffectsCount(spell_id) == 1 && IsEffectInSpell(spell_id, SE_DamageShield)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool IsDamageShieldAndResistanceSpellOnly(uint16 spell_id) {
|
|
||||||
if (!IsValidSpell(spell_id)) {
|
if (!IsValidSpell(spell_id)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -3234,19 +3226,10 @@ bool IsDamageShieldAndResistanceSpellOnly(uint16 spell_id) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
spell.effect_id[i] == SE_DamageShield ||
|
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
|
|
||||||
) {
|
) {
|
||||||
continue;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -1726,6 +1726,5 @@ bool IsResurrectSpell(uint16 spell_id);
|
|||||||
bool RequiresStackCheck(uint16 spellType);
|
bool RequiresStackCheck(uint16 spellType);
|
||||||
bool IsResistanceOnlySpell(uint16 spell_id);
|
bool IsResistanceOnlySpell(uint16 spell_id);
|
||||||
bool IsDamageShieldOnlySpell(uint16 spell_id);
|
bool IsDamageShieldOnlySpell(uint16 spell_id);
|
||||||
bool IsDamageShieldAndResistanceSpellOnly(uint16 spell_id);
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+2
-2
@@ -10964,7 +10964,7 @@ bool Bot::IsValidSpellTypeBySpellID(uint16 spellType, uint16 spell_id) {
|
|||||||
switch (spellType) {
|
switch (spellType) {
|
||||||
case BotSpellTypes::Buff:
|
case BotSpellTypes::Buff:
|
||||||
case BotSpellTypes::PetBuffs:
|
case BotSpellTypes::PetBuffs:
|
||||||
if (IsResistanceOnlySpell(spell_id) || IsDamageShieldOnlySpell(spell_id) || IsDamageShieldAndResistanceSpellOnly(spell_id)) {
|
if (IsResistanceOnlySpell(spell_id) || IsDamageShieldOnlySpell(spell_id)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -10978,7 +10978,7 @@ bool Bot::IsValidSpellTypeBySpellID(uint16 spellType, uint16 spell_id) {
|
|||||||
return false;
|
return false;
|
||||||
case BotSpellTypes::DamageShields:
|
case BotSpellTypes::DamageShields:
|
||||||
case BotSpellTypes::PetDamageShields:
|
case BotSpellTypes::PetDamageShields:
|
||||||
if (IsDamageShieldOnlySpell(spell_id) || IsDamageShieldAndResistanceSpellOnly(spell_id)) {
|
if (IsDamageShieldOnlySpell(spell_id)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user