mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-23 10:26:28 +01:00
Core/Transmog: Implemented transmog collection and updated transmog handling
This commit is contained in:
@@ -1653,10 +1653,16 @@ void WorldSession::HandleEquipmentSetSave(WorldPackets::EquipmentSet::SaveEquipm
|
||||
else
|
||||
{
|
||||
saveEquipmentSet.Set.Pieces[i].Clear();
|
||||
if (saveEquipmentSet.Set.Appearances[i] && !sItemModifiedAppearanceStore.LookupEntry(saveEquipmentSet.Set.Appearances[i]))
|
||||
return;
|
||||
if (saveEquipmentSet.Set.Appearances[i])
|
||||
{
|
||||
if (!sItemModifiedAppearanceStore.LookupEntry(saveEquipmentSet.Set.Appearances[i]))
|
||||
return;
|
||||
|
||||
// TODO: validata whether appearance is known
|
||||
bool hasAppearance, isTemporary;
|
||||
std::tie(hasAppearance, isTemporary) = GetCollectionMgr()->HasItemAppearance(saveEquipmentSet.Set.Appearances[i]);
|
||||
if (!hasAppearance)
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -1672,6 +1678,33 @@ void WorldSession::HandleEquipmentSetSave(WorldPackets::EquipmentSet::SaveEquipm
|
||||
saveEquipmentSet.Set.Enchants[0] = 0;
|
||||
saveEquipmentSet.Set.Enchants[1] = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
auto validateIllusion = [this](uint32 enchantId) -> bool
|
||||
{
|
||||
SpellItemEnchantmentEntry const* illusion = sSpellItemEnchantmentStore.LookupEntry(enchantId);
|
||||
if (!illusion)
|
||||
return false;
|
||||
|
||||
if (!illusion->ItemVisual || !(illusion->Flags & ENCHANTMENT_COLLECTABLE))
|
||||
return false;
|
||||
|
||||
if (PlayerConditionEntry const* condition = sPlayerConditionStore.LookupEntry(illusion->PlayerConditionID))
|
||||
if (!sConditionMgr->IsPlayerMeetingCondition(_player, condition))
|
||||
return false;
|
||||
|
||||
if (illusion->ScalingClassRestricted > 0 && uint8(illusion->ScalingClassRestricted) != _player->getClass())
|
||||
return false;
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
if (saveEquipmentSet.Set.Enchants[0] && !validateIllusion(saveEquipmentSet.Set.Enchants[0]))
|
||||
return;
|
||||
|
||||
if (saveEquipmentSet.Set.Enchants[1] && !validateIllusion(saveEquipmentSet.Set.Enchants[1]))
|
||||
return;
|
||||
}
|
||||
|
||||
_player->SetEquipmentSet(saveEquipmentSet.Set);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user