Removed unnecessary spaces

This commit is contained in:
Revision 2025-09-19 22:43:50 +02:00
parent ace813516d
commit fcb956ec1b
194 changed files with 100566 additions and 100566 deletions

View File

@ -506,7 +506,7 @@ AiPlayerbot.AutoGearQualityLimit = 3
# Max iLVL Phase 1(Kara, Gruul, Mag) = 125 | Phase 1.5(ZA) = 138 | Phase 2(SC, TK) = 141 | Phase 3(Hyjal, BT) = 156 | Phase 4(Sunwell) = 164 # Max iLVL Phase 1(Kara, Gruul, Mag) = 125 | Phase 1.5(ZA) = 138 | Phase 2(SC, TK) = 141 | Phase 3(Hyjal, BT) = 156 | Phase 4(Sunwell) = 164
# Wotlk # Wotlk
# Max iLVL Tier 7(10/25) = 200/213 | Tier 8(10/25) = 225/232 | Tier 9(10/25) = 232/245 | Tier 10(10/25/HC) = 251/264/290 # Max iLVL Tier 7(10/25) = 200/213 | Tier 8(10/25) = 225/232 | Tier 9(10/25) = 232/245 | Tier 10(10/25/HC) = 251/264/290
# Max iLVL Phase 1(Naxx) = 224 | Phase 2(Ulduar) = 245 | Phase 3(ToC) = 258 | Phase 4(ICC) = 290 # Max iLVL Phase 1(Naxx) = 224 | Phase 2(Ulduar) = 245 | Phase 3(ToC) = 258 | Phase 4(ICC) = 290
# Default: 0 (no limit) # Default: 0 (no limit)
AiPlayerbot.AutoGearScoreLimit = 0 AiPlayerbot.AutoGearScoreLimit = 0
@ -516,11 +516,11 @@ AiPlayerbot.AutoGearScoreLimit = 0
# "health" (bots immediately regenerate lost health) # "health" (bots immediately regenerate lost health)
# "mana" (bots have infinite mana) # "mana" (bots have infinite mana)
# "power" (bots have infinite energy, rage, and runic power) # "power" (bots have infinite energy, rage, and runic power)
# "taxi" (bots may use all flight paths, though they will not actually learn them) # "taxi" (bots may use all flight paths, though they will not actually learn them)
# "raid" (bots use cheats implemented into raid strategies) # "raid" (bots use cheats implemented into raid strategies)
# To use multiple cheats, separate them by commas below (e.g., to enable all, use "gold,health,mana,power,raid,taxi") # To use multiple cheats, separate them by commas below (e.g., to enable all, use "gold,health,mana,power,raid,taxi")
# Default: taxi and raid are enabled # Default: taxi and raid are enabled
AiPlayerbot.BotCheats = "food,taxi,raid" AiPlayerbot.BotCheats = "food,taxi,raid"
# #
# #
@ -670,7 +670,7 @@ AiPlayerbot.RandomGearQualityLimit = 3
# Max iLVL Phase 1(Kara, Gruul, Mag) = 125 | Phase 1.5(ZA) = 138 | Phase 2(SC, TK) = 141 | Phase 3(Hyjal, BT) = 156 | Phase 4(Sunwell) = 164 # Max iLVL Phase 1(Kara, Gruul, Mag) = 125 | Phase 1.5(ZA) = 138 | Phase 2(SC, TK) = 141 | Phase 3(Hyjal, BT) = 156 | Phase 4(Sunwell) = 164
# Wotlk # Wotlk
# Max iLVL Tier 7(10/25) = 200/213 | Tier 8(10/25) = 225/232 | Tier 9(10/25) = 232/245 | Tier 10(10/25/HC) = 251/264/290 # Max iLVL Tier 7(10/25) = 200/213 | Tier 8(10/25) = 225/232 | Tier 9(10/25) = 232/245 | Tier 10(10/25/HC) = 251/264/290
# Max iLVL Phase 1(Naxx) = 224 | Phase 2(Ulduar) = 245 | Phase 3(ToC) = 258 | Phase 4(ICC) = 290 # Max iLVL Phase 1(Naxx) = 224 | Phase 2(Ulduar) = 245 | Phase 3(ToC) = 258 | Phase 4(ICC) = 290
# Default: 0 (no limit) # Default: 0 (no limit)
AiPlayerbot.RandomGearScoreLimit = 0 AiPlayerbot.RandomGearScoreLimit = 0

File diff suppressed because it is too large Load Diff

View File

@ -4,11 +4,11 @@ DELETE FROM `playerbots_travelnode_path` WHERE `node_id` = 3780;
DELETE FROM `playerbots_travelnode` WHERE `id` = 3780; DELETE FROM `playerbots_travelnode` WHERE `id` = 3780;
-- Insert new entries into playerbots_travelnode -- Insert new entries into playerbots_travelnode
INSERT INTO `playerbots_travelnode` (`id`, `name`, `map_id`, `x`, `y`, `z`, `linked`) INSERT INTO `playerbots_travelnode` (`id`, `name`, `map_id`, `x`, `y`, `z`, `linked`)
VALUES (3780, 'Highlord Mograine', 533, 2524.32, -2951.28, 245.633, 1); VALUES (3780, 'Highlord Mograine', 533, 2524.32, -2951.28, 245.633, 1);
-- Insert new entries into playerbots_travelnode_path -- Insert new entries into playerbots_travelnode_path
INSERT INTO `playerbots_travelnode_path` (`node_id`, `to_node_id`, `nr`, `map_id`, `x`, `y`, `z`) INSERT INTO `playerbots_travelnode_path` (`node_id`, `to_node_id`, `nr`, `map_id`, `x`, `y`, `z`)
VALUES VALUES
(3780, 472, 0, 533, 2524.32, -2951.28, 245.633), (3780, 472, 0, 533, 2524.32, -2951.28, 245.633),
(3780, 472, 1, 533, 2528.79, -2948.58, 245.633), (3780, 472, 1, 533, 2528.79, -2948.58, 245.633),
@ -16,7 +16,7 @@ VALUES
(3780, 757, 1, 533, 2517.62, -2959.38, 245.636); (3780, 757, 1, 533, 2517.62, -2959.38, 245.636);
-- Insert new entries into playerbots_travelnode_link -- Insert new entries into playerbots_travelnode_link
INSERT INTO `playerbots_travelnode_link` (`node_id`, `to_node_id`, `type`, `object`, `distance`, `swim_distance`, `extra_cost`, `calculated`, `max_creature_0`, `max_creature_1`, `max_creature_2`) INSERT INTO `playerbots_travelnode_link` (`node_id`, `to_node_id`, `type`, `object`, `distance`, `swim_distance`, `extra_cost`, `calculated`, `max_creature_0`, `max_creature_1`, `max_creature_2`)
VALUES VALUES
(3780, 472, 1, 0, 5.3221, 0, 0, 1, 83, 0, 0), (3780, 472, 1, 0, 5.3221, 0, 0, 1, 83, 0, 0),
(3780, 757, 1, 0, 10.6118, 0, 0, 1, 83, 0, 0); (3780, 757, 1, 0, 10.6118, 0, 0, 1, 83, 0, 0);

View File

@ -1,5 +1,5 @@
DROP TABLE IF EXISTS `playerbots_rpg_races`; DROP TABLE IF EXISTS `playerbots_rpg_races`;
CREATE TABLE `playerbots_rpg_races` CREATE TABLE `playerbots_rpg_races`
( (
`id` int(11) NOT NULL AUTO_INCREMENT, `id` int(11) NOT NULL AUTO_INCREMENT,
`entry` int(11), `entry` int(11),

View File

@ -319,7 +319,7 @@ void AiFactory::AddDefaultCombatStrategies(Player* player, PlayerbotAI* const fa
{ {
engine->addStrategiesNoInit("fire", nullptr); engine->addStrategiesNoInit("fire", nullptr);
} }
} }
else // Frost else // Frost
engine->addStrategiesNoInit("frost", nullptr); engine->addStrategiesNoInit("frost", nullptr);

View File

@ -14,7 +14,7 @@
#include <cctype> #include <cctype>
#include <string> #include <string>
static std::string ToLower(const std::string& str) static std::string ToLower(const std::string& str)
{ {
std::string out = str; std::string out = str;
std::transform(out.begin(), out.end(), out.begin(), [](unsigned char c){ return std::tolower(c); }); std::transform(out.begin(), out.end(), out.begin(), [](unsigned char c){ return std::tolower(c); });
@ -393,12 +393,12 @@ private:
int specTab = AiFactory::GetPlayerSpecTab(bot); int specTab = AiFactory::GetPlayerSpecTab(bot);
std::string botSpecClass; std::string botSpecClass;
// For druids, specTab==1 is always feral; distinguish bear/cat at runtime by role // For druids, specTab==1 is always feral; distinguish bear/cat at runtime by role
if (cls == CLASS_DRUID && specTab == 1) if (cls == CLASS_DRUID && specTab == 1)
{ {
botSpecClass = botAI->IsTank(bot) ? "bear" : "cat"; botSpecClass = botAI->IsTank(bot) ? "bear" : "cat";
} }
// For death knights, specTab==0 is always blood; distinguish tank/dps at runtime by role // For death knights, specTab==0 is always blood; distinguish tank/dps at runtime by role
else if (cls == CLASS_DEATH_KNIGHT && specTab == 0) else if (cls == CLASS_DEATH_KNIGHT && specTab == 0)
{ {
botSpecClass = botAI->IsTank(bot) ? "bdkt" : "bdkd"; botSpecClass = botAI->IsTank(bot) ? "bdkt" : "bdkd";
} }
@ -482,7 +482,7 @@ public:
std::string msgLower = ToLower(message); std::string msgLower = ToLower(message);
const std::string prefix = "@aggroby"; const std::string prefix = "@aggroby";
size_t prefixLen = prefix.length(); size_t prefixLen = prefix.length();
if (msgLower.find(prefix) != 0) if (msgLower.find(prefix) != 0)
{ {
return message; return message;
} }
@ -601,12 +601,12 @@ CompositeChatFilter::~CompositeChatFilter()
std::string const CompositeChatFilter::Filter(std::string& message) std::string const CompositeChatFilter::Filter(std::string& message)
{ {
for (auto* filter : filters) for (auto* filter : filters)
{ {
message = filter->Filter(message); message = filter->Filter(message);
if (message.empty()) if (message.empty())
break; break;
} }
return message; return message;
} }

View File

@ -308,25 +308,25 @@ ItemIds ChatHelper::parseItems(std::string const text)
ItemWithRandomProperty ChatHelper::parseItemWithRandomProperty(std::string const text) ItemWithRandomProperty ChatHelper::parseItemWithRandomProperty(std::string const text)
{ {
ItemWithRandomProperty res; ItemWithRandomProperty res;
size_t itemStart = text.find("Hitem:"); size_t itemStart = text.find("Hitem:");
if (itemStart == std::string::npos) if (itemStart == std::string::npos)
return res; return res;
itemStart += 6; itemStart += 6;
if (itemStart >= text.length()) if (itemStart >= text.length())
return res; return res;
size_t colonPos = text.find(':', itemStart); size_t colonPos = text.find(':', itemStart);
if (colonPos == std::string::npos) if (colonPos == std::string::npos)
return res; return res;
std::string itemIdStr = text.substr(itemStart, colonPos - itemStart); std::string itemIdStr = text.substr(itemStart, colonPos - itemStart);
res.itemId = atoi(itemIdStr.c_str()); res.itemId = atoi(itemIdStr.c_str());
std::vector<std::string> params; std::vector<std::string> params;
size_t currentPos = colonPos + 1; size_t currentPos = colonPos + 1;
while (currentPos < text.length()) { while (currentPos < text.length()) {
size_t nextColon = text.find(':', currentPos); size_t nextColon = text.find(':', currentPos);
if (nextColon == std::string::npos) { if (nextColon == std::string::npos) {
@ -336,15 +336,15 @@ ItemWithRandomProperty ChatHelper::parseItemWithRandomProperty(std::string const
} }
break; break;
} }
params.push_back(text.substr(currentPos, nextColon - currentPos)); params.push_back(text.substr(currentPos, nextColon - currentPos));
currentPos = nextColon + 1; currentPos = nextColon + 1;
} }
if (params.size() >= 6) { if (params.size() >= 6) {
res.randomPropertyId = atoi(params[5].c_str()); res.randomPropertyId = atoi(params[5].c_str());
} }
return res; return res;
} }
@ -364,7 +364,7 @@ std::string const ChatHelper::FormatQuest(Quest const* quest)
if (questTitle.empty()) if (questTitle.empty())
questTitle = quest->GetTitle(); questTitle = quest->GetTitle();
out << "|cFFFFFF00|Hquest:" << quest->GetQuestId() << ':' << quest->GetQuestLevel() << "|h[" << questTitle << "]|h|r"; out << "|cFFFFFF00|Hquest:" << quest->GetQuestId() << ':' << quest->GetQuestLevel() << "|h[" << questTitle << "]|h|r";
return out.str(); return out.str();
} }
@ -432,7 +432,7 @@ std::string const ChatHelper::FormatItem(ItemTemplate const* proto, uint32 count
if (locale && locale->Name.size() > sWorld->GetDefaultDbcLocale()) if (locale && locale->Name.size() > sWorld->GetDefaultDbcLocale())
itemName = locale->Name[sWorld->GetDefaultDbcLocale()]; itemName = locale->Name[sWorld->GetDefaultDbcLocale()];
if (itemName.empty()) if (itemName.empty())
itemName = proto->Name1; itemName = proto->Name1;
@ -677,7 +677,7 @@ std::set<uint32> extractGeneric(std::string_view text, std::string_view prefix)
std::string_view number_str = text_view.substr(pos, end_pos - pos); std::string_view number_str = text_view.substr(pos, end_pos - pos);
uint32 number = 0; uint32 number = 0;
auto [ptr, ec] = std::from_chars(number_str.data(), number_str.data() + number_str.size(), number); auto [ptr, ec] = std::from_chars(number_str.data(), number_str.data() + number_str.size(), number);
if (ec == std::errc()) if (ec == std::errc())

View File

@ -590,7 +590,7 @@ uint32 GuildTaskMgr::GetTaskValue(uint32 owner, uint32 guildId, std::string cons
{ {
return 0; return 0;
} }
uint32 value = 0; uint32 value = 0;
PlayerbotsDatabasePreparedStatement* stmt = PlayerbotsDatabasePreparedStatement* stmt =

View File

@ -1051,7 +1051,7 @@ void PlayerbotAI::HandleBotOutgoingPacket(WorldPacket const& packet)
default: default:
return; return;
} }
if (chanName == "World") if (chanName == "World")
return; return;

View File

@ -554,7 +554,7 @@ public:
bool IsSafe(Player* player); bool IsSafe(Player* player);
bool IsSafe(WorldObject* obj); bool IsSafe(WorldObject* obj);
ChatChannelSource GetChatChannelSource(Player* bot, uint32 type, std::string channelName); ChatChannelSource GetChatChannelSource(Player* bot, uint32 type, std::string channelName);
bool CheckLocationDistanceByLevel(Player* player, const WorldLocation &loc, bool fromStartUp = false); bool CheckLocationDistanceByLevel(Player* player, const WorldLocation &loc, bool fromStartUp = false);
bool HasCheat(BotCheatMask mask) bool HasCheat(BotCheatMask mask)

View File

