Make struct BotSpellSettings snake case

This commit is contained in:
nytmyr
2025-01-28 23:04:13 -06:00
parent 626b7fd028
commit db00064028
5 changed files with 91 additions and 76 deletions
+48 -33
View File
@@ -10477,31 +10477,46 @@ void Bot::LoadDefaultBotSettings() {
for (uint16 i = BotSpellTypes::START; i <= BotSpellTypes::END; ++i) {
BotSpellSettings t;
t.spellType = i;
t.shortName = GetSpellTypeShortNameByID(i);
t.name = GetSpellTypeNameByID(i);
t.hold = GetDefaultSpellHold(i, bot_stance);
t.delay = GetDefaultSpellDelay(i, bot_stance);
t.minThreshold = GetDefaultSpellMinThreshold(i, bot_stance);
t.maxThreshold = GetDefaultSpellMaxThreshold(i, bot_stance);
t.resistLimit = GetDefaultSpellTypeResistLimit(i, bot_stance);
t.aggroCheck = GetDefaultSpellTypeAggroCheck(i, bot_stance);
t.minManaPct = GetDefaultSpellTypeMinManaLimit(i, bot_stance);
t.maxManaPct = GetDefaultSpellTypeMaxManaLimit(i, bot_stance);
t.minHPPct = GetDefaultSpellTypeMinHPLimit(i, bot_stance);
t.maxHPPct = GetDefaultSpellTypeMaxHPLimit(i, bot_stance);
t.idlePriority = GetDefaultSpellTypePriority(i, BotPriorityCategories::Idle, GetClass(), bot_stance);
t.engagedPriority = GetDefaultSpellTypePriority(i, BotPriorityCategories::Engaged, GetClass(), bot_stance);
t.pursuePriority = GetDefaultSpellTypePriority(i, BotPriorityCategories::Pursue, GetClass(), bot_stance);
t.AEOrGroupTargetCount = GetDefaultSpellTypeAEOrGroupTargetCount(i, bot_stance);
t.recastTimer.Start();
t.spell_type = i;
t.short_name = GetSpellTypeShortNameByID(i);
t.name = GetSpellTypeNameByID(i);
t.hold = GetDefaultSpellHold(i, bot_stance);
t.delay = GetDefaultSpellDelay(i, bot_stance);
t.min_threshold = GetDefaultSpellMinThreshold(i, bot_stance);
t.max_threshold = GetDefaultSpellMaxThreshold(i, bot_stance);
t.resist_limit = GetDefaultSpellTypeResistLimit(i, bot_stance);
t.aggro_check = GetDefaultSpellTypeAggroCheck(i, bot_stance);
t.min_mana_pct = GetDefaultSpellTypeMinManaLimit(i, bot_stance);
t.max_mana_pct = GetDefaultSpellTypeMaxManaLimit(i, bot_stance);
t.min_hp_pct = GetDefaultSpellTypeMinHPLimit(i, bot_stance);
t.max_hp_pct = GetDefaultSpellTypeMaxHPLimit(i, bot_stance);
t.idle_priority = GetDefaultSpellTypePriority(
i,
BotPriorityCategories::Idle,
GetClass(),
bot_stance
);
t.engaged_priority = GetDefaultSpellTypePriority(
i,
BotPriorityCategories::Engaged,
GetClass(),
bot_stance
);
t.pursue_priority = GetDefaultSpellTypePriority(
i,
BotPriorityCategories::Pursue,
GetClass(),
bot_stance
);
t.ae_or_group_target_count = GetDefaultSpellTypeAEOrGroupTargetCount(i, bot_stance);
t.recast_timer.Start();
m_bot_spell_settings.push_back(t);
LogBotSettingsDetail("{} says, 'Setting defaults for {} ({}) [#{}] - [{} [#{}] stance]'", GetCleanName(), t.name, t.shortName, t.spellType, Stance::GetName(bot_stance), bot_stance);
LogBotSettingsDetail("{} says, 'Setting defaults for {} ({}) [#{}] - [{} [#{}] stance]'", GetCleanName(), t.name, t.short_name, t.spell_type, Stance::GetName(bot_stance), bot_stance);
LogBotSettingsDetail("{} says, 'Hold = [{}] | Delay = [{}ms] | MinThreshold = [{}\%] | MaxThreshold = [{}\%]'", GetCleanName(), GetDefaultSpellHold(i, bot_stance), GetDefaultSpellDelay(i, bot_stance), GetDefaultSpellMinThreshold(i, bot_stance), GetDefaultSpellMaxThreshold(i, bot_stance));
LogBotSettingsDetail("{} says, 'AggroCheck = [{}] | MinManaPCT = [{}\%] | MaxManaPCT = [{}\%] | MinHPPCT = [{}\% | MaxHPPCT = [{}\%]'", GetCleanName(), GetDefaultSpellTypeAggroCheck(i, bot_stance), GetDefaultSpellTypeMinManaLimit(i, bot_stance), GetDefaultSpellTypeMaxManaLimit(i, bot_stance), GetDefaultSpellTypeMinHPLimit(i, bot_stance), GetDefaultSpellTypeMaxHPLimit(i, bot_stance));
LogBotSettingsDetail("{} says, 'IdlePriority = [{}] | EngagedPriority = [{}] | PursuePriority = [{}] | AEOrGroupTargetCount = [{}]'", GetCleanName(), GetDefaultSpellTypeIdlePriority(i, GetClass(), bot_stance), GetDefaultSpellTypeEngagedPriority(i, GetClass(), bot_stance), GetDefaultSpellTypePursuePriority(i, GetClass(), bot_stance), GetDefaultSpellTypeAEOrGroupTargetCount(i, bot_stance));
LogBotSettingsDetail("{} says, 'IdlePriority = [{}] | EngagedPriority = [{}] | PursuePriority = [{}] | ae_or_group_target_count = [{}]'", GetCleanName(), GetDefaultSpellTypeIdlePriority(i, GetClass(), bot_stance), GetDefaultSpellTypeEngagedPriority(i, GetClass(), bot_stance), GetDefaultSpellTypePursuePriority(i, GetClass(), bot_stance), GetDefaultSpellTypeAEOrGroupTargetCount(i, bot_stance));
}
}
@@ -10565,11 +10580,11 @@ BotSpell Bot::GetSpellByHealType(uint16 spell_type, Mob* tar) {
uint16 Bot::GetSpellTypePriority(uint16 spell_type, uint8 priority_type) {
switch (priority_type) {
case BotPriorityCategories::Idle:
return m_bot_spell_settings[spell_type].idlePriority;
return m_bot_spell_settings[spell_type].idle_priority;
case BotPriorityCategories::Engaged:
return m_bot_spell_settings[spell_type].engagedPriority;
return m_bot_spell_settings[spell_type].engaged_priority;
case BotPriorityCategories::Pursue:
return m_bot_spell_settings[spell_type].pursuePriority;
return m_bot_spell_settings[spell_type].pursue_priority;
default:
return 0;
}
@@ -10963,13 +10978,13 @@ uint16 Bot::GetDefaultSpellTypeAEOrGroupTargetCount(uint16 spell_type, uint8 sta
void Bot::SetSpellTypePriority(uint16 spell_type, uint8 priority_type, uint16 priority) {
switch (priority_type) {
case BotPriorityCategories::Idle:
m_bot_spell_settings[spell_type].idlePriority = priority;
m_bot_spell_settings[spell_type].idle_priority = priority;
break;
case BotPriorityCategories::Engaged:
m_bot_spell_settings[spell_type].engagedPriority = priority;
m_bot_spell_settings[spell_type].engaged_priority = priority;
break;
case BotPriorityCategories::Pursue:
m_bot_spell_settings[spell_type].pursuePriority = priority;
m_bot_spell_settings[spell_type].pursue_priority = priority;
break;
default:
return;
@@ -10977,31 +10992,31 @@ void Bot::SetSpellTypePriority(uint16 spell_type, uint8 priority_type, uint16 pr
}
void Bot::SetSpellTypeResistLimit(uint16 spell_type, uint16 resist_limit) {
m_bot_spell_settings[spell_type].resistLimit = resist_limit;
m_bot_spell_settings[spell_type].resist_limit = resist_limit;
}
void Bot::SetSpellTypeAggroCheck(uint16 spell_type, bool aggro_check) {
m_bot_spell_settings[spell_type].aggroCheck = aggro_check;
m_bot_spell_settings[spell_type].aggro_check = aggro_check;
}
void Bot::SetSpellTypeMinManaLimit(uint16 spell_type, uint8 mana_limit) {
m_bot_spell_settings[spell_type].minManaPct = mana_limit;
m_bot_spell_settings[spell_type].min_mana_pct = mana_limit;
}
void Bot::SetSpellTypeMaxManaLimit(uint16 spell_type, uint8 mana_limit) {
m_bot_spell_settings[spell_type].maxManaPct = mana_limit;
m_bot_spell_settings[spell_type].max_mana_pct = mana_limit;
}
void Bot::SetSpellTypeMinHPLimit(uint16 spell_type, uint8 hp_limit) {
m_bot_spell_settings[spell_type].minHPPct = hp_limit;
m_bot_spell_settings[spell_type].min_hp_pct = hp_limit;
}
void Bot::SetSpellTypeMaxHPLimit(uint16 spell_type, uint8 hp_limit) {
m_bot_spell_settings[spell_type].maxHPPct = hp_limit;
m_bot_spell_settings[spell_type].max_hp_pct = hp_limit;
}
void Bot::SetSpellTypeAEOrGroupTargetCount(uint16 spell_type, uint16 target_count) {
m_bot_spell_settings[spell_type].AEOrGroupTargetCount = target_count;
m_bot_spell_settings[spell_type].ae_or_group_target_count = target_count;
}
std::list<BotSpellTypeOrder> Bot::GetSpellTypesPrioritized(uint8 priority_type) {
+7 -7
View File
@@ -581,19 +581,19 @@ public:
int GetSetting(uint16 setting_category, uint16 setting_type);
uint16 GetSpellTypePriority(uint16 spell_type, uint8 priority_type);
void SetSpellTypePriority(uint16 spell_type, uint8 priority_type, uint16 priority);
inline uint16 GetSpellTypeResistLimit(uint16 spell_type) const { return m_bot_spell_settings[spell_type].resistLimit; }
inline uint16 GetSpellTypeResistLimit(uint16 spell_type) const { return m_bot_spell_settings[spell_type].resist_limit; }
void SetSpellTypeResistLimit(uint16 spell_type, uint16 resist_limit);
inline bool GetSpellTypeAggroCheck(uint16 spell_type) const { return m_bot_spell_settings[spell_type].aggroCheck; }
inline bool GetSpellTypeAggroCheck(uint16 spell_type) const { return m_bot_spell_settings[spell_type].aggro_check; }
void SetSpellTypeAggroCheck(uint16 spell_type, bool aggro_check);
inline uint8 GetSpellTypeMinManaLimit(uint16 spell_type) const { return m_bot_spell_settings[spell_type].minManaPct; }
inline uint8 GetSpellTypeMaxManaLimit(uint16 spell_type) const { return m_bot_spell_settings[spell_type].maxManaPct; }
inline uint8 GetSpellTypeMinManaLimit(uint16 spell_type) const { return m_bot_spell_settings[spell_type].min_mana_pct; }
inline uint8 GetSpellTypeMaxManaLimit(uint16 spell_type) const { return m_bot_spell_settings[spell_type].max_mana_pct; }
void SetSpellTypeMinManaLimit(uint16 spell_type, uint8 mana_limit);
void SetSpellTypeMaxManaLimit(uint16 spell_type, uint8 mana_limit);
inline uint8 GetSpellTypeMinHPLimit(uint16 spell_type) const { return m_bot_spell_settings[spell_type].minHPPct; }
inline uint8 GetSpellTypeMaxHPLimit(uint16 spell_type) const { return m_bot_spell_settings[spell_type].maxHPPct; }
inline uint8 GetSpellTypeMinHPLimit(uint16 spell_type) const { return m_bot_spell_settings[spell_type].min_hp_pct; }
inline uint8 GetSpellTypeMaxHPLimit(uint16 spell_type) const { return m_bot_spell_settings[spell_type].max_hp_pct; }
void SetSpellTypeMinHPLimit(uint16 spell_type, uint8 hp_limit);
void SetSpellTypeMaxHPLimit(uint16 spell_type, uint8 hp_limit);
inline uint16 GetSpellTypeAEOrGroupTargetCount(uint16 spell_type) const { return m_bot_spell_settings[spell_type].AEOrGroupTargetCount; }
inline uint16 GetSpellTypeAEOrGroupTargetCount(uint16 spell_type) const { return m_bot_spell_settings[spell_type].ae_or_group_target_count; }
void SetSpellTypeAEOrGroupTargetCount(uint16 spell_type, uint16 target_count);
bool BotPassiveCheck();
+9 -9
View File
@@ -230,18 +230,18 @@ void Client::LoadDefaultBotSettings() {
for (uint16 i = BotSpellTypes::START; i <= BotSpellTypes::END; ++i) {
BotSpellSettings t;
t.spellType = i;
t.shortName = GetSpellTypeShortNameByID(i);
t.name = GetSpellTypeNameByID(i);
t.hold = GetDefaultSpellHold(i);
t.delay = GetDefaultSpellDelay(i);
t.minThreshold = GetDefaultSpellMinThreshold(i);
t.maxThreshold = GetDefaultSpellMaxThreshold(i);
t.recastTimer.Start();
t.spell_type = i;
t.short_name = GetSpellTypeShortNameByID(i);
t.name = GetSpellTypeNameByID(i);
t.hold = GetDefaultSpellHold(i);
t.delay = GetDefaultSpellDelay(i);
t.min_threshold = GetDefaultSpellMinThreshold(i);
t.max_threshold = GetDefaultSpellMaxThreshold(i);
t.recast_timer.Start();
m_bot_spell_settings.push_back(t);
LogBotSettingsDetail("{} says, 'Setting defaults for {} ({}) [#{}]'", GetCleanName(), t.name, t.shortName, t.spellType);
LogBotSettingsDetail("{} says, 'Setting defaults for {} ({}) [#{}]'", GetCleanName(), t.name, t.short_name, t.spell_type);
LogBotSettingsDetail("{} says, 'Hold = [{}] | Delay = [{}ms] | MinThreshold = [{}\%] | MaxThreshold = [{}\%]'", GetCleanName(), GetDefaultSpellHold(i), GetDefaultSpellDelay(i), GetDefaultSpellMinThreshold(i), GetDefaultSpellMaxThreshold(i));
}
}
+22 -22
View File
@@ -94,24 +94,24 @@ struct AppearanceStruct {
};
struct BotSpellSettings {
uint16 spellType; // type ID of bot category
std::string shortName; // type short name of bot category
std::string name; // type name of bot category
bool hold; // 0 = allow spell type, 1 = hold spell type
uint16 delay; // delay between casts of spell type, 1ms-60,000ms
uint8 minThreshold; // minimum target health threshold to allow casting of spell type
uint8 maxThreshold; // maximum target health threshold to allow casting of spell type
uint16 resistLimit; // resist limit to skip spell type
bool aggroCheck; // whether or not to check for possible aggro before casting
uint8 minManaPct; // lower mana percentage limit to allow spell cast
uint8 maxManaPct; // upper mana percentage limit to allow spell cast
uint8 minHPPct; // lower HP percentage limit to allow spell cast
uint8 maxHPPct; // upper HP percentage limit to allow spell cast
uint16 idlePriority; // idle priority of the spell type
uint16 engagedPriority; // engaged priority of the spell type
uint16 pursuePriority; // pursue priority of the spell type
uint16 AEOrGroupTargetCount; // require target count to cast an AE or Group spell type
Timer recastTimer; // recast timer based off delay
uint16 spell_type; // type ID of bot category
std::string short_name; // type short name of bot category
std::string name; // type name of bot category
bool hold; // 0 = allow spell type, 1 = hold spell type
uint16 delay; // delay between casts of spell type, 1ms-60,000ms
uint8 min_threshold; // minimum target health threshold to allow casting of spell type
uint8 max_threshold; // maximum target health threshold to allow casting of spell type
uint16 resist_limit; // resist limit to skip spell type
bool aggro_check; // whether or not to check for possible aggro before casting
uint8 min_mana_pct; // lower mana percentage limit to allow spell cast
uint8 max_mana_pct; // upper mana percentage limit to allow spell cast
uint8 min_hp_pct; // lower HP percentage limit to allow spell cast
uint8 max_hp_pct; // upper HP percentage limit to allow spell cast
uint16 idle_priority; // idle priority of the spell type
uint16 engaged_priority; // engaged priority of the spell type
uint16 pursue_priority; // pursue priority of the spell type
uint16 ae_or_group_target_count; // require target count to cast an AE or Group spell type
Timer recast_timer; // recast timer based off delay
};
class DataBucketKey;
@@ -433,7 +433,7 @@ public:
bool PlotBotPositionAroundTarget(Mob* target, float& x_dest, float& y_dest, float& z_dest, float min_distance, float max_distance, bool behind_only = false, bool front_only = false, bool bypass_los = false);
virtual bool IsImmuneToBotSpell(uint16 spell_id, Mob* caster);
std::vector<Mob*> GatherSpellTargets(bool entireRaid = false, Mob* target = nullptr, bool no_clients = false, bool no_bots = false, bool no_pets = false);
inline bool SpellTypeRecastCheck(uint16 spellType) { return !m_bot_spell_settings[spellType].recastTimer.GetRemainingTime(); }
inline bool SpellTypeRecastCheck(uint16 spellType) { return !m_bot_spell_settings[spellType].recast_timer.GetRemainingTime(); }
uint16 GetSpellTypeIDByShortName(std::string spellType_string);
bool IsValidBotSpellCategory(uint8 setting_type);
std::string GetBotSpellCategoryName(uint8 setting_type);
@@ -456,12 +456,12 @@ public:
void SetSpellHold(uint16 spell_type, bool hold_status);
inline uint16 GetSpellDelay(uint16 spell_type) const { return m_bot_spell_settings[spell_type].delay; }
void SetSpellDelay(uint16 spell_type, uint16 delay_value);
inline uint8 GetSpellMinThreshold(uint16 spell_type) const { return m_bot_spell_settings[spell_type].minThreshold; }
inline uint8 GetSpellMinThreshold(uint16 spell_type) const { return m_bot_spell_settings[spell_type].min_threshold; }
void SetSpellMinThreshold(uint16 spell_type, uint8 threshold_value);
inline uint8 GetSpellMaxThreshold(uint16 spell_type) const { return m_bot_spell_settings[spell_type].maxThreshold; }
inline uint8 GetSpellMaxThreshold(uint16 spell_type) const { return m_bot_spell_settings[spell_type].max_threshold; }
void SetSpellMaxThreshold(uint16 spell_type, uint8 threshold_value);
inline uint16 GetSpellTypeRecastTimer(uint16 spell_type) { return m_bot_spell_settings[spell_type].recastTimer.GetRemainingTime(); }
inline uint16 GetSpellTypeRecastTimer(uint16 spell_type) { return m_bot_spell_settings[spell_type].recast_timer.GetRemainingTime(); }
void SetSpellTypeRecastTimer(uint16 spell_type, uint32 recast_time);
uint8 GetHPRatioForSpellType(uint16 spell_type, Mob* tar);
+5 -5
View File
@@ -589,26 +589,26 @@ void Mob::SetSpellDelay(uint16 spell_type, uint16 delay_value) {
}
void Mob::SetSpellMinThreshold(uint16 spell_type, uint8 threshold_value) {
m_bot_spell_settings[spell_type].minThreshold = threshold_value;
m_bot_spell_settings[spell_type].min_threshold = threshold_value;
}
void Mob::SetSpellMaxThreshold(uint16 spell_type, uint8 threshold_value) {
m_bot_spell_settings[spell_type].maxThreshold = threshold_value;
m_bot_spell_settings[spell_type].max_threshold = threshold_value;
}
void Mob::SetSpellTypeRecastTimer(uint16 spell_type, uint32 recast_time) {
m_bot_spell_settings[spell_type].recastTimer.Start(recast_time);
m_bot_spell_settings[spell_type].recast_timer.Start(recast_time);
}
void Mob::StartBotSpellTimers() {
for (uint16 i = BotSpellTypes::START; i <= BotSpellTypes::END; ++i) {
m_bot_spell_settings[i].recastTimer.Start();
m_bot_spell_settings[i].recast_timer.Start();
}
}
void Mob::DisableBotSpellTimers() {
for (uint16 i = BotSpellTypes::START; i <= BotSpellTypes::END; ++i) {
m_bot_spell_settings[i].recastTimer.Disable();
m_bot_spell_settings[i].recast_timer.Disable();
}
}