More fixes

TGB, ^cast, group/ae checks, in group/raid checks, inviting others bots to group, group disband fix, prevent rogue bs spam, ^follow fixes and cleanup, follow owner only by default when joining raid/group, group buff fixes for bots, range fixes for group buffs
This commit is contained in:
nytmyr
2024-10-31 07:32:16 -05:00
parent 32e37660d8
commit 4aa7a18b4f
17 changed files with 1053 additions and 670 deletions
+73 -3
View File
@@ -2782,15 +2782,16 @@ int8 SpellEffectsCount(uint16 spell_id) {
if (!IsValidSpell(spell_id)) {
return false;
}
int8 i = 0;
int8 x = 0;
for (int i = 0; i < EFFECT_COUNT; i++) {
if (!IsBlankSpellEffect(spell_id, i)) {
++i;
++x;
}
}
return i;
return x;
}
bool IsLichSpell(uint16 spell_id)
@@ -3175,3 +3176,72 @@ bool RequiresStackCheck(uint16 spellType) {
return true;
}
bool IsResistanceOnlySpell(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
) {
continue;
}
return false;
}
return true;
}
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)) {
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
) {
continue;
}
return false;
}
return true;
}