[ABD] World of Warcraft Armory Tooltips

Any abandoned MODs will be moved to this forum.

WARNING: MODs in this forum are not currently being supported or maintained by the original MOD author. Proceed at your own risk.
Forum rules
IMPORTANT: MOD Development Forum rules

WARNING: MODs in this forum are not currently being supported nor updated by the original MOD author. Proceed at your own risk.
Locked
Notalda
Registered User
Posts: 45
Joined: Sun Aug 31, 2008 2:50 pm

Re: [RC] World of Warcraft Armory Tooltips

Post by Notalda » Tue Oct 28, 2008 11:01 am

ssbltz wrote:I installed the developement version. When the armory is down, i cannot open the topics in my forum which includes item or armory bbCodes.
That's interesting... it shouldn't block things that way, since it's all AJAX... I'll see if I can find anything that may cause this.

Notalda
Registered User
Posts: 45
Joined: Sun Aug 31, 2008 2:50 pm

Re: [RC] World of Warcraft Armory Tooltips

Post by Notalda » Tue Oct 28, 2008 3:09 pm

Aactually... the new one does a few funky stuff that may block/freeze the browser if armory is unavailable, especially if not using cURL (there are timeouts for curl, but not for url_fopen yet).

Try disabling $AUTO_RACE_ICON, $AUTO_CLASS_ICON, $AUTOCOLOR_ITEM_QUALITY, $AUTOCOLOR_CHAR_CLASS and $AUTO_ITEM_ICON. That will prevent WAT from doing anything unless links are moused over, which in turn will allow topics to load.

silverscout
Registered User
Posts: 8
Joined: Sun May 14, 2006 10:56 am

Re: [RC] World of Warcraft Armory Tooltips

Post by silverscout » Tue Oct 28, 2008 8:35 pm

silverscout wrote:
Hi, I love this mod. however, it is not working properly.

You have to include the following line in your style's overall_header.html template:


Code: Select all
<script type="text/javascript" src="wowarmory_tooltip/js/wat.js.php"></script>


Without that javascript-foo, it won't work.
yes I did and I tried moving it around and above some other scripts. Like I said I use a portal which may cause it. However, I do not believe this should affect anything as it is just another script being called.

Notalda
Registered User
Posts: 45
Joined: Sun Aug 31, 2008 2:50 pm

Re: [RC] World of Warcraft Armory Tooltips

Post by Notalda » Tue Oct 28, 2008 10:13 pm

silverscout wrote: yes I did and I tried moving it around and above some other scripts. Like I said I use a portal which may cause it. However, I do not believe this should affect anything as it is just another script being called.
Well, it did cause problems in the past, eg, it refused to work with mootools + airbox.

ssbltz
Registered User
Posts: 13
Joined: Thu Oct 23, 2008 9:31 am

Re: [RC] World of Warcraft Armory Tooltips

Post by ssbltz » Tue Oct 28, 2008 10:17 pm

Notalda wrote:Aactually... the new one does a few funky stuff that may block/freeze the browser if armory is unavailable, especially if not using cURL (there are timeouts for curl, but not for url_fopen yet).

Try disabling $AUTO_RACE_ICON, $AUTO_CLASS_ICON, $AUTOCOLOR_ITEM_QUALITY, $AUTOCOLOR_CHAR_CLASS and $AUTO_ITEM_ICON. That will prevent WAT from doing anything unless links are moused over, which in turn will allow topics to load.
I will test it.

The Testpage gives me 2 error messages :)
Warning: WAT_Char_ToolTip::include_once(includes/class_conf/.php) [wat-char-tooltip.include-once]: failed to open stream: No such file or directory in /srv/www/httpd/phost/s/de/pytalhost/sneaky/web/forum/wowarmory_tooltip/includes/wat_char_tooltip.class.php on line 427

Warning: WAT_Char_ToolTip::include_once() [function.include]: Failed opening 'includes/class_conf/.php' for inclusion (include_path='.:/srv/www/httpd/phost/s/de/pytalhost/sneaky/web') in /srv/www/httpd/phost/s/de/pytalhost/sneaky/web/forum/wowarmory_tooltip/includes/wat_char_tooltip.class.php on line 427

