-
Notifications
You must be signed in to change notification settings - Fork 9
/
c_server_phase.py
242 lines (213 loc) · 7.13 KB
/
c_server_phase.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
from c_path import Files
from api_top_db_v2 import Columns, DB
class Encounter:
def __init__(self, name: str, mode: str = "25H") -> None:
self.name = name
self.mode = mode
self.table_name = DB.get_table_name(name, mode)
def __str__(self):
return self.table_name
def query_row_id(self, row_id):
return f'''
SELECT *
FROM [{self.table_name}]
WHERE {Columns.PLAYER_RAID_ID}='{row_id}'
'''
def query_row_id_min(self, row_id):
return f'''
SELECT {Columns.DURATION}, {Columns.REPORT_ID}
FROM [{self.table_name}]
WHERE {Columns.PLAYER_RAID_ID}='{row_id}'
'''
def query_stats(self):
return f"""
SELECT {Columns.SPEC}, {Columns.USEFUL_DPS}
FROM [{self.table_name}]
"""
def query_dps_spec(self, spec):
return f"""
SELECT {Columns.USEFUL_DPS}
FROM [{self.table_name}]
WHERE {Columns.SPEC}={spec}
"""
def query_dps(self, spec):
return f'''
SELECT {Columns.PLAYER_RAID_ID}, {Columns.USEFUL_DPS}
FROM [{self.table_name}]
WHERE {Columns.SPEC}={spec}
ORDER BY {Columns.USEFUL_DPS} DESC
'''
def query_players_data(self):
return f'''
SELECT {Columns.PLAYER_RAID_ID}, {Columns.GUID}, {Columns.NAME}, {Columns.SPEC}
FROM [{self.table_name}]
'''
class Phase:
BOSSES_GET_GUID_NAME_PAIRS_FROM: tuple[Encounter]
FOR_POINTS: tuple[Encounter]
OTHER: tuple[Encounter]
ALL_BOSSES: tuple[Encounter]
class Tier_10:
BOSSES_GET_GUID_NAME_PAIRS_FROM = (
Encounter("Deathbringer Saurfang"),
Encounter("The Lich King"),
Encounter("Blood-Queen Lana'thel"),
Encounter("Valithria Dreamwalker"),
)
FOR_POINTS = (
Encounter("Lord Marrowgar"),
Encounter("Lady Deathwhisper"),
Encounter("Deathbringer Saurfang"),
Encounter("Festergut"),
Encounter("Rotface"),
Encounter("Professor Putricide"),
Encounter("Blood Prince Council"),
Encounter("Blood-Queen Lana'thel"),
Encounter("Sindragosa"),
Encounter("The Lich King"),
)
OTHER = (
Encounter("Toravon the Ice Watcher", "25N"),
Encounter("Halion"),
Encounter("Anub'arak"),
Encounter("Valithria Dreamwalker"),
)
ALL_BOSSES = FOR_POINTS + OTHER
class Tier_3:
BOSSES_GET_GUID_NAME_PAIRS_FROM = (
Encounter("Patchwerk", "25N"),
Encounter("Anub'Rekhan", "25N"),
Encounter("Noth the Plaguebringer", "25N"),
Encounter("Kel'Thuzad", "25N"),
)
FOR_POINTS = (
Encounter("Anub'Rekhan", "25N"),
Encounter("Grand Widow Faerlina", "25N"),
Encounter("Maexxna", "25N"),
Encounter("Noth the Plaguebringer", "25N"),
Encounter("Heigan the Unclean", "25N"),
Encounter("Loatheb", "25N"),
Encounter("Patchwerk", "25N"),
Encounter("Grobbulus", "25N"),
Encounter("Gluth", "25N"),
Encounter("Thaddius", "25N"),
Encounter("Instructor Razuvious", "25N"),
Encounter("Gothik the Harvester", "25N"),
Encounter("The Four Horsemen", "25N"),
Encounter("Sapphiron", "25N"),
Encounter("Kel'Thuzad", "25N"),
)
OTHER = ()
ALL_BOSSES = FOR_POINTS + OTHER
class Tier_5:
BOSSES_GET_GUID_NAME_PAIRS_FROM = (
Encounter("Prince Malchezaar", "10N"),
Encounter("Gruul the Dragonkiller", "25N"),
Encounter("Magtheridon", "25N"),
)
FOR_POINTS = (
Encounter("Attumen the Huntsman", "10N"),
Encounter("Moroes", "10N"),
Encounter("Maiden of Virtue", "10N"),
Encounter("Opera House", "10N"),
Encounter("The Curator", "10N"),
Encounter("Terestian Illhoof", "10N"),
Encounter("Shade of Aran", "10N"),
Encounter("Netherspite", "10N"),
Encounter("Prince Malchezaar", "10N"),
Encounter("High King Maulgar", "25N"),
Encounter("Gruul the Dragonkiller", "25N"),
Encounter("Magtheridon", "25N"),
)
OTHER = ()
ALL_BOSSES = FOR_POINTS + OTHER
class Tier_6:
BOSSES_GET_GUID_NAME_PAIRS_FROM = (
Encounter("Archimonde", "25N"),
Encounter("Illidan Stormrage", "25N"),
Encounter("Kil'jaeden", "25N"),
)
FOR_POINTS = (
Encounter("Rage Winterchill", "25N"),
Encounter("Anetheron", "25N"),
Encounter("Kaz'rogal", "25N"),
Encounter("Azgalor", "25N"),
Encounter("Archimonde", "25N"),
Encounter("High Warlord Naj'entus", "25N"),
Encounter("Supremus", "25N"),
Encounter("Shade of Akama", "25N"),
Encounter("Teron Gorefiend", "25N"),
Encounter("Gurtogg Bloodboil", "25N"),
Encounter("Reliquary of Souls", "25N"),
Encounter("Mother Shahraz", "25N"),
Encounter("The Illidari Council", "25N"),
Encounter("Illidan Stormrage", "25N"),
Encounter("Kalecgos", "25N"),
Encounter("Brutallus", "25N"),
Encounter("Felmyst", "25N"),
Encounter("Eredar Twins", "25N"),
Encounter("M'uru", "25N"),
Encounter("Kil'jaeden", "25N"),
)
OTHER = ()
ALL_BOSSES = FOR_POINTS + OTHER
class Tier_7(Tier_3):
OTHER = (
Encounter("Archavon the Stone Watcher", "25N"),
)
ALL_BOSSES = Tier_3.FOR_POINTS + OTHER
class Tier_8:
BOSSES_GET_GUID_NAME_PAIRS_FROM = (
Encounter("XT-002 Deconstructor", "25H"),
Encounter("Kologarn", "25N"),
Encounter("Yogg-Saron", "25H"),
Encounter("Algalon the Observer", "25N"),
)
FOR_POINTS = (
Encounter("Ignis the Furnace Master", "25N"),
Encounter("Razorscale", "25N"),
Encounter("XT-002 Deconstructor", "25H"),
Encounter("Assembly of Iron", "25H"),
Encounter("Kologarn", "25N"),
Encounter("Auriaya", "25N"),
Encounter("Hodir", "25N"),
Encounter("Thorim", "25N"),
Encounter("Freya", "25H"),
Encounter("Mimiron", "25H"),
Encounter("General Vezax", "25H"),
Encounter("Yogg-Saron", "25H"),
Encounter("Algalon the Observer", "25N"),
)
OTHER = (
Encounter("Emalon the Storm Watcher", "25N"),
)
ALL_BOSSES = FOR_POINTS + OTHER
class Tier_9:
BOSSES_GET_GUID_NAME_PAIRS_FROM = (
Encounter("Koralon the Flame Watcher", "25N"),
Encounter("Northrend Beasts", "25H"),
)
FOR_POINTS = (
Encounter("Northrend Beasts", "25H"),
Encounter("Lord Jaraxxus", "25H"),
Encounter("Faction Champions", "25H"),
Encounter("Twin Val'kyr", "25H"),
Encounter("Anub'arak", "25H"),
)
OTHER = (
Encounter("Koralon the Flame Watcher", "25N"),
)
ALL_BOSSES = FOR_POINTS + OTHER
SERVER_PHASE: dict[str, str] = Files.server_phases.json_ignore_error()
def get_server_phase(server):
try:
phase = SERVER_PHASE[server]
return globals()[phase]
except KeyError:
return Tier_10
def main():
print(get_server_phase("Lordaeron"))
print(get_server_phase("Whitemane-Frostmourne"))
print(get_server_phase("Onyxia"))
if __name__ == "__main__":
main()