Skip to content

Commit a2a08e1

Browse files
committed
Add mists durations, fix library versioning. add mists toc.
1 parent c64d5ae commit a2a08e1

File tree

2 files changed

+190
-0
lines changed

2 files changed

+190
-0
lines changed

MagicComm/CCSpellIDsMists.lua

Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
--[[
2+
**********************************************************************
3+
MagicMarker - your best friend for raid marking. See README.txt for
4+
more details.
5+
**********************************************************************
6+
This file is part of MagicMarker, a World of Warcraft Addon
7+
8+
MagicMarker is free software: you can redistribute it and/or modify
9+
it under the terms of the GNU General Public License as published by
10+
the Free Software Foundation, either version 3 of the License, or
11+
(at your option) any later version.
12+
13+
MagicMarker is distributed in the hope that it will be useful, but
14+
WITHOUT ANY WARRANTY; without even the implied warranty of
15+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16+
General Public License for more details.
17+
18+
You should have received a copy of the GNU General Public License
19+
along with MagicMarker. If not, see <http://www.gnu.org/licenses/>.
20+
21+
**********************************************************************
22+
List of spell ID's for Wrath for all crowd control spells.
23+
Used for auto-learning which abilities can be used to CC a mob
24+
**********************************************************************
25+
]]
26+
27+
if WOW_PROJECT_ID ~= WOW_PROJECT_CLASSIC then return end
28+
29+
local version = select(1, GetBuildInfo())
30+
if not version or not version:match("^5%.") then return end
31+
32+
local comm = LibStub("MagicComm-1.0")
33+
if comm.upgradeDone then
34+
-- A newer version was already loaded, so don't "upgrade"
35+
return
36+
end
37+
38+
comm.upgradeDone = true
39+
40+
comm.spellIdToCCID = {
41+
-- Polymorph
42+
[118] = 2, [28271] = 2, [28272] = 2,
43+
[61025] = 2, [61305] = 2, [61721] = 2, [61780] = 2,
44+
45+
-- Banish
46+
[710] = 3,
47+
48+
-- Shackle
49+
[9484] = 4,
50+
51+
-- Hibernate
52+
[2637] = 5,
53+
[104045] = 5, -- metamorph fear change
54+
55+
-- Freezing Trap
56+
[3355] = 6,
57+
58+
-- 7 = KITE, not auto-learned
59+
60+
-- Mind control
61+
[605] = 8, [19812] = 8,
62+
63+
-- Fear
64+
[5782] = 9, [5484] = 9, [8122] = 9,
65+
66+
-- Death Coil
67+
[6789] = 9,
68+
69+
-- Sap
70+
[6770] = 10,
71+
72+
-- Enslave
73+
[1098] = 11,
74+
[104043] = 11, -- metamorth enslace
75+
76+
-- Root
77+
[339] = 12,
78+
79+
-- Cyclone
80+
[33786] = 13,
81+
82+
-- Scare Beast
83+
[1513] = 15,
84+
85+
-- Seduction
86+
[6358] = 16,
87+
88+
-- Turn Evil
89+
[10326] = 17,
90+
91+
-- Blind
92+
[2094] = 18,
93+
94+
-- 19 = "burn down", not auto-learned
95+
96+
-- Hex
97+
[51514] = 20,
98+
99+
-- Repentance
100+
[20066] = 21,
101+
102+
-- Bind Elemental
103+
[76780] = 22,
104+
105+
-- These aren't used for Magic Marker but are here for
106+
-- the duration auto scanning script. They are used by
107+
-- Magic Targets.
108+
-- Ring of Frost,
109+
-- [82691]
110+
}
111+
112+
113+
-- Spell durations in seconds
114+
comm.spellIdToDuration = {
115+
[118] = 50,
116+
[339] = 30,
117+
[605] = 30,
118+
[710] = 30,
119+
[1098] = 5,
120+
[1513] = 20,
121+
[2094] = 1,
122+
[2637] = 40,
123+
[3355] = 1,
124+
[5484] = 20,
125+
[5782] = 20,
126+
[6358] = 30,
127+
[6770] = 1,
128+
[6789] = 3,
129+
[8122] = 8,
130+
[9484] = 50,
131+
[10326] = 40,
132+
[19812] = 8,
133+
[20066] = 1,
134+
[28271] = 50,
135+
[28272] = 50,
136+
[33786] = 6,
137+
[51514] = 1,
138+
[61025] = 50,
139+
[61305] = 50,
140+
[61721] = 50,
141+
[61780] = 50,
142+
[76780] = 50,
143+
[82691] = 10,
144+
[104043] = 5,
145+
[104045] = 20,
146+
}

getdurations-mists.pike

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#!/usr/bin/env pike
2+
3+
int main(int argc, array argv) {
4+
string spells = Stdio.read_file("MagicComm/CCSpellIDsMists.lua");
5+
array(int) spellids = ({});
6+
int spellid;
7+
constant url = "curl -L -q https://www.wowhead.com/mop-classic/spell=%d 2>/dev/null";
8+
sscanf(spells, "%*s]]%s-- Spell durations in seconds", spells);
9+
mapping output = ([]);
10+
11+
while(sscanf(spells, "%*s[%d]%s", spellid, spells) > 1) {
12+
// spellids += ({spellid});
13+
// write("Found spell ID %d\n", spellid);
14+
werror("Getting data for spell id %d...\n", spellid);
15+
string spelldata = Process.popen(sprintf(url, spellid));
16+
if(!spelldata) {
17+
werror(" UNKNOWN SPELL %d\n", spellid);
18+
continue;
19+
}
20+
int duration;
21+
// exit(1);
22+
string scale;
23+
//werror("Fields found %d\n", sscanf(spelldata, "%*s<th>Duration</th>%*s<%*s>%d %s<", duration, scale));
24+
if(sscanf(spelldata, "%*s<th>Duration</th>%*s<%*s>%d %s<", duration, scale) == 5) {
25+
if(scale[..2] == "minute") {
26+
duration = duration * 60;
27+
}
28+
output[spellid] = duration;
29+
} else {
30+
if(spellid == 5782) {
31+
output[spellid] = 20; // hard coded since duratioon isn't obvious
32+
} else {
33+
werror("%O\n", array_sscanf(spelldata, "%*s<th>Duration</th>%*s<%*s>%d %s<"));
34+
werror(" Didn't find duration...\n");
35+
}
36+
}
37+
38+
}
39+
write("comm.spellIdToDuration = {\n");
40+
foreach(sort(indices(output)), int spellid) {
41+
write(" [%d] = %d, \n", spellid, output[spellid]);
42+
}
43+
write("}\n");
44+
}

0 commit comments

Comments
 (0)