http://sneaky.pytalhost.de/forum/wowarm ... s/test.php :)

silverscout
Registered User
Posts: 8
Joined: Sun May 14, 2006 10:56 am

Re: [RC] World of Warcraft Armory Tooltips

Post by silverscout » Wed Oct 29, 2008 12:23 am

ok I cleared the cache and it seems to work somewhat now.
atleast the java is working.

just some things i saw.

1. Icon's and you said you know the fix for that.
2. It can find some items and not others. However, to find some items I do have to move off of them and then highlight and it works.
3. getting people are not working.

new.guildklopfen.com if you want to look. go and click read more on the news article.

xVAMPx
Registered User
Posts: 8
Joined: Sat Oct 11, 2008 12:41 am

Re: [RC] World of Warcraft Armory Tooltips

Post by xVAMPx » Wed Oct 29, 2008 8:59 am

Notalda wrote:
xVAMPx wrote:
Notalda wrote: Did you add the BBCodes too to your phpBB board?
i have added here : Image
Are you using phpBB2 or phpBB3? My BBCode admin stuff on phpBB3 does not look anything like that, and the instructions were made for that version. I do not have access to any phpBB2 board, so I can't make instructions for that, I'm afraid.
I use OrionV2 with integrated phpbb (i think its 2). :?
But i have any MODs for 3

Notalda
Registered User
Posts: 45
Joined: Sun Aug 31, 2008 2:50 pm

Re: [RC] World of Warcraft Armory Tooltips

Post by Notalda » Wed Oct 29, 2008 10:22 am

silverscout wrote: 1. Icon's and you said you know the fix for that.
Indeed. It's already fixed in the development version, and 2.0.5 is coming either later today, or tomorrow.
2. It can find some items and not others. However, to find some items I do have to move off of them and then highlight and it works.
That's also something that's hopefully fixed in 2.0.5. I used to have the same problem, but it's gone now.
new.guildklopfen.com if you want to look. go and click read more on the news article.
I checked that page, and while the BBcodes appear to be set up fine, viewing the page's source in Firefox, I did not find any inclusion of js/wat.js.php, which does most of the magic..

Notalda
Registered User
Posts: 45
Joined: Sun Aug 31, 2008 2:50 pm

Re: [RC] World of Warcraft Armory Tooltips

Post by Notalda » Wed Oct 29, 2008 10:23 am

xVAMPx wrote: I use OrionV2 with integrated phpbb (i think its 2). :?
But i have any MODs for 3
You'll have to consult the docs for that then, I think. Like I said before, I do not have access to phpBB2 forums (and haven't even heard of OrionV2, heh), so I'm unable to help with those.

ssbltz
Registered User
Posts: 13
Joined: Thu Oct 23, 2008 9:31 am

Re: [RC] World of Warcraft Armory Tooltips

Post by ssbltz » Wed Oct 29, 2008 11:12 am

Aactually... the new one does a few funky stuff that may block/freeze the browser if armory is unavailable, especially if not using cURL (there are timeouts for curl, but not for url_fopen yet).

Try disabling $AUTO_RACE_ICON, $AUTO_CLASS_ICON, $AUTOCOLOR_ITEM_QUALITY, $AUTOCOLOR_CHAR_CLASS and $AUTO_ITEM_ICON. That will prevent WAT from doing anything unless links are moused over, which in turn will allow topics to load.
I tested it. When armory is down, the browser still freeze. The Skript needs a timeout for url_fopen. When the armory is down, i need to deactivate the item and armory bbCode.

Notalda
Registered User
Posts: 45
Joined: Sun Aug 31, 2008 2:50 pm

Re: [RC] World of Warcraft Armory Tooltips

Post by Notalda » Wed Oct 29, 2008 11:49 am

ssbltz wrote:
Aactually... the new one does a few funky stuff that may block/freeze the browser if armory is unavailable, especially if not using cURL (there are timeouts for curl, but not for url_fopen yet).

