Skip to content

Commit

Permalink
Travel: Added proper info to travel_map.csv
Browse files Browse the repository at this point in the history
  • Loading branch information
mostlikely4r committed Jan 21, 2025
1 parent ac58a18 commit 48a119b
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 3 deletions.
59 changes: 57 additions & 2 deletions playerbot/strategy/actions/ChooseTravelTargetAction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,7 @@ void ChooseTravelTargetAction::ReportTravelTarget(Player* requester, TravelTarge
else
out << round(newTarget->GetDestination()->DistanceTo(botPos)) << ",";

out << "1," << "\"" << destination->GetTitle() << "\",\"" << message << "\"";
out << "new," << "\"" << destination->GetTitle() << "\",\"" << message << "\"";

if (typeid(*destination) == typeid(NullTravelDestination))
out << ",none";
Expand Down Expand Up @@ -619,7 +619,62 @@ void ChooseTravelTargetAction::ReportTravelTarget(Player* requester, TravelTarge
else
out << round(newTarget->GetDestination()->DistanceTo(botPos)) << ",";

out << "0," << "\"" << destination->GetTitle() << "\",\""<< message << "\"";
out << "previous," << "\"" << destination->GetTitle() << "\",\""<< message << "\"";

if (typeid(*destination) == typeid(NullTravelDestination))
out << ",none";
else if (typeid(*destination) == typeid(QuestTravelDestination))
out << ",quest";
else if (typeid(*destination) == typeid(QuestRelationTravelDestination))
out << ",questgiver";
else if (typeid(*destination) == typeid(QuestObjectiveTravelDestination))
out << ",objective";
else if (typeid(*destination) == typeid(RpgTravelDestination))
{
RpgTravelDestination* RpgDestination = (RpgTravelDestination*)destination;
if (RpgDestination->GetEntry() > 0)
{
CreatureInfo const* cInfo = RpgDestination->GetCreatureInfo();

if (cInfo)
{
if ((cInfo->NpcFlags & UNIT_NPC_FLAG_VENDOR) && AI_VALUE2(bool, "group or", "should sell,can sell"))
out << ",sell";
else if ((cInfo->NpcFlags & UNIT_NPC_FLAG_REPAIR) && AI_VALUE2(bool, "group or", "should repair,can repair"))
out << ",repair";
else if ((cInfo->NpcFlags & UNIT_NPC_FLAG_AUCTIONEER) && AI_VALUE2(bool, "group or", "should ah sell,can ah sell"))
out << ",ah";
else
out << ",rpg";
}
else
out << ",rpg";
}
else
{
GameObjectInfo const* gInfo = RpgDestination->GetGoInfo();

if (gInfo)
{
if (gInfo->type == GAMEOBJECT_TYPE_MAILBOX && AI_VALUE(bool, "can get mail"))
out << ",mail";
else
out << ",rpg";
}
else
out << ",rpg";
}
}
else if (typeid(*destination) == typeid(ExploreTravelDestination))
out << ",explore";
else if (typeid(*destination) == typeid(GrindTravelDestination))
out << ",grind";
else if (typeid(*destination) == typeid(BossTravelDestination))
out << ",boss";
else if (typeid(*destination) == typeid(GatherTravelDestination))
out << ",gather";
else
out << ",unknown";

sPlayerbotAIConfig.log("travel_map.csv", out.str().c_str());
}
Expand Down
2 changes: 1 addition & 1 deletion playerbot/strategy/actions/MoveToTravelTargetAction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ bool MoveToTravelTargetAction::Execute(Event& event)
else
out << round(target->GetDestination()->DistanceTo(botPos)) << ",";

out << "2," << "\"" << destination->GetTitle() << "\",\"" << "timeout" << "\"";
out << "fail," << "\"" << destination->GetTitle() << "\",\"" << "timeout" << "\"";

if (typeid(*destination) == typeid(NullTravelDestination))
out << ",none";
Expand Down

0 comments on commit 48a119b

Please sign in to comment.