mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-24 14:16:31 +00:00
refactor(ItemTemplate): add missing enums + other minor improvements (#2236)
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
#include "Common.h"
|
||||
#include "Unit.h"
|
||||
#include "UpdateMask.h"
|
||||
#include "ItemPrototype.h"
|
||||
#include "ItemTemplate.h"
|
||||
#include "LootMgr.h"
|
||||
#include "DatabaseEnv.h"
|
||||
#include "Cell.h"
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#define MAX_BAG_SIZE 36 // 2.0.12
|
||||
|
||||
#include "Item.h"
|
||||
#include "ItemPrototype.h"
|
||||
#include "ItemTemplate.h"
|
||||
|
||||
class Bag : public Item
|
||||
{
|
||||
|
||||
@@ -343,7 +343,7 @@ void Item::SaveToDB(SQLTransaction& trans)
|
||||
|
||||
trans->Append(stmt);
|
||||
|
||||
if ((uState == ITEM_CHANGED) && HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_WRAPPED))
|
||||
if ((uState == ITEM_CHANGED) && HasFlag(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_WRAPPED))
|
||||
{
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GIFT_OWNER);
|
||||
stmt->setUInt32(0, GUID_LOPART(GetOwnerGUID()));
|
||||
@@ -358,7 +358,7 @@ void Item::SaveToDB(SQLTransaction& trans)
|
||||
stmt->setUInt32(0, guid);
|
||||
trans->Append(stmt);
|
||||
|
||||
if (HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_WRAPPED))
|
||||
if (HasFlag(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_WRAPPED))
|
||||
{
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GIFT);
|
||||
stmt->setUInt32(0, guid);
|
||||
@@ -425,7 +425,7 @@ bool Item::LoadFromDB(uint32 guid, uint64 owner_guid, Field* fields, uint32 entr
|
||||
// Remove bind flag for items vs NO_BIND set
|
||||
if (IsSoulBound() && proto->Bonding == NO_BIND)
|
||||
{
|
||||
ApplyModFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_SOULBOUND, false);
|
||||
ApplyModFlag(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_SOULBOUND, false);
|
||||
need_save = true;
|
||||
}
|
||||
|
||||
@@ -442,7 +442,7 @@ bool Item::LoadFromDB(uint32 guid, uint64 owner_guid, Field* fields, uint32 entr
|
||||
// update max durability (and durability) if need
|
||||
// xinef: do not overwrite durability for wrapped items!!
|
||||
SetUInt32Value(ITEM_FIELD_MAXDURABILITY, proto->MaxDurability);
|
||||
if (durability > proto->MaxDurability && !HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_WRAPPED))
|
||||
if (durability > proto->MaxDurability && !HasFlag(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_WRAPPED))
|
||||
{
|
||||
SetUInt32Value(ITEM_FIELD_DURABILITY, proto->MaxDurability);
|
||||
need_save = true;
|
||||
@@ -729,7 +729,7 @@ bool Item::CanBeTraded(bool mail, bool trade) const
|
||||
if (m_lootGenerated)
|
||||
return false;
|
||||
|
||||
if ((!mail || !IsBoundAccountWide()) && (IsSoulBound() && (!HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_BOP_TRADEABLE) || !trade)))
|
||||
if ((!mail || !IsBoundAccountWide()) && (IsSoulBound() && (!HasFlag(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_BOP_TRADEABLE) || !trade)))
|
||||
return false;
|
||||
|
||||
if (IsBag() && (Player::IsBagPos(GetPos()) || !((Bag const*)this)->IsEmpty()))
|
||||
@@ -1048,7 +1048,7 @@ Item* Item::CloneItem(uint32 count, Player const* player) const
|
||||
|
||||
newItem->SetUInt32Value(ITEM_FIELD_CREATOR, GetUInt32Value(ITEM_FIELD_CREATOR));
|
||||
newItem->SetUInt32Value(ITEM_FIELD_GIFTCREATOR, GetUInt32Value(ITEM_FIELD_GIFTCREATOR));
|
||||
newItem->SetUInt32Value(ITEM_FIELD_FLAGS, GetUInt32Value(ITEM_FIELD_FLAGS) & ~(ITEM_FLAG_REFUNDABLE | ITEM_FLAG_BOP_TRADEABLE));
|
||||
newItem->SetUInt32Value(ITEM_FIELD_FLAGS, GetUInt32Value(ITEM_FIELD_FLAGS) & ~(ITEM_FIELD_FLAG_REFUNDABLE | ITEM_FIELD_FLAG_BOP_TRADEABLE));
|
||||
newItem->SetUInt32Value(ITEM_FIELD_DURATION, GetUInt32Value(ITEM_FIELD_DURATION));
|
||||
// player CAN be NULL in which case we must not update random properties because that accesses player's item update queue
|
||||
if (player)
|
||||
@@ -1066,7 +1066,7 @@ bool Item::IsBindedNotWith(Player const* player) const
|
||||
if (GetOwnerGUID() == player->GetGUID())
|
||||
return false;
|
||||
|
||||
if (HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_BOP_TRADEABLE))
|
||||
if (HasFlag(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_BOP_TRADEABLE))
|
||||
if (allowedGUIDs.find(player->GetGUIDLow()) != allowedGUIDs.end())
|
||||
return false;
|
||||
|
||||
@@ -1115,10 +1115,10 @@ void Item::DeleteRefundDataFromDB(SQLTransaction* trans)
|
||||
|
||||
void Item::SetNotRefundable(Player* owner, bool changestate /*=true*/, SQLTransaction* trans /*=NULL*/)
|
||||
{
|
||||
if (!HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_REFUNDABLE))
|
||||
if (!HasFlag(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_REFUNDABLE))
|
||||
return;
|
||||
|
||||
RemoveFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_REFUNDABLE);
|
||||
RemoveFlag(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_REFUNDABLE);
|
||||
// Following is not applicable in the trading procedure
|
||||
if (changestate)
|
||||
SetState(ITEM_CHANGED, owner);
|
||||
@@ -1173,13 +1173,13 @@ bool Item::IsRefundExpired()
|
||||
|
||||
void Item::SetSoulboundTradeable(AllowedLooterSet& allowedLooters)
|
||||
{
|
||||
SetFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_BOP_TRADEABLE);
|
||||
SetFlag(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_BOP_TRADEABLE);
|
||||
allowedGUIDs = allowedLooters;
|
||||
}
|
||||
|
||||
void Item::ClearSoulboundTradeable(Player* currentOwner)
|
||||
{
|
||||
RemoveFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_BOP_TRADEABLE);
|
||||
RemoveFlag(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_BOP_TRADEABLE);
|
||||
if (allowedGUIDs.empty())
|
||||
return;
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#include "Common.h"
|
||||
#include "Object.h"
|
||||
#include "LootMgr.h"
|
||||
#include "ItemPrototype.h"
|
||||
#include "ItemTemplate.h"
|
||||
#include "DatabaseEnv.h"
|
||||
|
||||
class SpellInfo;
|
||||
@@ -209,9 +209,9 @@ class Item : public Object
|
||||
void SetOwnerGUID(uint64 guid) { SetUInt64Value(ITEM_FIELD_OWNER, guid); }
|
||||
Player* GetOwner() const;
|
||||
|
||||
void SetBinding(bool val) { ApplyModFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_SOULBOUND, val); }
|
||||
bool IsSoulBound() const { return HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_SOULBOUND); }
|
||||
bool IsBoundAccountWide() const { return (GetTemplate()->Flags & ITEM_PROTO_FLAG_BIND_TO_ACCOUNT) != 0; }
|
||||
void SetBinding(bool val) { ApplyModFlag(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_SOULBOUND, val); }
|
||||
bool IsSoulBound() const { return HasFlag(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_SOULBOUND); }
|
||||
bool IsBoundAccountWide() const { return (GetTemplate()->Flags & ITEM_FLAG_IS_BOUND_TO_ACCOUNT) != 0; }
|
||||
bool IsBindedNotWith(Player const* player) const;
|
||||
bool IsBoundByEnchant() const;
|
||||
bool IsBoundByTempEnchant() const;
|
||||
@@ -227,7 +227,7 @@ class Item : public Object
|
||||
Bag* ToBag() { if (IsBag()) return reinterpret_cast<Bag*>(this); else return NULL; }
|
||||
const Bag* ToBag() const { if (IsBag()) return reinterpret_cast<const Bag*>(this); else return NULL; }
|
||||
|
||||
bool IsLocked() const { return !HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_UNLOCKED); }
|
||||
bool IsLocked() const { return !HasFlag(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_UNLOCKED); }
|
||||
bool IsBag() const { return GetTemplate()->InventoryType == INVTYPE_BAG; }
|
||||
bool IsCurrencyToken() const { return GetTemplate()->IsCurrencyToken(); }
|
||||
bool IsNotEmptyBag() const;
|
||||
|
||||
@@ -90,87 +90,117 @@ enum ItemBondingType
|
||||
};
|
||||
|
||||
#define MAX_BIND_TYPE 6
|
||||
/* /// @todo: Requiring actual cases in which using (an) item isn't allowed while shapeshifted. Else, this flag would need an implementation.
|
||||
ITEM_FLAG_USE_WHEN_SHAPESHIFTED = 0x00800000, // Item can be used in shapeshift forms */
|
||||
|
||||
/* TODO
|
||||
// need to know cases when using item is not allowed in shapeshift
|
||||
ITEM_PROTO_FLAG_USABLE_WHEN_SHAPESHIFTED = 0x00800000, // Item can be used in shapeshift forms
|
||||
*/
|
||||
|
||||
enum ItemProtoFlags
|
||||
enum ItemFieldFlags : uint32
|
||||
{
|
||||
ITEM_PROTO_FLAG_UNK1 = 0x00000001, // ?
|
||||
ITEM_PROTO_FLAG_CONJURED = 0x00000002, // Conjured item
|
||||
ITEM_PROTO_FLAG_OPENABLE = 0x00000004, // Item can be right clicked to open for loot
|
||||
ITEM_PROTO_FLAG_HEROIC = 0x00000008, // Makes green "Heroic" text appear on item
|
||||
ITEM_PROTO_FLAG_DEPRECATED = 0x00000010, // Cannot equip or use
|
||||
ITEM_PROTO_FLAG_INDESTRUCTIBLE = 0x00000020, // Item can not be destroyed, except by using spell (item can be reagent for spell)
|
||||
ITEM_PROTO_FLAG_UNK2 = 0x00000040, // ?
|
||||
ITEM_PROTO_FLAG_NO_EQUIP_COOLDOWN = 0x00000080, // No default 30 seconds cooldown when equipped
|
||||
ITEM_PROTO_FLAG_UNK3 = 0x00000100, // ?
|
||||
ITEM_PROTO_FLAG_WRAPPER = 0x00000200, // Item can wrap other items
|
||||
ITEM_PROTO_FLAG_UNK4 = 0x00000400, // ?
|
||||
ITEM_PROTO_FLAG_PARTY_LOOT = 0x00000800, // Looting this item does not remove it from available loot
|
||||
ITEM_PROTO_FLAG_REFUNDABLE = 0x00001000, // Item can be returned to vendor for its original cost (extended cost)
|
||||
ITEM_PROTO_FLAG_CHARTER = 0x00002000, // Item is guild or arena charter
|
||||
ITEM_PROTO_FLAG_UNK5 = 0x00004000, // Only readable items have this (but not all)
|
||||
ITEM_PROTO_FLAG_UNK6 = 0x00008000, // ?
|
||||
ITEM_PROTO_FLAG_UNK7 = 0x00010000, // ?
|
||||
ITEM_PROTO_FLAG_UNK8 = 0x00020000, // ?
|
||||
ITEM_PROTO_FLAG_PROSPECTABLE = 0x00040000, // Item can be prospected
|
||||
ITEM_PROTO_FLAG_UNIQUE_EQUIPPED = 0x00080000, // You can only equip one of these
|
||||
ITEM_PROTO_FLAG_UNK9 = 0x00100000, // ?
|
||||
ITEM_PROTO_FLAG_USEABLE_IN_ARENA = 0x00200000, // Item can be used during arena match
|
||||
ITEM_PROTO_FLAG_THROWABLE = 0x00400000, // Some Thrown weapons have it (and only Thrown) but not all
|
||||
ITEM_PROTO_FLAG_USABLE_WHEN_SHAPESHIFTED = 0x00800000, // Item can be used in shapeshift forms
|
||||
ITEM_PROTO_FLAG_UNK10 = 0x01000000, // ?
|
||||
ITEM_PROTO_FLAG_SMART_LOOT = 0x02000000, // Profession recipes: can only be looted if you meet requirements and don't already know it
|
||||
ITEM_PROTO_FLAG_NOT_USEABLE_IN_ARENA = 0x04000000, // Item cannot be used in arena
|
||||
ITEM_PROTO_FLAG_BIND_TO_ACCOUNT = 0x08000000, // Item binds to account and can be sent only to your own characters
|
||||
ITEM_PROTO_FLAG_TRIGGERED_CAST = 0x10000000, // Spell is cast with triggered flag
|
||||
ITEM_PROTO_FLAG_MILLABLE = 0x20000000, // Item can be milled
|
||||
ITEM_PROTO_FLAG_UNK11 = 0x40000000, // ?
|
||||
ITEM_PROTO_FLAG_UNK12 = 0x80000000 // ?
|
||||
ITEM_FIELD_FLAG_SOULBOUND = 0x00000001, // Item is soulbound and cannot be traded <<--
|
||||
ITEM_FIELD_FLAG_UNK1 = 0x00000002, // ?
|
||||
ITEM_FIELD_FLAG_UNLOCKED = 0x00000004, // Item had lock but can be opened now
|
||||
ITEM_FIELD_FLAG_WRAPPED = 0x00000008, // Item is wrapped and contains another item
|
||||
ITEM_FIELD_FLAG_UNK2 = 0x00000010, // ?
|
||||
ITEM_FIELD_FLAG_UNK3 = 0x00000020, // ?
|
||||
ITEM_FIELD_FLAG_UNK4 = 0x00000040, // ?
|
||||
ITEM_FIELD_FLAG_UNK5 = 0x00000080, // ?
|
||||
ITEM_FIELD_FLAG_BOP_TRADEABLE = 0x00000100, // Allows trading soulbound items
|
||||
ITEM_FIELD_FLAG_READABLE = 0x00000200, // Opens text page when right clicked
|
||||
ITEM_FIELD_FLAG_UNK6 = 0x00000400, // ?
|
||||
ITEM_FIELD_FLAG_UNK7 = 0x00000800, // ?
|
||||
ITEM_FIELD_FLAG_REFUNDABLE = 0x00001000, // Item can be returned to vendor for its original cost (extended cost)
|
||||
ITEM_FIELD_FLAG_UNK8 = 0x00002000, // ?
|
||||
ITEM_FIELD_FLAG_UNK9 = 0x00004000, // ?
|
||||
ITEM_FIELD_FLAG_UNK10 = 0x00008000, // ?
|
||||
ITEM_FIELD_FLAG_UNK11 = 0x00010000, // ?
|
||||
ITEM_FIELD_FLAG_UNK12 = 0x00020000, // ?
|
||||
ITEM_FIELD_FLAG_UNK13 = 0x00040000, // ?
|
||||
ITEM_FIELD_FLAG_UNK14 = 0x00080000, // ?
|
||||
ITEM_FIELD_FLAG_UNK15 = 0x00100000, // ?
|
||||
ITEM_FIELD_FLAG_UNK16 = 0x00200000, // ?
|
||||
ITEM_FIELD_FLAG_UNK17 = 0x00400000, // ?
|
||||
ITEM_FIELD_FLAG_UNK18 = 0x00800000, // ?
|
||||
ITEM_FIELD_FLAG_UNK19 = 0x01000000, // ?
|
||||
ITEM_FIELD_FLAG_UNK20 = 0x02000000, // ?
|
||||
ITEM_FIELD_FLAG_UNK21 = 0x04000000, // ?
|
||||
ITEM_FIELD_FLAG_UNK22 = 0x08000000, // ?
|
||||
ITEM_FIELD_FLAG_UNK23 = 0x10000000, // ?
|
||||
ITEM_FIELD_FLAG_UNK24 = 0x20000000, // ?
|
||||
ITEM_FIELD_FLAG_UNK25 = 0x40000000, // ?
|
||||
ITEM_FIELD_FLAG_UNK26 = 0x80000000, // ?
|
||||
|
||||
ITEM_FLAG_MAIL_TEXT_MASK = ITEM_FIELD_FLAG_READABLE | ITEM_FIELD_FLAG_UNK13 | ITEM_FIELD_FLAG_UNK14
|
||||
};
|
||||
|
||||
/* TODO
|
||||
*/
|
||||
|
||||
enum ItemFieldFlags
|
||||
enum ItemFlags : uint32
|
||||
{
|
||||
ITEM_FLAG_SOULBOUND = 0x00000001, // Item is soulbound and cannot be traded <<--
|
||||
ITEM_FLAG_UNK1 = 0x00000002, // ?
|
||||
ITEM_FLAG_UNLOCKED = 0x00000004, // Item had lock but can be opened now
|
||||
ITEM_FLAG_WRAPPED = 0x00000008, // Item is wrapped and contains another item
|
||||
ITEM_FLAG_UNK2 = 0x00000010, // ?
|
||||
ITEM_FLAG_UNK3 = 0x00000020, // ?
|
||||
ITEM_FLAG_UNK4 = 0x00000040, // ?
|
||||
ITEM_FLAG_UNK5 = 0x00000080, // ?
|
||||
ITEM_FLAG_BOP_TRADEABLE = 0x00000100, // Allows trading soulbound items
|
||||
ITEM_FLAG_READABLE = 0x00000200, // Opens text page when right clicked
|
||||
ITEM_FLAG_UNK6 = 0x00000400, // ?
|
||||
ITEM_FLAG_UNK7 = 0x00000800, // ?
|
||||
ITEM_FLAG_REFUNDABLE = 0x00001000, // Item can be returned to vendor for its original cost (extended cost)
|
||||
ITEM_FLAG_UNK8 = 0x00002000, // ?
|
||||
ITEM_FLAG_UNK9 = 0x00004000, // ?
|
||||
ITEM_FLAG_UNK10 = 0x00008000, // ?
|
||||
ITEM_FLAG_UNK11 = 0x00010000, // ?
|
||||
ITEM_FLAG_NO_CREATOR = 0x00020000,
|
||||
ITEM_FLAG_UNK13 = 0x00040000, // ?
|
||||
ITEM_FLAG_UNK14 = 0x00080000, // ?
|
||||
ITEM_FLAG_UNK15 = 0x00100000, // ?
|
||||
ITEM_FLAG_UNK16 = 0x00200000, // ?
|
||||
ITEM_FLAG_UNK17 = 0x00400000, // ?
|
||||
ITEM_FLAG_UNK18 = 0x00800000, // ?
|
||||
ITEM_FLAG_UNK19 = 0x01000000, // ?
|
||||
ITEM_FLAG_UNK20 = 0x02000000, // ?
|
||||
ITEM_FLAG_UNK21 = 0x04000000, // ?
|
||||
ITEM_FLAG_UNK22 = 0x08000000, // ?
|
||||
ITEM_FLAG_UNK23 = 0x10000000, // ?
|
||||
ITEM_FLAG_UNK24 = 0x20000000, // ?
|
||||
ITEM_FLAG_UNK25 = 0x40000000, // ?
|
||||
ITEM_FLAG_UNK26 = 0x80000000, // ?
|
||||
ITEM_FLAG_NO_PICKUP = 0x00000001,
|
||||
ITEM_FLAG_CONJURED = 0x00000002, // Conjured item
|
||||
ITEM_FLAG_HAS_LOOT = 0x00000004, // Item can be right clicked to open for loot
|
||||
ITEM_FLAG_HEROIC_TOOLTIP = 0x00000008, // Makes green "Heroic" text appear on item
|
||||
ITEM_FLAG_DEPRECATED = 0x00000010, // Cannot equip or use
|
||||
ITEM_FLAG_NO_USER_DESTROY = 0x00000020, // Item can not be destroyed, except by using spell (item can be reagent for spell)
|
||||
ITEM_FLAG_PLAYERCAST = 0x00000040, // Item's spells are castable by players
|
||||
ITEM_FLAG_NO_EQUIP_COOLDOWN = 0x00000080, // No default 30 seconds cooldown when equipped
|
||||
ITEM_FLAG_MULTI_LOOT_QUEST = 0x00000100,
|
||||
ITEM_FLAG_IS_WRAPPER = 0x00000200, // Item can wrap other items
|
||||
ITEM_FLAG_USES_RESOURCES = 0x00000400,
|
||||
ITEM_FLAG_MULTI_DROP = 0x00000800, // Looting this item does not remove it from available loot
|
||||
ITEM_FLAG_ITEM_PURCHASE_RECORD = 0x00001000, // Item can be returned to vendor for its original cost (extended cost)
|
||||
ITEM_FLAG_PETITION = 0x00002000, // Item is guild or arena charter
|
||||
ITEM_FLAG_HAS_TEXT = 0x00004000, // Only readable items have this (but not all)
|
||||
ITEM_FLAG_NO_DISENCHANT = 0x00008000,
|
||||
ITEM_FLAG_REAL_DURATION = 0x00010000,
|
||||
ITEM_FLAG_NO_CREATOR = 0x00020000,
|
||||
ITEM_FLAG_IS_PROSPECTABLE = 0x00040000, // Item can be prospected
|
||||
ITEM_FLAG_UNIQUE_EQUIPPABLE = 0x00080000, // You can only equip one of these
|
||||
ITEM_FLAG_IGNORE_FOR_AURAS = 0x00100000,
|
||||
ITEM_FLAG_IGNORE_DEFAULT_ARENA_RESTRICTIONS = 0x00200000, // Item can be used during arena match
|
||||
ITEM_FLAG_NO_DURABILITY_LOSS = 0x00400000, // Some Thrown weapons have it (and only Thrown) but not all
|
||||
ITEM_FLAG_USE_WHEN_SHAPESHIFTED = 0x00800000, // Item can be used in shapeshift forms
|
||||
ITEM_FLAG_HAS_QUEST_GLOW = 0x01000000,
|
||||
ITEM_FLAG_HIDE_UNUSABLE_RECIPE = 0x02000000, // Profession recipes: can only be looted if you meet requirements and don't already know it
|
||||
ITEM_FLAG_NOT_USEABLE_IN_ARENA = 0x04000000, // Item cannot be used in arena
|
||||
ITEM_FLAG_IS_BOUND_TO_ACCOUNT = 0x08000000, // Item binds to account and can be sent only to your own characters
|
||||
ITEM_FLAG_NO_REAGENT_COST = 0x10000000, // Spell is cast ignoring reagents
|
||||
ITEM_FLAG_IS_MILLABLE = 0x20000000, // Item can be milled
|
||||
ITEM_FLAG_REPORT_TO_GUILD_CHAT = 0x40000000,
|
||||
ITEM_FLAG_NO_PROGRESSIVE_LOOT = 0x80000000
|
||||
};
|
||||
|
||||
ITEM_FLAG_MAIL_TEXT_MASK = ITEM_FLAG_READABLE | ITEM_FLAG_UNK13 | ITEM_FLAG_UNK14,
|
||||
enum ItemFlags2 : uint32
|
||||
{
|
||||
ITEM_FLAG2_FACTION_HORDE = 0x00000001,
|
||||
ITEM_FLAG2_FACTION_ALLIANCE = 0x00000002,
|
||||
ITEM_FLAG2_DONT_IGNORE_BUY_PRICE = 0x00000004, // when item uses extended cost, gold is also required
|
||||
ITEM_FLAG2_CLASSIFY_AS_CASTER = 0x00000008,
|
||||
ITEM_FLAG2_CLASSIFY_AS_PHYSICAL = 0x00000010,
|
||||
ITEM_FLAG2_EVERYONE_CAN_ROLL_NEED = 0x00000020,
|
||||
ITEM_FLAG2_NO_TRADE_BIND_ON_ACQUIRE = 0x00000040,
|
||||
ITEM_FLAG2_CAN_TRADE_BIND_ON_ACQUIRE = 0x00000080,
|
||||
ITEM_FLAG2_CAN_ONLY_ROLL_GREED = 0x00000100,
|
||||
ITEM_FLAG2_CASTER_WEAPON = 0x00000200,
|
||||
ITEM_FLAG2_DELETE_ON_LOGIN = 0x00000400,
|
||||
ITEM_FLAG2_INTERNAL_ITEM = 0x00000800,
|
||||
ITEM_FLAG2_NO_VENDOR_VALUE = 0x00001000,
|
||||
ITEM_FLAG2_SHOW_BEFORE_DISCOVERED = 0x00002000,
|
||||
ITEM_FLAG2_OVERRIDE_GOLD_COST = 0x00004000,
|
||||
ITEM_FLAG2_IGNORE_DEFAULT_RATED_BG_RESTRICTIONS = 0x00008000,
|
||||
ITEM_FLAG2_NOT_USABLE_IN_RATED_BG = 0x00010000,
|
||||
ITEM_FLAG2_BNET_ACCOUNT_TRADE_OK = 0x00020000,
|
||||
ITEM_FLAG2_CONFIRM_BEFORE_USE = 0x00040000,
|
||||
ITEM_FLAG2_REEVALUATE_BONDING_ON_TRANSFORM = 0x00080000,
|
||||
ITEM_FLAG2_NO_TRANSFORM_ON_CHARGE_DEPLETION = 0x00100000,
|
||||
ITEM_FLAG2_NO_ALTER_ITEM_VISUAL = 0x00200000,
|
||||
ITEM_FLAG2_NO_SOURCE_FOR_ITEM_VISUAL = 0x00400000,
|
||||
ITEM_FLAG2_IGNORE_QUALITY_FOR_ITEM_VISUAL_SOURCE = 0x00800000,
|
||||
ITEM_FLAG2_NO_DURABILITY = 0x01000000,
|
||||
ITEM_FLAG2_ROLE_TANK = 0x02000000,
|
||||
ITEM_FLAG2_ROLE_HEALER = 0x04000000,
|
||||
ITEM_FLAG2_ROLE_DAMAGE = 0x08000000,
|
||||
ITEM_FLAG2_CAN_DROP_IN_CHALLENGE_MODE = 0x10000000,
|
||||
ITEM_FLAG2_NEVER_STACK_IN_LOOT_UI = 0x20000000,
|
||||
ITEM_FLAG2_DISENCHANT_TO_LOOT_TABLE = 0x40000000,
|
||||
ITEM_FLAG2_USED_IN_A_TRADESKILL = 0x80000000
|
||||
};
|
||||
|
||||
enum ItemFlagsExtra
|
||||
@@ -527,8 +557,8 @@ inline uint8 ItemSubClassToDurabilityMultiplierId(uint32 ItemClass, uint32 ItemS
|
||||
{
|
||||
case ITEM_CLASS_WEAPON: return ItemSubClass;
|
||||
case ITEM_CLASS_ARMOR: return ItemSubClass + 21;
|
||||
default: return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
// GCC have alternative #pragma pack(N) syntax and old gcc version not support pack(push, N), also any gcc version not support it at some platform
|
||||
@@ -700,8 +730,8 @@ struct ItemTemplate
|
||||
if (Delay == 0)
|
||||
return 0;
|
||||
float temp = 0;
|
||||
for (uint8 i = 0; i < MAX_ITEM_PROTO_DAMAGES; ++i)
|
||||
temp+=Damage[i].DamageMin + Damage[i].DamageMax;
|
||||
for (auto i : Damage)
|
||||
temp+=i.DamageMin + i.DamageMax;
|
||||
return temp*500/Delay;
|
||||
}
|
||||
|
||||
@@ -720,7 +750,7 @@ struct ItemTemplate
|
||||
|
||||
float GetItemLevelIncludingQuality(uint8 pLevel) const
|
||||
{
|
||||
float itemLevel = (float)ItemLevel;
|
||||
auto itemLevel = (float)ItemLevel;
|
||||
switch (Quality)
|
||||
{
|
||||
case ITEM_QUALITY_POOR:
|
||||
@@ -781,7 +811,7 @@ struct ItemTemplate
|
||||
bool IsPotion() const { return Class == ITEM_CLASS_CONSUMABLE && SubClass == ITEM_SUBCLASS_POTION; }
|
||||
bool IsWeaponVellum() const { return Class == ITEM_CLASS_TRADE_GOODS && SubClass == ITEM_SUBCLASS_WEAPON_ENCHANTMENT; }
|
||||
bool IsArmorVellum() const { return Class == ITEM_CLASS_TRADE_GOODS && SubClass == ITEM_SUBCLASS_ARMOR_ENCHANTMENT; }
|
||||
bool IsConjuredConsumable() const { return Class == ITEM_CLASS_CONSUMABLE && (Flags & ITEM_PROTO_FLAG_CONJURED); }
|
||||
bool IsConjuredConsumable() const { return Class == ITEM_CLASS_CONSUMABLE && (Flags & ITEM_FLAG_CONJURED); }
|
||||
|
||||
void InitializeQueryData();
|
||||
};
|
||||
@@ -13018,7 +13018,7 @@ void Player::MoveItemToInventory(ItemPosCountVec const& dest, Item* pItem, bool
|
||||
// in case trade we already have item in other player inventory
|
||||
pLastItem->SetState(in_characterInventoryDB ? ITEM_CHANGED : ITEM_NEW, this);
|
||||
|
||||
if (pLastItem->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_BOP_TRADEABLE))
|
||||
if (pLastItem->HasFlag(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_BOP_TRADEABLE))
|
||||
AddTradeableItem(pLastItem);
|
||||
}
|
||||
}
|
||||
@@ -13037,7 +13037,7 @@ void Player::DestroyItem(uint8 bag, uint8 slot, bool update)
|
||||
for (uint8 i = 0; i < MAX_BAG_SIZE; ++i)
|
||||
DestroyItem(slot, i, update);
|
||||
|
||||
if (pItem->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_WRAPPED))
|
||||
if (pItem->HasFlag(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_WRAPPED))
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GIFT);
|
||||
|
||||
@@ -13109,7 +13109,7 @@ void Player::DestroyItem(uint8 bag, uint8 slot, bool update)
|
||||
pBag->RemoveItem(slot, update);
|
||||
|
||||
// Xinef: item is removed, remove loot from storage if any
|
||||
if (proto->Flags & ITEM_PROTO_FLAG_OPENABLE)
|
||||
if (proto->Flags & ITEM_FLAG_HAS_LOOT)
|
||||
sLootItemStorage->RemoveStoredLoot(pItem->GetGUIDLow());
|
||||
|
||||
if (IsInWorld() && update)
|
||||
@@ -18772,7 +18772,7 @@ Item* Player::_LoadItem(SQLTransaction& trans, uint32 zoneId, uint32 timeDiff, F
|
||||
remove = true;
|
||||
}
|
||||
// "Conjured items disappear if you are logged out for more than 15 minutes"
|
||||
else if (timeDiff > 15 * MINUTE && proto->Flags & ITEM_PROTO_FLAG_CONJURED)
|
||||
else if (timeDiff > 15 * MINUTE && proto->Flags & ITEM_FLAG_CONJURED)
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
sLog->outDebug(LOG_FILTER_PLAYER_LOADING, "Player::_LoadInventory: player (GUID: %u, name: '%s', diff: %u) has conjured item (GUID: %u, entry: %u) with expired lifetime (15 minutes). Deleting item.",
|
||||
@@ -18780,7 +18780,7 @@ Item* Player::_LoadItem(SQLTransaction& trans, uint32 zoneId, uint32 timeDiff, F
|
||||
#endif
|
||||
remove = true;
|
||||
}
|
||||
else if (item->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_REFUNDABLE))
|
||||
else if (item->HasFlag(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_REFUNDABLE))
|
||||
{
|
||||
if (item->GetPlayedTime() > (2 * HOUR))
|
||||
{
|
||||
@@ -18792,7 +18792,7 @@ Item* Player::_LoadItem(SQLTransaction& trans, uint32 zoneId, uint32 timeDiff, F
|
||||
stmt->setUInt32(0, item->GetGUIDLow());
|
||||
trans->Append(stmt);
|
||||
|
||||
item->RemoveFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_REFUNDABLE);
|
||||
item->RemoveFlag(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_REFUNDABLE);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -18813,11 +18813,11 @@ Item* Player::_LoadItem(SQLTransaction& trans, uint32 zoneId, uint32 timeDiff, F
|
||||
sLog->outDebug(LOG_FILTER_PLAYER_LOADING, "Player::_LoadInventory: player (GUID: %u, name: '%s') has item (GUID: %u, entry: %u) with refundable flags, but without data in item_refund_instance. Removing flag.",
|
||||
GetGUIDLow(), GetName().c_str(), item->GetGUIDLow(), item->GetEntry());
|
||||
#endif
|
||||
item->RemoveFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_REFUNDABLE);
|
||||
item->RemoveFlag(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_REFUNDABLE);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (item->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_BOP_TRADEABLE))
|
||||
else if (item->HasFlag(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_BOP_TRADEABLE))
|
||||
{
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_ITEM_BOP_TRADE);
|
||||
stmt->setUInt32(0, item->GetGUIDLow());
|
||||
@@ -18840,10 +18840,10 @@ Item* Player::_LoadItem(SQLTransaction& trans, uint32 zoneId, uint32 timeDiff, F
|
||||
else
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
sLog->outDebug(LOG_FILTER_PLAYER_LOADING, "Player::_LoadInventory: player (GUID: %u, name: '%s') has item (GUID: %u, entry: %u) with ITEM_FLAG_BOP_TRADEABLE flag, but without data in item_soulbound_trade_data. Removing flag.",
|
||||
sLog->outDebug(LOG_FILTER_PLAYER_LOADING, "Player::_LoadInventory: player (GUID: %u, name: '%s') has item (GUID: %u, entry: %u) with ITEM_FIELD_FLAG_BOP_TRADEABLE flag, but without data in item_soulbound_trade_data. Removing flag.",
|
||||
GetGUIDLow(), GetName().c_str(), item->GetGUIDLow(), item->GetEntry());
|
||||
#endif
|
||||
item->RemoveFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_BOP_TRADEABLE);
|
||||
item->RemoveFlag(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_BOP_TRADEABLE);
|
||||
}
|
||||
}
|
||||
else if (proto->HolidayId)
|
||||
@@ -19868,7 +19868,7 @@ void Player::_SaveInventory(SQLTransaction& trans)
|
||||
if (item->GetState() == ITEM_NEW)
|
||||
{
|
||||
// Xinef: item is removed, remove loot from storage if any
|
||||
if (item->GetTemplate()->Flags & ITEM_PROTO_FLAG_OPENABLE)
|
||||
if (item->GetTemplate()->Flags & ITEM_FLAG_HAS_LOOT)
|
||||
sLootItemStorage->RemoveStoredLoot(item->GetGUIDLow());
|
||||
continue;
|
||||
}
|
||||
@@ -19883,7 +19883,7 @@ void Player::_SaveInventory(SQLTransaction& trans)
|
||||
m_items[i]->FSetState(ITEM_NEW);
|
||||
|
||||
// Xinef: item is removed, remove loot from storage if any
|
||||
if (item->GetTemplate()->Flags & ITEM_PROTO_FLAG_OPENABLE)
|
||||
if (item->GetTemplate()->Flags & ITEM_FLAG_HAS_LOOT)
|
||||
sLootItemStorage->RemoveStoredLoot(item->GetGUIDLow());
|
||||
}
|
||||
|
||||
@@ -22004,9 +22004,9 @@ inline bool Player::_StoreOrEquipNewItem(uint32 vendorslot, uint32 item, uint8 c
|
||||
if (!bStore)
|
||||
AutoUnequipOffhandIfNeed();
|
||||
|
||||
if (pProto->Flags & ITEM_PROTO_FLAG_REFUNDABLE && crItem->ExtendedCost && pProto->GetMaxStackSize() == 1)
|
||||
if (pProto->Flags & ITEM_FLAG_ITEM_PURCHASE_RECORD && crItem->ExtendedCost && pProto->GetMaxStackSize() == 1)
|
||||
{
|
||||
it->SetFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_REFUNDABLE);
|
||||
it->SetFlag(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_REFUNDABLE);
|
||||
it->SetRefundRecipient(GetGUIDLow());
|
||||
it->SetPaidMoney(price);
|
||||
it->SetPaidExtendedCost(crItem->ExtendedCost);
|
||||
@@ -23328,7 +23328,7 @@ void Player::SendInstanceResetWarning(uint32 mapid, Difficulty difficulty, uint3
|
||||
|
||||
void Player::ApplyEquipCooldown(Item* pItem)
|
||||
{
|
||||
if (pItem->HasFlag(ITEM_FIELD_FLAGS, ITEM_PROTO_FLAG_NO_EQUIP_COOLDOWN))
|
||||
if (pItem->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_NO_EQUIP_COOLDOWN))
|
||||
return;
|
||||
|
||||
for (uint8 i = 0; i < MAX_ITEM_PROTO_SPELLS; ++i)
|
||||
@@ -25457,7 +25457,7 @@ InventoryResult Player::CanEquipUniqueItem(Item* pItem, uint8 eslot, uint32 limi
|
||||
InventoryResult Player::CanEquipUniqueItem(ItemTemplate const* itemProto, uint8 except_slot, uint32 limit_count) const
|
||||
{
|
||||
// check unique-equipped on item
|
||||
if (itemProto->Flags & ITEM_PROTO_FLAG_UNIQUE_EQUIPPED)
|
||||
if (itemProto->Flags & ITEM_FLAG_UNIQUE_EQUIPPABLE)
|
||||
{
|
||||
// there is an equip limit on this item
|
||||
if (HasItemOrGemWithIdEquipped(itemProto->ItemId, 1, except_slot))
|
||||
@@ -27116,7 +27116,7 @@ void Player::SendRefundInfo(Item* item)
|
||||
// This function call unsets ITEM_FLAGS_REFUNDABLE if played time is over 2 hours.
|
||||
item->UpdatePlayedTime(this);
|
||||
|
||||
if (!item->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_REFUNDABLE))
|
||||
if (!item->HasFlag(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_REFUNDABLE))
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "Item refund: item not refundable!");
|
||||
@@ -27182,7 +27182,7 @@ bool Player::AddItem(uint32 itemId, uint32 count)
|
||||
|
||||
void Player::RefundItem(Item* item)
|
||||
{
|
||||
if (!item->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_REFUNDABLE))
|
||||
if (!item->HasFlag(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_REFUNDABLE))
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "Item refund: item not refundable!");
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
#include "TemporarySummon.h"
|
||||
#include "Corpse.h"
|
||||
#include "QuestDef.h"
|
||||
#include "ItemPrototype.h"
|
||||
#include "ItemTemplate.h"
|
||||
#include "NPCHandler.h"
|
||||
#include "DatabaseEnv.h"
|
||||
#include "Mail.h"
|
||||
|
||||
@@ -202,7 +202,7 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recvData)
|
||||
itemEntry = item->GetTemplate()->ItemId;
|
||||
|
||||
if (sAuctionMgr->GetAItem(item->GetGUIDLow()) || !item->CanBeTraded() || item->IsNotEmptyBag() ||
|
||||
item->GetTemplate()->Flags & ITEM_PROTO_FLAG_CONJURED || item->GetUInt32Value(ITEM_FIELD_DURATION) ||
|
||||
item->GetTemplate()->Flags & ITEM_FLAG_CONJURED || item->GetUInt32Value(ITEM_FIELD_DURATION) ||
|
||||
item->GetCount() < count[i] || itemEntry != item->GetTemplate()->ItemId)
|
||||
{
|
||||
SendAuctionCommandResult(0, AUCTION_SELL_ITEM, ERR_AUCTION_DATABASE_ERROR);
|
||||
|
||||
@@ -277,7 +277,7 @@ void WorldSession::HandleDestroyItemOpcode(WorldPacket & recvData)
|
||||
return;
|
||||
}
|
||||
|
||||
if (pItem->GetTemplate()->Flags & ITEM_PROTO_FLAG_INDESTRUCTIBLE)
|
||||
if (pItem->GetTemplate()->Flags & ITEM_FLAG_NO_USER_DESTROY)
|
||||
{
|
||||
_player->SendEquipError(EQUIP_ERR_CANT_DROP_SOULBOUND, NULL, NULL);
|
||||
return;
|
||||
@@ -676,7 +676,7 @@ void WorldSession::HandleSellItemOpcode(WorldPacket & recvData)
|
||||
// prevent selling item for sellprice when the item is still refundable
|
||||
// this probably happens when right clicking a refundable item, the client sends both
|
||||
// CMSG_SELL_ITEM and CMSG_REFUND_ITEM (unverified)
|
||||
if (pItem->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_REFUNDABLE))
|
||||
if (pItem->HasFlag(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_REFUNDABLE))
|
||||
return; // Therefore, no feedback to client
|
||||
|
||||
// special case at auto sell (sell all)
|
||||
@@ -1270,7 +1270,7 @@ void WorldSession::HandleWrapItemOpcode(WorldPacket& recvData)
|
||||
return;
|
||||
}
|
||||
|
||||
if (!(gift->GetTemplate()->Flags & ITEM_PROTO_FLAG_WRAPPER)) // cheating: non-wrapper wrapper
|
||||
if (!(gift->GetTemplate()->Flags & ITEM_FLAG_IS_WRAPPER)) // cheating: non-wrapper wrapper
|
||||
{
|
||||
_player->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, gift, NULL);
|
||||
return;
|
||||
@@ -1355,7 +1355,7 @@ void WorldSession::HandleWrapItemOpcode(WorldPacket& recvData)
|
||||
case 21830: item->SetEntry(21831); break;
|
||||
}
|
||||
item->SetUInt64Value(ITEM_FIELD_GIFTCREATOR, _player->GetGUID());
|
||||
item->SetUInt32Value(ITEM_FIELD_FLAGS, ITEM_FLAG_WRAPPED);
|
||||
item->SetUInt32Value(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_WRAPPED);
|
||||
item->SetState(ITEM_CHANGED, _player);
|
||||
|
||||
// after save it will be impossible to remove the item from the queue
|
||||
@@ -1455,7 +1455,7 @@ void WorldSession::HandleSocketOpcode(WorldPacket& recvData)
|
||||
ItemTemplate const* iGemProto = Gems[i]->GetTemplate();
|
||||
|
||||
// unique item (for new and already placed bit removed enchantments
|
||||
if (iGemProto->Flags & ITEM_PROTO_FLAG_UNIQUE_EQUIPPED)
|
||||
if (iGemProto->Flags & ITEM_FLAG_UNIQUE_EQUIPPABLE)
|
||||
{
|
||||
for (int j = 0; j < MAX_GEM_SOCKETS; ++j)
|
||||
{
|
||||
|
||||
@@ -346,7 +346,7 @@ void WorldSession::DoLootRelease(uint64 lguid)
|
||||
ItemTemplate const* proto = pItem->GetTemplate();
|
||||
|
||||
// destroy only 5 items from stack in case prospecting and milling
|
||||
if (proto->Flags & (ITEM_PROTO_FLAG_PROSPECTABLE | ITEM_PROTO_FLAG_MILLABLE))
|
||||
if (proto->Flags & (ITEM_FLAG_IS_PROSPECTABLE | ITEM_FLAG_IS_MILLABLE))
|
||||
{
|
||||
pItem->m_lootGenerated = false;
|
||||
pItem->loot.clear();
|
||||
@@ -359,7 +359,7 @@ void WorldSession::DoLootRelease(uint64 lguid)
|
||||
|
||||
player->DestroyItemCount(pItem, count, true);
|
||||
}
|
||||
else if (pItem->loot.isLooted() || !(proto->Flags & ITEM_PROTO_FLAG_OPENABLE))
|
||||
else if (pItem->loot.isLooted() || !(proto->Flags & ITEM_FLAG_HAS_LOOT))
|
||||
{
|
||||
player->DestroyItem(pItem->GetBagSlot(), pItem->GetSlot(), true);
|
||||
return;
|
||||
|
||||
@@ -169,7 +169,7 @@ void WorldSession::HandleSendMail(WorldPacket & recvData)
|
||||
if (item)
|
||||
{
|
||||
ItemTemplate const* itemProto = item->GetTemplate();
|
||||
if (!itemProto || !(itemProto->Flags & ITEM_PROTO_FLAG_BIND_TO_ACCOUNT))
|
||||
if (!itemProto || !(itemProto->Flags & ITEM_FLAG_IS_BOUND_TO_ACCOUNT))
|
||||
{
|
||||
accountBound = false;
|
||||
break;
|
||||
@@ -218,13 +218,13 @@ void WorldSession::HandleSendMail(WorldPacket & recvData)
|
||||
return;
|
||||
}
|
||||
|
||||
if (item->GetTemplate()->Flags & ITEM_PROTO_FLAG_CONJURED || item->GetUInt32Value(ITEM_FIELD_DURATION))
|
||||
if (item->GetTemplate()->Flags & ITEM_FLAG_CONJURED || item->GetUInt32Value(ITEM_FIELD_DURATION))
|
||||
{
|
||||
player->SendMailResult(0, MAIL_SEND, MAIL_ERR_EQUIP_ERROR, EQUIP_ERR_MAIL_BOUND_ITEM);
|
||||
return;
|
||||
}
|
||||
|
||||
if (COD && item->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_WRAPPED))
|
||||
if (COD && item->HasFlag(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_WRAPPED))
|
||||
{
|
||||
player->SendMailResult(0, MAIL_SEND, MAIL_ERR_CANT_SEND_WRAPPED_COD);
|
||||
return;
|
||||
|
||||
@@ -111,14 +111,14 @@ void WorldSession::HandleUseItemOpcode(WorldPacket& recvPacket)
|
||||
}
|
||||
|
||||
// only allow conjured consumable, bandage, poisons (all should have the 2^21 item flag set in DB)
|
||||
if (proto->Class == ITEM_CLASS_CONSUMABLE && !(proto->Flags & ITEM_PROTO_FLAG_USEABLE_IN_ARENA) && pUser->InArena())
|
||||
if (proto->Class == ITEM_CLASS_CONSUMABLE && !(proto->Flags & ITEM_FLAG_IGNORE_DEFAULT_ARENA_RESTRICTIONS) && pUser->InArena())
|
||||
{
|
||||
pUser->SendEquipError(EQUIP_ERR_NOT_DURING_ARENA_MATCH, pItem, NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
// don't allow items banned in arena
|
||||
if (proto->Flags & ITEM_PROTO_FLAG_NOT_USEABLE_IN_ARENA && pUser->InArena())
|
||||
if (proto->Flags & ITEM_FLAG_NOT_USEABLE_IN_ARENA && pUser->InArena())
|
||||
{
|
||||
pUser->SendEquipError(EQUIP_ERR_NOT_DURING_ARENA_MATCH, pItem, NULL);
|
||||
return;
|
||||
@@ -204,7 +204,7 @@ void WorldSession::HandleOpenItemOpcode(WorldPacket& recvPacket)
|
||||
}
|
||||
|
||||
// Verify that the bag is an actual bag or wrapped item that can be used "normally"
|
||||
if (!(proto->Flags & ITEM_PROTO_FLAG_OPENABLE) && !item->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_WRAPPED))
|
||||
if (!(proto->Flags & ITEM_FLAG_HAS_LOOT) && !item->HasFlag(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_WRAPPED))
|
||||
{
|
||||
pUser->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, item, NULL);
|
||||
sLog->outError("Possible hacking attempt: Player %s [guid: %u] tried to open item [guid: %u, entry: %u] which is not openable!",
|
||||
@@ -233,7 +233,7 @@ void WorldSession::HandleOpenItemOpcode(WorldPacket& recvPacket)
|
||||
}
|
||||
}
|
||||
|
||||
if (item->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_WRAPPED))// wrapped?
|
||||
if (item->HasFlag(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_WRAPPED))// wrapped?
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_GIFT_BY_ITEM);
|
||||
|
||||
@@ -257,7 +257,7 @@ void WorldSession::HandleOpenWrappedItemCallback(PreparedQueryResult result, uin
|
||||
if (!item)
|
||||
return;
|
||||
|
||||
if (item->GetGUIDLow() != itemLowGUID || !item->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_WRAPPED)) // during getting result, gift was swapped with another item
|
||||
if (item->GetGUIDLow() != itemLowGUID || !item->HasFlag(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_WRAPPED)) // during getting result, gift was swapped with another item
|
||||
return;
|
||||
|
||||
|
||||
|
||||
@@ -94,7 +94,7 @@ void WorldSession::SendUpdateTrade(bool trader_data /*= true*/)
|
||||
data << uint32(item->GetTemplate()->DisplayInfoID);// display id
|
||||
data << uint32(item->GetCount()); // stack count
|
||||
// wrapped: hide stats but show giftcreator name
|
||||
data << uint32(item->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_WRAPPED) ? 1 : 0);
|
||||
data << uint32(item->HasFlag(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_WRAPPED) ? 1 : 0);
|
||||
data << uint64(item->GetUInt64Value(ITEM_FIELD_GIFTCREATOR));
|
||||
// perm. enchantment and gems
|
||||
data << uint32(item->GetEnchantmentId(PERM_ENCHANTMENT_SLOT));
|
||||
@@ -148,7 +148,7 @@ void WorldSession::moveItems(Item* myItems[], Item* hisItems[])
|
||||
#endif
|
||||
|
||||
// adjust time (depends on /played)
|
||||
if (myItems[i]->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_BOP_TRADEABLE))
|
||||
if (myItems[i]->HasFlag(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_BOP_TRADEABLE))
|
||||
myItems[i]->SetUInt32Value(ITEM_FIELD_CREATE_PLAYED_TIME, trader->GetTotalPlayedTime()-(_player->GetTotalPlayedTime()-myItems[i]->GetUInt32Value(ITEM_FIELD_CREATE_PLAYED_TIME)));
|
||||
// store
|
||||
trader->MoveItemToInventory(traderDst, myItems[i], true, true);
|
||||
@@ -161,7 +161,7 @@ void WorldSession::moveItems(Item* myItems[], Item* hisItems[])
|
||||
#endif
|
||||
|
||||
// adjust time (depends on /played)
|
||||
if (hisItems[i]->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_BOP_TRADEABLE))
|
||||
if (hisItems[i]->HasFlag(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_BOP_TRADEABLE))
|
||||
hisItems[i]->SetUInt32Value(ITEM_FIELD_CREATE_PLAYED_TIME, _player->GetTotalPlayedTime()-(trader->GetTotalPlayedTime()-hisItems[i]->GetUInt32Value(ITEM_FIELD_CREATE_PLAYED_TIME)));
|
||||
// store
|
||||
_player->MoveItemToInventory(playerDst, hisItems[i], true, true);
|
||||
|
||||
@@ -372,7 +372,7 @@ LootItem::LootItem(LootStoreItem const& li)
|
||||
conditions = li.conditions;
|
||||
|
||||
ItemTemplate const* proto = sObjectMgr->GetItemTemplate(itemid);
|
||||
freeforall = proto && (proto->Flags & ITEM_PROTO_FLAG_PARTY_LOOT);
|
||||
freeforall = proto && (proto->Flags & ITEM_FLAG_MULTI_DROP);
|
||||
follow_loot_rules = proto && (proto->FlagsCu & ITEM_FLAGS_CU_FOLLOW_LOOT_RULES);
|
||||
|
||||
needs_quest = li.needs_quest;
|
||||
@@ -399,7 +399,7 @@ bool LootItem::AllowedForPlayer(Player const* player) const
|
||||
return false;
|
||||
|
||||
// not show loot for players without profession or those who already know the recipe
|
||||
if ((pProto->Flags & ITEM_PROTO_FLAG_SMART_LOOT) && (!player->HasSkill(pProto->RequiredSkill) || player->HasSpell(pProto->Spells[1].SpellId)))
|
||||
if ((pProto->Flags & ITEM_FLAG_HIDE_UNUSABLE_RECIPE) && (!player->HasSkill(pProto->RequiredSkill) || player->HasSpell(pProto->Spells[1].SpellId)))
|
||||
return false;
|
||||
|
||||
// not show loot for not own team
|
||||
@@ -449,7 +449,7 @@ void Loot::AddItem(LootStoreItem const& item)
|
||||
// non-conditional one-player only items are counted here,
|
||||
// free for all items are counted in FillFFALoot(),
|
||||
// non-ffa conditionals are counted in FillNonQuestNonFFAConditionalLoot()
|
||||
if (!item.needs_quest && item.conditions.empty() && !(proto->Flags & ITEM_PROTO_FLAG_PARTY_LOOT))
|
||||
if (!item.needs_quest && item.conditions.empty() && !(proto->Flags & ITEM_FLAG_MULTI_DROP))
|
||||
++unlootedCount;
|
||||
}
|
||||
}
|
||||
@@ -1679,7 +1679,7 @@ void LoadLootTemplates_Item()
|
||||
// remove real entries and check existence loot
|
||||
ItemTemplateContainer const* its = sObjectMgr->GetItemTemplateStore();
|
||||
for (ItemTemplateContainer::const_iterator itr = its->begin(); itr != its->end(); ++itr)
|
||||
if (lootIdSet.find(itr->second.ItemId) != lootIdSet.end() && itr->second.Flags & ITEM_PROTO_FLAG_OPENABLE)
|
||||
if (lootIdSet.find(itr->second.ItemId) != lootIdSet.end() && itr->second.Flags & ITEM_FLAG_HAS_LOOT)
|
||||
lootIdSet.erase(itr->second.ItemId);
|
||||
|
||||
// output error for any still listed (not referenced from appropriate table) ids
|
||||
@@ -1706,7 +1706,7 @@ void LoadLootTemplates_Milling()
|
||||
ItemTemplateContainer const* its = sObjectMgr->GetItemTemplateStore();
|
||||
for (ItemTemplateContainer::const_iterator itr = its->begin(); itr != its->end(); ++itr)
|
||||
{
|
||||
if (!(itr->second.Flags & ITEM_PROTO_FLAG_MILLABLE))
|
||||
if (!(itr->second.Flags & ITEM_FLAG_IS_MILLABLE))
|
||||
continue;
|
||||
|
||||
if (lootIdSet.find(itr->second.ItemId) != lootIdSet.end())
|
||||
@@ -1773,7 +1773,7 @@ void LoadLootTemplates_Prospecting()
|
||||
ItemTemplateContainer const* its = sObjectMgr->GetItemTemplateStore();
|
||||
for (ItemTemplateContainer::const_iterator itr = its->begin(); itr != its->end(); ++itr)
|
||||
{
|
||||
if (!(itr->second.Flags & ITEM_PROTO_FLAG_PROSPECTABLE))
|
||||
if (!(itr->second.Flags & ITEM_FLAG_IS_PROSPECTABLE))
|
||||
continue;
|
||||
|
||||
if (lootIdSet.find(itr->second.ItemId) != lootIdSet.end())
|
||||
|
||||
@@ -5189,7 +5189,7 @@ void Spell::TakeReagents()
|
||||
ItemTemplate const* castItemTemplate = m_CastItem ? m_CastItem->GetTemplate() : NULL;
|
||||
|
||||
// do not take reagents for these item casts
|
||||
if (castItemTemplate && castItemTemplate->Flags & ITEM_PROTO_FLAG_TRIGGERED_CAST)
|
||||
if (castItemTemplate && castItemTemplate->Flags & ITEM_FLAG_NO_REAGENT_COST)
|
||||
return;
|
||||
|
||||
Player* p_caster = m_caster->ToPlayer();
|
||||
@@ -6804,7 +6804,7 @@ SpellCastResult Spell::CheckItems()
|
||||
}
|
||||
|
||||
// do not take reagents for these item casts
|
||||
if (!(m_CastItem && m_CastItem->GetTemplate()->Flags & ITEM_PROTO_FLAG_TRIGGERED_CAST))
|
||||
if (!(m_CastItem && m_CastItem->GetTemplate()->Flags & ITEM_FLAG_NO_REAGENT_COST))
|
||||
{
|
||||
bool checkReagents = !(_triggeredCastFlags & TRIGGERED_IGNORE_POWER_AND_REAGENT_COST) && !p_caster->CanNoReagentCast(m_spellInfo);
|
||||
// Not own traded item (in trader trade slot) requires reagents even if triggered spell
|
||||
@@ -6932,7 +6932,7 @@ SpellCastResult Spell::CheckItems()
|
||||
if (m_targets.GetItemTarget()->GetOwner() != m_caster)
|
||||
return SPELL_FAILED_NOT_TRADEABLE;
|
||||
// do not allow to enchant vellum from scroll made by vellum-prevent exploit
|
||||
if (m_CastItem && m_CastItem->GetTemplate()->Flags & ITEM_PROTO_FLAG_TRIGGERED_CAST)
|
||||
if (m_CastItem && m_CastItem->GetTemplate()->Flags & ITEM_FLAG_NO_REAGENT_COST)
|
||||
return SPELL_FAILED_TOTEM_CATEGORY;
|
||||
ItemPosCountVec dest;
|
||||
InventoryResult msg = p_caster->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, m_spellInfo->Effects[i].ItemType, 1);
|
||||
@@ -7065,7 +7065,7 @@ SpellCastResult Spell::CheckItems()
|
||||
if (!m_targets.GetItemTarget())
|
||||
return SPELL_FAILED_CANT_BE_PROSPECTED;
|
||||
//ensure item is a prospectable ore
|
||||
if (!(m_targets.GetItemTarget()->GetTemplate()->Flags & ITEM_PROTO_FLAG_PROSPECTABLE))
|
||||
if (!(m_targets.GetItemTarget()->GetTemplate()->Flags & ITEM_FLAG_IS_PROSPECTABLE))
|
||||
return SPELL_FAILED_CANT_BE_PROSPECTED;
|
||||
//prevent prospecting in trade slot
|
||||
if (m_targets.GetItemTarget()->GetOwnerGUID() != m_caster->GetGUID())
|
||||
@@ -7088,7 +7088,7 @@ SpellCastResult Spell::CheckItems()
|
||||
if (!m_targets.GetItemTarget())
|
||||
return SPELL_FAILED_CANT_BE_MILLED;
|
||||
//ensure item is a millable herb
|
||||
if (!(m_targets.GetItemTarget()->GetTemplate()->Flags & ITEM_PROTO_FLAG_MILLABLE))
|
||||
if (!(m_targets.GetItemTarget()->GetTemplate()->Flags & ITEM_FLAG_IS_MILLABLE))
|
||||
return SPELL_FAILED_CANT_BE_MILLED;
|
||||
//prevent milling in trade slot
|
||||
if (m_targets.GetItemTarget()->GetOwnerGUID() != m_caster->GetGUID())
|
||||
|
||||
@@ -2167,7 +2167,7 @@ void Spell::EffectOpenLock(SpellEffIndex effIndex)
|
||||
SendLoot(guid, LOOT_SKINNING);
|
||||
else if (itemTarget)
|
||||
{
|
||||
itemTarget->SetFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_UNLOCKED);
|
||||
itemTarget->SetFlag(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_UNLOCKED);
|
||||
if (Player* itemOwner = itemTarget->GetOwner())
|
||||
itemTarget->SetState(ITEM_CHANGED, itemOwner);
|
||||
}
|
||||
@@ -2864,7 +2864,7 @@ void Spell::EffectEnchantItemPerm(SpellEffIndex effIndex)
|
||||
else
|
||||
{
|
||||
// do not increase skill if vellum used
|
||||
if (!(m_CastItem && m_CastItem->GetTemplate()->Flags & ITEM_PROTO_FLAG_TRIGGERED_CAST))
|
||||
if (!(m_CastItem && m_CastItem->GetTemplate()->Flags & ITEM_FLAG_NO_REAGENT_COST))
|
||||
p_caster->UpdateCraftSkill(m_spellInfo->Id);
|
||||
|
||||
uint32 enchant_id = m_spellInfo->Effects[effIndex].MiscValue;
|
||||
@@ -5487,7 +5487,7 @@ void Spell::EffectProspecting(SpellEffIndex /*effIndex*/)
|
||||
return;
|
||||
|
||||
Player* p_caster = m_caster->ToPlayer();
|
||||
if (!itemTarget || !(itemTarget->GetTemplate()->Flags & ITEM_PROTO_FLAG_PROSPECTABLE))
|
||||
if (!itemTarget || !(itemTarget->GetTemplate()->Flags & ITEM_FLAG_IS_PROSPECTABLE))
|
||||
return;
|
||||
|
||||
if (itemTarget->GetCount() < 5)
|
||||
@@ -5512,7 +5512,7 @@ void Spell::EffectMilling(SpellEffIndex /*effIndex*/)
|
||||
return;
|
||||
|
||||
Player* p_caster = m_caster->ToPlayer();
|
||||
if (!itemTarget || !(itemTarget->GetTemplate()->Flags & ITEM_PROTO_FLAG_MILLABLE))
|
||||
if (!itemTarget || !(itemTarget->GetTemplate()->Flags & ITEM_FLAG_IS_MILLABLE))
|
||||
return;
|
||||
|
||||
if (itemTarget->GetCount() < 5)
|
||||
|
||||
Reference in New Issue
Block a user