Skip to content

Commit

Permalink
[191] Restore pet talent calculator work
Browse files Browse the repository at this point in the history
  • Loading branch information
Shadez committed May 8, 2010
1 parent 8534276 commit 312853e
Show file tree
Hide file tree
Showing 11 changed files with 2,212 additions and 52 deletions.
298 changes: 298 additions & 0 deletions data/talent-tree-0-de_de.xml

Large diffs are not rendered by default.

298 changes: 298 additions & 0 deletions data/talent-tree-0-en_gb.xml

Large diffs are not rendered by default.

298 changes: 298 additions & 0 deletions data/talent-tree-0-en_us.xml

Large diffs are not rendered by default.

298 changes: 298 additions & 0 deletions data/talent-tree-0-es_es.xml

Large diffs are not rendered by default.

298 changes: 298 additions & 0 deletions data/talent-tree-0-es_mx.xml

Large diffs are not rendered by default.

298 changes: 298 additions & 0 deletions data/talent-tree-0-fr_fr.xml

Large diffs are not rendered by default.

298 changes: 298 additions & 0 deletions data/talent-tree-0-ru_ru.xml

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions includes/armory_loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
/**
* @package World of Warcraft Armory
* @version Release Candidate 1
* @revision 182
* @copyright (c) 2009-2010 Shadez
* @revision 191
* @copyright (c) 2009-2010 Shadez
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
* This program is free software; you can redistribute it and/or modify
Expand All @@ -30,8 +30,8 @@
if(!@include('classes/class.connector.php')) {
die('<b>Error:</b> can not load connector class!');
}
define('DB_VERSION', 'armory_r178');
define('ARMORY_REVISION', 182);
define('DB_VERSION', 'armory_r191');
define('ARMORY_REVISION', 191);
$armory = new Connector;
/* Check DbVersion */
$dbVersion = $armory->aDB->selectCell("SELECT `version` FROM `armory_db_version`");
Expand Down
61 changes: 54 additions & 7 deletions includes/classes/class.utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
/**
* @package World of Warcraft Armory
* @version Release Candidate 1
* @revision 168
* @copyright (c) 2009-2010 Shadez
* @revision 191
* @copyright (c) 2009-2010 Shadez
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
* This program is free software; you can redistribute it and/or modify
Expand Down Expand Up @@ -316,23 +316,60 @@ public function realmFirsts() {
1410, 1411, 1412, 1413, 1414, 1415, 1416, 1417, 1418,
1419, 1420, 1421, 1422, 1423, 1424, 1425, 1426, 1427,
1463, 3259, 456, 1400, 1402, 3117, 4078, 4576
)"); // 3.3.3a IDs
)
ORDER BY `character_achievement`.`date` DESC"); // 3.3.3a IDs
if(!$achievements_data) {
return false;
}
$countAch = count($achievements_data);
for($i=0;$i<$countAch;$i++) {
$achievements_data[$i]['title'] = $this->aDB->selectCell("SELECT `name_".$this->_locale."` FROM `armory_achievement` WHERE `id`=? LIMIT 1", $achievements_data[$i]['achievement']);
$achievements_data[$i]['desc'] = $this->aDB->selectCell("SELECT `description_".$this->_locale."` FROM `armory_achievement` WHERE `id`=?", $achievements_data[$i]['achievement']);
$achievements_data[$i]['icon'] = $this->aDB->selectCell("SELECT `iconname` FROM `armory_achievement` WHERE `id`=?", $achievements_data[$i]['achievement']);
$achievements_data[$i]['dateCompleted'] = date('Y-m-d\TH:i:s\Z', $achievements_data[$i]['date']);
$tmp_info = $this->aDB->selectRow("SELECT `name_".$this->_locale."` AS `name`, `description_".$this->_locale."` AS `desc`, `iconname` FROM `armory_achievement` WHERE `id`=? LIMIT 1", $achievements_data[$i]['achievement']);
$achievements_data[$i]['title'] = $tmp_info['name'];
$achievements_data[$i]['desc'] = $tmp_info['desc'];
$achievements_data[$i]['icon'] = $tmp_info['iconname'];
$achievements_data[$i]['id'] = $achievements_data[$i]['achievement'];
$achievements_data[$i]['dateCompleted'] = date('Y-m-d\TH:i:s\Z', $achievements_data[$i]['date']);
}
/*
$start_id = $countAch+1;
// Sartharion Malygos Kel'thuzed Yogg-Saron ToGC The Lich King
$boss_firsts = array(456, 1400, 1402, 3117, 4078, 4576);
$bosses = array();
*/
$boss_firsts = array(456, 1400, 1402, 3117, 4078, 4576);
/*$i = count($achievements_data)+1;
foreach($boss_firsts as $rf) {
$tmp = $this->cDB->select("
SELECT
`character_achievement`.`achievement`,
`character_achievement`.`date`,
`character_achievement`.`guid`,
`characters`.`name` AS `charname`,
`characters`.`race`,
`characters`.`class`,
`characters`.`gender`,
`guild`.`name` AS `guildname`,
`guild`.`guildid`,
`guild_member`.`guildid`
FROM `character_achievement` AS `character_achievement`
LEFT JOIN `characters` AS `characters` ON `characters`.`guid`=`character_achievement`.`guid`
LEFT JOIN `guild_member` AS `guild_member` ON `guild_member`.`guid`=`character_achievement`.`guid`
LEFT JOIN `guild` AS `guild` ON `guild`.`guildid`=`guild_member`.`guildid`
WHERE `character_achievement`.`achievement`=?
ORDER BY `character_achievement`.`date` DESC", $rf);
if($tmp) {
foreach($tmp as $ach) {
if($ach['guildid'] != null) {
$achievements_data[$rf][$ach['guildid']]['info'] = array('guildId' => $ach['guildid'], 'name' => $ach['guildname'], 'achievementId' => $ach['achievement']);
}
else {
$ach['guildid'] = 0;
}
$achievements_data[$rf][$ach['guildid']]['members'][] = $ach;
}
}
}
*/
return $achievements_data;
}

