Skip to content

Commit

Permalink
wip1
Browse files Browse the repository at this point in the history
  • Loading branch information
Redbu11 authored and Redbu11 committed Sep 11, 2024
1 parent eb3734c commit 923e847
Show file tree
Hide file tree
Showing 32 changed files with 429 additions and 464 deletions.
92 changes: 0 additions & 92 deletions playerbot/BroadcastHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -742,36 +742,6 @@ bool BroadcastHelper::BroadcastGuildGroupOrRaidInvite(
return false;
}

bool BroadcastHelper::BroadcastSuggestInstance(
PlayerbotAI* ai,
std::vector<std::string>& allowedInstances,
Player* bot
)
{
if (urand(1, sPlayerbotAIConfig.broadcastChanceMaxValue) <= sPlayerbotAIConfig.broadcastChanceSuggestInstance)
{
std::map<std::string, std::string> placeholders;
placeholders["%my_role"] = ai->GetChatHelper()->formatClass(bot, AiFactory::GetPlayerSpecTab(bot));

std::ostringstream itemout;
//itemout << "|c00b000b0" << allowedInstances[urand(0, allowedInstances.size() - 1)] << "|r";
itemout << allowedInstances[urand(0, allowedInstances.size() - 1)];
placeholders["%instance_name"] = itemout.str();

placeholders["%my_class"] = ai->GetChatHelper()->formatClass(bot->getClass());
placeholders["%my_race"] = ai->GetChatHelper()->formatRace(bot->getRace());
placeholders["%my_level"] = std::to_string(bot->GetLevel());

return BroadcastToChannelWithGlobalChance(
ai,
BOT_TEXT2("suggest_instance", placeholders),
{ {TO_LOOKING_FOR_GROUP, 50}, {TO_GUILD, 50}, {TO_WORLD, 50}, {TO_GENERAL, 100} }
);
}

return false;
}

bool BroadcastHelper::BroadcastSuggestQuest(
PlayerbotAI* ai,
std::vector<uint32>& quests,
Expand Down Expand Up @@ -803,68 +773,6 @@ bool BroadcastHelper::BroadcastSuggestQuest(
return false;
}

bool BroadcastHelper::BroadcastSuggestGrindMaterials(
PlayerbotAI* ai,
std::string item,
Player* bot
)
{
if (urand(1, sPlayerbotAIConfig.broadcastChanceMaxValue) <= sPlayerbotAIConfig.broadcastChanceSuggestGrindMaterials)
{

std::map<std::string, std::string> placeholders;
placeholders["%my_role"] = ai->GetChatHelper()->formatClass(bot, AiFactory::GetPlayerSpecTab(bot));
placeholders["%category"] = item;

placeholders["%my_class"] = ai->GetChatHelper()->formatClass(bot->getClass());
placeholders["%my_race"] = ai->GetChatHelper()->formatRace(bot->getRace());
placeholders["%my_level"] = std::to_string(bot->GetLevel());

return BroadcastToChannelWithGlobalChance(
ai,
BOT_TEXT2("suggest_trade", placeholders),
{ {TO_TRADE, 50}, {TO_LOOKING_FOR_GROUP, 50}, {TO_GUILD, 50}, {TO_WORLD, 50}, {TO_GENERAL, 100} }
);
}

return false;
}

bool BroadcastHelper::BroadcastSuggestGrindReputation(
PlayerbotAI* ai,
std::vector<std::string> levels,
std::vector<std::string> allowedFactions,
Player* bot
)
{
if (urand(1, sPlayerbotAIConfig.broadcastChanceMaxValue) <= sPlayerbotAIConfig.broadcastChanceSuggestGrindReputation)
{

std::map<std::string, std::string> placeholders;
placeholders["%my_role"] = ai->GetChatHelper()->formatClass(bot, AiFactory::GetPlayerSpecTab(bot));
placeholders["%rep_level"] = levels[urand(0, 2)];
std::ostringstream rnd; rnd << urand(1, 5) << "K";
placeholders["%rndK"] = rnd.str();

std::ostringstream itemout;
//itemout << "|c004040b0" << allowedFactions[urand(0, allowedFactions.size() - 1)] << "|r";
itemout << allowedFactions[urand(0, allowedFactions.size() - 1)];
placeholders["%faction"] = itemout.str();

placeholders["%my_class"] = ai->GetChatHelper()->formatClass(bot->getClass());
placeholders["%my_race"] = ai->GetChatHelper()->formatRace(bot->getRace());
placeholders["%my_level"] = std::to_string(bot->GetLevel());

return BroadcastToChannelWithGlobalChance(
ai,
BOT_TEXT2("suggest_faction", placeholders),
{ {TO_LOOKING_FOR_GROUP, 50}, {TO_GUILD, 50}, {TO_WORLD, 50}, {TO_GENERAL, 100} }
);
}

return false;
}

bool BroadcastHelper::BroadcastSuggestSell(
PlayerbotAI* ai,
const ItemPrototype* proto,
Expand Down
16 changes: 0 additions & 16 deletions playerbot/BroadcastHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,27 +104,11 @@ namespace ai
Group* group,
Guild* guild
);
static bool BroadcastSuggestInstance(
PlayerbotAI* ai,
std::vector<std::string>& allowedInstances,
Player* bot
);
static bool BroadcastSuggestQuest(
PlayerbotAI* ai,
std::vector<uint32>& quests,
Player* bot
);
static bool BroadcastSuggestGrindMaterials(
PlayerbotAI* ai,
std::string item,
Player* bot
);
static bool BroadcastSuggestGrindReputation(
PlayerbotAI* ai,
std::vector<std::string> levels,
std::vector<std::string> allowedFactions,
Player* bot
);
static bool BroadcastSuggestSell(
PlayerbotAI* ai,
const ItemPrototype* proto,
Expand Down
Loading

0 comments on commit 923e847

Please sign in to comment.