Fix: Updated to work with newer commits of AzerothCore

This commit is contained in:
Revision
2024-07-22 00:39:06 +02:00
parent fedb6084e2
commit 838bfe333d
48 changed files with 241 additions and 239 deletions

View File

@@ -55,7 +55,7 @@ uint8 AiFactory::GetPlayerSpecTab(Player* bot)
{ {
std::map<uint8, uint32> tabs = GetPlayerSpecTabs(bot); std::map<uint8, uint32> tabs = GetPlayerSpecTabs(bot);
if (bot->getLevel() >= 10 && ((tabs[0] + tabs[1] + tabs[2]) > 0)) if (bot->GetLevel() >= 10 && ((tabs[0] + tabs[1] + tabs[2]) > 0))
{ {
int8 tab = -1; int8 tab = -1;
uint32 max = 0; uint32 max = 0;
@@ -301,7 +301,7 @@ void AiFactory::AddDefaultCombatStrategies(Player* player, PlayerbotAI* const fa
case CLASS_WARRIOR: case CLASS_WARRIOR:
if (tab == 2) if (tab == 2)
engine->addStrategies("tank", "tank assist", "aoe", "mark rti", nullptr); engine->addStrategies("tank", "tank assist", "aoe", "mark rti", nullptr);
else if (player->getLevel() < 36 || tab == 0) else if (player->GetLevel() < 36 || tab == 0)
engine->addStrategies("arms", "aoe", "dps assist",/*"behind",*/ nullptr); engine->addStrategies("arms", "aoe", "dps assist",/*"behind",*/ nullptr);
else else
engine->addStrategies("fury", "aoe", "dps assist",/*"behind",*/ nullptr); engine->addStrategies("fury", "aoe", "dps assist",/*"behind",*/ nullptr);

View File

@@ -68,14 +68,14 @@ class LevelChatFilter : public ChatFilter
uint32 fromLevel = atoi(message.substr(message.find("@") + 1, message.find("-")).c_str()); uint32 fromLevel = atoi(message.substr(message.find("@") + 1, message.find("-")).c_str());
uint32 toLevel = atoi(message.substr(message.find("-") + 1, message.find(" ")).c_str()); uint32 toLevel = atoi(message.substr(message.find("-") + 1, message.find(" ")).c_str());
if (bot->getLevel() >= fromLevel && bot->getLevel() <= toLevel) if (bot->GetLevel() >= fromLevel && bot->GetLevel() <= toLevel)
return ChatFilter::Filter(message); return ChatFilter::Filter(message);
return message; return message;
} }
uint32 level = atoi(message.substr(message.find("@") + 1, message.find(" ")).c_str()); uint32 level = atoi(message.substr(message.find("@") + 1, message.find(" ")).c_str());
if (bot->getLevel() == level) if (bot->GetLevel() == level)
return ChatFilter::Filter(message); return ChatFilter::Filter(message);
return message; return message;

View File

@@ -173,11 +173,11 @@ private:
bool GuildTaskMgr::CreateItemTask(Player* player, uint32 guildId) bool GuildTaskMgr::CreateItemTask(Player* player, uint32 guildId)
{ {
if (!player || player->getLevel() < 5) if (!player || player->GetLevel() < 5)
return false; return false;
RandomItemBySkillGuildTaskPredicate predicate(player); RandomItemBySkillGuildTaskPredicate predicate(player);
uint32 itemId = sRandomItemMgr->GetRandomItem(player->getLevel() - 5, RANDOM_ITEM_GUILD_TASK, &predicate); uint32 itemId = sRandomItemMgr->GetRandomItem(player->GetLevel() - 5, RANDOM_ITEM_GUILD_TASK, &predicate);
if (!itemId) if (!itemId)
{ {
LOG_ERROR("playerbots", "{} / {}: no items avaible for item task", sGuildMgr->GetGuildById(guildId)->GetName().c_str(), player->GetName().c_str()); LOG_ERROR("playerbots", "{} / {}: no items avaible for item task", sGuildMgr->GetGuildById(guildId)->GetName().c_str(), player->GetName().c_str());
@@ -203,7 +203,7 @@ bool GuildTaskMgr::CreateKillTask(Player* player, uint32 guildId)
std::vector<uint32> ids; std::vector<uint32> ids;
uint32 level = player->getLevel(); uint32 level = player->GetLevel();
QueryResult results = WorldDatabase.Query("SELECT ct.Entry, c.map, c.position_x, c.position_y, ct.Name FROM creature_template ct " QueryResult results = WorldDatabase.Query("SELECT ct.Entry, c.map, c.position_x, c.position_y, ct.Name FROM creature_template ct "
"JOIN creature c ON ct.Entry = c.id1 WHERE ct.MaxLevel < {} AND ct.MinLevel > {} AND ct.Rank = {} ", level + 4, level - 3, rank); "JOIN creature c ON ct.Entry = c.id1 WHERE ct.MaxLevel < {} AND ct.MinLevel > {} AND ct.Rank = {} ", level + 4, level - 3, rank);
if (results) if (results)
@@ -910,7 +910,7 @@ bool GuildTaskMgr::Reward(CharacterDatabaseTransaction& trans, uint32 owner, uin
body << guild->GetName() << "\n"; body << guild->GetName() << "\n";
body << leader->GetName() << "\n"; body << leader->GetName() << "\n";
rewardType = proto->Quality > ITEM_QUALITY_NORMAL ? RANDOM_ITEM_GUILD_TASK_REWARD_EQUIP_BLUE : RANDOM_ITEM_GUILD_TASK_REWARD_EQUIP_GREEN; rewardType = proto->Quality > ITEM_QUALITY_NORMAL ? RANDOM_ITEM_GUILD_TASK_REWARD_EQUIP_BLUE : RANDOM_ITEM_GUILD_TASK_REWARD_EQUIP_GREEN;
itemId = sRandomItemMgr->GetRandomItem(player->getLevel() - 5, rewardType); itemId = sRandomItemMgr->GetRandomItem(player->GetLevel() - 5, rewardType);
} }
else if (killTask) else if (killTask)
{ {
@@ -924,7 +924,7 @@ bool GuildTaskMgr::Reward(CharacterDatabaseTransaction& trans, uint32 owner, uin
body << guild->GetName() << "\n"; body << guild->GetName() << "\n";
body << leader->GetName() << "\n"; body << leader->GetName() << "\n";
rewardType = proto->rank == CREATURE_ELITE_RARE ? RANDOM_ITEM_GUILD_TASK_REWARD_TRADE : RANDOM_ITEM_GUILD_TASK_REWARD_TRADE_RARE; rewardType = proto->rank == CREATURE_ELITE_RARE ? RANDOM_ITEM_GUILD_TASK_REWARD_TRADE : RANDOM_ITEM_GUILD_TASK_REWARD_TRADE_RARE;
itemId = sRandomItemMgr->GetRandomItem(player->getLevel(), rewardType); itemId = sRandomItemMgr->GetRandomItem(player->GetLevel(), rewardType);
if (itemId) if (itemId)
{ {
ItemTemplate const* itemProto = sObjectMgr->GetItemTemplate(itemId); ItemTemplate const* itemProto = sObjectMgr->GetItemTemplate(itemId);

View File

@@ -71,7 +71,7 @@ void LootObject::Refresh(Player* bot, ObjectGuid lootGUID)
if (creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE)) if (creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE))
{ {
skillId = creature->GetCreatureTemplate()->GetRequiredLootSkill(); skillId = creature->GetCreatureTemplate()->GetRequiredLootSkill();
uint32 targetLevel = creature->getLevel(); uint32 targetLevel = creature->GetLevel();
reqSkillValue = targetLevel < 10 ? 1 : targetLevel < 20 ? (targetLevel - 10) * 10 : targetLevel * 5; reqSkillValue = targetLevel < 10 ? 1 : targetLevel < 20 ? (targetLevel - 10) * 10 : targetLevel * 5;
if (botAI->HasSkill((SkillType) skillId) && bot->GetSkillValue(skillId) >= reqSkillValue) if (botAI->HasSkill((SkillType) skillId) && bot->GetSkillValue(skillId) >= reqSkillValue)
guid = lootGUID; guid = lootGUID;

View File

@@ -1104,7 +1104,7 @@ void PlayerbotAI::DoNextAction(bool min)
if (!group->SameSubGroup(bot, member)) if (!group->SameSubGroup(bot, member))
continue; continue;
if (member->getLevel() < bot->getLevel()) if (member->GetLevel() < bot->GetLevel())
continue; continue;
// follow real player only if he has more honor/arena points // follow real player only if he has more honor/arena points

View File

@@ -282,7 +282,7 @@ void PlayerbotFactory::Randomize(bool incremental)
if (pmo) if (pmo)
pmo->finish(); pmo->finish();
// if (bot->getLevel() >= sPlayerbotAIConfig->minEnchantingBotLevel) // if (bot->GetLevel() >= sPlayerbotAIConfig->minEnchantingBotLevel)
// { // {
// pmo = sPerformanceMonitor->start(PERF_MON_RNDBOT, "PlayerbotFactory_Enchant"); // pmo = sPerformanceMonitor->start(PERF_MON_RNDBOT, "PlayerbotFactory_Enchant");
// LOG_INFO("playerbots", "Initializing enchant templates..."); // LOG_INFO("playerbots", "Initializing enchant templates...");
@@ -328,7 +328,7 @@ void PlayerbotFactory::Randomize(bool incremental)
if (pmo) if (pmo)
pmo->finish(); pmo->finish();
if (bot->getLevel() >= sPlayerbotAIConfig->minEnchantingBotLevel) { if (bot->GetLevel() >= sPlayerbotAIConfig->minEnchantingBotLevel) {
ApplyEnchantAndGemsNew(); ApplyEnchantAndGemsNew();
} }
// { // {
@@ -363,7 +363,7 @@ void PlayerbotFactory::Randomize(bool incremental)
//if (pmo) //if (pmo)
// pmo->finish(); // pmo->finish();
// if (bot->getLevel() >= 70) // if (bot->GetLevel() >= 70)
// { // {
// pmo = sPerformanceMonitor->start(PERF_MON_RNDBOT, "PlayerbotFactory_Arenas"); // pmo = sPerformanceMonitor->start(PERF_MON_RNDBOT, "PlayerbotFactory_Arenas");
// LOG_INFO("playerbots", "Initializing arena teams..."); // LOG_INFO("playerbots", "Initializing arena teams...");
@@ -377,7 +377,7 @@ void PlayerbotFactory::Randomize(bool incremental)
bot->RemovePet(nullptr, PET_SAVE_NOT_IN_SLOT, true); bot->RemovePet(nullptr, PET_SAVE_NOT_IN_SLOT, true);
// bot->SaveToDB(false, false); // bot->SaveToDB(false, false);
} }
if (bot->getLevel() >= 10) if (bot->GetLevel() >= 10)
{ {
pmo = sPerformanceMonitor->start(PERF_MON_RNDBOT, "PlayerbotFactory_Pet"); pmo = sPerformanceMonitor->start(PERF_MON_RNDBOT, "PlayerbotFactory_Pet");
LOG_DEBUG("playerbots", "Initializing pet..."); LOG_DEBUG("playerbots", "Initializing pet...");
@@ -417,7 +417,7 @@ void PlayerbotFactory::Refresh()
InitAvailableSpells(); InitAvailableSpells();
InitSkills(); InitSkills();
InitMounts(); InitMounts();
if (bot->getLevel() >= sPlayerbotAIConfig->minEnchantingBotLevel) { if (bot->GetLevel() >= sPlayerbotAIConfig->minEnchantingBotLevel) {
ApplyEnchantAndGemsNew(); ApplyEnchantAndGemsNew();
} }
bot->DurabilityRepairAll(false, 1.0f, false); bot->DurabilityRepairAll(false, 1.0f, false);
@@ -666,7 +666,7 @@ void PlayerbotFactory::InitPet()
if (!itr->second.IsTameable(bot->CanTameExoticPets())) if (!itr->second.IsTameable(bot->CanTameExoticPets()))
continue; continue;
if (itr->second.minlevel > bot->getLevel()) if (itr->second.minlevel > bot->GetLevel())
continue; continue;
ids.push_back(itr->first); ids.push_back(itr->first);
@@ -674,7 +674,7 @@ void PlayerbotFactory::InitPet()
if (ids.empty()) if (ids.empty())
{ {
LOG_ERROR("playerbots", "No pets available for bot {} ({} level)", bot->GetName().c_str(), bot->getLevel()); LOG_ERROR("playerbots", "No pets available for bot {} ({} level)", bot->GetName().c_str(), bot->GetLevel());
return; return;
} }
@@ -728,8 +728,8 @@ void PlayerbotFactory::InitPet()
if (pet) if (pet)
{ {
pet->InitStatsForLevel(bot->getLevel()); pet->InitStatsForLevel(bot->GetLevel());
pet->SetLevel(bot->getLevel()); pet->SetLevel(bot->GetLevel());
pet->SetPower(POWER_HAPPINESS, pet->GetMaxPower(Powers(POWER_HAPPINESS))); pet->SetPower(POWER_HAPPINESS, pet->GetMaxPower(Powers(POWER_HAPPINESS)));
pet->SetHealth(pet->GetMaxHealth()); pet->SetHealth(pet->GetMaxHealth());
} }
@@ -1241,7 +1241,7 @@ bool PlayerbotFactory::CanEquipItem(ItemTemplate const* proto, uint32 desiredQua
if (!requiredLevel) if (!requiredLevel)
return false; return false;
uint32 level = bot->getLevel(); uint32 level = bot->GetLevel();
uint32 delta = 2; uint32 delta = 2;
if (level < 15) if (level < 15)
delta = std::min(level, 15u); // urand(7, 15); delta = std::min(level, 15u); // urand(7, 15);
@@ -1363,7 +1363,7 @@ void Shuffle(std::vector<uint32>& items)
// newItem->SetOwnerGUID(bot->GetGUID()); // newItem->SetOwnerGUID(bot->GetGUID());
// EnchantItem(newItem); // EnchantItem(newItem);
// LOG_INFO("playerbots", "Bot {} {}:{} <{}>: Equip: {}, slot: {}, Old item: {}", // LOG_INFO("playerbots", "Bot {} {}:{} <{}>: Equip: {}, slot: {}, Old item: {}",
// bot->GetGUID().ToString().c_str(), IsAlliance(bot->getRace()) ? "A" : "H", bot->getLevel(), bot->GetName(), newItemId, slot, itemInSlot); // bot->GetGUID().ToString().c_str(), IsAlliance(bot->getRace()) ? "A" : "H", bot->GetLevel(), bot->GetName(), newItemId, slot, itemInSlot);
// found = true; // found = true;
// break; // break;
// } // }
@@ -1390,7 +1390,7 @@ void Shuffle(std::vector<uint32>& items)
// EnchantItem(newItem); // EnchantItem(newItem);
// found = true; // found = true;
// LOG_INFO("playerbots", "Bot {} {}:{} <{}>: Equip: {}, slot: {}", // LOG_INFO("playerbots", "Bot {} {}:{} <{}>: Equip: {}, slot: {}",
// bot->GetGUID().ToString().c_str(), IsAlliance(bot->getRace()) ? "A" : "H", bot->getLevel(), bot->GetName(), newItemId, slot); // bot->GetGUID().ToString().c_str(), IsAlliance(bot->getRace()) ? "A" : "H", bot->GetLevel(), bot->GetName(), newItemId, slot);
// break; // break;
// } // }
// } // }
@@ -1400,7 +1400,7 @@ void Shuffle(std::vector<uint32>& items)
// if (!found) // if (!found)
// { // {
// LOG_INFO("playerbots", "Bot {} {}:{} <{}>: no item for slot {}", // LOG_INFO("playerbots", "Bot {} {}:{} <{}>: no item for slot {}",
// bot->GetGUID().ToString().c_str(), IsAlliance(bot->getRace()) ? "A" : "H", bot->getLevel(), bot->GetName(), slot); // bot->GetGUID().ToString().c_str(), IsAlliance(bot->getRace()) ? "A" : "H", bot->GetLevel(), bot->GetName(), slot);
// continue; // continue;
// } // }
// } // }
@@ -1411,7 +1411,7 @@ void PlayerbotFactory::InitEquipment(bool incremental)
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 = 2; int32 delta = 2;
if (blevel < 15) if (blevel < 15)
delta = std::min(blevel, 15u); delta = std::min(blevel, 15u);
@@ -1593,8 +1593,8 @@ bool PlayerbotFactory::IsDesiredReplacement(Item* item)
// requiredLevel = sRandomItemMgr->GetMinLevelFromCache(proto->ItemId); // requiredLevel = sRandomItemMgr->GetMinLevelFromCache(proto->ItemId);
// } // }
uint32 delta = 1 + (80 - bot->getLevel()) / 10; uint32 delta = 1 + (80 - bot->GetLevel()) / 10;
return proto->Quality < ITEM_QUALITY_RARE || int32(bot->getLevel() - requiredLevel) > delta; return proto->Quality < ITEM_QUALITY_RARE || int32(bot->GetLevel() - requiredLevel) > delta;
} }
inline Item* StoreNewItemInInventorySlot(Player* player, uint32 newItemId, uint32 count) inline Item* StoreNewItemInInventorySlot(Player* player, uint32 newItemId, uint32 count)
@@ -1747,7 +1747,7 @@ void PlayerbotFactory::InitBags(bool destroyOld)
void PlayerbotFactory::EnchantItem(Item* item) void PlayerbotFactory::EnchantItem(Item* item)
{ {
if (bot->getLevel() < sPlayerbotAIConfig->minEnchantingBotLevel) if (bot->GetLevel() < sPlayerbotAIConfig->minEnchantingBotLevel)
return; return;
if (urand(0, 100) < 100 * sPlayerbotAIConfig->randomGearLoweringChance) if (urand(0, 100) < 100 * sPlayerbotAIConfig->randomGearLoweringChance)
@@ -1932,19 +1932,19 @@ void PlayerbotFactory::InitSkills()
uint16 step = bot->GetSkillValue(SKILL_RIDING) ? bot->GetSkillStep(SKILL_RIDING) : 1; uint16 step = bot->GetSkillValue(SKILL_RIDING) ? bot->GetSkillStep(SKILL_RIDING) : 1;
if (bot->getLevel() >= 70) if (bot->GetLevel() >= 70)
bot->SetSkill(SKILL_RIDING, step, 300, 300); bot->SetSkill(SKILL_RIDING, step, 300, 300);
else if (bot->getLevel() >= 60) else if (bot->GetLevel() >= 60)
bot->SetSkill(SKILL_RIDING, step, 225, 225); bot->SetSkill(SKILL_RIDING, step, 225, 225);
else if (bot->getLevel() >= 40) else if (bot->GetLevel() >= 40)
bot->SetSkill(SKILL_RIDING, step, 150, 150); bot->SetSkill(SKILL_RIDING, step, 150, 150);
else if (bot->getLevel() >= 20) else if (bot->GetLevel() >= 20)
bot->SetSkill(SKILL_RIDING, step, 75, 75); bot->SetSkill(SKILL_RIDING, step, 75, 75);
else else
bot->SetSkill(SKILL_RIDING, 0, 0, 0); bot->SetSkill(SKILL_RIDING, 0, 0, 0);
uint32 skillLevel = bot->getLevel() < 40 ? 0 : 1; uint32 skillLevel = bot->GetLevel() < 40 ? 0 : 1;
uint32 dualWieldLevel = bot->getLevel() < 20 ? 0 : 1; uint32 dualWieldLevel = bot->GetLevel() < 20 ? 0 : 1;
SetRandomSkill(SKILL_DEFENSE); SetRandomSkill(SKILL_DEFENSE);
switch (bot->getClass()) switch (bot->getClass())
{ {
@@ -2161,7 +2161,7 @@ void PlayerbotFactory::InitAvailableSpells()
void PlayerbotFactory::InitClassSpells() void PlayerbotFactory::InitClassSpells()
{ {
int32_t level = bot->getLevel(); int32_t level = bot->GetLevel();
switch (bot->getClass()) switch (bot->getClass())
{ {
case CLASS_WARRIOR: case CLASS_WARRIOR:
@@ -2450,14 +2450,14 @@ void PlayerbotFactory::InitQuests(std::list<uint32>& questMap)
uint32 questId = *i; uint32 questId = *i;
Quest const *quest = sObjectMgr->GetQuestTemplate(questId); Quest const *quest = sObjectMgr->GetQuestTemplate(questId);
if (!bot->SatisfyQuestClass(quest, false) || quest->GetMinLevel() > bot->getLevel() || !bot->SatisfyQuestRace(quest, false)) if (!bot->SatisfyQuestClass(quest, false) || quest->GetMinLevel() > bot->GetLevel() || !bot->SatisfyQuestRace(quest, false))
continue; continue;
bot->SetQuestStatus(questId, QUEST_STATUS_COMPLETE); bot->SetQuestStatus(questId, QUEST_STATUS_COMPLETE);
bot->RewardQuest(quest, 0, bot, false); bot->RewardQuest(quest, 0, bot, false);
LOG_INFO("playerbots", "Bot {} ({} level) rewarded quest {}: {} (MinLevel={}, QuestLevel={})", LOG_INFO("playerbots", "Bot {} ({} level) rewarded quest {}: {} (MinLevel={}, QuestLevel={})",
bot->GetName().c_str(), bot->getLevel(), questId, quest->GetTitle().c_str(), quest->GetMinLevel(), quest->GetQuestLevel()); bot->GetName().c_str(), bot->GetLevel(), questId, quest->GetTitle().c_str(), quest->GetMinLevel(), quest->GetQuestLevel());
if (!(count++ % 10)) if (!(count++ % 10))
ClearInventory(); ClearInventory();
@@ -2545,7 +2545,7 @@ void PlayerbotFactory::InitMounts()
uint32 thirdmount = 60; uint32 thirdmount = 60;
uint32 fourthmount = 70; uint32 fourthmount = 70;
if (bot->getLevel() < firstmount) if (bot->GetLevel() < firstmount)
return; return;
std::map<uint8, std::map<uint32, std::vector<uint32>>> mounts; std::map<uint8, std::map<uint32, std::vector<uint32>>> mounts;
@@ -2616,13 +2616,13 @@ void PlayerbotFactory::InitMounts()
for (uint32 type = 0; type < 4; type++) for (uint32 type = 0; type < 4; type++)
{ {
if (bot->getLevel() < secondmount && type == 1) if (bot->GetLevel() < secondmount && type == 1)
continue; continue;
if (bot->getLevel() < thirdmount && type == 2) if (bot->GetLevel() < thirdmount && type == 2)
continue; continue;
if (bot->getLevel() < fourthmount && type == 3) if (bot->GetLevel() < fourthmount && type == 3)
continue; continue;
uint32 index = urand(0, mounts[bot->getRace()][type].size() - 1); uint32 index = urand(0, mounts[bot->getRace()][type].size() - 1);
@@ -2630,7 +2630,7 @@ void PlayerbotFactory::InitMounts()
if (spell) if (spell)
{ {
bot->learnSpell(spell); bot->learnSpell(spell);
LOG_DEBUG("playerbots", "Bot {} ({}) learned {} mount {}", bot->GetGUID().ToString().c_str(), bot->getLevel(), type == 0 ? "slow" : (type == 1 ? "fast" : "flying"), spell); LOG_DEBUG("playerbots", "Bot {} ({}) learned {} mount {}", bot->GetGUID().ToString().c_str(), bot->GetLevel(), type == 0 ? "slow" : (type == 1 ? "fast" : "flying"), spell);
} }
} }
} }
@@ -2667,7 +2667,7 @@ void PlayerbotFactory::InitPotions()
uint32 itemId = sRandomItemMgr->GetRandomPotion(level, effect); uint32 itemId = sRandomItemMgr->GetRandomPotion(level, effect);
if (!itemId) if (!itemId)
{ {
// LOG_INFO("playerbots", "No potions (type {}) available for bot {} ({} level)", effect, bot->GetName().c_str(), bot->getLevel()); // LOG_INFO("playerbots", "No potions (type {}) available for bot {} ({} level)", effect, bot->GetName().c_str(), bot->GetLevel());
continue; continue;
} }
@@ -2701,7 +2701,7 @@ void PlayerbotFactory::InitFood()
proto->Bonding != NO_BIND) proto->Bonding != NO_BIND)
continue; continue;
if (proto->RequiredLevel > bot->getLevel() || proto->RequiredLevel < bot->getLevel() - 9) if (proto->RequiredLevel > bot->GetLevel() || proto->RequiredLevel < bot->GetLevel() - 9)
continue; continue;
if (proto->RequiredSkill && !bot->HasSkill(proto->RequiredSkill)) if (proto->RequiredSkill && !bot->HasSkill(proto->RequiredSkill))
@@ -2744,7 +2744,7 @@ void PlayerbotFactory::InitFood()
void PlayerbotFactory::InitReagents() void PlayerbotFactory::InitReagents()
{ {
int level = bot->getLevel(); int level = bot->GetLevel();
std::vector<std::pair<uint32, uint32>> items; std::vector<std::pair<uint32, uint32>> items;
switch (bot->getClass()) switch (bot->getClass())
{ {
@@ -2754,14 +2754,14 @@ void PlayerbotFactory::InitReagents()
std::vector<int> deadly_poison_ids = {43233, 43232, 22054, 22053, 20844, 8985, 8984, 2893, 2892}; std::vector<int> deadly_poison_ids = {43233, 43232, 22054, 22053, 20844, 8985, 8984, 2893, 2892};
for (int& itemId: deadly_poison_ids) { for (int& itemId: deadly_poison_ids) {
ItemTemplate const* proto = sObjectMgr->GetItemTemplate(itemId); ItemTemplate const* proto = sObjectMgr->GetItemTemplate(itemId);
if (proto->RequiredLevel > bot->getLevel()) if (proto->RequiredLevel > bot->GetLevel())
continue; continue;
items.push_back({itemId, 20}); // deadly poison items.push_back({itemId, 20}); // deadly poison
break; break;
} }
for (int& itemId: instant_poison_ids) { for (int& itemId: instant_poison_ids) {
ItemTemplate const* proto = sObjectMgr->GetItemTemplate(itemId); ItemTemplate const* proto = sObjectMgr->GetItemTemplate(itemId);
if (proto->RequiredLevel > bot->getLevel()) if (proto->RequiredLevel > bot->GetLevel())
continue; continue;
items.push_back({itemId, 20}); // instant poison items.push_back({itemId, 20}); // instant poison
break; break;
@@ -2774,7 +2774,7 @@ void PlayerbotFactory::InitReagents()
items.push_back({5176, 1}); // Flame Totem items.push_back({5176, 1}); // Flame Totem
items.push_back({5177, 1}); // Water Totem items.push_back({5177, 1}); // Water Totem
items.push_back({5178, 1}); // Air Totem items.push_back({5178, 1}); // Air Totem
if (bot->getLevel() >= 30) if (bot->GetLevel() >= 30)
items.push_back({17030, 40}); // Ankh items.push_back({17030, 40}); // Ankh
break; break;
case CLASS_WARLOCK: case CLASS_WARLOCK:
@@ -2848,7 +2848,7 @@ void PlayerbotFactory::InitGlyphs(bool increment)
} }
} }
uint32 level = bot->getLevel(); uint32 level = bot->GetLevel();
uint32 maxSlot = 0; uint32 maxSlot = 0;
if (level >= 15) if (level >= 15)
maxSlot = 2; maxSlot = 2;
@@ -3041,7 +3041,7 @@ void PlayerbotFactory::InitInventoryTrade()
uint32 itemId = sRandomItemMgr->GetRandomTrade(level); uint32 itemId = sRandomItemMgr->GetRandomTrade(level);
if (!itemId) if (!itemId)
{ {
LOG_ERROR("playerbots", "No trade items available for bot {} ({} level)", bot->GetName().c_str(), bot->getLevel()); LOG_ERROR("playerbots", "No trade items available for bot {} ({} level)", bot->GetName().c_str(), bot->GetLevel());
return; return;
} }
@@ -3151,7 +3151,7 @@ void PlayerbotFactory::InitGuild()
guild->AddMember(bot->GetGUID(), urand(GR_OFFICER, GR_INITIATE)); guild->AddMember(bot->GetGUID(), urand(GR_OFFICER, GR_INITIATE));
// add guild tabard // add guild tabard
if (bot->GetGuildId() && bot->getLevel() > 9 && urand(0, 4) && !bot->HasItemCount(5976, 1)) if (bot->GetGuildId() && bot->GetLevel() > 9 && urand(0, 4) && !bot->HasItemCount(5976, 1))
StoreItem(5976, 1); StoreItem(5976, 1);
bot->SaveToDB(false, false); bot->SaveToDB(false, false);
@@ -3229,7 +3229,7 @@ void PlayerbotFactory::InitImmersive()
{ {
Stats from = (Stats)urand(STAT_STRENGTH, MAX_STATS - 1); Stats from = (Stats)urand(STAT_STRENGTH, MAX_STATS - 1);
Stats to = (Stats)urand(STAT_STRENGTH, MAX_STATS - 1); Stats to = (Stats)urand(STAT_STRENGTH, MAX_STATS - 1);
int32 delta = urand(0, 5 + bot->getLevel() / 3); int32 delta = urand(0, 5 + bot->GetLevel() / 3);
if (from != to && percentMap[to] + delta <= 100 && percentMap[from] - delta >= 0) if (from != to && percentMap[to] + delta <= 100 && percentMap[from] - delta >= 0)
{ {
percentMap[to] += delta; percentMap[to] += delta;
@@ -3275,7 +3275,7 @@ void PlayerbotFactory::InitArenaTeam()
return; return;
} }
if (arenateam->GetMembersSize() < ((uint32)arenateam->GetType() * 2) && bot->getLevel() >= 70) if (arenateam->GetMembersSize() < ((uint32)arenateam->GetType() * 2) && bot->GetLevel() >= 70)
{ {
ObjectGuid capt = arenateam->GetCaptain(); ObjectGuid capt = arenateam->GetCaptain();
Player* botcaptain = ObjectAccessor::FindPlayer(capt); Player* botcaptain = ObjectAccessor::FindPlayer(capt);

View File

@@ -504,15 +504,15 @@ void PlayerbotHolder::OnBotLogin(Player* const bot)
bot->SaveToDB(false, false); bot->SaveToDB(false, false);
if (master && isRandomAccount && master->GetLevel() < bot->GetLevel()) { if (master && isRandomAccount && master->GetLevel() < bot->GetLevel()) {
// PlayerbotFactory factory(bot, master->getLevel()); // PlayerbotFactory factory(bot, master->GetLevel());
// factory.Randomize(false); // factory.Randomize(false);
uint32 mixedGearScore = PlayerbotAI::GetMixedGearScore(master, true, false, 12) * sPlayerbotAIConfig->autoInitEquipLevelLimitRatio; uint32 mixedGearScore = PlayerbotAI::GetMixedGearScore(master, true, false, 12) * sPlayerbotAIConfig->autoInitEquipLevelLimitRatio;
PlayerbotFactory factory(bot, master->getLevel(), ITEM_QUALITY_LEGENDARY, mixedGearScore); PlayerbotFactory factory(bot, master->GetLevel(), ITEM_QUALITY_LEGENDARY, mixedGearScore);
factory.Randomize(false); factory.Randomize(false);
} }
// bots join World chat if not solo oriented // bots join World chat if not solo oriented
if (bot->getLevel() >= 10 && sRandomPlayerbotMgr->IsRandomBot(bot) && GET_PLAYERBOT_AI(bot) && GET_PLAYERBOT_AI(bot)->GetGrouperType() != GrouperType::SOLO) if (bot->GetLevel() >= 10 && sRandomPlayerbotMgr->IsRandomBot(bot) && GET_PLAYERBOT_AI(bot) && GET_PLAYERBOT_AI(bot)->GetGrouperType() != GrouperType::SOLO)
{ {
// TODO make action/config // TODO make action/config
// Make the bot join the world channel for chat // Make the bot join the world channel for chat
@@ -628,44 +628,44 @@ std::string const PlayerbotHolder::ProcessBotCommand(std::string const cmd, Obje
int gs; int gs;
if (cmd == "init=white" || cmd == "init=common") if (cmd == "init=white" || cmd == "init=common")
{ {
PlayerbotFactory factory(bot, master->getLevel(), ITEM_QUALITY_NORMAL); PlayerbotFactory factory(bot, master->GetLevel(), ITEM_QUALITY_NORMAL);
factory.Randomize(false); factory.Randomize(false);
return "ok"; return "ok";
} }
else if (cmd == "init=green" || cmd == "init=uncommon") else if (cmd == "init=green" || cmd == "init=uncommon")
{ {
PlayerbotFactory factory(bot, master->getLevel(), ITEM_QUALITY_UNCOMMON); PlayerbotFactory factory(bot, master->GetLevel(), ITEM_QUALITY_UNCOMMON);
factory.Randomize(false); factory.Randomize(false);
return "ok"; return "ok";
} }
else if (cmd == "init=blue" || cmd == "init=rare") else if (cmd == "init=blue" || cmd == "init=rare")
{ {
PlayerbotFactory factory(bot, master->getLevel(), ITEM_QUALITY_RARE); PlayerbotFactory factory(bot, master->GetLevel(), ITEM_QUALITY_RARE);
factory.Randomize(false); factory.Randomize(false);
return "ok"; return "ok";
} }
else if (cmd == "init=epic" || cmd == "init=purple") else if (cmd == "init=epic" || cmd == "init=purple")
{ {
PlayerbotFactory factory(bot, master->getLevel(), ITEM_QUALITY_EPIC); PlayerbotFactory factory(bot, master->GetLevel(), ITEM_QUALITY_EPIC);
factory.Randomize(false); factory.Randomize(false);
return "ok"; return "ok";
} }
else if (cmd == "init=legendary" || cmd == "init=yellow") else if (cmd == "init=legendary" || cmd == "init=yellow")
{ {
PlayerbotFactory factory(bot, master->getLevel(), ITEM_QUALITY_LEGENDARY); PlayerbotFactory factory(bot, master->GetLevel(), ITEM_QUALITY_LEGENDARY);
factory.Randomize(false); factory.Randomize(false);
return "ok"; return "ok";
} }
else if (cmd == "init=auto") else if (cmd == "init=auto")
{ {
uint32 mixedGearScore = PlayerbotAI::GetMixedGearScore(master, true, false, 12) * sPlayerbotAIConfig->autoInitEquipLevelLimitRatio; uint32 mixedGearScore = PlayerbotAI::GetMixedGearScore(master, true, false, 12) * sPlayerbotAIConfig->autoInitEquipLevelLimitRatio;
PlayerbotFactory factory(bot, master->getLevel(), ITEM_QUALITY_LEGENDARY, mixedGearScore); PlayerbotFactory factory(bot, master->GetLevel(), ITEM_QUALITY_LEGENDARY, mixedGearScore);
factory.Randomize(false); factory.Randomize(false);
return "ok, gear score limit: " + std::to_string(mixedGearScore / (ITEM_QUALITY_EPIC + 1)) + "(for epic)"; return "ok, gear score limit: " + std::to_string(mixedGearScore / (ITEM_QUALITY_EPIC + 1)) + "(for epic)";
} }
else if (cmd.starts_with("init=") && sscanf(cmd.c_str(), "init=%d", &gs) != -1) else if (cmd.starts_with("init=") && sscanf(cmd.c_str(), "init=%d", &gs) != -1)
{ {
PlayerbotFactory factory(bot, master->getLevel(), ITEM_QUALITY_LEGENDARY, gs); PlayerbotFactory factory(bot, master->GetLevel(), ITEM_QUALITY_LEGENDARY, gs);
factory.Randomize(false); factory.Randomize(false);
return "ok, gear score limit: " + std::to_string(gs / (ITEM_QUALITY_EPIC + 1)) + "(for epic)"; return "ok, gear score limit: " + std::to_string(gs / (ITEM_QUALITY_EPIC + 1)) + "(for epic)";
} }
@@ -674,7 +674,7 @@ std::string const PlayerbotHolder::ProcessBotCommand(std::string const cmd, Obje
if (cmd == "refresh=raid") if (cmd == "refresh=raid")
{ // TODO: This function is not perfect yet. If you are already in a raid, { // TODO: This function is not perfect yet. If you are already in a raid,
// after the command is executed, the AI needs to go back online or exit the raid and re-enter. // after the command is executed, the AI needs to go back online or exit the raid and re-enter.
PlayerbotFactory factory(bot, bot->getLevel()); PlayerbotFactory factory(bot, bot->GetLevel());
factory.UnbindInstance(); factory.UnbindInstance();
return "ok"; return "ok";
} }
@@ -682,13 +682,13 @@ std::string const PlayerbotHolder::ProcessBotCommand(std::string const cmd, Obje
if (cmd == "levelup" || cmd == "level") if (cmd == "levelup" || cmd == "level")
{ {
PlayerbotFactory factory(bot, bot->getLevel()); PlayerbotFactory factory(bot, bot->GetLevel());
factory.Randomize(true); factory.Randomize(true);
return "ok"; return "ok";
} }
else if (cmd == "refresh") else if (cmd == "refresh")
{ {
PlayerbotFactory factory(bot, bot->getLevel()); PlayerbotFactory factory(bot, bot->GetLevel());
factory.Refresh(); factory.Refresh();
return "ok"; return "ok";
} }
@@ -698,7 +698,7 @@ std::string const PlayerbotHolder::ProcessBotCommand(std::string const cmd, Obje
return "ok"; return "ok";
} }
else if (cmd == "quests"){ else if (cmd == "quests"){
PlayerbotFactory factory(bot, bot->getLevel()); PlayerbotFactory factory(bot, bot->GetLevel());
factory.InitInstanceQuests(); factory.InitInstanceQuests();
return "Initialization quests"; return "Initialization quests";
} }
@@ -764,7 +764,7 @@ std::vector<std::string> PlayerbotHolder::HandlePlayerbotCommand(char const* arg
if (!strcmp(cmd, "initself")) { if (!strcmp(cmd, "initself")) {
if (master->GetSession()->GetSecurity() >= SEC_GAMEMASTER) { if (master->GetSession()->GetSecurity() >= SEC_GAMEMASTER) {
// OnBotLogin(master); // OnBotLogin(master);
PlayerbotFactory factory(master, master->getLevel(), ITEM_QUALITY_EPIC); PlayerbotFactory factory(master, master->GetLevel(), ITEM_QUALITY_EPIC);
factory.Randomize(false); factory.Randomize(false);
messages.push_back("initself ok"); messages.push_back("initself ok");
return messages; return messages;
@@ -778,7 +778,7 @@ std::vector<std::string> PlayerbotHolder::HandlePlayerbotCommand(char const* arg
if (!strcmp(cmd, "initself=rare")) { if (!strcmp(cmd, "initself=rare")) {
if (master->GetSession()->GetSecurity() >= SEC_GAMEMASTER) { if (master->GetSession()->GetSecurity() >= SEC_GAMEMASTER) {
// OnBotLogin(master); // OnBotLogin(master);
PlayerbotFactory factory(master, master->getLevel(), ITEM_QUALITY_RARE); PlayerbotFactory factory(master, master->GetLevel(), ITEM_QUALITY_RARE);
factory.Randomize(false); factory.Randomize(false);
messages.push_back("initself ok"); messages.push_back("initself ok");
return messages; return messages;
@@ -790,7 +790,7 @@ std::vector<std::string> PlayerbotHolder::HandlePlayerbotCommand(char const* arg
if (!strcmp(cmd, "initself=epic")) { if (!strcmp(cmd, "initself=epic")) {
if (master->GetSession()->GetSecurity() >= SEC_GAMEMASTER) { if (master->GetSession()->GetSecurity() >= SEC_GAMEMASTER) {
// OnBotLogin(master); // OnBotLogin(master);
PlayerbotFactory factory(master, master->getLevel(), ITEM_QUALITY_EPIC); PlayerbotFactory factory(master, master->GetLevel(), ITEM_QUALITY_EPIC);
factory.Randomize(false); factory.Randomize(false);
messages.push_back("initself ok"); messages.push_back("initself ok");
return messages; return messages;
@@ -803,7 +803,7 @@ std::vector<std::string> PlayerbotHolder::HandlePlayerbotCommand(char const* arg
if (sscanf(cmd, "initself=%d", &gs) != -1) { if (sscanf(cmd, "initself=%d", &gs) != -1) {
if (master->GetSession()->GetSecurity() >= SEC_GAMEMASTER) { if (master->GetSession()->GetSecurity() >= SEC_GAMEMASTER) {
// OnBotLogin(master); // OnBotLogin(master);
PlayerbotFactory factory(master, master->getLevel(), ITEM_QUALITY_LEGENDARY, gs); PlayerbotFactory factory(master, master->GetLevel(), ITEM_QUALITY_LEGENDARY, gs);
factory.Randomize(false); factory.Randomize(false);
messages.push_back("initself ok, gs = " + std::to_string(gs)); messages.push_back("initself ok, gs = " + std::to_string(gs));
return messages; return messages;

View File

@@ -69,7 +69,7 @@ PlayerbotSecurityLevel PlayerbotSecurity::LevelFor(Player* from, DenyReason* rea
return PLAYERBOT_SECURITY_TALK; return PLAYERBOT_SECURITY_TALK;
} }
if (sPlayerbotAIConfig->groupInvitationPermission <= 1 && (int32)bot->getLevel() - (int8)from->getLevel() > 5) if (sPlayerbotAIConfig->groupInvitationPermission <= 1 && (int32)bot->GetLevel() - (int8)from->GetLevel() > 5)
{ {
if (!bot->GetGuildId() || bot->GetGuildId() != from->GetGuildId()) if (!bot->GetGuildId() || bot->GetGuildId() != from->GetGuildId())
{ {
@@ -84,8 +84,8 @@ PlayerbotSecurityLevel PlayerbotSecurity::LevelFor(Player* from, DenyReason* rea
int32 fromGS = (int32)botAI->GetEquipGearScore(from, false, false); int32 fromGS = (int32)botAI->GetEquipGearScore(from, false, false);
if (sPlayerbotAIConfig->gearscorecheck) if (sPlayerbotAIConfig->gearscorecheck)
{ {
if (botGS && bot->getLevel() > 15 && botGS > fromGS && if (botGS && bot->GetLevel() > 15 && botGS > fromGS &&
static_cast<float>(100 * (botGS - fromGS) / botGS) >= static_cast<float>(12 * sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL) / from->getLevel())) static_cast<float>(100 * (botGS - fromGS) / botGS) >= static_cast<float>(12 * sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL) / from->GetLevel()))
{ {
if (reason) *reason = PLAYERBOT_DENY_GEARSCORE; if (reason) *reason = PLAYERBOT_DENY_GEARSCORE;
return PLAYERBOT_SECURITY_TALK; return PLAYERBOT_SECURITY_TALK;
@@ -199,14 +199,14 @@ bool PlayerbotSecurity::CheckLevelFor(PlayerbotSecurityLevel level, bool silent,
out << "I'll do it later"; out << "I'll do it later";
break; break;
case PLAYERBOT_DENY_LOW_LEVEL: case PLAYERBOT_DENY_LOW_LEVEL:
out << "You are too low level: |cffff0000" << (uint32)from->getLevel() << "|cffffffff/|cff00ff00" << (uint32)bot->getLevel(); out << "You are too low level: |cffff0000" << (uint32)from->GetLevel() << "|cffffffff/|cff00ff00" << (uint32)bot->GetLevel();
break; break;
case PLAYERBOT_DENY_GEARSCORE: case PLAYERBOT_DENY_GEARSCORE:
{ {
int botGS = (int)botAI->GetEquipGearScore(bot, false, false); int botGS = (int)botAI->GetEquipGearScore(bot, false, false);
int fromGS = (int)botAI->GetEquipGearScore(from, false, false); int fromGS = (int)botAI->GetEquipGearScore(from, false, false);
int diff = (100 * (botGS - fromGS) / botGS); int diff = (100 * (botGS - fromGS) / botGS);
int req = 12 * sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL) / from->getLevel(); int req = 12 * sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL) / from->GetLevel();
out << "Your gearscore is too low: |cffff0000" << fromGS << "|cffffffff/|cff00ff00" << botGS << " |cffff0000" << diff << "%|cffffffff/|cff00ff00" << req << "%"; out << "Your gearscore is too low: |cffff0000" << fromGS << "|cffffffff/|cff00ff00" << botGS << " |cffff0000" << diff << "%|cffffffff/|cff00ff00" << req << "%";
} }
break; break;

View File

@@ -1696,11 +1696,11 @@ uint32 RandomItemMgr::GetUpgrade(Player* player, std::string spec, uint8 slot, u
continue; continue;
// skip higher lvl // skip higher lvl
if (info.minLevel > player->getLevel()) if (info.minLevel > player->GetLevel())
continue; continue;
// skip too low level // skip too low level
if (info.minLevel < (player->getLevel() - 10)) if (info.minLevel < (player->GetLevel() - 10))
continue; continue;
// skip wrong team // skip wrong team
@@ -1720,7 +1720,7 @@ uint32 RandomItemMgr::GetUpgrade(Player* player, std::string spec, uint8 slot, u
continue; continue;
// skip items that only fit in slot, but not stats // skip items that only fit in slot, but not stats
if (!itemId && info.weights[specId] == 1 && player->getLevel() > 40) if (!itemId && info.weights[specId] == 1 && player->GetLevel() > 40)
continue; continue;
// skip quest items // skip quest items
@@ -1751,7 +1751,7 @@ uint32 RandomItemMgr::GetUpgrade(Player* player, std::string spec, uint8 slot, u
} }
} }
if (bestSpecId && bestSpecId != specId && player->getLevel() > 40) if (bestSpecId && bestSpecId != specId && player->GetLevel() > 40)
return 0; return 0;
if (!closestUpgrade) if (!closestUpgrade)
@@ -1820,11 +1820,11 @@ std::vector<uint32> RandomItemMgr::GetUpgradeList(Player* player, std::string sp
continue; continue;
// skip higher lvl // skip higher lvl
if (info.minLevel > player->getLevel()) if (info.minLevel > player->GetLevel())
continue; continue;
// skip too low level // skip too low level
if ((int32)info.minLevel < (int32)(player->getLevel() - 20)) if ((int32)info.minLevel < (int32)(player->GetLevel() - 20))
continue; continue;
// skip wrong team // skip wrong team
@@ -1844,7 +1844,7 @@ std::vector<uint32> RandomItemMgr::GetUpgradeList(Player* player, std::string sp
continue; continue;
// skip items that only fit in slot, but not stats // skip items that only fit in slot, but not stats
if (!itemId && info.weights[specId] == 1 && player->getLevel() > 40) if (!itemId && info.weights[specId] == 1 && player->GetLevel() > 40)
continue; continue;
// skip quest items // skip quest items
@@ -1863,7 +1863,7 @@ std::vector<uint32> RandomItemMgr::GetUpgradeList(Player* player, std::string sp
info.slot == EQUIPMENT_SLOT_FINGER2)) info.slot == EQUIPMENT_SLOT_FINGER2))
continue; continue;
//if (player->getLevel() >= 40) //if (player->GetLevel() >= 40)
//{ //{
// // check if item stat score is the best among class specs // // check if item stat score is the best among class specs
// uint32 bestSpecId = 0; // uint32 bestSpecId = 0;
@@ -1990,11 +1990,11 @@ uint32 RandomItemMgr::GetLiveStatWeight(Player* player, uint32 itemId)
statWeight = itr->second.weights[specId]; statWeight = itr->second.weights[specId];
// skip higher lvl // skip higher lvl
if (itr->second.minLevel > player->getLevel()) if (itr->second.minLevel > player->GetLevel())
return 0; return 0;
// skip too low level // skip too low level
//if ((int32)info->minLevel < (int32)(player->getLevel() - 20)) //if ((int32)info->minLevel < (int32)(player->GetLevel() - 20))
// return 0; // return 0;
// skip wrong team // skip wrong team
@@ -2025,7 +2025,7 @@ uint32 RandomItemMgr::GetLiveStatWeight(Player* player, uint32 itemId)
return 0; return 0;
// skip items that only fit in slot, but not stats // skip items that only fit in slot, but not stats
if (!itemId && itr->second.weights[specId] == 1 && player->getLevel() > 20) if (!itemId && itr->second.weights[specId] == 1 && player->GetLevel() > 20)
return 0; return 0;
// check if item stat score is the best among class specs // check if item stat score is the best among class specs
@@ -2040,7 +2040,7 @@ uint32 RandomItemMgr::GetLiveStatWeight(Player* player, uint32 itemId)
} }
} }
if (bestSpecId && bestSpecId != specId && player->getLevel() >= 60) if (bestSpecId && bestSpecId != specId && player->GetLevel() >= 60)
return 0;*/ return 0;*/
return statWeight; return statWeight;

View File

@@ -466,7 +466,7 @@ void RandomPlayerbotFactory::CreateRandomBots()
if (Player* playerBot = factory.CreateRandomBot(session, cls, names)) { if (Player* playerBot = factory.CreateRandomBot(session, cls, names)) {
playerBot->SaveToDB(true, false); playerBot->SaveToDB(true, false);
sCharacterCache->AddCharacterCacheEntry(playerBot->GetGUID(), accountId, playerBot->GetName(), sCharacterCache->AddCharacterCacheEntry(playerBot->GetGUID(), accountId, playerBot->GetName(),
playerBot->getGender(), playerBot->getRace(), playerBot->getClass(), playerBot->getLevel()); playerBot->getGender(), playerBot->getRace(), playerBot->getClass(), playerBot->GetLevel());
playerBot->CleanupsBeforeDelete(); playerBot->CleanupsBeforeDelete();
delete playerBot; delete playerBot;
} }
@@ -666,7 +666,7 @@ void RandomPlayerbotFactory::CreateRandomArenaTeams()
{ {
Player* player = ObjectAccessor::FindConnectedPlayer(captain); Player* player = ObjectAccessor::FindConnectedPlayer(captain);
if (!arenateam && player && player->getLevel() >= 70) if (!arenateam && player && player->GetLevel() >= 70)
availableCaptains.push_back(captain); availableCaptains.push_back(captain);
} }
} }
@@ -692,7 +692,7 @@ void RandomPlayerbotFactory::CreateRandomArenaTeams()
continue; continue;
} }
if (player->getLevel() < 70) if (player->GetLevel() < 70)
{ {
LOG_ERROR("playerbots", "Bot {} must be level 70 to create an arena team", captain.ToString().c_str()); LOG_ERROR("playerbots", "Bot {} must be level 70 to create an arena team", captain.ToString().c_str());
continue; continue;

View File

@@ -250,7 +250,7 @@ void RandomPlayerbotMgr::LogPlayerLocation()
out << std::to_string(bot->getRace()) << ","; out << std::to_string(bot->getRace()) << ",";
out << std::to_string(bot->getClass()) << ","; out << std::to_string(bot->getClass()) << ",";
out << bot->GetMapId() << ","; out << bot->GetMapId() << ",";
out << bot->getLevel() << ","; out << bot->GetLevel() << ",";
out << bot->GetHealth() << ","; out << bot->GetHealth() << ",";
out << bot->GetPowerPct(bot->getPowerType()) << ","; out << bot->GetPowerPct(bot->getPowerType()) << ",";
out << bot->GetMoney() << ","; out << bot->GetMoney() << ",";
@@ -293,7 +293,7 @@ void RandomPlayerbotMgr::LogPlayerLocation()
out << std::to_string(bot->getRace()) << ","; out << std::to_string(bot->getRace()) << ",";
out << std::to_string(bot->getClass()) << ","; out << std::to_string(bot->getClass()) << ",";
out << bot->GetMapId() << ","; out << bot->GetMapId() << ",";
out << bot->getLevel() << ","; out << bot->GetLevel() << ",";
out << bot->GetHealth() << ","; out << bot->GetHealth() << ",";
out << bot->GetPowerPct(bot->getPowerType()) << ","; out << bot->GetPowerPct(bot->getPowerType()) << ",";
out << bot->GetMoney() << ","; out << bot->GetMoney() << ",";
@@ -653,7 +653,7 @@ void RandomPlayerbotMgr::CheckBgQueue()
BattlegroundTypeId bgTypeId = sBattlegroundMgr->BGTemplateId(queueTypeId); BattlegroundTypeId bgTypeId = sBattlegroundMgr->BGTemplateId(queueTypeId);
Battleground* bg = sBattlegroundMgr->GetBattlegroundTemplate(bgTypeId); Battleground* bg = sBattlegroundMgr->GetBattlegroundTemplate(bgTypeId);
uint32 mapId = bg->GetMapId(); uint32 mapId = bg->GetMapId();
PvPDifficultyEntry const* pvpDiff = GetBattlegroundBracketByLevel(mapId, player->getLevel()); PvPDifficultyEntry const* pvpDiff = GetBattlegroundBracketByLevel(mapId, player->GetLevel());
if (!pvpDiff) if (!pvpDiff)
continue; continue;
@@ -743,7 +743,7 @@ void RandomPlayerbotMgr::CheckBgQueue()
BattlegroundTypeId bgTypeId = sBattlegroundMgr->BGTemplateId(queueTypeId); BattlegroundTypeId bgTypeId = sBattlegroundMgr->BGTemplateId(queueTypeId);
Battleground* bg = sBattlegroundMgr->GetBattlegroundTemplate(bgTypeId); Battleground* bg = sBattlegroundMgr->GetBattlegroundTemplate(bgTypeId);
uint32 mapId = bg->GetMapId(); uint32 mapId = bg->GetMapId();
PvPDifficultyEntry const* pvpDiff = GetBattlegroundBracketByLevel(mapId, bot->getLevel()); PvPDifficultyEntry const* pvpDiff = GetBattlegroundBracketByLevel(mapId, bot->GetLevel());
if (!pvpDiff) if (!pvpDiff)
continue; continue;
@@ -893,8 +893,8 @@ void RandomPlayerbotMgr::CheckPlayers()
//if (player->GetSession()->GetSecurity() > SEC_PLAYER) //if (player->GetSession()->GetSecurity() > SEC_PLAYER)
// continue; // continue;
if (player->getLevel() > playersLevel) if (player->GetLevel() > playersLevel)
playersLevel = player->getLevel() + 3; playersLevel = player->GetLevel() + 3;
} }
LOG_INFO("playerbots", "Max player level is {}, max bot level set to {}", playersLevel - 3, playersLevel); LOG_INFO("playerbots", "Max player level is {}, max bot level set to {}", playersLevel - 3, playersLevel);
@@ -935,7 +935,7 @@ bool RandomPlayerbotMgr::ProcessBot(uint32 bot)
if (!player || !player->GetGroup()) if (!player || !player->GetGroup())
{ {
if (player) if (player)
LOG_INFO("playerbots", "Bot #{} {}:{} <{}>: log out", bot, IsAlliance(player->getRace()) ? "A" : "H", player->getLevel(), player->GetName().c_str()); LOG_INFO("playerbots", "Bot #{} {}:{} <{}>: log out", bot, IsAlliance(player->getRace()) ? "A" : "H", player->GetLevel(), player->GetName().c_str());
else else
LOG_INFO("playerbots", "Bot #{}: log out", bot); LOG_INFO("playerbots", "Bot #{}: log out", bot);
@@ -1016,7 +1016,7 @@ bool RandomPlayerbotMgr::ProcessBot(uint32 bot)
uint32 logout = GetEventValue(bot, "logout"); uint32 logout = GetEventValue(bot, "logout");
if (player && !logout && !isValid) if (player && !logout && !isValid)
{ {
LOG_INFO("playerbots", "Bot #{} {}:{} <{}>: log out", bot, IsAlliance(player->getRace()) ? "A" : "H", player->getLevel(), player->GetName().c_str()); LOG_INFO("playerbots", "Bot #{} {}:{} <{}>: log out", bot, IsAlliance(player->getRace()) ? "A" : "H", player->GetLevel(), player->GetName().c_str());
LogoutPlayerBot(botGUID); LogoutPlayerBot(botGUID);
currentBots.remove(bot); currentBots.remove(bot);
SetEventValue(bot, "logout", 1, urand(sPlayerbotAIConfig->minRandomBotInWorldTime, sPlayerbotAIConfig->maxRandomBotInWorldTime)); SetEventValue(bot, "logout", 1, urand(sPlayerbotAIConfig->minRandomBotInWorldTime, sPlayerbotAIConfig->maxRandomBotInWorldTime));
@@ -1089,7 +1089,7 @@ bool RandomPlayerbotMgr::ProcessBot(Player* player)
if (!randomize) if (!randomize)
{ {
Randomize(player); Randomize(player);
LOG_INFO("playerbots", "Bot #{} {}:{} <{}>: randomized", bot, player->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", player->getLevel(), player->GetName()); LOG_INFO("playerbots", "Bot #{} {}:{} <{}>: randomized", bot, player->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", player->GetLevel(), player->GetName());
uint32 randomTime = urand(sPlayerbotAIConfig->minRandomBotRandomizeTime, sPlayerbotAIConfig->maxRandomBotRandomizeTime); uint32 randomTime = urand(sPlayerbotAIConfig->minRandomBotRandomizeTime, sPlayerbotAIConfig->maxRandomBotRandomizeTime);
ScheduleRandomize(bot, randomTime); ScheduleRandomize(bot, randomTime);
return true; return true;
@@ -1145,7 +1145,7 @@ void RandomPlayerbotMgr::RandomTeleport(Player* bot, std::vector<WorldLocation>&
if (bot->InBattlegroundQueue()) if (bot->InBattlegroundQueue())
return; return;
// if (bot->getLevel() < 5) // if (bot->GetLevel() < 5)
// return; // return;
// if (sPlayerbotAIConfig->randomBotRpgChance < 0) // if (sPlayerbotAIConfig->randomBotRpgChance < 0)
@@ -1423,7 +1423,7 @@ void RandomPlayerbotMgr::RandomTeleportForLevel(Player* bot)
if (bot->InBattleground()) if (bot->InBattleground())
return; return;
uint32 level = bot->getLevel(); uint32 level = bot->GetLevel();
uint8 race = bot->getRace(); uint8 race = bot->getRace();
LOG_DEBUG("playerbots", "Random teleporting bot {} for level {} ({} locations available)", bot->GetName().c_str(), bot->GetLevel(), locsPerLevelCache[level].size()); LOG_DEBUG("playerbots", "Random teleporting bot {} for level {} ({} locations available)", bot->GetName().c_str(), bot->GetLevel(), locsPerLevelCache[level].size());
if (level > 10 && urand(0, 100) < sPlayerbotAIConfig->probTeleToBankers * 100) { if (level > 10 && urand(0, 100) < sPlayerbotAIConfig->probTeleToBankers * 100) {
@@ -1438,7 +1438,7 @@ void RandomPlayerbotMgr::RandomTeleportGrindForLevel(Player* bot)
if (bot->InBattleground()) if (bot->InBattleground())
return; return;
uint32 level = bot->getLevel(); uint32 level = bot->GetLevel();
uint8 race = bot->getRace(); uint8 race = bot->getRace();
LOG_DEBUG("playerbots", "Random teleporting bot {} for level {} ({} locations available)", bot->GetName().c_str(), bot->GetLevel(), locsPerLevelCache[level].size()); LOG_DEBUG("playerbots", "Random teleporting bot {} for level {} ({} locations available)", bot->GetName().c_str(), bot->GetLevel(), locsPerLevelCache[level].size());
@@ -1489,11 +1489,11 @@ void RandomPlayerbotMgr::Randomize(Player* bot)
if (bot->InBattleground()) if (bot->InBattleground())
return; return;
if (bot->getLevel() < 3 || (bot->getLevel() < 56 && bot->getClass() == CLASS_DEATH_KNIGHT)) { if (bot->GetLevel() < 3 || (bot->GetLevel() < 56 && bot->getClass() == CLASS_DEATH_KNIGHT)) {
RandomizeFirst(bot); RandomizeFirst(bot);
} }
else if (bot->getLevel() < sPlayerbotAIConfig->randomBotMaxLevel || !sPlayerbotAIConfig->downgradeMaxLevelBot) { else if (bot->GetLevel() < sPlayerbotAIConfig->randomBotMaxLevel || !sPlayerbotAIConfig->downgradeMaxLevelBot) {
uint8 level = bot->getLevel(); uint8 level = bot->GetLevel();
PlayerbotFactory factory(bot, level); PlayerbotFactory factory(bot, level);
factory.Randomize(true); factory.Randomize(true);
// IncreaseLevel(bot); // IncreaseLevel(bot);
@@ -1512,7 +1512,7 @@ void RandomPlayerbotMgr::IncreaseLevel(Player* bot)
PerformanceMonitorOperation* pmo = sPerformanceMonitor->start(PERF_MON_RNDBOT, "IncreaseLevel"); PerformanceMonitorOperation* pmo = sPerformanceMonitor->start(PERF_MON_RNDBOT, "IncreaseLevel");
uint32 lastLevel = GetValue(bot, "level"); uint32 lastLevel = GetValue(bot, "level");
uint8 level = bot->getLevel() + 1; uint8 level = bot->GetLevel() + 1;
if (level > maxLevel) { if (level > maxLevel) {
level = maxLevel; level = maxLevel;
} }
@@ -1690,7 +1690,7 @@ void RandomPlayerbotMgr::Refresh(Player* bot)
bot->SetFullHealth(); bot->SetFullHealth();
bot->SetPvP(true); bot->SetPvP(true);
PlayerbotFactory factory(bot, bot->getLevel(), ITEM_QUALITY_RARE); PlayerbotFactory factory(bot, bot->GetLevel(), ITEM_QUALITY_RARE);
factory.Refresh(); factory.Refresh();
if (bot->GetMaxPower(POWER_MANA) > 0) if (bot->GetMaxPower(POWER_MANA) > 0)
@@ -1700,7 +1700,7 @@ void RandomPlayerbotMgr::Refresh(Player* bot)
bot->SetPower(POWER_ENERGY, bot->GetMaxPower(POWER_ENERGY)); bot->SetPower(POWER_ENERGY, bot->GetMaxPower(POWER_ENERGY));
uint32 money = bot->GetMoney(); uint32 money = bot->GetMoney();
bot->SetMoney(money + 500 * sqrt(urand(1, bot->getLevel() * 5))); bot->SetMoney(money + 500 * sqrt(urand(1, bot->GetLevel() * 5)));
if (bot->GetGroup()) if (bot->GetGroup())
bot->RemoveFromGroup(); bot->RemoveFromGroup();
@@ -2216,9 +2216,9 @@ void RandomPlayerbotMgr::PrintStats()
{ {
Player* bot = i->second; Player* bot = i->second;
if (IsAlliance(bot->getRace())) if (IsAlliance(bot->getRace()))
++alliance[bot->getLevel() / 10]; ++alliance[bot->GetLevel() / 10];
else else
++horde[bot->getLevel() / 10]; ++horde[bot->GetLevel() / 10];
++perRace[bot->getRace()]; ++perRace[bot->getRace()];
++perClass[bot->getClass()]; ++perClass[bot->getClass()];

View File

@@ -1063,7 +1063,7 @@ bool QuestRelationTravelDestination::isActive(Player* bot)
{ {
if (relation == 0) if (relation == 0)
{ {
if (questTemplate->GetQuestLevel() >= bot->getLevel() + 5) if (questTemplate->GetQuestLevel() >= bot->GetLevel() + 5)
return false; return false;
//if (questTemplate->XPValue(bot) == 0) //if (questTemplate->XPValue(bot) == 0)
@@ -1135,19 +1135,19 @@ std::string const QuestRelationTravelDestination::getTitle()
bool QuestObjectiveTravelDestination::isActive(Player* bot) bool QuestObjectiveTravelDestination::isActive(Player* bot)
{ {
if (questTemplate->GetQuestLevel() > bot->getLevel() + 1) if (questTemplate->GetQuestLevel() > bot->GetLevel() + 1)
return false; return false;
PlayerbotAI* botAI = GET_PLAYERBOT_AI(bot); PlayerbotAI* botAI = GET_PLAYERBOT_AI(bot);
AiObjectContext* context = botAI->GetAiObjectContext(); AiObjectContext* context = botAI->GetAiObjectContext();
if (questTemplate->GetQuestLevel() + 5 > bot->getLevel() && !AI_VALUE(bool, "can fight equal")) if (questTemplate->GetQuestLevel() + 5 > bot->GetLevel() && !AI_VALUE(bool, "can fight equal"))
return false; return false;
//Check mob level //Check mob level
if (getEntry() > 0) if (getEntry() > 0)
{ {
CreatureTemplate const* cInfo = sObjectMgr->GetCreatureTemplate(getEntry()); CreatureTemplate const* cInfo = sObjectMgr->GetCreatureTemplate(getEntry());
if (cInfo && (int)cInfo->maxlevel - (int)bot->getLevel() > 4) if (cInfo && (int)cInfo->maxlevel - (int)bot->GetLevel() > 4)
return false; return false;
// Do not try to hand-in dungeon/elite quests in instances without a group. // Do not try to hand-in dungeon/elite quests in instances without a group.
@@ -1258,7 +1258,7 @@ bool ExploreTravelDestination::isActive(Player* bot)
{ {
AreaTableEntry const* area = sAreaTableStore.LookupEntry(areaId); AreaTableEntry const* area = sAreaTableStore.LookupEntry(areaId);
if (area->area_level && (uint32)area->area_level > bot->getLevel() && bot->getLevel() < DEFAULT_MAX_LEVEL) if (area->area_level && (uint32)area->area_level > bot->GetLevel() && bot->GetLevel() < DEFAULT_MAX_LEVEL)
return false; return false;
if (area->exploreFlag == 0xffff) if (area->exploreFlag == 0xffff)
@@ -1290,7 +1290,7 @@ bool GrindTravelDestination::isActive(Player* bot)
CreatureTemplate const* cInfo = GetCreatureTemplate(); CreatureTemplate const* cInfo = GetCreatureTemplate();
int32 botLevel = bot->getLevel(); int32 botLevel = bot->GetLevel();
uint8 botPowerLevel = AI_VALUE(uint8, "durability"); uint8 botPowerLevel = AI_VALUE(uint8, "durability");
float levelMod = botPowerLevel / 500.0f; //(0-0.2f) float levelMod = botPowerLevel / 500.0f; //(0-0.2f)
@@ -1345,7 +1345,7 @@ bool BossTravelDestination::isActive(Player* bot)
CreatureTemplate const* cInfo = getCreatureTemplate(); CreatureTemplate const* cInfo = getCreatureTemplate();
/* /*
int32 botLevel = bot->getLevel(); int32 botLevel = bot->GetLevel();
uint8 botPowerLevel = AI_VALUE(uint8, "durability"); uint8 botPowerLevel = AI_VALUE(uint8, "durability");
float levelMod = botPowerLevel / 500.0f; //(0-0.2f) float levelMod = botPowerLevel / 500.0f; //(0-0.2f)
@@ -1362,7 +1362,7 @@ bool BossTravelDestination::isActive(Player* bot)
return false; return false;
*/ */
if ((int32)cInfo->maxlevel > bot->getLevel() + 3) if ((int32)cInfo->maxlevel > bot->GetLevel() + 3)
return false; return false;
FactionTemplateEntry const* factionEntry = sFactionTemplateStore.LookupEntry(cInfo->faction); FactionTemplateEntry const* factionEntry = sFactionTemplateStore.LookupEntry(cInfo->faction);
@@ -3842,7 +3842,7 @@ uint32 TravelMgr::getDialogStatus(Player* pPlayer, int32 questgiver, Quest const
{ {
dialogStatusNew = DIALOG_STATUS_REWARD_REP; dialogStatusNew = DIALOG_STATUS_REWARD_REP;
} }
else if (lowLevelDiff < 0 || pPlayer->getLevel() <= pPlayer->GetQuestLevel(pQuest) + uint32(lowLevelDiff)) else if (lowLevelDiff < 0 || pPlayer->GetLevel() <= pPlayer->GetQuestLevel(pQuest) + uint32(lowLevelDiff))
{ {
dialogStatusNew = DIALOG_STATUS_AVAILABLE; dialogStatusNew = DIALOG_STATUS_AVAILABLE;
} }

View File

@@ -126,7 +126,7 @@ float TravelNodePath::getCost(Player* bot, uint32 cGold)
if (bot->HasSpell(1066)) if (bot->HasSpell(1066))
swimSpeed *= 1.5; swimSpeed *= 1.5;
uint32 level = bot->getLevel(); uint32 level = bot->GetLevel();
bool isAlliance = Unit::GetFactionReactionTo(bot->GetFactionTemplateEntry(), sFactionTemplateStore.LookupEntry(1)) > REP_NEUTRAL; bool isAlliance = Unit::GetFactionReactionTo(bot->GetFactionTemplateEntry(), sFactionTemplateStore.LookupEntry(1)) > REP_NEUTRAL;
int factionAnnoyance = 0; int factionAnnoyance = 0;

View File

@@ -20,24 +20,26 @@
#include "RandomPlayerbotMgr.h" #include "RandomPlayerbotMgr.h"
#include "ScriptMgr.h" #include "ScriptMgr.h"
using namespace Acore::ChatCommands;
class playerbots_commandscript : public CommandScript class playerbots_commandscript : public CommandScript
{ {
public: public:
playerbots_commandscript() : CommandScript("playerbots_commandscript") { } playerbots_commandscript() : CommandScript("playerbots_commandscript") { }
std::vector<ChatCommand> GetCommands() const override ChatCommandTable GetCommands() const override
{ {
static std::vector<ChatCommand> playerbotsCommandTable = static ChatCommandTable playerbotsCommandTable =
{ {
{ "bot", SEC_PLAYER, false, &HandlePlayerbotCommand, nullptr }, { "bot", HandlePlayerbotCommand, SEC_PLAYER, Console::No },
{ "gtask", SEC_GAMEMASTER, true, &HandleGuildTaskCommand, nullptr }, { "gtask", HandleGuildTaskCommand, SEC_GAMEMASTER, Console::Yes },
{ "pmon", SEC_GAMEMASTER, true, &HandlePerfMonCommand, nullptr }, { "pmon", HandlePerfMonCommand, SEC_GAMEMASTER, Console::Yes },
{ "rndbot", SEC_GAMEMASTER, true, &HandleRandomPlayerbotCommand, nullptr } { "rndbot", HandleRandomPlayerbotCommand, SEC_GAMEMASTER, Console::Yes }
}; };
static std::vector<ChatCommand> commandTable = static ChatCommandTable commandTable =
{ {
{ "playerbots", SEC_PLAYER, true, nullptr, "", playerbotsCommandTable }, { "playerbots", playerbotsCommandTable },
}; };
return commandTable; return commandTable;

View File

@@ -121,7 +121,7 @@ void AutoLearnSpellAction::LearnQuestSpells(std::ostringstream* out)
if (!quest->GetRequiredClasses() || quest->IsRepeatable() || quest->GetMinLevel() < 10) if (!quest->GetRequiredClasses() || quest->IsRepeatable() || quest->GetMinLevel() < 10)
continue; continue;
if (!bot->SatisfyQuestClass(quest, false) || quest->GetMinLevel() > bot->getLevel() || !bot->SatisfyQuestRace(quest, false)) if (!bot->SatisfyQuestClass(quest, false) || quest->GetMinLevel() > bot->GetLevel() || !bot->SatisfyQuestRace(quest, false))
continue; continue;
if (quest->GetRewSpellCast() > 0) if (quest->GetRewSpellCast() > 0)

View File

@@ -32,7 +32,7 @@ bool BGJoinAction::Execute(Event event)
return false; return false;
uint32 mapId = bg->GetMapId(); uint32 mapId = bg->GetMapId();
PvPDifficultyEntry const* pvpDiff = GetBattlegroundBracketByLevel(mapId, bot->getLevel()); PvPDifficultyEntry const* pvpDiff = GetBattlegroundBracketByLevel(mapId, bot->GetLevel());
if (!pvpDiff) if (!pvpDiff)
return false; return false;
@@ -169,7 +169,7 @@ bool BGJoinAction::gatherArenaTeam(ArenaType type)
if (!member) if (!member)
continue; continue;
if (member->getLevel() < 70) if (member->GetLevel() < 70)
continue; continue;
if (!group->AddMember(member)) if (!group->AddMember(member))
@@ -218,7 +218,7 @@ bool BGJoinAction::canJoinBg(BattlegroundQueueTypeId queueTypeId, BattlegroundBr
// check bracket // check bracket
Battleground* bg = sBattlegroundMgr->GetBattlegroundTemplate(bgTypeId); Battleground* bg = sBattlegroundMgr->GetBattlegroundTemplate(bgTypeId);
uint32 mapId = bg->GetMapId(); uint32 mapId = bg->GetMapId();
PvPDifficultyEntry const* pvpDiff = GetBattlegroundBracketByLevel(mapId, bot->getLevel()); PvPDifficultyEntry const* pvpDiff = GetBattlegroundBracketByLevel(mapId, bot->GetLevel());
if (!pvpDiff) if (!pvpDiff)
return false; return false;
@@ -371,7 +371,7 @@ bool BGJoinAction::isUseful()
return false; return false;
// check level // check level
if (bot->getLevel() < 10) if (bot->GetLevel() < 10)
return false; return false;
// do not try if with player master or in combat/group // do not try if with player master or in combat/group
@@ -438,7 +438,7 @@ bool BGJoinAction::JoinQueue(uint32 type)
return false; return false;
uint32 mapId = bg->GetMapId(); uint32 mapId = bg->GetMapId();
PvPDifficultyEntry const* pvpDiff = GetBattlegroundBracketByLevel(mapId, bot->getLevel()); PvPDifficultyEntry const* pvpDiff = GetBattlegroundBracketByLevel(mapId, bot->GetLevel());
if (!pvpDiff) if (!pvpDiff)
return false; return false;
@@ -548,7 +548,7 @@ bool BGJoinAction::JoinQueue(uint32 type)
} }
LOG_INFO("playerbots", "Bot {} {}:{} <{}> queued {} {}", LOG_INFO("playerbots", "Bot {} {}:{} <{}> queued {} {}",
bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->getLevel(), bot->GetName().c_str(), _bgType.c_str(), bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName().c_str(), _bgType.c_str(),
isRated ? "Rated Arena" : isArena ? "Arena" : ""); isRated ? "Rated Arena" : isArena ? "Arena" : "");
@@ -722,7 +722,7 @@ bool BGLeaveAction::Execute(Event event)
if (bot->InBattleground()) if (bot->InBattleground())
{ {
LOG_INFO("playerbots", "Bot {} {}:{} <{}> leaves {}", LOG_INFO("playerbots", "Bot {} {}:{} <{}> leaves {}",
bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->getLevel(), bot->GetName(), isArena ? "Arena" : "BG"); bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName(), isArena ? "Arena" : "BG");
WorldPacket leave(CMSG_LEAVE_BATTLEFIELD); WorldPacket leave(CMSG_LEAVE_BATTLEFIELD);
leave << uint8(0) << uint8(0) << uint32(0) << uint16(0); leave << uint8(0) << uint8(0) << uint32(0) << uint16(0);
@@ -744,7 +744,7 @@ bool BGLeaveAction::Execute(Event event)
return false; return false;
LOG_INFO("playerbots", "Bot {} {}:{} <{}> leaves {} queue", LOG_INFO("playerbots", "Bot {} {}:{} <{}> leaves {} queue",
bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->getLevel(), bot->GetName().c_str(), isArena ? "Arena" : "BG"); bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName().c_str(), isArena ? "Arena" : "BG");
WorldPacket packet(CMSG_BATTLEFIELD_PORT, 20); WorldPacket packet(CMSG_BATTLEFIELD_PORT, 20);
packet << type << unk2 << (uint32)_bgTypeId << unk << uint8(0); packet << type << unk2 << (uint32)_bgTypeId << unk << uint8(0);
@@ -828,7 +828,7 @@ bool BGStatusAction::Execute(Event event)
BattlegroundBracketId bracketId; BattlegroundBracketId bracketId;
Battleground* bg = sBattlegroundMgr->GetBattlegroundTemplate(_bgTypeId); Battleground* bg = sBattlegroundMgr->GetBattlegroundTemplate(_bgTypeId);
mapId = bg->GetMapId(); mapId = bg->GetMapId();
PvPDifficultyEntry const* pvpDiff = GetBattlegroundBracketByLevel(mapId, bot->getLevel()); PvPDifficultyEntry const* pvpDiff = GetBattlegroundBracketByLevel(mapId, bot->GetLevel());
if (pvpDiff) if (pvpDiff)
bracketId = pvpDiff->GetBracketId(); bracketId = pvpDiff->GetBracketId();
@@ -892,7 +892,7 @@ bool BGStatusAction::Execute(Event event)
if (Time1 == TIME_TO_AUTOREMOVE) //Battleground is over, bot needs to leave if (Time1 == TIME_TO_AUTOREMOVE) //Battleground is over, bot needs to leave
{ {
LOG_INFO("playerbots", "Bot {} <{}> ({} {}): Received BG status TIME_REMOVE for {} {}", LOG_INFO("playerbots", "Bot {} <{}> ({} {}): Received BG status TIME_REMOVE for {} {}",
bot->GetGUID().ToString().c_str(), bot->GetName(), bot->getLevel(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", isArena ? "Arena" : "BG", _bgType); bot->GetGUID().ToString().c_str(), bot->GetName(), bot->GetLevel(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", isArena ? "Arena" : "BG", _bgType);
if (Battleground* bg = bot->GetBattleground()) if (Battleground* bg = bot->GetBattleground())
{ {
@@ -924,7 +924,7 @@ bool BGStatusAction::Execute(Event event)
botAI->ChangeStrategy("-arena", BOT_STATE_NON_COMBAT); botAI->ChangeStrategy("-arena", BOT_STATE_NON_COMBAT);
LOG_INFO("playerbots", "Bot {} {}:{} <{}> leaves {} - {}", LOG_INFO("playerbots", "Bot {} {}:{} <{}> leaves {} - {}",
bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->getLevel(), bot->GetName(), isArena ? "Arena" : "BG", _bgType); bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName(), isArena ? "Arena" : "BG", _bgType);
WorldPacket packet(CMSG_LEAVE_BATTLEFIELD); WorldPacket packet(CMSG_LEAVE_BATTLEFIELD);
packet << uint8(0); packet << uint8(0);
@@ -947,7 +947,7 @@ bool BGStatusAction::Execute(Event event)
if (statusid == STATUS_WAIT_QUEUE) // bot is in queue if (statusid == STATUS_WAIT_QUEUE) // bot is in queue
{ {
LOG_INFO("playerbots", "Bot {} {}:{} <{}>: Received BG status WAIT_QUEUE (wait time: {}) for {} {}", LOG_INFO("playerbots", "Bot {} {}:{} <{}>: Received BG status WAIT_QUEUE (wait time: {}) for {} {}",
bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->getLevel(), bot->GetName(), Time2, isArena ? "Arena" : "BG", _bgType); bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName(), Time2, isArena ? "Arena" : "BG", _bgType);
// temp fix for crash // temp fix for crash
//return true; //return true;
@@ -967,7 +967,7 @@ bool BGStatusAction::Execute(Event event)
} }
LOG_INFO("playerbots", "Bot {} {}:{} <{}>: Force join {} {}", LOG_INFO("playerbots", "Bot {} {}:{} <{}>: Force join {} {}",
bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->getLevel(), bot->GetName(), isArena ? "Arena" : "BG", _bgType); bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName(), isArena ? "Arena" : "BG", _bgType);
WorldPacket emptyPacket; WorldPacket emptyPacket;
bot->GetSession()->HandleCancelMountAuraOpcode(emptyPacket); bot->GetSession()->HandleCancelMountAuraOpcode(emptyPacket);
action = 0x1; action = 0x1;
@@ -1017,7 +1017,7 @@ bool BGStatusAction::Execute(Event event)
return false; return false;
LOG_INFO("playerbots", "Bot {} {}:{} <{}> waited too long and leaves queue ({} {}).", LOG_INFO("playerbots", "Bot {} {}:{} <{}> waited too long and leaves queue ({} {}).",
bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->getLevel(), bot->GetName(), isArena ? "Arena" : "BG", _bgType); bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName(), isArena ? "Arena" : "BG", _bgType);
WorldPacket packet(CMSG_BATTLEFIELD_PORT, 20); WorldPacket packet(CMSG_BATTLEFIELD_PORT, 20);
action = 0; action = 0;
@@ -1037,14 +1037,14 @@ bool BGStatusAction::Execute(Event event)
if (statusid == STATUS_IN_PROGRESS) // placeholder for Leave BG if it takes too long if (statusid == STATUS_IN_PROGRESS) // placeholder for Leave BG if it takes too long
{ {
LOG_INFO("playerbots", "Bot {} {}:{} <{}>: Received BG status IN_PROGRESS for {} {}", LOG_INFO("playerbots", "Bot {} {}:{} <{}>: Received BG status IN_PROGRESS for {} {}",
bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->getLevel(), bot->GetName(), isArena ? "Arena" : "BG", _bgType); bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName(), isArena ? "Arena" : "BG", _bgType);
return false; return false;
} }
if (statusid == STATUS_WAIT_JOIN) //bot may join if (statusid == STATUS_WAIT_JOIN) //bot may join
{ {
LOG_INFO("playerbots", "Bot {} {}:{} <{}>: Received BG status WAIT_JOIN for {} {}", LOG_INFO("playerbots", "Bot {} {}:{} <{}>: Received BG status WAIT_JOIN for {} {}",
bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->getLevel(), bot->GetName(), isArena ? "Arena" : "BG", _bgType); bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName(), isArena ? "Arena" : "BG", _bgType);
if (isArena) if (isArena)
{ {
@@ -1055,7 +1055,7 @@ bool BGStatusAction::Execute(Event event)
if (!bgQueue.GetPlayerGroupInfoData(bot->GetGUID(), &ginfo)) if (!bgQueue.GetPlayerGroupInfoData(bot->GetGUID(), &ginfo))
{ {
LOG_ERROR("playerbots", "Bot {} {}:{} <{}>: Missing QueueInfo for {} {}", LOG_ERROR("playerbots", "Bot {} {}:{} <{}>: Missing QueueInfo for {} {}",
bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->getLevel(), bot->GetName(), isArena ? "Arena" : "BG", _bgType); bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName(), isArena ? "Arena" : "BG", _bgType);
return false; return false;
} }
@@ -1066,7 +1066,7 @@ bool BGStatusAction::Execute(Event event)
if (!bg) if (!bg)
{ {
LOG_ERROR("playerbots", "Bot {} {}:{} <{}>: Missing QueueInfo for {} {}", LOG_ERROR("playerbots", "Bot {} {}:{} <{}>: Missing QueueInfo for {} {}",
bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->getLevel(), bot->GetName(), isArena ? "Arena" : "BG", _bgType); bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName(), isArena ? "Arena" : "BG", _bgType);
return false; return false;
} }
@@ -1075,7 +1075,7 @@ bool BGStatusAction::Execute(Event event)
} }
LOG_INFO("playerbots", "Bot {} {}:{} <{}> joined {} - {}", LOG_INFO("playerbots", "Bot {} {}:{} <{}> joined {} - {}",
bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->getLevel(), bot->GetName(), isArena ? "Arena" : "BG", _bgType); bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName(), isArena ? "Arena" : "BG", _bgType);
WorldPacket emptyPacket; WorldPacket emptyPacket;
bot->GetSession()->HandleCancelMountAuraOpcode(emptyPacket); bot->GetSession()->HandleCancelMountAuraOpcode(emptyPacket);
@@ -1118,7 +1118,7 @@ bool BGStatusCheckAction::Execute(Event event)
bot->GetSession()->HandleBattlefieldStatusOpcode(packet); bot->GetSession()->HandleBattlefieldStatusOpcode(packet);
LOG_INFO("playerbots", "Bot {} <{}> ({} {}) : Checking BG invite status", LOG_INFO("playerbots", "Bot {} <{}> ({} {}) : Checking BG invite status",
bot->GetGUID().ToString().c_str(), bot->GetName(), bot->getLevel(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H"); bot->GetGUID().ToString().c_str(), bot->GetName(), bot->GetLevel(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H");
return true; return true;
} }

View File

@@ -3545,7 +3545,7 @@ bool BGTactics::selectObjective(bool reset)
{ {
// Capture front objectives before attacking back objectives // Capture front objectives before attacking back objectives
// LOG_INFO("playerbots", "Bot {} {}:{} <{}>: Get Front Objectives", // LOG_INFO("playerbots", "Bot {} {}:{} <{}>: Get Front Objectives",
// bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->getLevel(), bot->GetName()); // bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName());
if (role < 6) if (role < 6)
{ {
BgObjective = bg->GetBGObject(attackObjectivesFront[0]); BgObjective = bg->GetBGObject(attackObjectivesFront[0]);
@@ -3559,7 +3559,7 @@ bool BGTactics::selectObjective(bool reset)
{ {
// Now capture all objectives with priority on back // Now capture all objectives with priority on back
// LOG_INFO("playerbots", "Bot {} {}:{} <{}>: Get All Objectives", // LOG_INFO("playerbots", "Bot {} {}:{} <{}>: Get All Objectives",
// bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->getLevel(), bot->GetName()); // bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName());
if (role < 4) if (role < 4)
{ {
BgObjective = bg->GetBGObject(attackObjectivesFront[0]); BgObjective = bg->GetBGObject(attackObjectivesFront[0]);
@@ -3632,7 +3632,7 @@ bool BGTactics::selectObjective(bool reset)
{ {
//Retreat with flag //Retreat with flag
//LOG_INFO("playerbots", "Bot {} {}:{} <{}>: Retreat with flag", //LOG_INFO("playerbots", "Bot {} {}:{} <{}>: Retreat with flag",
//bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->getLevel(), bot->GetName()); //bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName());
if (rootTeam == TEAM_HORDE) if (rootTeam == TEAM_HORDE)
{ {
areaTrigger = 0; areaTrigger = 0;
@@ -3648,7 +3648,7 @@ bool BGTactics::selectObjective(bool reset)
{ {
//Deliver flag //Deliver flag
//LOG_INFO("playerbots", "Bot {} {}:{} <{}>: Deliver flag", //LOG_INFO("playerbots", "Bot {} {}:{} <{}>: Deliver flag",
//bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->getLevel(), bot->GetName()); //bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName());
if (eyeOfTheStormBG->GetCapturePointInfo(EY_AttackObjectives[0])._ownerTeamId == rootTeamIndex) if (eyeOfTheStormBG->GetCapturePointInfo(EY_AttackObjectives[0])._ownerTeamId == rootTeamIndex)
{ {
areaTrigger = AT_FEL_REAVER_POINT; areaTrigger = AT_FEL_REAVER_POINT;

View File

@@ -155,7 +155,7 @@ std::string ChangeTalentsAction::SpecApply(std::string param)
// // for (auto& path : sPlayerbotAIConfig->classSpecs[bot->getClass()].talentPath) // // for (auto& path : sPlayerbotAIConfig->classSpecs[bot->getClass()].talentPath)
// // { // // {
// // TalentSpec newSpec = *GetBestPremadeSpec(path.id); // // TalentSpec newSpec = *GetBestPremadeSpec(path.id);
// // newSpec.CropTalents(bot->getLevel()); // // newSpec.CropTalents(bot->GetLevel());
// // if (oldSpec->isEarlierVersionOf(newSpec)) // // if (oldSpec->isEarlierVersionOf(newSpec))
// // { // // {
// // ret.push_back(&path); // // ret.push_back(&path);
@@ -225,7 +225,7 @@ std::string ChangeTalentsAction::SpecApply(std::string param)
// bool ChangeTalentsAction::AutoSelectTalents(std::ostringstream* out) // bool ChangeTalentsAction::AutoSelectTalents(std::ostringstream* out)
// { // {
// // Does the bot have talentpoints? // // Does the bot have talentpoints?
// if (bot->getLevel() < 10) // if (bot->GetLevel() < 10)
// { // {
// *out << "No free talent points."; // *out << "No free talent points.";
// return false; // return false;
@@ -239,7 +239,7 @@ std::string ChangeTalentsAction::SpecApply(std::string param)
// if (specNo > 0) // if (specNo > 0)
// { // {
// TalentSpec newSpec = *GetBestPremadeSpec(specId); // TalentSpec newSpec = *GetBestPremadeSpec(specId);
// newSpec.CropTalents(bot->getLevel()); // newSpec.CropTalents(bot->GetLevel());
// newSpec.ApplyTalents(bot, out); // newSpec.ApplyTalents(bot, out);
// if (newSpec.GetTalentPoints() > 0) // if (newSpec.GetTalentPoints() > 0)
// { // {
@@ -249,7 +249,7 @@ std::string ChangeTalentsAction::SpecApply(std::string param)
// else if (!specLink.empty()) // else if (!specLink.empty())
// { // {
// TalentSpec newSpec(bot, specLink); // TalentSpec newSpec(bot, specLink);
// newSpec.CropTalents(bot->getLevel()); // newSpec.CropTalents(bot->GetLevel());
// newSpec.ApplyTalents(bot, out); // newSpec.ApplyTalents(bot, out);
// if (newSpec.GetTalentPoints() > 0) // if (newSpec.GetTalentPoints() > 0)
// { // {
@@ -288,7 +288,7 @@ std::string ChangeTalentsAction::SpecApply(std::string param)
// specId = PickPremadePath(paths, sRandomPlayerbotMgr->IsRandomBot(bot))->id; // specId = PickPremadePath(paths, sRandomPlayerbotMgr->IsRandomBot(bot))->id;
// TalentSpec newSpec = *GetBestPremadeSpec(specId); // TalentSpec newSpec = *GetBestPremadeSpec(specId);
// specLink = newSpec.GetTalentLink(); // specLink = newSpec.GetTalentLink();
// newSpec.CropTalents(bot->getLevel()); // newSpec.CropTalents(bot->GetLevel());
// newSpec.ApplyTalents(bot, out); // newSpec.ApplyTalents(bot, out);
// if (paths.size() > 1) // if (paths.size() > 1)

View File

@@ -132,7 +132,7 @@ bool CheckMountStateAction::isUseful()
if (!GET_PLAYERBOT_AI(bot)->HasStrategy("mount", BOT_STATE_NON_COMBAT) && !bot->IsMounted()) if (!GET_PLAYERBOT_AI(bot)->HasStrategy("mount", BOT_STATE_NON_COMBAT) && !bot->IsMounted())
return false; return false;
bool firstmount = bot->getLevel() >= 20; bool firstmount = bot->GetLevel() >= 20;
if (!firstmount) if (!firstmount)
return false; return false;
@@ -197,7 +197,7 @@ bool CheckMountStateAction::Mount()
} }
} }
if (bot->GetPureSkillValue(SKILL_RIDING) <= 75 && bot->getLevel() < secondmount) if (bot->GetPureSkillValue(SKILL_RIDING) <= 75 && bot->GetLevel() < secondmount)
masterSpeed = 59; masterSpeed = 59;
if (bot->InBattleground() && masterSpeed > 99) if (bot->InBattleground() && masterSpeed > 99)

View File

@@ -789,7 +789,7 @@ bool ChooseTravelTargetAction::needForQuest(Unit* target)
{ {
QuestStatusData questStatus = quest.second; QuestStatusData questStatus = quest.second;
if (questTemplate->GetQuestLevel() > bot->getLevel()) if (questTemplate->GetQuestLevel() > bot->GetLevel())
continue; continue;
for (int j = 0; j < QUEST_OBJECTIVES_COUNT; j++) for (int j = 0; j < QUEST_OBJECTIVES_COUNT; j++)

View File

@@ -111,9 +111,9 @@ void CleanQuestLogAction::DropQuestType(uint8& numQuest, uint8 wantNum, bool isG
numQuest++; numQuest++;
int32 lowLevelDiff = sWorld->getIntConfig(CONFIG_QUEST_LOW_LEVEL_HIDE_DIFF); int32 lowLevelDiff = sWorld->getIntConfig(CONFIG_QUEST_LOW_LEVEL_HIDE_DIFF);
if (lowLevelDiff < 0 || bot->getLevel() <= bot->GetQuestLevel(quest) + uint32(lowLevelDiff)) // Quest is not gray if (lowLevelDiff < 0 || bot->GetLevel() <= bot->GetQuestLevel(quest) + uint32(lowLevelDiff)) // Quest is not gray
{ {
if (bot->getLevel() + 5 > bot->GetQuestLevel(quest)) // Quest is not red if (bot->GetLevel() + 5 > bot->GetQuestLevel(quest)) // Quest is not red
if (!isGreen) if (!isGreen)
continue; continue;
} }

View File

@@ -672,7 +672,7 @@ bool EmoteAction::Execute(Event event)
(namlen > 1 && strstri(bot->GetName().c_str(), nam.c_str())))) (namlen > 1 && strstri(bot->GetName().c_str(), nam.c_str()))))
{ {
LOG_INFO("playerbots", "Bot {} {}:{} <{}> received SMSG_TEXT_EMOTE {} from player {} <{}>", LOG_INFO("playerbots", "Bot {} {}:{} <{}> received SMSG_TEXT_EMOTE {} from player {} <{}>",
bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->getLevel(), bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(),
bot->GetName(), text_emote, pSource->GetGUID().ToString().c_str(), pSource->GetName()); bot->GetName(), text_emote, pSource->GetGUID().ToString().c_str(), pSource->GetName());
emote = text_emote; emote = text_emote;
@@ -694,7 +694,7 @@ bool EmoteAction::Execute(Event event)
(urand(0, 1) && bot->HasInArc(static_cast<float>(M_PI), pSource, 10.0f)))) (urand(0, 1) && bot->HasInArc(static_cast<float>(M_PI), pSource, 10.0f))))
{ {
LOG_INFO("playerbots", "Bot {} {}:{} <{}> received SMSG_EMOTE {} from player {} <{}>", LOG_INFO("playerbots", "Bot {} {}:{} <{}> received SMSG_EMOTE {} from player {} <{}>",
bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->getLevel(), bot->GetName(), bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName(),
emoteId, pSource->GetGUID().ToString().c_str(), pSource->GetName()); emoteId, pSource->GetGUID().ToString().c_str(), pSource->GetName());
std::vector<uint32> types; std::vector<uint32> types;

View File

@@ -31,15 +31,15 @@ bool HireAction::Execute(Event event)
return false; return false;
} }
if (bot->getLevel() > master->getLevel()) if (bot->GetLevel() > master->GetLevel())
{ {
botAI->TellMaster("You cannot hire higher level characters than you"); botAI->TellMaster("You cannot hire higher level characters than you");
return false; return false;
} }
uint32 discount = sRandomPlayerbotMgr->GetTradeDiscount(bot, master); uint32 discount = sRandomPlayerbotMgr->GetTradeDiscount(bot, master);
uint32 m = 1 + (bot->getLevel() / 10); uint32 m = 1 + (bot->GetLevel() / 10);
uint32 moneyReq = m * 5000 * bot->getLevel(); uint32 moneyReq = m * 5000 * bot->GetLevel();
if (discount < moneyReq) if (discount < moneyReq)
{ {
std::ostringstream out; std::ostringstream out;

View File

@@ -60,7 +60,7 @@ bool InviteNearbyToGroupAction::Execute(Event event)
return false; return false;
} }
if (abs(int32(player->getLevel() - bot->getLevel())) > 2) if (abs(int32(player->GetLevel() - bot->GetLevel())) > 2)
continue; continue;
if (sServerFacade->GetDistance2d(bot, player) > sPlayerbotAIConfig->sightDistance) if (sServerFacade->GetDistance2d(bot, player) > sPlayerbotAIConfig->sightDistance)
@@ -135,7 +135,7 @@ bool InviteGuildToGroupAction::Execute(Event event)
if (botAI->HasActivePlayerMaster()) //Do not invite alts of active players. if (botAI->HasActivePlayerMaster()) //Do not invite alts of active players.
continue; continue;
if (player->getLevel() > bot->getLevel() + 5) // Only invite higher levels that need money so they can grind money and help out. if (player->GetLevel() > bot->GetLevel() + 5) // Only invite higher levels that need money so they can grind money and help out.
{ {
AiObjectContext* botContext = botAI->GetAiObjectContext(); AiObjectContext* botContext = botAI->GetAiObjectContext();
@@ -149,7 +149,7 @@ bool InviteGuildToGroupAction::Execute(Event event)
return false; return false;
} }
if (abs(int32(player->getLevel() - bot->getLevel())) > 4) if (abs(int32(player->GetLevel() - bot->GetLevel())) > 4)
continue; continue;
if (!botAI && sServerFacade->GetDistance2d(bot, player) > sPlayerbotAIConfig->sightDistance) if (!botAI && sServerFacade->GetDistance2d(bot, player) > sPlayerbotAIConfig->sightDistance)

View File

@@ -144,14 +144,14 @@ bool LeaveFarAwayAction::isUseful()
if (bot->GetGuildId() == master->GetGuildId()) if (bot->GetGuildId() == master->GetGuildId())
{ {
if (bot->getLevel() > master->getLevel() + 5) if (bot->GetLevel() > master->GetLevel() + 5)
{ {
if (AI_VALUE(bool, "should get money")) if (AI_VALUE(bool, "should get money"))
return false; return false;
} }
} }
if (abs(int32(master->getLevel() - bot->getLevel())) > 4) if (abs(int32(master->GetLevel() - bot->GetLevel())) > 4)
return true; return true;
if (bot->GetMapId() != master->GetMapId() || bot->GetDistance2d(master) >= 2 * sPlayerbotAIConfig->rpgDistance) { if (bot->GetMapId() != master->GetMapId() || bot->GetDistance2d(master) >= 2 * sPlayerbotAIConfig->rpgDistance) {

View File

@@ -87,8 +87,8 @@ bool LfgJoinAction::JoinLFG()
ItemCountByQuality visitor; ItemCountByQuality visitor;
IterateItems(&visitor, ITERATE_ITEMS_IN_EQUIP); IterateItems(&visitor, ITERATE_ITEMS_IN_EQUIP);
bool random = urand(0, 100) < 20; bool random = urand(0, 100) < 20;
bool heroic = urand(0, 100) < 50 && (visitor.count[ITEM_QUALITY_EPIC] >= 3 || visitor.count[ITEM_QUALITY_RARE] >= 10) && bot->getLevel() >= 70; bool heroic = urand(0, 100) < 50 && (visitor.count[ITEM_QUALITY_EPIC] >= 3 || visitor.count[ITEM_QUALITY_RARE] >= 10) && bot->GetLevel() >= 70;
bool rbotAId = !heroic && (urand(0, 100) < 50 && visitor.count[ITEM_QUALITY_EPIC] >= 5 && (bot->getLevel() == 60 || bot->getLevel() == 70 || bot->getLevel() == 80)); bool rbotAId = !heroic && (urand(0, 100) < 50 && visitor.count[ITEM_QUALITY_EPIC] >= 5 && (bot->GetLevel() == 60 || bot->GetLevel() == 70 || bot->GetLevel() == 80));
LfgDungeonSet list; LfgDungeonSet list;
std::vector<uint32> selected; std::vector<uint32> selected;
@@ -103,7 +103,7 @@ bool LfgJoinAction::JoinLFG()
if (!dungeon || (dungeon->TypeID != LFG_TYPE_RANDOM && dungeon->TypeID != LFG_TYPE_DUNGEON && dungeon->TypeID != LFG_TYPE_HEROIC && dungeon->TypeID != LFG_TYPE_RAID)) if (!dungeon || (dungeon->TypeID != LFG_TYPE_RANDOM && dungeon->TypeID != LFG_TYPE_DUNGEON && dungeon->TypeID != LFG_TYPE_HEROIC && dungeon->TypeID != LFG_TYPE_RAID))
continue; continue;
uint32 botLevel = bot->getLevel(); uint32 botLevel = bot->GetLevel();
if (dungeon->MinLevel && botLevel < dungeon->MinLevel) if (dungeon->MinLevel && botLevel < dungeon->MinLevel)
continue; continue;
@@ -133,7 +133,7 @@ bool LfgJoinAction::JoinLFG()
dungeon->type != LFG_TYPE_RAID)) dungeon->type != LFG_TYPE_RAID))
continue; continue;
uint32 botLevel = bot->getLevel(); uint32 botLevel = bot->GetLevel();
if (dungeon->MinLevel && botLevel < dungeon->MinLevel) if (dungeon->MinLevel && botLevel < dungeon->MinLevel)
continue; continue;
@@ -173,7 +173,7 @@ bool LfgJoinAction::JoinLFG()
LOG_INFO("playerbots", "Bot {} {}:{} <{}>: queues LFG, Dungeon as {} ({})", LOG_INFO("playerbots", "Bot {} {}:{} <{}>: queues LFG, Dungeon as {} ({})",
bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H",
bot->getLevel(), bot->GetName().c_str(), _roles, many ? "several dungeons" : dungeon->Name[0]); bot->GetLevel(), bot->GetName().c_str(), _roles, many ? "several dungeons" : dungeon->Name[0]);
/*if (lfgState->IsSingleRole()) /*if (lfgState->IsSingleRole())
{ {
@@ -213,7 +213,7 @@ bool LfgJoinAction::JoinLFG()
pState->SetType(LFG_TYPE_RANDOM_DUNGEON); pState->SetType(LFG_TYPE_RANDOM_DUNGEON);
LOG_INFO("playerbots", "Bot {} {}:{} <{}>: queues LFG, Random Dungeon as {} ({})", LOG_INFO("playerbots", "Bot {} {}:{} <{}>: queues LFG, Random Dungeon as {} ({})",
bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->getLevel(), bot->GetName().c_str(), _roles, dungeon->Name[0]); bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName().c_str(), _roles, dungeon->Name[0]);
return true; return true;
} }
else if (heroic) else if (heroic)
@@ -221,19 +221,19 @@ bool LfgJoinAction::JoinLFG()
pState->SetType(LFG_TYPE_HEROIC_DUNGEON); pState->SetType(LFG_TYPE_HEROIC_DUNGEON);
LOG_INFO("playerbots", "Bot {} {}:{} <{}>: queues LFG, Heroic Dungeon as {} ({})", LOG_INFO("playerbots", "Bot {} {}:{} <{}>: queues LFG, Heroic Dungeon as {} ({})",
bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H",
bot->getLevel(), bot->GetName().c_str(), _roles, many ? "several dungeons" : dungeon->Name[0]); bot->GetLevel(), bot->GetName().c_str(), _roles, many ? "several dungeons" : dungeon->Name[0]);
} }
else if (rbotAId) else if (rbotAId)
{ {
pState->SetType(LFG_TYPE_RAID); pState->SetType(LFG_TYPE_RAID);
LOG_INFO("playerbots", "Bot {} {}:{} <{}>: queues LFG, RbotAId as {} ({})", LOG_INFO("playerbots", "Bot {} {}:{} <{}>: queues LFG, RbotAId as {} ({})",
bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->getLevel(), bot->GetName().c_str(), _roles, many ? "several dungeons" : dungeon->Name[0]); bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName().c_str(), _roles, many ? "several dungeons" : dungeon->Name[0]);
} }
else else
{ {
pState->SetType(LFG_TYPE_DUNGEON); pState->SetType(LFG_TYPE_DUNGEON);
LOG_INFO("playerbots", "Bot {} {}:{} <{}>: queues LFG, Dungeon as {} ({})", LOG_INFO("playerbots", "Bot {} {}:{} <{}>: queues LFG, Dungeon as {} ({})",
bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->getLevel(), bot->GetName().c_str(), _roles, many ? "several dungeons" : dungeon->Name[0]); bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName().c_str(), _roles, many ? "several dungeons" : dungeon->Name[0]);
}*/ }*/
// Set RbotAId Browser comment // Set RbotAId Browser comment
@@ -258,7 +258,7 @@ bool LfgRoleCheckAction::Execute(Event event)
sLFGMgr->UpdateRoleCheck(group->GetGUID(), bot->GetGUID(), newRoles); sLFGMgr->UpdateRoleCheck(group->GetGUID(), bot->GetGUID(), newRoles);
LOG_INFO("playerbots", "Bot {} {}:{} <{}>: LFG roles checked", LOG_INFO("playerbots", "Bot {} {}:{} <{}>: LFG roles checked",
bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->getLevel(), bot->GetName().c_str()); bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName().c_str());
return true; return true;
} }
@@ -281,13 +281,13 @@ bool LfgAcceptAction::Execute(Event event)
if (bot->IsInCombat() || bot->isDead()) if (bot->IsInCombat() || bot->isDead())
{ {
LOG_INFO("playerbots", "Bot {} {}:{} <{}> is in combat and refuses LFG proposal {}", LOG_INFO("playerbots", "Bot {} {}:{} <{}> is in combat and refuses LFG proposal {}",
bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->getLevel(), bot->GetName().c_str(), id); bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName().c_str(), id);
sLFGMgr->UpdateProposal(id, bot->GetGUID(), false); sLFGMgr->UpdateProposal(id, bot->GetGUID(), false);
return true; return true;
} }
LOG_INFO("playerbots", "Bot {} {}:{} <{}> accepts LFG proposal {}", LOG_INFO("playerbots", "Bot {} {}:{} <{}> accepts LFG proposal {}",
bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->getLevel(), bot->GetName().c_str(), id); bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName().c_str(), id);
botAI->GetAiObjectContext()->GetValue<uint32>("lfg proposal")->Set(0); botAI->GetAiObjectContext()->GetValue<uint32>("lfg proposal")->Set(0);
@@ -363,7 +363,7 @@ bool LfgJoinAction::isUseful()
return false; return false;
} }
if (bot->getLevel() < 15) if (bot->GetLevel() < 15)
return false; return false;
if ((botAI->GetMaster() && !GET_PLAYERBOT_AI(botAI->GetMaster())) || bot->GetGroup() && bot->GetGroup()->GetLeaderGUID() != bot->GetGUID()) if ((botAI->GetMaster() && !GET_PLAYERBOT_AI(botAI->GetMaster())) || bot->GetGroup() && bot->GetGroup()->GetLeaderGUID() != bot->GetGUID())

View File

@@ -402,7 +402,7 @@ bool MovementAction::MoveTo(uint32 mapId, float x, float y, float z, bool idle,
// out << std::to_string(bot->getRace()) << ","; // out << std::to_string(bot->getRace()) << ",";
// out << std::to_string(bot->getClass()) << ","; // out << std::to_string(bot->getClass()) << ",";
// out << bot->getLevel() << ","; // out << bot->GetLevel() << ",";
// out << (entry ? -1 : entry); // out << (entry ? -1 : entry);
// sPlayerbotAIConfig->log("bot_movement.csv", out.str().c_str()); // sPlayerbotAIConfig->log("bot_movement.csv", out.str().c_str());
@@ -559,7 +559,7 @@ bool MovementAction::MoveTo(uint32 mapId, float x, float y, float z, bool idle,
// startPosition.printWKT({ startPosition, movePosition }, out, 1); // startPosition.printWKT({ startPosition, movePosition }, out, 1);
// out << std::to_string(bot->getRace()) << ","; // out << std::to_string(bot->getRace()) << ",";
// out << std::to_string(bot->getClass()) << ","; // out << std::to_string(bot->getClass()) << ",";
// out << bot->getLevel(); // out << bot->GetLevel();
// out << 0; // out << 0;
// sPlayerbotAIConfig->log("bot_movement.csv", out.str().c_str()); // sPlayerbotAIConfig->log("bot_movement.csv", out.str().c_str());

View File

@@ -39,7 +39,7 @@ bool ReleaseSpiritAction::Execute(Event event)
context->GetValue<uint32>("death count")->Set(dCount + 1); context->GetValue<uint32>("death count")->Set(dCount + 1);
} }
LOG_INFO("playerbots", "Bot {} {}:{} <{}> released", bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->getLevel(), bot->GetName().c_str()); LOG_INFO("playerbots", "Bot {} {}:{} <{}> released", bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName().c_str());
WorldPacket packet(CMSG_REPOP_REQUEST); WorldPacket packet(CMSG_REPOP_REQUEST);
packet << uint8(0); packet << uint8(0);
@@ -86,13 +86,13 @@ bool AutoReleaseSpiritAction::Execute(Event event)
context->GetValue<uint32>("death count")->Set(dCount + 1); context->GetValue<uint32>("death count")->Set(dCount + 1);
} }
LOG_DEBUG("playerbots", "Bot {} {}:{} <{}> auto released", bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->getLevel(), bot->GetName().c_str()); LOG_DEBUG("playerbots", "Bot {} {}:{} <{}> auto released", bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName().c_str());
WorldPacket packet(CMSG_REPOP_REQUEST); WorldPacket packet(CMSG_REPOP_REQUEST);
packet << uint8(0); packet << uint8(0);
bot->GetSession()->HandleRepopRequestOpcode(packet); bot->GetSession()->HandleRepopRequestOpcode(packet);
LOG_DEBUG("playerbots", "Bot {} {}:{} <{}> releases spirit", bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->getLevel(), bot->GetName().c_str()); LOG_DEBUG("playerbots", "Bot {} {}:{} <{}> releases spirit", bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName().c_str());
if (bot->InBattleground() && (time(NULL) - bg_gossip_time >= 15 || !bot->HasAura(SPELL_WAITING_FOR_RESURRECT))) if (bot->InBattleground() && (time(NULL) - bg_gossip_time >= 15 || !bot->HasAura(SPELL_WAITING_FOR_RESURRECT)))
{ {
@@ -164,7 +164,7 @@ bool AutoReleaseSpiritAction::isUseful()
bool RepopAction::Execute(Event event) bool RepopAction::Execute(Event event)
{ {
LOG_DEBUG("playerbots", "Bot {} {}:{} <{}> repops at graveyard", bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->getLevel(), bot->GetName().c_str()); LOG_DEBUG("playerbots", "Bot {} {}:{} <{}> repops at graveyard", bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName().c_str());
int64 deadTime; int64 deadTime;

View File

@@ -55,7 +55,7 @@ bool ReviveFromCorpseAction::Execute(Event event)
} }
} }
LOG_DEBUG("playerbots", "Bot {} {}:{} <{}> revives at body", bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->getLevel(), bot->GetName().c_str()); LOG_DEBUG("playerbots", "Bot {} {}:{} <{}> revives at body", bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName().c_str());
bot->GetMotionMaster()->Clear(); bot->GetMotionMaster()->Clear();
bot->StopMoving(); bot->StopMoving();
@@ -91,7 +91,7 @@ bool FindCorpseAction::Execute(Event event)
if (dCount >= 5) if (dCount >= 5)
{ {
// LOG_INFO("playerbots", "Bot {} {}:{} <{}>: died too many times, was revived and teleported", // LOG_INFO("playerbots", "Bot {} {}:{} <{}>: died too many times, was revived and teleported",
// bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->getLevel(), bot->GetName().c_str()); // bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName().c_str());
context->GetValue<uint32>("death count")->Set(0); context->GetValue<uint32>("death count")->Set(0);
// sRandomPlayerbotMgr->RandomTeleportForLevel(bot); // sRandomPlayerbotMgr->RandomTeleportForLevel(bot);
sRandomPlayerbotMgr->Revive(bot); sRandomPlayerbotMgr->Revive(bot);
@@ -301,7 +301,7 @@ bool SpiritHealerAction::Execute(Event event)
if (unit && unit->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPIRITHEALER)) if (unit && unit->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPIRITHEALER))
{ {
LOG_DEBUG("playerbots", "Bot {} {}:{} <{}> revives at spirit healer", LOG_DEBUG("playerbots", "Bot {} {}:{} <{}> revives at spirit healer",
bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->getLevel(), bot->GetName()); bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName());
PlayerbotChatHandler ch(bot); PlayerbotChatHandler ch(bot);
bot->ResurrectPlayer(0.5f); bot->ResurrectPlayer(0.5f);
bot->SpawnCorpseBones(); bot->SpawnCorpseBones();
@@ -340,7 +340,7 @@ bool SpiritHealerAction::Execute(Event event)
} }
LOG_INFO("playerbots", "Bot {} {}:{} <{}> can't find a spirit healer", LOG_INFO("playerbots", "Bot {} {}:{} <{}> can't find a spirit healer",
bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->getLevel(), bot->GetName().c_str()); bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName().c_str());
botAI->TellError("Cannot find any spirit healer nearby"); botAI->TellError("Cannot find any spirit healer nearby");
return false; return false;

View File

@@ -88,7 +88,7 @@ void SuggestWhatToDoAction::instance()
std::vector<std::string> allowedInstances; std::vector<std::string> allowedInstances;
for (auto & instance : instances) for (auto & instance : instances)
{ {
if (bot->getLevel() >= instance.second) allowedInstances.push_back(instance.first); if (bot->GetLevel() >= instance.second) allowedInstances.push_back(instance.first);
} }
if (allowedInstances.empty()) return; if (allowedInstances.empty()) return;
@@ -187,7 +187,7 @@ void SuggestWhatToDoAction::grindReputation()
std::vector<std::string> allowedFactions; std::vector<std::string> allowedFactions;
for (std::map<std::string, uint8>::iterator i = factions.begin(); i != factions.end(); ++i) for (std::map<std::string, uint8>::iterator i = factions.begin(); i != factions.end(); ++i)
{ {
if (bot->getLevel() >= i->second) if (bot->GetLevel() >= i->second)
allowedFactions.push_back(i->first); allowedFactions.push_back(i->first);
} }

View File

@@ -168,7 +168,7 @@ bool MaintenanceAction::Execute(Event event)
factory.InitSkills(); factory.InitSkills();
factory.InitMounts(); factory.InitMounts();
factory.InitGlyphs(true); factory.InitGlyphs(true);
if (bot->getLevel() >= sPlayerbotAIConfig->minEnchantingBotLevel) { if (bot->GetLevel() >= sPlayerbotAIConfig->minEnchantingBotLevel) {
factory.ApplyEnchantAndGemsNew(); factory.ApplyEnchantAndGemsNew();
} }
bot->DurabilityRepairAll(false, 1.0f, false); bot->DurabilityRepairAll(false, 1.0f, false);
@@ -199,7 +199,7 @@ bool AutoGearAction::Execute(Event event)
gs); gs);
factory.InitEquipment(true); factory.InitEquipment(true);
factory.InitAmmo(); factory.InitAmmo();
if (bot->getLevel() >= sPlayerbotAIConfig->minEnchantingBotLevel) { if (bot->GetLevel() >= sPlayerbotAIConfig->minEnchantingBotLevel) {
factory.ApplyEnchantAndGemsNew(); factory.ApplyEnchantAndGemsNew();
} }
bot->DurabilityRepairAll(false, 1.0f, false); bot->DurabilityRepairAll(false, 1.0f, false);

View File

@@ -63,7 +63,7 @@ bool MoveToDarkPortalAction::Execute(Event event)
if (bot->GetGroup()->GetLeaderGUID() != bot->GetGUID() && !GET_PLAYERBOT_AI(GET_PLAYERBOT_AI(bot)->GetGroupMaster())) if (bot->GetGroup()->GetLeaderGUID() != bot->GetGUID() && !GET_PLAYERBOT_AI(GET_PLAYERBOT_AI(bot)->GetGroupMaster()))
return false; return false;
if (bot->getLevel() > 57) if (bot->GetLevel() > 57)
{ {
if ((bot->GetTeamId() == TEAM_ALLIANCE && bot->GetQuestStatus(10119) == QUEST_STATUS_NONE) || (bot->GetTeamId() == TEAM_HORDE && bot->GetQuestStatus(9407) == QUEST_STATUS_NONE)) if ((bot->GetTeamId() == TEAM_ALLIANCE && bot->GetQuestStatus(10119) == QUEST_STATUS_NONE) || (bot->GetTeamId() == TEAM_HORDE && bot->GetQuestStatus(9407) == QUEST_STATUS_NONE))
{ {
@@ -104,12 +104,12 @@ bool MoveToDarkPortalAction::Execute(Event event)
bool MoveToDarkPortalAction::isUseful() bool MoveToDarkPortalAction::isUseful()
{ {
return bot->getLevel() > 54; return bot->GetLevel() > 54;
} }
bool DarkPortalAzerothAction::Execute(Event event) bool DarkPortalAzerothAction::Execute(Event event)
{ {
if (bot->getLevel() > 57) if (bot->GetLevel() > 57)
{ {
WorldPacket packet(CMSG_AREATRIGGER); WorldPacket packet(CMSG_AREATRIGGER);
packet << 4354; packet << 4354;
@@ -122,7 +122,7 @@ bool DarkPortalAzerothAction::Execute(Event event)
bool DarkPortalAzerothAction::isUseful() bool DarkPortalAzerothAction::isUseful()
{ {
return bot->getLevel() > 57; return bot->GetLevel() > 57;
} }
bool MoveFromDarkPortalAction::Execute(Event event) bool MoveFromDarkPortalAction::Execute(Event event)

View File

@@ -108,7 +108,7 @@ std::string const WhoAction::QuerySpec(std::string const text)
uint8 spec = AiFactory::GetPlayerSpecTab(bot); uint8 spec = AiFactory::GetPlayerSpecTab(bot);
out << "|h|cffffffff" << chat->FormatRace(bot->getRace()) << " [" << (bot->getGender() == GENDER_MALE ? "M" : "F") << "] " << chat->FormatClass(bot, spec); out << "|h|cffffffff" << chat->FormatRace(bot->getRace()) << " [" << (bot->getGender() == GENDER_MALE ? "M" : "F") << "] " << chat->FormatClass(bot, spec);
out << " (|h|cff00ff00" << (uint32)bot->getLevel() << "|h|cffffffff lvl), "; out << " (|h|cff00ff00" << (uint32)bot->GetLevel() << "|h|cffffffff lvl), ";
out << "|h|cff00ff00" << botAI->GetEquipGearScore(bot, false, false) << "|h|cffffffff GS ("; out << "|h|cff00ff00" << botAI->GetEquipGearScore(bot, false, false) << "|h|cffffffff GS (";
ItemCountByQuality visitor; ItemCountByQuality visitor;

View File

@@ -36,10 +36,10 @@ std::vector<uint32> WorldBuffAction::NeedWorldBuffs(Unit* unit)
if (wb.classId != 0 && wb.classId != unit->getClass()) if (wb.classId != 0 && wb.classId != unit->getClass())
continue; continue;
if (wb.minLevel != 0 && wb.minLevel > unit->getLevel()) if (wb.minLevel != 0 && wb.minLevel > unit->GetLevel())
continue; continue;
if (wb.maxLevel != 0 && wb.maxLevel < unit->getLevel()) if (wb.maxLevel != 0 && wb.maxLevel < unit->GetLevel())
continue; continue;
if (unit->HasAura(wb.spellId)) if (unit->HasAura(wb.spellId))

View File

@@ -54,7 +54,7 @@ void XpGainAction::GiveXP(uint32 xp, Unit* victim)
return; return;
} }
uint32 level = bot->getLevel(); uint32 level = bot->GetLevel();
// XP to money conversion processed in Player::RewardQuest // XP to money conversion processed in Player::RewardQuest
if (level >= sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL)) if (level >= sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL))
@@ -80,7 +80,7 @@ void XpGainAction::GiveXP(uint32 xp, Unit* victim)
bot->GiveLevel(level + 1); bot->GiveLevel(level + 1);
} }
level = bot->getLevel(); level = bot->GetLevel();
nextLvlXP = bot->GetUInt32Value(PLAYER_NEXT_LEVEL_XP); nextLvlXP = bot->GetUInt32Value(PLAYER_NEXT_LEVEL_XP);
} }

View File

@@ -22,7 +22,7 @@ NextAction** CastDireBearFormAction::getAlternatives()
bool CastTravelFormAction::isUseful() bool CastTravelFormAction::isUseful()
{ {
bool firstmount = bot->getLevel() >= 20; bool firstmount = bot->GetLevel() >= 20;
// useful if no mount or with wsg flag // useful if no mount or with wsg flag
return !bot->IsMounted() && (!firstmount || (bot->HasAura(23333) || bot->HasAura(23335) || bot->HasAura(34976))) && !botAI->HasAura("dash", bot); return !bot->IsMounted() && (!firstmount || (bot->HasAura(23333) || bot->HasAura(23335) || bot->HasAura(34976))) && !botAI->HasAura("dash", bot);

View File

@@ -39,7 +39,7 @@
// if (mediumMana && dynamic_cast<CastBuffSpellAction*>(action)) // if (mediumMana && dynamic_cast<CastBuffSpellAction*>(action))
// return 0.0f; // return 0.0f;
// if (target && ((int)target->getLevel() - (int)bot->getLevel()) >= 0) // if (target && ((int)target->GetLevel() - (int)bot->GetLevel()) >= 0)
// return 1.0f; // return 1.0f;
// return 1.0f; // return 1.0f;

View File

@@ -59,7 +59,7 @@ bool StealthTrigger::IsActive()
bool SapTrigger::IsPossible() bool SapTrigger::IsPossible()
{ {
return bot->getLevel() > 10 && bot->HasSpell(6770) && !bot->IsInCombat(); return bot->GetLevel() > 10 && bot->HasSpell(6770) && !bot->IsInCombat();
} }
bool SprintTrigger::IsPossible() bool SprintTrigger::IsPossible()

View File

@@ -108,7 +108,7 @@ bool OutNumberedTrigger::IsActive()
if (bot->GetGroup() && bot->GetGroup()->isRaidGroup()) if (bot->GetGroup() && bot->GetGroup()->isRaidGroup())
return false; return false;
int32 botLevel = bot->getLevel(); int32 botLevel = bot->GetLevel();
uint32 friendPower = 200; uint32 friendPower = 200;
uint32 foePower = 0; uint32 foePower = 0;
for (auto& attacker : botAI->GetAiObjectContext()->GetValue<GuidVector>("attackers")->Get()) for (auto& attacker : botAI->GetAiObjectContext()->GetValue<GuidVector>("attackers")->Get())
@@ -117,7 +117,7 @@ bool OutNumberedTrigger::IsActive()
if (!creature) if (!creature)
continue; continue;
int32 dLevel = creature->getLevel() - botLevel; int32 dLevel = creature->GetLevel() - botLevel;
if (dLevel > -10) if (dLevel > -10)
foePower = std::max(100 + 10 * dLevel, dLevel * 200); foePower = std::max(100 + 10 * dLevel, dLevel * 200);
} }
@@ -131,7 +131,7 @@ bool OutNumberedTrigger::IsActive()
if (!player || player == bot) if (!player || player == bot)
continue; continue;
int32 dLevel = player->getLevel() - botLevel; int32 dLevel = player->GetLevel() - botLevel;
if (dLevel > -10 && bot->GetDistance(player) < 10.0f) if (dLevel > -10 && bot->GetDistance(player) < 10.0f)
friendPower += std::max(200 + 20 * dLevel, dLevel * 200); friendPower += std::max(200 + 20 * dLevel, dLevel * 200);

View File

@@ -84,7 +84,7 @@ bool BgInviteActiveTrigger::IsActive()
if (ginfo.IsInvitedToBGInstanceGUID && ginfo.RemoveInviteTime) if (ginfo.IsInvitedToBGInstanceGUID && ginfo.RemoveInviteTime)
{ {
LOG_INFO("playerbots", "Bot {} <{}> ({} {}) : Invited to BG but not in BG", LOG_INFO("playerbots", "Bot {} <{}> ({} {}) : Invited to BG but not in BG",
bot->GetGUID().ToString().c_str(), bot->GetName(), bot->getLevel(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H"); bot->GetGUID().ToString().c_str(), bot->GetName(), bot->GetLevel(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H");
return true; return true;
} }
} }

View File

@@ -425,7 +425,7 @@ bool RpgDuelTrigger::IsActive()
return false; return false;
// Less spammy duels // Less spammy duels
if (bot->getLevel() < 3) if (bot->GetLevel() < 3)
return false; return false;
if (botAI->HasRealPlayerMaster()) if (botAI->HasRealPlayerMaster())
@@ -450,10 +450,10 @@ bool RpgDuelTrigger::IsActive()
if (!player) if (!player)
return false; return false;
if (player->getLevel() > bot->getLevel() + 3) if (player->GetLevel() > bot->GetLevel() + 3)
return false; return false;
if (bot->getLevel() > player->getLevel() + 10) if (bot->GetLevel() > player->GetLevel() + 10)
return false; return false;
// caster or target already have requested duel // caster or target already have requested duel

View File

@@ -22,7 +22,7 @@ bool MoveStuckTrigger::IsActive()
if (posVal->LastChangeDelay() > 5 * MINUTE) if (posVal->LastChangeDelay() > 5 * MINUTE)
{ {
// LOG_INFO("playerbots", "Bot {} {}:{} <{}> was in the same position for {} seconds", // LOG_INFO("playerbots", "Bot {} {}:{} <{}> was in the same position for {} seconds",
// bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->getLevel(), bot->GetName(), posVal->LastChangeDelay()); // bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName(), posVal->LastChangeDelay());
return true; return true;
} }
@@ -45,7 +45,7 @@ bool MoveStuckTrigger::IsActive()
if (longLog) if (longLog)
{ {
// LOG_INFO("playerbots", "Bot {} {}:{} <{}> was in the same position for 10mins", // LOG_INFO("playerbots", "Bot {} {}:{} <{}> was in the same position for 10mins",
// bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->getLevel(), bot->GetName(), posVal->LastChangeDelay()); // bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName(), posVal->LastChangeDelay());
} }
return longLog; return longLog;
@@ -68,7 +68,7 @@ bool MoveLongStuckTrigger::IsActive()
if (grid.x_coord < 0 || grid.x_coord >= MAX_NUMBER_OF_GRIDS) if (grid.x_coord < 0 || grid.x_coord >= MAX_NUMBER_OF_GRIDS)
{ {
// LOG_INFO("playerbots", "Bot {} {}:{} <{}> was in grid {},{} on map {}", // LOG_INFO("playerbots", "Bot {} {}:{} <{}> was in grid {},{} on map {}",
// bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->getLevel(), bot->GetName(), grid.x_coord, grid.y_coord, botPos.getMapId()); // bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName(), grid.x_coord, grid.y_coord, botPos.getMapId());
return true; return true;
} }
@@ -76,7 +76,7 @@ bool MoveLongStuckTrigger::IsActive()
if (grid.y_coord < 0 || grid.y_coord >= MAX_NUMBER_OF_GRIDS) if (grid.y_coord < 0 || grid.y_coord >= MAX_NUMBER_OF_GRIDS)
{ {
// LOG_INFO("playerbots", "Bot {} {}:{} <{}> was in grid {},{} on map {}", // LOG_INFO("playerbots", "Bot {} {}:{} <{}> was in grid {},{} on map {}",
// bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->getLevel(), bot->GetName(), grid.x_coord, grid.y_coord, botPos.getMapId()); // bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName(), grid.x_coord, grid.y_coord, botPos.getMapId());
return true; return true;
} }
@@ -84,7 +84,7 @@ bool MoveLongStuckTrigger::IsActive()
if (cell.GridX() > 0 && cell.GridY() > 0 && !MMAP::MMapFactory::createOrGetMMapMgr()->loadMap(botPos.getMapId(), cell.GridX(), cell.GridY())) if (cell.GridX() > 0 && cell.GridY() > 0 && !MMAP::MMapFactory::createOrGetMMapMgr()->loadMap(botPos.getMapId(), cell.GridX(), cell.GridY()))
{ {
// LOG_INFO("playerbots", "Bot {} {}:{} <{}> was in unloaded grid {},{} on map {}", // LOG_INFO("playerbots", "Bot {} {}:{} <{}> was in unloaded grid {},{} on map {}",
// bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->getLevel(), bot->GetName(), grid.x_coord, grid.y_coord, botPos.getMapId()); // bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName(), grid.x_coord, grid.y_coord, botPos.getMapId());
return true; return true;
} }
@@ -94,7 +94,7 @@ bool MoveLongStuckTrigger::IsActive()
if (posVal->LastChangeDelay() > 10 * MINUTE) if (posVal->LastChangeDelay() > 10 * MINUTE)
{ {
// LOG_INFO("playerbots", "Bot {} {}:{} <{}> was in the same position for {} seconds", // LOG_INFO("playerbots", "Bot {} {}:{} <{}> was in the same position for {} seconds",
// bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->getLevel(), bot->GetName(), posVal->LastChangeDelay()); // bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName(), posVal->LastChangeDelay());
return true; return true;
} }
@@ -122,7 +122,7 @@ bool MoveLongStuckTrigger::IsActive()
if (longLog) if (longLog)
{ {
// LOG_INFO("playerbots", "Bot {} {}:{} <{}> was in the same position for 15mins", // LOG_INFO("playerbots", "Bot {} {}:{} <{}> was in the same position for 15mins",
// bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->getLevel(), bot->GetName(), posVal->LastChangeDelay()); // bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName(), posVal->LastChangeDelay());
} }
return longLog; return longLog;
@@ -146,7 +146,7 @@ bool CombatStuckTrigger::IsActive()
if (combatVal->LastChangeDelay() > 5 * MINUTE) if (combatVal->LastChangeDelay() > 5 * MINUTE)
{ {
// LOG_INFO("playerbots", "Bot {} {}:{} <{}> was in combat for {} seconds", // LOG_INFO("playerbots", "Bot {} {}:{} <{}> was in combat for {} seconds",
// bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->getLevel(), bot->GetName(), posVal->LastChangeDelay()); // bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName(), posVal->LastChangeDelay());
return true; return true;
} }
@@ -172,7 +172,7 @@ bool CombatLongStuckTrigger::IsActive()
if (combatVal->LastChangeDelay() > 15 * MINUTE) if (combatVal->LastChangeDelay() > 15 * MINUTE)
{ {
// LOG_INFO("playerbots", "Bot {} {}:{} <{}> was in combat for {} seconds", // LOG_INFO("playerbots", "Bot {} {}:{} <{}> was in combat for {} seconds",
// bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->getLevel(), bot->GetName(), posVal->LastChangeDelay()); // bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName(), posVal->LastChangeDelay());
return true; return true;
} }

View File

@@ -62,7 +62,7 @@ uint8 BalancePercentValue::Calculate()
if (!player || !player->IsAlive()) if (!player || !player->IsAlive())
continue; continue;
playerLevel += player->getLevel(); playerLevel += player->GetLevel();
} }
} }
@@ -73,7 +73,7 @@ uint8 BalancePercentValue::Calculate()
if (!creature || !creature->IsAlive()) if (!creature || !creature->IsAlive())
continue; continue;
uint32 level = creature->getLevel(); uint32 level = creature->GetLevel();
switch (creature->GetCreatureTemplate()->rank) switch (creature->GetCreatureTemplate()->rank)
{ {

View File

@@ -143,7 +143,7 @@ uint32 MoneyNeededForValue::Calculate()
uint32 moneyWanted = 0; uint32 moneyWanted = 0;
uint32 level = bot->getLevel(); uint32 level = bot->GetLevel();
switch (needMoneyFor) switch (needMoneyFor)
{ {

View File

@@ -78,7 +78,7 @@ Unit* GrindTargetValue::FindTargetForGrinding(uint32 assistCount)
//if (!bot->InBattleground() && master && master->GetDistance(unit) >= sPlayerbotAIConfig->grindDistance && !sRandomPlayerbotMgr->IsRandomBot(bot)) //if (!bot->InBattleground() && master && master->GetDistance(unit) >= sPlayerbotAIConfig->grindDistance && !sRandomPlayerbotMgr->IsRandomBot(bot))
//continue; //continue;
if (!bot->InBattleground() && (int)unit->getLevel() - (int)bot->getLevel() > 4 && !unit->GetGUID().IsPlayer()) if (!bot->InBattleground() && (int)unit->GetLevel() - (int)bot->GetLevel() > 4 && !unit->GetGUID().IsPlayer())
continue; continue;
// if (needForQuestMap.find(unit->GetEntry()) == needForQuestMap.end()) // if (needForQuestMap.find(unit->GetEntry()) == needForQuestMap.end())
@@ -160,7 +160,7 @@ bool GrindTargetValue::needForQuest(Unit* target)
{ {
QuestStatusData* questStatus = sTravelMgr->getQuestStatus(bot, questId); QuestStatusData* questStatus = sTravelMgr->getQuestStatus(bot, questId);
if (questTemplate->GetQuestLevel() > bot->getLevel()) if (questTemplate->GetQuestLevel() > bot->GetLevel())
continue; continue;
for (int j = 0; j < QUEST_OBJECTIVES_COUNT; j++) for (int j = 0; j < QUEST_OBJECTIVES_COUNT; j++)

View File

@@ -190,7 +190,7 @@ ItemUsage ItemUsageValue::QueryItemUsageForEquip(ItemTemplate const* itemProto)
if (itemProto->Class == ITEM_CLASS_WEAPON && !sRandomItemMgr->CanEquipWeapon(bot->getClass(), itemProto)) if (itemProto->Class == ITEM_CLASS_WEAPON && !sRandomItemMgr->CanEquipWeapon(bot->getClass(), itemProto))
shouldEquip = false; shouldEquip = false;
if (itemProto->Class == ITEM_CLASS_ARMOR && !sRandomItemMgr->CanEquipArmor(bot->getClass(), bot->getLevel(), itemProto)) if (itemProto->Class == ITEM_CLASS_ARMOR && !sRandomItemMgr->CanEquipArmor(bot->getClass(), bot->GetLevel(), itemProto))
shouldEquip = false; shouldEquip = false;
Item* oldItem = bot->GetItemByPos(dest); Item* oldItem = bot->GetItemByPos(dest);
@@ -228,7 +228,7 @@ ItemUsage ItemUsageValue::QueryItemUsageForEquip(ItemTemplate const* itemProto)
if (oldItemProto->Class == ITEM_CLASS_WEAPON && !sRandomItemMgr->CanEquipWeapon(bot->getClass(), oldItemProto)) if (oldItemProto->Class == ITEM_CLASS_WEAPON && !sRandomItemMgr->CanEquipWeapon(bot->getClass(), oldItemProto))
existingShouldEquip = false; existingShouldEquip = false;
if (oldItemProto->Class == ITEM_CLASS_ARMOR && !sRandomItemMgr->CanEquipArmor(bot->getClass(), bot->getLevel(), oldItemProto)) if (oldItemProto->Class == ITEM_CLASS_ARMOR && !sRandomItemMgr->CanEquipArmor(bot->getClass(), bot->GetLevel(), oldItemProto))
existingShouldEquip = false; existingShouldEquip = false;
// uint32 oldItemPower = sRandomItemMgr->GetLiveStatWeight(bot, oldItemProto->ItemId); // uint32 oldItemPower = sRandomItemMgr->GetLiveStatWeight(bot, oldItemProto->ItemId);

View File

@@ -177,7 +177,7 @@ BattlegroundTypeId RpgBgTypeValue::Calculate()
if (!bg) if (!bg)
continue; continue;
if (bot->getLevel() < bg->GetMinLevel()) if (bot->GetLevel() < bg->GetMinLevel())
continue; continue;
// check if already in queue // check if already in queue

View File

@@ -136,7 +136,7 @@ questGiverMap QuestGiversValue::Calculate()
std::vector<GuidPosition> ActiveQuestGiversValue::Calculate() std::vector<GuidPosition> ActiveQuestGiversValue::Calculate()
{ {
questGiverMap qGivers = GAI_VALUE2(questGiverMap, "quest givers", bot->getLevel()); questGiverMap qGivers = GAI_VALUE2(questGiverMap, "quest givers", bot->GetLevel());
std::vector<GuidPosition> retQuestGivers; std::vector<GuidPosition> retQuestGivers;
@@ -406,7 +406,7 @@ uint32 DialogStatusValue::getDialogStatus(Player* bot, int32 questgiver, uint32
{ {
dialogStatusNew = DIALOG_STATUS_REWARD_REP; dialogStatusNew = DIALOG_STATUS_REWARD_REP;
} }
else if (lowLevelDiff < 0 || bot->getLevel() <= bot->GetQuestLevel(pQuest) + uint32(lowLevelDiff)) else if (lowLevelDiff < 0 || bot->GetLevel() <= bot->GetQuestLevel(pQuest) + uint32(lowLevelDiff))
{ {
dialogStatusNew = DIALOG_STATUS_AVAILABLE; dialogStatusNew = DIALOG_STATUS_AVAILABLE;
} }