@ -1132,7 +1132,7 @@ std::vector<std::string> PlayerbotHolder::HandlePlayerbotCommand(char const* arg
{ {
std::string g = genderArg; std::string g = genderArg;
std::transform(g.begin(), g.end(), g.begin(), ::tolower); std::transform(g.begin(), g.end(), g.begin(), ::tolower);
if (g == "male" || g == "0") if (g == "male" || g == "0")
gender = GENDER_MALE; // 0 gender = GENDER_MALE; // 0
else if (g == "female" || g == "1") else if (g == "female" || g == "1")
@ -1155,7 +1155,7 @@ std::vector<std::string> PlayerbotHolder::HandlePlayerbotCommand(char const* arg
{ {
// If the user requested a specific gender, skip any character that doesn't match. // If the user requested a specific gender, skip any character that doesn't match.
if (gender != -1 && GetOfflinePlayerGender(guid) != gender) if (gender != -1 && GetOfflinePlayerGender(guid) != gender)
continue; continue;
if (botLoading.find(guid) != botLoading.end()) if (botLoading.find(guid) != botLoading.end())
continue; continue;
if (ObjectAccessor::FindConnectedPlayer(guid)) if (ObjectAccessor::FindConnectedPlayer(guid))

View File

@ -164,7 +164,7 @@ PlayerbotSecurityLevel PlayerbotSecurity::LevelFor(Player* from, DenyReason* rea
if (reason) if (reason)
*reason = PLAYERBOT_DENY_INVITE; *reason = PLAYERBOT_DENY_INVITE;
return PLAYERBOT_SECURITY_INVITE; return PLAYERBOT_SECURITY_INVITE;
} }

View File

@ -115,7 +115,7 @@ public:
roundedTime = roundedTime.substr(0, roundedTime.find('.') + 2); roundedTime = roundedTime.substr(0, roundedTime.find('.') + 2);
ChatHandler(player->GetSession()).SendSysMessage( ChatHandler(player->GetSession()).SendSysMessage(
"|cff00ff00Playerbots:|r bot initialization at server startup takes about '" "|cff00ff00Playerbots:|r bot initialization at server startup takes about '"
+ roundedTime + "' minutes."); + roundedTime + "' minutes.");
} }
} }
@ -299,7 +299,7 @@ public:
LOG_INFO("server.loading", "╚══════════════════════════════════════════════════════════╝"); LOG_INFO("server.loading", "╚══════════════════════════════════════════════════════════╝");
uint32 oldMSTime = getMSTime(); uint32 oldMSTime = getMSTime();
LOG_INFO("server.loading", " "); LOG_INFO("server.loading", " ");
LOG_INFO("server.loading", "Load Playerbots Config..."); LOG_INFO("server.loading", "Load Playerbots Config...");

View File

@ -2360,7 +2360,7 @@ void RandomItemMgr::BuildPotionCache()
(proto->SubClass != ITEM_SUBCLASS_POTION && proto->SubClass != ITEM_SUBCLASS_FLASK) || (proto->SubClass != ITEM_SUBCLASS_POTION && proto->SubClass != ITEM_SUBCLASS_FLASK) ||
proto->Bonding != NO_BIND) proto->Bonding != NO_BIND)
continue; continue;
uint32 requiredLevel = proto->RequiredLevel; uint32 requiredLevel = proto->RequiredLevel;
if (requiredLevel > level || (level > 13 && requiredLevel < level - 13)) if (requiredLevel > level || (level > 13 && requiredLevel < level - 13))
continue; continue;
@ -2374,10 +2374,10 @@ void RandomItemMgr::BuildPotionCache()
if (proto->Duration & 0x80000000) if (proto->Duration & 0x80000000)
continue; continue;
if (proto->AllowableClass != -1) if (proto->AllowableClass != -1)
continue; continue;
bool hybrid = false; bool hybrid = false;
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(proto->Spells[0].SpellId); SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(proto->Spells[0].SpellId);
if (!spellInfo) if (!spellInfo)

View File

@ -79,8 +79,8 @@ static const std::unordered_map<uint16, std::pair<CityId, FactionId>> bankerToCi
{2996, {CityId::THUNDER_BLUFF, FactionId::HORDE}}, {8356, {CityId::THUNDER_BLUFF, FactionId::HORDE}}, {8357, {CityId::THUNDER_BLUFF, FactionId::HORDE}}, {2996, {CityId::THUNDER_BLUFF, FactionId::HORDE}}, {8356, {CityId::THUNDER_BLUFF, FactionId::HORDE}}, {8357, {CityId::THUNDER_BLUFF, FactionId::HORDE}},
{17631, {CityId::SILVERMOON_CITY, FactionId::HORDE}}, {17632, {CityId::SILVERMOON_CITY, FactionId::HORDE}}, {17633, {CityId::SILVERMOON_CITY, FactionId::HORDE}}, {17631, {CityId::SILVERMOON_CITY, FactionId::HORDE}}, {17632, {CityId::SILVERMOON_CITY, FactionId::HORDE}}, {17633, {CityId::SILVERMOON_CITY, FactionId::HORDE}},
{16615, {CityId::SILVERMOON_CITY, FactionId::HORDE}}, {16616, {CityId::SILVERMOON_CITY, FactionId::HORDE}}, {16617, {CityId::SILVERMOON_CITY, FactionId::HORDE}}, {16615, {CityId::SILVERMOON_CITY, FactionId::HORDE}}, {16616, {CityId::SILVERMOON_CITY, FactionId::HORDE}}, {16617, {CityId::SILVERMOON_CITY, FactionId::HORDE}},
{19246, {CityId::SHATTRATH_CITY, FactionId::NEUTRAL}}, {19338, {CityId::SHATTRATH_CITY, FactionId::NEUTRAL}}, {19246, {CityId::SHATTRATH_CITY, FactionId::NEUTRAL}}, {19338, {CityId::SHATTRATH_CITY, FactionId::NEUTRAL}},
{19034, {CityId::SHATTRATH_CITY, FactionId::NEUTRAL}}, {19318, {CityId::SHATTRATH_CITY, FactionId::NEUTRAL}}, {19034, {CityId::SHATTRATH_CITY, FactionId::NEUTRAL}}, {19318, {CityId::SHATTRATH_CITY, FactionId::NEUTRAL}},
{30604, {CityId::DALARAN, FactionId::NEUTRAL}}, {30605, {CityId::DALARAN, FactionId::NEUTRAL}}, {30607, {CityId::DALARAN, FactionId::NEUTRAL}}, {30604, {CityId::DALARAN, FactionId::NEUTRAL}}, {30605, {CityId::DALARAN, FactionId::NEUTRAL}}, {30607, {CityId::DALARAN, FactionId::NEUTRAL}},
{28675, {CityId::DALARAN, FactionId::NEUTRAL}}, {28676, {CityId::DALARAN, FactionId::NEUTRAL}}, {28677, {CityId::DALARAN, FactionId::NEUTRAL}} {28675, {CityId::DALARAN, FactionId::NEUTRAL}}, {28676, {CityId::DALARAN, FactionId::NEUTRAL}}, {28677, {CityId::DALARAN, FactionId::NEUTRAL}}
}; };
@ -95,7 +95,7 @@ static const std::unordered_map<CityId, std::vector<uint16>> cityToBankers = {
{CityId::UNDERCITY, {4549, 2459, 2458, 4550}}, {CityId::UNDERCITY, {4549, 2459, 2458, 4550}},
{CityId::THUNDER_BLUFF, {2996, 8356, 8357}}, {CityId::THUNDER_BLUFF, {2996, 8356, 8357}},
{CityId::SILVERMOON_CITY, {17631, 17632, 17633, 16615, 16616, 16617}}, {CityId::SILVERMOON_CITY, {17631, 17632, 17633, 16615, 16616, 16617}},
{CityId::SHATTRATH_CITY, {19246, 19338, 19034, 19318}}, {CityId::SHATTRATH_CITY, {19246, 19338, 19034, 19318}},
{CityId::DALARAN, {30604, 30605, 30607, 28675, 28676, 28677, 29530}} {CityId::DALARAN, {30604, 30605, 30607, 28675, 28676, 28677, 29530}}
}; };
@ -2190,7 +2190,7 @@ void RandomPlayerbotMgr::RandomTeleportForLevel(Player* bot)
RandomTeleport(bot, fallbackLocs, true); RandomTeleport(bot, fallbackLocs, true);
return; return;
} }
// Collect valid cities based on bot faction. // Collect valid cities based on bot faction.
std::unordered_set<CityId> validBankerCities; std::unordered_set<CityId> validBankerCities;
for (auto& loc : bankerLocsPerLevelCache[level]) for (auto& loc : bankerLocsPerLevelCache[level])

View File

