mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-01-24 14:06:22 +00:00
[HOT FIX] MS build issues regarding folder / command lenght usage or rc.exe (#2038)
This commit is contained in:
64
src/Ai/Base/Value/ItemUsageValue.h
Normal file
64
src/Ai/Base/Value/ItemUsageValue.h
Normal file
@@ -0,0 +1,64 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license, you may redistribute it
|
||||
* and/or modify it under version 3 of the License, or (at your option), any later version.
|
||||
*/
|
||||
|
||||
#ifndef _PLAYERBOT_ITEMUSAGEVALUE_H
|
||||
#define _PLAYERBOT_ITEMUSAGEVALUE_H
|
||||
|
||||
#include "NamedObjectContext.h"
|
||||
#include "Value.h"
|
||||
|
||||
class Item;
|
||||
class Player;
|
||||
class PlayerbotAI;
|
||||
|
||||
struct ItemTemplate;
|
||||
|
||||
enum ItemUsage : uint32
|
||||
{
|
||||
ITEM_USAGE_NONE = 0,
|
||||
ITEM_USAGE_EQUIP = 1,
|
||||
ITEM_USAGE_REPLACE = 2,
|
||||
ITEM_USAGE_BAD_EQUIP = 3,
|
||||
ITEM_USAGE_BROKEN_EQUIP = 4,
|
||||
ITEM_USAGE_QUEST = 5,
|
||||
ITEM_USAGE_SKILL = 6,
|
||||
ITEM_USAGE_USE = 7,
|
||||
ITEM_USAGE_GUILD_TASK = 8,
|
||||
ITEM_USAGE_DISENCHANT = 9,
|
||||
ITEM_USAGE_AH = 10,
|
||||
ITEM_USAGE_KEEP = 11,
|
||||
ITEM_USAGE_VENDOR = 12,
|
||||
ITEM_USAGE_AMMO = 13
|
||||
};
|
||||
|
||||
class ItemUsageValue : public CalculatedValue<ItemUsage>, public Qualified
|
||||
{
|
||||
public:
|
||||
ItemUsageValue(PlayerbotAI* botAI, std::string const name = "item usage") : CalculatedValue<ItemUsage>(botAI, name)
|
||||
{
|
||||
}
|
||||
|
||||
ItemUsage Calculate() override;
|
||||
|
||||
private:
|
||||
ItemUsage QueryItemUsageForEquip(ItemTemplate const* proto, int32 randomPropertyId = 0);
|
||||
uint32 GetSmallestBagSize();
|
||||
bool IsItemUsefulForQuest(Player* player, ItemTemplate const* proto);
|
||||
bool IsItemNeededForSkill(ItemTemplate const* proto);
|
||||
bool IsItemUsefulForSkill(ItemTemplate const* proto);
|
||||
bool IsItemNeededForUsefullSpell(ItemTemplate const* proto, bool checkAllReagents = false);
|
||||
bool HasItemsNeededForSpell(uint32 spellId, ItemTemplate const* proto);
|
||||
Item* CurrentItem(ItemTemplate const* proto);
|
||||
float CurrentStacks(ItemTemplate const* proto);
|
||||
float BetterStacks(ItemTemplate const* proto, std::string const usageType = "");
|
||||
|
||||
public:
|
||||
static std::vector<uint32> SpellsUsingItem(uint32 itemId, Player* bot);
|
||||
static bool SpellGivesSkillUp(uint32 spellId, Player* bot);
|
||||
|
||||
static std::string const GetConsumableType(ItemTemplate const* proto, bool hasMana);
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user