34 TC_LOG_DEBUG(
"network",
"WORLD: HandleTransmogrifyItems - {} not found or player can't interact with it.", transmogrifyItems.
Npc.
ToString());
39 std::unordered_map<Item*, std::pair<uint32, uint32>> transmogItems;
40 std::unordered_map<Item*, uint32> illusionItems;
42 std::vector<Item*> resetAppearanceItems;
43 std::vector<Item*> resetIllusionItems;
44 std::vector<uint32> bindAppearances;
46 auto validateAndStoreTransmogItem = [&](
Item* itemTransmogrified,
uint32 itemModifiedAppearanceId,
bool isSecondary)
49 if (!itemModifiedAppearance)
51 TC_LOG_DEBUG(
"network",
"WORLD: HandleTransmogrifyItems - {}, Name: {} tried to transmogrify using invalid appearance ({}).", player->
GetGUID().
ToString(), player->
GetName(), itemModifiedAppearanceId);
57 TC_LOG_DEBUG(
"network",
"WORLD: HandleTransmogrifyItems - {}, Name: {} tried to transmogrify secondary appearance to non-shoulder item.", player->
GetGUID().
ToString(), player->
GetName());
64 TC_LOG_DEBUG(
"network",
"WORLD: HandleTransmogrifyItems - {}, Name: {} tried to transmogrify using appearance he has not collected ({}).", player->
GetGUID().
ToString(), player->
GetName(), itemModifiedAppearanceId);
70 TC_LOG_DEBUG(
"network",
"WORLD: HandleTransmogrifyItems - {}, Name: {} tried to transmogrify using appearance he can never use ({}).", player->
GetGUID().
ToString(), player->
GetName(), itemModifiedAppearanceId);
77 TC_LOG_DEBUG(
"network",
"WORLD: HandleTransmogrifyItems - {}, Name: {} failed CanTransmogrifyItemWithItem ({} with appearance {}).", player->
GetGUID().
ToString(), player->
GetName(), itemTransmogrified->
GetEntry(), itemModifiedAppearanceId);
82 transmogItems[itemTransmogrified].first = itemModifiedAppearanceId;
84 transmogItems[itemTransmogrified].second = itemModifiedAppearanceId;
87 bindAppearances.push_back(itemModifiedAppearanceId);
97 TC_LOG_DEBUG(
"network",
"WORLD: HandleTransmogrifyItems - Player ({}, name: {}) tried to transmogrify wrong slot ({}) when transmogrifying items.", player->
GetGUID().
ToString(), player->
GetName(), transmogItem.
Slot);
103 if (!itemTransmogrified)
105 TC_LOG_DEBUG(
"network",
"WORLD: HandleTransmogrifyItems - Player ({}, name: {}) tried to transmogrify an invalid item in a valid slot (slot: {}).", player->
GetGUID().
ToString(), player->
GetName(), transmogItem.
Slot);
121 resetAppearanceItems.push_back(itemTransmogrified);
127 TC_LOG_DEBUG(
"network",
"WORLD: HandleTransmogrifyItems - {}, Name: {} tried to transmogrify illusion into non-weapon slot ({}).", player->
GetGUID().
ToString(), player->
GetName(), transmogItem.
Slot);
151 resetIllusionItems.push_back(itemTransmogrified);
162 for (
auto& transmogPair : transmogItems)
164 Item* transmogrified = transmogPair.first;
211 for (
auto& illusionPair : illusionItems)
213 Item* transmogrified = illusionPair.first;
243 for (
Item* item : resetAppearanceItems)
288 for (
Item* item : resetIllusionItems)
317 for (
uint32 itemModifedAppearanceId : bindAppearances)
320 for (
ObjectGuid const& itemGuid : itemsProvidingAppearance)
324 item->SetNotRefundable(player);
325 item->ClearSoulboundTradeable(player);
335 npcInteraction.
Npc = guid;
DB2Storage< ItemModifiedAppearanceEntry > sItemModifiedAppearanceStore("ItemModifiedAppearance.db2", &ItemModifiedAppearanceLoadInfo::Instance)
DB2Storage< PlayerConditionEntry > sPlayerConditionStore("PlayerCondition.db2", &PlayerConditionLoadInfo::Instance)
@ ITEM_MODIFIER_TRANSMOG_SECONDARY_APPEARANCE_SPEC_3
@ ITEM_MODIFIER_ENCHANT_ILLUSION_SPEC_2
@ ITEM_MODIFIER_ENCHANT_ILLUSION_ALL_SPECS
@ ITEM_MODIFIER_TRANSMOG_SECONDARY_APPEARANCE_ALL_SPECS
@ ITEM_MODIFIER_TRANSMOG_SECONDARY_APPEARANCE_SPEC_4
@ ITEM_MODIFIER_ENCHANT_ILLUSION_SPEC_1
@ ITEM_MODIFIER_TRANSMOG_APPEARANCE_SPEC_4
@ ITEM_MODIFIER_ENCHANT_ILLUSION_SPEC_4
@ ITEM_MODIFIER_TRANSMOG_SECONDARY_APPEARANCE_SPEC_1
@ ITEM_MODIFIER_ENCHANT_ILLUSION_SPEC_3
@ ITEM_MODIFIER_TRANSMOG_APPEARANCE_SPEC_2
@ ITEM_MODIFIER_TRANSMOG_APPEARANCE_SPEC_3
@ ITEM_MODIFIER_TRANSMOG_APPEARANCE_ALL_SPECS
@ ITEM_MODIFIER_TRANSMOG_SECONDARY_APPEARANCE_SPEC_2
@ ITEM_MODIFIER_TRANSMOG_APPEARANCE_SPEC_1
ItemModifier const AppearanceModifierSlotBySpec[MAX_SPECIALIZATIONS]
ItemModifier const SecondaryAppearanceModifierSlotBySpec[MAX_SPECIALIZATIONS]
ItemModifier const IllusionModifierSlotBySpec[MAX_SPECIALIZATIONS]
#define TC_LOG_DEBUG(filterType__,...)
@ EQUIPMENT_SLOT_MAINHAND
#define INVENTORY_SLOT_BAG_0
@ SPELL_AURA_REMOVE_TRANSMOG_COST
@ UNIT_NPC_FLAG_TRANSMOGRIFIER
void AddItemAppearance(Item *item)
std::unordered_set< ObjectGuid > GetItemsProvidingTemporaryAppearance(uint32 itemModifiedAppearanceId) const
std::pair< bool, bool > HasItemAppearance(uint32 itemModifiedAppearanceId) const
static bool IsPlayerMeetingCondition(Player const *player, PlayerConditionEntry const *condition)
void SetState(ItemUpdateState state, Player *forplayer=nullptr)
static bool CanTransmogrifyItemWithItem(Item const *item, ItemModifiedAppearanceEntry const *itemModifiedAppearance)
void SetModifier(ItemModifier modifier, uint32 value)
ItemTemplate const * GetTemplate() const
void SetNotRefundable(Player *owner, bool changestate=true, CharacterDatabaseTransaction *trans=nullptr, bool addToCollection=true)
uint32 GetSellPrice(Player const *owner) const
void ClearSoulboundTradeable(Player *currentOwner)
uint32 GetModifier(ItemModifier modifier) const
std::string ToString() const
static ObjectGuid GetGUID(Object const *o)
bool ModifyMoney(int64 amount, bool sendError=true)
Creature * GetNPCIfCanInteractWith(ObjectGuid const &guid, NPCFlags npcFlags, NPCFlags2 npcFlags2) const
Item * GetItemByPos(uint16 pos) const
uint8 GetActiveTalentGroup() const
void SetVisibleItemSlot(uint8 slot, Item *pItem)
Item * GetItemByGuid(ObjectGuid guid) const
bool HasEnoughMoney(uint64 amount) const
InventoryResult CanUseItem(Item *pItem, bool not_loading=true) const
bool HasAuraType(AuraType auraType) const
std::string const & GetName() const
PlayerInteractionType InteractionType
WorldPacket const * Write() override
Array< TransmogrifyItem, MAX_TRANSMOGRIFY_ITEMS > Items
void HandleTransmogrifyItems(WorldPackets::Transmogrification::TransmogrifyItems &transmogrifyItems)
Player * GetPlayer() const
void SendOpenTransmogrifier(ObjectGuid const &guid)
void SendPacket(WorldPacket const *packet, bool forced=false)
Send a packet to the client.
CollectionMgr * GetCollectionMgr() const
InventoryType GetInventoryType() const
int32 SpellItemEnchantmentID
int32 SecondaryItemModifiedAppearanceID
int32 ItemModifiedAppearanceID