diff --git a/includes/defines.php b/includes/defines.php index 98b78c2b..ce7837e8 100644 --- a/includes/defines.php +++ b/includes/defines.php @@ -1157,11 +1157,13 @@ define('ACHIEVEMENT_CRITERIA_CONDITION_NOT_IN_GROUP', 10); define('ACHIEVEMENT_FLAG_COUNTER', 0x0001); // Just count statistic (never stop and complete) define('ACHIEVEMENT_FLAG_HIDDEN', 0x0002); // Not sent to client - internal use only define('ACHIEVEMENT_FLAG_STORE_MAX_VALUE', 0x0004); // Store only max value? used only in "Reach level xx" -define('ACHIEVEMENT_FLAG_SUMM', 0x0008); // Use summ criteria value from all reqirements (and calculate max value) +define('ACHIEVEMENT_FLAG_SUM', 0x0008); // Use sum criteria value from all reqirements (and calculate max value) define('ACHIEVEMENT_FLAG_MAX_USED', 0x0010); // Show max criteria (and calculate max value ??) define('ACHIEVEMENT_FLAG_REQ_COUNT', 0x0020); // Use not zero req count (and calculate max value) define('ACHIEVEMENT_FLAG_AVERAGE', 0x0040); // Show as average value (value / time_in_days) depend from other flag (by def use last criteria value) -define('ACHIEVEMENT_FLAG_BAR', 0x0080); // Show as progress bar (value / max vale) depend from other flag (by def use last criteria value) +define('ACHIEVEMENT_FLAG_PROGRESS_BAR', 0x0080); // Show as progress bar (value / max vale) depend from other flag (by def use last criteria value) +define('ACHIEVEMENT_FLAG_REALM_FIRST', 0x0100); // first max race/class/profession +define('ACHIEVEMENT_FLAG_REALM_FIRST_KILL', 0x0200); // first boss kill // AchievementCriteriaFlags define('ACHIEVEMENT_CRITERIA_FLAG_SHOW_PROGRESS_BAR', 0x0001); // Show progress as bar diff --git a/includes/profiler.class.php b/includes/profiler.class.php index 674c489c..24bc6633 100644 --- a/includes/profiler.class.php +++ b/includes/profiler.class.php @@ -666,7 +666,7 @@ class Profiler foreach (Util::createSqlBatchInsert($achievements) as $a) DB::Aowow()->query('INSERT INTO ?_profiler_completion (?#) VALUES '.$a, array_keys($achievements[0])); - $data['achievementpoints'] = DB::Aowow()->selectCell('SELECT SUM(points) FROM ?_achievement WHERE id IN (?a)', array_column($achievements, 'typeId')); + $data['achievementpoints'] = DB::Aowow()->selectCell('SELECT SUM(points) FROM ?_achievement WHERE id IN (?a) AND (flags & ?d) = 0', array_column($achievements, 'typeId'), ACHIEVEMENT_FLAG_COUNTER); } CLI::write(' ..achievements'); diff --git a/includes/types/profile.class.php b/includes/types/profile.class.php index d629463c..8ba36da6 100644 --- a/includes/types/profile.class.php +++ b/includes/types/profile.class.php @@ -750,9 +750,6 @@ class LocalProfileList extends ProfileList $realms = Profiler::getRealms(); - // post processing - $acvPoints = DB::Aowow()->selectCol('SELECT pc.id AS ARRAY_KEY, SUM(a.points) FROM ?_profiler_completion pc LEFT JOIN ?_achievement a ON a.id = pc.typeId WHERE pc.`type` = ?d AND pc.id IN (?a) GROUP BY pc.id', Type::ACHIEVEMENT, $this->getFoundIDs()); - foreach ($this->iterate() as $id => &$curTpl) { if ($curTpl['realm'] && !isset($realms[$curTpl['realm']])) @@ -766,8 +763,6 @@ class LocalProfileList extends ProfileList // battlegroup $curTpl['battlegroup'] = CFG_BATTLEGROUP; - - $curTpl['achievementpoints'] = isset($acvPoints[$id]) ? $acvPoints[$id] : 0; } }