Expand Down Expand Up @@ -648,5 +685,15 @@ public function GetDungeonId($instance_key) {
public function GetDungeonData($instance_key) {
return $this->aDB->selectRow("SELECT `id`, `name_".$this->_locale."` AS `name`, `is_heroic`, `key`, `difficulty` FROM `armory_instance_template` WHERE `key`=?", $instance_key);
}

public function PetTalentCalcData($key) {
switch(strtolower($key)) {
case 'ferocity':
case 'tenacity':
case 'cunning':
return $this->aDB->select("SELECT `catId`, `icon`, `id`, `name_".$this->_locale."` AS `name` FROM `armory_petcalc` WHERE `key`=? AND `catId` >= 0", strtolower($key));
break;
}
}
}
?>
55 changes: 55 additions & 0 deletions sql/updates/armory_r191_armory_petcalc.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;

UPDATE `armory_db_version` SET `version` = 'armory_r191';
DROP TABLE IF EXISTS `armory_petcalc`;
CREATE TABLE `armory_petcalc` (
`id` smallint(6) NOT NULL,
`catId` smallint(6) NOT NULL default '0',
`name_de_de` text NOT NULL,
`name_en_gb` text NOT NULL,
`name_es_es` text NOT NULL,
`name_fr_fr` text NOT NULL,
`name_ru_ru` text NOT NULL,
`icon` text NOT NULL,
`key` text NOT NULL,
PRIMARY KEY (`catId`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

INSERT INTO `armory_petcalc` VALUES (30, 8, 'Drachenfalke', 'Dragonhawk', 'Dracohalc&#243;n', 'Faucon-dragon', 'Дракондор', 'ability_hunter_pet_dragonhawk', 'Cunning'),
(35, 16, 'Schlange', 'Serpent', 'Serpiente', 'Serpent', 'Змей', 'spell_nature_guardianward', 'Cunning'),
(17, 22, 'Windnatter', 'Wind Serpent', 'Serpiente alada', 'Serpent des vents', 'Крылатый змей', 'ability_hunter_pet_windserpent', 'Cunning'),
(24, 0, 'Fledermaus', 'Bat', 'Murci&#233;lago', 'Chauve-souris', 'Летучая мышь', 'ability_hunter_pet_bat', 'Cunning'),
(31, 14, 'Felshetzer', 'Ravager', 'Devastador', 'Ravageur', 'Опустошитель', 'ability_hunter_pet_ravager', 'Cunning'),
(13, 17, 'Spinne', 'Spider', 'Ara&#241;a', 'Araign&#233;e', 'Паук', 'ability_hunter_pet_spider', 'Cunning'),
(41, 63, 'Silithid', 'Silithid', 'Sil&#237;tido', 'Silithide', 'Силитид', 'ability_hunter_pet_silithid', 'Cunning'),
(34, 12, 'Netherrochen', 'Nether Ray', 'Raya abisal', 'Raie du N&#233;ant', 'Скат Пустоты', 'ability_hunter_pet_netherray', 'Cunning'),
(0, 2, 'Raubvogel', 'Bird of Prey', 'Ave rapaz', 'Oiseau de proie', 'Сова', 'ability_hunter_pet_owl', 'Cunning'),
(33, 18, 'Sporensegler', 'Sporebat', 'Espori&#233;lago', 'Sporopt&#232;re', 'Спороскат', 'ability_hunter_pet_sporebat', 'Cunning'),
(38, 24, 'Schim&#228;re', 'Chimaera', 'Quimera', 'Chim&#232;re', 'Химера', 'ability_hunter_pet_chimera', 'Cunning'),
(5, 3, 'Eber', 'Boar', 'Jabal&#237;', 'Sanglier', 'Вепрь', 'ability_hunter_pet_boar', 'Tenacity'),
(9, 9, 'Gorilla', 'Gorilla', 'Gorila', 'Gorille', 'Горилла', 'ability_hunter_pet_gorilla', 'Tenacity'),
(8, 6, 'Krebs', 'Crab', 'Cangrejo', 'Crabe', 'Краб', 'ability_hunter_pet_crab', 'Tenacity'),
(6, 7, 'Krokilisk', 'Crocolisk', 'Crocolisco', 'Crocilisque', 'Кроколиск', 'ability_hunter_pet_crocolisk', 'Tenacity'),
(43, 61, 'Rhinozeros', 'Rhino', 'Rinoceronte', 'Rhinoc&#233;ros', 'Люторог', 'ability_hunter_pet_rhino', 'Tenacity'),
(4, 1, 'B&#228;r', 'Bear', 'Oso', 'Ours', 'Медведь', 'ability_hunter_pet_bear', 'Tenacity'),
(21, 21, 'Sph&#228;renj&#228;ger', 'Warp Stalker', 'Tortuga', 'Traqueur dim.', 'Черепаха', 'ability_hunter_pet_turtle', 'Tenacity'),
(20, 15, 'Skorpid', 'Scorpid', 'Esc&#243;rpido', 'Scorpide', 'Скорпид', 'ability_hunter_pet_scorpid', 'Tenacity'),
(42, 62, 'Wurm', 'Worm', 'Gusano', 'Ver', 'Червь', 'ability_hunter_pet_worm', 'Tenacity'),
(1, 23, 'Wolf', 'Wolf', 'Lobo', 'Loup', 'Волк', 'ability_hunter_pet_wolf', 'Ferocity'),
(25, 10, 'Hy&#228;ne', 'Hyena', 'Hiena', 'Hy&#232;ne', 'Гиена', 'ability_hunter_pet_hyena', 'Ferocity'),
(45, 59, 'Kernhund', 'Core Hound', 'Can del N&#250;cleo', 'Chien du Magma', 'Гончая Недр', 'ability_hunter_pet_corehound', 'Ferocity'),
(12, 19, 'Weitschreiter', 'Tallstrider', 'Zancaalta', 'Haut-trotteur', 'Долгоног', 'ability_hunter_pet_tallstrider', 'Ferocity'),
(46, 58, 'Geisterbestie', 'Spirit Beast', 'Bestia esp&#237;ritu', 'Esprit de b&#234;te', 'Дух зверя', 'ability_druid_primalprecision', 'Ferocity'),
(39, 25, 'Teufelssaurier', 'Devilsaur', 'Demosaurio', 'Diablosaure', 'Дьявозавр', 'ability_hunter_pet_devilsaur', 'Ferocity'),
(2, 5, 'Katze', 'Cat', 'Felino', 'F&#233;lin', 'Кошка', 'ability_hunter_pet_cat', 'Ferocity'),
(37, 11, 'Motte', 'Moth', 'Palomilla', 'Phal&#232;ne', 'Мотылек', 'ability_hunter_pet_moth', 'Ferocity'),
(44, 60, 'Wespe', 'Wasp', 'Avispa', 'Gu&#234;pe', 'Оса', 'ability_hunter_pet_wasp', 'Ferocity'),
(7, 4, 'Aasvogel', 'Carrion Bird', 'Carro&#241;ero', 'Charognard', 'Падальщик', 'ability_hunter_pet_vulture', 'Ferocity'),
(11, 13, 'Raptor', 'Raptor', 'Raptor', 'Raptor', 'Ящер', 'ability_hunter_pet_raptor', 'Ferocity'),
(-1, -1, '', 'Cunning', 'Astucia', '', 'Свирепость', '', 'cunning'),
(-1, -2, '', 'Tenacity', 'Tenacidad', '', 'Упорство', '', 'tenacity'),
(-1, -3, '', 'Ferocity', 'Ferocidad', '', 'Хитрость', '', 'ferocity');

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
54 changes: 13 additions & 41 deletions talent-calc.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
/**
* @package World of Warcraft Armory
* @version Release Candidate 1
* @revision 122
* @copyright (c) 2009-2010 Shadez
* @revision 191
* @copyright (c) 2009-2010 Shadez
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
* This program is free software; you can redistribute it and/or modify
Expand Down Expand Up @@ -43,11 +43,11 @@
$class_id = 6;
}
if(isset($_GET['pid'])) {
$pet_id = $_GET['pid'];
$pet_id = (int) $_GET['pid'];
}
$xml->XMLWriter()->startElement('talents');
if(isset($_GET['pid'])) {
$xml->XMLWriter()->writeAttribute('familyId', $_GET['pid']);
$xml->XMLWriter()->writeAttribute('familyId', $pet_id);
}
else {
$xml->XMLWriter()->writeAttribute('classId', $class_id);
Expand All @@ -70,44 +70,12 @@
}
else {
$xml->XMLWriter()->startElement('petTalentTabs');

$pet_catid = array();
$pet_catid['cunning'][0] = array('catId' => 8, 'icon' => 'ability_hunter_pet_dragonhawk', 'id' => 30);
$pet_catid['cunning'][1] = array('catId' => 16, 'icon' => 'spell_nature_guardianward', 'id' => 35);
$pet_catid['cunning'][2] = array('catId' => 22, 'icon' => 'ability_hunter_pet_windserpent', 'id' => 17);
$pet_catid['cunning'][3] = array('catId' => 0, 'icon' => 'ability_hunter_pet_bat', 'id' => 24);
$pet_catid['cunning'][4] = array('catId' => 14, 'icon' => 'ability_hunter_pet_ravager', 'id' => 31);
$pet_catid['cunning'][5] = array('catId' => 17, 'icon' => 'ability_hunter_pet_spider', 'id' => 13);
$pet_catid['cunning'][6] = array('catId' => 63, 'icon' => 'ability_hunter_pet_silithid', 'id' => 41);
$pet_catid['cunning'][7] = array('catId' => 12, 'icon' => 'ability_hunter_pet_netherray', 'id' => 34);
$pet_catid['cunning'][8] = array('catId' => 18, 'icon' => 'ability_hunter_pet_sporebat', 'id' => 33);
$pet_catid['cunning'][9] = array('catId' => 24, 'icon' => 'ability_hunter_pet_chimera', 'id' => 38);
$pet_catid['tenacity'][0] = array('catId' => 3, 'icon' => 'ability_hunter_pet_boar', 'id' => 5);
$pet_catid['tenacity'][1] = array('catId' => 9, 'icon' => 'ability_hunter_pet_gorilla', 'id' => 9);
$pet_catid['tenacity'][2] = array('catId' => 6, 'icon' => 'ability_hunter_pet_crab', 'id' => 8);
$pet_catid['tenacity'][3] = array('catId' => 7, 'icon' => 'ability_hunter_pet_crocolisk', 'id' => 6);
$pet_catid['tenacity'][4] = array('catId' => 61, 'icon' => 'ability_hunter_pet_rhino', 'id' => 43);
$pet_catid['tenacity'][5] = array('catId' => 1, 'icon' => 'ability_hunter_pet_bear', 'id' => 4);
$pet_catid['tenacity'][6] = array('catId' => 21, 'icon' => '"ability_hunter_pet_warpstalker', 'id' => 32);
$pet_catid['tenacity'][7] = array('catId' => 15, 'icon' => 'ability_hunter_pet_scorpid', 'id' => 20);
$pet_catid['tenacity'][8] = array('catId' => 62, 'icon' => 'ability_hunter_pet_worm', 'id' => 42);
$pet_catid['tenacity'][9] = array('catId' => 21, 'icon' => 'ability_hunter_pet_turtle', 'id' => 21);
$pet_catid['ferocity'][0] = array('catId' => 23, 'icon' => 'ability_hunter_pet_wolf', 'id' => 1);
$pet_catid['ferocity'][1] = array('catId' => 10, 'icon' => 'ability_hunter_pet_hyena', 'id' => 25);
$pet_catid['ferocity'][2] = array('catId' => 59, 'icon' => 'ability_hunter_pet_corehound', 'id' => 45);
$pet_catid['ferocity'][3] = array('catId' => 19, 'icon' => 'ability_hunter_pet_tallstrider', 'id' => 12);
$pet_catid['ferocity'][4] = array('catId' => 58, 'icon' => 'ability_druid_primalprecision', 'id' => 46);
$pet_catid['ferocity'][5] = array('catId' => 25, 'icon' => 'ability_hunter_pet_devilsaur', 'id' => 39);
$pet_catid['ferocity'][6] = array('catId' => 5, 'icon' => '"ability_hunter_pet_cat', 'id' => 2);
$pet_catid['ferocity'][7] = array('catId' => 11, 'icon' => 'ability_hunter_pet_moth', 'id' => 37);
$pet_catid['ferocity'][8] = array('catId' => 60, 'icon' => 'ability_hunter_pet_wasp', 'id' => 44);
$pet_catid['ferocity'][9] = array('catId' => 4, 'icon' => 'ability_hunter_pet_vulture', 'id' => 7);
$pet_catid['ferocity'][10] = array('catId' => 13, 'icon' => 'ability_hunter_pet_raptor', 'id' => 11);

$xml->XMLWriter()->startElement('petTalentTab');
$xml->XMLWriter()->writeAttribute('key', 'Cunning');
$xml->XMLWriter()->writeAttribute('name', $armory->aDB->selectCell("SELECT `name_".$armory->_locale."` FROM `armory_petcalc` WHERE `id` < 0 AND `key`='cunning'"));
$xml->XMLWriter()->writeAttribute('order', 2);
foreach($pet_catid['cunning'] as $cunning) {
$pet_cunning = $utils->PetTalentCalcData('cunning');
foreach($pet_cunning as $cunning) {
$xml->XMLWriter()->startElement('family');
foreach($cunning as $cunning_key => $cunning_value) {
$xml->XMLWriter()->writeAttribute($cunning_key, $cunning_value);
Expand All @@ -118,8 +86,10 @@

$xml->XMLWriter()->startElement('petTalentTab');
$xml->XMLWriter()->writeAttribute('key', 'Tenacity');
$xml->XMLWriter()->writeAttribute('name', $armory->aDB->selectCell("SELECT `name_".$armory->_locale."` FROM `armory_petcalc` WHERE `id` < 0 AND `key`='tenacity'"));
$xml->XMLWriter()->writeAttribute('order', 1);
foreach($pet_catid['tenacity'] as $tenacity) {
$pet_tenacity = $utils->PetTalentCalcData('tenacity');
foreach($pet_tenacity as $tenacity) {
$xml->XMLWriter()->startElement('family');
foreach($tenacity as $tenacity_key => $tenacity_value) {
$xml->XMLWriter()->writeAttribute($tenacity_key, $tenacity_value);
Expand All @@ -130,8 +100,10 @@

$xml->XMLWriter()->startElement('petTalentTab');
$xml->XMLWriter()->writeAttribute('key', 'Ferocity');
$xml->XMLWriter()->writeAttribute('name', $armory->aDB->selectCell("SELECT `name_".$armory->_locale."` FROM `armory_petcalc` WHERE `id` < 0 AND `key`='ferocity'"));
$xml->XMLWriter()->writeAttribute('order', 0);
foreach($pet_catid['ferocity'] as $ferocity) {
$pet_ferocity = $utils->PetTalentCalcData('ferocity');
foreach($pet_ferocity as $ferocity) {
$xml->XMLWriter()->startElement('family');
foreach($ferocity as $ferocity_key => $ferocity_value) {
$xml->XMLWriter()->writeAttribute($ferocity_key, $ferocity_value);
Expand Down

0 comments on commit 312853e

Please sign in to comment.