Allow bots to bypass los checks for positioning if no detrimental types allowed

This commit is contained in:
nytmyr
2024-11-28 22:15:02 -06:00
parent d0033d4786
commit ceeb083864
3 changed files with 47 additions and 13 deletions
+39
View File
@@ -3309,3 +3309,42 @@ bool IsCommandedSpellType(uint16 spellType) {
return false;
}
bool BotSpellTypeRequiresLoS(uint16 spellType, uint8 cls) {
switch (spellType) {
case BotSpellTypes::Nuke:
case BotSpellTypes::Root:
case BotSpellTypes::Lifetap:
case BotSpellTypes::Snare:
case BotSpellTypes::DOT:
case BotSpellTypes::Dispel:
case BotSpellTypes::Mez:
//case BotSpellTypes::Charm: // commanded
case BotSpellTypes::Slow:
case BotSpellTypes::Debuff:
case BotSpellTypes::HateRedux:
//case BotSpellTypes::Fear: // commanded
case BotSpellTypes::Stun:
case BotSpellTypes::AENukes:
case BotSpellTypes::AERains:
case BotSpellTypes::AEMez:
case BotSpellTypes::AEStun:
case BotSpellTypes::AEDebuff:
case BotSpellTypes::AESlow:
case BotSpellTypes::AESnare:
//case BotSpellTypes::AEFear: // commanded
case BotSpellTypes::AEDispel:
case BotSpellTypes::AERoot:
case BotSpellTypes::AEDoT:
case BotSpellTypes::AELifetap:
case BotSpellTypes::PBAENuke:
// case BotSpellTypes::Lull: // commanded
case BotSpellTypes::HateLine:
case BotSpellTypes::AEHateLine:
return true;
default:
return false;
}
return false;
}
+1
View File
@@ -752,6 +752,7 @@ bool SpellTypeRequiresTarget(uint16 spellType, uint16 cls = 0);
bool SpellTypeRequiresCastChecks(uint16 spellType);
bool SpellTypeRequiresAEChecks(uint16 spellType);
bool IsCommandedSpellType(uint16 spellType);
bool BotSpellTypeRequiresLoS(uint16 spellType, uint8 cls);
// These should not be used to determine spell category..
// They are a graphical affects (effects?) index only
+7 -13
View File
@@ -11329,14 +11329,14 @@ bool Bot::RequiresLoSForPositioning() {
if (GetLevel() < GetStopMeleeLevel()) {
return true;
}
else if (GetClass() == Class::Bard) {
return false;
}
else if (GetClass() == Class::Cleric) { //TODO bot rewrite - add check to see if spell requires los
return false;
for (uint16 i = BotSpellTypes::START; i <= BotSpellTypes::END; ++i) {
if (BOT_SPELL_TYPES_DETRIMENTAL(i) && !GetSpellHold(i)) {
return true;
}
}
return true;
return false;
}
bool Bot::HasRequiredLoSForPositioning(Mob* tar) {
@@ -11344,13 +11344,7 @@ bool Bot::HasRequiredLoSForPositioning(Mob* tar) {
return true;
}
if (GetClass() == Class::Cleric) { //add check to see if spell requires los
return true;
}
else if (GetClass() == Class::Bard && GetLevel() >= GetStopMeleeLevel()) {
return true;
}
if (!DoLosChecks(this, tar)) {
if (RequiresLoSForPositioning() && !DoLosChecks(this, tar)) {
return false;
}