mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-13 10:58:20 +00:00
Remove Bot_AICheckCloseBeneficialSpells and use AttemptCloseBeneficialSpells for better performance
This commit is contained in:
@@ -633,6 +633,9 @@ bool Bot::AI_PursueCastCheck() {
|
||||
}
|
||||
|
||||
auto castOrder = GetSpellTypesPrioritized(BotPriorityCategories::Pursue);
|
||||
Mob* tar = nullptr;
|
||||
Raid* raid = GetRaid();
|
||||
std::vector<Mob*> v = GatherSpellTargets(RuleB(Bots, CrossRaidBuffingAndHealing));
|
||||
|
||||
for (auto& currentCast : castOrder) {
|
||||
if (currentCast.priority == 0) {
|
||||
@@ -650,6 +653,10 @@ bool Bot::AI_PursueCastCheck() {
|
||||
|
||||
result = AttemptAICastSpell(currentCast.spellType);
|
||||
|
||||
if (!result && IsBotSpellTypeBeneficial(currentCast.spellType)) {
|
||||
result = AttemptCloseBeneficialSpells(currentCast.spellType, raid, v);
|
||||
}
|
||||
|
||||
if (result) {
|
||||
break;
|
||||
}
|
||||
@@ -692,6 +699,9 @@ bool Bot::AI_IdleCastCheck() {
|
||||
}
|
||||
|
||||
auto castOrder = GetSpellTypesPrioritized(BotPriorityCategories::Idle);
|
||||
Mob* tar = nullptr;
|
||||
Raid* raid = GetRaid();
|
||||
std::vector<Mob*> v = GatherSpellTargets(RuleB(Bots, CrossRaidBuffingAndHealing));
|
||||
|
||||
for (auto& currentCast : castOrder) {
|
||||
if (currentCast.priority == 0) {
|
||||
@@ -711,11 +721,21 @@ bool Bot::AI_IdleCastCheck() {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!IsBotSpellTypeBeneficial(currentCast.spellType)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
result = AttemptAICastSpell(currentCast.spellType);
|
||||
|
||||
if (result) {
|
||||
break;
|
||||
}
|
||||
|
||||
result = AttemptCloseBeneficialSpells(currentCast.spellType, raid, v);
|
||||
|
||||
if (result) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!AIautocastspell_timer->Enabled()) {
|
||||
@@ -746,6 +766,9 @@ bool Bot::AI_EngagedCastCheck() {
|
||||
}
|
||||
|
||||
auto castOrder = GetSpellTypesPrioritized(BotPriorityCategories::Engaged);
|
||||
Mob* tar = nullptr;
|
||||
Raid* raid = GetRaid();
|
||||
std::vector<Mob*> v = GatherSpellTargets(RuleB(Bots, CrossRaidBuffingAndHealing));
|
||||
|
||||
for (auto& currentCast : castOrder) {
|
||||
if (currentCast.priority == 0) {
|
||||
@@ -763,6 +786,10 @@ bool Bot::AI_EngagedCastCheck() {
|
||||
|
||||
result = AttemptAICastSpell(currentCast.spellType);
|
||||
|
||||
if (!result && IsBotSpellTypeBeneficial(currentCast.spellType)) {
|
||||
result = AttemptCloseBeneficialSpells(currentCast.spellType, raid, v);
|
||||
}
|
||||
|
||||
if (result) {
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user