Gem Socket
Hey, is there a way to know if an item has emty gem sockets ? (ex: when we kill a boss, know if the item looted has sockets, before get it)
|
You have to use tooltip scanning. Here's the code I use to find the number of sockets a given item has, with some added comments to explain what's going on:
Code:
local GetNumSockets It does not handle cases where the item isn't already in your local item cache, though -- in that case you'll need to wait and call it again once your client receives the item data. And, though you didn't ask, here's how to count how many gems are currently on the item: Code:
local _, itemID, enchantID, gem1, gem2, gem3, gem4 = strsplit(":", strmatch(link, "|H(.-)|h")) |
Thank you so much, it does exactly what I wanted
|
Sorry to bother you, but do you have a way to know the color of the gem socket ? (blue, red, meta, prismatic...) ?
It would be awesome. |
The simplest way is probably to just look at the actual texture being displayed, eg. textures[i]:GetTexture() and match it up to known textures for each gem or socket color.
However, I'm about 90% sure that all sockets on modern items are explicitly prismatic (any color gem activates the socket bonus) and have been that way since WoD launched, and I'm not sure why you'd care whether the gem in a socket was a blue, orange, or any other color, so I don't really see a point in figuring out what color the gem or socket is. |
All times are GMT -6. The time now is 04:48 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI