azerothcore / azerothcore/mod-transmog
Suggestion: Add config to allow unlocks regardless of item bonding type
- Dominant language
- C++
- Stars
- 189
- Forks
- 205
- PR merge metrics
- No merged PRs in 30d
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("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);
}
}
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in Transmogrification.cpp and transmog_scripts.cpp. Read LoadConfig and the loot, create-item, and store/equip hooks to understand the existing collection checks. Add the requested setting and verify that all three paths honor it while preserving the existing behavior when it is disabled.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- game-dev
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100