Try disabling $AUTO_RACE_ICON, $AUTO_CLASS_ICON, $AUTOCOLOR_ITEM_QUALITY, $AUTOCOLOR_CHAR_CLASS and $AUTO_ITEM_ICON. That will prevent WAT from doing anything unless links are moused over, which in turn will allow topics to load.
I tested it. When armory is down, the browser still freeze. The Skript needs a timeout for url_fopen. When the armory is down, i need to deactivate the item and armory bbCode.
I'll see what I can do. But keep in mind that url_fopen is a fallback solution, cURL is the default and highly recommended option. (TL;DR: Don't hold your breath)

ssbltz
Registered User
Posts: 13
Joined: Thu Oct 23, 2008 9:31 am

Re: [RC] World of Warcraft Armory Tooltips

Post by ssbltz » Wed Oct 29, 2008 2:59 pm

Notalda wrote:Don't hold your breath
No problem! I will help where I can!

ssbltz
Registered User
Posts: 13
Joined: Thu Oct 23, 2008 9:31 am

Re: [RC] World of Warcraft Armory Tooltips

Post by ssbltz » Wed Oct 29, 2008 6:10 pm

I added Support for other languages. 8-) I'm not good in PHP Coding :(

You need a new folder:
/includes/lang

This folder contains the Languagefiles de.php (german) and en.php (english).

de.php:

Code: Select all

<?php
$l_health = "Gesundheit";
$l_power = "Mana";
$l_stamina = "Ausdauer";
$l_intellect = "Intelligenz";
$l_strength = "St&auml;rke";
$l_armor = "R&uuml;stung";
$l_agility = "Beweglichkeit";
$l_spirit = "Willenskraft";
$l_spell_hit_chance = "Trefferchance";
$l_spell_penetration = "Zauberdurchschlagskraft";
$l_melee_attack_power = "Angriffskraft";
$l_melee_hit_chance = "Trefferchance";
$l_melee_crit_chance = "Kritisch";
$l_melee_expertise = "Waffenkunde";
$l_defense = "Verteidigung";
$l_resilience = "Abh&auml;rtung";
$l_healing = "Heilung";
$l_mana_regen = "Manaregeneration";
$l_mana_regen_cast = "Manaregeneration (Cast)";
$l_ranged_damage = "Schaden (Distanz)";
$l_ranged_dps = "DPS (Distanz)";
$l_ranged_crit_chance = "Kritisch (Distanz)";
$l_ranged_speed = "Tempo (Distanz)";
$l_ranged_hit_chance = "Trefferchance";
$l_ranged_attack_power = "Angriffskraft";
?>
en.php:

Code: Select all

<?php
$l_health = "Health";
$l_power = "Power";
$l_stamina = "Stamina";
$l_intellect = "Intellect";
$l_strength = "Strength";
$l_armor = "Armor";
$l_agility = "Agility";
$l_spirit = "Spirit";
$l_spell_hit_chance = "Spell hit chance";
$l_spell_penetration = "Spell penetration";
$l_melee_attack_power = "Melee attack power";
$l_melee_hit_chance = "Melee hit chance";
$l_melee_crit_chance = "Melee crit. chance";
$l_melee_expertise = "Melee expertise";
$l_defense = "Defense";
$l_resilience = "Resilience";
$l_healing = "Healing";
$l_mana_regen = "Mana regen";
$l_mana_regen_cast = "Mana regen (casting)";
$l_ranged_damage = "Ranged damage";
$l_ranged_dps = "Ranged DPS";
$l_ranged_crit_chance = "Ranged crit. chance";
$l_ranged_speed = "Ranged speed";
$l_ranged_hit_chance = "Ranged hit chance";
$l_ranged_attack_power = "Ranged attack power";
?>
Here the modified wat_char_tooltip.class.php:

Code: Select all

<?php
include_once('lang/' . $ARMORY_LANGUAGE . '.php');
class WAT_Char_ToolTip
{
        protected $char;
        protected $realm;
        protected $armory;