@ -168,33 +168,33 @@ void PlayerbotFactory::Init()
{ {
continue; continue;
} }
ItemTemplate const* proto = sObjectMgr->GetItemTemplate(gemId); ItemTemplate const* proto = sObjectMgr->GetItemTemplate(gemId);
if (!proto) if (!proto)
{ {
continue; continue;
} }
if (proto->ItemLevel < 60) if (proto->ItemLevel < 60)
{ {
continue; continue;
} }
if (proto->Flags & ITEM_FLAG_UNIQUE_EQUIPPABLE) if (proto->Flags & ITEM_FLAG_UNIQUE_EQUIPPABLE)
{ {
continue; continue;
} }
if (sRandomItemMgr->IsTestItem(gemId)) if (sRandomItemMgr->IsTestItem(gemId))
{ {
continue; continue;
} }
if (!sGemPropertiesStore.LookupEntry(proto->GemProperties)) if (!sGemPropertiesStore.LookupEntry(proto->GemProperties))
{ {
continue; continue;
} }
// LOG_INFO("playerbots", "Add {} to enchantment gems", gemId); // LOG_INFO("playerbots", "Add {} to enchantment gems", gemId);
enchantGemIdCache.push_back(gemId); enchantGemIdCache.push_back(gemId);
} }
@ -736,7 +736,7 @@ void PlayerbotFactory::InitConsumables()
int count = (int)item.second - (int)bot->GetItemCount(item.first); int count = (int)item.second - (int)bot->GetItemCount(item.first);
if (count > 0) if (count > 0)
StoreItem(item.first, count); StoreItem(item.first, count);
} }
} }
void PlayerbotFactory::InitPetTalents() void PlayerbotFactory::InitPetTalents()
@ -1032,10 +1032,10 @@ void PlayerbotFactory::ClearSkills()
} }
bot->SetUInt32Value(PLAYER_SKILL_INDEX(0), 0); bot->SetUInt32Value(PLAYER_SKILL_INDEX(0), 0);
bot->SetUInt32Value(PLAYER_SKILL_INDEX(1), 0); bot->SetUInt32Value(PLAYER_SKILL_INDEX(1), 0);
// unlearn default race/class skills // unlearn default race/class skills
if (PlayerInfo const* info = sObjectMgr->GetPlayerInfo(bot->getRace(), bot->getClass())) if (PlayerInfo const* info = sObjectMgr->GetPlayerInfo(bot->getRace(), bot->getClass()))
{ {
for (PlayerCreateInfoSkills::const_iterator itr = info->skills.begin(); itr != info->skills.end(); ++itr) for (PlayerCreateInfoSkills::const_iterator itr = info->skills.begin(); itr != info->skills.end(); ++itr)
{ {
uint32 skillId = itr->SkillId; uint32 skillId = itr->SkillId;
@ -1043,7 +1043,7 @@ void PlayerbotFactory::ClearSkills()
continue; continue;
bot->SetSkill(skillId, 0, 0, 0); bot->SetSkill(skillId, 0, 0, 0);
} }
} }
} }
void PlayerbotFactory::ClearEverything() void PlayerbotFactory::ClearEverything()
@ -1095,7 +1095,7 @@ void PlayerbotFactory::ResetQuests()
uint32 entry = quest->GetQuestId(); uint32 entry = quest->GetQuestId();
if (bot->GetQuestStatus(entry) == QUEST_STATUS_NONE) if (bot->GetQuestStatus(entry) == QUEST_STATUS_NONE)
continue; continue;
bot->RemoveRewardedQuest(entry); bot->RemoveRewardedQuest(entry);
bot->RemoveActiveQuest(entry, false); bot->RemoveActiveQuest(entry, false);
@ -1171,7 +1171,7 @@ void PlayerbotFactory::InitTalentsTree(bool increment /*false*/, bool use_templa
if (bot->GetFreeTalentPoints()) if (bot->GetFreeTalentPoints())
InitTalents((specTab + 2) % 3); InitTalents((specTab + 2) % 3);
bot->SendTalentsInfoData(false); bot->SendTalentsInfoData(false);
} }
@ -1704,7 +1704,7 @@ void PlayerbotFactory::InitEquipment(bool incremental, bool second_chance)
{ {
if (incremental && !sPlayerbotAIConfig->incrementalGearInit) if (incremental && !sPlayerbotAIConfig->incrementalGearInit)
return; return;
if (level < 5) { if (level < 5) {
// original items // original items
if (CharStartOutfitEntry const* oEntry = GetCharStartOutfitEntry(bot->getRace(), bot->getClass(), bot->getGender())) if (CharStartOutfitEntry const* oEntry = GetCharStartOutfitEntry(bot->getRace(), bot->getClass(), bot->getGender()))
@ -1715,11 +1715,11 @@ void PlayerbotFactory::InitEquipment(bool incremental, bool second_chance)
continue; continue;
uint32 itemId = oEntry->ItemId[j]; uint32 itemId = oEntry->ItemId[j];
// skip hearthstone // skip hearthstone
if (itemId == 6948) if (itemId == 6948)
continue; continue;
// just skip, reported in ObjectMgr::LoadItemTemplates // just skip, reported in ObjectMgr::LoadItemTemplates
ItemTemplate const* iProto = sObjectMgr->GetItemTemplate(itemId); ItemTemplate const* iProto = sObjectMgr->GetItemTemplate(itemId);
if (!iProto) if (!iProto)
@ -1743,10 +1743,10 @@ void PlayerbotFactory::InitEquipment(bool incremental, bool second_chance)
} }
return; return;
} }
std::unordered_map<uint8, std::vector<uint32>> items; std::unordered_map<uint8, std::vector<uint32>> items;
// int tab = AiFactory::GetPlayerSpecTab(bot); // int tab = AiFactory::GetPlayerSpecTab(bot);
uint32 blevel = bot->GetLevel(); uint32 blevel = bot->GetLevel();
int32 delta = std::min(blevel, 10u); int32 delta = std::min(blevel, 10u);
@ -1814,7 +1814,7 @@ void PlayerbotFactory::InitEquipment(bool incremental, bool second_chance)
ItemTemplate const* proto = sObjectMgr->GetItemTemplate(itemId); ItemTemplate const* proto = sObjectMgr->GetItemTemplate(itemId);
if (!proto) if (!proto)
continue; continue;
bool shouldCheckGS = desiredQuality > ITEM_QUALITY_NORMAL; bool shouldCheckGS = desiredQuality > ITEM_QUALITY_NORMAL;
if (shouldCheckGS && gearScoreLimit != 0 && if (shouldCheckGS && gearScoreLimit != 0 &&
@ -2923,7 +2923,7 @@ void PlayerbotFactory::InitQuests(std::list<uint32>& questMap, bool withRewardIt
// set reward to 5 to skip majority quest reward // set reward to 5 to skip majority quest reward
uint32 reward = withRewardItem ? 0 : 5; uint32 reward = withRewardItem ? 0 : 5;
bot->RewardQuest(quest, reward, bot, false); bot->RewardQuest(quest, reward, bot, false);
if (!withRewardItem) if (!withRewardItem)
{ {
// destroy the quest reward item // destroy the quest reward item
@ -3010,10 +3010,10 @@ void PlayerbotFactory::InitAmmo()
// disable next expansion ammo // disable next expansion ammo
if (sPlayerbotAIConfig->limitGearExpansion && bot->GetLevel() <= 60 && tEntry >= 23728) if (sPlayerbotAIConfig->limitGearExpansion && bot->GetLevel() <= 60 && tEntry >= 23728)
continue; continue;
if (sPlayerbotAIConfig->limitGearExpansion && bot->GetLevel() <= 70 && tEntry >= 35570) if (sPlayerbotAIConfig->limitGearExpansion && bot->GetLevel() <= 70 && tEntry >= 35570)
continue; continue;
entry = tEntry; entry = tEntry;
break; break;
} }
@ -3177,7 +3177,7 @@ void PlayerbotFactory::InitPotions()
if (effect == SPELL_EFFECT_ENERGIZE && !bot->GetPower(POWER_MANA)) if (effect == SPELL_EFFECT_ENERGIZE && !bot->GetPower(POWER_MANA))
continue; continue;
FindPotionVisitor visitor(bot, effect); FindPotionVisitor visitor(bot, effect);
IterateItems(&visitor); IterateItems(&visitor);
if (!visitor.GetResult().empty()) if (!visitor.GetResult().empty())
@ -3319,7 +3319,7 @@ void PlayerbotFactory::InitReagents()
switch (bot->getClass()) switch (bot->getClass())
{ {
case CLASS_DEATH_KNIGHT: case CLASS_DEATH_KNIGHT:
if (level >= 56) if (level >= 56)
items.push_back({37201, 40}); // Corpse Dust items.push_back({37201, 40}); // Corpse Dust
break; break;
case CLASS_DRUID: case CLASS_DRUID:
@ -4345,7 +4345,7 @@ void PlayerbotFactory::ApplyEnchantAndGemsNew(bool destoryOld)
{ {
continue; continue;
} }
if (item->GetTemplate() && item->GetTemplate()->Quality < ITEM_QUALITY_UNCOMMON) if (item->GetTemplate() && item->GetTemplate()->Quality < ITEM_QUALITY_UNCOMMON)
continue; continue;
int32 bestEnchantId = -1; int32 bestEnchantId = -1;
@ -4661,12 +4661,12 @@ void PlayerbotFactory::InitKeyring()
{ {
if (!bot) if (!bot)
return; return;
if (bot->GetLevel() < 70) if (bot->GetLevel() < 70)
return; return;
ReputationMgr& repMgr = bot->GetReputationMgr(); // Reference, use . instead of -> ReputationMgr& repMgr = bot->GetReputationMgr(); // Reference, use . instead of ->
std::vector<std::pair<uint32, uint32>> keysToCheck; std::vector<std::pair<uint32, uint32>> keysToCheck;
// Reputation-based Keys (Honored requirement) // Reputation-based Keys (Honored requirement)

View File

@ -85,7 +85,7 @@ public:
void InitKeyring(); void InitKeyring();
void InitReputation(); void InitReputation();
void InitAttunementQuests(); void InitAttunementQuests();
private: private:
void Prepare(); void Prepare();
// void InitSecondEquipmentSet(); // void InitSecondEquipmentSet();

View File

@ -571,7 +571,7 @@ void StatsWeightCalculator::CalculateItemTypePenalty(ItemTemplate const* proto)
{ {
weight_ *= 0.1; weight_ *= 0.1;
} }
if (lvl >= 10 && cls == CLASS_ROGUE && (tab == ROGUE_TAB_ASSASSINATION || tab == ROGUE_TAB_SUBTLETY) && if (lvl >= 10 && cls == CLASS_ROGUE && (tab == ROGUE_TAB_ASSASSINATION || tab == ROGUE_TAB_SUBTLETY) &&
proto->SubClass == ITEM_SUBCLASS_WEAPON_DAGGER) proto->SubClass == ITEM_SUBCLASS_WEAPON_DAGGER)
{ {

View File

@ -30,16 +30,16 @@ public:
void Reset(); void Reset();
float CalculateItem(uint32 itemId, int32 randomPropertyId = 0); float CalculateItem(uint32 itemId, int32 randomPropertyId = 0);
float CalculateEnchant(uint32 enchantId); float CalculateEnchant(uint32 enchantId);
void SetOverflowPenalty(bool apply) { enable_overflow_penalty_ = apply; } void SetOverflowPenalty(bool apply) { enable_overflow_penalty_ = apply; }
void SetItemSetBonus(bool apply) { enable_item_set_bonus_ = apply; } void SetItemSetBonus(bool apply) { enable_item_set_bonus_ = apply; }
void SetQualityBlend(bool apply) { enable_quality_blend_ = apply; } void SetQualityBlend(bool apply) { enable_quality_blend_ = apply; }
private: private:
void GenerateWeights(Player* player); void GenerateWeights(Player* player);
void GenerateBasicWeights(Player* player); void GenerateBasicWeights(Player* player);
void GenerateAdditionalWeights(Player* player); void GenerateAdditionalWeights(Player* player);
void CalculateRandomProperty(int32 randomPropertyId, uint32 itemId); void CalculateRandomProperty(int32 randomPropertyId, uint32 itemId);
void CalculateItemSetMod(Player* player, ItemTemplate const* proto); void CalculateItemSetMod(Player* player, ItemTemplate const* proto);
void CalculateSocketBonus(Player* player, ItemTemplate const* proto); void CalculateSocketBonus(Player* player, ItemTemplate const* proto);

View File

@ -88,7 +88,7 @@ Engine::~Engine(void)
void Engine::Reset() void Engine::Reset()
{ {
strategyTypeMask = 0; strategyTypeMask = 0;
ActionNode* action = nullptr; ActionNode* action = nullptr;
while ((action = queue.Pop()) != nullptr) while ((action = queue.Pop()) != nullptr)
@ -154,7 +154,7 @@ bool Engine::DoNextAction(Unit* unit, uint32 depth, bool minimal)
uint32 iterations = 0; uint32 iterations = 0;
uint32 iterationsPerTick = queue.Size() * (minimal ? 2 : sPlayerbotAIConfig->iterationsPerTick); uint32 iterationsPerTick = queue.Size() * (minimal ? 2 : sPlayerbotAIConfig->iterationsPerTick);
while (++iterations <= iterationsPerTick) while (++iterations <= iterationsPerTick)
{ {
basket = queue.Peek(); basket = queue.Peek();

View File

@ -12,7 +12,7 @@
/** /**
* @class Queue * @class Queue
* @brief Manages a priority queue of actions for the playerbot system * @brief Manages a priority queue of actions for the playerbot system
* *
* This queue maintains a list of ActionBasket objects, each containing an action * This queue maintains a list of ActionBasket objects, each containing an action
* and its relevance score. Actions with higher relevance scores are prioritized. * and its relevance score. Actions with higher relevance scores are prioritized.
*/ */
@ -25,7 +25,7 @@ public:
/** /**
* @brief Adds an action to the queue or updates existing action's relevance * @brief Adds an action to the queue or updates existing action's relevance
* @param action Pointer to the ActionBasket to be added * @param action Pointer to the ActionBasket to be added
* *
* If an action with the same name exists, updates its relevance if the new * If an action with the same name exists, updates its relevance if the new
* relevance is higher, then deletes the new action. Otherwise, adds the new * relevance is higher, then deletes the new action. Otherwise, adds the new
* action to the queue. * action to the queue.
@ -35,7 +35,7 @@ public:
/** /**
* @brief Removes and returns the action with highest relevance * @brief Removes and returns the action with highest relevance
* @return Pointer to the highest relevance ActionNode, or nullptr if queue is empty * @return Pointer to the highest relevance ActionNode, or nullptr if queue is empty
* *
* Ownership of the returned ActionNode is transferred to the caller. * Ownership of the returned ActionNode is transferred to the caller.
* The associated ActionBasket is deleted. * The associated ActionBasket is deleted.
*/ */
@ -55,7 +55,7 @@ public:
/** /**
* @brief Removes and deletes expired actions from the queue * @brief Removes and deletes expired actions from the queue
* *
* Uses sPlayerbotAIConfig->expireActionTime to determine if actions have expired. * Uses sPlayerbotAIConfig->expireActionTime to determine if actions have expired.
* Both the ActionNode and ActionBasket are deleted for expired actions. * Both the ActionNode and ActionBasket are deleted for expired actions.
*/ */

View File

@ -55,11 +55,11 @@ bool AttackAction::Attack(Unit* target, bool with_pet /*true*/)
{ {
Unit* oldTarget = context->GetValue<Unit*>("current target")->Get(); Unit* oldTarget = context->GetValue<Unit*>("current target")->Get();
bool shouldMelee = bot->IsWithinMeleeRange(target) || botAI->IsMelee(bot); bool shouldMelee = bot->IsWithinMeleeRange(target) || botAI->IsMelee(bot);
bool sameTarget = oldTarget == target && bot->GetVictim() == target; bool sameTarget = oldTarget == target && bot->GetVictim() == target;
bool inCombat = botAI->GetState() == BOT_STATE_COMBAT; bool inCombat = botAI->GetState() == BOT_STATE_COMBAT;
bool sameAttackMode = bot->HasUnitState(UNIT_STATE_MELEE_ATTACKING) == shouldMelee; bool sameAttackMode = bot->HasUnitState(UNIT_STATE_MELEE_ATTACKING) == shouldMelee;
if (bot->GetMotionMaster()->GetCurrentMovementGeneratorType() == FLIGHT_MOTION_TYPE || if (bot->GetMotionMaster()->GetCurrentMovementGeneratorType() == FLIGHT_MOTION_TYPE ||
bot->HasUnitState(UNIT_STATE_IN_FLIGHT)) bot->HasUnitState(UNIT_STATE_IN_FLIGHT))
{ {
@ -84,7 +84,7 @@ bool AttackAction::Attack(Unit* target, bool with_pet /*true*/)
return false; return false;
} }
if ((sPlayerbotAIConfig->IsInPvpProhibitedZone(bot->GetZoneId()) || if ((sPlayerbotAIConfig->IsInPvpProhibitedZone(bot->GetZoneId()) ||
sPlayerbotAIConfig->IsInPvpProhibitedArea(bot->GetAreaId())) sPlayerbotAIConfig->IsInPvpProhibitedArea(bot->GetAreaId()))
&& (target->IsPlayer() || target->IsPet())) && (target->IsPlayer() || target->IsPet()))
{ {
@ -158,7 +158,7 @@ bool AttackAction::Attack(Unit* target, bool with_pet /*true*/)
sServerFacade->SetFacingTo(bot, target); sServerFacade->SetFacingTo(bot, target);
} }
botAI->ChangeEngine(BOT_STATE_COMBAT); botAI->ChangeEngine(BOT_STATE_COMBAT);
bot->Attack(target, shouldMelee); bot->Attack(target, shouldMelee);
/* prevent pet dead immediately in group */ /* prevent pet dead immediately in group */
// if (bot->GetMap()->IsDungeon() && bot->GetGroup() && !target->IsInCombat()) { // if (bot->GetMap()->IsDungeon() && bot->GetGroup() && !target->IsInCombat()) {

View File

@ -158,7 +158,7 @@ void AutoMaintenanceOnLevelupAction::AutoUpgradeEquip()
{ {
if (!sPlayerbotAIConfig->autoUpgradeEquip || !sRandomPlayerbotMgr->IsRandomBot(bot)) if (!sPlayerbotAIConfig->autoUpgradeEquip || !sRandomPlayerbotMgr->IsRandomBot(bot))
return; return;
PlayerbotFactory factory(bot, bot->GetLevel()); PlayerbotFactory factory(bot, bot->GetLevel());
// Clean up old consumables before adding new ones // Clean up old consumables before adding new ones

View File

@ -543,7 +543,7 @@ bool BGJoinAction::JoinQueue(uint32 type)
} }
botAI->GetAiObjectContext()->GetValue<uint32>("bg type")->Set(0); botAI->GetAiObjectContext()->GetValue<uint32>("bg type")->Set(0);
if (!isArena) if (!isArena)
{ {
WorldPacket* packet = new WorldPacket(CMSG_BATTLEMASTER_JOIN, 20); WorldPacket* packet = new WorldPacket(CMSG_BATTLEMASTER_JOIN, 20);

View File

@ -2903,7 +2903,7 @@ bool BGTactics::selectObjective(bool reset)
{ {
// just make bot stay where it is if already close // just make bot stay where it is if already close
// (stops them shifting around between the random spots) // (stops them shifting around between the random spots)
if (bot->GetDistance(IC_GATE_ATTACK_POS_HORDE) < 8.0f) if (bot->GetDistance(IC_GATE_ATTACK_POS_HORDE) < 8.0f)
pos.Set(bot->GetPositionX(), bot->GetPositionY(), bot->GetPositionZ(), bot->GetMapId()); pos.Set(bot->GetPositionX(), bot->GetPositionY(), bot->GetPositionZ(), bot->GetMapId());
else else
pos.Set(IC_GATE_ATTACK_POS_HORDE.GetPositionX() + frand(-5.0f, +5.0f), pos.Set(IC_GATE_ATTACK_POS_HORDE.GetPositionX() + frand(-5.0f, +5.0f),
@ -3213,7 +3213,7 @@ bool BGTactics::moveToObjective(bool ignoreDist)
// sServerFacade->GetDistance2d(bot, pos.x, pos.y); bot->Say(out.str(), LANG_UNIVERSAL); // sServerFacade->GetDistance2d(bot, pos.x, pos.y); bot->Say(out.str(), LANG_UNIVERSAL);
// dont increase from 1.5 will cause bugs with horde capping AV towers // dont increase from 1.5 will cause bugs with horde capping AV towers
return MoveNear(bot->GetMapId(), pos.x, pos.y, pos.z, 1.5f); return MoveNear(bot->GetMapId(), pos.x, pos.y, pos.z, 1.5f);
} }
return false; return false;
} }
@ -3549,14 +3549,14 @@ bool BGTactics::startNewPathFree(std::vector<BattleBotPath*> const& vPaths)
/** /**
* @brief Handles flag/base capturing gameplay in battlegrounds * @brief Handles flag/base capturing gameplay in battlegrounds
* *
* This function manages the logic for capturing flags and bases in various battlegrounds. * This function manages the logic for capturing flags and bases in various battlegrounds.
* It handles: * It handles:
* - Enemy detection and combat near objectives * - Enemy detection and combat near objectives
* - Coordination with friendly players who are capturing * - Coordination with friendly players who are capturing
* - Different capture mechanics for each battleground type * - Different capture mechanics for each battleground type
* - Proper positioning and movement * - Proper positioning and movement
* *
* @param vPaths Vector of possible paths the bot can take * @param vPaths Vector of possible paths the bot can take
* @param vFlagIds Vector of flag/base GameObjects that can be captured * @param vFlagIds Vector of flag/base GameObjects that can be captured
* @return true if handling a flag/base action, false otherwise * @return true if handling a flag/base action, false otherwise
@ -3687,7 +3687,7 @@ bool BGTactics::atFlag(std::vector<BattleBotPath*> const& vPaths, std::vector<ui
float y = bot->GetPositionY() + 5.0f * sin(angle); float y = bot->GetPositionY() + 5.0f * sin(angle);
MoveTo(bot->GetMapId(), x, y, bot->GetPositionZ()); MoveTo(bot->GetMapId(), x, y, bot->GetPositionZ());
} }
// Reset objective and take new path for defending // Reset objective and take new path for defending
resetObjective(); resetObjective();
if (!startNewPathBegin(vPaths)) if (!startNewPathBegin(vPaths))
@ -3895,7 +3895,7 @@ bool BGTactics::protectFC()
float fcY = teamFC->GetPositionY(); float fcY = teamFC->GetPositionY();
float fcZ = teamFC->GetPositionZ(); float fcZ = teamFC->GetPositionZ();
uint32 mapId = bot->GetMapId(); uint32 mapId = bot->GetMapId();
return MoveNear(mapId, fcX, fcY, fcZ, 5.0f, MovementPriority::MOVEMENT_NORMAL); return MoveNear(mapId, fcX, fcY, fcZ, 5.0f, MovementPriority::MOVEMENT_NORMAL);
} }

View File

@ -67,14 +67,14 @@ bool BuyAction::Execute(Event event)
calculator.SetOverflowPenalty(false); calculator.SetOverflowPenalty(false);
std::sort(m_items_sorted.begin(), m_items_sorted.end(), std::sort(m_items_sorted.begin(), m_items_sorted.end(),
[&calculator](VendorItem* i, VendorItem* j) [&calculator](VendorItem* i, VendorItem* j)
{ {
ItemTemplate const* item1 = sObjectMgr->GetItemTemplate(i->item); ItemTemplate const* item1 = sObjectMgr->GetItemTemplate(i->item);
ItemTemplate const* item2 = sObjectMgr->GetItemTemplate(j->item); ItemTemplate const* item2 = sObjectMgr->GetItemTemplate(j->item);
if (!item1 || !item2) if (!item1 || !item2)
return false; return false;
float score1 = calculator.CalculateItem(item1->ItemId); float score1 = calculator.CalculateItem(item1->ItemId);
float score2 = calculator.CalculateItem(item2->ItemId); float score2 = calculator.CalculateItem(item2->ItemId);
@ -88,19 +88,19 @@ bool BuyAction::Execute(Event event)
}); });
std::unordered_map<uint32, float> bestPurchasedItemScore; // Track best item score per InventoryType std::unordered_map<uint32, float> bestPurchasedItemScore; // Track best item score per InventoryType
for (auto& tItem : m_items_sorted) for (auto& tItem : m_items_sorted)
{ {
uint32 maxPurchases = 1; // Default to buying once uint32 maxPurchases = 1; // Default to buying once
ItemTemplate const* proto = sObjectMgr->GetItemTemplate(tItem->item); ItemTemplate const* proto = sObjectMgr->GetItemTemplate(tItem->item);
if (!proto) if (!proto)
continue; continue;
if (proto->Class == ITEM_CLASS_CONSUMABLE || proto->Class == ITEM_CLASS_PROJECTILE) if (proto->Class == ITEM_CLASS_CONSUMABLE || proto->Class == ITEM_CLASS_PROJECTILE)
{ {
maxPurchases = 10; // Allow up to 10 purchases if it's a consumable or projectile maxPurchases = 10; // Allow up to 10 purchases if it's a consumable or projectile
} }
for (uint32 i = 0; i < maxPurchases; i++) for (uint32 i = 0; i < maxPurchases; i++)
{ {
ItemUsage usage = AI_VALUE2(ItemUsage, "item usage", tItem->item); ItemUsage usage = AI_VALUE2(ItemUsage, "item usage", tItem->item);

View File

@ -47,10 +47,10 @@ bool CastCustomSpellAction::Execute(Event event)
{ {
if (!target) if (!target)
target = botAI->GetUnit(go); target = botAI->GetUnit(go);
if (!botAI->GetUnit(go) || !botAI->GetUnit(go)->IsInWorld()) if (!botAI->GetUnit(go) || !botAI->GetUnit(go)->IsInWorld())
continue; continue;
chat->eraseAllSubStr(text, chat->FormatWorldobject(botAI->GetUnit(go))); chat->eraseAllSubStr(text, chat->FormatWorldobject(botAI->GetUnit(go)));
} }

View File

@ -12,7 +12,7 @@
#include "PlayerbotFactory.h" #include "PlayerbotFactory.h"
#include "Playerbots.h" #include "Playerbots.h"
#include "AiObjectContext.h" #include "AiObjectContext.h"
#include "Log.h" #include "Log.h"
bool ChangeTalentsAction::Execute(Event event) bool ChangeTalentsAction::Execute(Event event)
{ {

View File

@ -66,7 +66,7 @@ bool CheckMountStateAction::isUseful()
// Get shapeshift states, only applicable when there's a master // Get shapeshift states, only applicable when there's a master
if (master) if (master)
{ {
botInShapeshiftForm = bot->GetShapeshiftForm(); botInShapeshiftForm = bot->GetShapeshiftForm();
masterInShapeshiftForm = master->GetShapeshiftForm(); masterInShapeshiftForm = master->GetShapeshiftForm();
} }

View File

@ -195,7 +195,7 @@ bool ChooseRpgTargetAction::Execute(Event event)
} }
} }
} }
// if (possiblePlayers.size() > 200 || HasSameTarget(guidP, urand(5, 15), possiblePlayers)) // if (possiblePlayers.size() > 200 || HasSameTarget(guidP, urand(5, 15), possiblePlayers))
// continue; // continue;

View File

@ -86,11 +86,11 @@ bool DropTargetAction::Execute(Event event)
if (bot->getClass() == CLASS_HUNTER) // Check for Hunter Class if (bot->getClass() == CLASS_HUNTER) // Check for Hunter Class
{ {
Spell const* spell = bot->GetCurrentSpell(CURRENT_AUTOREPEAT_SPELL); // Get the current spell being cast by the bot Spell const* spell = bot->GetCurrentSpell(CURRENT_AUTOREPEAT_SPELL); // Get the current spell being cast by the bot
if (spell && spell->m_spellInfo->Id == 75) //Check spell is not nullptr before accessing m_spellInfo if (spell && spell->m_spellInfo->Id == 75) //Check spell is not nullptr before accessing m_spellInfo
{ {
bot->InterruptSpell(CURRENT_AUTOREPEAT_SPELL); // Interrupt Auto Shot bot->InterruptSpell(CURRENT_AUTOREPEAT_SPELL); // Interrupt Auto Shot
} }
} }
bot->AttackStop(); bot->AttackStop();
// if (Pet* pet = bot->GetPet()) // if (Pet* pet = bot->GetPet())

View File

@ -16,7 +16,7 @@ bool ChooseTravelTargetAction::Execute(Event event)
//Get the current travel target. This target is no longer active. //Get the current travel target. This target is no longer active.
TravelTarget* oldTarget = context->GetValue<TravelTarget*>("travel target")->Get(); TravelTarget* oldTarget = context->GetValue<TravelTarget*>("travel target")->Get();
//Select a new target to travel to. //Select a new target to travel to.
TravelTarget newTarget = TravelTarget(botAI); TravelTarget newTarget = TravelTarget(botAI);
if (!oldTarget) return false; if (!oldTarget) return false;
@ -146,7 +146,7 @@ void ChooseTravelTargetAction::getNewTarget(TravelTarget* newTarget, TravelTarge
foundTarget = SetBossTarget(newTarget); foundTarget = SetBossTarget(newTarget);
} }
} }
//Do quests (start, do, end) 95% chance //Do quests (start, do, end) 95% chance
if (!foundTarget && urand(1, 100) > 5) if (!foundTarget && urand(1, 100) > 5)
{ {

View File

@ -110,7 +110,7 @@ void EquipAction::EquipItem(Item* item)
WorldPackets::Item::AutoEquipItemSlot nicePacket(std::move(packet)); WorldPackets::Item::AutoEquipItemSlot nicePacket(std::move(packet));
nicePacket.Read(); nicePacket.Read();
bot->GetSession()->HandleAutoEquipItemSlotOpcode(nicePacket); bot->GetSession()->HandleAutoEquipItemSlotOpcode(nicePacket);
std::ostringstream out; std::ostringstream out;
out << "Equipping " << chat->FormatItem(itemProto) << " in ranged slot"; out << "Equipping " << chat->FormatItem(itemProto) << " in ranged slot";
botAI->TellMaster(out); botAI->TellMaster(out);
@ -123,7 +123,7 @@ void EquipAction::EquipItem(Item* item)
bool isWeapon = (itemProto->Class == ITEM_CLASS_WEAPON); bool isWeapon = (itemProto->Class == ITEM_CLASS_WEAPON);
bool canTitanGrip = bot->CanTitanGrip(); bool canTitanGrip = bot->CanTitanGrip();
bool canDualWield = bot->CanDualWield(); bool canDualWield = bot->CanDualWield();
bool isTwoHander = (invType == INVTYPE_2HWEAPON); bool isTwoHander = (invType == INVTYPE_2HWEAPON);
bool isValidTGWeapon = false; bool isValidTGWeapon = false;
if (canTitanGrip && isTwoHander) if (canTitanGrip && isTwoHander)
@ -208,24 +208,24 @@ void EquipAction::EquipItem(Item* item)
nicePacket.Read(); nicePacket.Read();
bot->GetSession()->HandleAutoEquipItemSlotOpcode(nicePacket); bot->GetSession()->HandleAutoEquipItemSlotOpcode(nicePacket);
} }
// Try moving old main hand weapon to offhand if beneficial // Try moving old main hand weapon to offhand if beneficial
if (mainHandItem && mainHandCanGoOff && (!offHandItem || mainHandScore > offHandScore)) if (mainHandItem && mainHandCanGoOff && (!offHandItem || mainHandScore > offHandScore))
{ {
const ItemTemplate* oldMHProto = mainHandItem->GetTemplate(); const ItemTemplate* oldMHProto = mainHandItem->GetTemplate();
WorldPacket offhandPacket(CMSG_AUTOEQUIP_ITEM_SLOT, 2); WorldPacket offhandPacket(CMSG_AUTOEQUIP_ITEM_SLOT, 2);
ObjectGuid oldMHGuid = mainHandItem->GetGUID(); ObjectGuid oldMHGuid = mainHandItem->GetGUID();
offhandPacket << oldMHGuid << uint8(EQUIPMENT_SLOT_OFFHAND); offhandPacket << oldMHGuid << uint8(EQUIPMENT_SLOT_OFFHAND);
WorldPackets::Item::AutoEquipItemSlot nicePacket(std::move(offhandPacket)); WorldPackets::Item::AutoEquipItemSlot nicePacket(std::move(offhandPacket));
nicePacket.Read(); nicePacket.Read();
bot->GetSession()->HandleAutoEquipItemSlotOpcode(nicePacket); bot->GetSession()->HandleAutoEquipItemSlotOpcode(nicePacket);
std::ostringstream moveMsg; std::ostringstream moveMsg;
moveMsg << "Main hand upgrade found. Moving " << chat->FormatItem(oldMHProto) << " to offhand"; moveMsg << "Main hand upgrade found. Moving " << chat->FormatItem(oldMHProto) << " to offhand";
botAI->TellMaster(moveMsg); botAI->TellMaster(moveMsg);
} }
std::ostringstream out; std::ostringstream out;
out << "Equipping " << chat->FormatItem(itemProto) << " in main hand"; out << "Equipping " << chat->FormatItem(itemProto) << " in main hand";
botAI->TellMaster(out); botAI->TellMaster(out);

View File

@ -10,7 +10,7 @@
#include "SpellMgr.h" #include "SpellMgr.h"
#include "DBCStores.h" #include "DBCStores.h"
#include "AiObjectContext.h" #include "AiObjectContext.h"
#include "Log.h" #include "Log.h"
#include <unordered_map> #include <unordered_map>
#include <sstream> #include <sstream>
@ -154,6 +154,6 @@ bool EquipGlyphsAction::Execute(Event event)
// Flag for custom glyphs // Flag for custom glyphs
botAI->GetAiObjectContext()->GetValue<bool>("custom_glyphs")->Set(true); botAI->GetAiObjectContext()->GetValue<bool>("custom_glyphs")->Set(true);
LOG_INFO("playerbots", "Custom Glyph Flag set to ON"); LOG_INFO("playerbots", "Custom Glyph Flag set to ON");
return true; return true;
} }

View File

@ -30,13 +30,13 @@ bool FollowAction::Execute(Event event)
WorldLocation loc = formation->GetLocation(); WorldLocation loc = formation->GetLocation();
if (Formation::IsNullLocation(loc) || loc.GetMapId() == -1) if (Formation::IsNullLocation(loc) || loc.GetMapId() == -1)
return false; return false;
MovementPriority priority = botAI->GetState() == BOT_STATE_COMBAT ? MovementPriority::MOVEMENT_COMBAT : MovementPriority::MOVEMENT_NORMAL; MovementPriority priority = botAI->GetState() == BOT_STATE_COMBAT ? MovementPriority::MOVEMENT_COMBAT : MovementPriority::MOVEMENT_NORMAL;
moved = MoveTo(loc.GetMapId(), loc.GetPositionX(), loc.GetPositionY(), loc.GetPositionZ(), false, false, false, moved = MoveTo(loc.GetMapId(), loc.GetPositionX(), loc.GetPositionY(), loc.GetPositionZ(), false, false, false,
true, priority, true); true, priority, true);
} }
// This section has been commented out because it was forcing the pet to // This section has been commented out because it was forcing the pet to
// follow the bot on every "follow" action tick, overriding any attack or // follow the bot on every "follow" action tick, overriding any attack or
// stay commands that might have been issued by the player. // stay commands that might have been issued by the player.
// if (Pet* pet = bot->GetPet()) // if (Pet* pet = bot->GetPet())

View File

@ -2,7 +2,7 @@
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it * Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
* and/or modify it under version 2 of the License, or (at your option), any later version. * and/or modify it under version 2 of the License, or (at your option), any later version.
*/ */
#include "GenericBuffUtils.h" #include "GenericBuffUtils.h"
#include "PlayerbotAIConfig.h" #include "PlayerbotAIConfig.h"
@ -146,7 +146,7 @@ namespace ai::buff
last = now; last = now;
} }
} }
} }
} }
return castName; return castName;
} }

View File

@ -2,7 +2,7 @@
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it * Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
* and/or modify it under version 2 of the License, or (at your option), any later version. * and/or modify it under version 2 of the License, or (at your option), any later version.
*/ */
#pragma once #pragma once
#include <string> #include <string>

View File

@ -243,7 +243,7 @@ bool BuffOnPartyAction::Execute(Event event)
return botAI->CastSpell(castName, GetTarget()); return botAI->CastSpell(castName, GetTarget());
} }
// End greater buff fix // End greater buff fix
CastShootAction::CastShootAction(PlayerbotAI* botAI) : CastSpellAction(botAI, "shoot") CastShootAction::CastShootAction(PlayerbotAI* botAI) : CastSpellAction(botAI, "shoot")
{ {
if (Item* const pItem = bot->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_RANGED)) if (Item* const pItem = bot->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_RANGED))
@ -322,14 +322,14 @@ bool CastVehicleSpellAction::Execute(Event event)
bool UseTrinketAction::Execute(Event event) bool UseTrinketAction::Execute(Event event)
{ {
Item* trinket1 = bot->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_TRINKET1); Item* trinket1 = bot->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_TRINKET1);
if (trinket1 && UseTrinket(trinket1)) if (trinket1 && UseTrinket(trinket1))
return true; return true;
Item* trinket2 = bot->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_TRINKET2); Item* trinket2 = bot->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_TRINKET2);
if (trinket2 && UseTrinket(trinket2)) if (trinket2 && UseTrinket(trinket2))
return true; return true;
return false; return false;
} }
@ -359,7 +359,7 @@ bool UseTrinketAction::UseTrinket(Item* item)
if (!spellInfo || !spellInfo->IsPositive()) if (!spellInfo || !spellInfo->IsPositive())
return false; return false;
bool applyAura = false; bool applyAura = false;
for (int i = 0; i < MAX_SPELL_EFFECTS; i++) for (int i = 0; i < MAX_SPELL_EFFECTS; i++)
{ {
@ -369,12 +369,12 @@ bool UseTrinketAction::UseTrinket(Item* item)
break; break;
} }
} }
if (!applyAura) if (!applyAura)
return false; return false;
uint32 spellProcFlag = spellInfo->ProcFlags; uint32 spellProcFlag = spellInfo->ProcFlags;
// Handle items with procflag "if you kill a target that grants honor or experience" // Handle items with procflag "if you kill a target that grants honor or experience"
// Bots will "learn" the trinket proc, so CanCastSpell() will be true // Bots will "learn" the trinket proc, so CanCastSpell() will be true
// e.g. on Item https://www.wowhead.com/wotlk/item=44074/oracle-talisman-of-ablution leading to // e.g. on Item https://www.wowhead.com/wotlk/item=44074/oracle-talisman-of-ablution leading to

