I discovered that CP does not pass the color in the tooltip any longer (maybe in the future it will be come back?) So I decided the only way to get that information is to work with the WoW Item IDs. This also allowed me to find Gems in the items and color them and put the Icon next to them like WoW.exe does. To do this it requires a database of the Gem Sockets IDs (not the same as the Gem Item IDs). The same is true for the enchantments. More on this later.
Stop reading this if you run a non English version of the roster, this release will not work--if this mod turns out to be worthwhile I will make a localized version.
How the Mod works:
I added onto the current function colorTooltip();
It now takes another arg $itemid. When this is passed to colorTooltip(); it will do the additional parsing for Sockets and Enchantments. (No need for this parsing for other tooltips--recipe lists, general tooltips, etc).
Added two new functions to the file commonfunctions.lib.php
parseItemId($itemid); & parseTooltipEnchantments($parsedToolTip, $itemid);
$itemid = the wow itemid string
$parsedToolTip = the parsed tooltip from the function colorToolTip();
parseTooltipEnchantments(); returns a final parsed tooltip variable to colorToolTip for final processing though OverLib.
I added a new file called lib/WoW_IDs.php.
This file contains the database (in 2 arrays) of the Enchantment ID's ($enchantment_ids) and Gem ID's ($gem_ids). The Enchantment ID array is pretty complete as I was able to find this information at http://www.wowwiki.com/EnchantId this data is Pre WoW 2.0 and Before the Rating System but I think I have converted all the data correctly. I am missing some of the new high level enchantments but if you have tooltip debugging enabled it will alert you of this and show the Enchantment ID. When this happens just post the information here and I will add it to the file.
The format of $enchantment_ids is as follows:
'EnchantID' => 'Enchant Text'
'2646' => '+25 Agility',
The other part is the Gem database. This is far from complete but I have added (i think) all known gems in the game HOWEVER most of the data does not have the SOCKETED_ID number required for the tooltip to parse out correctly. For example:
- Code: Select all
$gem_ids = array
(
'30601' => array
(
'name' => 'Beaming Fire Opal',
'txt' => 'Dodge Rating +5 and Resilience Rating +4',
'img' => 'INV_Jewelcrafting_NobleTopaz_03',
),
The number "30601" is the ItemID of the gem itself; to make the tooltip work correctly we need to know its Socketed_ID. The only way I know how to get this information is to socket the gem! So what I have done is to look on the roster and find all the gems people have socketed and change the Item ID to the Socketed_ID. The tooltip will report any new GemIDs in the tooltip for you, you just have to open the file and add the socketed ID and your set! (also please post your new gems on this site so we all can benefit from your findings).
Here is an example of a "Corrected" GemID:
- Code: Select all
'2698' => array //corrected
(
'name' => 'Solid Azure Moonstone',
'txt' => '+9 Stamina',
'img' => 'INV_Misc_Gem_AzureDraenite_02',
),
Two other things to note about the new file WoW_IDs.php:
At the top of the file you will find two defines,
- Code: Select all
define('TOOLTIP_DEBUG', 1); // debug information
define('OVERLIB_WIDTH', 325); // width in pixels, Roster default is 200.
With the added data in the tooltip I found it necessary to increase the size of the tooltip box. You can easily change this with the new define.
Also you can disable the additional debugging information passed to tooltips. (change the 1 to a 0)
That is about it for the workings of the mod. I am not the best explaining things but I will do my best to support this Mod if people like it and use it.
Attached are the Changed Files and added files for WoW Roster 1.7.3 DO NOT USE THIS ON ANY OTHER VERSION!!!!!!
If you want me to make a post with all the changes I made in a Find/Replace code let me know.
To see the Mod in action check out my guild site here:
http://wow.roa-guild.org/roster/