mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-01-24 14:06:22 +00:00
Rework in progress crash chat botgroup
This commit is contained in:
@@ -244,12 +244,11 @@ bool QuestUpdateCompleteAction::Execute(Event event)
|
||||
WorldPacket p(event.getPacket());
|
||||
p.rpos(0);
|
||||
|
||||
if (p.empty())
|
||||
return false;
|
||||
uint32 questId = 0;
|
||||
p >> questId;
|
||||
|
||||
uint32 entry, questId, available, required;
|
||||
ObjectGuid guid;
|
||||
p >> questId >> entry >> available >> required >> guid;
|
||||
p.print_storage();
|
||||
LOG_INFO("playerbots", "Packet: empty{} questId{}", p.empty(), questId);
|
||||
|
||||
Quest const* qInfo = sObjectMgr->GetQuestTemplate(questId);
|
||||
if (qInfo)
|
||||
@@ -275,8 +274,7 @@ bool QuestUpdateAddKillAction::Execute(Event event)
|
||||
p.rpos(0);
|
||||
|
||||
uint32 entry, questId, available, required;
|
||||
ObjectGuid guid;
|
||||
p >> questId >> entry >> available >> required >> guid;
|
||||
p >> questId >> entry >> available >> required;
|
||||
|
||||
std::stringstream ss;
|
||||
ss << "Update progression kill questid {" << std::to_string(questId) << "} {" << std::to_string(available) << "} / {" << std::to_string(required) << "}";
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -6,10 +6,10 @@
|
||||
#define _PLAYERBOT_SAYACTION_H
|
||||
|
||||
#include "Action.h"
|
||||
#include "PlayerbotAI.h"
|
||||
#include "NamedObjectContext.h"
|
||||
|
||||
class PlayerbotAI;
|
||||
|
||||
class SayAction : public Action, public Qualified
|
||||
{
|
||||
public:
|
||||
@@ -31,6 +31,13 @@ public:
|
||||
ChatReplyAction(PlayerbotAI* ai) : Action(ai, "chat message") {}
|
||||
virtual bool Execute(Event event) { return true; }
|
||||
bool isUseful() { return true; }
|
||||
|
||||
static void ChatReplyDo(Player* bot, uint32 type, uint32 guid1, uint32 guid2, std::string msg, std::string chanName, std::string name);
|
||||
static bool HandleThunderfuryReply(Player* bot, ChatChannelSource chatChannelSource, std::string msg, std::string name);
|
||||
static bool HandleToxicLinksReply(Player* bot, ChatChannelSource chatChannelSource, std::string msg, std::string name);
|
||||
static bool HandleWTBItemsReply(Player* bot, ChatChannelSource chatChannelSource, std::string msg, std::string name);
|
||||
static bool HandleLFGQuestsReply(Player* bot, ChatChannelSource chatChannelSource, std::string msg, std::string name);
|
||||
static bool SendGeneralResponse(Player* bot, ChatChannelSource chatChannelSource, std::string responseMessage, std::string name);
|
||||
static std::string GenerateReplyMessage(Player* bot, std::string incomingMessage, uint32 guid1, std::string name);
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -216,13 +216,12 @@ void SuggestWhatToDoAction::something()
|
||||
std::map<std::string, std::string> placeholders;
|
||||
placeholders["%role"] = chat->FormatClass(bot, AiFactory::GetPlayerSpecTab(bot));
|
||||
|
||||
AreaTableEntry const* entry = sAreaTableStore.LookupEntry(bot->GetAreaId());
|
||||
if (!entry)
|
||||
return;
|
||||
AreaTableEntry const* zone = sAreaTableStore.LookupEntry(bot->GetMap()->GetZoneId(bot->GetPhaseMask(), bot->GetPositionX(), bot->GetPositionY(), bot->GetPositionZ()));
|
||||
if (!zone) return;
|
||||
|
||||
std::ostringstream out;
|
||||
// out << "|cffb04040" << entry->area_name[0] << "|r";
|
||||
out << entry->area_name[_dbc_locale];
|
||||
out << zone->area_name[_dbc_locale];
|
||||
placeholders["%zone"] = out.str();
|
||||
|
||||
spam(BOT_TEXT2("suggest_something", placeholders), urand(0, 1) ? eTalkType::General : 0, !urand(0, 2), !urand(0, 3));
|
||||
|
||||
Reference in New Issue
Block a user