· 5 years ago · Feb 10, 2021, 01:36 AM
1# How much is a point of +healing worth to each of our healers across a raid?
2import requests
3import os.path
4import json
5
6endpoint = 'https://classic.warcraftlogs.com/v1'
7api_key = '' # <<<<<<<<<<<<<<<<<<<<<<<<<< PUT YOUR API KEY HERE
8_NAXX_ZONE = 1006
9
10# Note: coefficient is per-tick for HoTs.
11# todo figure out regrowth
12_HEALING_COEFFICIENTS = {
13596: .29, # Prayer of Healing r1 (Priest)
14996: .29, # Prayer of Healing r2 (Priest)
152054: .731, # Heal r1 (Priest)
162055: .86, # Heal r2 (Priest)
172060: .86, # Greater Heal r1 (Priest)
182061: .43, # Flash Heal r1 (Priest)
194077: 0, # Frost Resistance
205187: .554, # Healing Touch r3 (Druid)
215188: .857, # Healing Touch r4 (Druid)
226063: .86, # Heal r3 (Priest)
236064: .86, # Heal r4 (Priest)
247242: 0, # Shadow Protection
257254: 0, # Nature Protection
268940: .286, # Regrowth r4 (Druid)
279472: .43, # Flash Heal r2 (Priest)
289474: .43, # Flash Heal r4 (Priest)
299758: 1, # Healing Touch r8 (Druid)
309856: .286, # Regrowth r7 (Druid)
319858: .286, # Regrowth r9 (Druid)
3210310: 0, # Lay on Hands (Paladin)
3310901: .1, # PW:S r10 (Priest)
3410915: .43, # Flash Heal r5 (Priest)
3510917: .43, # Flash Heal r7 (Priest)
3610960: .29, # Prayer of Healing r3 (Priest)
3710961: .29, # Prayer of Healing r4 (Priest)
3810963: .86, # Greater Heal r2 (Priest)
3910964: .86, # Greater Heal r3 (Priest)
4010965: .86, # Greater Heal r4 (Priest)
4115700: 0, # Whipper Root Tuber
4217544: 0, # Frost Protection
4317546: 0, # Nature Protection
4417548: 0, # Shadow Protection
4517549: 0, # Arcane Protection
4617543: 0, # Fire Protection
4718562: .8, # Swiftmend (Druid) <<<<< more complicated but w/e
4819243: .43, # Desparate Prayer (Priest)
4919968: .71, # Holy Light (Paladin)
5019993: .43, # Flash of Light r1 (Paladin)
5120007: 0, # Holy Strength (???)
5220340: 0, # Seal of Light
5320343: 0, # Judgement of Light
5422729: .2, # Rejuvenation Potion
5522845: 0, # Frenzied Regeneration (Druid)
5623477: 0, # Major Healthstone
5723891: 0, # Bloodthirst (Warrior)
5825314: .86, # Greater Heal r5 (Priest)
5925297: 1, # Healing Touch r11 (Druid)
6025316: .29, # Prayer of Healing r5 (Priest)
6125903: .43, # Holy Shock r3 (Paladin)
6226470: 0, # Persistent Shield (Scarab Brooch) <<<<<<<<< more complicated but w/e
6327805: .0714, # Holy Nova r6 (Priest)
6428810: 0, # Armor of Faith (???)
6528817: 0, # Invigorate (???)
6628839: 0 # Vampirisim (???)
67}
68
69_HEALING_TICK_COEFFICIENTS = {
70139: .11, # Renew r1 (Priest)
712090: .2, # Rejuv r4 (Druid)
723627: .2, # Rejuv r6 (Druid)
736075: .2, # Renew r3 (Priest)
746076: .2, # Renew r4 (Priest)
758910: .2, # Rejuv r7 (Druid)
768940: .497, # Regrowth r4 (Druid)
779856: .497, # Regrowth r7 (Druid)
789858: .497, # Regrowth r9 (Druid)
7910927: .2, # Renew r7 (Priest)
8010929: .2, # Renew r9 (Priest)
8118610: 0, # First Aid
8222009: .2, # Priest T2 5/8
8325299: .2, # Rejuv r11 (Druid)
8425315: .2, # Renew r10 (Priest)
85}
86
87
88def sendRequest(path):
89 resp = requests.get(path)
90 if resp.status_code != 200:
91 raise Exception('Fucked up ', resp.text)
92 with open(persistedFileName, 'w') as f:
93 json.dump(resp.json(), f)
94 return resp.json()
95
96def getHealerSourceIds(id):
97 l = sendRequest('%s/report/tables/healing/%s?api_key=%s&by=source&end=100000000&encounter=-3' % (endpoint, id, api_key))
98 return dict(map(lambda i: (i['name'], i['id']), filter(lambda i: i['total'] > 500000, l['entries'])))
99
100def getHeals(id, source_id, encounter):
101 return sendRequest('%s/report/events/healing/%s?api_key=%s&end=100000000&encounter=%s&sourceid=%s' % (endpoint, id, api_key, encounter, source_id))
102
103def getHealingForEvent(e):
104 if 'tick' in e:
105 return _HEALING_TICK_COEFFICIENTS[e['ability']['guid']]
106
107 h = _HEALING_COEFFICIENTS[e['ability']['guid']]
108 return h*1.5 if 'hitType' in e and e['hitType'] == 2 else h
109
110def printIt(raid_id, healers, encounter):
111 hp_impact = {};
112 for healer_name, healer_id in healers.items():
113 heal_events = getHeals(raid_id, healer_id, encounter)
114 hp_impact[healer_name] = len(list(map(lambda e: getHealingForEvent(e), filter(lambda e: not 'overheal' in e, heal_events['events']))))
115 print(['%s: %s' % (i, hp_impact[i]) for i in sorted(hp_impact, key=hp_impact.get, reverse=True)])
116
117raid_ids = ['7LxHy3rkQXj4pmPw'] # <<<<<<<<<<<<<<<<<<<<<<<< Add one or more raid IDs here
118
119for raid_id in raid_ids:
120 print(raid_id)
121 healers = getHealerSourceIds(raid_id)
122 print('Bosses')
123 printIt(raid_id, healers, -2)
124 print('Bosses and Trash')
125 printIt(raid_id, healers, -3)
126