        protected $stats_conf = array (
                /* --base stats-- */
                'stamina' => FALSE,
                'strength' => FALSE,
                'intellect' => FALSE,
                'agility' => FALSE,
                'spirit' => FALSE,
                'armor' => FALSE,
                /*   -- spell damage--   */
                'shadow_power' => FALSE,
                'shadow_crit' => FALSE,
                'fire_power' => FALSE,
                'fire_crit' => FALSE,
                'frost_power' => FALSE,
                'frost_crit' => FALSE,
                'arcane_power' => FALSE,
                'arcane_crit' => FALSE,
                'nature_power' => FALSE,
                'nature_crit' => FALSE,
                'holy_power' => FALSE,
                'holy_crit' => FALSE,
                'healing' => FALSE,
                'mana_regen' => FALSE,
                'mana_regen_cast' => FALSE,
                'spell_hit' => FALSE,
                'penetration' => FALSE,
                /*   -- melee damage--   */
                'melee_main_dmg' => FALSE,
                'melee_main_speed' => FALSE,
                'melee_main_dps' => FALSE,
                'melee_off_dmg' => FALSE,
                'melee_off_speed' => FALSE,
                'melee_off_dps' => FALSE,
                'melee_power' => FALSE,
                'melee_hit' => FALSE,
                'melee_crit' => FALSE,
                'melee_expertise' => FALSE,
                /*   -- ranged damage--   */
                'ranged_power' => FALSE,
                'ranged_dmg' => FALSE,
                'ranged_speed' => FALSE,
                'ranged_dps' => FALSE,
                'ranged_crit' => FALSE,
                'ranged_hit' => FALSE,
                /*  --defenses--  */
                'defense' => FALSE,
                'dodge' => FALSE,
                'parry' => FALSE,
                'block' => FALSE,
                'resilience' => FALSE,
                /*  --resistances--  */
                'arcane_resist' => FALSE,
                'fire_resist' => FALSE,
                'frost_resist' => FALSE,
                'shadow_resist' => FALSE,
                'nature_resist' => FALSE,
                'holy_resist' => FALSE,
        );

        private $talent_trees = array (
                'druid' => array ('Balance', 'Feral', 'Restoration'),
                'hunter' => array ('Beast Mastery', 'Marksmanship', 'Survival'),
                'mage' => array ('Arcane', 'Fire', 'Frost'),
                'paladin' => array ('Holy', 'Protection', 'Retribution'),
                'priest' => array ('Discipline', 'Holy', 'Shadow'),
                'rogue' => array ('Assassination', 'Combat', 'Subtlety'),
                'shaman' => array ('Elemental', 'Enhancement', 'Restoration'),
                'warlock' => array ('Affliction', 'Demonology', 'Destruction'),
                'warrior' => array ('Arms', 'Fury', 'Protection'),
        );

        private $id_to_name = array (
                'unknown',
                'warrior',
                'paladin',
                'hunter',
                'rogue',
                'priest',
                '(6)',
                'shaman',
                'mage',
                'warlock',
                '(10)',
                'druid',
        );

        protected $armory_data;
        protected $url_base;
        protected $avatar_url_base;
        protected $icons_url_base;
        protected $char_data;
        protected $main_spec;

        public $error_message;

        protected $public_data = array ();

        public function __construct ($char, $realm, $armory, $url_base = NULL)
        {
                $this->char = $char;
                $this->realm = $realm;
                $this->armory = $armory;
                if ($url_base) {
                        $this->url_base = $url_base;
                } else {
                        $this->url_base = $this->armory->armory;
                }

                $this->error_message = null;

                $this->generate ();
        }

        private function enable_stats (array $stats)
        {
                foreach ($stats as $stat) {
                        $this->stats_conf[$stat] = TRUE;
                }
        }

