mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-01-14 17:39:09 +00:00
Merge code line
This commit is contained in:
@@ -1,10 +1,12 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
|
||||
* and/or modify it under version 2 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#include "QueryQuestAction.h"
|
||||
#include "Event.h"
|
||||
|
||||
#include "ChatHelper.h"
|
||||
#include "Event.h"
|
||||
#include "Playerbots.h"
|
||||
|
||||
void QueryQuestAction::TellObjective(std::string const name, uint32 available, uint32 required)
|
||||
@@ -70,10 +72,10 @@ bool QueryQuestAction::Execute(Event event)
|
||||
if (travel)
|
||||
{
|
||||
uint32 limit = 0;
|
||||
std::vector<TravelDestination*> allDestinations = sTravelMgr->getQuestTravelDestinations(bot, questId, true, true, -1);
|
||||
std::vector<TravelDestination*> allDestinations =
|
||||
sTravelMgr->getQuestTravelDestinations(bot, questId, true, true, -1);
|
||||
|
||||
std::sort(allDestinations.begin(), allDestinations.end(), [ptr_botpos](TravelDestination* i, TravelDestination* j) {return i->distanceTo(ptr_botpos) < j->distanceTo(ptr_botpos); });
|
||||
|
||||
for (auto dest : allDestinations)
|
||||
{
|
||||
if (limit > 50)
|
||||
@@ -84,14 +86,13 @@ bool QueryQuestAction::Execute(Event event)
|
||||
uint32 tpoints = dest->getPoints(true).size();
|
||||
uint32 apoints = dest->getPoints().size();
|
||||
|
||||
|
||||
out << round(dest->distanceTo(&botPos));
|
||||
|
||||
out << " to " << dest->getTitle();
|
||||
|
||||
out << " " << apoints;
|
||||
|
||||
if (apoints < tpoints)
|
||||
out << "/" << tpoints;
|
||||
|
||||
out << " points.";
|
||||
|
||||
if (!dest->isActive(bot))
|
||||
@@ -134,12 +135,12 @@ void QueryQuestAction::TellObjectives(uint32 questId)
|
||||
|
||||
if (questTemplate->RequiredNpcOrGo[i] < 0)
|
||||
{
|
||||
if (GameObjectTemplate const* info = sObjectMgr->GetGameObjectTemplate(-questTemplate->RequiredNpcOrGo[i]))
|
||||
if (GameObjectTemplate const* info =
|
||||
sObjectMgr->GetGameObjectTemplate(-questTemplate->RequiredNpcOrGo[i]))
|
||||
TellObjective(info->name, available, required);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
if (CreatureTemplate const* info = sObjectMgr->GetCreatureTemplate(questTemplate->RequiredNpcOrGo[i]))
|
||||
TellObjective(info->Name, available, required);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user