Core/Items: Removed invalid item bind type 5
This commit is contained in:
@@ -142,23 +142,23 @@ bool AuctionBotSeller::Initialize()
|
||||
// bounding filters
|
||||
switch (prototype->GetBonding())
|
||||
{
|
||||
case NO_BIND:
|
||||
case BIND_NONE:
|
||||
if (!sAuctionBotConfig->GetConfig(CONFIG_AHBOT_BIND_NO))
|
||||
continue;
|
||||
break;
|
||||
case BIND_WHEN_PICKED_UP:
|
||||
case BIND_ON_ACQUIRE:
|
||||
if (!sAuctionBotConfig->GetConfig(CONFIG_AHBOT_BIND_PICKUP))
|
||||
continue;
|
||||
break;
|
||||
case BIND_WHEN_EQUIPED:
|
||||
case BIND_ON_EQUIP:
|
||||
if (!sAuctionBotConfig->GetConfig(CONFIG_AHBOT_BIND_EQUIP))
|
||||
continue;
|
||||
break;
|
||||
case BIND_WHEN_USE:
|
||||
case BIND_ON_USE:
|
||||
if (!sAuctionBotConfig->GetConfig(CONFIG_AHBOT_BIND_USE))
|
||||
continue;
|
||||
break;
|
||||
case BIND_QUEST_ITEM:
|
||||
case BIND_QUEST:
|
||||
if (!sAuctionBotConfig->GetConfig(CONFIG_AHBOT_BIND_QUEST))
|
||||
continue;
|
||||
break;
|
||||
|
||||
@@ -670,8 +670,8 @@ bool Item::LoadFromDB(ObjectGuid::LowType guid, ObjectGuid ownerGuid, Field* fie
|
||||
SetSpellCharges(i, atoi(tokens[i]));
|
||||
|
||||
SetUInt32Value(ITEM_FIELD_FLAGS, itemFlags);
|
||||
// Remove bind flag for items vs NO_BIND set
|
||||
if (IsSoulBound() && proto->GetBonding() == NO_BIND)
|
||||
// Remove bind flag for items vs BIND_NONE set
|
||||
if (IsSoulBound() && proto->GetBonding() == BIND_NONE)
|
||||
{
|
||||
ApplyModFlag(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_SOULBOUND, false);
|
||||
need_save = true;
|
||||
|
||||
@@ -117,15 +117,14 @@ enum ItemSpelltriggerType
|
||||
|
||||
enum ItemBondingType
|
||||
{
|
||||
NO_BIND = 0,
|
||||
BIND_WHEN_PICKED_UP = 1,
|
||||
BIND_WHEN_EQUIPED = 2,
|
||||
BIND_WHEN_USE = 3,
|
||||
BIND_QUEST_ITEM = 4,
|
||||
BIND_QUEST_ITEM1 = 5 // not used in game
|
||||
BIND_NONE = 0,
|
||||
BIND_ON_ACQUIRE = 1,
|
||||
BIND_ON_EQUIP = 2,
|
||||
BIND_ON_USE = 3,
|
||||
BIND_QUEST = 4,
|
||||
};
|
||||
|
||||
#define MAX_BIND_TYPE 6
|
||||
#define MAX_BIND_TYPE 5
|
||||
|
||||
/* /// @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 */
|
||||
|
||||
@@ -11634,9 +11634,9 @@ Item* Player::_StoreItem(uint16 pos, Item* pItem, uint32 count, bool clone, bool
|
||||
if (!pItem)
|
||||
return nullptr;
|
||||
|
||||
if (pItem->GetTemplate()->GetBonding() == BIND_WHEN_PICKED_UP ||
|
||||
pItem->GetTemplate()->GetBonding() == BIND_QUEST_ITEM ||
|
||||
(pItem->GetTemplate()->GetBonding() == BIND_WHEN_EQUIPED && IsBagPos(pos)))
|
||||
if (pItem->GetTemplate()->GetBonding() == BIND_ON_ACQUIRE ||
|
||||
pItem->GetTemplate()->GetBonding() == BIND_QUEST ||
|
||||
(pItem->GetTemplate()->GetBonding() == BIND_ON_EQUIP && IsBagPos(pos)))
|
||||
pItem->SetBinding(true);
|
||||
|
||||
Bag* pBag = (bag == INVENTORY_SLOT_BAG_0) ? NULL : GetBagByPos(bag);
|
||||
@@ -11677,9 +11677,9 @@ Item* Player::_StoreItem(uint16 pos, Item* pItem, uint32 count, bool clone, bool
|
||||
}
|
||||
else
|
||||
{
|
||||
if (pItem2->GetTemplate()->GetBonding() == BIND_WHEN_PICKED_UP ||
|
||||
pItem2->GetTemplate()->GetBonding() == BIND_QUEST_ITEM ||
|
||||
(pItem2->GetTemplate()->GetBonding() == BIND_WHEN_EQUIPED && IsBagPos(pos)))
|
||||
if (pItem2->GetTemplate()->GetBonding() == BIND_ON_ACQUIRE ||
|
||||
pItem2->GetTemplate()->GetBonding() == BIND_QUEST ||
|
||||
(pItem2->GetTemplate()->GetBonding() == BIND_ON_EQUIP && IsBagPos(pos)))
|
||||
pItem2->SetBinding(true);
|
||||
|
||||
pItem2->SetCount(pItem2->GetCount() + count);
|
||||
@@ -11980,8 +11980,8 @@ void Player::VisualizeItem(uint8 slot, Item* pItem)
|
||||
if (!pItem)
|
||||
return;
|
||||
|
||||
// check also BIND_WHEN_PICKED_UP and BIND_QUEST_ITEM for .additem or .additemset case by GM (not binded at adding to inventory)
|
||||
if (pItem->GetTemplate()->GetBonding() == BIND_WHEN_EQUIPED || pItem->GetTemplate()->GetBonding() == BIND_WHEN_PICKED_UP || pItem->GetTemplate()->GetBonding() == BIND_QUEST_ITEM)
|
||||
// check also BIND_ON_ACQUIRE and BIND_QUEST for .additem or .additemset case by GM (not binded at adding to inventory)
|
||||
if (pItem->GetTemplate()->GetBonding() == BIND_ON_EQUIP || pItem->GetTemplate()->GetBonding() == BIND_ON_ACQUIRE || pItem->GetTemplate()->GetBonding() == BIND_QUEST)
|
||||
{
|
||||
pItem->SetBinding(true);
|
||||
if (IsInWorld())
|
||||
@@ -15205,13 +15205,13 @@ void Player::FailQuest(uint32 questId)
|
||||
for (QuestObjective const& obj : quest->GetObjectives())
|
||||
if (obj.Type == QUEST_OBJECTIVE_ITEM)
|
||||
if (ItemTemplate const* itemTemplate = sObjectMgr->GetItemTemplate(obj.ObjectID))
|
||||
if (itemTemplate->GetBonding() == BIND_QUEST_ITEM || itemTemplate->GetBonding() == BIND_QUEST_ITEM1)
|
||||
if (itemTemplate->GetBonding() == BIND_QUEST)
|
||||
DestroyItemCount(obj.ObjectID, obj.Amount, true, true);
|
||||
|
||||
// Destroy items received during the quest.
|
||||
for (uint8 i = 0; i < QUEST_ITEM_DROP_COUNT; ++i)
|
||||
if (ItemTemplate const* itemTemplate = sObjectMgr->GetItemTemplate(quest->ItemDrop[i]))
|
||||
if (quest->ItemDropQuantity[i] && (itemTemplate->GetBonding() == BIND_QUEST_ITEM || itemTemplate->GetBonding() == BIND_QUEST_ITEM1))
|
||||
if (quest->ItemDropQuantity[i] && itemTemplate->GetBonding() == BIND_QUEST)
|
||||
DestroyItemCount(quest->ItemDrop[i], quest->ItemDropQuantity[i], true, true);
|
||||
}
|
||||
}
|
||||
@@ -15224,13 +15224,13 @@ void Player::AbandonQuest(uint32 questId)
|
||||
for (QuestObjective const& obj : quest->GetObjectives())
|
||||
if (obj.Type == QUEST_OBJECTIVE_ITEM)
|
||||
if (ItemTemplate const* itemTemplate = sObjectMgr->GetItemTemplate(obj.ObjectID))
|
||||
if (itemTemplate->GetBonding() == BIND_QUEST_ITEM || itemTemplate->GetBonding() == BIND_QUEST_ITEM1)
|
||||
if (itemTemplate->GetBonding() == BIND_QUEST)
|
||||
DestroyItemCount(obj.ObjectID, obj.Amount, true, true);
|
||||
|
||||
// Destroy items received during the quest.
|
||||
for (uint8 i = 0; i < QUEST_ITEM_DROP_COUNT; ++i)
|
||||
if (ItemTemplate const* itemTemplate = sObjectMgr->GetItemTemplate(quest->ItemDrop[i]))
|
||||
if (quest->ItemDropQuantity[i] && (itemTemplate->GetBonding() == BIND_QUEST_ITEM || itemTemplate->GetBonding() == BIND_QUEST_ITEM1))
|
||||
if (quest->ItemDropQuantity[i] && itemTemplate->GetBonding() == BIND_QUEST)
|
||||
DestroyItemCount(quest->ItemDrop[i], quest->ItemDropQuantity[i], true, true);
|
||||
}
|
||||
}
|
||||
@@ -22045,7 +22045,7 @@ bool Player::BuyItemFromVendorSlot(ObjectGuid vendorguid, uint32 vendorslot, uin
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!(pProto->GetAllowableClass() & getClassMask()) && pProto->GetBonding() == BIND_WHEN_PICKED_UP && !IsGameMaster())
|
||||
if (!(pProto->GetAllowableClass() & getClassMask()) && pProto->GetBonding() == BIND_ON_ACQUIRE && !IsGameMaster())
|
||||
{
|
||||
SendBuyError(BUY_ERR_CANT_FIND_ITEM, nullptr, item, 0);
|
||||
return false;
|
||||
|
||||
@@ -2480,7 +2480,7 @@ void FillDisenchantFields(uint32* disenchantID, uint32* requiredDisenchantSkill,
|
||||
*disenchantID = 0;
|
||||
*(int32*)requiredDisenchantSkill = -1;
|
||||
if ((itemTemplate.GetFlags() & (ITEM_FLAG_CONJURED | ITEM_FLAG_NO_DISENCHANT)) ||
|
||||
itemTemplate.GetBonding() == BIND_QUEST_ITEM || itemTemplate.GetArea() || itemTemplate.GetMap() ||
|
||||
itemTemplate.GetBonding() == BIND_QUEST || itemTemplate.GetArea() || itemTemplate.GetMap() ||
|
||||
itemTemplate.GetMaxStackSize() > 1 ||
|
||||
itemTemplate.GetQuality() < ITEM_QUALITY_UNCOMMON || itemTemplate.GetQuality() > ITEM_QUALITY_EPIC ||
|
||||
!(itemTemplate.GetClass() == ITEM_CLASS_ARMOR || itemTemplate.GetClass() == ITEM_CLASS_WEAPON) ||
|
||||
|
||||
@@ -619,7 +619,7 @@ void WorldSession::SendListInventory(ObjectGuid vendorGuid)
|
||||
if (!_player->IsGameMaster()) // ignore conditions if GM on
|
||||
{
|
||||
// Respect allowed class
|
||||
if (!(itemTemplate->GetAllowableClass() & _player->getClassMask()) && itemTemplate->GetBonding() == BIND_WHEN_PICKED_UP)
|
||||
if (!(itemTemplate->GetAllowableClass() & _player->getClassMask()) && itemTemplate->GetBonding() == BIND_ON_ACQUIRE)
|
||||
continue;
|
||||
|
||||
// Only display items in vendor lists for the team the player is on
|
||||
|
||||
@@ -105,8 +105,8 @@ void WorldSession::HandleUseItemOpcode(WorldPackets::Spells::UseItem& packet)
|
||||
}
|
||||
}
|
||||
|
||||
// check also BIND_WHEN_PICKED_UP and BIND_QUEST_ITEM for .additem or .additemset case by GM (not binded at adding to inventory)
|
||||
if (item->GetTemplate()->GetBonding() == BIND_WHEN_USE || item->GetTemplate()->GetBonding() == BIND_WHEN_PICKED_UP || item->GetTemplate()->GetBonding() == BIND_QUEST_ITEM)
|
||||
// check also BIND_ON_ACQUIRE and BIND_QUEST for .additem or .additemset case by GM (not binded at adding to inventory)
|
||||
if (item->GetTemplate()->GetBonding() == BIND_ON_USE || item->GetTemplate()->GetBonding() == BIND_ON_ACQUIRE || item->GetTemplate()->GetBonding() == BIND_QUEST)
|
||||
{
|
||||
if (!item->IsSoulBound())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user