Модератор
Регистрация: 03.06.2012
Сообщений: 4,624
|
Для выдачи не выданных героев.
Эта тема предназначена для тех, кто желает выдать не выданных героев за прошедший месяц.
Для этой процедуры обновление самой сборки можно не дожидаться, а сделать прямо сейчас.
!!!Внимание!!! Статистика олимпиады с 1го по текущее число (когда вы поставите этот запрос), ОБНУЛИТСЯ!
1. Выключаем сервер.
2. Переименовываем таблицу olympiad_nobles в olympiad_nobles1.
3. Восстанавливаем бекап таких таблиц: heroes, olympiad_history, olympiad_nobles, за 28.02.2013 или ранее.
4. Выполняем этот запрос
!!!ВНИМАНИЕ!!! ЗАПРОС ВЫПОЛНЯЕМ ТОЛЬКО ОДИН РАЗ!!!
PHP код:
DELETE FROM olympiad_history WHERE old=1; UPDATE olympiad_history SET old=1;
UPDATE heroes SET played = 0, active = 0;
REPLACE INTO heroes (`char_id`, `count`, `played`, `active`, `message`) SELECT olympiad_nobles.char_id, heroes.count + 1, 1, 0, '' FROM olympiad_nobles LEFT JOIN character_subclasses ON olympiad_nobles.char_id=character_subclasses.char_obj_id AND character_subclasses.type=0 LEFT JOIN heroes ON olympiad_nobles.char_id=heroes.char_id AND character_subclasses.type=0 WHERE heroes.char_id > 0 AND character_subclasses.class_id = 139 AND `competitions_done` >= 15 AND `competitions_win` > 0 ORDER BY `olympiad_points` DESC, `competitions_win` DESC, `competitions_done` DESC LIMIT 1; REPLACE INTO heroes (`char_id`, `count`, `played`, `active`, `message`) SELECT olympiad_nobles.char_id, heroes.count + 1, 1, 0, '' FROM olympiad_nobles LEFT JOIN character_subclasses ON olympiad_nobles.char_id=character_subclasses.char_obj_id AND character_subclasses.type=0 LEFT JOIN heroes ON olympiad_nobles.char_id=heroes.char_id AND character_subclasses.type=0 WHERE heroes.char_id > 0 AND character_subclasses.class_id = 140 AND `competitions_done` >= 15 AND `competitions_win` > 0 ORDER BY `olympiad_points` DESC, `competitions_win` DESC, `competitions_done` DESC LIMIT 1; REPLACE INTO heroes (`char_id`, `count`, `played`, `active`, `message`) SELECT olympiad_nobles.char_id, heroes.count + 1, 1, 0, '' FROM olympiad_nobles LEFT JOIN character_subclasses ON olympiad_nobles.char_id=character_subclasses.char_obj_id AND character_subclasses.type=0 LEFT JOIN heroes ON olympiad_nobles.char_id=heroes.char_id AND character_subclasses.type=0 WHERE heroes.char_id > 0 AND character_subclasses.class_id = 141 AND `competitions_done` >= 15 AND `competitions_win` > 0 ORDER BY `olympiad_points` DESC, `competitions_win` DESC, `competitions_done` DESC LIMIT 1; REPLACE INTO heroes (`char_id`, `count`, `played`, `active`, `message`) SELECT olympiad_nobles.char_id, heroes.count + 1, 1, 0, '' FROM olympiad_nobles LEFT JOIN character_subclasses ON olympiad_nobles.char_id=character_subclasses.char_obj_id AND character_subclasses.type=0 LEFT JOIN heroes ON olympiad_nobles.char_id=heroes.char_id AND character_subclasses.type=0 WHERE heroes.char_id > 0 AND character_subclasses.class_id = 142 AND `competitions_done` >= 15 AND `competitions_win` > 0 ORDER BY `olympiad_points` DESC, `competitions_win` DESC, `competitions_done` DESC LIMIT 1; REPLACE INTO heroes (`char_id`, `count`, `played`, `active`, `message`) SELECT olympiad_nobles.char_id, heroes.count + 1, 1, 0, '' FROM olympiad_nobles LEFT JOIN character_subclasses ON olympiad_nobles.char_id=character_subclasses.char_obj_id AND character_subclasses.type=0 LEFT JOIN heroes ON olympiad_nobles.char_id=heroes.char_id AND character_subclasses.type=0 WHERE heroes.char_id > 0 AND character_subclasses.class_id = 143 AND `competitions_done` >= 15 AND `competitions_win` > 0 ORDER BY `olympiad_points` DESC, `competitions_win` DESC, `competitions_done` DESC LIMIT 1; REPLACE INTO heroes (`char_id`, `count`, `played`, `active`, `message`) SELECT olympiad_nobles.char_id, heroes.count + 1, 1, 0, '' FROM olympiad_nobles LEFT JOIN character_subclasses ON olympiad_nobles.char_id=character_subclasses.char_obj_id AND character_subclasses.type=0 LEFT JOIN heroes ON olympiad_nobles.char_id=heroes.char_id AND character_subclasses.type=0 WHERE heroes.char_id > 0 AND character_subclasses.class_id = 144 AND `competitions_done` >= 15 AND `competitions_win` > 0 ORDER BY `olympiad_points` DESC, `competitions_win` DESC, `competitions_done` DESC LIMIT 1; REPLACE INTO heroes (`char_id`, `count`, `played`, `active`, `message`) SELECT olympiad_nobles.char_id, heroes.count + 1, 1, 0, '' FROM olympiad_nobles LEFT JOIN character_subclasses ON olympiad_nobles.char_id=character_subclasses.char_obj_id AND character_subclasses.type=0 LEFT JOIN heroes ON olympiad_nobles.char_id=heroes.char_id AND character_subclasses.type=0 WHERE heroes.char_id > 0 AND character_subclasses.class_id = 145 AND `competitions_done` >= 15 AND `competitions_win` > 0 ORDER BY `olympiad_points` DESC, `competitions_win` DESC, `competitions_done` DESC LIMIT 1; REPLACE INTO heroes (`char_id`, `count`, `played`, `active`, `message`) SELECT olympiad_nobles.char_id, heroes.count + 1, 1, 0, '' FROM olympiad_nobles LEFT JOIN character_subclasses ON olympiad_nobles.char_id=character_subclasses.char_obj_id AND character_subclasses.type=0 LEFT JOIN heroes ON olympiad_nobles.char_id=heroes.char_id AND character_subclasses.type=0 WHERE heroes.char_id > 0 AND character_subclasses.class_id = 146 AND `competitions_done` >= 15 AND `competitions_win` > 0 ORDER BY `olympiad_points` DESC, `competitions_win` DESC, `competitions_done` DESC LIMIT 1;
REPLACE INTO heroes (`char_id`, `count`, `played`, `active`, `message`) SELECT olympiad_nobles.char_id, 1, 1, 0, '' FROM olympiad_nobles LEFT JOIN character_subclasses ON olympiad_nobles.char_id=character_subclasses.char_obj_id AND character_subclasses.type=0 WHERE olympiad_nobles.char_id NOT IN (SELECT char_id FROM heroes) AND character_subclasses.class_id = 139 AND `competitions_done` >= 15 AND `competitions_win` > 0 ORDER BY `olympiad_points` DESC, `competitions_win` DESC, `competitions_done` DESC LIMIT 1; REPLACE INTO heroes (`char_id`, `count`, `played`, `active`, `message`) SELECT olympiad_nobles.char_id, 1, 1, 0, '' FROM olympiad_nobles LEFT JOIN character_subclasses ON olympiad_nobles.char_id=character_subclasses.char_obj_id AND character_subclasses.type=0 WHERE olympiad_nobles.char_id NOT IN (SELECT char_id FROM heroes) AND character_subclasses.class_id = 140 AND `competitions_done` >= 15 AND `competitions_win` > 0 ORDER BY `olympiad_points` DESC, `competitions_win` DESC, `competitions_done` DESC LIMIT 1; REPLACE INTO heroes (`char_id`, `count`, `played`, `active`, `message`) SELECT olympiad_nobles.char_id, 1, 1, 0, '' FROM olympiad_nobles LEFT JOIN character_subclasses ON olympiad_nobles.char_id=character_subclasses.char_obj_id AND character_subclasses.type=0 WHERE olympiad_nobles.char_id NOT IN (SELECT char_id FROM heroes) AND character_subclasses.class_id = 141 AND `competitions_done` >= 15 AND `competitions_win` > 0 ORDER BY `olympiad_points` DESC, `competitions_win` DESC, `competitions_done` DESC LIMIT 1; REPLACE INTO heroes (`char_id`, `count`, `played`, `active`, `message`) SELECT olympiad_nobles.char_id, 1, 1, 0, '' FROM olympiad_nobles LEFT JOIN character_subclasses ON olympiad_nobles.char_id=character_subclasses.char_obj_id AND character_subclasses.type=0 WHERE olympiad_nobles.char_id NOT IN (SELECT char_id FROM heroes) AND character_subclasses.class_id = 142 AND `competitions_done` >= 15 AND `competitions_win` > 0 ORDER BY `olympiad_points` DESC, `competitions_win` DESC, `competitions_done` DESC LIMIT 1; REPLACE INTO heroes (`char_id`, `count`, `played`, `active`, `message`) SELECT olympiad_nobles.char_id, 1, 1, 0, '' FROM olympiad_nobles LEFT JOIN character_subclasses ON olympiad_nobles.char_id=character_subclasses.char_obj_id AND character_subclasses.type=0 WHERE olympiad_nobles.char_id NOT IN (SELECT char_id FROM heroes) AND character_subclasses.class_id = 143 AND `competitions_done` >= 15 AND `competitions_win` > 0 ORDER BY `olympiad_points` DESC, `competitions_win` DESC, `competitions_done` DESC LIMIT 1; REPLACE INTO heroes (`char_id`, `count`, `played`, `active`, `message`) SELECT olympiad_nobles.char_id, 1, 1, 0, '' FROM olympiad_nobles LEFT JOIN character_subclasses ON olympiad_nobles.char_id=character_subclasses.char_obj_id AND character_subclasses.type=0 WHERE olympiad_nobles.char_id NOT IN (SELECT char_id FROM heroes) AND character_subclasses.class_id = 144 AND `competitions_done` >= 15 AND `competitions_win` > 0 ORDER BY `olympiad_points` DESC, `competitions_win` DESC, `competitions_done` DESC LIMIT 1; REPLACE INTO heroes (`char_id`, `count`, `played`, `active`, `message`) SELECT olympiad_nobles.char_id, 1, 1, 0, '' FROM olympiad_nobles LEFT JOIN character_subclasses ON olympiad_nobles.char_id=character_subclasses.char_obj_id AND character_subclasses.type=0 WHERE olympiad_nobles.char_id NOT IN (SELECT char_id FROM heroes) AND character_subclasses.class_id = 145 AND `competitions_done` >= 15 AND `competitions_win` > 0 ORDER BY `olympiad_points` DESC, `competitions_win` DESC, `competitions_done` DESC LIMIT 1; REPLACE INTO heroes (`char_id`, `count`, `played`, `active`, `message`) SELECT olympiad_nobles.char_id, 1, 1, 0, '' FROM olympiad_nobles LEFT JOIN character_subclasses ON olympiad_nobles.char_id=character_subclasses.char_obj_id AND character_subclasses.type=0 WHERE olympiad_nobles.char_id NOT IN (SELECT char_id FROM heroes) AND character_subclasses.class_id = 146 AND `competitions_done` >= 15 AND `competitions_win` > 0 ORDER BY `olympiad_points` DESC, `competitions_win` DESC, `competitions_done` DESC LIMIT 1;
UPDATE `olympiad_nobles` SET `olympiad_points_past` = `olympiad_points`, `olympiad_points_past_static` = `olympiad_points` WHERE `competitions_done` >= 15; UPDATE `olympiad_nobles` SET `olympiad_points` = 50, `competitions_done` = 0, `competitions_win` = 0, `competitions_loose` = 0, game_classes_count=0, game_noclasses_count=0;
UPDATE olympiad_nobles, olympiad_nobles1 SET olympiad_nobles.olympiad_points=olympiad_nobles1.olympiad_points+olympiad_nobles.olympiad_points, olympiad_nobles.olympiad_points_past=olympiad_nobles1.olympiad_points_past+olympiad_nobles.olympiad_points_past, olympiad_nobles.olympiad_points_past_static=olympiad_nobles1.olympiad_points_past_static+olympiad_nobles.olympiad_points_past_static, olympiad_nobles.competitions_done=olympiad_nobles1.competitions_done+olympiad_nobles.competitions_done, olympiad_nobles.competitions_win=olympiad_nobles1.competitions_win+olympiad_nobles.competitions_win, olympiad_nobles.competitions_loose=olympiad_nobles1.competitions_loose+olympiad_nobles.competitions_loose, olympiad_nobles.game_classes_count=olympiad_nobles1.game_classes_count+olympiad_nobles.game_classes_count, olympiad_nobles.game_noclasses_count=olympiad_nobles1.game_noclasses_count+olympiad_nobles.game_noclasses_count WHERE olympiad_nobles.char_id=olympiad_nobles1.char_id;
REPLACE INTO olympiad_nobles (`char_id`, `class_id`, `olympiad_points`, `olympiad_points_past`, `olympiad_points_past_static`, `competitions_done`, `competitions_win`, `competitions_loose`, `game_classes_count`, `game_noclasses_count`) SELECT olympiad_nobles1.char_id, olympiad_nobles1.class_id, olympiad_nobles1.olympiad_points, olympiad_nobles1.olympiad_points_past, olympiad_nobles1.olympiad_points_past_static, olympiad_nobles1.competitions_done, olympiad_nobles1.competitions_win, olympiad_nobles1.competitions_loose, olympiad_nobles1.game_classes_count, olympiad_nobles1.game_noclasses_count FROM olympiad_nobles1 WHERE olympiad_nobles1.char_id NOT IN (SELECT char_id FROM olympiad_nobles); DROP TABLE olympiad_nobles1;
или же скачайте в SQL: http://yadi.sk/d/Pzz7OW2Z311Xp
5. Запускаем сервер.
6. Готово.
__________________
Техническая поддержка L2-Scripts
Внимание: с 1 мая 2015 г. скайп технической поддержки будет: L2-scripts
старый скайп тех поддержки обслуживаться не будет !
Последний раз редактировалось Core; 07.03.2013 в 07:45.
|