Fix chain link broken (random) unknown + dbc local enus force in some case (spell / chathelper etc)

This commit is contained in:
Atidot3
2024-07-27 14:39:30 +02:00
parent 162229efe5
commit 00844985eb
7 changed files with 12 additions and 13 deletions

View File

@@ -288,7 +288,7 @@ std::string const ChatHelper::FormatQuest(Quest const* quest)
std::string const ChatHelper::FormatGameobject(GameObject* go) std::string const ChatHelper::FormatGameobject(GameObject* go)
{ {
std::ostringstream out; std::ostringstream out;
out << "|cFFFFFF00|Hfound:" << go->GetGUID().GetRawValue() << ":" << go->GetEntry() << ":" << "|h[" << go->GetNameForLocaleIdx(sWorld->GetDefaultDbcLocale()) << "]|h|r"; out << "|cFFFFFF00|Hfound:" << go->GetGUID().GetRawValue() << ":" << go->GetEntry() << ":" << "|h[" << go->GetNameForLocaleIdx(LOCALE_enUS) << "]|h|r";
return out.str(); return out.str();
} }
@@ -296,7 +296,7 @@ std::string const ChatHelper::FormatWorldobject(WorldObject* wo)
{ {
std::ostringstream out; std::ostringstream out;
out << "|cFFFFFF00|Hfound:" << wo->GetGUID().GetRawValue() << ":" << wo->GetEntry() << ":" << "|h["; out << "|cFFFFFF00|Hfound:" << wo->GetGUID().GetRawValue() << ":" << wo->GetEntry() << ":" << "|h[";
out << (wo->ToGameObject() ? ((GameObject*)wo)->GetNameForLocaleIdx(sWorld->GetDefaultDbcLocale()) : wo->GetNameForLocaleIdx(sWorld->GetDefaultDbcLocale())) << "]|h|r"; out << (wo->ToGameObject() ? ((GameObject*)wo)->GetNameForLocaleIdx(LOCALE_enUS) : wo->GetNameForLocaleIdx(LOCALE_enUS)) << "]|h|r";
return out.str(); return out.str();
} }
@@ -327,7 +327,7 @@ std::string const ChatHelper::FormatWorldEntry(int32 entry)
std::string const ChatHelper::FormatSpell(SpellInfo const* spellInfo) std::string const ChatHelper::FormatSpell(SpellInfo const* spellInfo)
{ {
std::ostringstream out; std::ostringstream out;
out << "|cffffffff|Hspell:" << spellInfo->Id << "|h[" << spellInfo->SpellName[sWorld->GetDefaultDbcLocale()] << "]|h|r"; out << "|cffffffff|Hspell:" << spellInfo->Id << "|h[" << spellInfo->SpellName[LOCALE_enUS] << "]|h|r";
return out.str(); return out.str();
} }
@@ -336,7 +336,7 @@ std::string const ChatHelper::FormatItem(ItemTemplate const* proto, uint32 count
char color[32]; char color[32];
sprintf(color, "%x", ItemQualityColors[proto->Quality]); sprintf(color, "%x", ItemQualityColors[proto->Quality]);
// const std::string &name = sObjectMgr->GetItemLocale(proto->ItemId)->Name[sWorld->GetDefaultDbcLocale()]; // const std::string &name = sObjectMgr->GetItemLocale(proto->ItemId)->Name[LOCALE_enUS];
std::ostringstream out; std::ostringstream out;
out << "|c" << color << "|Hitem:" << proto->ItemId out << "|c" << color << "|Hitem:" << proto->ItemId

View File

@@ -1228,8 +1228,8 @@ void RandomPlayerbotMgr::RandomTeleport(Player* bot, std::vector<WorldLocation>&
if (bot->GetLevel() <= 18 && (loc.GetMapId() != pInfo->mapId || dis > 10000.0f)) { if (bot->GetLevel() <= 18 && (loc.GetMapId() != pInfo->mapId || dis > 10000.0f)) {
continue; continue;
} }
LocaleConstant locale = sWorld->GetDefaultDbcLocale();
const LocaleConstant& locale = sWorld->GetDefaultDbcLocale();
LOG_INFO("playerbots", "Random teleporting bot {} (level {}) to Map: {} ({}) Zone: {} ({}) Area: {} ({}) {},{},{} ({}/{} locations)", LOG_INFO("playerbots", "Random teleporting bot {} (level {}) to Map: {} ({}) Zone: {} ({}) Area: {} ({}) {},{},{} ({}/{} locations)",
bot->GetName().c_str(), bot->GetLevel(), bot->GetName().c_str(), bot->GetLevel(),
map->GetId(), map->GetMapName(), map->GetId(), map->GetMapName(),

View File

@@ -105,7 +105,7 @@ bool LfgJoinAction::JoinLFG()
const auto& botLevel = bot->GetLevel(); const auto& botLevel = bot->GetLevel();
/*LFG_TYPE_RANDOM on classic is 15-58 so bot over level 25 will never queue*/ /*LFG_TYPE_RANDOM on classic is 15-58 so bot over level 25 will never queue*/
if (dungeon->MinLevel && (botLevel < dungeon->MinLevel || botLevel > dungeon->MaxLevel) if (dungeon->MinLevel && (botLevel < dungeon->MinLevel || botLevel > dungeon->MaxLevel)
|| ||
(botLevel > dungeon->MinLevel + 10 && dungeon->TypeID == LFG_TYPE_DUNGEON) (botLevel > dungeon->MinLevel + 10 && dungeon->TypeID == LFG_TYPE_DUNGEON)

View File

@@ -1555,7 +1555,7 @@ bool AvoidAoeAction::AvoidAuraWithDynamicObj()
return false; return false;
} }
std::ostringstream name; std::ostringstream name;
name << spellInfo->SpellName[sWorld->GetDefaultDbcLocale()]; // << "] (aura)"; name << spellInfo->SpellName[LOCALE_enUS]; // << "] (aura)";
if (FleePosition(dynOwner->GetPosition(), radius)) { if (FleePosition(dynOwner->GetPosition(), radius)) {
if (sPlayerbotAIConfig->tellWhenAvoidAoe && lastTellTimer < time(NULL) - 10) { if (sPlayerbotAIConfig->tellWhenAvoidAoe && lastTellTimer < time(NULL) - 10) {
lastTellTimer = time(NULL); lastTellTimer = time(NULL);
@@ -1613,7 +1613,7 @@ bool AvoidAoeAction::AvoidGameObjectWithDamage()
continue; continue;
} }
std::ostringstream name; std::ostringstream name;
name << spellInfo->SpellName[sWorld->GetDefaultDbcLocale()]; // << "] (object)"; name << spellInfo->SpellName[LOCALE_enUS]; // << "] (object)";
if (FleePosition(go->GetPosition(), radius)) { if (FleePosition(go->GetPosition(), radius)) {
if (sPlayerbotAIConfig->tellWhenAvoidAoe && lastTellTimer < time(NULL) - 10) { if (sPlayerbotAIConfig->tellWhenAvoidAoe && lastTellTimer < time(NULL) - 10) {
lastTellTimer = time(NULL); lastTellTimer = time(NULL);
@@ -1662,7 +1662,7 @@ bool AvoidAoeAction::AvoidUnitWithDamageAura()
break; break;
} }
std::ostringstream name; std::ostringstream name;
name << triggerSpellInfo->SpellName[sWorld->GetDefaultDbcLocale()]; //<< "] (unit)"; name << triggerSpellInfo->SpellName[LOCALE_enUS]; //<< "] (unit)";
if (FleePosition(unit->GetPosition(), radius)) { if (FleePosition(unit->GetPosition(), radius)) {
if (sPlayerbotAIConfig->tellWhenAvoidAoe && lastTellTimer < time(NULL) - 10) { if (sPlayerbotAIConfig->tellWhenAvoidAoe && lastTellTimer < time(NULL) - 10) {
lastTellTimer = time(NULL); lastTellTimer = time(NULL);

View File

@@ -20,7 +20,6 @@ class SuggestWhatToDoAction : public InventoryAction
protected: protected:
using Suggestion = std::function<void()>; using Suggestion = std::function<void()>;
std::vector<Suggestion> suggestions; std::vector<Suggestion> suggestions;
void instance();
void specificQuest(); void specificQuest();
void grindReputation(); void grindReputation();
void grindMaterials(); void grindMaterials();

View File

@@ -138,4 +138,4 @@ bool TellExpectedDpsAction::Execute(Event event)
float dps = AI_VALUE(float, "expected group dps"); float dps = AI_VALUE(float, "expected group dps");
botAI->TellMaster("Expected Group DPS: " + std::to_string(dps)); botAI->TellMaster("Expected Group DPS: " + std::to_string(dps));
return true; return true;
} }

View File

@@ -22,7 +22,7 @@ void EmoteStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
} }
if (sPlayerbotAIConfig->randomBotSuggestDungeons) if (sPlayerbotAIConfig->randomBotSuggestDungeons)
triggers.push_back(new TriggerNode("random", NextAction::array(0, new NextAction("suggest dungeon", 1.0f), nullptr))); triggers.push_back(new TriggerNode("often", NextAction::array(0, new NextAction("suggest dungeon", 1.0f), nullptr)));
if (sPlayerbotAIConfig->enableGreet) if (sPlayerbotAIConfig->enableGreet)
triggers.push_back(new TriggerNode("new player nearby", NextAction::array(0, new NextAction("greet", 1.0f), nullptr))); triggers.push_back(new TriggerNode("new player nearby", NextAction::array(0, new NextAction("greet", 1.0f), nullptr)));