mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-11 15:58:36 +00:00
Add rules (Bots, AICastSpellTypeDelay, Bots, AICastSpellTypeHeldDelay) to prevent spamming of failed spell type AI casts
This commit is contained in:
@@ -663,6 +663,7 @@ bool Bot::AI_PursueCastCheck() {
|
||||
|
||||
for (auto& current_cast : cast_order) {
|
||||
if (current_cast.priority == 0) {
|
||||
SetSpellTypeAITimer(current_cast.spellType, RuleI(Bots, AICastSpellTypeHeldDelay));
|
||||
LogBotSpellChecksDetail("{} says, '[{}] is priority 0, skipping.'", GetCleanName(), GetSpellTypeNameByID(current_cast.spellType));
|
||||
continue;
|
||||
}
|
||||
@@ -679,12 +680,18 @@ bool Bot::AI_PursueCastCheck() {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!SpellTypeAIDelayCheck(current_cast.spellType)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
result = AttemptAICastSpell(current_cast.spellType, nullptr);
|
||||
|
||||
if (!result && IsBotSpellTypeBeneficial(current_cast.spellType)) {
|
||||
result = AttemptCloseBeneficialSpells(current_cast.spellType);
|
||||
}
|
||||
|
||||
SetSpellTypeAITimer(current_cast.spellType, RuleI(Bots, AICastSpellTypeDelay));
|
||||
|
||||
if (result) {
|
||||
break;
|
||||
}
|
||||
@@ -731,6 +738,7 @@ bool Bot::AI_IdleCastCheck() {
|
||||
|
||||
for (auto& current_cast : cast_order) {
|
||||
if (current_cast.priority == 0) {
|
||||
SetSpellTypeAITimer(current_cast.spellType, RuleI(Bots, AICastSpellTypeHeldDelay));
|
||||
LogBotSpellChecksDetail("{} says, '[{}] is priority 0, skipping.'", GetCleanName(), GetSpellTypeNameByID(current_cast.spellType));
|
||||
continue;
|
||||
}
|
||||
@@ -755,6 +763,10 @@ bool Bot::AI_IdleCastCheck() {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!SpellTypeAIDelayCheck(current_cast.spellType)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
result = AttemptAICastSpell(current_cast.spellType, nullptr);
|
||||
|
||||
if (result) {
|
||||
@@ -763,6 +775,8 @@ bool Bot::AI_IdleCastCheck() {
|
||||
|
||||
result = AttemptCloseBeneficialSpells(current_cast.spellType);
|
||||
|
||||
SetSpellTypeAITimer(current_cast.spellType, RuleI(Bots, AICastSpellTypeDelay));
|
||||
|
||||
if (result) {
|
||||
break;
|
||||
}
|
||||
@@ -799,6 +813,7 @@ bool Bot::AI_EngagedCastCheck() {
|
||||
|
||||
for (auto& current_cast : cast_order) {
|
||||
if (current_cast.priority == 0) {
|
||||
SetSpellTypeAITimer(current_cast.spellType, RuleI(Bots, AICastSpellTypeHeldDelay));
|
||||
LogBotSpellChecksDetail("{} says, '[{}] is priority 0, skipping.'", GetCleanName(), GetSpellTypeNameByID(current_cast.spellType));
|
||||
continue;
|
||||
}
|
||||
@@ -815,8 +830,14 @@ bool Bot::AI_EngagedCastCheck() {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!SpellTypeAIDelayCheck(current_cast.spellType)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
result = AttemptAICastSpell(current_cast.spellType, nullptr);
|
||||
|
||||
SetSpellTypeAITimer(current_cast.spellType, RuleI(Bots, AICastSpellTypeDelay));
|
||||
|
||||
if (!result && IsBotSpellTypeBeneficial(current_cast.spellType)) {
|
||||
result = AttemptCloseBeneficialSpells(current_cast.spellType);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user