code cleanup 1

This commit is contained in:
nytmyr
2025-01-09 23:01:48 -06:00
parent 2fa32d1874
commit 40b676c320
8 changed files with 281 additions and 274 deletions
+48 -19
View File
@@ -9441,7 +9441,7 @@ bool Bot::CastChecks(uint16 spell_id, Mob* tar, uint16 spellType, bool doPrechec
if (chance && zone->random.Roll(chance)) { if (chance && zone->random.Roll(chance)) {
LogBotPreChecksDetail("{} says, 'Cancelling cast of {} due to focusFcMute.'", GetCleanName(), GetSpellName(spell_id)); LogBotPreChecksDetail("{} says, 'Cancelling cast of {} due to focusFcMute.'", GetCleanName(), GetSpellName(spell_id));
return(false); return false;
} }
} }
@@ -11389,11 +11389,7 @@ void Bot::DoCombatPositioning(
bool Bot::CheckDoubleRangedAttack() { bool Bot::CheckDoubleRangedAttack() {
int32 chance = spellbonuses.DoubleRangedAttack + itembonuses.DoubleRangedAttack + aabonuses.DoubleRangedAttack; int32 chance = spellbonuses.DoubleRangedAttack + itembonuses.DoubleRangedAttack + aabonuses.DoubleRangedAttack;
if (chance && zone->random.Roll(chance)) { return (chance && zone->random.Roll(chance));
return true;
}
return false;
} }
bool Bot::RequiresLoSForPositioning() { bool Bot::RequiresLoSForPositioning() {
@@ -11775,7 +11771,10 @@ bool Bot::IsValidSpellTypeSubType(uint16 spellType, uint16 subType, uint16 spell
switch (subType) { switch (subType) {
case CommandedSubTypes::SingleTarget: case CommandedSubTypes::SingleTarget:
if (!IsAnyAESpell(spell_id) && !IsGroupSpell(spell_id)) { if (
!IsAnyAESpell(spell_id) &&
!IsGroupSpell(spell_id)
) {
return true; return true;
} }
@@ -11787,7 +11786,10 @@ bool Bot::IsValidSpellTypeSubType(uint16 spellType, uint16 subType, uint16 spell
break; break;
case CommandedSubTypes::AETarget: case CommandedSubTypes::AETarget:
if (IsAnyAESpell(spell_id) && !IsGroupSpell(spell_id)) { if (
IsAnyAESpell(spell_id) &&
!IsGroupSpell(spell_id)
) {
return true; return true;
} }
@@ -11799,43 +11801,70 @@ bool Bot::IsValidSpellTypeSubType(uint16 spellType, uint16 subType, uint16 spell
break; break;
case CommandedSubTypes::Invis: case CommandedSubTypes::Invis:
if (IsEffectInSpell(spell_id, SE_Invisibility) || IsEffectInSpell(spell_id, SE_Invisibility2)) { if (
IsEffectInSpell(spell_id, SE_Invisibility) ||
IsEffectInSpell(spell_id, SE_Invisibility2)
) {
return true; return true;
} }
break; break;
case CommandedSubTypes::InvisUndead: case CommandedSubTypes::InvisUndead:
if (IsEffectInSpell(spell_id, SE_InvisVsUndead) || IsEffectInSpell(spell_id, SE_InvisVsUndead2)) { if (
IsEffectInSpell(spell_id, SE_InvisVsUndead) ||
IsEffectInSpell(spell_id, SE_InvisVsUndead2)
) {
return true; return true;
} }
break; break;
case CommandedSubTypes::InvisAnimals: case CommandedSubTypes::InvisAnimals:
if (IsEffectInSpell(spell_id, SE_InvisVsAnimals) || IsEffectInSpell(spell_id, SE_ImprovedInvisAnimals)) { if (
IsEffectInSpell(spell_id, SE_InvisVsAnimals) ||
IsEffectInSpell(spell_id, SE_ImprovedInvisAnimals)
) {
return true; return true;
} }
break; break;
case CommandedSubTypes::Shrink: case CommandedSubTypes::Shrink:
if ( if (
(IsEffectInSpell(spell_id, SE_ModelSize) && CalcSpellEffectValue(spell_id, GetSpellEffectIndex(spell_id, SE_ModelSize), GetLevel()) < 100) || (
(IsEffectInSpell(spell_id, SE_ChangeHeight) && CalcSpellEffectValue(spell_id, GetSpellEffectIndex(spell_id, SE_ChangeHeight), GetLevel()) < 100) IsEffectInSpell(spell_id, SE_ModelSize) &&
) { CalcSpellEffectValue(spell_id, GetSpellEffectIndex(spell_id, SE_ModelSize), GetLevel()) < 100
)
||
(
IsEffectInSpell(spell_id, SE_ChangeHeight) &&
CalcSpellEffectValue(spell_id, GetSpellEffectIndex(spell_id, SE_ChangeHeight), GetLevel()) < 100
)
) {
return true; return true;
} }
break; break;
case CommandedSubTypes::Grow: case CommandedSubTypes::Grow:
if ( if (
(IsEffectInSpell(spell_id, SE_ModelSize) && CalcSpellEffectValue(spell_id, GetSpellEffectIndex(spell_id, SE_ModelSize), GetLevel()) > 100) || (
(IsEffectInSpell(spell_id, SE_ChangeHeight) && CalcSpellEffectValue(spell_id, GetSpellEffectIndex(spell_id, SE_ChangeHeight), GetLevel()) > 100) IsEffectInSpell(spell_id, SE_ModelSize) &&
) { CalcSpellEffectValue(spell_id, GetSpellEffectIndex(spell_id, SE_ModelSize), GetLevel()) > 100
)
||
(
IsEffectInSpell(spell_id, SE_ChangeHeight) &&
CalcSpellEffectValue(spell_id, GetSpellEffectIndex(spell_id, SE_ChangeHeight), GetLevel()) > 100
)
) {
return true; return true;
} }
break; break;
case CommandedSubTypes::Selo: case CommandedSubTypes::Selo:
if (IsBeneficialSpell(spell_id) && IsEffectInSpell(spell_id, SE_MovementSpeed) && IsBardSong(spell_id)) { if (
IsBeneficialSpell(spell_id) &&
IsEffectInSpell(spell_id, SE_MovementSpeed) &&
IsBardSong(spell_id)
) {
return true; return true;
} }
+9 -36
View File
@@ -2147,33 +2147,15 @@ void SendSpellTypeWindow(Client* c, const Seperator* sep) {
std::string shortnameField = "Short Name"; std::string shortnameField = "Short Name";
std::string popup_text = DialogueWindow::TableRow( std::string popup_text = DialogueWindow::TableRow(
DialogueWindow::TableCell( DialogueWindow::TableCell(DialogueWindow::ColorMessage(goldenrod, spellTypeField))
fmt::format( +
"{}", DialogueWindow::TableCell((!arg0.compare("^spelltypeids") ? DialogueWindow::ColorMessage(goldenrod, idField) : DialogueWindow::ColorMessage(goldenrod, shortnameField)))
DialogueWindow::ColorMessage(goldenrod, spellTypeField)
)
) +
DialogueWindow::TableCell(
fmt::format(
"{}",
(!arg0.compare("^spelltypeids") ? DialogueWindow::ColorMessage(goldenrod, idField) : DialogueWindow::ColorMessage(goldenrod, shortnameField))
)
)
); );
popup_text += DialogueWindow::TableRow( popup_text += DialogueWindow::TableRow(
DialogueWindow::TableCell( DialogueWindow::TableCell(DialogueWindow::ColorMessage(gold, fillerLine))
fmt::format( +
"{}", DialogueWindow::TableCell(DialogueWindow::ColorMessage(gold, fillerLine))
DialogueWindow::ColorMessage(gold, fillerLine)
)
) +
DialogueWindow::TableCell(
fmt::format(
"{}",
DialogueWindow::ColorMessage(gold, fillerLine)
)
)
); );
for (int i = minCount; i <= maxCount; ++i) { for (int i = minCount; i <= maxCount; ++i) {
@@ -2182,18 +2164,9 @@ void SendSpellTypeWindow(Client* c, const Seperator* sep) {
} }
popup_text += DialogueWindow::TableRow( popup_text += DialogueWindow::TableRow(
DialogueWindow::TableCell( DialogueWindow::TableCell(DialogueWindow::ColorMessage(forest_green, c->GetSpellTypeNameByID(i)))
fmt::format( +
"{}", DialogueWindow::TableCell((!arg0.compare("^spelltypeids") ? DialogueWindow::ColorMessage(slate_blue, std::to_string(i)) : DialogueWindow::ColorMessage(slate_blue, c->GetSpellTypeShortNameByID(i))))
DialogueWindow::ColorMessage(forest_green, c->GetSpellTypeNameByID(i))
)
) +
DialogueWindow::TableCell(
fmt::format(
"{}",
(!arg0.compare("^spelltypeids") ? DialogueWindow::ColorMessage(slate_blue, std::to_string(i)) : DialogueWindow::ColorMessage(slate_blue, c->GetSpellTypeShortNameByID(i)))
)
)
); );
} }
+36 -35
View File
@@ -2,41 +2,42 @@
void bot_command_bot_settings(Client* c, const Seperator* sep) void bot_command_bot_settings(Client* c, const Seperator* sep)
{ {
std::list<const char*> subcommand_list; std::vector<const char*> subcommand_list = {
subcommand_list.push_back("behindmob"); "behindmob",
subcommand_list.push_back("blockedbuffs"); "blockedbuffs",
subcommand_list.push_back("blockedpetbuffs"); "blockedpetbuffs",
subcommand_list.push_back("distanceranged"); "distanceranged",
subcommand_list.push_back("copysettings"); "copysettings",
subcommand_list.push_back("defaultsettings"); "defaultsettings",
subcommand_list.push_back("enforcespelllist"); "enforcespelllist",
subcommand_list.push_back("follow"); "follow",
subcommand_list.push_back("followdistance"); "followdistance",
subcommand_list.push_back("illusionblock"); "illusionblock",
subcommand_list.push_back("maxmeleerange"); "maxmeleerange",
subcommand_list.push_back("owneroption"); "owneroption",
subcommand_list.push_back("petsettype"); "petsettype",
subcommand_list.push_back("sithppercent"); "sithppercent",
subcommand_list.push_back("sitincombat"); "sitincombat",
subcommand_list.push_back("sitmanapercent"); "sitmanapercent",
subcommand_list.push_back("sithppercent"); "sithppercent",
subcommand_list.push_back("spellaggrocheck"); "spellaggrocheck",
subcommand_list.push_back("spelldelays"); "spelldelays",
subcommand_list.push_back("spellengagedpriority"); "spellengagedpriority",
subcommand_list.push_back("spellholds"); "spellholds",
subcommand_list.push_back("spellidlepriority"); "spellidlepriority",
subcommand_list.push_back("spellmaxhppct"); "spellmaxhppct",
subcommand_list.push_back("spellmaxmanapct"); "spellmaxmanapct",
subcommand_list.push_back("spellmaxthresholds"); "spellmaxthresholds",
subcommand_list.push_back("spellminhppct"); "spellminhppct",
subcommand_list.push_back("spellminmanapct"); "spellminmanapct",
subcommand_list.push_back("spellminthresholds"); "spellminthresholds",
subcommand_list.push_back("spellpursuepriority"); "spellpursuepriority",
subcommand_list.push_back("spelltargetcount"); "spelltargetcount",
subcommand_list.push_back("spelllist"); "spelllist",
subcommand_list.push_back("stance"); "stance",
subcommand_list.push_back("togglehelm"); "togglehelm",
subcommand_list.push_back("bottoggleranged"); "bottoggleranged"
};
if (helper_command_alias_fail(c, "bot_command_bot_settings", sep->arg[0], "botsettings")) if (helper_command_alias_fail(c, "bot_command_bot_settings", sep->arg[0], "botsettings"))
return; return;
+12 -12
View File
@@ -2239,21 +2239,21 @@ bool BotDatabase::LoadBotSettings(Mob* m)
for (const auto& e : l) { for (const auto& e : l) {
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->GetBotSettingCategoryName(e.setting_type) m->GetBotSettingCategoryName(e.setting_type),
, e.setting_type e.setting_type,
, e.value e.value
); );
} }
else { else {
LogBotSettings("[{}] says, 'Loading {} [{}], {} [{}] - setting to [{}]." LogBotSettings("[{}] says, 'Loading {} [{}], {} [{}] - setting to [{}].",
, m->GetCleanName() m->GetCleanName(),
, m->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,
, e.value e.value
); );
} }
+1 -7
View File
@@ -13308,14 +13308,8 @@ std::string Client::SplitCommandHelpText(std::vector<std::string> msg, std::stri
for (const auto& s : msg_split) { for (const auto& s : msg_split) {
returnText += DialogueWindow::TableRow( returnText += DialogueWindow::TableRow(
DialogueWindow::TableCell( DialogueWindow::TableCell(DialogueWindow::ColorMessage(((secondColor && i == 0) ? color : secondaryColor), s))
fmt::format(
"{}",
DialogueWindow::ColorMessage(((secondColor && i == 0) ? color : secondaryColor), s)
)
)
); );
} }
} }
+136 -126
View File
@@ -4822,7 +4822,7 @@ bool Mob::PlotPositionAroundTarget(Mob* target, float &x_dest, float &y_dest, fl
return Result; return Result;
} }
bool Mob::PlotBotPositionAroundTarget(Mob* target, float& x_dest, float& y_dest, float& z_dest, float min_distance, float max_distance, bool behindOnly, bool frontOnly, bool bypassLoS) { bool Mob::PlotBotPositionAroundTarget(Mob* target, float& x_dest, float& y_dest, float& z_dest, float min_distance, float max_distance, bool behind_only, bool front_only, bool bypass_los) {
bool Result = false; bool Result = false;
if (target) { if (target) {
@@ -4830,41 +4830,41 @@ bool Mob::PlotBotPositionAroundTarget(Mob* target, float& x_dest, float& y_dest,
min_distance = min_distance; min_distance = min_distance;
max_distance = max_distance; max_distance = max_distance;
float tempX = 0; float temp_x = 0;
float tempY = 0; float temp_y = 0;
float tempZ = target->GetZ(); float temp_z = target->GetZ();
float bestZ = 0; float best_z = 0;
auto offset = GetZOffset(); auto offset = GetZOffset();
const float tarX = target->GetX(); const float tar_x = target->GetX();
const float tarY = target->GetY(); const float tar_y = target->GetY();
float tar_distance = 0; float tar_distance = 0;
glm::vec3 temp_z_Position; glm::vec3 temp_z_Position;
glm::vec4 temp_m_Position; glm::vec4 temp_m_Position;
const uint16 maxIterationsAllowed = 50; const uint16 max_iterations_allowed = 50;
uint16 counter = 0; uint16 counter = 0;
while (counter < maxIterationsAllowed) { while (counter < max_iterations_allowed) {
tempX = tarX + zone->random.Real(-max_distance, max_distance); temp_x = tar_x + zone->random.Real(-max_distance, max_distance);
tempY = tarY + zone->random.Real(-max_distance, max_distance); temp_y = tar_y + zone->random.Real(-max_distance, max_distance);
temp_z_Position.x = tempX; temp_z_Position.x = temp_z;
temp_z_Position.y = tempY; temp_z_Position.y = temp_y;
temp_z_Position.z = tempZ; temp_z_Position.z = temp_z;
bestZ = GetFixedZ(temp_z_Position); best_z = GetFixedZ(temp_z_Position);
if (bestZ != BEST_Z_INVALID) { if (best_z != BEST_Z_INVALID) {
tempZ = bestZ; temp_z = best_z;
} }
else { else {
counter++; counter++;
continue; continue;
} }
temp_m_Position.x = tempX; temp_m_Position.x = temp_x;
temp_m_Position.y = tempY; temp_m_Position.y = temp_y;
temp_m_Position.z = tempZ; temp_m_Position.z = temp_z;
tar_distance = Distance(target->GetPosition(), temp_m_Position); tar_distance = Distance(target->GetPosition(), temp_m_Position);
@@ -4872,15 +4872,15 @@ bool Mob::PlotBotPositionAroundTarget(Mob* target, float& x_dest, float& y_dest,
counter++; counter++;
continue; continue;
} }
if (frontOnly && !InFrontMob(target, tempX, tempY)) { if (front_only && !InFrontMob(target, temp_x, temp_y)) {
counter++; counter++;
continue; continue;
} }
else if (behindOnly && !BehindMob(target, tempX, tempY)) { else if (behind_only && !BehindMob(target, temp_x, temp_y)) {
counter++; counter++;
continue; continue;
} }
if (!bypassLoS && CastToBot()->RequiresLoSForPositioning() && !CheckPositioningLosFN(target, tempX, tempY, tempZ)) { if (!bypass_los && CastToBot()->RequiresLoSForPositioning() && !CheckPositioningLosFN(target, temp_x, temp_y, temp_z)) {
counter++; counter++;
continue; continue;
} }
@@ -4890,9 +4890,9 @@ bool Mob::PlotBotPositionAroundTarget(Mob* target, float& x_dest, float& y_dest,
} }
if (Result) { if (Result) {
x_dest = tempX; x_dest = temp_x;
y_dest = tempY; y_dest = temp_y;
z_dest = tempZ; z_dest = temp_z;
} }
} }
@@ -8690,7 +8690,7 @@ void Mob::CheckScanCloseMobsMovingTimer()
} }
} }
std::vector<Mob*> Mob::GatherSpellTargets(bool entireRaid, Mob* target, bool noClients, bool noBots, bool noPets) { std::vector<Mob*> Mob::GatherSpellTargets(bool entire_raid, Mob* target, bool no_clients, bool no_bots, bool no_pets) {
std::vector<Mob*> valid_spell_targets; std::vector<Mob*> valid_spell_targets;
if (IsRaidGrouped()) { if (IsRaidGrouped()) {
@@ -8704,25 +8704,32 @@ std::vector<Mob*> Mob::GatherSpellTargets(bool entireRaid, Mob* target, bool noC
} }
if (raid) { if (raid) {
if (entireRaid) { if (entire_raid) {
for (const auto& m : raid->members) { for (const auto& m : raid->members) {
if (m.member && m.group_number != RAID_GROUPLESS && ((m.member->IsClient() && !noClients) || (m.member->IsBot() && !noBots))) { if (m.member && m.group_number != RAID_GROUPLESS && ((m.member->IsClient() && !no_clients) || (m.member->IsBot() && !no_bots))) {
valid_spell_targets.emplace_back(m.member); valid_spell_targets.emplace_back(m.member);
} }
} }
} }
else { else {
std::vector<RaidMember> raidGroup; std::vector<RaidMember> raid_group;
if (target) { if (target) {
raidGroup = raid->GetRaidGroupMembers(raid->GetGroup(target->GetName())); raid_group = raid->GetRaidGroupMembers(raid->GetGroup(target->GetName()));
} }
else { else {
raidGroup = raid->GetRaidGroupMembers(raid->GetGroup(GetName())); raid_group = raid->GetRaidGroupMembers(raid->GetGroup(GetName()));
} }
for (const auto& m : raidGroup) { for (const auto& m : raid_group) {
if (m.member && m.group_number != RAID_GROUPLESS && ((m.member->IsClient() && !noClients) || (m.member->IsBot() && !noBots))) { if (
m.member &&
m.group_number != RAID_GROUPLESS &&
(
(m.member->IsClient() && !no_clients) ||
(m.member->IsBot() && !no_bots)
)
) {
valid_spell_targets.emplace_back(m.member); valid_spell_targets.emplace_back(m.member);
} }
} }
@@ -8734,7 +8741,7 @@ std::vector<Mob*> Mob::GatherSpellTargets(bool entireRaid, Mob* target, bool noC
if (group) { if (group) {
for (const auto& m : group->members) { for (const auto& m : group->members) {
if (m && ((m->IsClient() && !noClients) || (m->IsBot() && !noBots))) { if (m && ((m->IsClient() && !no_clients) || (m->IsBot() && !no_bots))) {
valid_spell_targets.emplace_back(m); valid_spell_targets.emplace_back(m);
} }
} }
@@ -8747,16 +8754,16 @@ std::vector<Mob*> Mob::GatherSpellTargets(bool entireRaid, Mob* target, bool noC
return valid_spell_targets; return valid_spell_targets;
} }
uint16 Mob::GetSpellTypeIDByShortName(std::string spellTypeString) { uint16 Mob::GetSpellTypeIDByShortName(std::string spell_type_string) {
for (int i = BotSpellTypes::START; i <= BotSpellTypes::END; ++i) { for (int i = BotSpellTypes::START; i <= BotSpellTypes::END; ++i) {
if (!Strings::ToLower(spellTypeString).compare(GetSpellTypeShortNameByID(i))) { if (!Strings::ToLower(spell_type_string).compare(GetSpellTypeShortNameByID(i))) {
return i; return i;
} }
} }
for (int i = BotSpellTypes::COMMANDED_START; i <= BotSpellTypes::COMMANDED_END; ++i) { for (int i = BotSpellTypes::COMMANDED_START; i <= BotSpellTypes::COMMANDED_END; ++i) {
if (!Strings::ToLower(spellTypeString).compare(GetSpellTypeShortNameByID(i))) { if (!Strings::ToLower(spell_type_string).compare(GetSpellTypeShortNameByID(i))) {
return i; return i;
} }
} }
@@ -8765,16 +8772,16 @@ uint16 Mob::GetSpellTypeIDByShortName(std::string spellTypeString) {
} }
bool Mob::IsValidBotSpellCategory(uint8 setting_type) { bool Mob::IsValidBotSpellCategory(uint8 setting_type) {
return (setting_type >= BotSettingCategories::START && setting_type <= BotSettingCategories::END_FULL); return EQ::ValueWithin(setting_type, BotSettingCategories::START, BotSettingCategories::END_FULL);
} }
std::string Mob::GetBotSpellCategoryName(uint8 setting_type) { std::string Mob::GetBotSpellCategoryName(uint8 setting_type) {
return IsValidBotBaseSetting(setting_type) ? botSpellCategory_names[setting_type] : "UNKNOWN CATEGORY"; return IsValidBotBaseSetting(setting_type) ? botSpellCategory_names[setting_type] : "UNKNOWN CATEGORY";
} }
uint16 Mob::GetBotSpellCategoryIDByShortName(std::string settingString) { uint16 Mob::GetBotSpellCategoryIDByShortName(std::string setting_string) {
for (int i = BotSettingCategories::START; i <= BotSettingCategories::END; ++i) { for (int i = BotSettingCategories::START; i <= BotSettingCategories::END; ++i) {
if (!Strings::ToLower(settingString).compare(Strings::ToLower(GetBotSpellCategoryName(i)))) { if (!Strings::ToLower(setting_string).compare(Strings::ToLower(GetBotSpellCategoryName(i)))) {
return i; return i;
} }
} }
@@ -8783,16 +8790,16 @@ uint16 Mob::GetBotSpellCategoryIDByShortName(std::string settingString) {
} }
bool Mob::IsValidBotBaseSetting(uint16 setting_type) { bool Mob::IsValidBotBaseSetting(uint16 setting_type) {
return (setting_type >= BotBaseSettings::START_ALL && setting_type <= BotBaseSettings::END); return EQ::ValueWithin(setting_type, BotBaseSettings::START_ALL, BotBaseSettings::END);
} }
std::string Mob::GetBotSettingCategoryName(uint16 setting_type) { std::string Mob::GetBotSettingCategoryName(uint16 setting_type) {
return IsValidBotBaseSetting(setting_type) ? botBaseSettings_names[setting_type] : "UNKNOWN SETTING"; return IsValidBotBaseSetting(setting_type) ? botBaseSettings_names[setting_type] : "UNKNOWN SETTING";
} }
uint16 Mob::GetBaseSettingIDByShortName(std::string settingString) { uint16 Mob::GetBaseSettingIDByShortName(std::string setting_string) {
for (int i = BotSettingCategories::START; i <= BotSettingCategories::END; ++i) { for (int i = BotSettingCategories::START; i <= BotSettingCategories::END; ++i) {
if (!Strings::ToLower(settingString).compare(Strings::ToLower(GetBotSettingCategoryName(i)))) { if (!Strings::ToLower(setting_string).compare(Strings::ToLower(GetBotSettingCategoryName(i)))) {
return i; return i;
} }
} }
@@ -8800,30 +8807,33 @@ uint16 Mob::GetBaseSettingIDByShortName(std::string settingString) {
return UINT16_MAX; return UINT16_MAX;
} }
bool Mob::IsValidSpellType(uint16 spellType) { bool Mob::IsValidSpellType(uint16 spell_type) {
return (spellType >= BotSpellTypes::START && spellType <= BotSpellTypes::END) || (spellType >= BotSpellTypes::COMMANDED_START && spellType <= BotSpellTypes::COMMANDED_END); return (
EQ::ValueWithin(spell_type, BotSpellTypes::START, BotSpellTypes::END) ||
EQ::ValueWithin(spell_type, BotSpellTypes::COMMANDED_START, BotSpellTypes::COMMANDED_END)
);
} }
std::string Mob::GetSpellTypeShortNameByID(uint16 spellType) { std::string Mob::GetSpellTypeShortNameByID(uint16 spell_type) {
return IsValidSpellType(spellType) ? spellType_shortNames[spellType] : "UNKNOWN SPELLTYPE"; return IsValidSpellType(spell_type) ? spellType_shortNames[spell_type] : "UNKNOWN SPELLTYPE";
} }
std::string Mob::GetSpellTypeNameByID(uint16 spellType) { std::string Mob::GetSpellTypeNameByID(uint16 spell_type) {
return IsValidSpellType(spellType) ? spellType_names[spellType] : "UNKNOWN SPELLTYPE"; return IsValidSpellType(spell_type) ? spellType_names[spell_type] : "UNKNOWN SPELLTYPE";
} }
bool Mob::IsValidSubType(uint16 subType) { bool Mob::IsValidSubType(uint16 sub_type) {
return (subType >= CommandedSubTypes::START && subType <= CommandedSubTypes::END); return EQ::ValueWithin(sub_type, CommandedSubTypes::START, CommandedSubTypes::END);
} }
std::string Mob::GetSubTypeNameByID(uint16 subType) { std::string Mob::GetSubTypeNameByID(uint16 sub_type) {
return IsValidSpellType(subType) ? botSubType_names[subType] : "UNKNOWN SUBTYPE"; return IsValidSpellType(sub_type) ? botSubType_names[sub_type] : "UNKNOWN SUBTYPE";
} }
bool Mob::GetDefaultSpellHold(uint16 spellType, uint8 stance) { bool Mob::GetDefaultSpellHold(uint16 spell_type, uint8 stance) {
uint8 botClass = GetClass(); uint8 bot_class = GetClass();
switch (spellType) { switch (spell_type) {
case BotSpellTypes::FastHeals: case BotSpellTypes::FastHeals:
case BotSpellTypes::VeryFastHeals: case BotSpellTypes::VeryFastHeals:
case BotSpellTypes::Pet: case BotSpellTypes::Pet:
@@ -8866,7 +8876,7 @@ bool Mob::GetDefaultSpellHold(uint16 spellType, uint8 stance) {
case BotSpellTypes::InCombatBuffSong: case BotSpellTypes::InCombatBuffSong:
case BotSpellTypes::OutOfCombatBuffSong: case BotSpellTypes::OutOfCombatBuffSong:
case BotSpellTypes::PreCombatBuffSong: case BotSpellTypes::PreCombatBuffSong:
if (botClass == Class::Bard) { if (bot_class == Class::Bard) {
return false; return false;
} }
else { else {
@@ -8917,7 +8927,7 @@ bool Mob::GetDefaultSpellHold(uint16 spellType, uint8 stance) {
return false; return false;
} }
case BotSpellTypes::HateLine: case BotSpellTypes::HateLine:
if (botClass == Class::ShadowKnight || botClass == Class::Paladin) { if (bot_class == Class::ShadowKnight || bot_class == Class::Paladin) {
switch (stance) { switch (stance) {
case Stance::Aggressive: case Stance::Aggressive:
return false; return false;
@@ -8948,8 +8958,8 @@ bool Mob::GetDefaultSpellHold(uint16 spellType, uint8 stance) {
} }
} }
uint16 Mob::GetDefaultSpellDelay(uint16 spellType, uint8 stance) { uint16 Mob::GetDefaultSpellDelay(uint16 spell_type, uint8 stance) {
switch (spellType) { switch (spell_type) {
case BotSpellTypes::VeryFastHeals: case BotSpellTypes::VeryFastHeals:
case BotSpellTypes::PetVeryFastHeals: case BotSpellTypes::PetVeryFastHeals:
return 1500; return 1500;
@@ -9015,8 +9025,8 @@ uint16 Mob::GetDefaultSpellDelay(uint16 spellType, uint8 stance) {
} }
} }
uint8 Mob::GetDefaultSpellMinThreshold(uint16 spellType, uint8 stance) { uint8 Mob::GetDefaultSpellMinThreshold(uint16 spell_type, uint8 stance) {
switch (spellType) { switch (spell_type) {
case BotSpellTypes::AEDebuff: case BotSpellTypes::AEDebuff:
case BotSpellTypes::Debuff: case BotSpellTypes::Debuff:
case BotSpellTypes::AEDispel: case BotSpellTypes::AEDispel:
@@ -9063,10 +9073,10 @@ uint8 Mob::GetDefaultSpellMinThreshold(uint16 spellType, uint8 stance) {
} }
} }
uint8 Mob::GetDefaultSpellMaxThreshold(uint16 spellType, uint8 stance) { uint8 Mob::GetDefaultSpellMaxThreshold(uint16 spell_type, uint8 stance) {
uint8 botClass = GetClass(); uint8 bot_class = GetClass();
switch (spellType) { switch (spell_type) {
case BotSpellTypes::Escape: case BotSpellTypes::Escape:
case BotSpellTypes::VeryFastHeals: case BotSpellTypes::VeryFastHeals:
case BotSpellTypes::PetVeryFastHeals: case BotSpellTypes::PetVeryFastHeals:
@@ -9153,7 +9163,7 @@ uint8 Mob::GetDefaultSpellMaxThreshold(uint16 spellType, uint8 stance) {
case BotSpellTypes::GroupHoTHeals: case BotSpellTypes::GroupHoTHeals:
case BotSpellTypes::HoTHeals: case BotSpellTypes::HoTHeals:
case BotSpellTypes::PetHoTHeals: case BotSpellTypes::PetHoTHeals:
if (botClass == Class::Necromancer || botClass == Class::Shaman) { if (bot_class == Class::Necromancer || bot_class == Class::Shaman) {
return 60; return 60;
} }
else { else {
@@ -9195,24 +9205,24 @@ uint8 Mob::GetDefaultSpellMaxThreshold(uint16 spellType, uint8 stance) {
} }
} }
void Mob::SetSpellHold(uint16 spellType, bool holdStatus) { void Mob::SetSpellHold(uint16 spell_type, bool hold_status) {
_spellSettings[spellType].hold = holdStatus; _spellSettings[spell_type].hold = hold_status;
} }
void Mob::SetSpellDelay(uint16 spellType, uint16 delayValue) { void Mob::SetSpellDelay(uint16 spell_type, uint16 delay_value) {
_spellSettings[spellType].delay = delayValue; _spellSettings[spell_type].delay = delay_value;
} }
void Mob::SetSpellMinThreshold(uint16 spellType, uint8 thresholdValue) { void Mob::SetSpellMinThreshold(uint16 spell_type, uint8 threshold_value) {
_spellSettings[spellType].minThreshold = thresholdValue; _spellSettings[spell_type].minThreshold = threshold_value;
} }
void Mob::SetSpellMaxThreshold(uint16 spellType, uint8 thresholdValue) { void Mob::SetSpellMaxThreshold(uint16 spell_type, uint8 threshold_value) {
_spellSettings[spellType].maxThreshold = thresholdValue; _spellSettings[spell_type].maxThreshold = threshold_value;
} }
void Mob::SetSpellTypeRecastTimer(uint16 spellType, uint32 recastTime) { void Mob::SetSpellTypeRecastTimer(uint16 spell_type, uint32 recast_time) {
_spellSettings[spellType].recastTimer.Start(recastTime); _spellSettings[spell_type].recastTimer.Start(recast_time);
} }
void Mob::StartBotSpellTimers() { void Mob::StartBotSpellTimers() {
@@ -9227,84 +9237,84 @@ void Mob::DisableBotSpellTimers() {
} }
} }
bool Mob::GetUltimateSpellHold(uint16 spellType, Mob* tar) { bool Mob::GetUltimateSpellHold(uint16 spell_type, Mob* tar) {
if (!tar) { if (!tar) {
return GetSpellHold(spellType); return GetSpellHold(spell_type);
} }
if (tar->IsPet() && tar->GetOwner() && tar->GetOwner()->IsOfClientBot()) { if (tar->IsPet() && tar->GetOwner() && tar->GetOwner()->IsOfClientBot()) {
return tar->GetOwner()->GetSpellHold(GetPetSpellType(spellType)); return tar->GetOwner()->GetSpellHold(GetPetSpellType(spell_type));
} }
return GetSpellHold(spellType); return GetSpellHold(spell_type);
} }
uint16 Mob::GetUltimateSpellDelay(uint16 spellType, Mob* tar) { uint16 Mob::GetUltimateSpellDelay(uint16 spell_type, Mob* tar) {
if (!tar) { if (!tar) {
return GetSpellDelay(spellType); return GetSpellDelay(spell_type);
} }
if (tar->IsPet() && tar->GetOwner() && tar->GetOwner()->IsOfClientBot()) { if (tar->IsPet() && tar->GetOwner() && tar->GetOwner()->IsOfClientBot()) {
return tar->GetOwner()->GetSpellDelay(GetPetSpellType(spellType)); return tar->GetOwner()->GetSpellDelay(GetPetSpellType(spell_type));
} }
if (IsBotSpellTypeOtherBeneficial(spellType) && tar->IsOfClientBot()) { if (IsBotSpellTypeOtherBeneficial(spell_type) && tar->IsOfClientBot()) {
return tar->GetSpellDelay(spellType); return tar->GetSpellDelay(spell_type);
} }
return GetSpellDelay(spellType); return GetSpellDelay(spell_type);
} }
bool Mob::GetUltimateSpellDelayCheck(uint16 spellType, Mob* tar) { bool Mob::GetUltimateSpellDelayCheck(uint16 spell_type, Mob* tar) {
if (!tar) { if (!tar) {
return SpellTypeRecastCheck(spellType); return SpellTypeRecastCheck(spell_type);
} }
if (tar->IsPet() && tar->GetOwner() && tar->GetOwner()->IsOfClientBot()) { if (tar->IsPet() && tar->GetOwner() && tar->GetOwner()->IsOfClientBot()) {
return tar->GetOwner()->SpellTypeRecastCheck(GetPetSpellType(spellType)); return tar->GetOwner()->SpellTypeRecastCheck(GetPetSpellType(spell_type));
} }
if (IsBotSpellTypeOtherBeneficial(spellType) && tar->IsOfClientBot()) { if (IsBotSpellTypeOtherBeneficial(spell_type) && tar->IsOfClientBot()) {
return tar->SpellTypeRecastCheck(spellType); return tar->SpellTypeRecastCheck(spell_type);
} }
return SpellTypeRecastCheck(spellType); return SpellTypeRecastCheck(spell_type);
} }
uint8 Mob::GetUltimateSpellMinThreshold(uint16 spellType, Mob* tar) { uint8 Mob::GetUltimateSpellMinThreshold(uint16 spell_type, Mob* tar) {
if (!tar) { if (!tar) {
return GetSpellMinThreshold(spellType); return GetSpellMinThreshold(spell_type);
} }
if (tar->IsPet() && tar->GetOwner() && tar->GetOwner()->IsOfClientBot()) { if (tar->IsPet() && tar->GetOwner() && tar->GetOwner()->IsOfClientBot()) {
return tar->GetOwner()->GetSpellMinThreshold(GetPetSpellType(spellType)); return tar->GetOwner()->GetSpellMinThreshold(GetPetSpellType(spell_type));
} }
if (IsBotSpellTypeOtherBeneficial(spellType) && tar->IsOfClientBot()) { if (IsBotSpellTypeOtherBeneficial(spell_type) && tar->IsOfClientBot()) {
return tar->GetSpellMinThreshold(spellType); return tar->GetSpellMinThreshold(spell_type);
} }
return GetSpellMinThreshold(spellType); return GetSpellMinThreshold(spell_type);
} }
uint8 Mob::GetUltimateSpellMaxThreshold(uint16 spellType, Mob* tar) { uint8 Mob::GetUltimateSpellMaxThreshold(uint16 spell_type, Mob* tar) {
if (!tar) { if (!tar) {
return GetSpellMaxThreshold(spellType); return GetSpellMaxThreshold(spell_type);
} }
if (tar->IsPet() && tar->GetOwner() && tar->GetOwner()->IsOfClientBot()) { if (tar->IsPet() && tar->GetOwner() && tar->GetOwner()->IsOfClientBot()) {
return tar->GetOwner()->GetSpellMaxThreshold(GetPetSpellType(spellType)); return tar->GetOwner()->GetSpellMaxThreshold(GetPetSpellType(spell_type));
} }
if (IsBotSpellTypeOtherBeneficial(spellType) && tar->IsOfClientBot()) { if (IsBotSpellTypeOtherBeneficial(spell_type) && tar->IsOfClientBot()) {
return tar->GetSpellMaxThreshold(spellType); return tar->GetSpellMaxThreshold(spell_type);
} }
return GetSpellMaxThreshold(spellType); return GetSpellMaxThreshold(spell_type);
} }
uint16 Mob::GetPetSpellType(uint16 spellType) { uint16 Mob::GetPetSpellType(uint16 spell_type) {
switch (spellType) { switch (spell_type) {
case BotSpellTypes::VeryFastHeals: case BotSpellTypes::VeryFastHeals:
return BotSpellTypes::PetVeryFastHeals; return BotSpellTypes::PetVeryFastHeals;
case BotSpellTypes::FastHeals: case BotSpellTypes::FastHeals:
@@ -9327,11 +9337,11 @@ uint16 Mob::GetPetSpellType(uint16 spellType) {
break; break;
} }
return spellType; return spell_type;
} }
uint8 Mob::GetHPRatioForSpellType(uint16 spellType, Mob* tar) { uint8 Mob::GetHPRatioForSpellType(uint16 spell_type, Mob* tar) {
switch (spellType) { switch (spell_type) {
case BotSpellTypes::Escape: case BotSpellTypes::Escape:
case BotSpellTypes::HateRedux: case BotSpellTypes::HateRedux:
case BotSpellTypes::InCombatBuff: case BotSpellTypes::InCombatBuff:
@@ -9350,28 +9360,28 @@ uint8 Mob::GetHPRatioForSpellType(uint16 spellType, Mob* tar) {
return tar->GetHPRatio(); return tar->GetHPRatio();
} }
void Mob::SetBotSetting(uint8 settingType, uint16 botSetting, int settingValue) { void Mob::SetBotSetting(uint8 setting_type, uint16 bot_setting, int setting_value) {
if (!IsOfClientBot()) { if (!IsOfClientBot()) {
return; return;
} }
if (IsClient()) { if (IsClient()) {
CastToClient()->SetBotSetting(settingType, botSetting, settingValue); CastToClient()->SetBotSetting(setting_type, bot_setting, setting_value);
return; return;
} }
if (IsBot()) { if (IsBot()) {
CastToBot()->SetBotSetting(settingType, botSetting, settingValue); CastToBot()->SetBotSetting(setting_type, bot_setting, setting_value);
return; return;
} }
return; return;
} }
void Mob::SetBaseSetting(uint16 baseSetting, int settingValue) { void Mob::SetBaseSetting(uint16 base_setting, int setting_value) {
switch (baseSetting) { switch (base_setting) {
case BotBaseSettings::IllusionBlock: case BotBaseSettings::IllusionBlock:
SetIllusionBlock(settingValue); SetIllusionBlock(setting_value);
break; break;
default: default:
break; break;
@@ -9409,7 +9419,7 @@ void Mob::ClearDataBucketCache()
} }
} }
bool Mob::IsInGroupOrRaid(Mob *other, bool sameRaidGroup) { bool Mob::IsInGroupOrRaid(Mob *other, bool same_raid_group) {
if (!other || !IsOfClientBotMerc() || !other->IsOfClientBotMerc()) { if (!other || !IsOfClientBotMerc() || !other->IsOfClientBotMerc()) {
return false; return false;
} }
@@ -9440,23 +9450,23 @@ bool Mob::IsInGroupOrRaid(Mob *other, bool sameRaidGroup) {
return false; return false;
} }
Raid* otherRaid = nullptr; Raid* other_raid = nullptr;
if (other->IsBot()) { if (other->IsBot()) {
otherRaid = other->CastToBot()->GetStoredRaid(); other_raid = other->CastToBot()->GetStoredRaid();
} }
else { else {
otherRaid = other->GetRaid(); other_raid = other->GetRaid();
} }
if (!otherRaid) { if (!other_raid) {
return false; return false;
} }
auto rGroup = raid->GetGroup(GetCleanName()); auto raid_group = raid->GetGroup(GetCleanName());
auto rOGroup = otherRaid->GetGroup(other->GetCleanName()); auto raid_other_group = other_raid->GetGroup(other->GetCleanName());
if (rGroup == RAID_GROUPLESS || rOGroup == RAID_GROUPLESS || (sameRaidGroup && rGroup != rOGroup)) { if (raid_group == RAID_GROUPLESS || raid_other_group == RAID_GROUPLESS || (same_raid_group && raid_group != raid_other_group)) {
return false; return false;
} }
@@ -9464,10 +9474,10 @@ bool Mob::IsInGroupOrRaid(Mob *other, bool sameRaidGroup) {
} }
else { else {
auto* group = GetGroup(); auto* group = GetGroup();
auto* groupOther = other->GetGroup(); auto* group_other = other->GetGroup();
if (group) { if (group) {
if (!groupOther || group != groupOther) { if (!group_other || group != group_other) {
return false; return false;
} }
+34 -34
View File
@@ -432,53 +432,53 @@ public:
inline bool SpellTypeRecastCheck(uint16 spellType) { return (IsClient() ? true : _spellSettings[spellType].recastTimer.GetRemainingTime() > 0 ? false : true); } inline bool SpellTypeRecastCheck(uint16 spellType) { return (IsClient() ? true : _spellSettings[spellType].recastTimer.GetRemainingTime() > 0 ? false : true); }
std::vector<Mob*> GatherSpellTargets(bool entireRaid = false, Mob* target = nullptr, bool noClients = false, bool noBots = false, bool noPets = false); std::vector<Mob*> GatherSpellTargets(bool entireRaid = false, Mob* target = nullptr, bool no_clients = false, bool no_bots = false, bool no_pets = false);
uint16 GetSpellTypeIDByShortName(std::string spellTypeString); uint16 GetSpellTypeIDByShortName(std::string spellType_string);
bool IsValidBotSpellCategory(uint8 setting_type); bool IsValidBotSpellCategory(uint8 setting_type);
std::string GetBotSpellCategoryName(uint8 setting_type); std::string GetBotSpellCategoryName(uint8 setting_type);
uint16 GetBotSpellCategoryIDByShortName(std::string settingString); uint16 GetBotSpellCategoryIDByShortName(std::string setting_string);
bool IsValidBotBaseSetting(uint16 setting_type); bool IsValidBotBaseSetting(uint16 setting_type);
std::string GetBotSettingCategoryName(uint16 setting_type); std::string GetBotSettingCategoryName(uint16 setting_type);
uint16 GetBaseSettingIDByShortName(std::string settingString); uint16 GetBaseSettingIDByShortName(std::string setting_string);
bool IsValidSpellType(uint16 spellType); bool IsValidSpellType(uint16 spell_type);
std::string GetSpellTypeNameByID(uint16 spellType); std::string GetSpellTypeNameByID(uint16 spell_type);
std::string GetSpellTypeShortNameByID(uint16 spellType); std::string GetSpellTypeShortNameByID(uint16 spell_type);
bool IsValidSubType(uint16 subType); bool IsValidSubType(uint16 sub_type);
std::string GetSubTypeNameByID(uint16 subType); std::string GetSubTypeNameByID(uint16 sub_type);
bool GetDefaultSpellHold(uint16 spellType, uint8 stance = Stance::Balanced); bool GetDefaultSpellHold(uint16 spell_type, uint8 stance = Stance::Balanced);
uint16 GetDefaultSpellDelay(uint16 spellType, uint8 stance = Stance::Balanced); uint16 GetDefaultSpellDelay(uint16 spell_type, uint8 stance = Stance::Balanced);
uint8 GetDefaultSpellMinThreshold(uint16 spellType, uint8 stance = Stance::Balanced); uint8 GetDefaultSpellMinThreshold(uint16 spell_type, uint8 stance = Stance::Balanced);
uint8 GetDefaultSpellMaxThreshold(uint16 spellType, uint8 stance = Stance::Balanced); uint8 GetDefaultSpellMaxThreshold(uint16 spell_type, uint8 stance = Stance::Balanced);
inline bool GetSpellHold(uint16 spellType) const { return _spellSettings[spellType].hold; } inline bool GetSpellHold(uint16 spell_type) const { return _spellSettings[spell_type].hold; }
void SetSpellHold(uint16 spellType, bool holdStatus); void SetSpellHold(uint16 spell_type, bool hold_status);
inline uint16 GetSpellDelay(uint16 spellType) const { return _spellSettings[spellType].delay; } inline uint16 GetSpellDelay(uint16 spell_type) const { return _spellSettings[spell_type].delay; }
void SetSpellDelay(uint16 spellType, uint16 delayValue); void SetSpellDelay(uint16 spell_type, uint16 delay_value);
inline uint8 GetSpellMinThreshold(uint16 spellType) const { return _spellSettings[spellType].minThreshold; } inline uint8 GetSpellMinThreshold(uint16 spell_type) const { return _spellSettings[spell_type].minThreshold; }
void SetSpellMinThreshold(uint16 spellType, uint8 thresholdValue); void SetSpellMinThreshold(uint16 spell_type, uint8 threshold_value);
inline uint8 GetSpellMaxThreshold(uint16 spellType) const { return _spellSettings[spellType].maxThreshold; } inline uint8 GetSpellMaxThreshold(uint16 spell_type) const { return _spellSettings[spell_type].maxThreshold; }
void SetSpellMaxThreshold(uint16 spellType, uint8 thresholdValue); void SetSpellMaxThreshold(uint16 spell_type, uint8 threshold_value);
inline uint16 GetSpellTypeRecastTimer(uint16 spellType) { return _spellSettings[spellType].recastTimer.GetRemainingTime(); } inline uint16 GetSpellTypeRecastTimer(uint16 spell_type) { return _spellSettings[spell_type].recastTimer.GetRemainingTime(); }
void SetSpellTypeRecastTimer(uint16 spellType, uint32 recastTime); void SetSpellTypeRecastTimer(uint16 spell_type, uint32 recast_time);
uint8 GetHPRatioForSpellType(uint16 spellType, Mob* tar); uint8 GetHPRatioForSpellType(uint16 spell_type, Mob* tar);
bool GetUltimateSpellHold(uint16 spellType, Mob* tar); bool GetUltimateSpellHold(uint16 spell_type, Mob* tar);
uint16 GetUltimateSpellDelay(uint16 spellType, Mob* tar); uint16 GetUltimateSpellDelay(uint16 spell_type, Mob* tar);
bool GetUltimateSpellDelayCheck(uint16 spellType, Mob* tar); bool GetUltimateSpellDelayCheck(uint16 spell_type, Mob* tar);
uint8 GetUltimateSpellMinThreshold(uint16 spellType, Mob* tar); uint8 GetUltimateSpellMinThreshold(uint16 spell_type, Mob* tar);
uint8 GetUltimateSpellMaxThreshold(uint16 spellType, Mob* tar); uint8 GetUltimateSpellMaxThreshold(uint16 spell_type, Mob* tar);
uint16 GetPetSpellType(uint16 spellType); uint16 GetPetSpellType(uint16 spell_type);
void DisableBotSpellTimers(); void DisableBotSpellTimers();
void StartBotSpellTimers(); void StartBotSpellTimers();
void SetBotSetting(uint8 settingType, uint16 botSetting, int settingValue); void SetBotSetting(uint8 spell_type, uint16 bot_setting, int setting_value);
void SetBaseSetting(uint16 baseSetting, int settingValue); void SetBaseSetting(uint16 base_setting, int setting_value);
void SetIllusionBlock(bool value) { _illusionBlock = value; } void SetIllusionBlock(bool value) { _illusionBlock = value; }
bool GetIllusionBlock() const { return _illusionBlock; } bool GetIllusionBlock() const { return _illusionBlock; }
@@ -785,7 +785,7 @@ public:
virtual bool HasGroup() = 0; virtual bool HasGroup() = 0;
virtual Raid* GetRaid() = 0; virtual Raid* GetRaid() = 0;
virtual Group* GetGroup() = 0; virtual Group* GetGroup() = 0;
bool IsInGroupOrRaid(Mob* other, bool sameRaidGroup = false); bool IsInGroupOrRaid(Mob* other, bool same_raid_group = false);
//Faction //Faction
virtual inline int32 GetPrimaryFaction() const { return 0; } virtual inline int32 GetPrimaryFaction() const { return 0; }
@@ -940,7 +940,7 @@ public:
void ShowStats(Client* client); void ShowStats(Client* client);
void ShowBuffs(Client* c); void ShowBuffs(Client* c);
bool PlotPositionAroundTarget(Mob* target, float &x_dest, float &y_dest, float &z_dest, bool lookForAftArc = true); bool PlotPositionAroundTarget(Mob* target, float &x_dest, float &y_dest, float &z_dest, bool lookForAftArc = true);
bool PlotBotPositionAroundTarget(Mob* target, float& x_dest, float& y_dest, float& z_dest, float min_distance, float max_distance, bool behindOnly = false, bool frontOnly = false, bool bypassLoS = false); 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 int GetKillExpMod() const { return 100; } virtual int GetKillExpMod() const { return 100; }
// aura functions // aura functions
+4 -4
View File
@@ -2180,14 +2180,14 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce
IsClient() && CastToClient()->TGB() && IsClient() && CastToClient()->TGB() &&
IsTGBCompatibleSpell(spell_id) && IsTGBCompatibleSpell(spell_id) &&
(slot != CastingSlot::Item || RuleB(Spells, AllowItemTGB)) (slot != CastingSlot::Item || RuleB(Spells, AllowItemTGB))
) { ) {
if ( if (
!target || !target ||
target->IsCorpse() || target->IsCorpse() ||
( (
target->IsNPC() && target->IsNPC() &&
!(target->GetOwner() && target->GetOwner()->IsClient()) !(target->GetOwner() && target->GetOwner()->IsClient())
) )
) { ) {
spell_target = this; spell_target = this;
} }
@@ -7549,8 +7549,8 @@ bool Mob::IsImmuneToBotSpell(uint16 spell_id, Mob* caster)
{ {
int effect_index; int effect_index;
if (caster == nullptr) { if (!caster) {
return(false); return false;
} }
//TODO: this function loops through the effect list for //TODO: this function loops through the effect list for