[Quest API] Add HasSpellEffect() to Perl/Lua (#3319)

* [Quest API] Add HasSpellEffect() to Perl/Lua

# Perl
- Add `$mob->HasSpellEffect(effect_id)`.

# Lua
- Add `mob:HasSpellEffect(effect_id)`.

# Notes
- Allows operators to see if a Mob has an effect ID from any of their buffs.

* Update mob.cpp
This commit is contained in:
Alex King
2023-04-29 21:09:00 -04:00
committed by GitHub
parent 7eff6ada87
commit 0e582eda82
4 changed files with 21 additions and 8 deletions
+8 -8
View File
@@ -6227,20 +6227,20 @@ FACTION_VALUE Mob::GetSpecialFactionCon(Mob* iOther) {
bool Mob::HasSpellEffect(int effect_id)
{
int i;
const auto buff_count = GetMaxTotalSlots();
for (int i = 0; i < buff_count; i++) {
const auto spell_id = buffs[i].spellid;
int buff_count = GetMaxTotalSlots();
for(i = 0; i < buff_count; i++)
{
if (!IsValidSpell(buffs[i].spellid)) {
if (!IsValidSpell(spell_id)) {
continue;
}
if (IsEffectInSpell(buffs[i].spellid, effect_id)) {
return(1);
if (IsEffectInSpell(spell_id, effect_id)) {
return true;
}
}
return(0);
return false;
}
int Mob::GetSpecialAbility(int ability)