annotate Spells.cpp @ 1208:4d90f0591add

Merge
author Grumpy7
date Sun, 09 Jun 2013 01:41:55 +0200
parents ab6560001f5b
children 86a83e12d795 dcc52e17b517
rev   line source
1165
29a8defbad9e temporary _CRT_SECURE_NO_WARNINGS to remove some warnings
Grumpy7
parents: 1104
diff changeset
1 #ifdef _MSC_VER
29a8defbad9e temporary _CRT_SECURE_NO_WARNINGS to remove some warnings
Grumpy7
parents: 1104
diff changeset
2 #define _CRT_SECURE_NO_WARNINGS
29a8defbad9e temporary _CRT_SECURE_NO_WARNINGS to remove some warnings
Grumpy7
parents: 1104
diff changeset
3 #endif
29a8defbad9e temporary _CRT_SECURE_NO_WARNINGS to remove some warnings
Grumpy7
parents: 1104
diff changeset
4
0
Ritor1
parents:
diff changeset
5 #include <stdlib.h>
Ritor1
parents:
diff changeset
6
Ritor1
parents:
diff changeset
7 #include "Spells.h"
Ritor1
parents:
diff changeset
8 #include "Overlays.h"
Ritor1
parents:
diff changeset
9 #include "Allocator.h"
Ritor1
parents:
diff changeset
10 #include "LOD.h"
189
038a4d09406f new texts file, fix text rendender error
Gloval
parents: 142
diff changeset
11 #include "texts.h"
0
Ritor1
parents:
diff changeset
12
Ritor1
parents:
diff changeset
13 #include "mm7_data.h"
Ritor1
parents:
diff changeset
14
Ritor1
parents:
diff changeset
15
Ritor1
parents:
diff changeset
16
Ritor1
parents:
diff changeset
17
1206
ab6560001f5b arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents: 1205
diff changeset
18 std::array<TownPortalData, 6> TownPortalList = //4ECBB8
ab6560001f5b arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents: 1205
diff changeset
19 {{
839
ae8f83e1b0cf coordinates for the town portal
x1diablo
parents: 490
diff changeset
20 {Vec3_int_(-5121, 2107, 1), 1536, 0, 21, 0},
ae8f83e1b0cf coordinates for the town portal
x1diablo
parents: 490
diff changeset
21 {Vec3_int_(-15148, -10240, 1473), 0, 0, 4, 0},
ae8f83e1b0cf coordinates for the town portal
x1diablo
parents: 490
diff changeset
22 {Vec3_int_(-10519, 5375, 753), 512, 0, 3, 0},
ae8f83e1b0cf coordinates for the town portal
x1diablo
parents: 490
diff changeset
23 {Vec3_int_(3114, -11055, 513), 0, 0, 10, 0},
ae8f83e1b0cf coordinates for the town portal
x1diablo
parents: 490
diff changeset
24 {Vec3_int_(-158, 7624, 1), 512, 0, 7, 0},
ae8f83e1b0cf coordinates for the town portal
x1diablo
parents: 490
diff changeset
25 {Vec3_int_(-1837, -4247, 65), 65, 0, 8, 0}
1206
ab6560001f5b arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents: 1205
diff changeset
26 }} ;
0
Ritor1
parents:
diff changeset
27
Ritor1
parents:
diff changeset
28 struct SpellStats *pSpellStats;
Ritor1
parents:
diff changeset
29
Ritor1
parents:
diff changeset
30
1206
ab6560001f5b arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents: 1205
diff changeset
31 std::array<stru324_spell, 103> stru_4E3ACC =
ab6560001f5b arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents: 1205
diff changeset
32 {{
488
Nomad
parents: 363
diff changeset
33 {10, 0},
Nomad
parents: 363
diff changeset
34 {1000, 0}, {1010, 0}, {1020, 0}, {1030, 0}, {1040, 0}, {1050, 0}, {1060, 0}, {1070, 0}, {1080, 0}, {1090, 0}, {1100, 0},
Nomad
parents: 363
diff changeset
35 {2000, 0}, {2010, 0}, {2020, 0}, {2030, 0}, {2040, 0}, {2050, 0}, {2060, 0}, {2070, 0}, {2080, 0}, {2090, 0}, {2100, 0},
Nomad
parents: 363
diff changeset
36 {3000, 0}, {3010, 0}, {3020, 0}, {3030, 0}, {3040, 0}, {3050, 0}, {3060, 0}, {3070, 0}, {3080, 0}, {3090, 0}, {3100, 0},
Nomad
parents: 363
diff changeset
37 {4000, 0}, {4010, 0}, {4020, 0}, {4030, 0}, {4040, 0}, {4050, 0}, {4060, 0}, {4070, 0}, {4080, 0}, {4090, 0}, {4100, 0},
Nomad
parents: 363
diff changeset
38 {5000, 0}, {5010, 0}, {5020, 0}, {5030, 0}, {5040, 0}, {5050, 0}, {5060, 0}, {5070, 0}, {5080, 0}, {5090, 0}, {5100, 0},
Nomad
parents: 363
diff changeset
39 {6000, 0}, {6010, 0}, {6020, 0}, {6030, 0}, {6040, 0}, {6050, 0}, {6060, 0}, {6070, 0}, {6080, 0}, {6090, 0}, {6100, 0},
Nomad
parents: 363
diff changeset
40 {7000, 0}, {7010, 0}, {7020, 0}, {7030, 0}, {7040, 0}, {7050, 0}, {7060, 0}, {7070, 0}, {7080, 0}, {7090, 0}, {7100, 0},
Nomad
parents: 363
diff changeset
41 {8000, 0}, {8010, 0}, {8020, 0}, {8030, 0}, {8040, 0}, {8050, 0}, {8060, 0}, {8070, 0}, {8080, 0}, {8090, 0}, {8100, 0},
1086
74ab0ed7e308 arrows working
zipi
parents: 1016
diff changeset
42 {9000, 0}, {9010, 0}, {9020, 0}, {9030, 0}, {9040, 0}, {9050, 0}, {9060, 0}, {9070, 0}, {9080, 0}, {9090, 0}, {9100, 0},
74ab0ed7e308 arrows working
zipi
parents: 1016
diff changeset
43 {545, 0},
74ab0ed7e308 arrows working
zipi
parents: 1016
diff changeset
44 {545, 0},
74ab0ed7e308 arrows working
zipi
parents: 1016
diff changeset
45 {555, 0}
1206
ab6560001f5b arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents: 1205
diff changeset
46 }};
363
2bc1c8d68f41 Allocator and SpellCost Tip
Gloval
parents: 357
diff changeset
47 //9 spellbook pages 11 spells per page 9*11 =99 +1 zero struct at 0. It counted from 1!
1206
ab6560001f5b arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents: 1205
diff changeset
48 std::array<SpellData, 100> pSpellDatas={{
363
2bc1c8d68f41 Allocator and SpellCost Tip
Gloval
parents: 357
diff changeset
49 {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
2bc1c8d68f41 Allocator and SpellCost Tip
Gloval
parents: 357
diff changeset
50
2bc1c8d68f41 Allocator and SpellCost Tip
Gloval
parents: 357
diff changeset
51 {1, 1, 1, 1, 60, 60, 60, 40, 0, 0},//0
192
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
52 {2, 2, 2, 2, 110, 110, 100, 90, 768, 0},
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
53 {3, 3, 3, 3, 120, 120, 120, 120, 0, 0},
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
54 {4, 4, 4, 4, 120, 120, 120, 120, 0, 0},
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
55 {5, 5, 5, 5, 120, 120, 120, 120, 0, 0},
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
56 {8, 8, 8, 8, 100, 100, 90, 80, 1536, 0},
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
57 {10, 10, 10, 10, 150, 150, 150, 150, 1536, 0},
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
58 {15, 15, 15, 15, 120, 120, 120, 120, 1536, 0},
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
59 {20, 20, 20, 20, 100, 100, 100, 90, 264, 0},
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
60 {25, 25, 25, 25, 100, 100, 100, 90, 268, 0},
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
61 {30, 30, 30, 30, 90, 90, 90, 90, 3855, 0},
363
2bc1c8d68f41 Allocator and SpellCost Tip
Gloval
parents: 357
diff changeset
62
2bc1c8d68f41 Allocator and SpellCost Tip
Gloval
parents: 357
diff changeset
63 {1, 1, 1, 0, 60, 60, 60, 60, 0, 0}, //1
192
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
64 {2, 2, 2, 2, 120, 120, 120, 100, 0, 0},
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
65 {3, 3, 3, 3, 120, 120, 120, 120, 0, 0},
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
66 {4, 4, 4, 4, 110, 100, 90, 80, 258, 0},
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
67 {5, 5, 5, 5, 90, 90, 70, 50, 0, 0},
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
68 {8, 8, 8, 8, 120, 120, 120, 120, 0, 0},
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
69 {10, 10, 10, 10, 100, 100, 90, 70, 2048, 0},
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
70 {15, 15, 15, 15, 200, 200, 200, 200, 0, 0},
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
71 {20, 20, 20, 20, 100, 100, 100, 90, 2570, 0},
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
72 {25, 25, 25, 25, 250, 250, 250, 250, 0, 0},
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
73 {30, 30, 30, 30, 90, 90, 90, 90, 276, 0},
363
2bc1c8d68f41 Allocator and SpellCost Tip
Gloval
parents: 357
diff changeset
74
2bc1c8d68f41 Allocator and SpellCost Tip
Gloval
parents: 357
diff changeset
75 {1, 1, 1, 1, 60, 60, 60, 20, 0, 0}, //2
192
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
76 {2, 2, 2, 2, 110, 100, 90, 70, 514, 0},
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
77 {3, 3, 3, 3, 120, 120, 120, 120, 0, 0},
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
78 {4, 4, 4, 4, 110, 100, 90, 80, 1024, 0},
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
79 {5, 5, 5, 5, 150, 150, 150, 150, 0, 0},
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
80 {8, 8, 8, 8, 200, 200, 200, 200, 0, 0},
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
81 {10, 10, 10, 10, 100, 100, 90, 80, 2313, 0},
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
82 {15, 15, 15, 15, 140, 140, 140, 140, 0, 0},
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
83 {20, 20, 20, 20, 200, 200, 200, 200, 0, 0},
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
84 {25, 25, 25, 25, 80, 80, 80, 80, 780, 0},
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
85 {30, 30, 30, 30, 250, 250, 250, 250, 0, 0},
363
2bc1c8d68f41 Allocator and SpellCost Tip
Gloval
parents: 357
diff changeset
86
2bc1c8d68f41 Allocator and SpellCost Tip
Gloval
parents: 357
diff changeset
87 {1, 1, 1, 1, 80, 80, 80, 80, 0, 0}, //3
192
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
88 {2, 2, 2, 2, 100, 100, 100, 100, 0, 0},
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
89 {3, 3, 3, 3, 120, 120, 120, 120, 0, 0},
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
90 {4, 4, 4, 4, 110, 100, 90, 80, 773, 0},
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
91 {5, 5, 5, 5, 120, 120, 120, 120, 0, 0},
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
92 {8, 8, 8, 8, 100, 100, 90, 80, 2304, 0},
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
93 {10, 10, 10, 10, 140, 140, 140, 140, 0, 0},
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
94 {15, 15, 15, 15, 90, 90, 90, 80, 2048, 0},
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
95 {20, 20, 20, 20, 150, 150, 150, 150, 0, 0},
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
96 {25, 25, 25, 25, 100, 100, 100, 90, 276, 0},
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
97 {30, 30, 30, 30, 90, 90, 90, 90, 25, 0},
363
2bc1c8d68f41 Allocator and SpellCost Tip
Gloval
parents: 357
diff changeset
98
2bc1c8d68f41 Allocator and SpellCost Tip
Gloval
parents: 357
diff changeset
99 {1, 1, 1, 1, 100, 100, 100, 100, 0, 0}, //4
192
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
100 {2, 2, 2, 2, 100, 100, 100, 100, 0, 0},
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
101 {3, 3, 3, 3, 90, 90, 90, 90, 0, 0},
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
102 {4, 4, 4, 4, 120, 120, 120, 120, 0, 0},
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
103 {5, 5, 5, 5, 120, 120, 120, 120, 0, 0},
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
104 {8, 8, 8, 8, 120, 120, 120, 120, 0, 0},
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
105 {10, 10, 10, 10, 120, 120, 120, 120, 0, 0},
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
106 {15, 15, 15, 15, 100, 100, 100, 100, 2058, 0},
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
107 {20, 20, 20, 20, 240, 240, 240, 240, 0, 0},
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
108 {25, 25, 25, 25, 150, 150, 150, 150, 0, 0},
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
109 {30, 30, 30, 30, 1000, 1000, 1000, 1000, 0, 0},
363
2bc1c8d68f41 Allocator and SpellCost Tip
Gloval
parents: 357
diff changeset
110
2bc1c8d68f41 Allocator and SpellCost Tip
Gloval
parents: 357
diff changeset
111 {1, 1, 1, 1, 120, 120, 120, 120, 0, 0}, //5
192
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
112 {2, 2, 2, 2, 110, 110, 110, 110, 771, 0},
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
113 {3, 3, 3, 3, 120, 120, 120, 120, 0, 0},
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
114 {4, 4, 4, 4, 110, 100, 90, 80, 0, 0},
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
115 {5, 5, 5, 5, 100, 100, 100, 100, 0, 0},
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
116 {8, 8, 8, 8, 120, 120, 120, 120, 0, 0},
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
117 {10, 10, 10, 10, 120, 120, 120, 120, 0, 0},
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
118 {15, 15, 15, 15, 80, 80, 80, 80, 0, 0},
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
119 {20, 20, 20, 20, 120, 120, 120, 120, 0, 0},
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
120 {25, 25, 25, 25, 110, 110, 110, 100, 268, 0},
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
121 {30, 30, 30, 30, 120, 120, 120, 120, 0, 0},
363
2bc1c8d68f41 Allocator and SpellCost Tip
Gloval
parents: 357
diff changeset
122
2bc1c8d68f41 Allocator and SpellCost Tip
Gloval
parents: 357
diff changeset
123 {1, 1, 1, 1, 120, 120, 120, 120, 0, 0}, //6
192
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
124 {2, 2, 2, 2, 100, 100, 100, 100, 0, 0},
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
125 {3, 3, 3, 3, 120, 120, 120, 120, 0, 0},
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
126 {4, 4, 4, 4, 110, 100, 90, 80, 520, 0},
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
127 {5, 5, 5, 5, 110, 110, 110, 110, 0, 0},
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
128 {8, 8, 8, 8, 120, 120, 120, 120, 0, 0},
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
129 {10, 10, 10, 10, 120, 120, 120, 120, 0, 0},
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
130 {15, 15, 15, 15, 120, 120, 120, 120, 0, 0},
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
131 {20, 20, 20, 20, 120, 120, 120, 120, 0, 0},
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
132 {25, 25, 25, 25, 110, 110, 110, 100, 1310, 0},
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
133 {30, 30, 30, 30, 100, 100, 100, 100, 0, 0},
363
2bc1c8d68f41 Allocator and SpellCost Tip
Gloval
parents: 357
diff changeset
134
2bc1c8d68f41 Allocator and SpellCost Tip
Gloval
parents: 357
diff changeset
135 {5, 5, 5, 5, 110, 100, 90, 80, 1024, 0}, //7
192
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
136 {10, 10, 10, 10, 120, 110, 100, 90, 4112, 0},
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
137 {15, 15, 15, 15, 120, 110, 100, 90, 0, 0},
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
138 {20, 20, 20, 20, 160, 140, 120, 100, 0, 0},
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
139 {25, 25, 25, 25, 140, 140, 140, 140, 0, 0},
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
140 {30, 30, 30, 30, 500, 500, 500, 500, 0, 0},
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
141 {35, 35, 35, 35, 135, 135, 120, 100, 281, 0},
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
142 {40, 40, 40, 40, 500, 500, 500, 500, 0, 0},
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
143 {45, 45, 45, 45, 250, 250, 250, 250, 0, 0},
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
144 {50, 50, 50, 50, 150, 150, 150, 135, 5140, 0},
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
145 {55, 55, 55, 55, 300, 300, 300, 300, 0, 0},
363
2bc1c8d68f41 Allocator and SpellCost Tip
Gloval
parents: 357
diff changeset
146
2bc1c8d68f41 Allocator and SpellCost Tip
Gloval
parents: 357
diff changeset
147 {10, 10, 10, 10, 140, 140, 140, 140, 0, 0}, //8
192
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
148 {15, 15, 15, 15, 120, 110, 100, 90, 2585, 0},
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
149 {20, 20, 20, 20, 120, 100, 90, 120, 0, 0},
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
150 {25, 25, 25, 25, 120, 120, 120, 120, 0, 0},
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
151 {30, 30, 30, 30, 90, 90, 80, 70, 1542, 0},
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
152 {35, 35, 35, 35, 120, 120, 100, 80, 0, 0},
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
153 {40, 40, 40, 40, 110, 110, 110, 110, 0, 0},
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
154 {45, 45, 45, 45, 200, 200, 200, 150, 0, 0},
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
155 {50, 50, 50, 50, 120, 120, 120, 100, 6400, 0},
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
156 {55, 55, 55, 55, 250, 250, 250, 250, 306, 0},
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
157 {60, 60, 60, 60, 300, 300, 300, 300, 2073, 0}
1206
ab6560001f5b arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents: 1205
diff changeset
158 }};
0
Ritor1
parents:
diff changeset
159
490
Nomad
parents: 488
diff changeset
160
1206
ab6560001f5b arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents: 1205
diff changeset
161 std::array<unsigned int, 25> wand_spell_ids =
490
Nomad
parents: 488
diff changeset
162 {
Nomad
parents: 488
diff changeset
163 // 135 Wand of Fire 136 Wand of Sparks 137 Wand of Poison 138 Wand of Stunning 139 Wand of Harm
Nomad
parents: 488
diff changeset
164 SPELL_FIRE_FIRE_BOLT, SPELL_AIR_SPARKS, SPELL_WATER_POISON_SPRAY, SPELL_EARTH_STUN, SPELL_BODY_HARM,
Nomad
parents: 488
diff changeset
165 // 140 Fairy Wand of Light 141 Fairy Wand of Ice 142 Fairy Wand of Lashing 143 Fairy Wand of Mind 144 Fairy Wand of Swarms
Nomad
parents: 488
diff changeset
166 SPELL_LIGHT_LIGHT_BOLT, SPELL_WATER_ICE_BOLT, SPELL_SPIRIT_SPIRIT_LASH, SPELL_MIND_MIND_BLAST, SPELL_EARTH_DEADLY_SWARM,
Nomad
parents: 488
diff changeset
167 // 145 Alacorn Wand of Fireballs 146 Alacorn Wand of Acid 147 Alacorn Wand of Lightning 148 Alacorn Wand of Blades 149 Alacorn Wand of Charms
Nomad
parents: 488
diff changeset
168 SPELL_FIRE_FIREBALL, SPELL_WATER_ACID_BURST, SPELL_AIR_LIGHNING_BOLT, SPELL_EARTH_BLADES, SPELL_MIND_CHARM,
Nomad
parents: 488
diff changeset
169 // 150 Arcane Wand of Blasting 151 Arcane Wand of The Fist 152 Arcane Wand of Rocks 153 Arcane Wand of Paralyzing 154 Arcane Wand of Clouds
Nomad
parents: 488
diff changeset
170 SPELL_WATER_ICE_BLAST, SPELL_BODY_FLYING_FIST, SPELL_EARTH_ROCK_BLAST, SPELL_LIGHT_PARALYZE, SPELL_DARK_TOXIC_CLOUD,
Nomad
parents: 488
diff changeset
171 // 155 Mystic Wand of Implosion 156 Mystic Wand of Distortion 157 Mystic Wand of Sharpmetal 158 Mystic Wand of Shrinking 159 Mystic Wand of Incineration
Nomad
parents: 488
diff changeset
172 SPELL_AIR_IMPLOSION, SPELL_EARTH_MASS_DISTORTION, SPELL_DARK_SHARPMETAL, SPELL_DARK_SHRINKING_RAY, SPELL_FIRE_INCINERATE
Nomad
parents: 488
diff changeset
173 };
Nomad
parents: 488
diff changeset
174
Nomad
parents: 488
diff changeset
175
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
176 std::array<std::array<unsigned char, 12>, 9> pSpellbookSpellIndices = // 4E2430
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
177 {{ //0 1 2 3 4 5 6 7 8 9 10 11
357
b07cf89108d5 Spell positions in book
Gloval
parents: 210
diff changeset
178 {0, 3, 1, 8, 11, 7, 4, 10, 6, 2, 5, 9},
b07cf89108d5 Spell positions in book
Gloval
parents: 210
diff changeset
179 {0, 11, 2, 9, 6, 8, 5, 10, 3, 7, 1, 4},
b07cf89108d5 Spell positions in book
Gloval
parents: 210
diff changeset
180 {0, 4, 8, 9, 1, 10, 3, 11, 7, 6, 2, 5},
b07cf89108d5 Spell positions in book
Gloval
parents: 210
diff changeset
181 {0, 7, 10, 8, 2, 11, 1, 5, 3, 6, 4, 9},
b07cf89108d5 Spell positions in book
Gloval
parents: 210
diff changeset
182 {0, 5, 10, 11, 7, 2, 8, 1, 4, 9, 3, 6},
b07cf89108d5 Spell positions in book
Gloval
parents: 210
diff changeset
183 {0, 5, 9, 8, 3, 7, 6, 4, 1, 11, 2, 10},
b07cf89108d5 Spell positions in book
Gloval
parents: 210
diff changeset
184 {0, 1, 6, 9, 3, 5, 8, 11, 7, 10, 4, 2},
b07cf89108d5 Spell positions in book
Gloval
parents: 210
diff changeset
185 {0, 1, 10, 11, 9, 4, 3, 6, 5, 7, 8, 2},
b07cf89108d5 Spell positions in book
Gloval
parents: 210
diff changeset
186 {0, 9, 3, 7, 1, 5, 2, 10, 11, 8, 6, 4}
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1165
diff changeset
187 }};
0
Ritor1
parents:
diff changeset
188
1206
ab6560001f5b arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents: 1205
diff changeset
189 std::array<std::array<struct SpellBookIconPos, 12>, 9> pIconPos={{
363
2bc1c8d68f41 Allocator and SpellCost Tip
Gloval
parents: 357
diff changeset
190
1206
ab6560001f5b arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents: 1205
diff changeset
191 { 0, 0, 17, 13, 115, 2, 217, 15,
ab6560001f5b arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents: 1205
diff changeset
192 299, 6, 28, 125, 130, 133, 294, 114,
ab6560001f5b arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents: 1205
diff changeset
193 11, 232, 134, 233, 237, 171, 296, 231},
0
Ritor1
parents:
diff changeset
194
1206
ab6560001f5b arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents: 1205
diff changeset
195 { 0, 0, 19, 9, 117, 3, 206, 13,
ab6560001f5b arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents: 1205
diff changeset
196 285, 7, 16, 123, 113, 101, 201, 118,
ab6560001f5b arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents: 1205
diff changeset
197 317, 110, 11, 230, 149, 236, 296, 234},
357
b07cf89108d5 Spell positions in book
Gloval
parents: 210
diff changeset
198
1206
ab6560001f5b arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents: 1205
diff changeset
199 { 0, 0, 17, 9, 140, 0, 210, 34,
ab6560001f5b arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents: 1205
diff changeset
200 293, 5, 15, 98, 78, 121, 175, 136,
ab6560001f5b arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents: 1205
diff changeset
201 301, 115, 15, 226, 154, 225, 272, 220},
357
b07cf89108d5 Spell positions in book
Gloval
parents: 210
diff changeset
202
1206
ab6560001f5b arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents: 1205
diff changeset
203 { 0, 0, 7, 9, 156, 2, 277, 9,
ab6560001f5b arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents: 1205
diff changeset
204 11, 117, 111, 82, 180, 102, 303, 108,
ab6560001f5b arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents: 1205
diff changeset
205 10, 229, 120, 221, 201, 217, 296, 225},
357
b07cf89108d5 Spell positions in book
Gloval
parents: 210
diff changeset
206
1206
ab6560001f5b arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents: 1205
diff changeset
207 { 0, 0, 18, 8, 89, 15, 192, 14,
ab6560001f5b arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents: 1205
diff changeset
208 292, 7, 22, 129, 125, 146, 217, 136,
ab6560001f5b arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents: 1205
diff changeset
209 305, 115, 22, 226, 174, 237, 290, 231},
357
b07cf89108d5 Spell positions in book
Gloval
parents: 210
diff changeset
210
1206
ab6560001f5b arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents: 1205
diff changeset
211 { 0, 0, 18, 12, 148, 9, 292, 7,
ab6560001f5b arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents: 1205
diff changeset
212 17, 122, 121, 99, 220, 87, 293, 112,
ab6560001f5b arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents: 1205
diff changeset
213 13, 236, 128, 213, 220, 223, 315, 223},
357
b07cf89108d5 Spell positions in book
Gloval
parents: 210
diff changeset
214
1206
ab6560001f5b arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents: 1205
diff changeset
215 { 0, 0, 23, 14, 127, 8, 204, 0,
ab6560001f5b arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents: 1205
diff changeset
216 306, 8, 14, 115, 122, 132, 200, 116,
ab6560001f5b arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents: 1205
diff changeset
217 293, 122, 20, 228, 154, 228, 294, 239},
357
b07cf89108d5 Spell positions in book
Gloval
parents: 210
diff changeset
218
1206
ab6560001f5b arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents: 1205
diff changeset
219 { 0, 0, 19, 14, 124, 10, 283, 12,
ab6560001f5b arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents: 1205
diff changeset
220 8, 105, 113, 89, 190, 82, 298, 108,
ab6560001f5b arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents: 1205
diff changeset
221 18, 181, 101, 204, 204, 203, 285, 218},
357
b07cf89108d5 Spell positions in book
Gloval
parents: 210
diff changeset
222
1206
ab6560001f5b arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents: 1205
diff changeset
223 { 0, 0, 18, 17, 110, 16, 201, 15,
ab6560001f5b arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents: 1205
diff changeset
224 307, 15, 18, 148, 125, 166, 201, 123,
ab6560001f5b arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents: 1205
diff changeset
225 275, 120, 28, 235, 217, 222, 324, 216}}};
0
Ritor1
parents:
diff changeset
226
Ritor1
parents:
diff changeset
227
Ritor1
parents:
diff changeset
228 //----- (0042EB31) --------------------------------------------------------
Ritor1
parents:
diff changeset
229 bool SpellBuff::NotExpired()
Ritor1
parents:
diff changeset
230 {
189
038a4d09406f new texts file, fix text rendender error
Gloval
parents: 142
diff changeset
231 return (signed __int64)this->uExpireTime > 0 ? true:false;
0
Ritor1
parents:
diff changeset
232 }
Ritor1
parents:
diff changeset
233
Ritor1
parents:
diff changeset
234
Ritor1
parents:
diff changeset
235 //----- (00458585) --------------------------------------------------------
Ritor1
parents:
diff changeset
236 void SpellBuff::Reset()
Ritor1
parents:
diff changeset
237 {
982
08fd1436ef35 enums & lod
Nomad
parents: 910
diff changeset
238 uSkill = 0;
08fd1436ef35 enums & lod
Nomad
parents: 910
diff changeset
239 uPower = 0;
08fd1436ef35 enums & lod
Nomad
parents: 910
diff changeset
240 uExpireTime = 0i64;
08fd1436ef35 enums & lod
Nomad
parents: 910
diff changeset
241 uCaster = 0;
08fd1436ef35 enums & lod
Nomad
parents: 910
diff changeset
242 uFlags = 0;
08fd1436ef35 enums & lod
Nomad
parents: 910
diff changeset
243 if (uOverlayID)
0
Ritor1
parents:
diff changeset
244 {
982
08fd1436ef35 enums & lod
Nomad
parents: 910
diff changeset
245 pOtherOverlayList->pOverlays[uOverlayID - 1].Reset();
142
8b8fd4d83fdc Various things here and there
Nomad
parents: 0
diff changeset
246 pOtherOverlayList->bRedraw = true;
982
08fd1436ef35 enums & lod
Nomad
parents: 910
diff changeset
247 uOverlayID = 0;
0
Ritor1
parents:
diff changeset
248 }
Ritor1
parents:
diff changeset
249 }
Ritor1
parents:
diff changeset
250
Ritor1
parents:
diff changeset
251 //----- (004585CA) --------------------------------------------------------
Ritor1
parents:
diff changeset
252 signed int SpellBuff::_4585CA(__int64 a2)
Ritor1
parents:
diff changeset
253 {
982
08fd1436ef35 enums & lod
Nomad
parents: 910
diff changeset
254 if (uExpireTime && uExpireTime < a2)
0
Ritor1
parents:
diff changeset
255 {
982
08fd1436ef35 enums & lod
Nomad
parents: 910
diff changeset
256 uExpireTime = 0;
08fd1436ef35 enums & lod
Nomad
parents: 910
diff changeset
257 uPower = 0;
08fd1436ef35 enums & lod
Nomad
parents: 910
diff changeset
258 uSkill = 0;
08fd1436ef35 enums & lod
Nomad
parents: 910
diff changeset
259 uOverlayID = 0;
08fd1436ef35 enums & lod
Nomad
parents: 910
diff changeset
260 return true;
0
Ritor1
parents:
diff changeset
261 }
982
08fd1436ef35 enums & lod
Nomad
parents: 910
diff changeset
262 return false;
0
Ritor1
parents:
diff changeset
263 }
Ritor1
parents:
diff changeset
264
Ritor1
parents:
diff changeset
265 //----- (004584E0) --------------------------------------------------------
982
08fd1436ef35 enums & lod
Nomad
parents: 910
diff changeset
266 bool SpellBuff::Apply(unsigned __int64 uExpireTime, unsigned __int16 uSkillLevel, unsigned __int16 uPower, int uOverlayID, unsigned __int8 caster)
0
Ritor1
parents:
diff changeset
267 {
982
08fd1436ef35 enums & lod
Nomad
parents: 910
diff changeset
268 if (this->uExpireTime && uExpireTime < this->uExpireTime)
08fd1436ef35 enums & lod
Nomad
parents: 910
diff changeset
269 return false;
0
Ritor1
parents:
diff changeset
270
982
08fd1436ef35 enums & lod
Nomad
parents: 910
diff changeset
271 this->uSkill = uSkillLevel;
08fd1436ef35 enums & lod
Nomad
parents: 910
diff changeset
272 this->uPower = uPower;
08fd1436ef35 enums & lod
Nomad
parents: 910
diff changeset
273 this->uExpireTime = uExpireTime;
08fd1436ef35 enums & lod
Nomad
parents: 910
diff changeset
274 if (this->uOverlayID && this->uOverlayID != uOverlayID)
0
Ritor1
parents:
diff changeset
275 {
982
08fd1436ef35 enums & lod
Nomad
parents: 910
diff changeset
276 pOtherOverlayList->pOverlays[this->uOverlayID - 1].Reset();
08fd1436ef35 enums & lod
Nomad
parents: 910
diff changeset
277 pOtherOverlayList->bRedraw = true;
08fd1436ef35 enums & lod
Nomad
parents: 910
diff changeset
278 this->uOverlayID = 0;
0
Ritor1
parents:
diff changeset
279 }
982
08fd1436ef35 enums & lod
Nomad
parents: 910
diff changeset
280 this->uOverlayID = uOverlayID;
08fd1436ef35 enums & lod
Nomad
parents: 910
diff changeset
281 this->uCaster = caster;
08fd1436ef35 enums & lod
Nomad
parents: 910
diff changeset
282
08fd1436ef35 enums & lod
Nomad
parents: 910
diff changeset
283 return true;
0
Ritor1
parents:
diff changeset
284 }
Ritor1
parents:
diff changeset
285
Ritor1
parents:
diff changeset
286 //----- (0045384A) --------------------------------------------------------
Ritor1
parents:
diff changeset
287 void SpellStats::Initialize()
982
08fd1436ef35 enums & lod
Nomad
parents: 910
diff changeset
288 {
191
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
289 int decode_step;
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
290 char* test_string;
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
291 bool break_loop;
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
292 unsigned char c;
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
293 unsigned int temp_str_len;
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
294 char* tmp_pos;
189
038a4d09406f new texts file, fix text rendender error
Gloval
parents: 142
diff changeset
295
191
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
296 if ( pSpellsTXT_Raw )
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
297 pAllocator->FreeChunk(pSpellsTXT_Raw);
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
298 pSpellsTXT_Raw = NULL;
189
038a4d09406f new texts file, fix text rendender error
Gloval
parents: 142
diff changeset
299
191
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
300 pSpellsTXT_Raw = (char *)pEvents_LOD->LoadRaw("spells.txt", 0);
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
301 strtok(pSpellsTXT_Raw, "\r");
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
302 strtok(NULL, "\r");
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
303 for(int i=1; i<100; ++i)
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
304 {
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
305 test_string=strtok(NULL, "\r")+1;
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
306 decode_step =0;
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
307 break_loop=false;
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
308 do
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
309 {
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
310 c = *(unsigned char*)test_string;
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
311 temp_str_len = 0;
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
312 while((c!='\t')&&(c>0))
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
313 {
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
314 ++temp_str_len;
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
315 c=test_string[temp_str_len];
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
316 }
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
317 tmp_pos=test_string+temp_str_len;
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
318 if (*tmp_pos == 0)
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
319 break_loop = true;
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
320 *tmp_pos = 0;
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
321 if (temp_str_len)
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
322 {
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
323 switch (decode_step)
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
324 {
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
325 case 2:
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
326 pInfos[i].pName=RemoveQuotes(test_string);
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
327 break;
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
328 case 3:
192
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
329 pInfos[i].uSchool = SPELL_SCHOOL_NONE;
1104
5d5c78088274 strcmpi to stricmp conversion
Grumpy7
parents: 1086
diff changeset
330 if (!_stricmp("fire", test_string) )
191
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
331 {
192
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
332 pInfos[i].uSchool =SPELL_SCHOOL_FIRE;
191
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
333 break;
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
334 }
1104
5d5c78088274 strcmpi to stricmp conversion
Grumpy7
parents: 1086
diff changeset
335 if ( !_stricmp("air", test_string) )
191
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
336 {
192
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
337 pInfos[i].uSchool = SPELL_SCHOOL_AIR;
191
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
338 break;
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
339 }
1104
5d5c78088274 strcmpi to stricmp conversion
Grumpy7
parents: 1086
diff changeset
340 if ( !_stricmp("water", test_string))
191
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
341 {
192
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
342 pInfos[i].uSchool = SPELL_SCHOOL_WATER;
191
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
343 break;
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
344 }
1104
5d5c78088274 strcmpi to stricmp conversion
Grumpy7
parents: 1086
diff changeset
345 if ( !_stricmp("earth", test_string))
191
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
346 {
192
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
347 pInfos[i].uSchool = SPELL_SCHOOL_EARTH;
191
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
348 break;
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
349 }
1104
5d5c78088274 strcmpi to stricmp conversion
Grumpy7
parents: 1086
diff changeset
350 if ( !_stricmp("spirit", test_string))
191
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
351 {
192
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
352 pInfos[i].uSchool = SPELL_SCHOOL_SPIRIT;
191
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
353 break;
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
354 }
1104
5d5c78088274 strcmpi to stricmp conversion
Grumpy7
parents: 1086
diff changeset
355 if ( !_stricmp("mind", test_string))
191
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
356 {
192
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
357 pInfos[i].uSchool = SPELL_SCHOOL_MIND;
191
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
358 break;
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
359 }
1104
5d5c78088274 strcmpi to stricmp conversion
Grumpy7
parents: 1086
diff changeset
360 if ( !_stricmp("body", test_string) )
191
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
361 {
192
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
362 pInfos[i].uSchool = SPELL_SCHOOL_BODY;
191
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
363 break;
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
364 }
1104
5d5c78088274 strcmpi to stricmp conversion
Grumpy7
parents: 1086
diff changeset
365 if ( !_stricmp("light", test_string) )
191
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
366 {
192
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
367 pInfos[i].uSchool = SPELL_SCHOOL_LIGHT;
191
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
368 break;
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
369 }
1104
5d5c78088274 strcmpi to stricmp conversion
Grumpy7
parents: 1086
diff changeset
370 if ( !_stricmp("dark", test_string))
191
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
371 {
192
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
372 pInfos[i].uSchool = SPELL_SCHOOL_DARK;
191
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
373 break;
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
374 }
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
375
1104
5d5c78088274 strcmpi to stricmp conversion
Grumpy7
parents: 1086
diff changeset
376 if ( !_stricmp("magic", test_string))
191
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
377 {
192
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
378 pInfos[i].uSchool = SPELL_SCHOOL_MAGIC;
191
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
379 break;
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
380 }
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
381 break;
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
382 case 4:
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
383 pInfos[i].pShortName=RemoveQuotes(test_string);
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
384 break;
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
385 case 5:
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
386 pInfos[i].pDescription=RemoveQuotes(test_string);
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
387 break;
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
388 case 6:
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
389 pInfos[i].pBasicSkillDesc=RemoveQuotes(test_string);
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
390 break;
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
391 case 7:
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
392 pInfos[i].pExpertSkillDesc=RemoveQuotes(test_string);
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
393 break;
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
394 case 8:
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
395 pInfos[i].pMasterSkillDesc=RemoveQuotes(test_string);
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
396 break;
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
397 case 9:
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
398 pInfos[i].pGrandmasterSkillDesc=RemoveQuotes(test_string);
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
399 break;
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
400 case 10:
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
401 int in_string_pos=0;
192
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
402 unsigned char test;
191
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
403 int in_str_len=strlen(test_string);
192
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
404 for (int j=0; j<in_str_len; ++j)
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
405 {
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
406 test= tolower(test_string[j]);
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
407 switch (test)
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
408 {
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
409 case 109:
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
410 pSpellDatas[i].field_12|=1;
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
411 break;
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
412 case 101:
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
413 pSpellDatas[i].field_12|=2;
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
414 break;
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
415 case 99:
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
416 pSpellDatas[i].field_12|=4;
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
417 break;
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
418 case 120:
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
419 pSpellDatas[i].field_12|=8;
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
420 break;
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
421 }
1c8add70bcf9 spell init fixed
Gloval
parents: 191
diff changeset
422 }
191
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
423 break;
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
424 }
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
425 }
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
426 else
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
427 break_loop=true;
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
428 ++decode_step;
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
429 test_string=tmp_pos+1;
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
430 } while ((decode_step<11)&&!break_loop);
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
431 if ((i%11)==0)
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
432 strtok(NULL, "\r");
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
433 }
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
434
4813b57396ba spell init in progress
Gloval
parents: 189
diff changeset
435 }