rename BOT_SPELL_TYPE functions

This commit is contained in:
nytmyr
2024-12-01 23:33:21 -06:00
parent 3034bd5762
commit a22502a13d
7 changed files with 28 additions and 28 deletions
+5 -5
View File
@@ -2791,7 +2791,7 @@ bool IsLichSpell(uint16 spell_id)
return false; return false;
} }
bool BOT_SPELL_TYPES_DETRIMENTAL(uint16 spellType, uint8 cls) { bool IsBotSpellTypeDetrimental(uint16 spellType, uint8 cls) {
switch (spellType) { switch (spellType) {
case BotSpellTypes::Nuke: case BotSpellTypes::Nuke:
case BotSpellTypes::Root: case BotSpellTypes::Root:
@@ -2830,7 +2830,7 @@ bool BOT_SPELL_TYPES_DETRIMENTAL(uint16 spellType, uint8 cls) {
return false; return false;
} }
bool BOT_SPELL_TYPES_BENEFICIAL(uint16 spellType, uint8 cls) { bool IsBotSpellTypeBeneficial(uint16 spellType, uint8 cls) {
switch (spellType) { switch (spellType) {
case BotSpellTypes::RegularHeal: case BotSpellTypes::RegularHeal:
case BotSpellTypes::CompleteHeal: case BotSpellTypes::CompleteHeal:
@@ -2879,7 +2879,7 @@ bool BOT_SPELL_TYPES_BENEFICIAL(uint16 spellType, uint8 cls) {
return false; return false;
} }
bool BOT_SPELL_TYPES_OTHER_BENEFICIAL(uint16 spellType) { bool IsBotSpellTypeOtherBeneficial(uint16 spellType) {
switch (spellType) { switch (spellType) {
case BotSpellTypes::RegularHeal: case BotSpellTypes::RegularHeal:
case BotSpellTypes::CompleteHeal: case BotSpellTypes::CompleteHeal:
@@ -2922,7 +2922,7 @@ bool BOT_SPELL_TYPES_OTHER_BENEFICIAL(uint16 spellType) {
return false; return false;
} }
bool BOT_SPELL_TYPES_INNATE(uint16 spellType) { bool IsBotSpellTypeInnate(uint16 spellType) {
switch (spellType) { switch (spellType) {
case BotSpellTypes::AENukes: case BotSpellTypes::AENukes:
case BotSpellTypes::AERains: case BotSpellTypes::AERains:
@@ -2955,7 +2955,7 @@ bool BOT_SPELL_TYPES_INNATE(uint16 spellType) {
} }
bool IsBotSpellType(uint16 spellType) { bool IsBotSpellType(uint16 spellType) {
if (BOT_SPELL_TYPES_DETRIMENTAL(spellType) && BOT_SPELL_TYPES_BENEFICIAL(spellType) && BOT_SPELL_TYPES_INNATE(spellType)) { if (IsBotSpellTypeDetrimental(spellType) && IsBotSpellTypeBeneficial(spellType) && IsBotSpellTypeInnate(spellType)) {
return true; return true;
} }
+4 -4
View File
@@ -736,10 +736,10 @@ const uint32 SPELL_TYPES_DETRIMENTAL = (SpellType_Nuke | SpellType_Root | SpellT
const uint32 SPELL_TYPES_BENEFICIAL = (SpellType_Heal | SpellType_Buff | SpellType_Escape | SpellType_Pet | SpellType_InCombatBuff | SpellType_Cure | SpellType_HateRedux | SpellType_InCombatBuffSong | SpellType_OutOfCombatBuffSong | SpellType_PreCombatBuff | SpellType_PreCombatBuffSong); const uint32 SPELL_TYPES_BENEFICIAL = (SpellType_Heal | SpellType_Buff | SpellType_Escape | SpellType_Pet | SpellType_InCombatBuff | SpellType_Cure | SpellType_HateRedux | SpellType_InCombatBuffSong | SpellType_OutOfCombatBuffSong | SpellType_PreCombatBuff | SpellType_PreCombatBuffSong);
const uint32 SPELL_TYPES_INNATE = (SpellType_Nuke | SpellType_Lifetap | SpellType_DOT | SpellType_Dispel | SpellType_Mez | SpellType_Slow | SpellType_Debuff | SpellType_Charm | SpellType_Root); const uint32 SPELL_TYPES_INNATE = (SpellType_Nuke | SpellType_Lifetap | SpellType_DOT | SpellType_Dispel | SpellType_Mez | SpellType_Slow | SpellType_Debuff | SpellType_Charm | SpellType_Root);
bool BOT_SPELL_TYPES_DETRIMENTAL (uint16 spellType, uint8 cls = 0); bool IsBotSpellTypeDetrimental (uint16 spellType, uint8 cls = 0);
bool BOT_SPELL_TYPES_BENEFICIAL (uint16 spellType, uint8 cls = 0); bool IsBotSpellTypeBeneficial (uint16 spellType, uint8 cls = 0);
bool BOT_SPELL_TYPES_OTHER_BENEFICIAL(uint16 spellType); bool IsBotSpellTypeOtherBeneficial(uint16 spellType);
bool BOT_SPELL_TYPES_INNATE (uint16 spellType); bool IsBotSpellTypeInnate (uint16 spellType);
bool IsBotSpellType (uint16 spellType); bool IsBotSpellType (uint16 spellType);
bool IsAEBotSpellType(uint16 spellType); bool IsAEBotSpellType(uint16 spellType);
bool IsGroupBotSpellType(uint16 spellType); bool IsGroupBotSpellType(uint16 spellType);
+7 -7
View File
@@ -7166,7 +7166,7 @@ bool Bot::CheckLoreConflict(const EQ::ItemData* item) {
bool EntityList::Bot_AICheckCloseBeneficialSpells(Bot* caster, uint8 iChance, uint16 spellType) { bool EntityList::Bot_AICheckCloseBeneficialSpells(Bot* caster, uint8 iChance, uint16 spellType) {
if (BOT_SPELL_TYPES_DETRIMENTAL(spellType, caster->GetClass())) { if (IsBotSpellTypeDetrimental(spellType, caster->GetClass())) {
LogError("[EntityList::Bot_AICheckCloseBeneficialSpells] detrimental spells requested"); LogError("[EntityList::Bot_AICheckCloseBeneficialSpells] detrimental spells requested");
return false; return false;
} }
@@ -10258,7 +10258,7 @@ void Bot::SetBotSpellRecastTimer(uint16 spellType, Mob* tar, bool preCast) {
return; return;
} }
if (!preCast && BOT_SPELL_TYPES_OTHER_BENEFICIAL(spellType)) { if (!preCast && IsBotSpellTypeOtherBeneficial(spellType)) {
return; return;
} }
@@ -10276,7 +10276,7 @@ void Bot::SetBotSpellRecastTimer(uint16 spellType, Mob* tar, bool preCast) {
if (tar->IsPet() && tar->GetOwner() && tar->GetOwner()->IsOfClientBot()) { if (tar->IsPet() && tar->GetOwner() && tar->GetOwner()->IsOfClientBot()) {
return tar->GetOwner()->SetSpellTypeRecastTimer(spellType, (GetUltimateSpellDelay(spellType, tar) + addedDelay)); return tar->GetOwner()->SetSpellTypeRecastTimer(spellType, (GetUltimateSpellDelay(spellType, tar) + addedDelay));
} }
else if (BOT_SPELL_TYPES_OTHER_BENEFICIAL(spellType)) { else if (IsBotSpellTypeOtherBeneficial(spellType)) {
tar->SetSpellTypeRecastTimer(spellType, (GetUltimateSpellDelay(spellType, tar) + addedDelay)); tar->SetSpellTypeRecastTimer(spellType, (GetUltimateSpellDelay(spellType, tar) + addedDelay));
} }
else { else {
@@ -10407,7 +10407,7 @@ uint16 Bot::GetDefaultSpellTypePriority(uint16 spellType, uint8 priorityType, ui
} }
uint16 Bot::GetDefaultSpellTypeIdlePriority(uint16 spellType, uint8 botClass, uint8 stance) { uint16 Bot::GetDefaultSpellTypeIdlePriority(uint16 spellType, uint8 botClass, uint8 stance) {
if (!BOT_SPELL_TYPES_BENEFICIAL(spellType, botClass)) { if (!IsBotSpellTypeBeneficial(spellType, botClass)) {
return 0; return 0;
} }
@@ -10669,7 +10669,7 @@ uint16 Bot::GetDefaultSpellTypePursuePriority(uint16 spellType, uint8 botClass,
uint16 Bot::GetDefaultSpellTypeResistLimit(uint16 spellType, uint8 stance) { uint16 Bot::GetDefaultSpellTypeResistLimit(uint16 spellType, uint8 stance) {
if (!BOT_SPELL_TYPES_BENEFICIAL(spellType, GetClass())) { if (!IsBotSpellTypeBeneficial(spellType, GetClass())) {
return RuleI(Bots, SpellResistLimit); return RuleI(Bots, SpellResistLimit);
} }
else { else {
@@ -10924,7 +10924,7 @@ bool Bot::AttemptAICastSpell(uint16 spellType) {
return result; return result;
} }
if (BOT_SPELL_TYPES_BENEFICIAL(spellType, GetClass())) { if (IsBotSpellTypeBeneficial(spellType, GetClass())) {
if (!PrecastChecks(this, spellType) || !AICastSpell(this, GetChanceToCastBySpellType(spellType), spellType)) { if (!PrecastChecks(this, spellType) || !AICastSpell(this, GetChanceToCastBySpellType(spellType), spellType)) {
if (GetClass() == Class::Bard) { if (GetClass() == Class::Bard) {
return result; return result;
@@ -11337,7 +11337,7 @@ bool Bot::RequiresLoSForPositioning() {
} }
for (uint16 i = BotSpellTypes::START; i <= BotSpellTypes::END; ++i) { for (uint16 i = BotSpellTypes::START; i <= BotSpellTypes::END; ++i) {
if (BOT_SPELL_TYPES_DETRIMENTAL(i) && !GetSpellHold(i)) { if (IsBotSpellTypeDetrimental(i) && !GetSpellHold(i)) {
return true; return true;
} }
} }
+4 -4
View File
@@ -339,7 +339,7 @@ void bot_command_cast(Client* c, const Seperator* sep)
break; break;
default: default:
if ( if (
(BOT_SPELL_TYPES_DETRIMENTAL(spellType) && !c->IsAttackAllowed(tar)) || (IsBotSpellTypeDetrimental(spellType) && !c->IsAttackAllowed(tar)) ||
( (
spellType == BotSpellTypes::Charm && spellType == BotSpellTypes::Charm &&
( (
@@ -354,7 +354,7 @@ void bot_command_cast(Client* c, const Seperator* sep)
return; return;
} }
if (BOT_SPELL_TYPES_BENEFICIAL(spellType)) { if (IsBotSpellTypeBeneficial(spellType)) {
if ( if (
(!tar->IsOfClientBot() && !(tar->IsPet() && tar->GetOwner() && tar->GetOwner()->IsOfClientBot())) || (!tar->IsOfClientBot() && !(tar->IsPet() && tar->GetOwner() && tar->GetOwner()->IsOfClientBot())) ||
((tar->IsOfClientBot() && !c->IsInGroupOrRaid(tar)) || (tar->GetOwner() && tar->GetOwner()->IsOfClientBot() && !c->IsInGroupOrRaid(tar->GetOwner()))) ((tar->IsOfClientBot() && !c->IsInGroupOrRaid(tar)) || (tar->GetOwner() && tar->GetOwner()->IsOfClientBot() && !c->IsInGroupOrRaid(tar->GetOwner())))
@@ -418,14 +418,14 @@ void bot_command_cast(Client* c, const Seperator* sep)
} }
if ( if (
BOT_SPELL_TYPES_BENEFICIAL(spellType) && IsBotSpellTypeBeneficial(spellType) &&
!RuleB(Bots, CrossRaidBuffingAndHealing) && !RuleB(Bots, CrossRaidBuffingAndHealing) &&
!bot_iter->IsInGroupOrRaid(newTar, true) !bot_iter->IsInGroupOrRaid(newTar, true)
) { ) {
continue; continue;
} }
if (BOT_SPELL_TYPES_DETRIMENTAL(spellType, bot_iter->GetClass()) && !bot_iter->IsAttackAllowed(newTar)) { if (IsBotSpellTypeDetrimental(spellType, bot_iter->GetClass()) && !bot_iter->IsAttackAllowed(newTar)) {
bot_iter->BotGroupSay( bot_iter->BotGroupSay(
bot_iter, bot_iter,
fmt::format( fmt::format(
+1 -1
View File
@@ -249,7 +249,7 @@ void bot_command_depart(Client* c, const Seperator* sep)
} }
if (bot_iter->CastSpell(itr->SpellId, tar->GetID(), EQ::spells::CastingSlot::Gem2, -1, -1)) { if (bot_iter->CastSpell(itr->SpellId, tar->GetID(), EQ::spells::CastingSlot::Gem2, -1, -1)) {
if (BOT_SPELL_TYPES_OTHER_BENEFICIAL(BotSpellTypes::Teleport)) { if (IsBotSpellTypeOtherBeneficial(BotSpellTypes::Teleport)) {
bot_iter->SetCastedSpellType(UINT16_MAX); bot_iter->SetCastedSpellType(UINT16_MAX);
} }
else { else {
+3 -3
View File
@@ -243,7 +243,7 @@ bool Bot::AICastSpell(Mob* tar, uint8 iChance, uint16 spellType, uint16 subTarge
} }
if (AIDoSpellCast(s.SpellIndex, tar, s.ManaCost)) { if (AIDoSpellCast(s.SpellIndex, tar, s.ManaCost)) {
if (BOT_SPELL_TYPES_OTHER_BENEFICIAL(spellType)) { if (IsBotSpellTypeOtherBeneficial(spellType)) {
SetCastedSpellType(UINT16_MAX); SetCastedSpellType(UINT16_MAX);
if (!IsCommandedSpell()) { if (!IsCommandedSpell()) {
@@ -293,7 +293,7 @@ bool Bot::BotCastMez(Mob* tar, uint8 botClass, BotSpell& botSpell, uint16 spellT
} }
if (AIDoSpellCast(s.SpellIndex, tar, s.ManaCost)) { if (AIDoSpellCast(s.SpellIndex, tar, s.ManaCost)) {
if (BOT_SPELL_TYPES_OTHER_BENEFICIAL(spellType)) { if (IsBotSpellTypeOtherBeneficial(spellType)) {
SetCastedSpellType(UINT16_MAX); SetCastedSpellType(UINT16_MAX);
if (!IsCommandedSpell()) { if (!IsCommandedSpell()) {
@@ -2514,7 +2514,7 @@ DBbotspells_Struct* ZoneDatabase::GetBotSpells(uint32 bot_spell_id)
entry.bucket_comparison = e.bucket_comparison; entry.bucket_comparison = e.bucket_comparison;
// some spell types don't make much since to be priority 0, so fix that // some spell types don't make much since to be priority 0, so fix that
if (!BOT_SPELL_TYPES_INNATE(entry.type) && entry.priority == 0) { if (!IsBotSpellTypeInnate(entry.type) && entry.priority == 0) {
entry.priority = 1; entry.priority = 1;
} }
+4 -4
View File
@@ -9631,7 +9631,7 @@ uint16 Mob::GetUltimateSpellDelay(uint16 spellType, Mob* tar) {
return tar->GetOwner()->GetSpellDelay(GetPetSpellType(spellType)); return tar->GetOwner()->GetSpellDelay(GetPetSpellType(spellType));
} }
if (BOT_SPELL_TYPES_OTHER_BENEFICIAL(spellType) && tar->IsOfClientBot()) { if (IsBotSpellTypeOtherBeneficial(spellType) && tar->IsOfClientBot()) {
return tar->GetSpellDelay(spellType); return tar->GetSpellDelay(spellType);
} }
@@ -9647,7 +9647,7 @@ bool Mob::GetUltimateSpellDelayCheck(uint16 spellType, Mob* tar) {
return tar->GetOwner()->SpellTypeRecastCheck(GetPetSpellType(spellType)); return tar->GetOwner()->SpellTypeRecastCheck(GetPetSpellType(spellType));
} }
if (BOT_SPELL_TYPES_OTHER_BENEFICIAL(spellType) && tar->IsOfClientBot()) { if (IsBotSpellTypeOtherBeneficial(spellType) && tar->IsOfClientBot()) {
return tar->SpellTypeRecastCheck(spellType); return tar->SpellTypeRecastCheck(spellType);
} }
@@ -9663,7 +9663,7 @@ uint8 Mob::GetUltimateSpellMinThreshold(uint16 spellType, Mob* tar) {
return tar->GetOwner()->GetSpellMinThreshold(GetPetSpellType(spellType)); return tar->GetOwner()->GetSpellMinThreshold(GetPetSpellType(spellType));
} }
if (BOT_SPELL_TYPES_OTHER_BENEFICIAL(spellType) && tar->IsOfClientBot()) { if (IsBotSpellTypeOtherBeneficial(spellType) && tar->IsOfClientBot()) {
return tar->GetSpellMinThreshold(spellType); return tar->GetSpellMinThreshold(spellType);
} }
@@ -9679,7 +9679,7 @@ uint8 Mob::GetUltimateSpellMaxThreshold(uint16 spellType, Mob* tar) {
return tar->GetOwner()->GetSpellMaxThreshold(GetPetSpellType(spellType)); return tar->GetOwner()->GetSpellMaxThreshold(GetPetSpellType(spellType));
} }
if (BOT_SPELL_TYPES_OTHER_BENEFICIAL(spellType) && tar->IsOfClientBot()) { if (IsBotSpellTypeOtherBeneficial(spellType) && tar->IsOfClientBot()) {
return tar->GetSpellMaxThreshold(spellType); return tar->GetSpellMaxThreshold(spellType);
} }