mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-19 17:38:26 +00:00
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:
+73
-3
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user