public static function GetTalentsData() { if (!self::IsCorrect()) { WoW_Log::WriteError('%s : character was not found.', __METHOD__); return false; } if (self::$fullTalentData && is_array(self::$fullTalentData)) { return self::$fullTalentData; } self::HandleTalents(true); // Get specs names/icons $current_spec = array(); $specsData = array(); for ($i = 0; $i < self::GetSpecCount(); $i++) { if (!isset(self::$talent_points[$i])) { $specsData[$i] = array('group' => $i + 1, 'icon' => 'inv_misc_questionmark', 'name' => WoW_Locale::GetString('template_no_talents'), 'treeOne' => 0, 'treeTwo' => 0, 'treeThree' => 0, 'active' => self::GetActiveSpec() == $i ? 1 : 0, 'roles' => null, 'text_group' => $i == 1 ? 'primary' : 'secondary'); continue; } $current_spec[$i] = WoW_Utils::GetMaxArray(self::$talent_points[$i]); $specsData[$i] = array('group' => $i + 1, 'icon' => self::GetTalentSpecIconFromDB($current_spec[$i]), 'name' => self::GetTalentSpecNameFromDB($current_spec[$i]), 'treeOne' => self::$talent_points[$i][self::GetTalentTabForClass(0)], 'treeTwo' => self::$talent_points[$i][self::GetTalentTabForClass(1)], 'treeThree' => self::$talent_points[$i][self::GetTalentTabForClass(2)], 'active' => 0, 'roles' => null, 'text_group' => $i == 1 ? 'primary' : 'secondary'); $spec_roles = self::GetTalentSpecRolesFromDB($current_spec[$i]); $roles = null; if (is_array($spec_roles)) { foreach ($spec_roles as $role => $allowed) { if ($allowed == 1) { $roles .= sprintf('<span class="icon-%s"></span>', $role); } } } if (self::GetActiveSpec() == $i) { $specsData[$i]['active'] = 1; } $specsData[$i]['roles'] = $roles; if ($specsData[$i]['treeOne'] == 0 && $specsData[$i]['treeTwo'] == 0 && $specsData[$i]['treeThree'] == 0) { // have no talents $specsData[$i]['icon'] = 'inv_misc_questionmark'; $specsData[$i]['prim'] = WoW_Locale::GetString('template_no_talents'); $specsData[$i]['roles'] = null; } } self::$fullTalentData = array('build' => self::$talent_build, 'specsData' => $specsData); return self::$fullTalentData; }