Move bot spdat functions to spdat_bot

This commit is contained in:
nytmyr
2025-01-21 13:13:30 -06:00
parent 37910cf3dc
commit 2301b91e77
9 changed files with 739 additions and 675 deletions
+2 -2
View File
@@ -9329,7 +9329,7 @@ bool Bot::PrecastChecks(Mob* tar, uint16 spell_type) {
return false;
}
if (IsPullingSpell() && IsPullingSpellType(spell_type)) { //Skip remaining checks for commanded
if (IsPullingSpell() && IsPullingBotSpellType(spell_type)) { //Skip remaining checks for commanded
return true;
}
@@ -9472,7 +9472,7 @@ bool Bot::CastChecks(uint16 spell_id, Mob* tar, uint16 spell_type, bool precheck
return false;
}
if (SpellTypeRequiresTarget(spell_type) && !tar) {
if (BotSpellTypeRequiresTarget(spell_type) && !tar) {
LogBotSpellChecksDetail("{} says, 'Cancelling cast due to CastChecks !tar.'", GetCleanName());
return false;
}
+1 -1
View File
@@ -509,7 +509,7 @@ void bot_command_cast(Client* c, const Seperator* sep)
Mob* new_tar = tar;
if (!aa_type && !by_spell_id) {
if (!SpellTypeRequiresTarget(spell_type)) {
if (!BotSpellTypeRequiresTarget(spell_type)) {
new_tar = bot_iter;
}
+7 -7
View File
@@ -64,7 +64,7 @@ bool Bot::AICastSpell(Mob* tar, uint8 chance, uint16 spell_type, uint16 sub_targ
bot_spell.SpellIndex = 0;
bot_spell.ManaCost = 0;
if (SpellTypeRequiresLoS(spell_type) && tar != this) {
if (BotSpellTypeRequiresLoS(spell_type) && tar != this) {
SetHasLoS(DoLosChecks(this, tar));
}
else {
@@ -644,7 +644,7 @@ bool Bot::AI_PursueCastCheck() {
continue;
}
if (IsCommandedSpellType(current_cast.spellType)) { // Unsupported by AI currently.
if (IsCommandedBotSpellType(current_cast.spellType)) { // Unsupported by AI currently.
continue;
}
@@ -716,7 +716,7 @@ bool Bot::AI_IdleCastCheck() {
continue;
}
if (IsCommandedSpellType(current_cast.spellType)) { // Unsupported by AI currently.
if (IsCommandedBotSpellType(current_cast.spellType)) { // Unsupported by AI currently.
continue;
}
@@ -780,7 +780,7 @@ bool Bot::AI_EngagedCastCheck() {
continue;
}
if (IsCommandedSpellType(current_cast.spellType)) { // Unsupported by AI currently.
if (IsCommandedBotSpellType(current_cast.spellType)) { // Unsupported by AI currently.
continue;
}
@@ -1071,7 +1071,7 @@ std::vector<BotSpell_wPriority> Bot::GetPrioritizedBotSpellsBySpellType(Bot* cas
caster->IsCommandedSpell() ||
!AE ||
(
SpellTypeRequiresAEChecks(spell_type) &&
BotSpellTypeRequiresAEChecks(spell_type) &&
caster->HasValidAETarget(caster, bot_spell_list[i].spellid, spell_type, tar)
)
) {
@@ -2957,7 +2957,7 @@ void Bot::CheckBotSpells() {
}
}
correct_type = GetCorrectSpellType(s.type, spell_id);
correct_type = GetCorrectBotSpellType(s.type, spell_id);
parent_type = GetParentSpellType(correct_type);
if (RuleB(Bots, UseParentSpellTypeForChecks)) {
@@ -2967,7 +2967,7 @@ void Bot::CheckBotSpells() {
}
else {
if (IsPetBotSpellType(s.type)) {
correct_type = GetPetSpellType(correct_type);
correct_type = GetPetBotSpellType(correct_type);
}
}
+1 -1
View File
@@ -470,7 +470,7 @@ public:
uint8 GetUltimateSpellMinThreshold(uint16 spell_type, Mob* tar);
uint8 GetUltimateSpellMaxThreshold(uint16 spell_type, Mob* tar);
uint16 GetPetSpellType(uint16 spell_type);
uint16 GetPetBotSpellType(uint16 spell_type);
void DisableBotSpellTimers();
void StartBotSpellTimers();
+6 -6
View File
@@ -618,7 +618,7 @@ bool Mob::GetUltimateSpellHold(uint16 spell_type, Mob* tar) {
}
if (tar->IsPet() && tar->GetOwner() && tar->GetOwner()->IsOfClientBot()) {
return tar->GetOwner()->GetSpellHold(GetPetSpellType(spell_type));
return tar->GetOwner()->GetSpellHold(GetPetBotSpellType(spell_type));
}
return GetSpellHold(spell_type);
@@ -630,7 +630,7 @@ uint16 Mob::GetUltimateSpellDelay(uint16 spell_type, Mob* tar) {
}
if (tar->IsPet() && tar->GetOwner() && tar->GetOwner()->IsOfClientBot()) {
return tar->GetOwner()->GetSpellDelay(GetPetSpellType(spell_type));
return tar->GetOwner()->GetSpellDelay(GetPetBotSpellType(spell_type));
}
if (IsBotSpellTypeOtherBeneficial(spell_type) && tar->IsOfClientBot()) {
@@ -646,7 +646,7 @@ bool Mob::GetUltimateSpellDelayCheck(uint16 spell_type, Mob* tar) {
}
if (tar->IsPet() && tar->GetOwner() && tar->GetOwner()->IsOfClientBot()) {
return tar->GetOwner()->SpellTypeRecastCheck(GetPetSpellType(spell_type));
return tar->GetOwner()->SpellTypeRecastCheck(GetPetBotSpellType(spell_type));
}
if (IsBotSpellTypeOtherBeneficial(spell_type) && tar->IsOfClientBot()) {
@@ -662,7 +662,7 @@ uint8 Mob::GetUltimateSpellMinThreshold(uint16 spell_type, Mob* tar) {
}
if (tar->IsPet() && tar->GetOwner() && tar->GetOwner()->IsOfClientBot()) {
return tar->GetOwner()->GetSpellMinThreshold(GetPetSpellType(spell_type));
return tar->GetOwner()->GetSpellMinThreshold(GetPetBotSpellType(spell_type));
}
if (IsBotSpellTypeOtherBeneficial(spell_type) && tar->IsOfClientBot()) {
@@ -678,7 +678,7 @@ uint8 Mob::GetUltimateSpellMaxThreshold(uint16 spell_type, Mob* tar) {
}
if (tar->IsPet() && tar->GetOwner() && tar->GetOwner()->IsOfClientBot()) {
return tar->GetOwner()->GetSpellMaxThreshold(GetPetSpellType(spell_type));
return tar->GetOwner()->GetSpellMaxThreshold(GetPetBotSpellType(spell_type));
}
if (IsBotSpellTypeOtherBeneficial(spell_type) && tar->IsOfClientBot()) {
@@ -688,7 +688,7 @@ uint8 Mob::GetUltimateSpellMaxThreshold(uint16 spell_type, Mob* tar) {
return GetSpellMaxThreshold(spell_type);
}
uint16 Mob::GetPetSpellType(uint16 spell_type) {
uint16 Mob::GetPetBotSpellType(uint16 spell_type) {
switch (spell_type) {
case BotSpellTypes::VeryFastHeals:
return BotSpellTypes::PetVeryFastHeals;