Core/Items: Updated InventoryResult enum
This commit is contained in:
1 parent
6cea446f22
commit
9c3c3cd9ec
13 files changed
+242
-240
No files matched your search
@@ -838,15 +838,15 @@ InventoryResult Item::CanBeMergedPartlyWith(ItemTemplate const* proto) const
|
||||
{
|
||||
// not allow merge looting currently items
|
||||
if (m_lootGenerated)
|
||||
return EQUIP_ERR_ALREADY_LOOTED;
|
||||
return EQUIP_ERR_LOOT_GONE;
|
||||
|
||||
// check item type
|
||||
if (GetEntry() != proto->ItemId)
|
||||
return EQUIP_ERR_ITEM_CANT_STACK;
|
||||
return EQUIP_ERR_CANT_STACK;
|
||||
|
||||
// check free space (full stacks can't be target of merge
|
||||
if (GetCount() >= proto->GetMaxStackSize())
|
||||
return EQUIP_ERR_ITEM_CANT_STACK;
|
||||
return EQUIP_ERR_CANT_STACK;
|
||||
|
||||
return EQUIP_ERR_OK;
|
||||
}
|
||||
|
||||
@@ -38,95 +38,99 @@ struct ItemSetEffect
|
||||
|
||||
enum InventoryResult
|
||||
{
|
||||
EQUIP_ERR_OK = 0,
|
||||
EQUIP_ERR_CANT_EQUIP_LEVEL_I = 1,
|
||||
EQUIP_ERR_CANT_EQUIP_SKILL = 2,
|
||||
EQUIP_ERR_ITEM_DOESNT_GO_TO_SLOT = 3,
|
||||
EQUIP_ERR_BAG_FULL = 4,
|
||||
EQUIP_ERR_NONEMPTY_BAG_OVER_OTHER_BAG = 5,
|
||||
EQUIP_ERR_CANT_TRADE_EQUIP_BAGS = 6,
|
||||
EQUIP_ERR_ONLY_AMMO_CAN_GO_HERE = 7,
|
||||
EQUIP_ERR_NO_REQUIRED_PROFICIENCY = 8,
|
||||
EQUIP_ERR_NO_EQUIPMENT_SLOT_AVAILABLE = 9,
|
||||
EQUIP_ERR_YOU_CAN_NEVER_USE_THAT_ITEM = 10,
|
||||
EQUIP_ERR_YOU_CAN_NEVER_USE_THAT_ITEM2 = 11,
|
||||
EQUIP_ERR_NO_EQUIPMENT_SLOT_AVAILABLE2 = 12,
|
||||
EQUIP_ERR_CANT_EQUIP_WITH_TWOHANDED = 13,
|
||||
EQUIP_ERR_CANT_DUAL_WIELD = 14,
|
||||
EQUIP_ERR_ITEM_DOESNT_GO_INTO_BAG = 15,
|
||||
EQUIP_ERR_ITEM_DOESNT_GO_INTO_BAG2 = 16,
|
||||
EQUIP_ERR_CANT_CARRY_MORE_OF_THIS = 17,
|
||||
EQUIP_ERR_NO_EQUIPMENT_SLOT_AVAILABLE3 = 18,
|
||||
EQUIP_ERR_ITEM_CANT_STACK = 19,
|
||||
EQUIP_ERR_ITEM_CANT_BE_EQUIPPED = 20,
|
||||
EQUIP_ERR_ITEMS_CANT_BE_SWAPPED = 21,
|
||||
EQUIP_ERR_SLOT_IS_EMPTY = 22,
|
||||
EQUIP_ERR_ITEM_NOT_FOUND = 23,
|
||||
EQUIP_ERR_CANT_DROP_SOULBOUND = 24,
|
||||
EQUIP_ERR_OUT_OF_RANGE = 25,
|
||||
EQUIP_ERR_TRIED_TO_SPLIT_MORE_THAN_COUNT = 26,
|
||||
EQUIP_ERR_COULDNT_SPLIT_ITEMS = 27,
|
||||
EQUIP_ERR_MISSING_REAGENT = 28,
|
||||
EQUIP_ERR_NOT_ENOUGH_MONEY = 29,
|
||||
EQUIP_ERR_NOT_A_BAG = 30,
|
||||
EQUIP_ERR_CAN_ONLY_DO_WITH_EMPTY_BAGS = 31,
|
||||
EQUIP_ERR_DONT_OWN_THAT_ITEM = 32,
|
||||
EQUIP_ERR_CAN_EQUIP_ONLY1_QUIVER = 33,
|
||||
EQUIP_ERR_MUST_PURCHASE_THAT_BAG_SLOT = 34,
|
||||
EQUIP_ERR_TOO_FAR_AWAY_FROM_BANK = 35,
|
||||
EQUIP_ERR_ITEM_LOCKED = 36,
|
||||
EQUIP_ERR_YOU_ARE_STUNNED = 37,
|
||||
EQUIP_ERR_YOU_ARE_DEAD = 38,
|
||||
EQUIP_ERR_CANT_DO_RIGHT_NOW = 39,
|
||||
EQUIP_ERR_INT_BAG_ERROR = 40,
|
||||
EQUIP_ERR_CAN_EQUIP_ONLY1_BOLT = 41,
|
||||
EQUIP_ERR_CAN_EQUIP_ONLY1_AMMOPOUCH = 42,
|
||||
EQUIP_ERR_STACKABLE_CANT_BE_WRAPPED = 43,
|
||||
EQUIP_ERR_EQUIPPED_CANT_BE_WRAPPED = 44,
|
||||
EQUIP_ERR_WRAPPED_CANT_BE_WRAPPED = 45,
|
||||
EQUIP_ERR_BOUND_CANT_BE_WRAPPED = 46,
|
||||
EQUIP_ERR_UNIQUE_CANT_BE_WRAPPED = 47,
|
||||
EQUIP_ERR_BAGS_CANT_BE_WRAPPED = 48,
|
||||
EQUIP_ERR_ALREADY_LOOTED = 49,
|
||||
EQUIP_ERR_INVENTORY_FULL = 50,
|
||||
EQUIP_ERR_BANK_FULL = 51,
|
||||
EQUIP_ERR_ITEM_IS_CURRENTLY_SOLD_OUT = 52,
|
||||
EQUIP_ERR_BAG_FULL3 = 53,
|
||||
EQUIP_ERR_ITEM_NOT_FOUND2 = 54,
|
||||
EQUIP_ERR_ITEM_CANT_STACK2 = 55,
|
||||
EQUIP_ERR_BAG_FULL4 = 56,
|
||||
EQUIP_ERR_ITEM_SOLD_OUT = 57,
|
||||
EQUIP_ERR_OBJECT_IS_BUSY = 58,
|
||||
EQUIP_ERR_NONE = 59,
|
||||
EQUIP_ERR_NOT_IN_COMBAT = 60,
|
||||
EQUIP_ERR_NOT_WHILE_DISARMED = 61,
|
||||
EQUIP_ERR_BAG_FULL6 = 62,
|
||||
EQUIP_ERR_CANT_EQUIP_RANK = 63,
|
||||
EQUIP_ERR_CANT_EQUIP_REPUTATION = 64,
|
||||
EQUIP_ERR_TOO_MANY_SPECIAL_BAGS = 65,
|
||||
EQUIP_ERR_LOOT_CANT_LOOT_THAT_NOW = 66,
|
||||
EQUIP_ERR_ITEM_UNIQUE_EQUIPABLE = 67,
|
||||
EQUIP_ERR_VENDOR_MISSING_TURNINS = 68,
|
||||
EQUIP_ERR_NOT_ENOUGH_HONOR_POINTS = 69,
|
||||
EQUIP_ERR_NOT_ENOUGH_ARENA_POINTS = 70,
|
||||
EQUIP_ERR_ITEM_MAX_COUNT_SOCKETED = 71,
|
||||
EQUIP_ERR_MAIL_BOUND_ITEM = 72,
|
||||
EQUIP_ERR_NO_SPLIT_WHILE_PROSPECTING = 73,
|
||||
EQUIP_ERR_ITEM_MAX_COUNT_EQUIPPED_SOCKETED = 75,
|
||||
EQUIP_ERR_ITEM_UNIQUE_EQUIPPABLE_SOCKETED = 76,
|
||||
EQUIP_ERR_TOO_MUCH_GOLD = 77,
|
||||
EQUIP_ERR_NOT_DURING_ARENA_MATCH = 78,
|
||||
EQUIP_ERR_CANNOT_TRADE_THAT = 79,
|
||||
EQUIP_ERR_PERSONAL_ARENA_RATING_TOO_LOW = 80,
|
||||
EQUIP_ERR_EVENT_AUTOEQUIP_BIND_CONFIRM = 81,
|
||||
EQUIP_ERR_ARTEFACTS_ONLY_FOR_OWN_CHARACTERS = 82,
|
||||
// no output = 83,
|
||||
EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_COUNT_EXCEEDED = 84,
|
||||
EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_SOCKETED_EXCEEDED = 85,
|
||||
EQUIP_ERR_SCALING_STAT_ITEM_LEVEL_EXCEEDED = 86,
|
||||
EQUIP_ERR_PURCHASE_LEVEL_TOO_LOW = 87,
|
||||
EQUIP_ERR_CANT_EQUIP_NEED_TALENT = 88,
|
||||
EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_EQUIPPED_EXCEEDED = 89
|
||||
EQUIP_ERR_OK = 0,
|
||||
EQUIP_ERR_CANT_EQUIP_LEVEL_I = 1, // You must reach level %d to use that item.
|
||||
EQUIP_ERR_CANT_EQUIP_SKILL = 2, // You aren't skilled enough to use that item.
|
||||
EQUIP_ERR_WRONG_SLOT = 3, // That item does not go in that slot.
|
||||
EQUIP_ERR_BAG_FULL = 4, // That bag is full.
|
||||
EQUIP_ERR_BAG_IN_BAG = 5, // Can't put non-empty bags in other bags.
|
||||
EQUIP_ERR_TRADE_EQUIPPED_BAG = 6, // You can't trade equipped bags.
|
||||
EQUIP_ERR_AMMO_ONLY = 7, // Only ammo can go there.
|
||||
EQUIP_ERR_PROFICIENCY_NEEDED = 8, // You do not have the required proficiency for that item.
|
||||
EQUIP_ERR_NO_SLOT_AVAILABLE = 9, // No equipment slot is available for that item.
|
||||
EQUIP_ERR_CANT_EQUIP_EVER = 10, // You can never use that item.
|
||||
EQUIP_ERR_CANT_EQUIP_EVER_2 = 11, // You can never use that item.
|
||||
EQUIP_ERR_NO_SLOT_AVAILABLE_2 = 12, // No equipment slot is available for that item.
|
||||
EQUIP_ERR_2HANDED_EQUIPPED = 13, // Cannot equip that with a two-handed weapon.
|
||||
EQUIP_ERR_2HSKILLNOTFOUND = 14, // You cannot dual-wield
|
||||
EQUIP_ERR_WRONG_BAG_TYPE = 15, // That item doesn't go in that container.
|
||||
EQUIP_ERR_WRONG_BAG_TYPE_2 = 16, // That item doesn't go in that container.
|
||||
EQUIP_ERR_ITEM_MAX_COUNT = 17, // You can't carry any more of those items.
|
||||
EQUIP_ERR_NO_SLOT_AVAILABLE_3 = 18, // No equipment slot is available for that item.
|
||||
EQUIP_ERR_CANT_STACK = 19, // This item cannot stack.
|
||||
EQUIP_ERR_NOT_EQUIPPABLE = 20, // This item cannot be equipped.
|
||||
EQUIP_ERR_CANT_SWAP = 21, // These items can't be swapped.
|
||||
EQUIP_ERR_SLOT_EMPTY = 22, // That slot is empty.
|
||||
EQUIP_ERR_ITEM_NOT_FOUND = 23, // The item was not found.
|
||||
EQUIP_ERR_DROP_BOUND_ITEM = 24, // You can't drop a soulbound item.
|
||||
EQUIP_ERR_OUT_OF_RANGE = 25, // Out of range.
|
||||
EQUIP_ERR_TOO_FEW_TO_SPLIT = 26, // Tried to split more than number in stack.
|
||||
EQUIP_ERR_SPLIT_FAILED = 27, // Couldn't split those items.
|
||||
EQUIP_ERR_SPELL_FAILED_REAGENTS_GENERIC = 28, // Missing reagent
|
||||
EQUIP_ERR_NOT_ENOUGH_MONEY = 29, // You don't have enough money.
|
||||
EQUIP_ERR_NOT_A_BAG = 30, // Not a bag.
|
||||
EQUIP_ERR_DESTROY_NONEMPTY_BAG = 31, // You can only do that with empty bags.
|
||||
EQUIP_ERR_NOT_OWNER = 32, // You don't own that item.
|
||||
EQUIP_ERR_ONLY_ONE_QUIVER = 33, // You can only equip one quiver.
|
||||
EQUIP_ERR_NO_BANK_SLOT = 34, // You must purchase that bag slot first
|
||||
EQUIP_ERR_NO_BANK_HERE = 35, // You are too far away from a bank.
|
||||
EQUIP_ERR_ITEM_LOCKED = 36, // Item is locked.
|
||||
EQUIP_ERR_GENERIC_STUNNED = 37, // You are stunned
|
||||
EQUIP_ERR_PLAYER_DEAD = 38, // You can't do that when you're dead.
|
||||
EQUIP_ERR_CLIENT_LOCKED_OUT = 39, // You can't do that right now.
|
||||
EQUIP_ERR_INTERNAL_BAG_ERROR = 40, // Internal Bag Error
|
||||
EQUIP_ERR_ONLY_ONE_BOLT = 41, // You can only equip one quiver.
|
||||
EQUIP_ERR_ONLY_ONE_AMMO = 42, // You can only equip one ammo pouch.
|
||||
EQUIP_ERR_CANT_WRAP_STACKABLE = 43, // Stackable items can't be wrapped.
|
||||
EQUIP_ERR_CANT_WRAP_EQUIPPED = 44, // Equipped items can't be wrapped.
|
||||
EQUIP_ERR_CANT_WRAP_WRAPPED = 45, // Wrapped items can't be wrapped.
|
||||
EQUIP_ERR_CANT_WRAP_BOUND = 46, // Bound items can't be wrapped.
|
||||
EQUIP_ERR_CANT_WRAP_UNIQUE = 47, // Unique items can't be wrapped.
|
||||
EQUIP_ERR_CANT_WRAP_BAGS = 48, // Bags can't be wrapped.
|
||||
EQUIP_ERR_LOOT_GONE = 49, // Already looted
|
||||
EQUIP_ERR_INV_FULL = 50, // Inventory is full.
|
||||
EQUIP_ERR_BANK_FULL = 51, // Your bank is full
|
||||
EQUIP_ERR_VENDOR_SOLD_OUT = 52, // That item is currently sold out.
|
||||
EQUIP_ERR_BAG_FULL_2 = 53, // That bag is full.
|
||||
EQUIP_ERR_ITEM_NOT_FOUND_2 = 54, // The item was not found.
|
||||
EQUIP_ERR_CANT_STACK_2 = 55, // This item cannot stack.
|
||||
EQUIP_ERR_BAG_FULL_3 = 56, // That bag is full.
|
||||
EQUIP_ERR_VENDOR_SOLD_OUT_2 = 57, // That item is currently sold out.
|
||||
EQUIP_ERR_OBJECT_IS_BUSY = 58, // That object is busy.
|
||||
EQUIP_ERR_CANT_BE_DISENCHANTED = 59,
|
||||
EQUIP_ERR_NOT_IN_COMBAT = 60, // You can't do that while in combat
|
||||
EQUIP_ERR_NOT_WHILE_DISARMED = 61, // You can't do that while disarmed
|
||||
EQUIP_ERR_BAG_FULL_4 = 62, // That bag is full.
|
||||
EQUIP_ERR_CANT_EQUIP_RANK = 63, // You don't have the required rank for that item
|
||||
EQUIP_ERR_CANT_EQUIP_REPUTATION = 64, // You don't have the required reputation for that item
|
||||
EQUIP_ERR_TOO_MANY_SPECIAL_BAGS = 65, // You cannot equip another bag of that type
|
||||
EQUIP_ERR_LOOT_CANT_LOOT_THAT_NOW = 66, // You can't loot that item now.
|
||||
EQUIP_ERR_ITEM_UNIQUE_EQUIPPABLE = 67, // You cannot equip more than one of those.
|
||||
EQUIP_ERR_VENDOR_MISSING_TURNINS = 68, // You do not have the required items for that purchase
|
||||
EQUIP_ERR_NOT_ENOUGH_HONOR_POINTS = 69, // You don't have enough honor points
|
||||
EQUIP_ERR_NOT_ENOUGH_ARENA_POINTS = 70, // You don't have enough arena points
|
||||
EQUIP_ERR_ITEM_MAX_COUNT_SOCKETED = 71, // You have the maximum number of those gems in your inventory or socketed into items.
|
||||
EQUIP_ERR_MAIL_BOUND_ITEM = 72, // You can't mail soulbound items.
|
||||
EQUIP_ERR_INTERNAL_BAG_ERROR_2 = 73, // Internal Bag Error
|
||||
EQUIP_ERR_BAG_FULL_5 = 74, // That bag is full.
|
||||
EQUIP_ERR_ITEM_MAX_COUNT_EQUIPPED_SOCKETED = 75, // You have the maximum number of those gems socketed into equipped items.
|
||||
EQUIP_ERR_ITEM_UNIQUE_EQUIPPABLE_SOCKETED = 76, // You cannot socket more than one of those gems into a single item.
|
||||
EQUIP_ERR_TOO_MUCH_GOLD = 77, // At gold limit
|
||||
EQUIP_ERR_NOT_DURING_ARENA_MATCH = 78, // You can't do that while in an arena match
|
||||
EQUIP_ERR_TRADE_BOUND_ITEM = 79, // You can't trade a soulbound item.
|
||||
EQUIP_ERR_CANT_EQUIP_RATING = 80, // You don't have the personal, team, or battleground rating required to buy that item
|
||||
EQUIP_ERR_NO_OUTPUT = 81,
|
||||
EQUIP_ERR_NOT_SAME_ACCOUNT = 82, // Account-bound items can only be given to your own characters.
|
||||
EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_COUNT_EXCEEDED_IS = 84, // You can only carry %d %s
|
||||
EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_SOCKETED_EXCEEDED_IS = 85, // You can only equip %d |4item:items in the %s category
|
||||
EQUIP_ERR_SCALING_STAT_ITEM_LEVEL_EXCEEDED = 86, // Your level is too high to use that item
|
||||
EQUIP_ERR_PURCHASE_LEVEL_TOO_LOW = 87, // You must reach level %d to purchase that item.
|
||||
EQUIP_ERR_CANT_EQUIP_NEED_TALENT = 88, // You do not have the required talent to equip that.
|
||||
EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_EQUIPPED_EXCEEDED_IS = 89, // You can only equip %d |4item:items in the %s category
|
||||
EQUIP_ERR_SHAPESHIFT_FORM_CANNOT_EQUIP = 90, // Cannot equip item in this form
|
||||
EQUIP_ERR_ITEM_INVENTORY_FULL_SATCHEL = 91, // Your inventory is full. Your satchel has been delivered to your mailbox.
|
||||
EQUIP_ERR_SCALING_STAT_ITEM_LEVEL_TOO_LOW = 92, // Your level is too low to use that item
|
||||
EQUIP_ERR_CANT_BUY_QUANTITY = 93, // You can't buy the specified quantity of that item.
|
||||
};
|
||||
|
||||
enum BuyResult
|
||||
|
||||
@@ -8527,7 +8527,7 @@ void Player::CastItemUseSpell(Item* item, SpellCastTargets const& targets, uint8
|
||||
if (!spellInfo)
|
||||
{
|
||||
sLog->outError(LOG_FILTER_PLAYER, "Player::CastItemUseSpell: Item (Entry: %u) in have wrong spell id %u, ignoring ", proto->ItemId, learn_spell_id);
|
||||
SendEquipError(EQUIP_ERR_NONE, item, NULL);
|
||||
SendEquipError(EQUIP_ERR_INTERNAL_BAG_ERROR, item, NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -10466,11 +10466,11 @@ InventoryResult Player::CanTakeMoreSimilarItems(uint32 entry, uint32 count, Item
|
||||
{
|
||||
if (no_space_count)
|
||||
*no_space_count = count;
|
||||
return EQUIP_ERR_CANT_CARRY_MORE_OF_THIS;
|
||||
return EQUIP_ERR_ITEM_MAX_COUNT;
|
||||
}
|
||||
|
||||
if (pItem && pItem->m_lootGenerated)
|
||||
return EQUIP_ERR_ALREADY_LOOTED;
|
||||
return EQUIP_ERR_LOOT_GONE;
|
||||
|
||||
// no maximum
|
||||
if ((pProto->MaxCount <= 0 && pProto->ItemLimitCategory == 0) || pProto->MaxCount == 2147483647)
|
||||
@@ -10483,7 +10483,7 @@ InventoryResult Player::CanTakeMoreSimilarItems(uint32 entry, uint32 count, Item
|
||||
{
|
||||
if (no_space_count)
|
||||
*no_space_count = count + curcount - pProto->MaxCount;
|
||||
return EQUIP_ERR_CANT_CARRY_MORE_OF_THIS;
|
||||
return EQUIP_ERR_ITEM_MAX_COUNT;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10495,7 +10495,7 @@ InventoryResult Player::CanTakeMoreSimilarItems(uint32 entry, uint32 count, Item
|
||||
{
|
||||
if (no_space_count)
|
||||
*no_space_count = count;
|
||||
return EQUIP_ERR_ITEM_CANT_BE_EQUIPPED;
|
||||
return EQUIP_ERR_NOT_EQUIPPABLE;
|
||||
}
|
||||
|
||||
if (limitEntry->mode == ITEM_LIMIT_CATEGORY_MODE_HAVE)
|
||||
@@ -10505,7 +10505,7 @@ InventoryResult Player::CanTakeMoreSimilarItems(uint32 entry, uint32 count, Item
|
||||
{
|
||||
if (no_space_count)
|
||||
*no_space_count = count + curcount - limitEntry->maxCount;
|
||||
return EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_COUNT_EXCEEDED;
|
||||
return EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_COUNT_EXCEEDED_IS;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10524,7 +10524,7 @@ InventoryResult Player::CanStoreItem_InSpecificSlot(uint8 bag, uint8 slot, ItemP
|
||||
uint32 need_space;
|
||||
|
||||
if (pSrcItem && pSrcItem->IsNotEmptyBag() && !IsBagPos(uint16(bag) << 8 | slot))
|
||||
return EQUIP_ERR_CAN_ONLY_DO_WITH_EMPTY_BAGS;
|
||||
return EQUIP_ERR_DESTROY_NONEMPTY_BAG;
|
||||
|
||||
// empty specific slot - check item fit to slot
|
||||
if (!pItem2 || swap)
|
||||
@@ -10533,23 +10533,23 @@ InventoryResult Player::CanStoreItem_InSpecificSlot(uint8 bag, uint8 slot, ItemP
|
||||
{
|
||||
// prevent cheating
|
||||
if ((slot >= BUYBACK_SLOT_START && slot < BUYBACK_SLOT_END) || slot >= PLAYER_SLOT_END)
|
||||
return EQUIP_ERR_ITEM_DOESNT_GO_INTO_BAG;
|
||||
return EQUIP_ERR_WRONG_BAG_TYPE;
|
||||
}
|
||||
else
|
||||
{
|
||||
Bag* pBag = GetBagByPos(bag);
|
||||
if (!pBag)
|
||||
return EQUIP_ERR_ITEM_DOESNT_GO_INTO_BAG;
|
||||
return EQUIP_ERR_WRONG_BAG_TYPE;
|
||||
|
||||
ItemTemplate const* pBagProto = pBag->GetTemplate();
|
||||
if (!pBagProto)
|
||||
return EQUIP_ERR_ITEM_DOESNT_GO_INTO_BAG;
|
||||
return EQUIP_ERR_WRONG_BAG_TYPE;
|
||||
|
||||
if (slot >= pBagProto->ContainerSlots)
|
||||
return EQUIP_ERR_ITEM_DOESNT_GO_INTO_BAG;
|
||||
return EQUIP_ERR_WRONG_BAG_TYPE;
|
||||
|
||||
if (!ItemCanGoIntoBag(pProto, pBagProto))
|
||||
return EQUIP_ERR_ITEM_DOESNT_GO_INTO_BAG;
|
||||
return EQUIP_ERR_WRONG_BAG_TYPE;
|
||||
}
|
||||
|
||||
// non empty stack with space
|
||||
@@ -10583,26 +10583,26 @@ InventoryResult Player::CanStoreItem_InBag(uint8 bag, ItemPosCountVec &dest, Ite
|
||||
{
|
||||
// skip specific bag already processed in first called CanStoreItem_InBag
|
||||
if (bag == skip_bag)
|
||||
return EQUIP_ERR_ITEM_DOESNT_GO_INTO_BAG;
|
||||
return EQUIP_ERR_WRONG_BAG_TYPE;
|
||||
|
||||
// skip not existed bag or self targeted bag
|
||||
Bag* pBag = GetBagByPos(bag);
|
||||
if (!pBag || pBag == pSrcItem)
|
||||
return EQUIP_ERR_ITEM_DOESNT_GO_INTO_BAG;
|
||||
return EQUIP_ERR_WRONG_BAG_TYPE;
|
||||
|
||||
if (pSrcItem && pSrcItem->IsNotEmptyBag())
|
||||
return EQUIP_ERR_CAN_ONLY_DO_WITH_EMPTY_BAGS;
|
||||
return EQUIP_ERR_DESTROY_NONEMPTY_BAG;
|
||||
|
||||
ItemTemplate const* pBagProto = pBag->GetTemplate();
|
||||
if (!pBagProto)
|
||||
return EQUIP_ERR_ITEM_DOESNT_GO_INTO_BAG;
|
||||
return EQUIP_ERR_WRONG_BAG_TYPE;
|
||||
|
||||
// specialized bag mode or non-specilized
|
||||
if (non_specialized != (pBagProto->Class == ITEM_CLASS_CONTAINER && pBagProto->SubClass == ITEM_SUBCLASS_CONTAINER))
|
||||
return EQUIP_ERR_ITEM_DOESNT_GO_INTO_BAG;
|
||||
return EQUIP_ERR_WRONG_BAG_TYPE;
|
||||
|
||||
if (!ItemCanGoIntoBag(pProto, pBagProto))
|
||||
return EQUIP_ERR_ITEM_DOESNT_GO_INTO_BAG;
|
||||
return EQUIP_ERR_WRONG_BAG_TYPE;
|
||||
|
||||
for (uint32 j = 0; j < pBag->GetBagSize(); j++)
|
||||
{
|
||||
@@ -10653,7 +10653,7 @@ InventoryResult Player::CanStoreItem_InInventorySlots(uint8 slot_begin, uint8 sl
|
||||
{
|
||||
//this is never called for non-bag slots so we can do this
|
||||
if (pSrcItem && pSrcItem->IsNotEmptyBag())
|
||||
return EQUIP_ERR_CAN_ONLY_DO_WITH_EMPTY_BAGS;
|
||||
return EQUIP_ERR_DESTROY_NONEMPTY_BAG;
|
||||
|
||||
for (uint32 j = slot_begin; j < slot_end; j++)
|
||||
{
|
||||
@@ -10709,7 +10709,7 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des
|
||||
{
|
||||
if (no_space_count)
|
||||
*no_space_count = count;
|
||||
return swap ? EQUIP_ERR_ITEMS_CANT_BE_SWAPPED :EQUIP_ERR_ITEM_NOT_FOUND;
|
||||
return swap ? EQUIP_ERR_CANT_SWAP :EQUIP_ERR_ITEM_NOT_FOUND;
|
||||
}
|
||||
|
||||
if (pItem)
|
||||
@@ -10719,14 +10719,14 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des
|
||||
{
|
||||
if (no_space_count)
|
||||
*no_space_count = count;
|
||||
return EQUIP_ERR_ALREADY_LOOTED;
|
||||
return EQUIP_ERR_LOOT_GONE;
|
||||
}
|
||||
|
||||
if (pItem->IsBindedNotWith(this))
|
||||
{
|
||||
if (no_space_count)
|
||||
*no_space_count = count;
|
||||
return EQUIP_ERR_DONT_OWN_THAT_ITEM;
|
||||
return EQUIP_ERR_NOT_OWNER;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10762,7 +10762,7 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des
|
||||
|
||||
if (no_space_count)
|
||||
*no_space_count = count + no_similar_count;
|
||||
return EQUIP_ERR_CANT_CARRY_MORE_OF_THIS;
|
||||
return EQUIP_ERR_ITEM_MAX_COUNT;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10791,7 +10791,7 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des
|
||||
|
||||
if (no_space_count)
|
||||
*no_space_count = count + no_similar_count;
|
||||
return EQUIP_ERR_CANT_CARRY_MORE_OF_THIS;
|
||||
return EQUIP_ERR_ITEM_MAX_COUNT;
|
||||
}
|
||||
}
|
||||
else // equipped bag
|
||||
@@ -10815,7 +10815,7 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des
|
||||
|
||||
if (no_space_count)
|
||||
*no_space_count = count + no_similar_count;
|
||||
return EQUIP_ERR_CANT_CARRY_MORE_OF_THIS;
|
||||
return EQUIP_ERR_ITEM_MAX_COUNT;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10838,7 +10838,7 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des
|
||||
|
||||
if (no_space_count)
|
||||
*no_space_count = count + no_similar_count;
|
||||
return EQUIP_ERR_CANT_CARRY_MORE_OF_THIS;
|
||||
return EQUIP_ERR_ITEM_MAX_COUNT;
|
||||
}
|
||||
}
|
||||
else // equipped bag
|
||||
@@ -10861,7 +10861,7 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des
|
||||
|
||||
if (no_space_count)
|
||||
*no_space_count = count + no_similar_count;
|
||||
return EQUIP_ERR_CANT_CARRY_MORE_OF_THIS;
|
||||
return EQUIP_ERR_ITEM_MAX_COUNT;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10886,7 +10886,7 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des
|
||||
|
||||
if (no_space_count)
|
||||
*no_space_count = count + no_similar_count;
|
||||
return EQUIP_ERR_CANT_CARRY_MORE_OF_THIS;
|
||||
return EQUIP_ERR_ITEM_MAX_COUNT;
|
||||
}
|
||||
|
||||
if (pProto->BagFamily)
|
||||
@@ -10904,7 +10904,7 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des
|
||||
|
||||
if (no_space_count)
|
||||
*no_space_count = count + no_similar_count;
|
||||
return EQUIP_ERR_CANT_CARRY_MORE_OF_THIS;
|
||||
return EQUIP_ERR_ITEM_MAX_COUNT;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10922,7 +10922,7 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des
|
||||
|
||||
if (no_space_count)
|
||||
*no_space_count = count + no_similar_count;
|
||||
return EQUIP_ERR_CANT_CARRY_MORE_OF_THIS;
|
||||
return EQUIP_ERR_ITEM_MAX_COUNT;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10943,13 +10943,13 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des
|
||||
|
||||
if (no_space_count)
|
||||
*no_space_count = count + no_similar_count;
|
||||
return EQUIP_ERR_CANT_CARRY_MORE_OF_THIS;
|
||||
return EQUIP_ERR_ITEM_MAX_COUNT;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (pItem && pItem->IsNotEmptyBag())
|
||||
return EQUIP_ERR_NONEMPTY_BAG_OVER_OTHER_BAG;
|
||||
return EQUIP_ERR_BAG_IN_BAG;
|
||||
|
||||
// search free slot
|
||||
res = CanStoreItem_InInventorySlots(INVENTORY_SLOT_ITEM_START, INVENTORY_SLOT_ITEM_END, dest, pProto, count, false, pItem, bag, slot);
|
||||
@@ -10967,7 +10967,7 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des
|
||||
|
||||
if (no_space_count)
|
||||
*no_space_count = count + no_similar_count;
|
||||
return EQUIP_ERR_CANT_CARRY_MORE_OF_THIS;
|
||||
return EQUIP_ERR_ITEM_MAX_COUNT;
|
||||
}
|
||||
|
||||
for (uint8 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; i++)
|
||||
@@ -10983,14 +10983,14 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des
|
||||
|
||||
if (no_space_count)
|
||||
*no_space_count = count + no_similar_count;
|
||||
return EQUIP_ERR_CANT_CARRY_MORE_OF_THIS;
|
||||
return EQUIP_ERR_ITEM_MAX_COUNT;
|
||||
}
|
||||
}
|
||||
|
||||
if (no_space_count)
|
||||
*no_space_count = count + no_similar_count;
|
||||
|
||||
return EQUIP_ERR_INVENTORY_FULL;
|
||||
return EQUIP_ERR_INV_FULL;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
@@ -11039,11 +11039,11 @@ InventoryResult Player::CanStoreItems(Item** pItems, int count) const
|
||||
|
||||
// item used
|
||||
if (pItem->m_lootGenerated)
|
||||
return EQUIP_ERR_ALREADY_LOOTED;
|
||||
return EQUIP_ERR_LOOT_GONE;
|
||||
|
||||
// item it 'bind'
|
||||
if (pItem->IsBindedNotWith(this))
|
||||
return EQUIP_ERR_DONT_OWN_THAT_ITEM;
|
||||
return EQUIP_ERR_NOT_OWNER;
|
||||
|
||||
ItemTemplate const* pBagProto;
|
||||
|
||||
@@ -11163,7 +11163,7 @@ InventoryResult Player::CanStoreItems(Item** pItems, int count) const
|
||||
|
||||
// no free slot found?
|
||||
if (!b_found)
|
||||
return EQUIP_ERR_INVENTORY_FULL;
|
||||
return EQUIP_ERR_INV_FULL;
|
||||
}
|
||||
|
||||
return EQUIP_ERR_OK;
|
||||
@@ -11195,10 +11195,10 @@ InventoryResult Player::CanEquipItem(uint8 slot, uint16 &dest, Item* pItem, bool
|
||||
{
|
||||
// item used
|
||||
if (pItem->m_lootGenerated)
|
||||
return EQUIP_ERR_ALREADY_LOOTED;
|
||||
return EQUIP_ERR_LOOT_GONE;
|
||||
|
||||
if (pItem->IsBindedNotWith(this))
|
||||
return EQUIP_ERR_DONT_OWN_THAT_ITEM;
|
||||
return EQUIP_ERR_NOT_OWNER;
|
||||
|
||||
// check count of items (skip for auto move for same player from bank)
|
||||
InventoryResult res = CanTakeMoreSimilarItems(pItem);
|
||||
@@ -11211,7 +11211,7 @@ InventoryResult Player::CanEquipItem(uint8 slot, uint16 &dest, Item* pItem, bool
|
||||
// May be here should be more stronger checks; STUNNED checked
|
||||
// ROOT, CONFUSED, DISTRACTED, FLEEING this needs to be checked.
|
||||
if (HasUnitState(UNIT_STATE_STUNNED))
|
||||
return EQUIP_ERR_YOU_ARE_STUNNED;
|
||||
return EQUIP_ERR_GENERIC_STUNNED;
|
||||
|
||||
// do not allow equipping gear except weapons, offhands, projectiles, relics in
|
||||
// - combat
|
||||
@@ -11227,27 +11227,27 @@ InventoryResult Player::CanEquipItem(uint8 slot, uint16 &dest, Item* pItem, bool
|
||||
}
|
||||
|
||||
if (isInCombat()&& (pProto->Class == ITEM_CLASS_WEAPON || pProto->InventoryType == INVTYPE_RELIC) && m_weaponChangeTimer != 0)
|
||||
return EQUIP_ERR_CANT_DO_RIGHT_NOW; // maybe exist better err
|
||||
return EQUIP_ERR_CLIENT_LOCKED_OUT; // maybe exist better err
|
||||
|
||||
if (IsNonMeleeSpellCasted(false))
|
||||
return EQUIP_ERR_CANT_DO_RIGHT_NOW;
|
||||
return EQUIP_ERR_CLIENT_LOCKED_OUT;
|
||||
}
|
||||
|
||||
ScalingStatDistributionEntry const* ssd = pProto->ScalingStatDistribution ? sScalingStatDistributionStore.LookupEntry(pProto->ScalingStatDistribution) : 0;
|
||||
// check allowed level (extend range to upper values if MaxLevel more or equal max player level, this let GM set high level with 1...max range items)
|
||||
if (ssd && ssd->MaxLevel < DEFAULT_MAX_LEVEL && ssd->MaxLevel < getLevel())
|
||||
return EQUIP_ERR_ITEM_CANT_BE_EQUIPPED;
|
||||
return EQUIP_ERR_NOT_EQUIPPABLE;
|
||||
|
||||
uint8 eslot = FindEquipSlot(pProto, slot, swap);
|
||||
if (eslot == NULL_SLOT)
|
||||
return EQUIP_ERR_ITEM_CANT_BE_EQUIPPED;
|
||||
return EQUIP_ERR_NOT_EQUIPPABLE;
|
||||
|
||||
res = CanUseItem(pItem, not_loading);
|
||||
if (res != EQUIP_ERR_OK)
|
||||
return res;
|
||||
|
||||
if (!swap && GetItemByPos(INVENTORY_SLOT_BAG_0, eslot))
|
||||
return EQUIP_ERR_NO_EQUIPMENT_SLOT_AVAILABLE;
|
||||
return EQUIP_ERR_NO_SLOT_AVAILABLE;
|
||||
|
||||
// if swap ignore item (equipped also)
|
||||
InventoryResult res2 = CanEquipUniqueItem(pItem, swap ? eslot : uint8(NULL_SLOT));
|
||||
@@ -11262,8 +11262,8 @@ InventoryResult Player::CanEquipItem(uint8 slot, uint16 &dest, Item* pItem, bool
|
||||
if (ItemTemplate const* pBagProto = pBag->GetTemplate())
|
||||
if (pBagProto->Class == pProto->Class && (!swap || pBag->GetSlot() != eslot))
|
||||
return (pBagProto->SubClass == ITEM_SUBCLASS_AMMO_POUCH)
|
||||
? EQUIP_ERR_CAN_EQUIP_ONLY1_AMMOPOUCH
|
||||
: EQUIP_ERR_CAN_EQUIP_ONLY1_QUIVER;
|
||||
? EQUIP_ERR_ONLY_ONE_AMMO
|
||||
: EQUIP_ERR_ONLY_ONE_QUIVER;
|
||||
|
||||
uint32 type = pProto->InventoryType;
|
||||
|
||||
@@ -11272,16 +11272,16 @@ InventoryResult Player::CanEquipItem(uint8 slot, uint16 &dest, Item* pItem, bool
|
||||
if (type == INVTYPE_WEAPON || type == INVTYPE_WEAPONOFFHAND)
|
||||
{
|
||||
if (!CanDualWield())
|
||||
return EQUIP_ERR_CANT_DUAL_WIELD;
|
||||
return EQUIP_ERR_2HSKILLNOTFOUND;
|
||||
}
|
||||
else if (type == INVTYPE_2HWEAPON)
|
||||
{
|
||||
if (!CanDualWield() || !CanTitanGrip())
|
||||
return EQUIP_ERR_CANT_DUAL_WIELD;
|
||||
return EQUIP_ERR_2HSKILLNOTFOUND;
|
||||
}
|
||||
|
||||
if (IsTwoHandUsed())
|
||||
return EQUIP_ERR_CANT_EQUIP_WITH_TWOHANDED;
|
||||
return EQUIP_ERR_2HANDED_EQUIPPED;
|
||||
}
|
||||
|
||||
// equip two-hand weapon case (with possible unequip 2 items)
|
||||
@@ -11290,10 +11290,10 @@ InventoryResult Player::CanEquipItem(uint8 slot, uint16 &dest, Item* pItem, bool
|
||||
if (eslot == EQUIPMENT_SLOT_OFFHAND)
|
||||
{
|
||||
if (!CanTitanGrip())
|
||||
return EQUIP_ERR_ITEM_CANT_BE_EQUIPPED;
|
||||
return EQUIP_ERR_NOT_EQUIPPABLE;
|
||||
}
|
||||
else if (eslot != EQUIPMENT_SLOT_MAINHAND)
|
||||
return EQUIP_ERR_ITEM_CANT_BE_EQUIPPED;
|
||||
return EQUIP_ERR_NOT_EQUIPPABLE;
|
||||
|
||||
if (!CanTitanGrip())
|
||||
{
|
||||
@@ -11303,7 +11303,7 @@ InventoryResult Player::CanEquipItem(uint8 slot, uint16 &dest, Item* pItem, bool
|
||||
if (offItem && (!not_loading ||
|
||||
CanUnequipItem(uint16(INVENTORY_SLOT_BAG_0) << 8 | EQUIPMENT_SLOT_OFFHAND, false) != EQUIP_ERR_OK ||
|
||||
CanStoreItem(NULL_BAG, NULL_SLOT, off_dest, offItem, false) != EQUIP_ERR_OK))
|
||||
return swap ? EQUIP_ERR_ITEMS_CANT_BE_SWAPPED : EQUIP_ERR_INVENTORY_FULL;
|
||||
return swap ? EQUIP_ERR_CANT_SWAP : EQUIP_ERR_INV_FULL;
|
||||
}
|
||||
}
|
||||
dest = ((INVENTORY_SLOT_BAG_0 << 8) | eslot);
|
||||
@@ -11311,7 +11311,7 @@ InventoryResult Player::CanEquipItem(uint8 slot, uint16 &dest, Item* pItem, bool
|
||||
}
|
||||
}
|
||||
|
||||
return !swap ? EQUIP_ERR_ITEM_NOT_FOUND : EQUIP_ERR_ITEMS_CANT_BE_SWAPPED;
|
||||
return !swap ? EQUIP_ERR_ITEM_NOT_FOUND : EQUIP_ERR_CANT_SWAP;
|
||||
}
|
||||
|
||||
InventoryResult Player::CanUnequipItem(uint16 pos, bool swap) const
|
||||
@@ -11334,7 +11334,7 @@ InventoryResult Player::CanUnequipItem(uint16 pos, bool swap) const
|
||||
|
||||
// item used
|
||||
if (pItem->m_lootGenerated)
|
||||
return EQUIP_ERR_ALREADY_LOOTED;
|
||||
return EQUIP_ERR_LOOT_GONE;
|
||||
|
||||
// do not allow unequipping gear except weapons, offhands, projectiles, relics in
|
||||
// - combat
|
||||
@@ -11350,7 +11350,7 @@ InventoryResult Player::CanUnequipItem(uint16 pos, bool swap) const
|
||||
}
|
||||
|
||||
if (!swap && pItem->IsNotEmptyBag())
|
||||
return EQUIP_ERR_CAN_ONLY_DO_WITH_EMPTY_BAGS;
|
||||
return EQUIP_ERR_DESTROY_NONEMPTY_BAG;
|
||||
|
||||
return EQUIP_ERR_OK;
|
||||
}
|
||||
@@ -11358,28 +11358,28 @@ InventoryResult Player::CanUnequipItem(uint16 pos, bool swap) const
|
||||
InventoryResult Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, Item* pItem, bool swap, bool not_loading) const
|
||||
{
|
||||
if (!pItem)
|
||||
return swap ? EQUIP_ERR_ITEMS_CANT_BE_SWAPPED : EQUIP_ERR_ITEM_NOT_FOUND;
|
||||
return swap ? EQUIP_ERR_CANT_SWAP : EQUIP_ERR_ITEM_NOT_FOUND;
|
||||
|
||||
uint32 count = pItem->GetCount();
|
||||
|
||||
sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: CanBankItem bag = %u, slot = %u, item = %u, count = %u", bag, slot, pItem->GetEntry(), pItem->GetCount());
|
||||
ItemTemplate const* pProto = pItem->GetTemplate();
|
||||
if (!pProto)
|
||||
return swap ? EQUIP_ERR_ITEMS_CANT_BE_SWAPPED : EQUIP_ERR_ITEM_NOT_FOUND;
|
||||
return swap ? EQUIP_ERR_CANT_SWAP : EQUIP_ERR_ITEM_NOT_FOUND;
|
||||
|
||||
// item used
|
||||
if (pItem->m_lootGenerated)
|
||||
return EQUIP_ERR_ALREADY_LOOTED;
|
||||
return EQUIP_ERR_LOOT_GONE;
|
||||
|
||||
if (pItem->IsBindedNotWith(this))
|
||||
return EQUIP_ERR_DONT_OWN_THAT_ITEM;
|
||||
return EQUIP_ERR_NOT_OWNER;
|
||||
|
||||
// Currency tokens are not supposed to be swapped out of their hidden bag
|
||||
if(pItem->IsCurrencyToken())
|
||||
{
|
||||
sLog->outError(LOG_FILTER_PLAYER, "Possible hacking attempt: Player %s [guid: %u] tried to move token [guid: %u, entry: %u] out of the currency bag!",
|
||||
GetName(), GetGUIDLow(), pItem->GetGUIDLow(), pProto->ItemId);
|
||||
return EQUIP_ERR_ITEMS_CANT_BE_SWAPPED;
|
||||
return EQUIP_ERR_CANT_SWAP;
|
||||
}
|
||||
|
||||
// check count of items (skip for auto move for same player from bank)
|
||||
@@ -11393,10 +11393,10 @@ InventoryResult Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest
|
||||
if (slot >= BANK_SLOT_BAG_START && slot < BANK_SLOT_BAG_END)
|
||||
{
|
||||
if (!pItem->IsBag())
|
||||
return EQUIP_ERR_ITEM_DOESNT_GO_TO_SLOT;
|
||||
return EQUIP_ERR_WRONG_SLOT;
|
||||
|
||||
if (slot - BANK_SLOT_BAG_START >= GetBankBagSlotCount())
|
||||
return EQUIP_ERR_MUST_PURCHASE_THAT_BAG_SLOT;
|
||||
return EQUIP_ERR_NO_BANK_SLOT;
|
||||
|
||||
res = CanUseItem(pItem, not_loading);
|
||||
if (res != EQUIP_ERR_OK)
|
||||
@@ -11417,7 +11417,7 @@ InventoryResult Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest
|
||||
if (bag != NULL_BAG)
|
||||
{
|
||||
if (pItem->IsNotEmptyBag())
|
||||
return EQUIP_ERR_NONEMPTY_BAG_OVER_OTHER_BAG;
|
||||
return EQUIP_ERR_BAG_IN_BAG;
|
||||
|
||||
// search stack in bag for merge to
|
||||
if (pProto->Stackable != 1)
|
||||
@@ -11548,16 +11548,16 @@ InventoryResult Player::CanUseItem(Item* pItem, bool not_loading) const
|
||||
sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: CanUseItem item = %u", pItem->GetEntry());
|
||||
|
||||
if (!isAlive() && not_loading)
|
||||
return EQUIP_ERR_YOU_ARE_DEAD;
|
||||
return EQUIP_ERR_PLAYER_DEAD;
|
||||
|
||||
//if (isStunned())
|
||||
// return EQUIP_ERR_YOU_ARE_STUNNED;
|
||||
// return EQUIP_ERR_GENERIC_STUNNED;
|
||||
|
||||
ItemTemplate const* pProto = pItem->GetTemplate();
|
||||
if (pProto)
|
||||
{
|
||||
if (pItem->IsBindedNotWith(this))
|
||||
return EQUIP_ERR_DONT_OWN_THAT_ITEM;
|
||||
return EQUIP_ERR_NOT_OWNER;
|
||||
|
||||
InventoryResult res = CanUseItem(pProto);
|
||||
if (res != EQUIP_ERR_OK)
|
||||
@@ -11570,7 +11570,7 @@ InventoryResult Player::CanUseItem(Item* pItem, bool not_loading) const
|
||||
// Armor that is binded to account can "morph" from plate to mail, etc. if skill is not learned yet.
|
||||
if (pProto->Quality == ITEM_QUALITY_HEIRLOOM && pProto->Class == ITEM_CLASS_ARMOR && !HasSkill(itemSkill))
|
||||
{
|
||||
// TODO: when you right-click already equipped item it throws EQUIP_ERR_NO_REQUIRED_PROFICIENCY.
|
||||
// TODO: when you right-click already equipped item it throws EQUIP_ERR_PROFICIENCY_NEEDED.
|
||||
|
||||
// In fact it's a visual bug, everything works properly... I need sniffs of operations with
|
||||
// binded to account items from off server.
|
||||
@@ -11588,7 +11588,7 @@ InventoryResult Player::CanUseItem(Item* pItem, bool not_loading) const
|
||||
}
|
||||
}
|
||||
if (!allowEquip && GetSkillValue(itemSkill) == 0)
|
||||
return EQUIP_ERR_NO_REQUIRED_PROFICIENCY;
|
||||
return EQUIP_ERR_PROFICIENCY_NEEDED;
|
||||
}
|
||||
|
||||
if (pProto->RequiredReputationFaction && uint32(GetReputationRank(pProto->RequiredReputationFaction)) < pProto->RequiredReputationRank)
|
||||
@@ -11607,31 +11607,31 @@ InventoryResult Player::CanUseItem(ItemTemplate const* proto) const
|
||||
if (proto)
|
||||
{
|
||||
if ((proto->Flags2 & ITEM_FLAGS_EXTRA_HORDE_ONLY) && GetTeam() != HORDE)
|
||||
return EQUIP_ERR_YOU_CAN_NEVER_USE_THAT_ITEM;
|
||||
return EQUIP_ERR_CANT_EQUIP_EVER;
|
||||
|
||||
if ((proto->Flags2 & ITEM_FLAGS_EXTRA_ALLIANCE_ONLY) && GetTeam() != ALLIANCE)
|
||||
return EQUIP_ERR_YOU_CAN_NEVER_USE_THAT_ITEM;
|
||||
return EQUIP_ERR_CANT_EQUIP_EVER;
|
||||
|
||||
if ((proto->AllowableClass & getClassMask()) == 0 || (proto->AllowableRace & getRaceMask()) == 0)
|
||||
return EQUIP_ERR_YOU_CAN_NEVER_USE_THAT_ITEM;
|
||||
return EQUIP_ERR_CANT_EQUIP_EVER;
|
||||
|
||||
if (proto->RequiredSkill != 0)
|
||||
{
|
||||
if (GetSkillValue(proto->RequiredSkill) == 0)
|
||||
return EQUIP_ERR_NO_REQUIRED_PROFICIENCY;
|
||||
return EQUIP_ERR_PROFICIENCY_NEEDED;
|
||||
else if (GetSkillValue(proto->RequiredSkill) < proto->RequiredSkillRank)
|
||||
return EQUIP_ERR_CANT_EQUIP_SKILL;
|
||||
}
|
||||
|
||||
if (proto->RequiredSpell != 0 && !HasSpell(proto->RequiredSpell))
|
||||
return EQUIP_ERR_NO_REQUIRED_PROFICIENCY;
|
||||
return EQUIP_ERR_PROFICIENCY_NEEDED;
|
||||
|
||||
if (getLevel() < proto->RequiredLevel)
|
||||
return EQUIP_ERR_CANT_EQUIP_LEVEL_I;
|
||||
|
||||
// If World Event is not active, prevent using event dependant items
|
||||
if (proto->HolidayId && !IsHolidayActive((HolidayIds)proto->HolidayId))
|
||||
return EQUIP_ERR_CANT_DO_RIGHT_NOW;
|
||||
return EQUIP_ERR_CLIENT_LOCKED_OUT;
|
||||
|
||||
return EQUIP_ERR_OK;
|
||||
}
|
||||
@@ -11673,15 +11673,15 @@ InventoryResult Player::CanRollForItemInLFG(ItemTemplate const* proto, WorldObje
|
||||
}; //Copy from function Item::GetSkill()
|
||||
|
||||
if ((proto->AllowableClass & getClassMask()) == 0 || (proto->AllowableRace & getRaceMask()) == 0)
|
||||
return EQUIP_ERR_YOU_CAN_NEVER_USE_THAT_ITEM;
|
||||
return EQUIP_ERR_CANT_EQUIP_EVER;
|
||||
|
||||
if (proto->RequiredSpell != 0 && !HasSpell(proto->RequiredSpell))
|
||||
return EQUIP_ERR_NO_REQUIRED_PROFICIENCY;
|
||||
return EQUIP_ERR_PROFICIENCY_NEEDED;
|
||||
|
||||
if (proto->RequiredSkill != 0)
|
||||
{
|
||||
if (!GetSkillValue(proto->RequiredSkill))
|
||||
return EQUIP_ERR_NO_REQUIRED_PROFICIENCY;
|
||||
return EQUIP_ERR_PROFICIENCY_NEEDED;
|
||||
else if (GetSkillValue(proto->RequiredSkill) < proto->RequiredSkillRank)
|
||||
return EQUIP_ERR_CANT_EQUIP_SKILL;
|
||||
}
|
||||
@@ -11689,7 +11689,7 @@ InventoryResult Player::CanRollForItemInLFG(ItemTemplate const* proto, WorldObje
|
||||
uint8 _class = getClass();
|
||||
|
||||
if (proto->Class == ITEM_CLASS_WEAPON && GetSkillValue(item_weapon_skills[proto->SubClass]) == 0)
|
||||
return EQUIP_ERR_NO_REQUIRED_PROFICIENCY;
|
||||
return EQUIP_ERR_PROFICIENCY_NEEDED;
|
||||
|
||||
if (proto->Class == ITEM_CLASS_ARMOR && proto->SubClass > ITEM_SUBCLASS_ARMOR_MISCELLANEOUS && proto->SubClass < ITEM_SUBCLASS_ARMOR_BUCKLER && proto->InventoryType != INVTYPE_CLOAK)
|
||||
{
|
||||
@@ -11698,29 +11698,29 @@ InventoryResult Player::CanRollForItemInLFG(ItemTemplate const* proto, WorldObje
|
||||
if (getLevel() < 40)
|
||||
{
|
||||
if (proto->SubClass != ITEM_SUBCLASS_ARMOR_MAIL)
|
||||
return EQUIP_ERR_CANT_DO_RIGHT_NOW;
|
||||
return EQUIP_ERR_CLIENT_LOCKED_OUT;
|
||||
}
|
||||
else if (proto->SubClass != ITEM_SUBCLASS_ARMOR_PLATE)
|
||||
return EQUIP_ERR_CANT_DO_RIGHT_NOW;
|
||||
return EQUIP_ERR_CLIENT_LOCKED_OUT;
|
||||
}
|
||||
else if (_class == CLASS_HUNTER || _class == CLASS_SHAMAN)
|
||||
{
|
||||
if (getLevel() < 40)
|
||||
{
|
||||
if (proto->SubClass != ITEM_SUBCLASS_ARMOR_LEATHER)
|
||||
return EQUIP_ERR_CANT_DO_RIGHT_NOW;
|
||||
return EQUIP_ERR_CLIENT_LOCKED_OUT;
|
||||
}
|
||||
else if (proto->SubClass != ITEM_SUBCLASS_ARMOR_MAIL)
|
||||
return EQUIP_ERR_CANT_DO_RIGHT_NOW;
|
||||
return EQUIP_ERR_CLIENT_LOCKED_OUT;
|
||||
}
|
||||
|
||||
if (_class == CLASS_ROGUE || _class == CLASS_DRUID)
|
||||
if (proto->SubClass != ITEM_SUBCLASS_ARMOR_LEATHER)
|
||||
return EQUIP_ERR_CANT_DO_RIGHT_NOW;
|
||||
return EQUIP_ERR_CLIENT_LOCKED_OUT;
|
||||
|
||||
if (_class == CLASS_MAGE || _class == CLASS_PRIEST || _class == CLASS_WARLOCK)
|
||||
if (proto->SubClass != ITEM_SUBCLASS_ARMOR_CLOTH)
|
||||
return EQUIP_ERR_CANT_DO_RIGHT_NOW;
|
||||
return EQUIP_ERR_CLIENT_LOCKED_OUT;
|
||||
}
|
||||
|
||||
return EQUIP_ERR_OK;
|
||||
@@ -12522,21 +12522,21 @@ void Player::SplitItem(uint16 src, uint16 dst, uint32 count)
|
||||
if (pSrcItem->m_lootGenerated) // prevent split looting item (item
|
||||
{
|
||||
//best error message found for attempting to split while looting
|
||||
SendEquipError(EQUIP_ERR_COULDNT_SPLIT_ITEMS, pSrcItem, NULL);
|
||||
SendEquipError(EQUIP_ERR_SPLIT_FAILED, pSrcItem, NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
// not let split all items (can be only at cheating)
|
||||
if (pSrcItem->GetCount() == count)
|
||||
{
|
||||
SendEquipError(EQUIP_ERR_COULDNT_SPLIT_ITEMS, pSrcItem, NULL);
|
||||
SendEquipError(EQUIP_ERR_SPLIT_FAILED, pSrcItem, NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
// not let split more existed items (can be only at cheating)
|
||||
if (pSrcItem->GetCount() < count)
|
||||
{
|
||||
SendEquipError(EQUIP_ERR_TRIED_TO_SPLIT_MORE_THAN_COUNT, pSrcItem, NULL);
|
||||
SendEquipError(EQUIP_ERR_TOO_FEW_TO_SPLIT, pSrcItem, NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -12637,7 +12637,7 @@ void Player::SwapItem(uint16 src, uint16 dst)
|
||||
|
||||
if (!isAlive())
|
||||
{
|
||||
SendEquipError(EQUIP_ERR_YOU_ARE_DEAD, pSrcItem, pDstItem);
|
||||
SendEquipError(EQUIP_ERR_PLAYER_DEAD, pSrcItem, pDstItem);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -12646,7 +12646,7 @@ void Player::SwapItem(uint16 src, uint16 dst)
|
||||
if (pSrcItem->m_lootGenerated) // prevent swap looting item
|
||||
{
|
||||
//best error message found for attempting to swap while looting
|
||||
SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, pSrcItem, NULL);
|
||||
SendEquipError(EQUIP_ERR_CLIENT_LOCKED_OUT, pSrcItem, NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -12665,14 +12665,14 @@ void Player::SwapItem(uint16 src, uint16 dst)
|
||||
// prevent put equipped/bank bag in self
|
||||
if (IsBagPos(src) && srcslot == dstbag)
|
||||
{
|
||||
SendEquipError(EQUIP_ERR_NONEMPTY_BAG_OVER_OTHER_BAG, pSrcItem, pDstItem);
|
||||
SendEquipError(EQUIP_ERR_BAG_IN_BAG, pSrcItem, pDstItem);
|
||||
return;
|
||||
}
|
||||
|
||||
// prevent equipping bag in the same slot from its inside
|
||||
if (IsBagPos(dst) && srcbag == dstslot)
|
||||
{
|
||||
SendEquipError(EQUIP_ERR_ITEMS_CANT_BE_SWAPPED, pSrcItem, pDstItem);
|
||||
SendEquipError(EQUIP_ERR_CANT_SWAP, pSrcItem, pDstItem);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -12683,7 +12683,7 @@ void Player::SwapItem(uint16 src, uint16 dst)
|
||||
if (pDstItem->m_lootGenerated) // prevent swap looting item
|
||||
{
|
||||
//best error message found for attempting to swap while looting
|
||||
SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, pDstItem, NULL);
|
||||
SendEquipError(EQUIP_ERR_CLIENT_LOCKED_OUT, pDstItem, NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -12880,7 +12880,7 @@ void Player::SwapItem(uint16 src, uint16 dst)
|
||||
if (!bagItemProto || !ItemCanGoIntoBag(bagItemProto, emptyProto))
|
||||
{
|
||||
// one from items not go to empty target bag
|
||||
SendEquipError(EQUIP_ERR_NONEMPTY_BAG_OVER_OTHER_BAG, pSrcItem, pDstItem);
|
||||
SendEquipError(EQUIP_ERR_BAG_IN_BAG, pSrcItem, pDstItem);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -12890,7 +12890,7 @@ void Player::SwapItem(uint16 src, uint16 dst)
|
||||
if (count > emptyBag->GetBagSize())
|
||||
{
|
||||
// too small targeted bag
|
||||
SendEquipError(EQUIP_ERR_ITEMS_CANT_BE_SWAPPED, pSrcItem, pDstItem);
|
||||
SendEquipError(EQUIP_ERR_CANT_SWAP, pSrcItem, pDstItem);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -13084,16 +13084,16 @@ void Player::SendEquipError(InventoryResult msg, Item* pItem, Item* pItem2, uint
|
||||
data << uint32(proto ? proto->RequiredLevel : 0);
|
||||
break;
|
||||
}
|
||||
case EQUIP_ERR_EVENT_AUTOEQUIP_BIND_CONFIRM: // no idea about this one...
|
||||
case EQUIP_ERR_NO_OUTPUT: // no idea about this one...
|
||||
{
|
||||
data << uint64(0); // item guid
|
||||
data << uint32(0); // slot
|
||||
data << uint64(0); // container
|
||||
break;
|
||||
}
|
||||
case EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_COUNT_EXCEEDED:
|
||||
case EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_SOCKETED_EXCEEDED:
|
||||
case EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_EQUIPPED_EXCEEDED:
|
||||
case EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_COUNT_EXCEEDED_IS:
|
||||
case EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_SOCKETED_EXCEEDED_IS:
|
||||
case EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_EQUIPPED_EXCEEDED_IS:
|
||||
{
|
||||
ItemTemplate const* proto = pItem ? pItem->GetTemplate() : sObjectMgr->GetItemTemplate(itemid);
|
||||
data << uint32(proto ? proto->ItemLimitCategory : 0);
|
||||
@@ -14630,7 +14630,7 @@ bool Player::CanAddQuest(Quest const* quest, bool msg)
|
||||
InventoryResult msg2 = CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, srcitem, count);
|
||||
|
||||
// player already have max number (in most case 1) source item, no additional item needed and quest can be added.
|
||||
if (msg2 == EQUIP_ERR_CANT_CARRY_MORE_OF_THIS)
|
||||
if (msg2 == EQUIP_ERR_ITEM_MAX_COUNT)
|
||||
return true;
|
||||
else if (msg2 != EQUIP_ERR_OK)
|
||||
{
|
||||
@@ -15543,7 +15543,7 @@ bool Player::GiveQuestSourceItem(Quest const* quest)
|
||||
return true;
|
||||
}
|
||||
// player already have max amount required item, just report success
|
||||
else if (msg == EQUIP_ERR_CANT_CARRY_MORE_OF_THIS)
|
||||
else if (msg == EQUIP_ERR_ITEM_MAX_COUNT)
|
||||
return true;
|
||||
else
|
||||
SendEquipError(msg, NULL, NULL, srcitem);
|
||||
@@ -17496,7 +17496,7 @@ void Player::_LoadInventory(PreparedQueryResult result, uint32 timeDiff)
|
||||
{
|
||||
std::map<uint64, Item*>::iterator itr = invalidBagMap.find(bagGuid);
|
||||
if (std::find(problematicItems.begin(),problematicItems.end(),itr->second) != problematicItems.end())
|
||||
err = EQUIP_ERR_INT_BAG_ERROR;
|
||||
err = EQUIP_ERR_INTERNAL_BAG_ERROR;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -21269,7 +21269,7 @@ bool Player::BuyItemFromVendorSlot(uint64 vendorguid, uint32 vendorslot, uint32
|
||||
{
|
||||
if (pProto->BuyCount * count != 1)
|
||||
{
|
||||
SendEquipError(EQUIP_ERR_ITEM_CANT_BE_EQUIPPED, NULL, NULL);
|
||||
SendEquipError(EQUIP_ERR_NOT_EQUIPPABLE, NULL, NULL);
|
||||
return false;
|
||||
}
|
||||
if (!_StoreOrEquipNewItem(vendorslot, item, count, bag, slot, price, pProto, creature, crItem, false))
|
||||
@@ -21277,7 +21277,7 @@ bool Player::BuyItemFromVendorSlot(uint64 vendorguid, uint32 vendorslot, uint32
|
||||
}
|
||||
else
|
||||
{
|
||||
SendEquipError(EQUIP_ERR_ITEM_DOESNT_GO_TO_SLOT, NULL, NULL);
|
||||
SendEquipError(EQUIP_ERR_WRONG_SLOT, NULL, NULL);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -23963,7 +23963,7 @@ void Player::StoreLootItem(uint8 lootSlot, Loot* loot)
|
||||
|
||||
if (!item)
|
||||
{
|
||||
SendEquipError(EQUIP_ERR_ALREADY_LOOTED, NULL, NULL);
|
||||
SendEquipError(EQUIP_ERR_LOOT_GONE, NULL, NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -24255,7 +24255,7 @@ InventoryResult Player::CanEquipUniqueItem(ItemTemplate const* itemProto, uint8
|
||||
{
|
||||
// there is an equip limit on this item
|
||||
if (HasItemOrGemWithIdEquipped(itemProto->ItemId, 1, except_slot))
|
||||
return EQUIP_ERR_ITEM_UNIQUE_EQUIPABLE;
|
||||
return EQUIP_ERR_ITEM_UNIQUE_EQUIPPABLE;
|
||||
}
|
||||
|
||||
// check unique-equipped limit
|
||||
@@ -24263,12 +24263,12 @@ InventoryResult Player::CanEquipUniqueItem(ItemTemplate const* itemProto, uint8
|
||||
{
|
||||
ItemLimitCategoryEntry const* limitEntry = sItemLimitCategoryStore.LookupEntry(itemProto->ItemLimitCategory);
|
||||
if (!limitEntry)
|
||||
return EQUIP_ERR_ITEM_CANT_BE_EQUIPPED;
|
||||
return EQUIP_ERR_NOT_EQUIPPABLE;
|
||||
|
||||
// NOTE: limitEntry->mode not checked because if item have have-limit then it applied and to equip case
|
||||
|
||||
if (limit_count > limitEntry->maxCount)
|
||||
return EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_EQUIPPED_EXCEEDED;
|
||||
return EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_EQUIPPED_EXCEEDED_IS;
|
||||
|
||||
// there is an equip limit on this item
|
||||
if (HasItemOrGemWithLimitCategoryEquipped(itemProto->ItemLimitCategory, limitEntry->maxCount - limit_count + 1, except_slot))
|
||||
@@ -25756,7 +25756,7 @@ uint8 Player::AddVoidStorageItem(const VoidStorageItem& item)
|
||||
if (slot >= VOID_STORAGE_MAX_SLOT)
|
||||
{
|
||||
GetSession()->SendVoidStorageTransferResult(VOID_TRANSFER_ERROR_FULL);
|
||||
return -1;
|
||||
return 255;
|
||||
}
|
||||
|
||||
_voidStorageItems[slot] = new VoidStorageItem(item.ItemId, item.ItemEntry,
|
||||
|
||||
@@ -764,13 +764,13 @@ bool Guild::PlayerMoveItemData::InitItem()
|
||||
// Anti-WPE protection. Do not move non-empty bags to bank.
|
||||
if (m_pItem->IsNotEmptyBag())
|
||||
{
|
||||
m_pPlayer->SendEquipError(EQUIP_ERR_CAN_ONLY_DO_WITH_EMPTY_BAGS, m_pItem);
|
||||
m_pPlayer->SendEquipError(EQUIP_ERR_DESTROY_NONEMPTY_BAG, m_pItem);
|
||||
m_pItem = NULL;
|
||||
}
|
||||
// Bound items cannot be put into bank.
|
||||
else if (!m_pItem->CanBeTraded())
|
||||
{
|
||||
m_pPlayer->SendEquipError(EQUIP_ERR_ITEMS_CANT_BE_SWAPPED, m_pItem);
|
||||
m_pPlayer->SendEquipError(EQUIP_ERR_CANT_SWAP, m_pItem);
|
||||
m_pItem = NULL;
|
||||
}
|
||||
}
|
||||
@@ -989,11 +989,11 @@ InventoryResult Guild::BankMoveItemData::CanStore(Item* pItem, bool swap)
|
||||
uint32 count = pItem->GetCount();
|
||||
// Soulbound items cannot be moved
|
||||
if (pItem->IsSoulBound())
|
||||
return EQUIP_ERR_CANT_DROP_SOULBOUND;
|
||||
return EQUIP_ERR_DROP_BOUND_ITEM;
|
||||
|
||||
// Make sure destination bank tab exists
|
||||
if (m_container >= m_pGuild->_GetPurchasedTabsSize())
|
||||
return EQUIP_ERR_ITEM_DOESNT_GO_INTO_BAG;
|
||||
return EQUIP_ERR_WRONG_BAG_TYPE;
|
||||
|
||||
// Slot explicitely specified. Check it.
|
||||
if (m_slotId != NULL_SLOT)
|
||||
@@ -1004,7 +1004,7 @@ InventoryResult Guild::BankMoveItemData::CanStore(Item* pItem, bool swap)
|
||||
pItemDest = NULL;
|
||||
|
||||
if (!_ReserveSpace(m_slotId, pItem, pItemDest, count))
|
||||
return EQUIP_ERR_ITEM_CANT_STACK;
|
||||
return EQUIP_ERR_CANT_STACK;
|
||||
|
||||
if (count == 0)
|
||||
return EQUIP_ERR_OK;
|
||||
|
||||
@@ -591,7 +591,7 @@ void WorldSession::HandleGuildBankSwapItems(WorldPacket & recvData)
|
||||
// Player <-> Bank
|
||||
// Allow to work with inventory only
|
||||
if (!Player::IsInventoryPos(playerBag, playerSlotId) && !(playerBag == NULL_BAG && playerSlotId == NULL_SLOT))
|
||||
GetPlayer()->SendEquipError(EQUIP_ERR_NONE, NULL);
|
||||
GetPlayer()->SendEquipError(EQUIP_ERR_INTERNAL_BAG_ERROR, NULL);
|
||||
else
|
||||
guild->SwapItemsWithInventory(GetPlayer(), toChar, tabId, slotId, playerBag, playerSlotId, splitedAmount);
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ void WorldSession::HandleSplitItemOpcode(WorldPacket& recvData)
|
||||
|
||||
if (!_player->IsValidPos(dstbag, dstslot, false)) // can be autostore pos
|
||||
{
|
||||
_player->SendEquipError(EQUIP_ERR_ITEM_DOESNT_GO_TO_SLOT, NULL, NULL);
|
||||
_player->SendEquipError(EQUIP_ERR_WRONG_SLOT, NULL, NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ void WorldSession::HandleSwapInvItemOpcode(WorldPacket & recvData)
|
||||
|
||||
if (!_player->IsValidPos(INVENTORY_SLOT_BAG_0, dstslot, true))
|
||||
{
|
||||
_player->SendEquipError(EQUIP_ERR_ITEM_DOESNT_GO_TO_SLOT, NULL, NULL);
|
||||
_player->SendEquipError(EQUIP_ERR_WRONG_SLOT, NULL, NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -134,7 +134,7 @@ void WorldSession::HandleSwapItem(WorldPacket& recvData)
|
||||
|
||||
if (!_player->IsValidPos(dstbag, dstslot, true))
|
||||
{
|
||||
_player->SendEquipError(EQUIP_ERR_ITEM_DOESNT_GO_TO_SLOT, NULL, NULL);
|
||||
_player->SendEquipError(EQUIP_ERR_WRONG_SLOT, NULL, NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -265,7 +265,7 @@ void WorldSession::HandleDestroyItemOpcode(WorldPacket & recvData)
|
||||
|
||||
if (pItem->GetTemplate()->Flags & ITEM_PROTO_FLAG_INDESTRUCTIBLE)
|
||||
{
|
||||
_player->SendEquipError(EQUIP_ERR_CANT_DROP_SOULBOUND, NULL, NULL);
|
||||
_player->SendEquipError(EQUIP_ERR_DROP_BOUND_ITEM, NULL, NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -885,7 +885,7 @@ void WorldSession::HandleAutoStoreBagItemOpcode(WorldPacket& recvData)
|
||||
|
||||
if (!_player->IsValidPos(dstbag, NULL_SLOT, false)) // can be autostore pos
|
||||
{
|
||||
_player->SendEquipError(EQUIP_ERR_ITEM_DOESNT_GO_TO_SLOT, NULL, NULL);
|
||||
_player->SendEquipError(EQUIP_ERR_WRONG_SLOT, NULL, NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -914,7 +914,7 @@ void WorldSession::HandleAutoStoreBagItemOpcode(WorldPacket& recvData)
|
||||
if (dest.size() == 1 && dest[0].pos == src)
|
||||
{
|
||||
// just remove grey item state
|
||||
_player->SendEquipError(EQUIP_ERR_NONE, pItem, NULL);
|
||||
_player->SendEquipError(EQUIP_ERR_INTERNAL_BAG_ERROR, pItem, NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -997,7 +997,7 @@ void WorldSession::HandleAutoBankItemOpcode(WorldPacket& recvPacket)
|
||||
|
||||
if (dest.size() == 1 && dest[0].pos == pItem->GetPos())
|
||||
{
|
||||
_player->SendEquipError(EQUIP_ERR_NONE, pItem, NULL);
|
||||
_player->SendEquipError(EQUIP_ERR_CANT_SWAP, pItem, NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1102,44 +1102,44 @@ void WorldSession::HandleWrapItemOpcode(WorldPacket& recvData)
|
||||
|
||||
if (item == gift) // not possable with pacjket from real client
|
||||
{
|
||||
_player->SendEquipError(EQUIP_ERR_WRAPPED_CANT_BE_WRAPPED, item, NULL);
|
||||
_player->SendEquipError(EQUIP_ERR_CANT_WRAP_WRAPPED, item, NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
if (item->IsEquipped())
|
||||
{
|
||||
_player->SendEquipError(EQUIP_ERR_EQUIPPED_CANT_BE_WRAPPED, item, NULL);
|
||||
_player->SendEquipError(EQUIP_ERR_CANT_WRAP_EQUIPPED, item, NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
if (item->GetUInt64Value(ITEM_FIELD_GIFTCREATOR)) // HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAGS_WRAPPED);
|
||||
{
|
||||
_player->SendEquipError(EQUIP_ERR_WRAPPED_CANT_BE_WRAPPED, item, NULL);
|
||||
_player->SendEquipError(EQUIP_ERR_CANT_WRAP_WRAPPED, item, NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
if (item->IsBag())
|
||||
{
|
||||
_player->SendEquipError(EQUIP_ERR_BAGS_CANT_BE_WRAPPED, item, NULL);
|
||||
_player->SendEquipError(EQUIP_ERR_CANT_WRAP_BAGS, item, NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
if (item->IsSoulBound())
|
||||
{
|
||||
_player->SendEquipError(EQUIP_ERR_BOUND_CANT_BE_WRAPPED, item, NULL);
|
||||
_player->SendEquipError(EQUIP_ERR_CANT_WRAP_BOUND, item, NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
if (item->GetMaxStackCount() != 1)
|
||||
{
|
||||
_player->SendEquipError(EQUIP_ERR_STACKABLE_CANT_BE_WRAPPED, item, NULL);
|
||||
_player->SendEquipError(EQUIP_ERR_CANT_WRAP_STACKABLE, item, NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
// maybe not correct check (it is better than nothing)
|
||||
if (item->GetTemplate()->MaxCount>0)
|
||||
if (item->GetTemplate()->MaxCount > 0)
|
||||
{
|
||||
_player->SendEquipError(EQUIP_ERR_UNIQUE_CANT_BE_WRAPPED, item, NULL);
|
||||
_player->SendEquipError(EQUIP_ERR_CANT_WRAP_UNIQUE, item, NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -483,7 +483,7 @@ void WorldSession::HandleLootMasterGiveOpcode(WorldPacket& recvData)
|
||||
ItemPosCountVec dest;
|
||||
InventoryResult msg = target->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, item.itemid, item.count);
|
||||
if (item.follow_loot_rules && !item.AllowedForPlayer(target))
|
||||
msg = EQUIP_ERR_YOU_CAN_NEVER_USE_THAT_ITEM;
|
||||
msg = EQUIP_ERR_CANT_EQUIP_EVER;
|
||||
if (msg != EQUIP_ERR_OK)
|
||||
{
|
||||
target->SendEquipError(msg, NULL, NULL, item.itemid);
|
||||
|
||||
@@ -259,7 +259,7 @@ void WorldSession::HandleSendMail(WorldPacket& recvData)
|
||||
|
||||
if (item->IsBoundAccountWide() && item->IsSoulBound() && player->GetSession()->GetAccountId() != rc_account)
|
||||
{
|
||||
player->SendMailResult(0, MAIL_SEND, MAIL_ERR_EQUIP_ERROR, EQUIP_ERR_ARTEFACTS_ONLY_FOR_OWN_CHARACTERS);
|
||||
player->SendMailResult(0, MAIL_SEND, MAIL_ERR_EQUIP_ERROR, EQUIP_ERR_NOT_SAME_ACCOUNT);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -277,7 +277,7 @@ void WorldSession::HandleSendMail(WorldPacket& recvData)
|
||||
|
||||
if (item->IsNotEmptyBag())
|
||||
{
|
||||
player->SendMailResult(0, MAIL_SEND, MAIL_ERR_EQUIP_ERROR, EQUIP_ERR_CAN_ONLY_DO_WITH_EMPTY_BAGS);
|
||||
player->SendMailResult(0, MAIL_SEND, MAIL_ERR_EQUIP_ERROR, EQUIP_ERR_DESTROY_NONEMPTY_BAG);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -228,7 +228,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))
|
||||
{
|
||||
pUser->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, item, NULL);
|
||||
pUser->SendEquipError(EQUIP_ERR_CLIENT_LOCKED_OUT, item, NULL);
|
||||
sLog->outError(LOG_FILTER_NETWORKIO, "Possible hacking attempt: Player %s [guid: %u] tried to open item [guid: %u, entry: %u] which is not openable!",
|
||||
pUser->GetName(), pUser->GetGUIDLow(), item->GetGUIDLow(), proto->ItemId);
|
||||
return;
|
||||
|
||||
@@ -791,14 +791,14 @@ void Aura::SetCharges(uint8 charges)
|
||||
|
||||
uint8 Aura::CalcMaxCharges(Unit* caster) const
|
||||
{
|
||||
uint8 maxProcCharges = m_spellInfo->ProcCharges;
|
||||
uint32 maxProcCharges = m_spellInfo->ProcCharges;
|
||||
if (SpellProcEntry const* procEntry = sSpellMgr->GetSpellProcEntry(GetId()))
|
||||
maxProcCharges = procEntry->charges;
|
||||
|
||||
if (caster)
|
||||
if (Player* modOwner = caster->GetSpellModOwner())
|
||||
modOwner->ApplySpellMod(GetId(), SPELLMOD_CHARGES, maxProcCharges);
|
||||
return maxProcCharges;
|
||||
return uint8(maxProcCharges);
|
||||
}
|
||||
|
||||
bool Aura::ModCharges(int32 num, AuraRemoveMode removeMode)
|
||||
|
||||
@@ -1549,7 +1549,7 @@ void Spell::DoCreateItem(uint32 /*i*/, uint32 itemtype)
|
||||
if (msg != EQUIP_ERR_OK)
|
||||
{
|
||||
// convert to possible store amount
|
||||
if (msg == EQUIP_ERR_INVENTORY_FULL || msg == EQUIP_ERR_CANT_CARRY_MORE_OF_THIS)
|
||||
if (msg == EQUIP_ERR_INV_FULL || msg == EQUIP_ERR_ITEM_MAX_COUNT)
|
||||
num_to_add -= no_space;
|
||||
else
|
||||
{
|
||||
@@ -2070,9 +2070,9 @@ void Spell::EffectSummonChangeItem(SpellEffIndex effIndex)
|
||||
|
||||
uint8 msg = player->CanEquipItem(m_CastItem->GetSlot(), dest, pNewItem, true);
|
||||
|
||||
if (msg == EQUIP_ERR_OK || msg == EQUIP_ERR_CANT_DO_RIGHT_NOW)
|
||||
if (msg == EQUIP_ERR_OK || msg == EQUIP_ERR_CLIENT_LOCKED_OUT)
|
||||
{
|
||||
if (msg == EQUIP_ERR_CANT_DO_RIGHT_NOW) dest = EQUIPMENT_SLOT_MAINHAND;
|
||||
if (msg == EQUIP_ERR_CLIENT_LOCKED_OUT) dest = EQUIPMENT_SLOT_MAINHAND;
|
||||
|
||||
// prevent crash at access and unexpected charges counting with item update queue corrupt
|
||||
if (m_CastItem == m_targets.GetItemTarget())
|
||||
|
||||
@@ -75,7 +75,7 @@ public:
|
||||
return false;
|
||||
|
||||
// error
|
||||
player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, item, NULL);
|
||||
player->SendEquipError(EQUIP_ERR_CLIENT_LOCKED_OUT, item, NULL);
|
||||
return true;
|
||||
}
|
||||
};
|
||||
@@ -118,7 +118,7 @@ public:
|
||||
targets.GetUnitTarget()->GetEntry() == 20748 && !targets.GetUnitTarget()->HasAura(32578))
|
||||
return false;
|
||||
|
||||
player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, item, NULL);
|
||||
player->SendEquipError(EQUIP_ERR_CLIENT_LOCKED_OUT, item, NULL);
|
||||
return true;
|
||||
}
|
||||
};
|
||||
@@ -267,15 +267,13 @@ class item_petrov_cluster_bombs : public ItemScript
|
||||
public:
|
||||
item_petrov_cluster_bombs() : ItemScript("item_petrov_cluster_bombs") { }
|
||||
|
||||
bool OnUse(Player* player, Item* item, const SpellCastTargets & /*targets*/)
|
||||
bool OnUse(Player* player, Item* /*item*/, const SpellCastTargets & /*targets*/)
|
||||
{
|
||||
if (player->GetZoneId() != ZONE_ID_HOWLING)
|
||||
return false;
|
||||
|
||||
if (!player->GetTransport() || player->GetAreaId() != AREA_ID_SHATTERED_STRAITS)
|
||||
{
|
||||
player->SendEquipError(EQUIP_ERR_NONE, item, NULL);
|
||||
|
||||
if (const SpellInfo* spellInfo = sSpellMgr->GetSpellInfo(SPELL_PETROV_BOMB))
|
||||
Spell::SendCastResult(player, spellInfo, 1, SPELL_FAILED_NOT_HERE);
|
||||
|
||||
@@ -380,7 +378,7 @@ public:
|
||||
} else
|
||||
player->SendEquipError(EQUIP_ERR_OUT_OF_RANGE, item, NULL);
|
||||
} else
|
||||
player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, item, NULL);
|
||||
player->SendEquipError(EQUIP_ERR_CLIENT_LOCKED_OUT, item, NULL);
|
||||
return true;
|
||||
}
|
||||
};
|
||||
@@ -406,7 +404,7 @@ public:
|
||||
player->SendEquipError(EQUIP_ERR_OUT_OF_RANGE, item, NULL);
|
||||
}
|
||||
else
|
||||
player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, item, NULL);
|
||||
player->SendEquipError(EQUIP_ERR_CLIENT_LOCKED_OUT, item, NULL);
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -361,7 +361,7 @@ void ProcessUnlearnAction(Player* player, Creature* creature, uint32 spellId, ui
|
||||
player->SendBuyError(BUY_ERR_NOT_ENOUGHT_MONEY, creature, 0, 0);
|
||||
}
|
||||
else
|
||||
player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, NULL, NULL);
|
||||
player->SendEquipError(EQUIP_ERR_CLIENT_LOCKED_OUT, NULL, NULL);
|
||||
player->CLOSE_GOSSIP_MENU();
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user