mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-24 13:38:21 +00:00
CanUseBotSpell for ^cast
This commit is contained in:
@@ -2649,6 +2649,30 @@ bool Bot::HasBotSpellEntry(uint16 spell_id) {
|
|||||||
return false;
|
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) {
|
bool Bot::IsValidSpellRange(uint16 spell_id, Mob* tar) {
|
||||||
if (!IsValidSpell(spell_id) || !tar) {
|
if (!IsValidSpell(spell_id) || !tar) {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user