[Bots] Fix Bot Spell Type "In Combat Buffs" (#2711)

This commit is contained in:
Aeadoin
2023-01-07 19:04:29 -05:00
committed by GitHub
parent 9e5a530f0f
commit 5f244c2dd2
3 changed files with 188 additions and 124 deletions
+27 -3
View File
@@ -8602,16 +8602,16 @@ bool EntityList::Bot_AICheckCloseBeneficialSpells(Bot* caster, uint8 iChance, fl
}
}
if( iSpellTypes == SpellType_Buff) {
if (iSpellTypes == SpellType_Buff) {
uint8 chanceToCast = caster->IsEngaged() ? caster->GetChanceToCastBySpellType(SpellType_Buff) : 100;
if(botCasterClass == BARD) {
if (botCasterClass == BARD) {
if(caster->AICastSpell(caster, chanceToCast, SpellType_Buff))
return true;
else
return false;
}
if(caster->HasGroup()) {
if (caster->HasGroup()) {
Group *g = caster->GetGroup();
if(g) {
for(int i = 0; i < MAX_GROUP_MEMBERS; i++) {
@@ -8679,6 +8679,30 @@ bool EntityList::Bot_AICheckCloseBeneficialSpells(Bot* caster, uint8 iChance, fl
}
}
if (iSpellTypes == SpellType_InCombatBuff) {
if (botCasterClass == BARD) {
if (caster->AICastSpell(caster, iChance, SpellType_InCombatBuff)) {
return true;
}
else {
return false;
}
}
if (caster->HasGroup()) {
Group* g = caster->GetGroup();
if (g) {
for (int i = 0; i < MAX_GROUP_MEMBERS; i++) {
if (g->members[i]) {
if (caster->AICastSpell(g->members[i], iChance, SpellType_InCombatBuff) || caster->AICastSpell(g->members[i]->GetPet(), iChance, SpellType_InCombatBuff)) {
return true;
}
}
}
}
}
}
return false;
}