CanUseBotSpell for ^cast

This commit is contained in:
nytmyr
2024-12-12 08:01:26 -06:00
parent 4019e7da65
commit f67df44d99
+24
View File
@@ -2649,6 +2649,30 @@ bool Bot::HasBotSpellEntry(uint16 spell_id) {
return false;
}
bool Bot::CanUseBotSpell(uint16 spell_id) {
if (AIBot_spells.empty()) {
return false;
}
for (const auto& s : AIBot_spells) {
if (!IsValidSpell(s.spellid)) {
return false;
}
if (s.spellid != spell_id) {
continue;
}
if (s.minlevel > GetLevel()) {
return false;
}
return true;
}
return false;
}
bool Bot::IsValidSpellRange(uint16 spell_id, Mob* tar) {
if (!IsValidSpell(spell_id) || !tar) {
return false;