View Full Version : TrinityCore 3.3.5 Needing help with doing action on adding item to a player

07-05-2016, 03:43 PM
Hey guys,
I'm wondering if u want to add items to a player by gossip,
and for example if the item is "Chest" add gem/sockets to that item,
Is there any function to do by? Because I don't see anything around Player.cpp/Item.cpp
and if you have any idea on how to do this, I will be really thank you!

07-05-2016, 06:11 PM
Im sure you can find some functions by searching opcodes.cpp with "socket".
From opcodes.cpp you can find functions that handle different packets and from those functions you often find how something is implemented, like how socketing an item works.

I took a peek at it right now and it does not look pretty. Prepare yourself for the spaghetti.


07-06-2016, 10:56 AM
Thanks, but I've searched alot, And all the function I found was about to activation of the Gem Enchantment "I think bonus" not setting them !
for example I found this functions on player.cpp, Player::EnchantmentFitsRequirements - Player::CorrectMetaGemEnchants
they are all about checking the requirment, nothing found about setting something ?!?!:S

07-06-2016, 04:13 PM
Sounds like you didnt even look where I told you to.
Did you look at the contents of WorldSession::HandleSocketOpcode? It contains everything.

And it seems the code doesnt socket gem items, but the gem item is destroyed when socketed and just the enchant/socket bonus is added to the item.