private static function CalculateCharacterIntellect($recalculate = false) { if (!self::IsCorrect()) { WoW_Log::WriteError('%s : character was not found.', __METHOD__); return false; } if (isset(self::$stats_holder['base_stats']['intellect']) && !$recalculate) { return true; } $base_intellect = min(20, self::GetStat(STAT_INTELLECT)); $more_intellect = self::GetStat(STAT_INTELLECT) - $base_intellect; self::$stats_holder['base_stats']['intellect'] = array('base' => self::GetStat(STAT_INTELLECT) - WoW_Utils::GetFloatValue(self::GetPosStat(STAT_INTELLECT), 0) - WoW_Utils::GetFloatValue(self::GetNegStat(STAT_INTELLECT), 0), 'hitCritPercent' => self::IsManaUser() ? round(WoW_Utils::GetSpellCritChanceFromIntellect(self::$rating, self::GetClassID(), self::GetStat(STAT_INTELLECT)), 2) : -1, 'effective' => self::GetStat(STAT_INTELLECT), 'mana' => self::IsManaUser() ? $base_intellect + $more_intellect * MANA_PER_INTELLECT : -1, 'petBonus' => WoW_Utils::ComputePetBonus(STAT_INTELLECT, self::GetStat(STAT_INTELLECT), self::GetClassID())); return true; }