        private function grab_armory ()
        {
                // Get the char data from Armory
                $this->armory_data = $this->armory->characterFetch ($this->char, $this->realm);

                // Url for armory icons
                $this->avatar_url_base = $this->url_base . "images/portraits/";
                $this->icons_url_base  = $this->url_base . "images/icons/";

                // Reduce the array name size, make more easy to work with the array.
                $this->armory_data = $this->armory_data['characterinfo'];

                if (count ($this->armory_data) == 0) {
                        $this->error_message = 'Error connecting to the armory.';
                        return;
                }

                if ($this->armory_data['errcode'] == 'noCharacter') {
                        $this->error_message = 'No such character.';
                        return;
                }

                if (!$this->armory_data['charactertab']) {
                        $this->error_message = 'Character data unavailable.';
                        return;
                }

                $this->public_data['class'] = $this->id_to_name[$this->armory_data['character']['classid']];
        }

        private function process_armory_data ()
        {
                // To change the fields by class edit the stats_conf/ files
                // each class have a separated config.

                 global $l_health;
                 global $l_power;
                 global $l_stamina;
                 global $l_intellect;
                 global $l_strength;
                 global $l_armor;
                 global $l_agility;
                 global $l_spirit;
                 global $l_spell_hit_chance;
                 global $l_spell_penetration;
                 global $l_melee_attack_power;
                 global $l_melee_hit_chance;
                 global $l_melee_crit_chance;
                 global $l_melee_expertise;
                 global $l_defense;
                 global $l_resilience;
                 global $l_healing;
                 global $l_mana_regen;
                 global $l_mana_regen_cast;
                 global $l_ranged_damage;
                 global $l_ranged_dps;
                 global $l_ranged_crit_chance;
                 global $l_ranged_speed;
                 global $l_ranged_hit_chance;
                 global $l_ranged_attack_power;

                $char = $this->armory_data;

                $stamina = $char['charactertab']['basestats']['stamina']['effective'] . " (" . $char['charactertab']['basestats']['stamina']['base'] . " + " . ($char['charactertab']['basestats']['stamina']['effective'] - $char['charactertab']['basestats']['stamina']['base']) . ")";
                $intellect = $char['charactertab']['basestats']['intellect']['effective'] . " (" . $char['charactertab']['basestats']['intellect']['base'] . " + " . ($char['charactertab']['basestats']['intellect']['effective'] - $char['charactertab']['basestats']['intellect']['base']) . ")";
                $strength = $char['charactertab']['basestats']['strength']['effective'] . " (" . $char['charactertab']['basestats']['strength']['base'] . " + " . ($char['charactertab']['basestats']['strength']['effective'] - $char['charactertab']['basestats']['strength']['base']) . ")";
                $agility = $char['charactertab']['basestats']['agility']['effective'] . " (" . $char['charactertab']['basestats']['agility']['base'] . " + " . ($char['charactertab']['basestats']['agility']['effective'] - $char['charactertab']['basestats']['agility']['base']) . ")";
                $spirit = $char['charactertab']['basestats']['spirit']['effective'] . " (" . $char['charactertab']['basestats']['spirit']['base'] . " + " . ($char['charactertab']['basestats']['spirit']['effective'] - $char['charactertab']['basestats']['spirit']['base']) . ")";
                $armor = $char['charactertab']['basestats']['armor']['effective'] . " (" . $char['charactertab']['basestats']['armor']['base'] . " + " . ($char['charactertab']['basestats']['armor']['effective'] - $char['charactertab']['basestats']['armor']['base']) . ")";

                $extradata['health'] = Array  (
                        'field' => $l_health,
                        'value' => $char['charactertab']['characterbars']['health']['effective'],
                        'class' => 'health',
                );
                $extradata['secondbar'] = Array (
                        'field' => $l_power,
                        'value' => $char['charactertab']['characterbars']['secondbar']['effective'],
                        'class' => 'power_mana',
                );
                $extradata['stamina'] = Array (
                        'field' => $l_stamina,
                        'value' => $stamina,
                        'class' => 'primary',
                );
                $extradata['intellect'] = Array (
                        'field' => $l_intellect,
                        'value' => $intellect,
                        'class' => 'primary',
                );
                $extradata['strength'] = Array (
                        'field' => $l_strength,
                        'value' => $strength,
                        'class' => 'primary',
                );
                $extradata['armor'] = Array (
                        'field' => $l_armor,
                        'value' => $armor,
                        'class' => 'primary',
                );
                $extradata['agility'] = Array (
                        'field' => $l_agility,
                        'value' => $agility,
                        'class' => 'primary',
                );
                $extradata['spirit'] = Array (
                        'field' => $l_spirit,
                        'value' => $spirit,
                        'class' => 'primary',
                );

                foreach (array ('Shadow', 'Fire', 'Frost', 'Arcane', 'Nature', 'Holy') as $spell_school) {
                        $extradata[strtolower ($spell_school) . '_power'] = array (
                                'field' => $spell_school .' damage',
                                'value' => $char['charactertab']['spell']['bonusdamage'][strtolower ($spell_school)]['value'],
                                'class' => strtolower ($spell_school) . '_spell',
                        );
                        $extradata[strtolower ($spell_school) . '_crit'] = array (
                                'field' => $spell_school . ' crit. chance',
                                'value' => $char['charactertab']['spell']['critchance'][strtolower ($spell_school)]['percent']."%",
                                'class' => strtolower ($spell_school) . '_spell',
                        );
                }

                $extradata['spell_hit'] = Array (
                        'field' => $l_spell_hit_chance,
                        'value' => $char['charactertab']['spell']['hitrating']['increasedhitpercent'] . "%",
                        'class' => 'generic',
                );
                $extradata['penetration'] = Array (
                        'field' => $l_spell_penetration,
                        'value' => $char['charactertab']['spell']['penetration']['value'],
                        'class' => 'generic',
                        );

                foreach (array ('main' ,'off') as $hand) {
                        $extradata['melee_' . $hand . '_dmg'] = array (
                                'field' => 'Melee ' . $hand . ' damage',
                                'value' => $char['charactertab']['melee'][$hand . 'handdamage']['max'] . "-" .
                                $char['charactertab']['melee'][$hand . 'handdamage']['min'],
                                'class' => 'melee_' . $hand . '_hand',
                        );
                        $extradata['melee_' . $hand . '_speed'] = array (
                                'field' => 'Melee ' . $hand . ' speed',
                                'value' => $char['charactertab']['melee'][$hand . 'handdamage']['speed'],
                                'class' => 'melee_' . $hand . '_hand',
                        );
                        $extradata['melee_' . $hand . '_dps'] = array (
                                'field' => 'Melee ' . $hand . ' DPS',
                                'value' => $char['charactertab']['melee'][$hand . 'handdamage']['dps'],
                                'class' => 'melee_' . $hand . '_hand'
                        );
                }

                $extradata['melee_power'] = Array (
                        'field' => $l_melee_attack_power,
                        'value' => $char['charactertab']['melee']['power']['effective'],
                        'class' => 'generic',
                );
                $extradata['melee_hit'] = Array (
                        'field' => $l_melee_hit_chance,
                        'value' => $char['charactertab']['melee']['hitrating']['increasedhitpercent'] . '%',
                        'class' => 'generic',
                );
                $extradata['melee_crit'] = Array(
                        'field' => $l_melee_crit_chance,
                        'value' => $char['charactertab']['melee']['critchance']['percent'] . '%',
                        'class' => 'generic',
                );
                $extradata['melee_expertise'] = Array(
                        'field' => $l_melee_expertise,
                        'value' => $char['charactertab']['melee']['expertise']['value'],
                        'class' => 'generic',
                );

                $extradata['defense'] = Array (
                        'field' => $l_defense,
                        'value' => $char['charactertab']['defenses']['defense']['value'] +
                        $char['charactertab']['defenses']['defense']['plusdefense'],
                        'class' => 'defensive',
                );

                foreach (array ('Block', 'Dodge', 'Parry') as $avoidance) {
                        $extradata[strtolower ($avoidance)] = Array (
                                'field' => $avoidance . ' chance',
                                'value' => $char['charactertab']['defenses'][strtolower ($avoidance)]['percent'] . "%",
                                'class' => 'defensive',
                        );
                }

                $extradata['resilience'] = Array (
                        'field' => $l_resilience,
                        'value' => $char['charactertab']['defenses']['resilience']['value'],
                        'class' => 'defensive',
                );

                $extradata['healing'] = Array (
                        'field' => $l_healing,
                        'value' => $char['charactertab']['spell']['bonushealing']['value'],
                        'class' => 'healing',
                        );
                $extradata['mana_regen'] = Array (
                        'field' => $l_mana_regen,
                        'value' => $char['charactertab']['spell']['manaregen']['notcasting'],
                        'class' => 'mana_regen',
                        );
                $extradata['mana_regen_cast'] = Array (
                        'field' => $l_mana_regen_cast,
                        'value' => $char['charactertab']['spell']['manaregen']['casting'],
                        'class' => 'mana_regen',
                );

                $extradata['ranged_dmg'] = Array (
                        'field' => $l_ranged_damage,
                        'value' => $char['charactertab']['ranged']['damage']['max'] . "-" .$char['charactertab']['ranged']['damage']['min'],
                        'class' => 'ranged',
                );
                $extradata['ranged_dps'] = Array (
                        'field' => $l_ranged_dps,
                        'value' => $char['charactertab']['ranged']['damage']['dps'],
                        'class' => 'ranged',
                );
                $extradata['ranged_crit'] = Array (
                        'field' => $l_ranged_crit_chance,
                        'value' => $char['charactertab']['ranged']['critchance']['percent'] ."%",
                        'class' => 'ranged',
                );
                $extradata['ranged_speed'] = Array (
                        'field' => $l_ranged_speed,
                        'value' => $char['charactertab']['ranged']['speed']['value'],
                        'class' => 'ranged',
                );
                $extradata['ranged_hit'] = Array (
                        'field' => $l_ranged_hit_chance,
                        'value' => $char['charactertab']['ranged']['hitrating']['increasedhitpercent'] . "%",
                        'class' => 'ranged',
                );
                $extradata['ranged_power'] = Array (
                        'field' => $l_ranged_attack_power,
                        'value' => $char['charactertab']['ranged']['power']['effective'],
                        'class' => 'ranged',
                );

                $this->char_data = $extradata;
        }

