Open
Description
It would be nice to have the option to unlock looted items regardless of whether they are soulbound / bind when picked up.
This seems relatively easy to implement. Just need to create a new setting and add it to the conditions on loot/create/store item. Some pseudo code / examples below:
Transmogrification.cpp
void Transmogrification::LoadConfig(bool reload)
{
...
alwaysUnlock = sConfigMgr->GetOption<bool>("Transmogrification.AlwaysUnlock", false);
...
}
bool Transmogrification::GetAlwaysUnlock() const
{
return alwaysUnlock;
}
transmog_scripts.cpp
void OnLootItem(Player* player, Item* item, uint32 /*count*/, ObjectGuid /*lootguid*/) override
{
if (!sT->GetUseCollectionSystem() || !item)
return;
if (sT->GetAlwaysUnlock() || item->GetTemplate()->Bonding == ItemBondingType::BIND_WHEN_PICKED_UP || item->IsSoulBound())
{
AddToDatabase(player, item);
}
}
void OnCreateItem(Player* player, Item* item, uint32 /*count*/) override
{
if (!sT->GetUseCollectionSystem())
return;
if (sT->GetAlwaysUnlock() || item->GetTemplate()->Bonding == ItemBondingType::BIND_WHEN_PICKED_UP || item->IsSoulBound())
{
AddToDatabase(player, item);
}
}
void OnAfterStoreOrEquipNewItem(Player* player, uint32 /*vendorslot*/, Item* item, uint8 /*count*/, uint8 /*bag*/, uint8 /*slot*/, ItemTemplate const* /*pProto*/, Creature* /*pVendor*/, VendorItem const* /*crItem*/, bool /*bStore*/) override
{
if (!sT->GetUseCollectionSystem())
return;
if (sT->GetAlwaysUnlock() || item->GetTemplate()->Bonding == ItemBondingType::BIND_WHEN_PICKED_UP || item->IsSoulBound())
{
AddToDatabase(player, item);
}
}
Metadata
Metadata
Assignees
Labels
No labels