Move getnames for categories and settings to mob, rename hptomed/manatomed

This commit is contained in:
nytmyr
2024-12-17 23:03:42 -06:00
parent 8377797523
commit ffd92017e0
7 changed files with 132 additions and 120 deletions
+13 -89
View File
@@ -1787,7 +1787,7 @@ void Bot::SpellProcess() {
} }
void Bot::BotMeditate(bool isSitting) { void Bot::BotMeditate(bool isSitting) {
if (GetManaRatio() < GetManaWhenToMed() || (GetHPRatio() < GetHPWhenToMed() && GetLevel() < GetStopMeleeLevel())) { if (GetManaRatio() < GetSitManaPct() || (GetHPRatio() < GetSitHPPct() && GetLevel() < GetStopMeleeLevel())) {
if ((!IsEngaged() || (IsEngaged() && GetMedInCombat() && !HasTargetReflection())) && !isSitting) { if ((!IsEngaged() || (IsEngaged() && GetMedInCombat() && !HasTargetReflection())) && !isSitting) {
Sit(); Sit();
} }
@@ -10170,11 +10170,11 @@ void Bot::SetBotBaseSetting(uint16 botSetting, int settingValue) {
case BotBaseSettings::MedInCombat: case BotBaseSettings::MedInCombat:
SetMedInCombat(settingValue); SetMedInCombat(settingValue);
break; break;
case BotBaseSettings::HPWhenToMed: case BotBaseSettings::SitHPPct:
SetHPWhenToMed(settingValue); SetSitHPPct(settingValue);
break; break;
case BotBaseSettings::ManaWhenToMed: case BotBaseSettings::SitManaPct:
SetManaWhenToMed(settingValue); SetSitManaPct(settingValue);
break; break;
default: default:
break; break;
@@ -10219,12 +10219,12 @@ int Bot::GetBotBaseSetting(uint16 botSetting) {
case BotBaseSettings::MedInCombat: case BotBaseSettings::MedInCombat:
//LogBotSettingsDetail("Returning current GetMedInCombate of [{}] for [{}]", GetMaxMeleeRange(), GetCleanName()); //deleteme //LogBotSettingsDetail("Returning current GetMedInCombate of [{}] for [{}]", GetMaxMeleeRange(), GetCleanName()); //deleteme
return GetMedInCombat(); return GetMedInCombat();
case BotBaseSettings::HPWhenToMed: case BotBaseSettings::SitHPPct:
//LogBotSettingsDetail("Returning current GetHPWhenToMed of [{}] for [{}]", GetMaxMeleeRange(), GetCleanName()); //deleteme //LogBotSettingsDetail("Returning current GetSitHPPct of [{}] for [{}]", GetMaxMeleeRange(), GetCleanName()); //deleteme
return GetHPWhenToMed(); return GetSitHPPct();
case BotBaseSettings::ManaWhenToMed: case BotBaseSettings::SitManaPct:
//LogBotSettingsDetail("Returning current GetManaWhenToMed of [{}] for [{}]", GetMaxMeleeRange(), GetCleanName()); //deleteme //LogBotSettingsDetail("Returning current GetSitManaPct of [{}] for [{}]", GetMaxMeleeRange(), GetCleanName()); //deleteme
return GetManaWhenToMed(); return GetSitManaPct();
default: default:
return true; return true;
} }
@@ -10274,8 +10274,8 @@ int Bot::GetDefaultBotBaseSetting(uint16 botSetting, uint8 stance) {
} }
return false; return false;
case BotBaseSettings::HPWhenToMed: case BotBaseSettings::SitHPPct:
case BotBaseSettings::ManaWhenToMed: case BotBaseSettings::SitManaPct:
return 80; return 80;
case BotBaseSettings::EnforceSpellSettings: case BotBaseSettings::EnforceSpellSettings:
case BotBaseSettings::RangedSetting: case BotBaseSettings::RangedSetting:
@@ -10883,82 +10883,6 @@ void Bot::SetSpellTypeAEOrGroupTargetCount(uint16 spellType, uint16 targetCount)
_spellSettings[spellType].AEOrGroupTargetCount = targetCount; _spellSettings[spellType].AEOrGroupTargetCount = targetCount;
} }
std::string Bot::GetBotSettingCategoryName(uint8 setting_type) {
switch (setting_type) {
case BotBaseSettings::ExpansionBitmask:
return "ExpansionBitmask";
case BotBaseSettings::ShowHelm:
return "ShowHelm";
case BotBaseSettings::FollowDistance:
return "FollowDistance";
case BotBaseSettings::StopMeleeLevel:
return "StopMeleeLevel";
case BotBaseSettings::EnforceSpellSettings:
return "EnforceSpellSettings";
case BotBaseSettings::RangedSetting:
return "RangedSetting";
case BotBaseSettings::PetSetTypeSetting:
return "PetSetTypeSetting";
case BotBaseSettings::BehindMob:
return "BehindMob";
case BotBaseSettings::DistanceRanged:
return "DistanceRanged";
case BotBaseSettings::IllusionBlock:
return "IllusionBlock";
case BotBaseSettings::MaxMeleeRange:
return "MaxMeleeRange";
case BotBaseSettings::MedInCombat:
return "MedInCombat";
case BotBaseSettings::HPWhenToMed:
return "HPWhenToMed";
case BotBaseSettings::ManaWhenToMed:
return "ManaWhenToMed";
default:
return "Null";
}
return "Null";
}
std::string Bot::GetBotSpellCategoryName(uint8 setting_type) {
switch (setting_type) {
case BotSettingCategories::BaseSetting:
return "BaseSetting";
case BotSettingCategories::SpellHold:
return "SpellHold";
case BotSettingCategories::SpellDelay:
return "SpellDelay";
case BotSettingCategories::SpellMinThreshold:
return "SpellMinThreshold";
case BotSettingCategories::SpellMaxThreshold:
return "SpellMaxThreshold";
case BotSettingCategories::SpellTypeAggroCheck:
return "SpellTypeAggroCheck";
case BotSettingCategories::SpellTypeMinManaPct:
return "SpellTypeMinManaPct";
case BotSettingCategories::SpellTypeMaxManaPct:
return "SpellTypeMaxManaPct";
case BotSettingCategories::SpellTypeMinHPPct:
return "SpellTypeMinHPPct";
case BotSettingCategories::SpellTypeMaxHPPct:
return "SpellTypeMaxHPPct";
case BotSettingCategories::SpellTypeIdlePriority:
return "SpellTypeIdlePriority";
case BotSettingCategories::SpellTypeEngagedPriority:
return "SpellTypeEngagedPriority";
case BotSettingCategories::SpellTypePursuePriority:
return "SpellTypePursuePriority";
case BotSettingCategories::SpellTypeAEOrGroupTargetCount:
return "SpellTypeAEOrGroupTargetCount";
case BotSettingCategories::SpellTypeRecastDelay:
return "SpellTypeRecastDelay";
default:
return "Null";
}
return "Null";
}
std::list<BotSpellTypeOrder> Bot::GetSpellTypesPrioritized(uint8 priorityType) { std::list<BotSpellTypeOrder> Bot::GetSpellTypesPrioritized(uint8 priorityType) {
std::list<BotSpellTypeOrder> castOrder; std::list<BotSpellTypeOrder> castOrder;
std::list<BotSpellTypeOrder> tempCastOrder; std::list<BotSpellTypeOrder> tempCastOrder;
+10 -12
View File
@@ -139,12 +139,12 @@ namespace BotBaseSettings {
constexpr uint16 IllusionBlock = 9; constexpr uint16 IllusionBlock = 9;
constexpr uint16 MaxMeleeRange = 10; constexpr uint16 MaxMeleeRange = 10;
constexpr uint16 MedInCombat = 11; constexpr uint16 MedInCombat = 11;
constexpr uint16 HPWhenToMed = 12; constexpr uint16 SitHPPct = 12;
constexpr uint16 ManaWhenToMed = 13; constexpr uint16 SitManaPct = 13;
constexpr uint16 START_ALL = ExpansionBitmask; constexpr uint16 START_ALL = ExpansionBitmask;
constexpr uint16 START = BotBaseSettings::ShowHelm; // Everything above this cannot be copied, changed or viewed by players constexpr uint16 START = BotBaseSettings::ShowHelm; // Everything above this cannot be copied, changed or viewed by players
constexpr uint16 END = BotBaseSettings::ManaWhenToMed; // Increment as needed constexpr uint16 END = BotBaseSettings::SitManaPct; // Increment as needed
}; };
namespace CommandedSubTypes { namespace CommandedSubTypes {
@@ -471,6 +471,7 @@ public:
void CopySettings(Bot* to, uint8 settingType, uint16 spellType = UINT16_MAX); void CopySettings(Bot* to, uint8 settingType, uint16 spellType = UINT16_MAX);
void CopyBotSpellSettings(Bot* to); void CopyBotSpellSettings(Bot* to);
void ResetBotSpellSettings(); void ResetBotSpellSettings();
void CopyBotBlockedBuffs(Bot* to);
int GetBotBaseSetting(uint16 botSetting); int GetBotBaseSetting(uint16 botSetting);
int GetDefaultBotBaseSetting(uint16 botSetting, uint8 stance = Stance::Balanced); int GetDefaultBotBaseSetting(uint16 botSetting, uint8 stance = Stance::Balanced);
void SetBotBaseSetting(uint16 botSetting, int settingValue); void SetBotBaseSetting(uint16 botSetting, int settingValue);
@@ -485,9 +486,6 @@ public:
void SetBotBlockedBuff(uint16 spell_id, bool block); void SetBotBlockedBuff(uint16 spell_id, bool block);
void SetBotBlockedPetBuff(uint16 spell_id, bool block); void SetBotBlockedPetBuff(uint16 spell_id, bool block);
std::string GetBotSpellCategoryName(uint8 setting_type);
std::string GetBotSettingCategoryName(uint8 setting_type);
int GetDefaultSetting(uint16 settingCategory, uint16 settingType, uint8 stance = Stance::Balanced); int GetDefaultSetting(uint16 settingCategory, uint16 settingType, uint8 stance = Stance::Balanced);
uint16 GetDefaultSpellTypePriority(uint16 spellType, uint8 priorityType, uint8 botClass, uint8 stance = Stance::Balanced); uint16 GetDefaultSpellTypePriority(uint16 spellType, uint8 priorityType, uint8 botClass, uint8 stance = Stance::Balanced);
uint16 GetDefaultSpellTypeIdlePriority(uint16 spellType, uint8 botClass, uint8 stance = Stance::Balanced); uint16 GetDefaultSpellTypeIdlePriority(uint16 spellType, uint8 botClass, uint8 stance = Stance::Balanced);
@@ -532,10 +530,10 @@ public:
void SetBotDistanceRanged(uint32 distanceRanged) { _distanceRanged = distanceRanged; } void SetBotDistanceRanged(uint32 distanceRanged) { _distanceRanged = distanceRanged; }
bool GetMedInCombat() const { return _medInCombat; } bool GetMedInCombat() const { return _medInCombat; }
void SetMedInCombat(bool value) { _medInCombat = value; } void SetMedInCombat(bool value) { _medInCombat = value; }
uint8 GetHPWhenToMed() const { return _HPWhenToMed; } uint8 GetSitHPPct() const { return _SitHPPct; }
void SetHPWhenToMed(uint8 value) { _HPWhenToMed = value; } void SetSitHPPct(uint8 value) { _SitHPPct = value; }
uint8 GetManaWhenToMed() const { return _ManaWhenToMed; } uint8 GetSitManaPct() const { return _SitManaPct; }
void SetManaWhenToMed(uint8 value) { _ManaWhenToMed = value; } void SetSitManaPct(uint8 value) { _SitManaPct = value; }
void SetHasLoS(bool hasLoS) { _hasLoS = hasLoS; } void SetHasLoS(bool hasLoS) { _hasLoS = hasLoS; }
bool HasLoS() const { return _hasLoS; } bool HasLoS() const { return _hasLoS; }
@@ -1089,8 +1087,8 @@ private:
bool _behindMobStatus; bool _behindMobStatus;
bool _maxMeleeRangeStatus; bool _maxMeleeRangeStatus;
bool _medInCombat; bool _medInCombat;
uint8 _HPWhenToMed; uint8 _SitHPPct;
uint8 _ManaWhenToMed; uint8 _SitManaPct;
uint16 _castedSpellType; uint16 _castedSpellType;
bool _hasLoS; bool _hasLoS;
bool _commandedSpell; bool _commandedSpell;
+3 -3
View File
@@ -141,12 +141,12 @@ void bot_command_sit_hp_percent(Client* c, const Seperator* sep)
fmt::format( fmt::format(
"{} says, 'I sit in combat whem at or below [{}%%] HP.'", "{} says, 'I sit in combat whem at or below [{}%%] HP.'",
my_bot->GetCleanName(), my_bot->GetCleanName(),
my_bot->GetHPWhenToMed() my_bot->GetSitHPPct()
).c_str() ).c_str()
); );
} }
else { else {
my_bot->SetHPWhenToMed(typeValue); my_bot->SetSitHPPct(typeValue);
++success_count; ++success_count;
} }
} }
@@ -157,7 +157,7 @@ void bot_command_sit_hp_percent(Client* c, const Seperator* sep)
fmt::format( fmt::format(
"{} says, 'I will now sit in combat whem at or below [{}%%] HP.'", "{} says, 'I will now sit in combat whem at or below [{}%%] HP.'",
first_found->GetCleanName(), first_found->GetCleanName(),
first_found->GetHPWhenToMed() first_found->GetSitHPPct()
).c_str() ).c_str()
); );
} }
+3 -3
View File
@@ -141,12 +141,12 @@ void bot_command_sit_mana_percent(Client* c, const Seperator* sep)
fmt::format( fmt::format(
"{} says, 'I sit in combat whem at or below [{}%%] mana.'", "{} says, 'I sit in combat whem at or below [{}%%] mana.'",
my_bot->GetCleanName(), my_bot->GetCleanName(),
my_bot->GetManaWhenToMed() my_bot->GetSitManaPct()
).c_str() ).c_str()
); );
} }
else { else {
my_bot->SetManaWhenToMed(typeValue); my_bot->SetSitManaPct(typeValue);
++success_count; ++success_count;
} }
} }
@@ -157,7 +157,7 @@ void bot_command_sit_mana_percent(Client* c, const Seperator* sep)
fmt::format( fmt::format(
"{} says, 'I will now sit in combat whem at or below [{}%%] mana.'", "{} says, 'I will now sit in combat whem at or below [{}%%] mana.'",
first_found->GetCleanName(), first_found->GetCleanName(),
first_found->GetManaWhenToMed() first_found->GetSitManaPct()
).c_str() ).c_str()
); );
} }
+13 -13
View File
@@ -2238,7 +2238,7 @@ bool BotDatabase::LoadBotSettings(Mob* m)
if (e.setting_type == BotSettingCategories::BaseSetting) { if (e.setting_type == BotSettingCategories::BaseSetting) {
LogBotSettings("[{}] says, 'Loading {} [{}] - setting to [{}]." LogBotSettings("[{}] says, 'Loading {} [{}] - setting to [{}]."
, m->GetCleanName() , m->GetCleanName()
, m->CastToBot()->GetBotSettingCategoryName(e.setting_type) , m->GetBotSettingCategoryName(e.setting_type)
, e.setting_type , e.setting_type
, e.value , e.value
); //deleteme ); //deleteme
@@ -2246,7 +2246,7 @@ bool BotDatabase::LoadBotSettings(Mob* m)
else { else {
LogBotSettings("[{}] says, 'Loading {} [{}], {} [{}] - setting to [{}]." LogBotSettings("[{}] says, 'Loading {} [{}], {} [{}] - setting to [{}]."
, m->GetCleanName() , m->GetCleanName()
, m->CastToBot()->GetBotSpellCategoryName(e.setting_type) , m->GetBotSpellCategoryName(e.setting_type)
, e.setting_type , e.setting_type
, m->GetSpellTypeNameByID(e.setting_id) , m->GetSpellTypeNameByID(e.setting_id)
, e.setting_id , e.setting_id
@@ -2304,13 +2304,13 @@ bool BotDatabase::SaveBotSettings(Mob* m)
.setting_id = static_cast<uint16_t>(i), .setting_id = static_cast<uint16_t>(i),
.setting_type = static_cast<uint8_t>(BotSettingCategories::BaseSetting), .setting_type = static_cast<uint8_t>(BotSettingCategories::BaseSetting),
.value = static_cast<int32_t>(m->CastToBot()->GetBotBaseSetting(i)), .value = static_cast<int32_t>(m->CastToBot()->GetBotBaseSetting(i)),
.category_name = m->CastToBot()->GetBotSpellCategoryName(BotSettingCategories::BaseSetting), .category_name = m->GetBotSpellCategoryName(BotSettingCategories::BaseSetting),
.setting_name = m->CastToBot()->GetBotSettingCategoryName(i) .setting_name = m->GetBotSettingCategoryName(i)
}; };
v.emplace_back(e); v.emplace_back(e);
LogBotSettings("{} says, 'Saving {} [{}] - set to [{}] default [{}].'", m->GetCleanName(), m->CastToBot()->GetBotSettingCategoryName(i), i, e.value, m->CastToBot()->GetDefaultBotBaseSetting(i)); //deleteme LogBotSettings("{} says, 'Saving {} [{}] - set to [{}] default [{}].'", m->GetCleanName(), m->GetBotSettingCategoryName(i), i, e.value, m->CastToBot()->GetDefaultBotBaseSetting(i)); //deleteme
} }
} }
@@ -2324,13 +2324,13 @@ bool BotDatabase::SaveBotSettings(Mob* m)
.setting_id = static_cast<uint16_t>(x), .setting_id = static_cast<uint16_t>(x),
.setting_type = static_cast<uint8_t>(i), .setting_type = static_cast<uint8_t>(i),
.value = m->CastToBot()->GetSetting(i, x), .value = m->CastToBot()->GetSetting(i, x),
.category_name = m->CastToBot()->GetBotSpellCategoryName(i), .category_name = m->GetBotSpellCategoryName(i),
.setting_name = m->CastToBot()->GetSpellTypeNameByID(x) .setting_name = m->CastToBot()->GetSpellTypeNameByID(x)
}; };
v.emplace_back(e); v.emplace_back(e);
LogBotSettings("{} says, 'Saving {} {} [{}] - set to [{}] default [{}].'", m->GetCleanName(), m->CastToBot()->GetBotSpellCategoryName(i), m->GetSpellTypeNameByID(x), x, e.value, m->CastToBot()->GetDefaultSetting(i, x, botStance)); //deleteme LogBotSettings("{} says, 'Saving {} {} [{}] - set to [{}] default [{}].'", m->GetCleanName(), m->GetBotSpellCategoryName(i), m->GetSpellTypeNameByID(x), x, e.value, m->CastToBot()->GetDefaultSetting(i, x, botStance)); //deleteme
} }
} }
} }
@@ -2345,18 +2345,18 @@ bool BotDatabase::SaveBotSettings(Mob* m)
.setting_id = static_cast<uint16_t>(BotBaseSettings::IllusionBlock), .setting_id = static_cast<uint16_t>(BotBaseSettings::IllusionBlock),
.setting_type = static_cast<uint8_t>(BotSettingCategories::BaseSetting), .setting_type = static_cast<uint8_t>(BotSettingCategories::BaseSetting),
.value = m->GetIllusionBlock(), .value = m->GetIllusionBlock(),
.category_name = m->CastToBot()->GetBotSpellCategoryName(BotSettingCategories::BaseSetting), .category_name = m->GetBotSpellCategoryName(BotSettingCategories::BaseSetting),
.setting_name = m->CastToBot()->GetBotSettingCategoryName(BotBaseSettings::IllusionBlock) .setting_name = m->GetBotSettingCategoryName(BotBaseSettings::IllusionBlock)
}; };
v.emplace_back(e); v.emplace_back(e);
LogBotSettings("{} says, 'Saving {} [{}] - set to [{}] default [{}].'", m->GetCleanName(), m->CastToBot()->GetBotSettingCategoryName(BotBaseSettings::IllusionBlock), BotBaseSettings::IllusionBlock, e.value, m->GetIllusionBlock()); //deleteme LogBotSettings("{} says, 'Saving {} [{}] - set to [{}] default [{}].'", m->GetCleanName(), m->GetBotSettingCategoryName(BotBaseSettings::IllusionBlock), BotBaseSettings::IllusionBlock, e.value, m->GetIllusionBlock()); //deleteme
} }
for (uint16 i = BotSettingCategories::START_CLIENT; i <= BotSettingCategories::END_CLIENT; ++i) { for (uint16 i = BotSettingCategories::START_CLIENT; i <= BotSettingCategories::END_CLIENT; ++i) {
for (uint16 x = BotSpellTypes::START; x <= BotSpellTypes::END; ++x) { for (uint16 x = BotSpellTypes::START; x <= BotSpellTypes::END; ++x) {
LogBotSettings("{} says, 'Checking {} {} [{}] - set to [{}] default [{}].'", m->GetCleanName(), m->CastToBot()->GetBotSpellCategoryName(i), m->CastToBot()->GetSpellTypeNameByID(x), x, m->CastToClient()->GetBotSetting(i, x), m->CastToClient()->GetDefaultBotSettings(i, x)); //deleteme LogBotSettings("{} says, 'Checking {} {} [{}] - set to [{}] default [{}].'", m->GetCleanName(), m->GetBotSpellCategoryName(i), m->CastToBot()->GetSpellTypeNameByID(x), x, m->CastToClient()->GetBotSetting(i, x), m->CastToClient()->GetDefaultBotSettings(i, x)); //deleteme
if (m->CastToClient()->GetBotSetting(i, x) != m->CastToClient()->GetDefaultBotSettings(i, x)) { if (m->CastToClient()->GetBotSetting(i, x) != m->CastToClient()->GetDefaultBotSettings(i, x)) {
auto e = BotSettingsRepository::BotSettings{ auto e = BotSettingsRepository::BotSettings{
.char_id = charID, .char_id = charID,
@@ -2365,13 +2365,13 @@ bool BotDatabase::SaveBotSettings(Mob* m)
.setting_id = static_cast<uint16_t>(x), .setting_id = static_cast<uint16_t>(x),
.setting_type = static_cast<uint8_t>(i), .setting_type = static_cast<uint8_t>(i),
.value = m->CastToClient()->GetBotSetting(i, x), .value = m->CastToClient()->GetBotSetting(i, x),
.category_name = m->CastToBot()->GetBotSpellCategoryName(i), .category_name = m->GetBotSpellCategoryName(i),
.setting_name = m->CastToBot()->GetSpellTypeNameByID(x) .setting_name = m->CastToBot()->GetSpellTypeNameByID(x)
}; };
v.emplace_back(e); v.emplace_back(e);
LogBotSettings("{} says, 'Saving {} {} [{}] - set to [{}] default [{}].'", m->GetCleanName(), m->CastToBot()->GetBotSpellCategoryName(i), m->CastToBot()->GetSpellTypeNameByID(x), x, e.value, m->CastToClient()->GetDefaultBotSettings(i, x)); //deleteme LogBotSettings("{} says, 'Saving {} {} [{}] - set to [{}] default [{}].'", m->GetCleanName(), m->GetBotSpellCategoryName(i), m->CastToBot()->GetSpellTypeNameByID(x), x, e.value, m->CastToClient()->GetDefaultBotSettings(i, x)); //deleteme
} }
} }
} }
+87
View File
@@ -8712,6 +8712,93 @@ uint16 Mob::GetSpellTypeIDByShortName(std::string spellTypeString) {
return UINT16_MAX; return UINT16_MAX;
} }
std::string Mob::GetBotSpellCategoryName(uint8 setting_type) {
switch (setting_type) {
case BotSettingCategories::BaseSetting:
return "BaseSetting";
case BotSettingCategories::SpellHold:
return "SpellHolds";
case BotSettingCategories::SpellDelay:
return "SpellDelays";
case BotSettingCategories::SpellMinThreshold:
return "SpellMinThresholds";
case BotSettingCategories::SpellMaxThreshold:
return "SpellMaxThresholds";
case BotSettingCategories::SpellTypeAggroCheck:
return "SpellAggroChecks";
case BotSettingCategories::SpellTypeMinManaPct:
return "SpellMinManaPct";
case BotSettingCategories::SpellTypeMaxManaPct:
return "SpellMaxManaPct";
case BotSettingCategories::SpellTypeMinHPPct:
return "SpellMinHPPct";
case BotSettingCategories::SpellTypeMaxHPPct:
return "SpellMaxHPPct";
case BotSettingCategories::SpellTypeIdlePriority:
return "SpellIdlePriority";
case BotSettingCategories::SpellTypeEngagedPriority:
return "SpellEngagedPriority";
case BotSettingCategories::SpellTypePursuePriority:
return "SpellPursuePriority";
case BotSettingCategories::SpellTypeAEOrGroupTargetCount:
return "SpellTargetCounts";
case BotSettingCategories::SpellTypeRecastDelay:
return "SpellRecastDelay";
default:
return "Null";
}
return "Null";
}
std::string Mob::GetBotSettingCategoryName(uint8 setting_type) {
switch (setting_type) {
case BotBaseSettings::ExpansionBitmask:
return "ExpansionBitmask";
case BotBaseSettings::ShowHelm:
return "ShowHelm";
case BotBaseSettings::FollowDistance:
return "FollowDistance";
case BotBaseSettings::StopMeleeLevel:
return "StopMeleeLevel";
case BotBaseSettings::EnforceSpellSettings:
return "EnforceSpellSettings";
case BotBaseSettings::RangedSetting:
return "RangedSetting";
case BotBaseSettings::PetSetTypeSetting:
return "PetSetTypeSetting";
case BotBaseSettings::BehindMob:
return "BehindMob";
case BotBaseSettings::DistanceRanged:
return "DistanceRanged";
case BotBaseSettings::IllusionBlock:
return "IllusionBlock";
case BotBaseSettings::MaxMeleeRange:
return "MaxMeleeRange";
case BotBaseSettings::MedInCombat:
return "MedInCombat";
case BotBaseSettings::SitHPPct:
return "SitHPPct";
case BotBaseSettings::SitManaPct:
return "SitManaPct";
default:
return "Null";
}
return "Null";
}
uint16 Mob::GetBaseSettingIDByShortName(std::string settingString) {
for (int i = BotSettingCategories::START; i <= BotSettingCategories::END; ++i) {
if (!Strings::ToLower(settingString).compare(GetBotSettingCategoryName(i))) {
return i;
}
}
return UINT16_MAX;
}
std::string Mob::GetSpellTypeNameByID(uint16 spellType) { std::string Mob::GetSpellTypeNameByID(uint16 spellType) {
std::string spellTypeName = "null"; std::string spellTypeName = "null";
+3
View File
@@ -434,6 +434,9 @@ public:
uint16 GetSpellTypeIDByShortName(std::string spellTypeString); uint16 GetSpellTypeIDByShortName(std::string spellTypeString);
std::string GetBotSpellCategoryName(uint8 setting_type);
std::string GetBotSettingCategoryName(uint8 setting_type);
uint16 GetBaseSettingIDByShortName(std::string settingString);
std::string GetSpellTypeNameByID(uint16 spellType); std::string GetSpellTypeNameByID(uint16 spellType);
std::string GetSpellTypeShortNameByID(uint16 spellType); std::string GetSpellTypeShortNameByID(uint16 spellType);
std::string GetSubTypeNameByID(uint16 subType); std::string GetSubTypeNameByID(uint16 subType);