mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-01-14 09:29:09 +00:00
Run clang-format
This commit is contained in:
@@ -1,11 +1,13 @@
|
||||
/*
|
||||
* 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 "QueryItemUsageAction.h"
|
||||
|
||||
#include "ChatHelper.h"
|
||||
#include "Event.h"
|
||||
#include "ItemUsageValue.h"
|
||||
#include "ChatHelper.h"
|
||||
#include "Playerbots.h"
|
||||
|
||||
bool QueryItemUsageAction::Execute(Event event)
|
||||
@@ -37,10 +39,10 @@ bool QueryItemUsageAction::Execute(Event event)
|
||||
uint32 invCount;
|
||||
uint8 bagSlot;
|
||||
|
||||
data >> received; // 0=looted, 1=from npc
|
||||
data >> created; // 0=received, 1=created
|
||||
data >> isShowChatMessage; // IsShowChatMessage
|
||||
data >> bagSlot; // item slot, but when added to stack: 0xFFFFFFFF
|
||||
data >> received; // 0=looted, 1=from npc
|
||||
data >> created; // 0=received, 1=created
|
||||
data >> isShowChatMessage; // IsShowChatMessage
|
||||
data >> bagSlot; // item slot, but when added to stack: 0xFFFFFFFF
|
||||
|
||||
data >> notUsed;
|
||||
data >> itemId;
|
||||
@@ -127,10 +129,10 @@ std::string const QueryItemUsageAction::QueryItemUsage(ItemTemplate const* item)
|
||||
return "Tradeskill";
|
||||
case ITEM_USAGE_USE:
|
||||
return "Use";
|
||||
case ITEM_USAGE_GUILD_TASK:
|
||||
return "Guild task";
|
||||
case ITEM_USAGE_DISENCHANT:
|
||||
return "Disenchant";
|
||||
case ITEM_USAGE_GUILD_TASK:
|
||||
return "Guild task";
|
||||
case ITEM_USAGE_DISENCHANT:
|
||||
return "Disenchant";
|
||||
case ITEM_USAGE_VENDOR:
|
||||
return "Vendor";
|
||||
case ITEM_USAGE_AH:
|
||||
@@ -139,7 +141,7 @@ std::string const QueryItemUsageAction::QueryItemUsage(ItemTemplate const* item)
|
||||
return "Ammunition";
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
@@ -160,7 +162,8 @@ std::string const QueryItemUsageAction::QueryItemPrice(ItemTemplate const* item)
|
||||
for (std::vector<Item*>::iterator i = items.begin(); i != items.end(); ++i)
|
||||
{
|
||||
Item* sell = *i;
|
||||
int32 price = sell->GetCount() * sell->GetTemplate()->SellPrice * sRandomPlayerbotMgr->GetSellMultiplier(bot);
|
||||
int32 price =
|
||||
sell->GetCount() * sell->GetTemplate()->SellPrice * sRandomPlayerbotMgr->GetSellMultiplier(bot);
|
||||
if (!sellPrice || sellPrice > price)
|
||||
sellPrice = price;
|
||||
}
|
||||
@@ -193,12 +196,13 @@ std::string const QueryItemUsageAction::QueryQuestItem(uint32 itemId)
|
||||
for (QuestStatusMap::const_iterator i = questMap.begin(); i != questMap.end(); i++)
|
||||
{
|
||||
Quest const* questTemplate = sObjectMgr->GetQuestTemplate(i->first);
|
||||
if (!questTemplate )
|
||||
if (!questTemplate)
|
||||
continue;
|
||||
|
||||
uint32 questId = questTemplate->GetQuestId();
|
||||
QuestStatus status = bot->GetQuestStatus(questId);
|
||||
if (status == QUEST_STATUS_INCOMPLETE || (status == QUEST_STATUS_COMPLETE && !bot->GetQuestRewardStatus(questId)))
|
||||
if (status == QUEST_STATUS_INCOMPLETE ||
|
||||
(status == QUEST_STATUS_COMPLETE && !bot->GetQuestRewardStatus(questId)))
|
||||
{
|
||||
QuestStatusData const& questStatus = i->second;
|
||||
std::string const usage = QueryQuestItem(itemId, questTemplate, &questStatus);
|
||||
@@ -210,7 +214,8 @@ std::string const QueryItemUsageAction::QueryQuestItem(uint32 itemId)
|
||||
return "";
|
||||
}
|
||||
|
||||
std::string const QueryItemUsageAction::QueryQuestItem(uint32 itemId, Quest const* questTemplate, QuestStatusData const* questStatus)
|
||||
std::string const QueryItemUsageAction::QueryQuestItem(uint32 itemId, Quest const* questTemplate,
|
||||
QuestStatusData const* questStatus)
|
||||
{
|
||||
for (uint32 i = 0; i < QUEST_OBJECTIVES_COUNT; i++)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user