View File

@ -29,7 +29,7 @@ public:
NextAction** getPrerequisites() override; NextAction** getPrerequisites() override;
std::string const getSpell() { return spell; } std::string const getSpell() { return spell; }
protected: protected:
std::string spell; std::string spell;
float range; float range;

View File

@ -209,7 +209,7 @@ bool GuildManageNearbyAction::Execute(Event event)
if (botAi->GetGuilderType() == GuilderType::SOLO && !botAi->HasRealPlayerMaster()) //Do not invite solo players. if (botAi->GetGuilderType() == GuilderType::SOLO && !botAi->HasRealPlayerMaster()) //Do not invite solo players.
continue; continue;
if (botAi->HasActivePlayerMaster() && !sRandomPlayerbotMgr->IsRandomBot(player)) //Do not invite alts of active players. if (botAi->HasActivePlayerMaster() && !sRandomPlayerbotMgr->IsRandomBot(player)) //Do not invite alts of active players.
continue; continue;
} }

View File

@ -30,7 +30,7 @@ bool PartyCommandAction::Execute(Event event)
Player* master = GetMaster(); Player* master = GetMaster();
if (master && member == master->GetName()) if (master && member == master->GetName())
return Leave(bot); return Leave(bot);
botAI->Reset(); botAI->Reset();
return false; return false;
@ -64,7 +64,7 @@ bool UninviteAction::Execute(Event event)
if (bot->GetGUID() == guid) if (bot->GetGUID() == guid)
return Leave(bot); return Leave(bot);
} }
botAI->Reset(); botAI->Reset();
return false; return false;
@ -162,7 +162,7 @@ bool LeaveFarAwayAction::isUseful()
{ {
return true; return true;
} }
botAI->Reset(); botAI->Reset();
return false; return false;

View File

@ -151,7 +151,7 @@ bool LfgJoinAction::JoinLFG()
// Set RbotAId Browser comment // Set RbotAId Browser comment
std::string const _gs = std::to_string(botAI->GetEquipGearScore(bot/*, false, false*/)); std::string const _gs = std::to_string(botAI->GetEquipGearScore(bot/*, false, false*/));
// JoinLfg is not threadsafe, so make packet and queue into session // JoinLfg is not threadsafe, so make packet and queue into session
// sLFGMgr->JoinLfg(bot, roleMask, list, _gs); // sLFGMgr->JoinLfg(bot, roleMask, list, _gs);
@ -180,7 +180,7 @@ bool LfgRoleCheckAction::Execute(Event event)
// if (currentRoles == newRoles) // if (currentRoles == newRoles)
// return false; // return false;
WorldPacket* packet = new WorldPacket(CMSG_LFG_SET_ROLES); WorldPacket* packet = new WorldPacket(CMSG_LFG_SET_ROLES);
*packet << (uint8)newRoles; *packet << (uint8)newRoles;
bot->GetSession()->QueuePacket(packet); bot->GetSession()->QueuePacket(packet);
@ -317,7 +317,7 @@ bool LfgJoinAction::isUseful()
if (bot->GetLevel() < 15) if (bot->GetLevel() < 15)
return false; return false;
// don't use if active player master // don't use if active player master
if (GET_PLAYERBOT_AI(bot)->IsRealPlayer()) if (GET_PLAYERBOT_AI(bot)->IsRealPlayer())
return false; return false;

View File

