aboutsummaryrefslogtreecommitdiff
path: root/src/game/Item.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/Item.h')
-rw-r--r--src/game/Item.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/game/Item.h b/src/game/Item.h
index 30cf1a595cb..9cae8f67105 100644
--- a/src/game/Item.h
+++ b/src/game/Item.h
@@ -29,6 +29,7 @@
struct SpellEntry;
class Bag;
class QueryResult;
+class Unit;
struct ItemSetEffect
{
@@ -197,6 +198,24 @@ enum ItemUpdateState
ITEM_REMOVED = 3
};
+enum ItemRequiredTargetType
+{
+ ITEM_TARGET_TYPE_CREATURE = 1,
+ ITEM_TARGET_TYPE_DEAD = 2
+};
+
+#define MAX_ITEM_REQ_TARGET_TYPE 2
+
+struct ItemRequiredTarget
+{
+ ItemRequiredTarget(ItemRequiredTargetType uiType, uint32 uiTargetEntry) : m_uiType(uiType), m_uiTargetEntry(uiTargetEntry) {}
+ ItemRequiredTargetType m_uiType;
+ uint32 m_uiTargetEntry;
+
+ // helpers
+ bool IsFitToRequirements(Unit* pUnitTarget) const;
+};
+
bool ItemCanGoIntoBag(ItemPrototype const *proto, ItemPrototype const *pBagProto);
class TRINITY_DLL_SPEC Item : public Object
@@ -232,6 +251,7 @@ class TRINITY_DLL_SPEC Item : public Object
bool IsInTrade() const { return mb_in_trade; }
bool IsFitToSpellRequirements(SpellEntry const* spellInfo) const;
+ bool IsTargetValidForItemUse(Unit* pUnitTarget);
bool IsLimitedToAnotherMapOrZone( uint32 cur_mapId, uint32 cur_zoneId) const;
bool GemsFitSockets() const;
@@ -296,6 +316,7 @@ class TRINITY_DLL_SPEC Item : public Object
bool IsWeaponVellum() const { return GetProto()->IsWeaponVellum(); }
bool IsArmorVellum() const { return GetProto()->IsArmorVellum(); }
bool IsConjuredConsumable() const { return GetProto()->IsConjuredConsumable(); }
+
private:
uint8 m_slot;
Bag *m_container;