mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-26 19:47:16 +00:00
add GetBotSpellCategoryIDByShortName and CopyBotBlockedPetBuffs, update ^defaultsettings command
This commit is contained in:
@@ -11734,6 +11734,10 @@ void Bot::CopySettings(Bot* to, uint8 settingType, uint16 spellType) {
|
|||||||
|
|
||||||
void Bot::CopyBotSpellSettings(Bot* to)
|
void Bot::CopyBotSpellSettings(Bot* to)
|
||||||
{
|
{
|
||||||
|
if (!to) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
to->ResetBotSpellSettings();
|
to->ResetBotSpellSettings();
|
||||||
to->bot_spell_settings.clear();
|
to->bot_spell_settings.clear();
|
||||||
|
|
||||||
@@ -11784,6 +11788,38 @@ void Bot::ResetBotSpellSettings()
|
|||||||
SetBotEnforceSpellSetting(false);
|
SetBotEnforceSpellSetting(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Bot::CopyBotBlockedBuffs(Bot* to) {
|
||||||
|
if (!to) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
to->ClearBotBlockedBuffs();
|
||||||
|
|
||||||
|
std::vector<BotBlockedBuffs_Struct> blockedBuffs = GetBotBlockedBuffs();
|
||||||
|
|
||||||
|
if (!blockedBuffs.empty()) {
|
||||||
|
for (auto& blocked_buff : blockedBuffs) {
|
||||||
|
to->SetBotBlockedBuff(blocked_buff.spell_id, blocked_buff.blocked);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Bot::CopyBotBlockedPetBuffs(Bot* to) {
|
||||||
|
if (!to) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
to->ClearBotBlockedBuffs();
|
||||||
|
|
||||||
|
std::vector<BotBlockedBuffs_Struct> blockedBuffs = GetBotBlockedBuffs();
|
||||||
|
|
||||||
|
if (!blockedBuffs.empty()) {
|
||||||
|
for (auto& blocked_buff : blockedBuffs) {
|
||||||
|
to->SetBotBlockedPetBuff(blocked_buff.spell_id, blocked_buff.blocked_pet);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool Bot::BotPassiveCheck() {
|
bool Bot::BotPassiveCheck() {
|
||||||
if (GetBotStance() == Stance::Passive) {
|
if (GetBotStance() == Stance::Passive) {
|
||||||
GetOwner()->Message(
|
GetOwner()->Message(
|
||||||
|
|||||||
@@ -472,6 +472,7 @@ public:
|
|||||||
void CopyBotSpellSettings(Bot* to);
|
void CopyBotSpellSettings(Bot* to);
|
||||||
void ResetBotSpellSettings();
|
void ResetBotSpellSettings();
|
||||||
void CopyBotBlockedBuffs(Bot* to);
|
void CopyBotBlockedBuffs(Bot* to);
|
||||||
|
void CopyBotBlockedPetBuffs(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);
|
||||||
|
|||||||
@@ -358,7 +358,7 @@ void bot_command_default_settings(Client* c, const Seperator* sep)
|
|||||||
}
|
}
|
||||||
else if (!strcasecmp(sep->arg[1], "targetcounts")) {
|
else if (!strcasecmp(sep->arg[1], "targetcounts")) {
|
||||||
if (spellType != UINT16_MAX) {
|
if (spellType != UINT16_MAX) {
|
||||||
myBot->SetSpellDelay(spellType, myBot->GetDefaultSpellDelay(spellType, botStance));
|
myBot->SetSpellTypeAEOrGroupTargetCount(spellType, myBot->GetDefaultSpellTypeAEOrGroupTargetCount(spellType, botStance));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
for (uint16 i = BotSpellTypes::START; i <= BotSpellTypes::END; ++i) {
|
for (uint16 i = BotSpellTypes::START; i <= BotSpellTypes::END; ++i) {
|
||||||
@@ -366,7 +366,7 @@ void bot_command_default_settings(Client* c, const Seperator* sep)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
output = "ae/group count settings";
|
output = "target count settings";
|
||||||
}
|
}
|
||||||
else if (!strcasecmp(sep->arg[1], "spellsettings")) {
|
else if (!strcasecmp(sep->arg[1], "spellsettings")) {
|
||||||
myBot->ResetBotSpellSettings();
|
myBot->ResetBotSpellSettings();
|
||||||
@@ -430,6 +430,9 @@ void bot_command_default_settings(Client* c, const Seperator* sep)
|
|||||||
};
|
};
|
||||||
|
|
||||||
myBot->ResetBotSpellSettings();
|
myBot->ResetBotSpellSettings();
|
||||||
|
myBot->ClearBotBlockedBuffs();
|
||||||
|
|
||||||
|
myBot->Save();
|
||||||
|
|
||||||
output = "settings";
|
output = "settings";
|
||||||
|
|
||||||
|
|||||||
+11
-2
@@ -8751,6 +8751,16 @@ std::string Mob::GetBotSpellCategoryName(uint8 setting_type) {
|
|||||||
return "Null";
|
return "Null";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint16 Mob::GetBotSpellCategoryIDByShortName(std::string settingString) {
|
||||||
|
for (int i = BotSettingCategories::START; i <= BotSettingCategories::END; ++i) {
|
||||||
|
if (!Strings::ToLower(settingString).compare(Strings::ToLower(GetBotSpellCategoryName(i)))) {
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return UINT16_MAX;
|
||||||
|
}
|
||||||
|
|
||||||
std::string Mob::GetBotSettingCategoryName(uint8 setting_type) {
|
std::string Mob::GetBotSettingCategoryName(uint8 setting_type) {
|
||||||
switch (setting_type) {
|
switch (setting_type) {
|
||||||
case BotBaseSettings::ExpansionBitmask:
|
case BotBaseSettings::ExpansionBitmask:
|
||||||
@@ -8789,9 +8799,8 @@ std::string Mob::GetBotSettingCategoryName(uint8 setting_type) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
uint16 Mob::GetBaseSettingIDByShortName(std::string settingString) {
|
uint16 Mob::GetBaseSettingIDByShortName(std::string settingString) {
|
||||||
|
|
||||||
for (int i = BotSettingCategories::START; i <= BotSettingCategories::END; ++i) {
|
for (int i = BotSettingCategories::START; i <= BotSettingCategories::END; ++i) {
|
||||||
if (!Strings::ToLower(settingString).compare(GetBotSettingCategoryName(i))) {
|
if (!Strings::ToLower(settingString).compare(Strings::ToLower(GetBotSettingCategoryName(i)))) {
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -435,6 +435,7 @@ public:
|
|||||||
uint16 GetSpellTypeIDByShortName(std::string spellTypeString);
|
uint16 GetSpellTypeIDByShortName(std::string spellTypeString);
|
||||||
|
|
||||||
std::string GetBotSpellCategoryName(uint8 setting_type);
|
std::string GetBotSpellCategoryName(uint8 setting_type);
|
||||||
|
uint16 GetBotSpellCategoryIDByShortName(std::string settingString);
|
||||||
std::string GetBotSettingCategoryName(uint8 setting_type);
|
std::string GetBotSettingCategoryName(uint8 setting_type);
|
||||||
uint16 GetBaseSettingIDByShortName(std::string settingString);
|
uint16 GetBaseSettingIDByShortName(std::string settingString);
|
||||||
std::string GetSpellTypeNameByID(uint16 spellType);
|
std::string GetSpellTypeNameByID(uint16 spellType);
|
||||||
|
|||||||
Reference in New Issue
Block a user