@ -139,17 +139,17 @@ std::vector<std::pair<uint32, std::string>> ListSpellsAction::GetSpellList(std::
{ {
if (itr->second->State == PLAYERSPELL_REMOVED || !itr->second->Active) if (itr->second->State == PLAYERSPELL_REMOVED || !itr->second->Active)
continue; continue;
if (!(itr->second->specMask & bot->GetActiveSpecMask())) if (!(itr->second->specMask & bot->GetActiveSpecMask()))
continue; continue;
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(itr->first); SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(itr->first);
if (!spellInfo) if (!spellInfo)
continue; continue;
if (spellInfo->IsPassive()) if (spellInfo->IsPassive())
continue; continue;
SkillLineAbilityEntry const* skillLine = skillSpells[itr->first]; SkillLineAbilityEntry const* skillLine = skillSpells[itr->first];
if (skill != SKILL_NONE && (!skillLine || skillLine->SkillLine != skill)) if (skill != SKILL_NONE && (!skillLine || skillLine->SkillLine != skill))
continue; continue;
@ -273,7 +273,7 @@ std::vector<std::pair<uint32, std::string>> ListSpellsAction::GetSpellList(std::
if (out.str().empty()) if (out.str().empty())
continue; continue;
if (itr->first == 0) if (itr->first == 0)
{ {
LOG_ERROR("playerbots", "?! {}", itr->first); LOG_ERROR("playerbots", "?! {}", itr->first);

View File

@ -19,7 +19,7 @@
#include "BroadcastHelper.h" #include "BroadcastHelper.h"
bool LootAction::Execute(Event /*event*/) bool LootAction::Execute(Event /*event*/)
{ {
if (!AI_VALUE(bool, "has available loot")) if (!AI_VALUE(bool, "has available loot"))
return false; return false;
@ -156,7 +156,7 @@ bool OpenLootAction::DoLoot(LootObject& lootObject)
uint32 spellId = GetOpeningSpell(lootObject); uint32 spellId = GetOpeningSpell(lootObject);
if (!spellId) if (!spellId)
return false; return false;
return botAI->CastSpell(spellId, bot); return botAI->CastSpell(spellId, bot);
} }

View File

@ -39,7 +39,7 @@ bool LootRollAction::Execute(Event event)
ItemTemplate const* proto = sObjectMgr->GetItemTemplate(itemId); ItemTemplate const* proto = sObjectMgr->GetItemTemplate(itemId);
if (!proto) if (!proto)
continue; continue;
std::string itemUsageParam; std::string itemUsageParam;
if (randomProperty != 0) { if (randomProperty != 0) {
itemUsageParam = std::to_string(itemId) + "," + std::to_string(randomProperty); itemUsageParam = std::to_string(itemId) + "," + std::to_string(randomProperty);
@ -47,7 +47,7 @@ bool LootRollAction::Execute(Event event)
itemUsageParam = std::to_string(itemId); itemUsageParam = std::to_string(itemId);
} }
ItemUsage usage = AI_VALUE2(ItemUsage, "item usage", itemUsageParam); ItemUsage usage = AI_VALUE2(ItemUsage, "item usage", itemUsageParam);
// Armor Tokens are classed as MISC JUNK (Class 15, Subclass 0), luckily no other items I found have class bits and epic quality. // Armor Tokens are classed as MISC JUNK (Class 15, Subclass 0), luckily no other items I found have class bits and epic quality.
if (proto->Class == ITEM_CLASS_MISC && proto->SubClass == ITEM_SUBCLASS_JUNK && proto->Quality == ITEM_QUALITY_EPIC) if (proto->Class == ITEM_CLASS_MISC && proto->SubClass == ITEM_SUBCLASS_JUNK && proto->Quality == ITEM_QUALITY_EPIC)
{ {
@ -93,7 +93,7 @@ bool LootRollAction::Execute(Event event)
{ {
vote = PASS; vote = PASS;
} }
else else
{ {
vote = GREED; vote = GREED;
} }
@ -228,7 +228,7 @@ bool RollUniqueCheck(ItemTemplate const* proto, Player* bot)
bool RollAction::Execute(Event event) bool RollAction::Execute(Event event)
{ {
std::string link = event.getParam(); std::string link = event.getParam();
if (link.empty()) if (link.empty())
{ {
bot->DoRandomRoll(0,100); bot->DoRandomRoll(0,100);
@ -245,7 +245,7 @@ bool RollAction::Execute(Event event)
} }
std::string itemUsageParam; std::string itemUsageParam;
itemUsageParam = std::to_string(itemId); itemUsageParam = std::to_string(itemId);
ItemUsage usage = AI_VALUE2(ItemUsage, "item usage", itemUsageParam); ItemUsage usage = AI_VALUE2(ItemUsage, "item usage", itemUsageParam);
switch (proto->Class) switch (proto->Class)
{ {

View File

@ -1040,7 +1040,7 @@ void MovementAction::UpdateMovementState()
// Save current state for the next check // Save current state for the next check
wasMovementRestricted = isCurrentlyRestricted; wasMovementRestricted = isCurrentlyRestricted;
// Temporary speed increase in group // Temporary speed increase in group
// if (botAI->HasRealPlayerMaster()) { // if (botAI->HasRealPlayerMaster()) {
// bot->SetSpeedRate(MOVE_RUN, 1.1f); // bot->SetSpeedRate(MOVE_RUN, 1.1f);
@ -2412,7 +2412,7 @@ bool TankFaceAction::Execute(Event event)
if (!AI_VALUE2(bool, "has aggro", "current target")) if (!AI_VALUE2(bool, "has aggro", "current target"))
return false; return false;
float averageAngle = AverageGroupAngle(target, true); float averageAngle = AverageGroupAngle(target, true);
if (averageAngle == 0.0f) if (averageAngle == 0.0f)
@ -2435,7 +2435,7 @@ bool TankFaceAction::Execute(Event event)
std::vector<Position> availablePos; std::vector<Position> availablePos;
float x, y, z; float x, y, z;
target->GetNearPoint(bot, x, y, z, 0.0f, dist, goodAngle1); target->GetNearPoint(bot, x, y, z, 0.0f, dist, goodAngle1);
if (bot->GetMap()->CheckCollisionAndGetValidCoords(bot, bot->GetPositionX(), bot->GetPositionY(), bot->GetPositionZ(), if (bot->GetMap()->CheckCollisionAndGetValidCoords(bot, bot->GetPositionX(), bot->GetPositionY(), bot->GetPositionZ(),
x, y, z)) x, y, z))
{ {
/// @todo: movement control now is a mess, prepare to rewrite /// @todo: movement control now is a mess, prepare to rewrite
@ -2448,7 +2448,7 @@ bool TankFaceAction::Execute(Event event)
} }
} }
target->GetNearPoint(bot, x, y, z, 0.0f, dist, goodAngle2); target->GetNearPoint(bot, x, y, z, 0.0f, dist, goodAngle2);
if (bot->GetMap()->CheckCollisionAndGetValidCoords(bot, bot->GetPositionX(), bot->GetPositionY(), bot->GetPositionZ(), if (bot->GetMap()->CheckCollisionAndGetValidCoords(bot, bot->GetPositionX(), bot->GetPositionY(), bot->GetPositionZ(),
x, y, z)) x, y, z))
{ {
std::list<FleeInfo>& infoList = AI_VALUE(std::list<FleeInfo>&, "recently flee info"); std::list<FleeInfo>& infoList = AI_VALUE(std::list<FleeInfo>&, "recently flee info");
@ -2500,7 +2500,7 @@ bool RearFlankAction::Execute(Event event)
{ {
destination = &rightFlank; destination = &rightFlank;
} }
return MoveTo(bot->GetMapId(), destination->GetPositionX(), destination->GetPositionY(), destination->GetPositionZ(), return MoveTo(bot->GetMapId(), destination->GetPositionX(), destination->GetPositionY(), destination->GetPositionZ(),
false, false, false, true, MovementPriority::MOVEMENT_COMBAT); false, false, false, true, MovementPriority::MOVEMENT_COMBAT);
} }
@ -2666,7 +2666,7 @@ bool SetBehindTargetAction::Execute(Event event)
std::vector<Position> availablePos; std::vector<Position> availablePos;
float x, y, z; float x, y, z;
target->GetNearPoint(bot, x, y, z, 0.0f, dist, goodAngle1); target->GetNearPoint(bot, x, y, z, 0.0f, dist, goodAngle1);
if (bot->GetMap()->CheckCollisionAndGetValidCoords(bot, bot->GetPositionX(), bot->GetPositionY(), bot->GetPositionZ(), if (bot->GetMap()->CheckCollisionAndGetValidCoords(bot, bot->GetPositionX(), bot->GetPositionY(), bot->GetPositionZ(),
x, y, z)) x, y, z))
{ {
/// @todo: movement control now is a mess, prepare to rewrite /// @todo: movement control now is a mess, prepare to rewrite
@ -2679,7 +2679,7 @@ bool SetBehindTargetAction::Execute(Event event)
} }
} }
target->GetNearPoint(bot, x, y, z, 0.0f, dist, goodAngle2); target->GetNearPoint(bot, x, y, z, 0.0f, dist, goodAngle2);
if (bot->GetMap()->CheckCollisionAndGetValidCoords(bot, bot->GetPositionX(), bot->GetPositionY(), bot->GetPositionZ(), if (bot->GetMap()->CheckCollisionAndGetValidCoords(bot, bot->GetPositionX(), bot->GetPositionY(), bot->GetPositionZ(),
x, y, z)) x, y, z))
{ {
std::list<FleeInfo>& infoList = AI_VALUE(std::list<FleeInfo>&, "recently flee info"); std::list<FleeInfo>& infoList = AI_VALUE(std::list<FleeInfo>&, "recently flee info");

View File

@ -186,7 +186,7 @@ void OutfitAction::Update(std::string const name)
{ {
ListItemsVisitor visitor; ListItemsVisitor visitor;
IterateItems(&visitor, ITERATE_ITEMS_IN_EQUIP); IterateItems(&visitor, ITERATE_ITEMS_IN_EQUIP);
ItemIds items; ItemIds items;
for (std::map<uint32, uint32>::iterator i = visitor.items.begin(); i != visitor.items.end(); ++i) for (std::map<uint32, uint32>::iterator i = visitor.items.begin(); i != visitor.items.end(); ++i)
items.insert(i->first); items.insert(i->first);

View File

@ -23,7 +23,7 @@ public:
private: private:
bool warningEnabled = true; bool warningEnabled = true;
std::string defaultCmd; std::string defaultCmd;
}; };
#endif #endif

View File

@ -113,7 +113,7 @@ bool QueryQuestAction::Execute(Event event)
void QueryQuestAction::TellObjectives(uint32 questId) void QueryQuestAction::TellObjectives(uint32 questId)
{ {
Quest const* questTemplate = sObjectMgr->GetQuestTemplate(questId); Quest const* questTemplate = sObjectMgr->GetQuestTemplate(questId);
// Checks if the questTemplate is valid // Checks if the questTemplate is valid
if (!questTemplate) if (!questTemplate)
{ {

View File

@ -278,7 +278,7 @@ bool QuestUpdateCompleteAction::Execute(Event event)
{ {
// std::map<std::string, std::string> placeholders; // std::map<std::string, std::string> placeholders;
// placeholders["%quest_link"] = format; // placeholders["%quest_link"] = format;
// if (botAI->HasStrategy("debug quest", BotState::BOT_STATE_NON_COMBAT) || botAI->HasStrategy("debug rpg", BotState::BOT_STATE_COMBAT)) // if (botAI->HasStrategy("debug quest", BotState::BOT_STATE_NON_COMBAT) || botAI->HasStrategy("debug rpg", BotState::BOT_STATE_COMBAT))
// { // {
// LOG_INFO("playerbots", "{} => Quest [ {} ] completed", bot->GetName(), qInfo->GetTitle()); // LOG_INFO("playerbots", "{} => Quest [ {} ] completed", bot->GetName(), qInfo->GetTitle());
@ -338,7 +338,7 @@ bool QuestUpdateAddKillAction::Execute(Event event)
botAI->TellMasterNoFacing(out.str()); botAI->TellMasterNoFacing(out.str());
} }
} }
} }
return false; return false;
} }
@ -373,7 +373,7 @@ bool QuestUpdateAddItemAction::Execute(Event event)
BroadcastHelper::BroadcastQuestUpdateAddItem(botAI, bot, pair.first, availableItemsCount, requiredItemsCount, itemPrototype); BroadcastHelper::BroadcastQuestUpdateAddItem(botAI, bot, pair.first, availableItemsCount, requiredItemsCount, itemPrototype);
} }
} }
return false; return false;
} }
@ -390,7 +390,7 @@ bool QuestItemPushResultAction::Execute(Event event)
if (guid != bot->GetGUID()) if (guid != bot->GetGUID())
return false; return false;
const ItemTemplate* proto = sObjectMgr->GetItemTemplate(itemEntry); const ItemTemplate* proto = sObjectMgr->GetItemTemplate(itemEntry);
if (!proto) if (!proto)
return false; return false;
@ -406,13 +406,13 @@ bool QuestItemPushResultAction::Execute(Event event)
return false; return false;
const QuestStatusData& q_status = bot->getQuestStatusMap().at(questId); const QuestStatusData& q_status = bot->getQuestStatusMap().at(questId);
for (int i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; i++) for (int i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; i++)
{ {
uint32 itemId = quest->RequiredItemId[i]; uint32 itemId = quest->RequiredItemId[i];
if (!itemId) if (!itemId)
continue; continue;
int32 previousCount = itemCount - count; int32 previousCount = itemCount - count;
if (itemId == itemEntry && previousCount < quest->RequiredItemCount[i]) if (itemId == itemEntry && previousCount < quest->RequiredItemCount[i])
{ {

View File

@ -20,7 +20,7 @@ bool ReleaseSpiritAction::Execute(Event event)
{ {
if (bot->IsAlive()) if (bot->IsAlive())
{ {
if (!bot->InBattleground()) if (!bot->InBattleground())
{ {
botAI->TellMasterNoFacing("I am not dead, will wait here"); botAI->TellMasterNoFacing("I am not dead, will wait here");
// -follow in bg is overwriten each tick with +follow // -follow in bg is overwriten each tick with +follow
@ -38,8 +38,8 @@ bool ReleaseSpiritAction::Execute(Event event)
} }
const WorldPacket& packet = event.getPacket(); const WorldPacket& packet = event.getPacket();
const std::string message = !packet.empty() && packet.GetOpcode() == CMSG_REPOP_REQUEST const std::string message = !packet.empty() && packet.GetOpcode() == CMSG_REPOP_REQUEST
? "Releasing..." ? "Releasing..."
: "Meet me at the graveyard"; : "Meet me at the graveyard";
botAI->TellMasterNoFacing(message); botAI->TellMasterNoFacing(message);
@ -89,7 +89,7 @@ bool AutoReleaseSpiritAction::Execute(Event event)
bot->GetSession()->HandleRepopRequestOpcode(packet); bot->GetSession()->HandleRepopRequestOpcode(packet);
LogRelease("releases spirit", true); LogRelease("releases spirit", true);
if (bot->InBattleground()) if (bot->InBattleground())
{ {
return HandleBattlegroundSpiritHealer(); return HandleBattlegroundSpiritHealer();
@ -117,8 +117,8 @@ bool AutoReleaseSpiritAction::HandleBattlegroundSpiritHealer()
{ {
constexpr uint32_t RESURRECT_DELAY = 15; constexpr uint32_t RESURRECT_DELAY = 15;
const time_t now = time(nullptr); const time_t now = time(nullptr);
if ((now - m_bgGossipTime < RESURRECT_DELAY) && if ((now - m_bgGossipTime < RESURRECT_DELAY) &&
bot->HasAura(SPELL_WAITING_FOR_RESURRECT)) bot->HasAura(SPELL_WAITING_FOR_RESURRECT))
{ {
return false; return false;
@ -174,9 +174,9 @@ bool AutoReleaseSpiritAction::ShouldAutoRelease() const
if (!botAI->HasActivePlayerMaster()) if (!botAI->HasActivePlayerMaster())
return true; return true;
if (botAI->HasActivePlayerMaster() && if (botAI->HasActivePlayerMaster() &&
groupMaster->GetMapId() == bot->GetMapId() && groupMaster->GetMapId() == bot->GetMapId() &&
bot->GetMap() && bot->GetMap() &&
(bot->GetMap()->IsRaid() || bot->GetMap()->IsDungeon())) (bot->GetMap()->IsRaid() || bot->GetMap()->IsDungeon()))
{ {
return false; return false;
@ -218,7 +218,7 @@ bool AutoReleaseSpiritAction::ShouldDelayBattlegroundRelease() const
bool RepopAction::Execute(Event event) bool RepopAction::Execute(Event event)
{ {
const GraveyardStruct* graveyard = GetGrave( const GraveyardStruct* graveyard = GetGrave(
AI_VALUE(uint32, "death count") > 10 || AI_VALUE(uint32, "death count") > 10 ||
CalculateDeadTime() > 30 * MINUTE CalculateDeadTime() > 30 * MINUTE
); );
@ -238,7 +238,7 @@ int64 RepopAction::CalculateDeadTime() const
{ {
if (Corpse* corpse = bot->GetCorpse()) if (Corpse* corpse = bot->GetCorpse())
return time(nullptr) - corpse->GetGhostTime(); return time(nullptr) - corpse->GetGhostTime();
return bot->isDead() ? 0 : 60 * MINUTE; return bot->isDead() ? 0 : 60 * MINUTE;
} }

View File

@ -28,7 +28,7 @@ protected:
void toxicLinks(); void toxicLinks();
void somethingToxic(); void somethingToxic();
void thunderfury(); void thunderfury();
std::vector<uint32> GetIncompletedQuests(); std::vector<uint32> GetIncompletedQuests();
private: private:

View File

@ -102,7 +102,7 @@ void TalkToQuestGiverAction::RewardNoItem(Quest const* quest, Object* questGiver
{ {
std::map<std::string, std::string> args; std::map<std::string, std::string> args;
args["%quest"] = chat->FormatQuest(quest); args["%quest"] = chat->FormatQuest(quest);
if (bot->CanRewardQuest(quest, false)) if (bot->CanRewardQuest(quest, false))
{ {
out << BOT_TEXT2("quest_status_completed", args); out << BOT_TEXT2("quest_status_completed", args);

View File

@ -13,13 +13,13 @@ bool TeleportAction::Execute(Event event)
{ {
/* /*
// List of allowed portal entries (you can populate this dynamically) // List of allowed portal entries (you can populate this dynamically)
std::vector<uint32> allowedPortals = { std::vector<uint32> allowedPortals = {
187055, 195142, 195141, 201797, 202079, 194481, 195682, 191164, 176498, 182351, 187055, 195142, 195141, 201797, 202079, 194481, 195682, 191164, 176498, 182351,
178404, 176497, 181146, 184605, 176499, 195140, 193948, 193427, 193052, 193206, 178404, 176497, 181146, 184605, 176499, 195140, 193948, 193427, 193052, 193206,
192786, 184594, 183384, 182352, 184604, 189994, 193053, 193207, 193956, 195139, 192786, 184594, 183384, 182352, 184604, 189994, 193053, 193207, 193956, 195139,
176296, 194011, 194012, 189993, 176500, 176501, 193955, 193425, 193772, 193604, 176296, 194011, 194012, 189993, 176500, 176501, 193955, 193425, 193772, 193604,
191006, 191007, 191008, 191009, 191013, 191014, 191010, 190960, 191011, 191012, 191006, 191007, 191008, 191009, 191013, 191014, 191010, 190960, 191011, 191012,
183317, 183321, 183322, 187056, 183323, 183324, 183325, 183326, 183327, 190203, 183317, 183321, 183322, 187056, 183323, 183324, 183325, 183326, 183327, 190203,
190204, 190205, 190206, 193908, 181575, 181576, 181577, 181578, 202277, 202278 190204, 190205, 190206, 193908, 181575, 181576, 181577, 181578, 202277, 202278
}; };
@ -60,7 +60,7 @@ bool TeleportAction::Execute(Event event)
return true; return true;
} }
*/ */
// If no portal was found, fallback to spellcaster-type game objects // If no portal was found, fallback to spellcaster-type game objects
GuidVector gos = *context->GetValue<GuidVector>("nearest game objects"); GuidVector gos = *context->GetValue<GuidVector>("nearest game objects");
for (ObjectGuid const guid : gos) for (ObjectGuid const guid : gos)
@ -91,7 +91,7 @@ bool TeleportAction::Execute(Event event)
spell->cast(true); spell->cast(true);
return true; return true;
} }
// If no game objects were found, try using the last area trigger // If no game objects were found, try using the last area trigger
LastMovement& movement = context->GetValue<LastMovement&>("last area trigger")->Get(); LastMovement& movement = context->GetValue<LastMovement&>("last area trigger")->Get();
if (movement.lastAreaTrigger) if (movement.lastAreaTrigger)

View File

@ -24,7 +24,7 @@ bool TradeStatusAction::Execute(Event event)
return false; return false;
PlayerbotAI* traderBotAI = GET_PLAYERBOT_AI(trader); PlayerbotAI* traderBotAI = GET_PLAYERBOT_AI(trader);
// Allow the master and group members to trade // Allow the master and group members to trade
if (trader != master && !traderBotAI && (!bot->GetGroup() || !bot->GetGroup()->IsMember(trader->GetGUID()))) if (trader != master && !traderBotAI && (!bot->GetGroup() || !bot->GetGroup()->IsMember(trader->GetGUID())))
{ {
@ -181,7 +181,7 @@ bool TradeStatusAction::CheckTrade()
break; break;
} }
} }
if (isGettingItem) if (isGettingItem)
{ {
if (bot->GetGroup() && bot->GetGroup()->IsMember(bot->GetTrader()->GetGUID()) && if (bot->GetGroup() && bot->GetGroup()->IsMember(bot->GetTrader()->GetGUID()) &&

View File

@ -66,7 +66,7 @@ bool UnlockTradedItemAction::CanUnlockItem(Item* item)
else else
{ {
std::ostringstream out; std::ostringstream out;
out << "Lockpicking skill too low (" << botSkill << "/" << requiredSkill << ") to unlock: " out << "Lockpicking skill too low (" << botSkill << "/" << requiredSkill << ") to unlock: "
<< item->GetTemplate()->Name1; << item->GetTemplate()->Name1;
botAI->TellMaster(out.str()); botAI->TellMaster(out.str());
} }

View File

@ -169,7 +169,7 @@ bool SummonAction::Teleport(Player* summoner, Player* player)
// Player* master = GetMaster(); // Player* master = GetMaster();
if (!summoner) if (!summoner)
return false; return false;
if (player->GetVehicle()) if (player->GetVehicle())
{ {
botAI->TellError("You cannot summon me while I'm on a vehicle"); botAI->TellError("You cannot summon me while I'm on a vehicle");

View File

@ -23,7 +23,7 @@ bool EnterVehicleAction::Execute(Event event)
// do not switch vehicles yet // do not switch vehicles yet
if (bot->GetVehicle()) if (bot->GetVehicle())
return false; return false;
Player* master = botAI->GetMaster(); Player* master = botAI->GetMaster();
// Triggered by a chat command // Triggered by a chat command
if (event.getOwner() && master && master->GetTarget()) if (event.getOwner() && master && master->GetTarget())
@ -45,7 +45,7 @@ bool EnterVehicleAction::Execute(Event event)
Unit* vehicleBase = botAI->GetUnit(*i); Unit* vehicleBase = botAI->GetUnit(*i);
if (!vehicleBase) if (!vehicleBase)
continue; continue;
if (vehicleBase->HasUnitFlag(UNIT_FLAG_NOT_SELECTABLE)) if (vehicleBase->HasUnitFlag(UNIT_FLAG_NOT_SELECTABLE))
continue; continue;

View File

@ -86,7 +86,7 @@ public:
creators["quest update complete"] = &WorldPacketActionContext::quest_update_complete; creators["quest update complete"] = &WorldPacketActionContext::quest_update_complete;
creators["turn in query quest"] = &WorldPacketActionContext::turn_in_query_quest; creators["turn in query quest"] = &WorldPacketActionContext::turn_in_query_quest;
creators["quest item push result"] = &WorldPacketActionContext::quest_item_push_result; creators["quest item push result"] = &WorldPacketActionContext::quest_item_push_result;
creators["party command"] = &WorldPacketActionContext::party_command; creators["party command"] = &WorldPacketActionContext::party_command;
creators["tell cast failed"] = &WorldPacketActionContext::tell_cast_failed; creators["tell cast failed"] = &WorldPacketActionContext::tell_cast_failed;
creators["accept duel"] = &WorldPacketActionContext::accept_duel; creators["accept duel"] = &WorldPacketActionContext::accept_duel;

View File

@ -43,7 +43,7 @@ bool XpGainAction::Execute(Event event)
// randomBotXPRate is now implemented in OnPlayerGiveXP script // randomBotXPRate is now implemented in OnPlayerGiveXP script
// if (!sRandomPlayerbotMgr->IsRandomBot(bot) || sPlayerbotAIConfig->randomBotXPRate == 1) // if (!sRandomPlayerbotMgr->IsRandomBot(bot) || sPlayerbotAIConfig->randomBotXPRate == 1)
// return true; // return true;
// Unit* victim = nullptr; // Unit* victim = nullptr;
// if (guid) // if (guid)
// victim = botAI->GetUnit(guid); // victim = botAI->GetUnit(guid);

View File

@ -73,6 +73,6 @@ bool DeathAndDecayCooldownTrigger::IsActive()
uint32 spellId = AI_VALUE2(uint32, "spell id", name); uint32 spellId = AI_VALUE2(uint32, "spell id", name);
if (!spellId) if (!spellId)
return true; return true;
return bot->GetSpellCooldownDelay(spellId) >= 2000; return bot->GetSpellCooldownDelay(spellId) >= 2000;
} }

View File

@ -184,7 +184,7 @@ void GenericDKStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
"horn of winter", NextAction::array(0, new NextAction("horn of winter", ACTION_NORMAL + 1), nullptr))); "horn of winter", NextAction::array(0, new NextAction("horn of winter", ACTION_NORMAL + 1), nullptr)));
triggers.push_back(new TriggerNode("critical health", triggers.push_back(new TriggerNode("critical health",
NextAction::array(0, new NextAction("death pact", ACTION_HIGH + 5), nullptr))); NextAction::array(0, new NextAction("death pact", ACTION_HIGH + 5), nullptr)));
triggers.push_back( triggers.push_back(
new TriggerNode("low health", NextAction::array(0, new NextAction("icebound fortitude", ACTION_HIGH + 5), new TriggerNode("low health", NextAction::array(0, new NextAction("icebound fortitude", ACTION_HIGH + 5),
new NextAction("rune tap", ACTION_HIGH + 4), nullptr))); new NextAction("rune tap", ACTION_HIGH + 4), nullptr)));

View File

@ -90,7 +90,7 @@ void UnholyDKStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
{ {
GenericDKStrategy::InitTriggers(triggers); GenericDKStrategy::InitTriggers(triggers);
triggers.push_back(new TriggerNode( triggers.push_back(new TriggerNode(
"death and decay cooldown", NextAction::array(0, "death and decay cooldown", NextAction::array(0,
new NextAction("ghoul frenzy", ACTION_DEFAULT + 0.9f), new NextAction("ghoul frenzy", ACTION_DEFAULT + 0.9f),
new NextAction("scourge strike", ACTION_DEFAULT + 0.8f), new NextAction("scourge strike", ACTION_DEFAULT + 0.8f),
new NextAction("icy touch", ACTION_DEFAULT + 0.7f), new NextAction("icy touch", ACTION_DEFAULT + 0.7f),
@ -107,7 +107,7 @@ void UnholyDKStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
// "plague strike", NextAction::array(0, new NextAction("plague strike", ACTION_HIGH + 1), nullptr))); // "plague strike", NextAction::array(0, new NextAction("plague strike", ACTION_HIGH + 1), nullptr)));
triggers.push_back(new TriggerNode( triggers.push_back(new TriggerNode(
"high frost rune", NextAction::array(0, "high frost rune", NextAction::array(0,
new NextAction("icy touch", ACTION_NORMAL + 3), nullptr))); new NextAction("icy touch", ACTION_NORMAL + 3), nullptr)));
triggers.push_back(new TriggerNode( triggers.push_back(new TriggerNode(

View File

@ -133,7 +133,7 @@ void CasterDruidStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
NextAction::array(0, new NextAction("starfire", ACTION_DEFAULT + 0.2f), nullptr))); NextAction::array(0, new NextAction("starfire", ACTION_DEFAULT + 0.2f), nullptr)));
triggers.push_back(new TriggerNode("eclipse (solar) cooldown", triggers.push_back(new TriggerNode("eclipse (solar) cooldown",
NextAction::array(0, new NextAction("wrath", ACTION_DEFAULT + 0.2f), nullptr))); NextAction::array(0, new NextAction("wrath", ACTION_DEFAULT + 0.2f), nullptr)));
triggers.push_back(new TriggerNode( triggers.push_back(new TriggerNode(
"insect swarm", NextAction::array(0, new NextAction("insect swarm", ACTION_NORMAL + 5), nullptr))); "insect swarm", NextAction::array(0, new NextAction("insect swarm", ACTION_NORMAL + 5), nullptr)));
triggers.push_back( triggers.push_back(

View File

@ -14,7 +14,7 @@ class DruidAiObjectContext : public AiObjectContext
{ {
public: public:
DruidAiObjectContext(PlayerbotAI* botAI); DruidAiObjectContext(PlayerbotAI* botAI);
static void BuildSharedContexts(); static void BuildSharedContexts();
static void BuildSharedStrategyContexts(SharedNamedObjectContextList<Strategy>& strategyContexts); static void BuildSharedStrategyContexts(SharedNamedObjectContextList<Strategy>& strategyContexts);
static void BuildSharedActionContexts(SharedNamedObjectContextList<Action>& actionContexts); static void BuildSharedActionContexts(SharedNamedObjectContextList<Action>& actionContexts);

View File

@ -132,7 +132,7 @@ void GenericDruidNonCombatStrategy::InitTriggers(std::vector<TriggerNode*>& trig
triggers.push_back( triggers.push_back(
new TriggerNode("party member low health", new TriggerNode("party member low health",
NextAction::array(0, NextAction::array(0,
new NextAction("wild growth on party", ACTION_MEDIUM_HEAL + 5), new NextAction("wild growth on party", ACTION_MEDIUM_HEAL + 5),
new NextAction("regrowth on party", ACTION_MEDIUM_HEAL + 4), new NextAction("regrowth on party", ACTION_MEDIUM_HEAL + 4),
new NextAction("rejuvenation on party", ACTION_MEDIUM_HEAL + 3), new NextAction("rejuvenation on party", ACTION_MEDIUM_HEAL + 3),
@ -160,7 +160,7 @@ void GenericDruidNonCombatStrategy::InitTriggers(std::vector<TriggerNode*>& trig
new NextAction("regrowth on party", ACTION_MEDIUM_HEAL + 6), new NextAction("regrowth on party", ACTION_MEDIUM_HEAL + 6),
new NextAction("rejuvenation on party", ACTION_MEDIUM_HEAL + 5), new NextAction("rejuvenation on party", ACTION_MEDIUM_HEAL + 5),
nullptr))); nullptr)));
triggers.push_back(new TriggerNode("party member low health", NextAction::array(0, triggers.push_back(new TriggerNode("party member low health", NextAction::array(0,
new NextAction("wild growth on party", ACTION_MEDIUM_HEAL + 5), new NextAction("wild growth on party", ACTION_MEDIUM_HEAL + 5),
new NextAction("regrowth on party", ACTION_MEDIUM_HEAL + 4), new NextAction("regrowth on party", ACTION_MEDIUM_HEAL + 4),
new NextAction("rejuvenation on party", ACTION_MEDIUM_HEAL + 3), new NextAction("rejuvenation on party", ACTION_MEDIUM_HEAL + 3),
@ -174,8 +174,8 @@ void GenericDruidNonCombatStrategy::InitTriggers(std::vector<TriggerNode*>& trig
new NextAction("wild growth on party", ACTION_LIGHT_HEAL + 3), new NextAction("wild growth on party", ACTION_LIGHT_HEAL + 3),
new NextAction("rejuvenation on party", ACTION_LIGHT_HEAL + 2), new NextAction("rejuvenation on party", ACTION_LIGHT_HEAL + 2),
nullptr))); nullptr)));
triggers.push_back(new TriggerNode("party member remove curse", NextAction::array(0, triggers.push_back(new TriggerNode("party member remove curse", NextAction::array(0,
new NextAction("remove curse on party", ACTION_DISPEL + 7), new NextAction("remove curse on party", ACTION_DISPEL + 7),
nullptr))); nullptr)));
int specTab = AiFactory::GetPlayerSpecTab(botAI->GetBot()); int specTab = AiFactory::GetPlayerSpecTab(botAI->GetBot());
@ -196,12 +196,12 @@ void GenericDruidBuffStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
NonCombatStrategy::InitTriggers(triggers); NonCombatStrategy::InitTriggers(triggers);
triggers.push_back(new TriggerNode("mark of the wild on party", NextAction::array(0, triggers.push_back(new TriggerNode("mark of the wild on party", NextAction::array(0,
new NextAction("mark of the wild on party", 13.0f), new NextAction("mark of the wild on party", 13.0f),
nullptr))); nullptr)));
triggers.push_back(new TriggerNode("thorns on main tank", NextAction::array(0, triggers.push_back(new TriggerNode("thorns on main tank", NextAction::array(0,
new NextAction("thorns on main tank", 11.0f), new NextAction("thorns on main tank", 11.0f),
nullptr))); nullptr)));
triggers.push_back(new TriggerNode("thorns", NextAction::array(0, triggers.push_back(new TriggerNode("thorns", NextAction::array(0,
new NextAction("thorns", 10.0f), new NextAction("thorns", 10.0f),
nullptr))); nullptr)));
} }

View File

@ -133,11 +133,11 @@ void DruidCureStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
triggers.push_back( triggers.push_back(
new TriggerNode("party member cure poison", new TriggerNode("party member cure poison",
NextAction::array(0, new NextAction("abolish poison on party", ACTION_DISPEL + 1), nullptr))); NextAction::array(0, new NextAction("abolish poison on party", ACTION_DISPEL + 1), nullptr)));
triggers.push_back( triggers.push_back(
new TriggerNode("party member remove curse", new TriggerNode("party member remove curse",
NextAction::array(0, new NextAction("remove curse on party", ACTION_DISPEL + 7), NULL))); NextAction::array(0, new NextAction("remove curse on party", ACTION_DISPEL + 7), NULL)));
} }
void DruidBoostStrategy::InitTriggers(std::vector<TriggerNode*>& triggers) void DruidBoostStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)

View File

@ -82,7 +82,7 @@ void HealDruidStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
triggers.push_back(new TriggerNode( triggers.push_back(new TriggerNode(
"group heal setting", "group heal setting",
NextAction::array(0, NextAction::array(0,
new NextAction("tree form", ACTION_MEDIUM_HEAL + 2.3f), new NextAction("tree form", ACTION_MEDIUM_HEAL + 2.3f),
new NextAction("wild growth on party", ACTION_MEDIUM_HEAL + 2.2f), new NextAction("wild growth on party", ACTION_MEDIUM_HEAL + 2.2f),
new NextAction("rejuvenation on not full", ACTION_MEDIUM_HEAL + 2.1f), new NextAction("rejuvenation on not full", ACTION_MEDIUM_HEAL + 2.1f),
@ -90,7 +90,7 @@ void HealDruidStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
triggers.push_back( triggers.push_back(
new TriggerNode("medium group heal setting", new TriggerNode("medium group heal setting",
NextAction::array(0, NextAction::array(0,
new NextAction("tree form", ACTION_CRITICAL_HEAL + 0.6f), new NextAction("tree form", ACTION_CRITICAL_HEAL + 0.6f),
new NextAction("tranquility", ACTION_CRITICAL_HEAL + 0.5f), nullptr))); new NextAction("tranquility", ACTION_CRITICAL_HEAL + 0.5f), nullptr)));
@ -107,7 +107,7 @@ void HealDruidStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
// MEDIUM // MEDIUM
triggers.push_back( triggers.push_back(
new TriggerNode("party member medium health", new TriggerNode("party member medium health",
NextAction::array(0, NextAction::array(0,
new NextAction("tree form", ACTION_MEDIUM_HEAL + 0.5f), new NextAction("tree form", ACTION_MEDIUM_HEAL + 0.5f),
new NextAction("wild growth on party", ACTION_MEDIUM_HEAL + 0.4f), new NextAction("wild growth on party", ACTION_MEDIUM_HEAL + 0.4f),
new NextAction("rejuvenation on party", ACTION_MEDIUM_HEAL + 0.3f), new NextAction("rejuvenation on party", ACTION_MEDIUM_HEAL + 0.3f),

View File

@ -47,7 +47,7 @@ class DungeonStrategyContext : public NamedObjectContext<Strategy>
// Burning Crusade // Burning Crusade
// ... // ...
// Wrath of the Lich King // Wrath of the Lich King
creators["wotlk-uk"] = &DungeonStrategyContext::wotlk_uk; // Utgarde Keep creators["wotlk-uk"] = &DungeonStrategyContext::wotlk_uk; // Utgarde Keep
creators["wotlk-nex"] = &DungeonStrategyContext::wotlk_nex; // The Nexus creators["wotlk-nex"] = &DungeonStrategyContext::wotlk_nex; // The Nexus
@ -84,8 +84,8 @@ class DungeonStrategyContext : public NamedObjectContext<Strategy>
static Strategy* wotlk_toc(PlayerbotAI* botAI) { return new WotlkDungeonToCStrategy(botAI); } static Strategy* wotlk_toc(PlayerbotAI* botAI) { return new WotlkDungeonToCStrategy(botAI); }
// NYI from here down // NYI from here down
static Strategy* wotlk_hor(PlayerbotAI* botAI) { return new WotlkDungeonUKStrategy(botAI); } static Strategy* wotlk_hor(PlayerbotAI* botAI) { return new WotlkDungeonUKStrategy(botAI); }
}; };
#endif #endif

View File

@ -25,7 +25,7 @@ bool AttackWebWrapAction::Execute(Event event)
{ {
return false; return false;
} }
return Attack(webWrap); return Attack(webWrap);
} }

View File

@ -9,7 +9,7 @@
float KrikthirMultiplier::GetValue(Action* action) float KrikthirMultiplier::GetValue(Action* action)
{ {
if (!botAI->IsDps(bot)) { return 1.0f; } if (!botAI->IsDps(bot)) { return 1.0f; }
// Target is not findable from threat table using AI_VALUE2(), // Target is not findable from threat table using AI_VALUE2(),
// therefore need to search manually for the unit name // therefore need to search manually for the unit name
Unit* boss = nullptr; Unit* boss = nullptr;

View File

@ -11,7 +11,7 @@ void WotlkDungeonANStrategy::InitTriggers(std::vector<TriggerNode*> &triggers)
NextAction::array(0, new NextAction("attack web wrap", ACTION_RAID + 5), nullptr))); NextAction::array(0, new NextAction("attack web wrap", ACTION_RAID + 5), nullptr)));
triggers.push_back(new TriggerNode("krik'thir watchers", triggers.push_back(new TriggerNode("krik'thir watchers",
NextAction::array(0, new NextAction("krik'thir priority", ACTION_RAID + 4), nullptr))); NextAction::array(0, new NextAction("krik'thir priority", ACTION_RAID + 4), nullptr)));
// Hadronox // Hadronox
// The core AC triggers are very buggy with this boss, but default strat seems to play correctly // The core AC triggers are very buggy with this boss, but default strat seems to play correctly

View File

@ -5,7 +5,7 @@
#include "AiObjectContext.h" #include "AiObjectContext.h"
#include "AzjolNerubTriggers.h" #include "AzjolNerubTriggers.h"
class WotlkDungeonANTriggerContext : public NamedObjectContext<Trigger> class WotlkDungeonANTriggerContext : public NamedObjectContext<Trigger>
{ {
public: public:
WotlkDungeonANTriggerContext() WotlkDungeonANTriggerContext()

View File

@ -7,7 +7,7 @@
bool KrikthirWebWrapTrigger::IsActive() bool KrikthirWebWrapTrigger::IsActive()
{ {
if (!botAI->IsDps(bot)) { return false; } if (!botAI->IsDps(bot)) { return false; }
// Target is not findable from threat table using AI_VALUE2(), // Target is not findable from threat table using AI_VALUE2(),
// therefore need to search manually for the unit name // therefore need to search manually for the unit name
GuidVector targets = AI_VALUE(GuidVector, "possible targets no los"); GuidVector targets = AI_VALUE(GuidVector, "possible targets no los");
@ -51,7 +51,7 @@ bool KrikthirWatchersTrigger::IsActive()
// for (auto i = triggers.begin(); i != triggers.end(); i++) // for (auto i = triggers.begin(); i != triggers.end(); i++)
// { // {
// Unit* unit = botAI->GetUnit(*i); // Unit* unit = botAI->GetUnit(*i);
// if (unit) // if (unit)
// { // {
// bot->Yell("TRIGGER="+unit->GetName(), LANG_UNIVERSAL); // bot->Yell("TRIGGER="+unit->GetName(), LANG_UNIVERSAL);
@ -64,6 +64,6 @@ bool AnubarakPoundTrigger::IsActive()
{ {
Unit* boss = AI_VALUE2(Unit*, "find target", "anub'arak"); Unit* boss = AI_VALUE2(Unit*, "find target", "anub'arak");
if (!boss) { return false; } if (!boss) { return false; }
return boss->HasUnitState(UNIT_STATE_CASTING) && boss->FindCurrentSpellBySpellId(SPELL_POUND); return boss->HasUnitState(UNIT_STATE_CASTING) && boss->FindCurrentSpellBySpellId(SPELL_POUND);
} }

View File

@ -12,7 +12,7 @@ float EpochMultiplier::GetValue(Action* action)
if (!boss) { return 1.0f; } if (!boss) { return 1.0f; }
if (bot->getClass() == CLASS_HUNTER) { return 1.0f; } if (bot->getClass() == CLASS_HUNTER) { return 1.0f; }
if (dynamic_cast<FleeAction*>(action)) { return 0.0f; } if (dynamic_cast<FleeAction*>(action)) { return 0.0f; }
return 1.0f; return 1.0f;

View File

@ -10,12 +10,12 @@ void WotlkDungeonCoSStrategy::InitTriggers(std::vector<TriggerNode*> &triggers)
// Salramm the Fleshcrafter // Salramm the Fleshcrafter
triggers.push_back(new TriggerNode("explode ghoul", triggers.push_back(new TriggerNode("explode ghoul",
NextAction::array(0, new NextAction("explode ghoul spread", ACTION_MOVE + 5), nullptr))); NextAction::array(0, new NextAction("explode ghoul spread", ACTION_MOVE + 5), nullptr)));
// Chrono-Lord Epoch // Chrono-Lord Epoch
// Not sure if this actually works, I think I've seen him charge melee characters..? // Not sure if this actually works, I think I've seen him charge melee characters..?
triggers.push_back(new TriggerNode("epoch ranged", triggers.push_back(new TriggerNode("epoch ranged",
NextAction::array(0, new NextAction("epoch stack", ACTION_MOVE + 5), nullptr))); NextAction::array(0, new NextAction("epoch stack", ACTION_MOVE + 5), nullptr)));
// Mal'Ganis // Mal'Ganis
// Infinite Corruptor (Heroic only) // Infinite Corruptor (Heroic only)

View File

@ -5,7 +5,7 @@
#include "AiObjectContext.h" #include "AiObjectContext.h"
#include "CullingOfStratholmeTriggers.h" #include "CullingOfStratholmeTriggers.h"
class WotlkDungeonCoSTriggerContext : public NamedObjectContext<Trigger> class WotlkDungeonCoSTriggerContext : public NamedObjectContext<Trigger>
{ {
public: public:
WotlkDungeonCoSTriggerContext() WotlkDungeonCoSTriggerContext()

View File

@ -64,11 +64,11 @@ bool NovosTargetPriorityAction::Execute(Event event)
{ {
// TODO: This can be improved, some parts are still buggy. // TODO: This can be improved, some parts are still buggy.
// But it works for now and this fight is very easy // But it works for now and this fight is very easy
// Designate a dps char to handle the stairs adds. // Designate a dps char to handle the stairs adds.
// This is probably better as a melee, so just pick the first // This is probably better as a melee, so just pick the first
// melee dps in the party. If none exist, pick the first ranged. // melee dps in the party. If none exist, pick the first ranged.
// TODO: Switch to botAI->Index instead, cleaner // TODO: Switch to botAI->Index instead, cleaner
Player* stairsDps = nullptr; Player* stairsDps = nullptr;
GuidVector members = AI_VALUE(GuidVector, "group members"); GuidVector members = AI_VALUE(GuidVector, "group members");
@ -76,7 +76,7 @@ bool NovosTargetPriorityAction::Execute(Event event)
{ {
Player* groupMember = botAI->GetPlayer(member); Player* groupMember = botAI->GetPlayer(member);
if (!groupMember) { continue; } if (!groupMember) { continue; }
if (botAI->IsDps(groupMember)) if (botAI->IsDps(groupMember))
{ {
if (botAI->IsMelee(groupMember)) if (botAI->IsMelee(groupMember))
@ -131,7 +131,7 @@ bool NovosTargetPriorityAction::Execute(Event event)
{ {
selectedTargets[0] = unit; selectedTargets[0] = unit;
} }
} }
else if (creatureId == NPC_FETID_TROLL_CORPSE) else if (creatureId == NPC_FETID_TROLL_CORPSE)
{ {

View File

@ -10,7 +10,7 @@ float NovosMultiplier::GetValue(Action* action)
{ {
Unit* boss = AI_VALUE2(Unit*, "find target", "novos the summoner"); Unit* boss = AI_VALUE2(Unit*, "find target", "novos the summoner");
if (!boss) { return 1.0f; } if (!boss) { return 1.0f; }
if (boss->FindCurrentSpellBySpellId(SPELL_ARCANE_FIELD) && bot->GetTarget()) if (boss->FindCurrentSpellBySpellId(SPELL_ARCANE_FIELD) && bot->GetTarget())
{ {
if (dynamic_cast<DpsAssistAction*>(action) if (dynamic_cast<DpsAssistAction*>(action)
@ -25,7 +25,7 @@ float NovosMultiplier::GetValue(Action* action)
float TharonjaMultiplier::GetValue(Action* action) float TharonjaMultiplier::GetValue(Action* action)
{ {
if (!bot->HasAura(SPELL_GIFT_OF_THARONJA)) { return 1.0f; } if (!bot->HasAura(SPELL_GIFT_OF_THARONJA)) { return 1.0f; }
// Suppress all skills that are not enabled in skeleton form. // Suppress all skills that are not enabled in skeleton form.
// Still allow non-ability actions such as movement // Still allow non-ability actions such as movement
if (dynamic_cast<CastSpellAction*>(action) if (dynamic_cast<CastSpellAction*>(action)

View File

@ -7,7 +7,7 @@ void WotlkDungeonDTKStrategy::InitTriggers(std::vector<TriggerNode*> &triggers)
// Trollgore // Trollgore
triggers.push_back(new TriggerNode("corpse explode", triggers.push_back(new TriggerNode("corpse explode",
NextAction::array(0, new NextAction("corpse explode spread", ACTION_MOVE + 5), nullptr))); NextAction::array(0, new NextAction("corpse explode spread", ACTION_MOVE + 5), nullptr)));
// Novos the Summoner // Novos the Summoner
// TODO: Can be improved - it's a pretty easy fight but complex to program, revisit if needed // TODO: Can be improved - it's a pretty easy fight but complex to program, revisit if needed
triggers.push_back(new TriggerNode("arcane field", triggers.push_back(new TriggerNode("arcane field",
@ -16,7 +16,7 @@ void WotlkDungeonDTKStrategy::InitTriggers(std::vector<TriggerNode*> &triggers)
NextAction::array(0, new NextAction("novos positioning", ACTION_MOVE + 4), nullptr))); NextAction::array(0, new NextAction("novos positioning", ACTION_MOVE + 4), nullptr)));
triggers.push_back(new TriggerNode("arcane field", triggers.push_back(new TriggerNode("arcane field",
NextAction::array(0, new NextAction("novos target priority", ACTION_NORMAL + 1), nullptr))); NextAction::array(0, new NextAction("novos target priority", ACTION_NORMAL + 1), nullptr)));
// King Dred // King Dred
// TODO: Fear ward / tremor totem, or general anti-fear strat development // TODO: Fear ward / tremor totem, or general anti-fear strat development

View File

@ -5,7 +5,7 @@
#include "AiObjectContext.h" #include "AiObjectContext.h"
#include "DrakTharonKeepTriggers.h" #include "DrakTharonKeepTriggers.h"
class WotlkDungeonDTKTriggerContext : public NamedObjectContext<Trigger> class WotlkDungeonDTKTriggerContext : public NamedObjectContext<Trigger>
{ {
public: public:
WotlkDungeonDTKTriggerContext() WotlkDungeonDTKTriggerContext()

View File

@ -4,7 +4,7 @@
#include "SharedDefines.h" #include "SharedDefines.h"
bool MoveFromBronjahmAction::Execute(Event event) bool MoveFromBronjahmAction::Execute(Event event)
{ {
Unit* boss = AI_VALUE2(Unit*, "find target", "bronjahm"); Unit* boss = AI_VALUE2(Unit*, "find target", "bronjahm");
if (!boss) if (!boss)
return false; return false;
@ -46,10 +46,10 @@ bool AttackCorruptedSoulFragmentAction::Execute(Event event)
} }
break; break;
} }
} }
return false; return false;
} }
@ -101,7 +101,7 @@ bool BronjahmGroupPositionAction::Execute(Event event)
// If soul is near boss, flee from boss // If soul is near boss, flee from boss
if (soulToBossDist < 10.0f) if (soulToBossDist < 10.0f)
return FleePosition(unit->GetPosition(), 13.0f, 1000U); return FleePosition(unit->GetPosition(), 13.0f, 1000U);
// If soul exists but none of the above conditions, don't move to tank position yet // If soul exists but none of the above conditions, don't move to tank position yet
bot->SetFacingToObject(boss); bot->SetFacingToObject(boss);
return true; return true;

View File

@ -30,7 +30,7 @@ bool SwitchToSoulFragment::IsActive()
if (!activeSoulExists) if (!activeSoulExists)
return false; return false;
return true; return true;
} }
bool BronjahmPositionTrigger::IsActive() bool BronjahmPositionTrigger::IsActive()

View File

@ -15,11 +15,11 @@ void WotlkDungeonGDStrategy::InitTriggers(std::vector<TriggerNode*> &triggers)
NextAction::array(0, new NextAction("avoid poison nova", ACTION_RAID + 5), nullptr))); NextAction::array(0, new NextAction("avoid poison nova", ACTION_RAID + 5), nullptr)));
triggers.push_back(new TriggerNode("snake wrap", triggers.push_back(new TriggerNode("snake wrap",
NextAction::array(0, new NextAction("attack snake wrap", ACTION_RAID + 4), nullptr))); NextAction::array(0, new NextAction("attack snake wrap", ACTION_RAID + 4), nullptr)));
// Gal'darah // Gal'darah
triggers.push_back(new TriggerNode("whirling slash", triggers.push_back(new TriggerNode("whirling slash",
NextAction::array(0, new NextAction("avoid whirling slash", ACTION_RAID + 5), nullptr))); NextAction::array(0, new NextAction("avoid whirling slash", ACTION_RAID + 5), nullptr)));
// Eck the Ferocious (Heroic only) // Eck the Ferocious (Heroic only)
} }

View File

@ -5,7 +5,7 @@
#include "AiObjectContext.h" #include "AiObjectContext.h"
#include "GundrakTriggers.h" #include "GundrakTriggers.h"
class WotlkDungeonGDTriggerContext : public NamedObjectContext<Trigger> class WotlkDungeonGDTriggerContext : public NamedObjectContext<Trigger>
{ {
public: public:
WotlkDungeonGDTriggerContext() WotlkDungeonGDTriggerContext()

View File

@ -7,7 +7,7 @@ bool SladranPoisonNovaTrigger::IsActive()
{ {
Unit* boss = AI_VALUE2(Unit*, "find target", "slad'ran"); Unit* boss = AI_VALUE2(Unit*, "find target", "slad'ran");
if (!boss) { return false; } if (!boss) { return false; }
return bool(boss->FindCurrentSpellBySpellId(SPELL_POISON_NOVA)); return bool(boss->FindCurrentSpellBySpellId(SPELL_POISON_NOVA));
} }

View File

@ -12,7 +12,7 @@ enum GundrakIDs
SPELL_POISON_NOVA_N = 55081, SPELL_POISON_NOVA_N = 55081,
SPELL_POISON_NOVA_H = 59842, SPELL_POISON_NOVA_H = 59842,
NPC_SNAKE_WRAP = 29742, NPC_SNAKE_WRAP = 29742,
// Gal'darah // Gal'darah
SPELL_WHIRLING_SLASH_N = 55250, SPELL_WHIRLING_SLASH_N = 55250,
SPELL_WHIRLING_SLASH_H = 59824, SPELL_WHIRLING_SLASH_H = 59824,

View File

@ -59,7 +59,7 @@ bool VolkhanTargetAction::Execute(Event event)
{ {
return false; return false;
} }
return Attack(boss); return Attack(boss);
} }
@ -148,7 +148,7 @@ bool LokenStackAction::Execute(Event event)
// else // else
return Move(bot->GetAngle(boss), fmin(bot->GetExactDist2d(boss), maxMovement)); return Move(bot->GetAngle(boss), fmin(bot->GetExactDist2d(boss), maxMovement));
} }
return false; return false;
} }

View File

@ -48,7 +48,7 @@ float BjarngrimMultiplier::GetValue(Action* action)
{ {
return 0.0f; return 0.0f;
} }
return 1.0f; return 1.0f;
} }
@ -66,7 +66,7 @@ float VolkhanMultiplier::GetValue(Action* action)
{ {
return 0.0f; return 0.0f;
} }
return 1.0f; return 1.0f;
} }

View File

@ -13,7 +13,7 @@ void WotlkDungeonHoLStrategy::InitTriggers(std::vector<TriggerNode*> &triggers)
// Volkhan // Volkhan
triggers.push_back(new TriggerNode("volkhan", triggers.push_back(new TriggerNode("volkhan",
NextAction::array(0, new NextAction("volkhan target", ACTION_RAID + 5), nullptr))); NextAction::array(0, new NextAction("volkhan target", ACTION_RAID + 5), nullptr)));
// Ionar // Ionar
triggers.push_back(new TriggerNode("ionar disperse", triggers.push_back(new TriggerNode("ionar disperse",
NextAction::array(0, new NextAction("disperse position", ACTION_MOVE + 5), nullptr))); NextAction::array(0, new NextAction("disperse position", ACTION_MOVE + 5), nullptr)));
@ -24,7 +24,7 @@ void WotlkDungeonHoLStrategy::InitTriggers(std::vector<TriggerNode*> &triggers)
// TODO: Targeted player can dodge the ball, but a single player soaking it isn't too bad to heal // TODO: Targeted player can dodge the ball, but a single player soaking it isn't too bad to heal
triggers.push_back(new TriggerNode("ball lightning", triggers.push_back(new TriggerNode("ball lightning",
NextAction::array(0, new NextAction("ball lightning spread", ACTION_MOVE + 2), nullptr))); NextAction::array(0, new NextAction("ball lightning spread", ACTION_MOVE + 2), nullptr)));
// Loken // Loken
triggers.push_back(new TriggerNode("lightning nova", triggers.push_back(new TriggerNode("lightning nova",
NextAction::array(0, new NextAction("avoid lightning nova", ACTION_MOVE + 5), nullptr))); NextAction::array(0, new NextAction("avoid lightning nova", ACTION_MOVE + 5), nullptr)));

View File

@ -5,7 +5,7 @@
#include "AiObjectContext.h" #include "AiObjectContext.h"
#include "HallsOfLightningTriggers.h" #include "HallsOfLightningTriggers.h"
class WotlkDungeonHoLTriggerContext : public NamedObjectContext<Trigger> class WotlkDungeonHoLTriggerContext : public NamedObjectContext<Trigger>
{ {
public: public:
WotlkDungeonHoLTriggerContext() WotlkDungeonHoLTriggerContext()

View File

@ -27,7 +27,7 @@ bool BjarngrimWhirlwindTrigger::IsActive()
{ {
Unit* boss = AI_VALUE2(Unit*, "find target", "general bjarngrim"); Unit* boss = AI_VALUE2(Unit*, "find target", "general bjarngrim");
if (!boss) { return false; } if (!boss) { return false; }
return boss->HasUnitState(UNIT_STATE_CASTING) && boss->FindCurrentSpellBySpellId(SPELL_WHIRLWIND_BJARNGRIM); return boss->HasUnitState(UNIT_STATE_CASTING) && boss->FindCurrentSpellBySpellId(SPELL_WHIRLWIND_BJARNGRIM);
} }
@ -57,7 +57,7 @@ bool IonarBallLightningTrigger::IsActive()
Unit* boss = AI_VALUE2(Unit*, "find target", "ionar"); Unit* boss = AI_VALUE2(Unit*, "find target", "ionar");
if (!boss) { return false; } if (!boss) { return false; }
return boss->HasUnitState(UNIT_STATE_CASTING) && boss->FindCurrentSpellBySpellId(SPELL_BALL_LIGHTNING); return boss->HasUnitState(UNIT_STATE_CASTING) && boss->FindCurrentSpellBySpellId(SPELL_BALL_LIGHTNING);
} }
@ -67,7 +67,7 @@ bool IonarTankAggroTrigger::IsActive()
Unit* boss = AI_VALUE2(Unit*, "find target", "ionar"); Unit* boss = AI_VALUE2(Unit*, "find target", "ionar");
if (!boss) { return false; } if (!boss) { return false; }
return AI_VALUE2(bool, "has aggro", "current target"); return AI_VALUE2(bool, "has aggro", "current target");
} }
@ -88,6 +88,6 @@ bool LokenLightningNovaTrigger::IsActive()
{ {
Unit* boss = AI_VALUE2(Unit*, "find target", "loken"); Unit* boss = AI_VALUE2(Unit*, "find target", "loken");
if (!boss) { return false; } if (!boss) { return false; }
return boss->HasUnitState(UNIT_STATE_CASTING) && boss->FindCurrentSpellBySpellId(SPELL_LIGHTNING_NOVA); return boss->HasUnitState(UNIT_STATE_CASTING) && boss->FindCurrentSpellBySpellId(SPELL_LIGHTNING_NOVA);
} }

View File

@ -9,7 +9,7 @@ bool ShatterSpreadAction::Execute(Event event)
float radius = 40.0f; float radius = 40.0f;
Unit* closestMember = nullptr; Unit* closestMember = nullptr;
GuidVector members = AI_VALUE(GuidVector, "group members"); GuidVector members = AI_VALUE(GuidVector, "group members");
for (auto& member : members) for (auto& member : members)
{ {
@ -31,7 +31,7 @@ bool ShatterSpreadAction::Execute(Event event)
// return MoveAway(closestMember, radius - bot->GetExactDist2d(closestMember)); // return MoveAway(closestMember, radius - bot->GetExactDist2d(closestMember));
return MoveAway(closestMember, 5.0f); return MoveAway(closestMember, 5.0f);
} }
return false; return false;
} }

View File

@ -10,7 +10,7 @@ float KrystallusMultiplier::GetValue(Action* action)
{ {
Unit* boss = AI_VALUE2(Unit*, "find target", "krystallus"); Unit* boss = AI_VALUE2(Unit*, "find target", "krystallus");
if (!boss) { return 1.0f; } if (!boss) { return 1.0f; }
// Check both of these... the spell is applied first, debuff later. // Check both of these... the spell is applied first, debuff later.
// Neither is active for the full duration so we need to trigger off both // Neither is active for the full duration so we need to trigger off both
if (bot->HasAura(SPELL_GROUND_SLAM) || bot->HasAura(DEBUFF_GROUND_SLAM)) if (bot->HasAura(SPELL_GROUND_SLAM) || bot->HasAura(DEBUFF_GROUND_SLAM))

View File

@ -11,7 +11,7 @@ void WotlkDungeonHoSStrategy::InitTriggers(std::vector<TriggerNode*> &triggers)
// TODO: I think bots need to dismiss pets on this, or they nuke players they are standing close to // TODO: I think bots need to dismiss pets on this, or they nuke players they are standing close to
triggers.push_back(new TriggerNode("ground slam", triggers.push_back(new TriggerNode("ground slam",
NextAction::array(0, new NextAction("shatter spread", ACTION_RAID + 5), nullptr))); NextAction::array(0, new NextAction("shatter spread", ACTION_RAID + 5), nullptr)));
// Tribunal of Ages // Tribunal of Ages
// Seems fine, maybe add focus targeting strat if needed on heroic. // Seems fine, maybe add focus targeting strat if needed on heroic.
// Main issue is dps will immediately rambo in and sometimes die before tank gets aggro, // Main issue is dps will immediately rambo in and sometimes die before tank gets aggro,

View File

@ -5,7 +5,7 @@
#include "AiObjectContext.h" #include "AiObjectContext.h"
#include "HallsOfStoneTriggers.h" #include "HallsOfStoneTriggers.h"
class WotlkDungeonHoSTriggerContext : public NamedObjectContext<Trigger> class WotlkDungeonHoSTriggerContext : public NamedObjectContext<Trigger>
{ {
public: public:
WotlkDungeonHoSTriggerContext() WotlkDungeonHoSTriggerContext()

View File

@ -7,7 +7,7 @@ bool KrystallusGroundSlamTrigger::IsActive()
{ {
Unit* boss = AI_VALUE2(Unit*, "find target", "krystallus"); Unit* boss = AI_VALUE2(Unit*, "find target", "krystallus");
if (!boss) { return false; } if (!boss) { return false; }
// Check both of these... the spell is applied first, debuff later. // Check both of these... the spell is applied first, debuff later.
// Neither is active for the full duration so we need to trigger off both // Neither is active for the full duration so we need to trigger off both
return bot->HasAura(SPELL_GROUND_SLAM) || bot->HasAura(DEBUFF_GROUND_SLAM); return bot->HasAura(SPELL_GROUND_SLAM) || bot->HasAura(DEBUFF_GROUND_SLAM);
@ -17,6 +17,6 @@ bool SjonnirLightningRingTrigger::IsActive()
{ {
Unit* boss = AI_VALUE2(Unit*, "find target", "sjonnir the ironshaper"); Unit* boss = AI_VALUE2(Unit*, "find target", "sjonnir the ironshaper");
if (!boss) { return false; } if (!boss) { return false; }
return boss->HasUnitState(UNIT_STATE_CASTING) && boss->FindCurrentSpellBySpellId(SPELL_LIGHTNING_RING); return boss->HasUnitState(UNIT_STATE_CASTING) && boss->FindCurrentSpellBySpellId(SPELL_LIGHTNING_RING);
} }

View File

@ -41,7 +41,7 @@ bool MoveFromWhirlwindAction::Execute(Event event)
} }
float bossDistance = bot->GetExactDist2d(boss->GetPosition()); float bossDistance = bot->GetExactDist2d(boss->GetPosition());
// Check if the bot is already at a safe distance // Check if the bot is already at a safe distance
if (bossDistance > targetDist) if (bossDistance > targetDist)
{ {
@ -156,7 +156,7 @@ bool DodgeSpikesAction::Execute(Event event)
{ {
Unit* boss = AI_VALUE2(Unit*, "find target", "ormorok the tree-shaper"); Unit* boss = AI_VALUE2(Unit*, "find target", "ormorok the tree-shaper");
if (!boss) { return false; } if (!boss) { return false; }
return Move(bot->GetAngle(boss), bot->GetExactDist2d(boss) - 0.3f); return Move(bot->GetAngle(boss), bot->GetExactDist2d(boss) - 0.3f);
} }

View File

@ -9,7 +9,7 @@ float FactionCommanderMultiplier::GetValue(Action* action)
{ {
Unit* boss = nullptr; Unit* boss = nullptr;
uint8 faction = bot->GetTeamId(); uint8 faction = bot->GetTeamId();
switch (bot->GetMap()->GetDifficulty()) switch (bot->GetMap()->GetDifficulty())
{ {
case DUNGEON_DIFFICULTY_NORMAL: case DUNGEON_DIFFICULTY_NORMAL:
@ -78,7 +78,7 @@ float OrmorokMultiplier::GetValue(Action* action)
{ {
Unit* boss = AI_VALUE2(Unit*, "find target", "ormorok the tree-shaper"); Unit* boss = AI_VALUE2(Unit*, "find target", "ormorok the tree-shaper");
if (!boss) { return 1.0f; } if (!boss) { return 1.0f; }
// These are used for auto ranged repositioning, need to suppress so ranged dps don't ping-pong // These are used for auto ranged repositioning, need to suppress so ranged dps don't ping-pong
if (dynamic_cast<FleeAction*>(action)) if (dynamic_cast<FleeAction*>(action))
{ {

View File

@ -10,7 +10,7 @@ void WotlkDungeonNexStrategy::InitTriggers(std::vector<TriggerNode*> &triggers)
triggers.push_back(new TriggerNode("faction commander whirlwind", triggers.push_back(new TriggerNode("faction commander whirlwind",
NextAction::array(0, new NextAction("move from whirlwind", ACTION_MOVE + 5), nullptr))); NextAction::array(0, new NextAction("move from whirlwind", ACTION_MOVE + 5), nullptr)));
// TODO: Handle fear? (tremor totems, fear ward etc.) // TODO: Handle fear? (tremor totems, fear ward etc.)
// Grand Magus Telestra // Grand Magus Telestra
triggers.push_back(new TriggerNode("telestra firebomb", triggers.push_back(new TriggerNode("telestra firebomb",
NextAction::array(0, new NextAction("firebomb spread", ACTION_MOVE + 5), nullptr))); NextAction::array(0, new NextAction("firebomb spread", ACTION_MOVE + 5), nullptr)));
@ -21,7 +21,7 @@ void WotlkDungeonNexStrategy::InitTriggers(std::vector<TriggerNode*> &triggers)
// Anomalus // Anomalus
triggers.push_back(new TriggerNode("chaotic rift", triggers.push_back(new TriggerNode("chaotic rift",
NextAction::array(0, new NextAction("chaotic rift target", ACTION_RAID + 1), nullptr))); NextAction::array(0, new NextAction("chaotic rift target", ACTION_RAID + 1), nullptr)));
// Ormorok the Tree-Shaper // Ormorok the Tree-Shaper
// Tank trigger to stack inside boss. Can also add return action to prevent boss repositioning // Tank trigger to stack inside boss. Can also add return action to prevent boss repositioning
// if it becomes too much of a problem. He usually dies before he's up against a wall though // if it becomes too much of a problem. He usually dies before he's up against a wall though

Some files were not shown because too many files have changed in this diff Show More