Пример #1
0
def check_banners(c):
  award_player_banners(c, 'zin',
                       query_first_col(c, '''SELECT player
                                             FROM all_hellpan_kills'''),
                       3)
  award_player_banners(c, 'zin',
                       query_first_col(c, '''SELECT player
                                             FROM have_hellpan_kills'''),
                       2)
  award_player_banners(c, 'jiyva',
                       query_first_col(c,
                                       '''
SELECT player, COUNT(DISTINCT MID(charabbrev,1,2)) AS race_count,
               COUNT(DISTINCT MID(charabbrev,3,2)) AS class_count
FROM
(SELECT player, charabbrev FROM games WHERE xl>=9
UNION
SELECT player, charabbrev FROM milestones WHERE xl>=9) AS T
GROUP BY player
HAVING race_count >= 5 AND class_count >= 5'''),
                       1)
  award_player_banners(c, 'jiyva',
                       query_first_col(c,
                                       '''SELECT player FROM fivefives_rune'''),
                       2)
  award_player_banners(c, 'jiyva',
                       query_first_col(c,
                                       '''SELECT player FROM fivefives_win'''),
                       3)
  award_player_banners(c, 'fedhas',
                       query_first_col(c,
                                       '''SELECT player FROM orbrun_tomb'''),
                       3)
  award_player_banners(c, 'yredelemnul',
                       query_first_col(c,
                                       '''SELECT player FROM kunique_times
                                          WHERE nuniques >= 65'''),
                       3)
  award_player_banners(c, 'yredelemnul',
                       query_first_col(c,
                                       '''SELECT player FROM kunique_times
                                          WHERE nuniques >= 45'''),
                       2)
  award_player_banners(c, 'yredelemnul',
                       query_first_col(c,
                                       '''SELECT player FROM kunique_times
                                          WHERE nuniques >= 25'''),
                       1)
  rows = query_rows(c, '''SELECT * FROM nearby_uniques''')
  for r in rows:
    a = uniq.how_deep(r[1])
    b = uniq.how_deep(r[2])
    d = 3 - (r[4] - r[3])
    if b < a:
      a = b
    if d < a:
      a = d
    banner.award_banner(c, r[0], 'vehumet', a)
Пример #2
0
def check_banners(c):
  award_player_banners(c, 'zin',
                       query_first_col(c, '''SELECT player
                                             FROM all_hellpan_kills'''),
                       3)
  award_player_banners(c, 'zin',
                       query_first_col(c, '''SELECT player
                                             FROM have_hellpan_kills'''),
                       2)
  award_player_banners(c, 'jiyva',
                       query_first_col(c,
                                       '''SELECT player FROM fivefives_nine'''),
                       1)
  award_player_banners(c, 'jiyva',
                       query_first_col(c,
                                       '''SELECT player FROM fivefives_rune'''),
                       2)
  award_player_banners(c, 'jiyva',
                       query_first_col(c,
                                       '''SELECT player FROM fivefives_win'''),
                       3)
  award_player_banners(c, 'fedhas',
                       query_first_col(c,
                                       '''SELECT player FROM orbrun_tomb'''),
                       3)
  award_player_banners(c, 'yredelemnul',
                       query_first_col(c,
                                       '''SELECT player FROM kunique_times
                                          WHERE nuniques >= 65'''),
                       3)
  award_player_banners(c, 'yredelemnul',
                       query_first_col(c,
                                       '''SELECT player FROM kunique_times
                                          WHERE nuniques >= 45'''),
                       2)
  award_player_banners(c, 'yredelemnul',
                       query_first_col(c,
                                       '''SELECT player FROM kunique_times
                                          WHERE nuniques >= 25'''),
                       1)
  rows = query_rows(c, '''SELECT * FROM nearby_uniques''')
  for r in rows:
    a = uniq.how_deep(r[1])
    b = uniq.how_deep(r[2])
    d = 3 - (r[4] - r[3])
    if b < a:
      a = b
    if d < a:
      a = d
    banner.award_banner(c, r[0], 'vehumet', a)