        private function generate_talent_info ()
        {
                $tree = $this->armory_data['charactertab']['talentspec'];

                switch (max ($tree['treeone'], $tree['treetwo'], $tree['treethree'])) {
                case $tree['treeone']: $main_tree = 1; break;
                case $tree['treetwo']: $main_tree = 2; break;
                case $tree['treethree']: $main_tree = 3; break;
                }

                $this->main_spec = $main_tree;
                $this->public_data['talents']['tree']['main'] = $main_tree;

                $this->public_data['talents']['main_spec'] = $this->talent_trees[$this->public_data['class']][$main_tree - 1];
                $this->public_data['talents']['icon_url'] = $this->icons_url_base . 'class/' . $this->armory_data['character']['classid'] . '/talents/' . $main_tree . '.gif';
                $this->public_data['talents']['tree'][1] = $tree['treeone'];
                $this->public_data['talents']['tree'][2] = $tree['treetwo'];
                $this->public_data['talents']['tree'][3] = $tree['treethree'];
        }

        private function generate_profession_info ()
        {
                $info = $this->armory_data['charactertab']['professions']['skill'];

                for ($i = 0; $i <= 1; $i++) {
                        if ($info[$i]) {
                                $this->public_data['professions'][$i] = array (
                                        'icon_url' => $this->icons_url_base . 'professions/' . $info[$i]['key'] . '-sm.gif',
                                        'value' => $info[$i]['value'],
                                        'max' => $info[$i]['max'],
                                        'name' => $info[$i]['name'],
                                );
                        }
                }
        }

