-
Notifications
You must be signed in to change notification settings - Fork 717
/
Copy pathspelldatadump_ci.sh
executable file
·70 lines (56 loc) · 1.96 KB
/
spelldatadump_ci.sh
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
#!/bin/bash
# convert unix line endings to windows since that's been the standard
convert_line_ending()
{
sed 's/$'"/`echo \\\r`/" $1.unix > $1
rm $1.unix
}
CLASSES=(warrior hunter monk paladin rogue shaman mage warlock druid deathknight priest demonhunter evoker)
# get directory of this script
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd $DIR/..
if grep -q "#define SC_USE_PTR 1" engine/config.hpp; then
HAS_PTR=1
else
HAS_PTR=0
fi
for CLASS in "${CLASSES[@]}"
do
echo "Processing $CLASS"
FILE=SpellDataDump/$CLASS.txt
echo $FILE
${SIMC_CLI_PATH} display_build="0" spell_query="spell.class=$CLASS" > $FILE.unix
convert_line_ending $FILE
if [ "$HAS_PTR" -eq 1 ]; then
FILE=SpellDataDump/${CLASS}_ptr.txt
echo $FILE
${SIMC_CLI_PATH} display_build="0" ptr="1" spell_query="spell.class=$CLASS" > $FILE.unix
convert_line_ending $FILE
fi
done
FILE=SpellDataDump/allspells.txt
${SIMC_CLI_PATH} display_build="0" spell_query="spell" > $FILE.unix
convert_line_ending $FILE
FILE=SpellDataDump/nonclass.txt
${SIMC_CLI_PATH} display_build="0" spell_query="spell.class=none" > $FILE.unix
convert_line_ending $FILE
FILE=SpellDataDump/build_info.txt
${SIMC_CLI_PATH} display_build="2" > $FILE.unix
convert_line_ending $FILE
FILE=SpellDataDump/bonus_ids.txt
${SIMC_CLI_PATH} display_build="0" show_bonus_ids="1" > $FILE.unix
convert_line_ending $FILE
if [ "$HAS_PTR" -eq 1 ]; then
FILE=SpellDataDump/allspells_ptr.txt
${SIMC_CLI_PATH} display_build="0" ptr="1" spell_query="spell" > $FILE.unix
convert_line_ending $FILE
FILE=SpellDataDump/nonclass_ptr.txt
${SIMC_CLI_PATH} display_build="0" ptr="1" spell_query="spell.class=none" > $FILE.unix
convert_line_ending $FILE
FILE=SpellDataDump/build_info_ptr.txt
${SIMC_CLI_PATH} display_build="2" ptr="1" > $FILE.unix
convert_line_ending $FILE
FILE=SpellDataDump/bonus_ids_ptr.txt
${SIMC_CLI_PATH} display_build="0" ptr="1" show_bonus_ids="1" > $FILE.unix
convert_line_ending $FILE
fi