Modifing Gem's so they use SQL stats like Stat_type1 (request)

So, been banging my head on this for awhile, thought I would ask some people with better C++ skills.

I know that the Core looks at the DBC files for adding the spells for Gems. What I have been trying to do is change this so if I add stats to a Gem in sql (Stat_type1-Stat_type10) it would give those stats to the player when the gem was equipped in gear. In itemHandler.cpp have found a few sections in GemEnchants. So my conclusion was it handled Gem’s like enchants. Does anyone have any ideas for a custom script to get (Stat_type1-Stat_type10) to work on Gem sockets?

Look at the Player::*Enchantment functions and their call hierarchy, you’ll eventually see where it calls the DBC lookup, you can just override that there.

Thank you for pointing me in the right direction. I’m probably thinking about this in the wrong way since I havn’t had a C++ class in 12 years and know just enough to get in trouble.

I have found GemPropertiesEntry under Player::EnchantmentFitsRequirements .

Are you saying I just need to override the call and that’s whats stopping it? Basically, I need to make it look at at the stats on the gem instead of the dbc file so it will appear on the item when its equipped. That way it will use the stat instead of the dbc entry.

I know that Player::_ApplyItemBonuses is where players get the (Stat_type1-Stat_type10) bonuses from equipped items. I have been trying to get ideas from that code to implement into the GemPropertiesEntry ,but I think this is getting above my C++ tinkering abilities so far and am totally way off.

When I socket the Gem it looses its Stat properties and doesn’t even display. The only thing it displays is the Enchant from the DBC.