        private function generate_avatar_info ()
        {
                // Create the Avatar URL
                $char = $this->armory_data;

                $avatar = $this->avatar_url_base;
                if ($char['character']['level'] == 70) {
                        $avatar .= "wow-70/";
                } elseif ($char['character']['level'] < 70 && $char['character']['level'] > 59) {
                        $avatar .= "wow/";
                } else {
                        $avatar .= "wow-default/";
                }
                $avatar .= $char['character']['genderid'] . '-' . $char['character']['raceid'] . '-' . $char['character']['classid'] . '.gif';

                $this->public_data['avatar']['url'] = $avatar;
        }

        private function generate_buff_info ()
        {
                $this->public_data['buffs'] = array ();

                if (is_array ($this->armory_data['charactertab']['buffs']['spell'][0]))        {
                        foreach ($this->armory_data['charactertab']['buffs']['spell'] as $buf) {
                                $this->public_data['buffs'][] = array (
                                        'name' => $buf['name'],
                                        'icon' => $this->icons_url_base . "/21x21/" . $buf['icon'] . '.png',
                                        'effect' => $buf['effect'],
                                );
                        }
                } elseif (isset ($this->armory_data['charactertab']['buffs']['spell']['icon'])) {
                        $buf = $this->armory_data['charactertab']['buffs']['spell'];
                        $this->public_data['buffs'][] = array (
                                'name' => $buf['name'],
                                'icon' => $this->icons_url_base . "/21x21/" . $buf['icon'] . '.png',
                                'effect' => $buf['effect'],
                        );
                }
        }

