From b3a550f19322321487313f34b036db457a862991 Mon Sep 17 00:00:00 2001 From: nytmyr <53322305+nytmyr@users.noreply.github.com> Date: Sun, 26 Jan 2025 22:27:15 -0600 Subject: [PATCH] Rename BotSpells_Struct/BotSpells_Struct_wIndex --- zone/bot.cpp | 6 +++--- zone/bot.h | 10 +++++----- zone/bot_commands/discipline.cpp | 2 +- zone/bot_structs.h | 4 ++-- zone/botspellsai.cpp | 22 +++++++++++----------- 5 files changed, 22 insertions(+), 22 deletions(-) diff --git a/zone/bot.cpp b/zone/bot.cpp index 2e4b3c368..f8b85f2a9 100644 --- a/zone/bot.cpp +++ b/zone/bot.cpp @@ -12329,7 +12329,7 @@ void Bot::CleanBotBlockedBuffs() } } -std::vector Bot::BotGetSpellsByType(uint16 spell_type) { +std::vector Bot::BotGetSpellsByType(uint16 spell_type) { if (AIBot_spells_by_type[spell_type].empty()) { spell_type = GetParentSpellType(spell_type); } @@ -12337,7 +12337,7 @@ std::vector Bot::BotGetSpellsByType(uint16 spell_type) return AIBot_spells_by_type[spell_type]; } -void Bot::AssignBotSpellsToTypes(std::vector& AIBot_spells, std::unordered_map>& AIBot_spells_by_type) { +void Bot::AssignBotSpellsToTypes(std::vector& AIBot_spells, std::unordered_map>& AIBot_spells_by_type) { AIBot_spells_by_type.clear(); for (size_t i = 0; i < AIBot_spells.size(); ++i) { @@ -12347,7 +12347,7 @@ void Bot::AssignBotSpellsToTypes(std::vector& AIBot_spells, st continue; } - BotSpells_Struct_wIndex spell_with_index{ + BotSpells_wIndex spell_with_index{ static_cast(i), spell.type, spell.spellid, diff --git a/zone/bot.h b/zone/bot.h index 71772bd5d..43df08fd7 100644 --- a/zone/bot.h +++ b/zone/bot.h @@ -304,7 +304,7 @@ public: uint16 BotGetSpells(int spellslot) { return AIBot_spells[spellslot].spellid; } uint32 BotGetSpellType(int spellslot) { return AIBot_spells[spellslot].type; } uint16 BotGetSpellPriority(int spellslot) { return AIBot_spells[spellslot].priority; } - std::vector BotGetSpellsByType(uint16 spell_type); + std::vector BotGetSpellsByType(uint16 spell_type); float GetProcChances(float ProcBonus, uint16 hand) override; int GetHandToHandDamage(void) override; bool TryFinishingBlow(Mob *defender, int64 &damage) override; @@ -540,7 +540,7 @@ public: void SetVerifiedRaid(bool status) { _verifiedRaid = status; } uint16 GetTempSpellType() { return _tempSpellType; } void SetTempSpellType(uint16 spell_type) { _tempSpellType = spell_type; } - void AssignBotSpellsToTypes(std::vector& AIBot_spells, std::unordered_map>& AIBot_spells_by_type); + void AssignBotSpellsToTypes(std::vector& AIBot_spells, std::unordered_map>& AIBot_spells_by_type); bool IsTargetAlreadyReceivingSpell(Mob* tar, uint16 spell_id); bool DoResistCheck(Mob* target, uint16 spell_id, int32 resist_limit); bool DoResistCheckBySpellType(Mob* tar, uint16 spell_id, uint16 spell_type); @@ -1072,9 +1072,9 @@ protected: void SetGroupDoter(bool flag = true) { m_CastingRoles.GroupDoter = flag; } std::deque bot_signal_q; - std::vector AIBot_spells; - std::vector AIBot_spells_enforced; - std::unordered_map> AIBot_spells_by_type; + std::vector AIBot_spells; + std::vector AIBot_spells_enforced; + std::unordered_map> AIBot_spells_by_type; std::map> commanded_spells_min_level; diff --git a/zone/bot_commands/discipline.cpp b/zone/bot_commands/discipline.cpp index 8246b1406..146ed6090 100644 --- a/zone/bot_commands/discipline.cpp +++ b/zone/bot_commands/discipline.cpp @@ -134,7 +134,7 @@ void bot_command_discipline(Client* c, const Seperator* sep) } if (spell_id == UINT16_MAX) { // Aggressive/Defensive type - std::vector bot_spell_list; + std::vector bot_spell_list; if (aggressive) { bot_spell_list = bot_iter->BotGetSpellsByType(BotSpellTypes::DiscAggressive); diff --git a/zone/bot_structs.h b/zone/bot_structs.h index 47db1706d..c40e820b8 100644 --- a/zone/bot_structs.h +++ b/zone/bot_structs.h @@ -64,7 +64,7 @@ struct BotSpellSetting { bool is_enabled = true; }; -struct BotSpells_Struct { +struct BotSpells { uint32 type; // 0 = never, must be one (and only one) of the defined values int16 spellid; // <= 0 = no spell int16 manacost; // -1 = use spdat, -2 = no cast time @@ -81,7 +81,7 @@ struct BotSpells_Struct { uint8 bucket_comparison; }; -struct BotSpells_Struct_wIndex { +struct BotSpells_wIndex { uint32 index; //index of AIBot_spells uint32 type; // 0 = never, must be one (and only one) of the defined values int16 spellid; // <= 0 = no spell diff --git a/zone/botspellsai.cpp b/zone/botspellsai.cpp index 17f1d8d81..25982f7f4 100644 --- a/zone/botspellsai.cpp +++ b/zone/botspellsai.cpp @@ -907,7 +907,7 @@ std::list Bot::GetBotSpellsForSpellEffect(Bot* caster, uint16 spell_ty } if (caster->AI_HasSpells()) { - std::vector bot_spell_list = caster->BotGetSpellsByType(spell_type); + std::vector bot_spell_list = caster->BotGetSpellsByType(spell_type); for (int i = bot_spell_list.size() - 1; i >= 0; i--) { if (!IsValidSpellAndLoS(bot_spell_list[i].spellid, caster->HasLoS())) { @@ -945,7 +945,7 @@ std::list Bot::GetBotSpellsForSpellEffectAndTargetType(Bot* caster, ui } if (caster->AI_HasSpells()) { - std::vector bot_spell_list = caster->BotGetSpellsByType(spell_type); + std::vector bot_spell_list = caster->BotGetSpellsByType(spell_type); for (int i = bot_spell_list.size() - 1; i >= 0; i--) { if (!IsValidSpellAndLoS(bot_spell_list[i].spellid, caster->HasLoS())) { @@ -986,7 +986,7 @@ std::list Bot::GetBotSpellsBySpellType(Bot* caster, uint16 spell_type) } if (caster->AI_HasSpells()) { - std::vector bot_spell_list = caster->BotGetSpellsByType(spell_type); + std::vector bot_spell_list = caster->BotGetSpellsByType(spell_type); for (int i = bot_spell_list.size() - 1; i >= 0; i--) { if (!IsValidSpellAndLoS(bot_spell_list[i].spellid, caster->HasLoS())) { @@ -1015,7 +1015,7 @@ std::vector Bot::GetPrioritizedBotSpellsBySpellType(Bot* cas std::vector result; if (caster && caster->AI_HasSpells()) { - std::vector bot_spell_list = caster->BotGetSpellsByType(spell_type); + std::vector bot_spell_list = caster->BotGetSpellsByType(spell_type); for (int i = bot_spell_list.size() - 1; i >= 0; i--) { if (!IsValidSpellAndLoS(bot_spell_list[i].spellid, caster->HasLoS())) { @@ -1104,7 +1104,7 @@ BotSpell Bot::GetFirstBotSpellBySpellType(Bot* caster, uint16 spell_type) { result.ManaCost = 0; if (caster && caster->AI_HasSpells()) { - std::vector bot_spell_list = caster->BotGetSpellsByType(spell_type); + std::vector bot_spell_list = caster->BotGetSpellsByType(spell_type); for (int i = bot_spell_list.size() - 1; i >= 0; i--) { if (!IsValidSpellAndLoS(bot_spell_list[i].spellid, caster->HasLoS())) { @@ -1212,7 +1212,7 @@ BotSpell Bot::GetBestBotSpellForPercentageHeal(Bot* caster, Mob* tar, uint16 spe result.ManaCost = 0; if (caster && caster->AI_HasSpells()) { - std::vector bot_spell_list = caster->BotGetSpellsByType(spell_type); + std::vector bot_spell_list = caster->BotGetSpellsByType(spell_type); for (int i = bot_spell_list.size() - 1; i >= 0; i--) { if (!IsValidSpell(bot_spell_list[i].spellid)) { continue; @@ -1932,7 +1932,7 @@ BotSpell Bot::GetDebuffBotSpell(Bot* caster, Mob *tar, uint16 spell_type) { return result; if (caster->AI_HasSpells()) { - std::vector bot_spell_list = caster->BotGetSpellsByType(spell_type); + std::vector bot_spell_list = caster->BotGetSpellsByType(spell_type); for (int i = bot_spell_list.size() - 1; i >= 0; i--) { if (!IsValidSpellAndLoS(bot_spell_list[i].spellid, caster->HasLoS())) { @@ -1978,7 +1978,7 @@ BotSpell Bot::GetBestBotSpellForResistDebuff(Bot* caster, Mob *tar, uint16 spell bool needs_disease_resist_debuff = (tar->GetDR() + level_mod) > 100; if (caster->AI_HasSpells()) { - std::vector bot_spell_list = caster->BotGetSpellsByType(spell_type); + std::vector bot_spell_list = caster->BotGetSpellsByType(spell_type); for (int i = bot_spell_list.size() - 1; i >= 0; i--) { if (!IsValidSpellAndLoS(bot_spell_list[i].spellid, caster->HasLoS())) { @@ -2437,7 +2437,7 @@ bool Bot::AI_AddBotSpells(uint32 bot_spell_id) { } } - std::sort(AIBot_spells.begin(), AIBot_spells.end(), [](const BotSpells_Struct& a, const BotSpells_Struct& b) { + std::sort(AIBot_spells.begin(), AIBot_spells.end(), [](const BotSpells& a, const BotSpells& b) { return a.priority > b.priority; }); @@ -2604,7 +2604,7 @@ void Bot::AddSpellToBotList( } HasAISpell = true; - BotSpells_Struct t; + BotSpells t; t.priority = in_priority; t.spellid = in_spell_id; @@ -2650,7 +2650,7 @@ void Bot::AddSpellToBotEnforceList( } HasAISpell = true; - BotSpells_Struct t; + BotSpells t; t.priority = iPriority; t.spellid = iSpellID;