        private function finalise_char ()
        {
                include_once ('includes/class_conf/' . $this->public_data['class'] . '.php');

                $this->public_data['stats'] = array ();
                foreach ($this->stats_conf as $stat => $value) {
                        if ($value)
                                $this->public_data['stats'][$stat] = $this->char_data[$stat];
                }

                // define parameters for the class
                if ($this->public_data['class'] == 'warrior') $this->char_data['secondbar']['class'] = 'power_rage';
                if ($this->public_data['class'] == 'rogue') $this->char_data['secondbar']['class'] = 'power_energy';
        }

        private function generate ()
        {
                $this->grab_armory ();
                $this->process_armory_data ();

                $this->generate_talent_info ();
                $this->generate_profession_info ();
                $this->generate_avatar_info ();
                $this->generate_buff_info ();
                $this->finalise_char ();

                $this->public_data['health'] = $this->char_data['health']['value'];
                $this->public_data['secondbar'] = array ('value' => $this->char_data['secondbar']['value'],
                                                         'class' => $this->char_data['secondbar']['class']);
                $this->public_data['char'] = array (
                        'name' => $this->armory_data['character']['name'],
                        'title' => $this->armory_data['charactertab']['title']['value'],
                        'guild' => ($this->armory_data['character']['guildname']) ? $this->armory_data['character']['guildname'] : " &nbsp; ",
                        'level' => $this->armory_data['character']['level'],
                        'race' => $this->armory_data['character']['race'],
                        'class' => $this->armory_data['character']['class'],
                );
        }

        public function __get ($index)
        {
                $r = $this->public_data[$index];
                return $r;
        }
};
?>

Notalda
Registered User
Posts: 45
Joined: Sun Aug 31, 2008 2:50 pm

Re: [RC] World of Warcraft Armory Tooltips

Post by Notalda » Wed Oct 29, 2008 11:33 pm

Thanks for the translation, I'll add it... mm.... well, 2.0.6, I want to get 2.0.5 soon now, but probably do 2.0.6 with the translation a few days after.

enkiktd
Registered User
Posts: 6
Joined: Thu Oct 30, 2008 2:30 am

Re: [RC] World of Warcraft Armory Tooltips

Post by enkiktd » Thu Oct 30, 2008 2:36 am

I'm having problems with the links as well...the links are showing up as blue for characters and white for items, mousing over them brings up the correct tooltip but there are no images for the player's character and class, and no images for the item.

http://www.kirinthedestroyers.com/phpBB ... &sk=t&sd=a

1. Is my phpbb3 skin overriding the colors of the links? Mine doesn't look nearly as pretty as yours does (being the proper color of the item) and doesn't have the brackets (though I think I just add those in myself).

2. Do I have to add the character's icons for class and race in the BBcode or is it supposed to be automatically pulling that information?

3. Any ideas as to why it's not pulling up the item image? Also in that example, Thori'dal is marked as red...odd.

Locked

Return to “[3.0.x] Abandoned MODs”