Mercurial > mm7
annotate Spells.cpp @ 2254:2e02c384c62b
Merge
author | Grumpy7 |
---|---|
date | Wed, 26 Feb 2014 23:35:46 +0100 |
parents | aff7a7b072b7 |
children | f5680ba9c96d |
rev | line source |
---|---|
2253
aff7a7b072b7
adding _CRT_SECURE_NO_WARNINGS to get rid of a few hundrer annoying warnings + adding count parameter to swprintf
Grumpy7
parents:
2153
diff
changeset
|
1 #define _CRT_SECURE_NO_WARNINGS |
0 | 2 #include <stdlib.h> |
3 | |
4 #include "Spells.h" | |
5 #include "Overlays.h" | |
6 #include "LOD.h" | |
189 | 7 #include "texts.h" |
0 | 8 |
9 #include "mm7_data.h" | |
1295 | 10 #include "Party.h" |
2037
7a9477135943
Renamed Math.h -> OurMath.h (file resolution was sometimes ambiguous)
Nomad
parents:
1679
diff
changeset
|
11 #include "OurMath.h" |
1295 | 12 #include "SpriteObject.h" |
13 #include "ObjectList.h" | |
14 #include "Indoor.h" | |
15 #include "AudioPlayer.h" | |
16 #include "Actor.h" | |
17 #include "Game.h" | |
18 #include "stru6.h" | |
0 | 19 |
20 | |
1206
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
21 std::array<TownPortalData, 6> TownPortalList = //4ECBB8 |
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
22 {{ |
839 | 23 {Vec3_int_(-5121, 2107, 1), 1536, 0, 21, 0}, |
24 {Vec3_int_(-15148, -10240, 1473), 0, 0, 4, 0}, | |
25 {Vec3_int_(-10519, 5375, 753), 512, 0, 3, 0}, | |
26 {Vec3_int_(3114, -11055, 513), 0, 0, 10, 0}, | |
27 {Vec3_int_(-158, 7624, 1), 512, 0, 7, 0}, | |
28 {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
|
29 }} ; |
0 | 30 |
31 struct SpellStats *pSpellStats; | |
32 | |
33 | |
1206
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
34 std::array<stru324_spell, 103> stru_4E3ACC = |
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
35 {{ |
488 | 36 {10, 0}, |
37 {1000, 0}, {1010, 0}, {1020, 0}, {1030, 0}, {1040, 0}, {1050, 0}, {1060, 0}, {1070, 0}, {1080, 0}, {1090, 0}, {1100, 0}, | |
38 {2000, 0}, {2010, 0}, {2020, 0}, {2030, 0}, {2040, 0}, {2050, 0}, {2060, 0}, {2070, 0}, {2080, 0}, {2090, 0}, {2100, 0}, | |
39 {3000, 0}, {3010, 0}, {3020, 0}, {3030, 0}, {3040, 0}, {3050, 0}, {3060, 0}, {3070, 0}, {3080, 0}, {3090, 0}, {3100, 0}, | |
40 {4000, 0}, {4010, 0}, {4020, 0}, {4030, 0}, {4040, 0}, {4050, 0}, {4060, 0}, {4070, 0}, {4080, 0}, {4090, 0}, {4100, 0}, | |
41 {5000, 0}, {5010, 0}, {5020, 0}, {5030, 0}, {5040, 0}, {5050, 0}, {5060, 0}, {5070, 0}, {5080, 0}, {5090, 0}, {5100, 0}, | |
42 {6000, 0}, {6010, 0}, {6020, 0}, {6030, 0}, {6040, 0}, {6050, 0}, {6060, 0}, {6070, 0}, {6080, 0}, {6090, 0}, {6100, 0}, | |
43 {7000, 0}, {7010, 0}, {7020, 0}, {7030, 0}, {7040, 0}, {7050, 0}, {7060, 0}, {7070, 0}, {7080, 0}, {7090, 0}, {7100, 0}, | |
44 {8000, 0}, {8010, 0}, {8020, 0}, {8030, 0}, {8040, 0}, {8050, 0}, {8060, 0}, {8070, 0}, {8080, 0}, {8090, 0}, {8100, 0}, | |
1086 | 45 {9000, 0}, {9010, 0}, {9020, 0}, {9030, 0}, {9040, 0}, {9050, 0}, {9060, 0}, {9070, 0}, {9080, 0}, {9090, 0}, {9100, 0}, |
46 {545, 0}, | |
47 {545, 0}, | |
48 {555, 0} | |
1206
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
49 }}; |
363 | 50 //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
|
51 std::array<SpellData, 100> pSpellDatas={{ |
363 | 52 {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, |
53 | |
54 {1, 1, 1, 1, 60, 60, 60, 40, 0, 0},//0 | |
192 | 55 {2, 2, 2, 2, 110, 110, 100, 90, 768, 0}, |
56 {3, 3, 3, 3, 120, 120, 120, 120, 0, 0}, | |
57 {4, 4, 4, 4, 120, 120, 120, 120, 0, 0}, | |
58 {5, 5, 5, 5, 120, 120, 120, 120, 0, 0}, | |
59 {8, 8, 8, 8, 100, 100, 90, 80, 1536, 0}, | |
60 {10, 10, 10, 10, 150, 150, 150, 150, 1536, 0}, | |
61 {15, 15, 15, 15, 120, 120, 120, 120, 1536, 0}, | |
62 {20, 20, 20, 20, 100, 100, 100, 90, 264, 0}, | |
63 {25, 25, 25, 25, 100, 100, 100, 90, 268, 0}, | |
64 {30, 30, 30, 30, 90, 90, 90, 90, 3855, 0}, | |
363 | 65 |
66 {1, 1, 1, 0, 60, 60, 60, 60, 0, 0}, //1 | |
192 | 67 {2, 2, 2, 2, 120, 120, 120, 100, 0, 0}, |
68 {3, 3, 3, 3, 120, 120, 120, 120, 0, 0}, | |
69 {4, 4, 4, 4, 110, 100, 90, 80, 258, 0}, | |
70 {5, 5, 5, 5, 90, 90, 70, 50, 0, 0}, | |
71 {8, 8, 8, 8, 120, 120, 120, 120, 0, 0}, | |
72 {10, 10, 10, 10, 100, 100, 90, 70, 2048, 0}, | |
73 {15, 15, 15, 15, 200, 200, 200, 200, 0, 0}, | |
74 {20, 20, 20, 20, 100, 100, 100, 90, 2570, 0}, | |
75 {25, 25, 25, 25, 250, 250, 250, 250, 0, 0}, | |
76 {30, 30, 30, 30, 90, 90, 90, 90, 276, 0}, | |
363 | 77 |
78 {1, 1, 1, 1, 60, 60, 60, 20, 0, 0}, //2 | |
192 | 79 {2, 2, 2, 2, 110, 100, 90, 70, 514, 0}, |
80 {3, 3, 3, 3, 120, 120, 120, 120, 0, 0}, | |
81 {4, 4, 4, 4, 110, 100, 90, 80, 1024, 0}, | |
82 {5, 5, 5, 5, 150, 150, 150, 150, 0, 0}, | |
83 {8, 8, 8, 8, 200, 200, 200, 200, 0, 0}, | |
84 {10, 10, 10, 10, 100, 100, 90, 80, 2313, 0}, | |
85 {15, 15, 15, 15, 140, 140, 140, 140, 0, 0}, | |
86 {20, 20, 20, 20, 200, 200, 200, 200, 0, 0}, | |
87 {25, 25, 25, 25, 80, 80, 80, 80, 780, 0}, | |
88 {30, 30, 30, 30, 250, 250, 250, 250, 0, 0}, | |
363 | 89 |
90 {1, 1, 1, 1, 80, 80, 80, 80, 0, 0}, //3 | |
192 | 91 {2, 2, 2, 2, 100, 100, 100, 100, 0, 0}, |
92 {3, 3, 3, 3, 120, 120, 120, 120, 0, 0}, | |
93 {4, 4, 4, 4, 110, 100, 90, 80, 773, 0}, | |
94 {5, 5, 5, 5, 120, 120, 120, 120, 0, 0}, | |
95 {8, 8, 8, 8, 100, 100, 90, 80, 2304, 0}, | |
96 {10, 10, 10, 10, 140, 140, 140, 140, 0, 0}, | |
97 {15, 15, 15, 15, 90, 90, 90, 80, 2048, 0}, | |
98 {20, 20, 20, 20, 150, 150, 150, 150, 0, 0}, | |
99 {25, 25, 25, 25, 100, 100, 100, 90, 276, 0}, | |
100 {30, 30, 30, 30, 90, 90, 90, 90, 25, 0}, | |
363 | 101 |
102 {1, 1, 1, 1, 100, 100, 100, 100, 0, 0}, //4 | |
192 | 103 {2, 2, 2, 2, 100, 100, 100, 100, 0, 0}, |
104 {3, 3, 3, 3, 90, 90, 90, 90, 0, 0}, | |
105 {4, 4, 4, 4, 120, 120, 120, 120, 0, 0}, | |
106 {5, 5, 5, 5, 120, 120, 120, 120, 0, 0}, | |
107 {8, 8, 8, 8, 120, 120, 120, 120, 0, 0}, | |
108 {10, 10, 10, 10, 120, 120, 120, 120, 0, 0}, | |
109 {15, 15, 15, 15, 100, 100, 100, 100, 2058, 0}, | |
110 {20, 20, 20, 20, 240, 240, 240, 240, 0, 0}, | |
111 {25, 25, 25, 25, 150, 150, 150, 150, 0, 0}, | |
112 {30, 30, 30, 30, 1000, 1000, 1000, 1000, 0, 0}, | |
363 | 113 |
114 {1, 1, 1, 1, 120, 120, 120, 120, 0, 0}, //5 | |
192 | 115 {2, 2, 2, 2, 110, 110, 110, 110, 771, 0}, |
116 {3, 3, 3, 3, 120, 120, 120, 120, 0, 0}, | |
117 {4, 4, 4, 4, 110, 100, 90, 80, 0, 0}, | |
118 {5, 5, 5, 5, 100, 100, 100, 100, 0, 0}, | |
119 {8, 8, 8, 8, 120, 120, 120, 120, 0, 0}, | |
120 {10, 10, 10, 10, 120, 120, 120, 120, 0, 0}, | |
121 {15, 15, 15, 15, 80, 80, 80, 80, 0, 0}, | |
122 {20, 20, 20, 20, 120, 120, 120, 120, 0, 0}, | |
123 {25, 25, 25, 25, 110, 110, 110, 100, 268, 0}, | |
124 {30, 30, 30, 30, 120, 120, 120, 120, 0, 0}, | |
363 | 125 |
126 {1, 1, 1, 1, 120, 120, 120, 120, 0, 0}, //6 | |
192 | 127 {2, 2, 2, 2, 100, 100, 100, 100, 0, 0}, |
128 {3, 3, 3, 3, 120, 120, 120, 120, 0, 0}, | |
129 {4, 4, 4, 4, 110, 100, 90, 80, 520, 0}, | |
130 {5, 5, 5, 5, 110, 110, 110, 110, 0, 0}, | |
131 {8, 8, 8, 8, 120, 120, 120, 120, 0, 0}, | |
132 {10, 10, 10, 10, 120, 120, 120, 120, 0, 0}, | |
133 {15, 15, 15, 15, 120, 120, 120, 120, 0, 0}, | |
134 {20, 20, 20, 20, 120, 120, 120, 120, 0, 0}, | |
135 {25, 25, 25, 25, 110, 110, 110, 100, 1310, 0}, | |
136 {30, 30, 30, 30, 100, 100, 100, 100, 0, 0}, | |
363 | 137 |
138 {5, 5, 5, 5, 110, 100, 90, 80, 1024, 0}, //7 | |
192 | 139 {10, 10, 10, 10, 120, 110, 100, 90, 4112, 0}, |
140 {15, 15, 15, 15, 120, 110, 100, 90, 0, 0}, | |
141 {20, 20, 20, 20, 160, 140, 120, 100, 0, 0}, | |
142 {25, 25, 25, 25, 140, 140, 140, 140, 0, 0}, | |
143 {30, 30, 30, 30, 500, 500, 500, 500, 0, 0}, | |
144 {35, 35, 35, 35, 135, 135, 120, 100, 281, 0}, | |
145 {40, 40, 40, 40, 500, 500, 500, 500, 0, 0}, | |
146 {45, 45, 45, 45, 250, 250, 250, 250, 0, 0}, | |
147 {50, 50, 50, 50, 150, 150, 150, 135, 5140, 0}, | |
148 {55, 55, 55, 55, 300, 300, 300, 300, 0, 0}, | |
363 | 149 |
150 {10, 10, 10, 10, 140, 140, 140, 140, 0, 0}, //8 | |
192 | 151 {15, 15, 15, 15, 120, 110, 100, 90, 2585, 0}, |
152 {20, 20, 20, 20, 120, 100, 90, 120, 0, 0}, | |
153 {25, 25, 25, 25, 120, 120, 120, 120, 0, 0}, | |
154 {30, 30, 30, 30, 90, 90, 80, 70, 1542, 0}, | |
155 {35, 35, 35, 35, 120, 120, 100, 80, 0, 0}, | |
156 {40, 40, 40, 40, 110, 110, 110, 110, 0, 0}, | |
157 {45, 45, 45, 45, 200, 200, 200, 150, 0, 0}, | |
158 {50, 50, 50, 50, 120, 120, 120, 100, 6400, 0}, | |
159 {55, 55, 55, 55, 250, 250, 250, 250, 306, 0}, | |
160 {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
|
161 }}; |
0 | 162 |
490 | 163 |
1206
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
164 std::array<unsigned int, 25> wand_spell_ids = |
490 | 165 { |
166 // 135 Wand of Fire 136 Wand of Sparks 137 Wand of Poison 138 Wand of Stunning 139 Wand of Harm | |
167 SPELL_FIRE_FIRE_BOLT, SPELL_AIR_SPARKS, SPELL_WATER_POISON_SPRAY, SPELL_EARTH_STUN, SPELL_BODY_HARM, | |
168 // 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 | |
169 SPELL_LIGHT_LIGHT_BOLT, SPELL_WATER_ICE_BOLT, SPELL_SPIRIT_SPIRIT_LASH, SPELL_MIND_MIND_BLAST, SPELL_EARTH_DEADLY_SWARM, | |
170 // 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 | |
171 SPELL_FIRE_FIREBALL, SPELL_WATER_ACID_BURST, SPELL_AIR_LIGHNING_BOLT, SPELL_EARTH_BLADES, SPELL_MIND_CHARM, | |
172 // 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 | |
173 SPELL_WATER_ICE_BLAST, SPELL_BODY_FLYING_FIST, SPELL_EARTH_ROCK_BLAST, SPELL_LIGHT_PARALYZE, SPELL_DARK_TOXIC_CLOUD, | |
174 // 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 | |
175 SPELL_AIR_IMPLOSION, SPELL_EARTH_MASS_DISTORTION, SPELL_DARK_SHARPMETAL, SPELL_DARK_SHRINKING_RAY, SPELL_FIRE_INCINERATE | |
176 }; | |
177 | |
178 | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1165
diff
changeset
|
179 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
|
180 {{ //0 1 2 3 4 5 6 7 8 9 10 11 |
357 | 181 {0, 3, 1, 8, 11, 7, 4, 10, 6, 2, 5, 9}, |
182 {0, 11, 2, 9, 6, 8, 5, 10, 3, 7, 1, 4}, | |
183 {0, 4, 8, 9, 1, 10, 3, 11, 7, 6, 2, 5}, | |
184 {0, 7, 10, 8, 2, 11, 1, 5, 3, 6, 4, 9}, | |
185 {0, 5, 10, 11, 7, 2, 8, 1, 4, 9, 3, 6}, | |
186 {0, 5, 9, 8, 3, 7, 6, 4, 1, 11, 2, 10}, | |
187 {0, 1, 6, 9, 3, 5, 8, 11, 7, 10, 4, 2}, | |
188 {0, 1, 10, 11, 9, 4, 3, 6, 5, 7, 8, 2}, | |
189 {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
|
190 }}; |
0 | 191 |
1206
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
192 std::array<std::array<struct SpellBookIconPos, 12>, 9> pIconPos={{ |
363 | 193 |
1206
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
194 { 0, 0, 17, 13, 115, 2, 217, 15, |
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
195 299, 6, 28, 125, 130, 133, 294, 114, |
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
196 11, 232, 134, 233, 237, 171, 296, 231}, |
0 | 197 |
1206
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
198 { 0, 0, 19, 9, 117, 3, 206, 13, |
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
199 285, 7, 16, 123, 113, 101, 201, 118, |
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
200 317, 110, 11, 230, 149, 236, 296, 234}, |
357 | 201 |
1206
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
202 { 0, 0, 17, 9, 140, 0, 210, 34, |
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
203 293, 5, 15, 98, 78, 121, 175, 136, |
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
204 301, 115, 15, 226, 154, 225, 272, 220}, |
357 | 205 |
1206
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
206 { 0, 0, 7, 9, 156, 2, 277, 9, |
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
207 11, 117, 111, 82, 180, 102, 303, 108, |
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
208 10, 229, 120, 221, 201, 217, 296, 225}, |
357 | 209 |
1206
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
210 { 0, 0, 18, 8, 89, 15, 192, 14, |
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
211 292, 7, 22, 129, 125, 146, 217, 136, |
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
212 305, 115, 22, 226, 174, 237, 290, 231}, |
357 | 213 |
1206
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
214 { 0, 0, 18, 12, 148, 9, 292, 7, |
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
215 17, 122, 121, 99, 220, 87, 293, 112, |
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
216 13, 236, 128, 213, 220, 223, 315, 223}, |
357 | 217 |
1206
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
218 { 0, 0, 23, 14, 127, 8, 204, 0, |
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
219 306, 8, 14, 115, 122, 132, 200, 116, |
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
220 293, 122, 20, 228, 154, 228, 294, 239}, |
357 | 221 |
1206
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
222 { 0, 0, 19, 14, 124, 10, 283, 12, |
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
223 8, 105, 113, 89, 190, 82, 298, 108, |
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
224 18, 181, 101, 204, 204, 203, 285, 218}, |
357 | 225 |
1206
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
226 { 0, 0, 18, 17, 110, 16, 201, 15, |
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
227 307, 15, 18, 148, 125, 166, 201, 123, |
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
228 275, 120, 28, 235, 217, 222, 324, 216}}}; |
0 | 229 |
230 | |
231 //----- (0042EB31) -------------------------------------------------------- | |
232 bool SpellBuff::NotExpired() | |
233 { | |
189 | 234 return (signed __int64)this->uExpireTime > 0 ? true:false; |
0 | 235 } |
236 | |
237 | |
238 //----- (00458585) -------------------------------------------------------- | |
239 void SpellBuff::Reset() | |
240 { | |
982 | 241 uSkill = 0; |
242 uPower = 0; | |
243 uExpireTime = 0i64; | |
244 uCaster = 0; | |
245 uFlags = 0; | |
246 if (uOverlayID) | |
0 | 247 { |
982 | 248 pOtherOverlayList->pOverlays[uOverlayID - 1].Reset(); |
142 | 249 pOtherOverlayList->bRedraw = true; |
982 | 250 uOverlayID = 0; |
0 | 251 } |
252 } | |
253 | |
254 //----- (004585CA) -------------------------------------------------------- | |
1340 | 255 bool SpellBuff::IsBuffExpiredToTime( __int64 time_end ) |
256 { | |
257 if (uExpireTime && (uExpireTime < time_end)) | |
0 | 258 { |
982 | 259 uExpireTime = 0; |
260 uPower = 0; | |
261 uSkill = 0; | |
262 uOverlayID = 0; | |
263 return true; | |
0 | 264 } |
982 | 265 return false; |
0 | 266 } |
267 | |
268 //----- (004584E0) -------------------------------------------------------- | |
1340 | 269 bool SpellBuff::Apply( signed __int64 uExpireTime, unsigned __int16 uSkillLevel, unsigned __int16 uPower, int uOverlayID, unsigned __int8 caster ) |
270 { | |
271 if (this->uExpireTime && (uExpireTime < this->uExpireTime)) | |
982 | 272 return false; |
0 | 273 |
982 | 274 this->uSkill = uSkillLevel; |
275 this->uPower = uPower; | |
276 this->uExpireTime = uExpireTime; | |
277 if (this->uOverlayID && this->uOverlayID != uOverlayID) | |
0 | 278 { |
982 | 279 pOtherOverlayList->pOverlays[this->uOverlayID - 1].Reset(); |
280 pOtherOverlayList->bRedraw = true; | |
281 this->uOverlayID = 0; | |
0 | 282 } |
982 | 283 this->uOverlayID = uOverlayID; |
284 this->uCaster = caster; | |
285 | |
286 return true; | |
0 | 287 } |
288 | |
289 //----- (0045384A) -------------------------------------------------------- | |
290 void SpellStats::Initialize() | |
982 | 291 { |
191 | 292 int decode_step; |
293 char* test_string; | |
294 bool break_loop; | |
295 unsigned char c; | |
296 unsigned int temp_str_len; | |
297 char* tmp_pos; | |
189 | 298 |
191 | 299 if ( pSpellsTXT_Raw ) |
1583 | 300 free(pSpellsTXT_Raw); |
191 | 301 pSpellsTXT_Raw = NULL; |
189 | 302 |
191 | 303 pSpellsTXT_Raw = (char *)pEvents_LOD->LoadRaw("spells.txt", 0); |
304 strtok(pSpellsTXT_Raw, "\r"); | |
305 strtok(NULL, "\r"); | |
306 for(int i=1; i<100; ++i) | |
307 { | |
308 test_string=strtok(NULL, "\r")+1; | |
309 decode_step =0; | |
310 break_loop=false; | |
311 do | |
312 { | |
313 c = *(unsigned char*)test_string; | |
314 temp_str_len = 0; | |
315 while((c!='\t')&&(c>0)) | |
316 { | |
317 ++temp_str_len; | |
318 c=test_string[temp_str_len]; | |
319 } | |
320 tmp_pos=test_string+temp_str_len; | |
321 if (*tmp_pos == 0) | |
322 break_loop = true; | |
323 *tmp_pos = 0; | |
324 if (temp_str_len) | |
325 { | |
326 switch (decode_step) | |
327 { | |
328 case 2: | |
329 pInfos[i].pName=RemoveQuotes(test_string); | |
330 break; | |
331 case 3: | |
192 | 332 pInfos[i].uSchool = SPELL_SCHOOL_NONE; |
1104 | 333 if (!_stricmp("fire", test_string) ) |
191 | 334 { |
192 | 335 pInfos[i].uSchool =SPELL_SCHOOL_FIRE; |
191 | 336 break; |
337 } | |
1104 | 338 if ( !_stricmp("air", test_string) ) |
191 | 339 { |
192 | 340 pInfos[i].uSchool = SPELL_SCHOOL_AIR; |
191 | 341 break; |
342 } | |
1104 | 343 if ( !_stricmp("water", test_string)) |
191 | 344 { |
192 | 345 pInfos[i].uSchool = SPELL_SCHOOL_WATER; |
191 | 346 break; |
347 } | |
1104 | 348 if ( !_stricmp("earth", test_string)) |
191 | 349 { |
192 | 350 pInfos[i].uSchool = SPELL_SCHOOL_EARTH; |
191 | 351 break; |
352 } | |
1104 | 353 if ( !_stricmp("spirit", test_string)) |
191 | 354 { |
192 | 355 pInfos[i].uSchool = SPELL_SCHOOL_SPIRIT; |
191 | 356 break; |
357 } | |
1104 | 358 if ( !_stricmp("mind", test_string)) |
191 | 359 { |
192 | 360 pInfos[i].uSchool = SPELL_SCHOOL_MIND; |
191 | 361 break; |
362 } | |
1104 | 363 if ( !_stricmp("body", test_string) ) |
191 | 364 { |
192 | 365 pInfos[i].uSchool = SPELL_SCHOOL_BODY; |
191 | 366 break; |
367 } | |
1104 | 368 if ( !_stricmp("light", test_string) ) |
191 | 369 { |
192 | 370 pInfos[i].uSchool = SPELL_SCHOOL_LIGHT; |
191 | 371 break; |
372 } | |
1104 | 373 if ( !_stricmp("dark", test_string)) |
191 | 374 { |
192 | 375 pInfos[i].uSchool = SPELL_SCHOOL_DARK; |
191 | 376 break; |
377 } | |
378 | |
1104 | 379 if ( !_stricmp("magic", test_string)) |
191 | 380 { |
192 | 381 pInfos[i].uSchool = SPELL_SCHOOL_MAGIC; |
191 | 382 break; |
383 } | |
384 break; | |
385 case 4: | |
386 pInfos[i].pShortName=RemoveQuotes(test_string); | |
387 break; | |
388 case 5: | |
389 pInfos[i].pDescription=RemoveQuotes(test_string); | |
390 break; | |
391 case 6: | |
392 pInfos[i].pBasicSkillDesc=RemoveQuotes(test_string); | |
393 break; | |
394 case 7: | |
395 pInfos[i].pExpertSkillDesc=RemoveQuotes(test_string); | |
396 break; | |
397 case 8: | |
398 pInfos[i].pMasterSkillDesc=RemoveQuotes(test_string); | |
399 break; | |
400 case 9: | |
401 pInfos[i].pGrandmasterSkillDesc=RemoveQuotes(test_string); | |
402 break; | |
403 case 10: | |
404 int in_string_pos=0; | |
192 | 405 unsigned char test; |
191 | 406 int in_str_len=strlen(test_string); |
192 | 407 for (int j=0; j<in_str_len; ++j) |
408 { | |
409 test= tolower(test_string[j]); | |
410 switch (test) | |
411 { | |
2107
85e9766d6124
sub_427769_spell to sub_427769_isSpellQuickCastableOnShiftClick
Grumpy7
parents:
2037
diff
changeset
|
412 case 'm': |
85e9766d6124
sub_427769_spell to sub_427769_isSpellQuickCastableOnShiftClick
Grumpy7
parents:
2037
diff
changeset
|
413 pSpellDatas[i].stats|=1; |
192 | 414 break; |
2107
85e9766d6124
sub_427769_spell to sub_427769_isSpellQuickCastableOnShiftClick
Grumpy7
parents:
2037
diff
changeset
|
415 case 'e': |
85e9766d6124
sub_427769_spell to sub_427769_isSpellQuickCastableOnShiftClick
Grumpy7
parents:
2037
diff
changeset
|
416 pSpellDatas[i].stats|=2; |
192 | 417 break; |
2107
85e9766d6124
sub_427769_spell to sub_427769_isSpellQuickCastableOnShiftClick
Grumpy7
parents:
2037
diff
changeset
|
418 case 'c': |
85e9766d6124
sub_427769_spell to sub_427769_isSpellQuickCastableOnShiftClick
Grumpy7
parents:
2037
diff
changeset
|
419 pSpellDatas[i].stats|=4; |
192 | 420 break; |
2107
85e9766d6124
sub_427769_spell to sub_427769_isSpellQuickCastableOnShiftClick
Grumpy7
parents:
2037
diff
changeset
|
421 case 'x': |
85e9766d6124
sub_427769_spell to sub_427769_isSpellQuickCastableOnShiftClick
Grumpy7
parents:
2037
diff
changeset
|
422 pSpellDatas[i].stats|=8; |
192 | 423 break; |
424 } | |
425 } | |
191 | 426 break; |
427 } | |
428 } | |
429 else | |
430 break_loop=true; | |
431 ++decode_step; | |
432 test_string=tmp_pos+1; | |
433 } while ((decode_step<11)&&!break_loop); | |
434 if ((i%11)==0) | |
435 strtok(NULL, "\r"); | |
436 } | |
437 | |
1295 | 438 } |
439 //----- (00448DF8) -------------------------------------------------------- | |
1519 | 440 void __fastcall EventCastSpell(int uSpellID, int uSkillLevel, int uSkill, int fromx, int fromy, int fromz, int tox, int toy, int toz)//sub_448DF8 |
1295 | 441 { |
442 int v9; // esi@1 | |
443 double v10; // st7@4 | |
444 double v11; // st6@4 | |
445 double v12; // st5@4 | |
446 double v13; // st7@6 | |
447 int v14; // ST44_4@7 | |
448 signed int v15; // ebx@9 | |
449 signed int v16; // edx@15 | |
450 char *v17; // ecx@16 | |
451 unsigned __int16 v18; // ax@20 | |
452 char *v19; // ecx@31 | |
453 int v20; // edx@35 | |
454 signed int v21; // edx@37 | |
455 char *v22; // ecx@38 | |
456 unsigned __int16 v23; // ax@41 | |
457 int i; // esi@42 | |
458 signed int v25; // edx@55 | |
459 char *v26; // ecx@56 | |
460 unsigned __int16 v27; // ax@59 | |
461 int j; // esi@60 | |
462 signed int v29; // edx@66 | |
463 char *v30; // ecx@67 | |
464 unsigned __int16 v31; // ax@70 | |
465 //Player *v32; // eax@80 | |
466 //unsigned __int16 v33; // si@85 | |
467 int v34; // eax@96 | |
468 int v35; // eax@97 | |
469 unsigned __int64 v36; // qax@99 | |
470 SpellBuff *v37; // ecx@99 | |
471 int v38; // esi@103 | |
472 signed __int64 v39; // qax@105 | |
473 int v40; // ebx@108 | |
474 int v41; // ebx@109 | |
475 int v42; // esi@111 | |
476 int v43; // ebx@111 | |
477 int v44; // eax@117 | |
478 //unsigned __int16 v45; // si@137 | |
479 unsigned __int16 v46; // [sp-8h] [bp-BCh]@99 | |
480 int v47; // [sp-4h] [bp-B8h]@35 | |
481 unsigned __int16 v48; // [sp-4h] [bp-B8h]@99 | |
482 int v49; // [sp+0h] [bp-B4h]@35 | |
483 int v50; // [sp+0h] [bp-B4h]@99 | |
484 int v51; // [sp+4h] [bp-B0h]@35 | |
485 unsigned __int8 v52; // [sp+4h] [bp-B0h]@99 | |
486 float v53; // [sp+14h] [bp-A0h]@4 | |
487 float v54; // [sp+18h] [bp-9Ch]@4 | |
488 int v55; // [sp+28h] [bp-8Ch]@7 | |
489 unsigned int yaw; // [sp+30h] [bp-84h]@7 | |
490 int pitch; // [sp+34h] [bp-80h]@7 | |
491 //SpriteObject a1; // [sp+38h] [bp-7Ch]@12 | |
492 int v59; // [sp+A8h] [bp-Ch]@1 | |
493 int v60; // [sp+ACh] [bp-8h]@1 | |
494 //int spellnum_; // [sp+B0h] [bp-4h]@1 | |
495 //signed int levela; // [sp+BCh] [bp+8h]@80 | |
496 int a6_4; // [sp+C8h] [bp+14h]@117 | |
497 float a7a; // [sp+CCh] [bp+18h]@6 | |
498 signed int a7b; // [sp+CCh] [bp+18h]@12 | |
499 int a7c; // [sp+CCh] [bp+18h]@29 | |
500 int a7d; // [sp+CCh] [bp+18h]@55 | |
501 float a8a; // [sp+D0h] [bp+1Ch]@6 | |
502 int a8b; // [sp+D0h] [bp+1Ch]@37 | |
503 int a8c; // [sp+D0h] [bp+1Ch]@55 | |
504 float toza; // [sp+D4h] [bp+20h]@6 | |
505 | |
506 v9 = 0; | |
507 v59 = uSkillLevel + 1; | |
1519 | 508 //spellnum_ = uSpellID; |
1295 | 509 v60 = 0; |
510 if ( tox || toy || toz ) | |
511 { | |
512 v10 = (double)tox - (double)fromx; | |
513 v53 = v10; | |
514 v11 = (double)toy - (double)fromy; | |
515 v54 = v11; | |
516 v12 = (double)toz; | |
517 } | |
518 else | |
519 { | |
520 v10 = (double)pParty->vPosition.x - (double)fromx; | |
521 v53 = v10; | |
522 v11 = (double)pParty->vPosition.y - (double)fromy; | |
523 v54 = v11; | |
524 v12 = (double)(pParty->vPosition.z + pParty->sEyelevel); | |
525 } | |
526 a7a = v12 - (double)fromz; | |
527 toza = v11 * v11; | |
528 a8a = v10 * v10; | |
529 v13 = sqrt(a7a * a7a + a8a + toza); | |
530 if ( v13 <= 1.0 ) | |
531 { | |
532 LOBYTE(v55) = 1; | |
533 yaw = 0; | |
534 pitch = 0; | |
535 } | |
536 else | |
537 { | |
538 v55 = (signed __int64)v13; | |
539 v14 = (signed __int64)sqrt(a8a + toza); | |
540 yaw = stru_5C6E00->Atan2((signed __int64)v53, (signed __int64)v54); | |
541 pitch = stru_5C6E00->Atan2(v14, (signed __int64)a7a); | |
542 } | |
543 v15 = v59; | |
544 if ( v59 <= 0 || v59 > 4 ) | |
545 v15 = 1; | |
546 a7b = v15; | |
547 | |
548 SpriteObject a1; // [sp+38h] [bp-7Ch]@12 | |
549 //SpriteObject::SpriteObject(&a1); | |
550 | |
1519 | 551 a1.uType = stru_4E3ACC[uSpellID].uType; |
552 if ( uSpellID > 58 ) | |
1295 | 553 { |
2101 | 554 if ( uSpellID == SPELL_BODY_PROTECTION_FROM_BODY ) |
1295 | 555 goto LABEL_117; |
2101 | 556 if ( uSpellID != SPELL_LIGHT_DAY_OF_THE_GODS ) |
1295 | 557 return; |
558 v40 = v15 - 2; | |
559 if ( v40 ) | |
560 { | |
561 v41 = v40 - 1; | |
562 if ( !v41 ) | |
563 { | |
564 v42 = 14400 * uSkill; | |
565 v43 = 4 * uSkill + 10; | |
566 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 0); | |
567 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 1u); | |
568 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 2u); | |
569 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 3u); | |
570 v39 = (signed __int64)((double)(v42 << 7) * 0.033333335); | |
571 v37 = &pParty->pPartyBuffs[PARTY_BUFF_DAY_OF_GODS]; | |
572 v36 = pParty->uTimePlayed + v39; | |
573 v37->Apply(v36, a7b, v43, 0, 0); | |
2101 | 574 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0); |
575 return; | |
1295 | 576 } |
577 if ( v41 == 1 ) | |
578 { | |
579 v42 = 18000 * uSkill; | |
580 v43 = 5 * uSkill + 10; | |
581 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 0); | |
582 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 1u); | |
583 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 2u); | |
584 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 3u); | |
585 v39 = (signed __int64)((double)(v42 << 7) * 0.033333335); | |
586 v37 = &pParty->pPartyBuffs[PARTY_BUFF_DAY_OF_GODS]; | |
587 v36 = pParty->uTimePlayed + v39; | |
588 v37->Apply(v36, a7b, v43, 0, 0); | |
2101 | 589 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0); |
590 return; | |
1295 | 591 } |
592 } | |
593 v42 = 10800 * uSkill; | |
594 v43 = 3 * uSkill + 10; | |
595 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 0); | |
596 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 1u); | |
597 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 2u); | |
598 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 3u); | |
599 v39 = (signed __int64)((double)(v42 << 7) * 0.033333335); | |
600 v37 = &pParty->pPartyBuffs[PARTY_BUFF_DAY_OF_GODS]; | |
601 v36 = pParty->uTimePlayed + v39; | |
602 v37->Apply(v36, a7b, v43, 0, 0); | |
2101 | 603 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0); |
604 return; | |
1295 | 605 } |
1519 | 606 if ( uSpellID != 58 ) |
1295 | 607 { |
1519 | 608 switch ( uSpellID ) |
1295 | 609 { |
2101 | 610 case SPELL_FIRE_FIRE_BOLT: |
611 case SPELL_FIRE_FIREBALL: | |
612 case SPELL_AIR_LIGHNING_BOLT: | |
613 case SPELL_WATER_ICE_BOLT: | |
614 case SPELL_WATER_ACID_BURST: | |
615 case SPELL_WATER_ICE_BLAST: | |
616 case SPELL_EARTH_BLADES: | |
617 case SPELL_EARTH_ROCK_BLAST: | |
1295 | 618 a1.stru_24.Reset(); |
619 v16 = 0; | |
1519 | 620 a1.spell_id = uSpellID; |
1295 | 621 a1.spell_level = uSkill; |
622 a1.spell_skill = v15; | |
623 if ( (signed int)pObjectList->uNumObjects <= 0 ) | |
624 { | |
2101 | 625 //v18 = 0; |
626 a1.uObjectDescID = 0; | |
1295 | 627 *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy); |
628 a1.vPosition.x = fromx; | |
629 a1.uAttributes = 16; | |
630 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz); | |
631 a1.field_60_distance_related_prolly_lod = v55; | |
2101 | 632 //v20 = yaw; |
1295 | 633 a1.uSpriteFrameID = 0; |
634 a1.spell_caster_pid = 8000 | OBJECT_Item; | |
635 a1.spell_target_pid = 0; | |
636 a1.uFacing = yaw; | |
637 a1.uSoundID = 0; | |
638 v49 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; | |
2101 | 639 a1.Create(yaw, pitch, v49, 0); |
640 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0); | |
641 return; | |
1295 | 642 } |
643 v17 = (char *)&pObjectList->pObjects->uObjectID; | |
644 while ( (short)a1.uType != *(short *)v17 ) | |
645 { | |
646 ++v16; | |
647 v17 += 56; | |
648 if ( v16 >= (signed int)pObjectList->uNumObjects ) | |
649 { | |
2101 | 650 //v18 = 0; |
651 a1.uObjectDescID = 0; | |
1295 | 652 *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy); |
653 a1.vPosition.x = fromx; | |
654 a1.uAttributes = 16; | |
655 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz); | |
656 a1.field_60_distance_related_prolly_lod = v55; | |
2101 | 657 //v20 = yaw; |
1295 | 658 a1.uSpriteFrameID = 0; |
659 a1.spell_caster_pid = 8000 | OBJECT_Item; | |
660 a1.spell_target_pid = 0; | |
661 a1.uFacing = yaw; | |
662 a1.uSoundID = 0; | |
663 v49 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; | |
2101 | 664 a1.Create(yaw, pitch, v49, 0); |
665 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0); | |
666 return; | |
1295 | 667 } |
668 } | |
669 v18 = v16; | |
670 a1.uObjectDescID = v18; | |
671 *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy); | |
672 a1.vPosition.x = fromx; | |
673 a1.uAttributes = 16; | |
674 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz); | |
675 a1.field_60_distance_related_prolly_lod = v55; | |
2101 | 676 //v20 = yaw; |
1295 | 677 a1.uSpriteFrameID = 0; |
678 a1.spell_caster_pid = 8000 | OBJECT_Item; | |
679 a1.spell_target_pid = 0; | |
680 a1.uFacing = yaw; | |
681 a1.uSoundID = 0; | |
682 v49 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; | |
2101 | 683 a1.Create(yaw, pitch, v49, 0); |
684 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0); | |
685 return; | |
686 case SPELL_WATER_POISON_SPRAY: | |
1295 | 687 switch ( v15 ) |
688 { | |
689 case 1: | |
690 v60 = 1; | |
691 break; | |
692 case 2: | |
693 v60 = 3; | |
694 break; | |
695 case 3: | |
696 v60 = 5; | |
697 break; | |
698 case 4: | |
699 v60 = 7; | |
700 break; | |
701 } | |
702 a7c = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360; | |
703 if ( v60 != 1 ) | |
704 { | |
705 a8b = a7c / (v60 - 1); | |
706 a1.stru_24.Reset(); | |
707 v21 = 0; | |
1519 | 708 a1.spell_id = uSpellID; |
1295 | 709 a1.spell_level = uSkill; |
710 a1.spell_skill = v15; | |
711 if ( (signed int)pObjectList->uNumObjects <= 0 ) | |
712 v23 = 0; | |
713 else | |
714 { | |
715 v22 = (char *)&pObjectList->pObjects->uObjectID; | |
716 while ( (short)a1.uType != *(short *)v22 ) | |
717 { | |
718 ++v21; | |
719 v22 += 56; | |
720 if ( v21 >= (signed int)pObjectList->uNumObjects ) | |
721 { | |
722 v23 = 0; | |
723 a1.uObjectDescID = v23; | |
724 *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy); | |
725 a1.vPosition.x = fromx; | |
726 a1.uAttributes = 16; | |
727 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz); | |
728 a1.field_60_distance_related_prolly_lod = v55; | |
729 a1.uSpriteFrameID = 0; | |
730 a1.spell_caster_pid = 8000 | OBJECT_Item; | |
731 a1.spell_target_pid = 4; | |
732 a1.uSoundID = 0; | |
733 for ( i = a7c / -2; i <= a7c / 2; i += a8b ) | |
734 { | |
735 a1.uFacing = i + yaw; | |
736 a1.Create((signed __int16)(i + (short)yaw), pitch, pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, 0); | |
737 } | |
2101 | 738 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0); |
739 return; | |
1295 | 740 } |
741 } | |
742 v23 = v21; | |
743 } | |
744 a1.uObjectDescID = v23; | |
745 *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy); | |
746 a1.vPosition.x = fromx; | |
747 a1.uAttributes = 16; | |
748 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz); | |
749 a1.field_60_distance_related_prolly_lod = v55; | |
750 a1.uSpriteFrameID = 0; | |
751 a1.spell_caster_pid = 8000 | OBJECT_Item; | |
752 a1.spell_target_pid = 4; | |
753 a1.uSoundID = 0; | |
754 for ( i = a7c / -2; i <= a7c / 2; i += a8b ) | |
755 { | |
756 a1.uFacing = i + yaw; | |
757 a1.Create((signed __int16)(i + (short)yaw), pitch, pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, 0); | |
758 } | |
2101 | 759 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0); |
760 return; | |
1295 | 761 } |
762 a1.stru_24.Reset(); | |
1519 | 763 a1.spell_id = uSpellID; |
1295 | 764 a1.spell_level = uSkill; |
765 a1.spell_skill = v15; | |
766 if ( (signed int)pObjectList->uNumObjects <= 0 ) | |
767 { | |
2101 | 768 //v18 = 0; |
769 a1.uObjectDescID = 0; | |
770 *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy); | |
771 a1.vPosition.x = fromx; | |
772 a1.uAttributes = 16; | |
773 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz); | |
774 a1.field_60_distance_related_prolly_lod = v55; | |
775 //v20 = yaw; | |
776 a1.uSpriteFrameID = 0; | |
777 a1.spell_caster_pid = 8000 | OBJECT_Item; | |
778 a1.spell_target_pid = 0; | |
779 a1.uFacing = yaw; | |
780 a1.uSoundID = 0; | |
781 //v51 = 0; | |
782 v49 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; | |
783 //v47 = pitch; | |
784 a1.Create(yaw, pitch, v49, 0); | |
785 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0); | |
786 return; | |
787 } | |
788 //v19 = (char *)&pObjectList->pObjects->uObjectID; | |
789 for ( v16 = 0; v16 < (signed int)pObjectList->uNumObjects; ++v16 ) | |
790 { | |
791 if ( (short)a1.uType == pObjectList->pObjects[v16].uObjectID ) | |
1295 | 792 { |
2101 | 793 //v18 = v16; |
794 a1.uObjectDescID = v16; | |
1295 | 795 *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy); |
796 a1.vPosition.x = fromx; | |
797 a1.uAttributes = 16; | |
798 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz); | |
799 a1.field_60_distance_related_prolly_lod = v55; | |
2101 | 800 //v20 = yaw; |
1295 | 801 a1.uSpriteFrameID = 0; |
802 a1.spell_caster_pid = 8000 | OBJECT_Item; | |
803 a1.spell_target_pid = 0; | |
804 a1.uFacing = yaw; | |
805 a1.uSoundID = 0; | |
2101 | 806 //v51 = 0; |
1295 | 807 v49 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; |
2101 | 808 //v47 = pitch; |
809 a1.Create(yaw, pitch, v49, 0); | |
810 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0); | |
811 return; | |
1295 | 812 } |
2101 | 813 //v19 += 56; |
1295 | 814 } |
2101 | 815 //v18 = 0; |
816 a1.uObjectDescID = 0; | |
1295 | 817 *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy); |
818 a1.vPosition.x = fromx; | |
819 a1.uAttributes = 16; | |
820 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz); | |
821 a1.field_60_distance_related_prolly_lod = v55; | |
2101 | 822 //v20 = yaw; |
1295 | 823 a1.uSpriteFrameID = 0; |
824 a1.spell_caster_pid = 8000 | OBJECT_Item; | |
825 a1.spell_target_pid = 0; | |
826 a1.uFacing = yaw; | |
827 a1.uSoundID = 0; | |
2101 | 828 //v51 = 0; |
1295 | 829 v49 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; |
2101 | 830 //v47 = pitch; |
831 a1.Create(yaw, pitch, v49, 0); | |
832 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0); | |
833 return; | |
834 case SPELL_AIR_SPARKS: | |
1295 | 835 switch ( v15 ) |
836 { | |
837 case 1: | |
838 v60 = 3; | |
839 break; | |
840 case 2: | |
841 v60 = 5; | |
842 break; | |
843 case 3: | |
844 v60 = 7; | |
845 break; | |
846 case 4: | |
847 v60 = 9; | |
848 break; | |
849 } | |
850 a7d = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360; | |
851 a8c = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360 / (v60 - 1); | |
852 a1.stru_24.Reset(); | |
853 v25 = 0; | |
1519 | 854 a1.spell_id = uSpellID; |
1295 | 855 a1.spell_level = uSkill; |
856 a1.spell_skill = v15; | |
857 if ( (signed int)pObjectList->uNumObjects <= 0 ) | |
858 { | |
2101 | 859 //v27 = 0; |
860 a1.uObjectDescID = 0; | |
1295 | 861 *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy); |
862 a1.vPosition.x = fromx; | |
863 a1.uAttributes = 16; | |
864 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz); | |
865 a1.field_60_distance_related_prolly_lod = v55; | |
866 a1.uSpriteFrameID = 0; | |
867 a1.spell_caster_pid = 8000 | OBJECT_Item; | |
868 a1.spell_target_pid = 4; | |
869 a1.uSoundID = 0; | |
870 for ( j = a7d / -2; j <= a7d / 2; j += a8c ) | |
871 { | |
872 a1.uFacing = j + yaw; | |
873 a1.Create((signed __int16)(j + (short)yaw), pitch, pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, 0); | |
874 } | |
2101 | 875 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0); |
876 return; | |
1295 | 877 } |
878 v26 = (char *)&pObjectList->pObjects->uObjectID; | |
879 while ( (short)a1.uType != *(short *)v26 ) | |
880 { | |
881 ++v25; | |
882 v26 += 56; | |
883 if ( v25 >= (signed int)pObjectList->uNumObjects ) | |
884 { | |
885 v27 = 0; | |
886 a1.uObjectDescID = v27; | |
887 *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy); | |
888 a1.vPosition.x = fromx; | |
889 a1.uAttributes = 16; | |
890 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz); | |
891 a1.field_60_distance_related_prolly_lod = v55; | |
892 a1.uSpriteFrameID = 0; | |
893 a1.spell_caster_pid = 8000 | OBJECT_Item; | |
894 a1.spell_target_pid = 4; | |
895 a1.uSoundID = 0; | |
896 for ( j = a7d / -2; j <= a7d / 2; j += a8c ) | |
897 { | |
898 a1.uFacing = j + yaw; | |
899 a1.Create((signed __int16)(j + (short)yaw), pitch, pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, 0); | |
900 } | |
2101 | 901 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0); |
902 return; | |
1295 | 903 } |
904 } | |
905 v27 = v25; | |
906 a1.uObjectDescID = v27; | |
907 *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy); | |
908 a1.vPosition.x = fromx; | |
909 a1.uAttributes = 16; | |
910 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz); | |
911 a1.field_60_distance_related_prolly_lod = v55; | |
912 a1.uSpriteFrameID = 0; | |
913 a1.spell_caster_pid = 8000 | OBJECT_Item; | |
914 a1.spell_target_pid = 4; | |
915 a1.uSoundID = 0; | |
916 for ( j = a7d / -2; j <= a7d / 2; j += a8c ) | |
917 { | |
918 a1.uFacing = j + yaw; | |
2101 | 919 a1.Create((signed __int16)(j + (short)yaw), pitch, |
920 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, 0); | |
1295 | 921 } |
2101 | 922 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0); |
923 return; | |
924 case SPELL_EARTH_DEATH_BLOSSOM: | |
1295 | 925 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor ) |
926 return; | |
927 a1.stru_24.Reset(); | |
928 v29 = 0; | |
1519 | 929 a1.spell_id = uSpellID; |
1295 | 930 a1.spell_level = uSkill; |
931 a1.spell_skill = v15; | |
932 if ( (signed int)pObjectList->uNumObjects <= 0 ) | |
933 { | |
2101 | 934 //v31 = 0; |
935 a1.uObjectDescID = 0; | |
1295 | 936 *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy); |
937 a1.vPosition.x = fromx; | |
938 a1.uAttributes = 16; | |
939 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz); | |
940 a1.field_60_distance_related_prolly_lod = v55; | |
941 a1.uSpriteFrameID = 0; | |
942 a1.spell_caster_pid = 8000 | OBJECT_Item; | |
943 a1.spell_target_pid = 4; | |
944 a1.uSoundID = 0; | |
2101 | 945 //v51 = 0; |
1295 | 946 v49 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; |
2101 | 947 //v20 = yaw; |
1295 | 948 v47 = (signed int)stru_5C6E00->uIntegerHalfPi / 2; |
2101 | 949 a1.Create(yaw, v47, v49, 0); |
950 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0); | |
951 return; | |
1295 | 952 } |
953 v30 = (char *)&pObjectList->pObjects->uObjectID; | |
954 break; | |
955 | |
956 case SPELL_FIRE_HASTE: | |
957 if ( v15 > 0 ) | |
958 { | |
959 if ( v15 <= 2 ) | |
960 v9 = 60 * (uSkill + 60); | |
2106 | 961 else if ( v15 == 3 ) |
962 v9 = 180 * (uSkill + 20); | |
963 else if ( v15 == 4 ) | |
964 v9 = 240 * (uSkill + 15); | |
1295 | 965 } |
966 //levela = 1; | |
967 //v32 = pParty->pPlayers;//[0].pConditions[1]; | |
968 //do | |
969 for (uint i = 0; i < 4; ++i) | |
1362
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
970 if (pParty->pPlayers[i].IsWeak()) |
1295 | 971 return; |
972 //while ( v32 <= &pParty->pPlayers[3] ); | |
973 //if ( !levela ) | |
974 // return; | |
975 pParty->pPartyBuffs[PARTY_BUFF_HASTE].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(v9 * 128) * 0.033333335), | |
2101 | 976 v15, 0, 0, 0); |
1295 | 977 //v33 = spellnum_; |
1519 | 978 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 0); |
979 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 1); | |
980 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 2); | |
981 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 3); | |
2105 | 982 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0);//çâóê àëòàðÿ |
2101 | 983 return; |
984 case SPELL_AIR_SHIELD: | |
985 case SPELL_EARTH_STONESKIN: | |
986 case SPELL_SPIRIT_HEROISM: | |
1295 | 987 switch ( v15 ) |
988 { | |
989 case 1: | |
990 case 2: | |
991 v9 = 300 * (uSkill + 12); | |
992 break; | |
993 case 3: | |
994 v9 = 900 * (uSkill + 4); | |
995 break; | |
996 case 4: | |
997 v9 = 3600 * (uSkill + 1); | |
998 break; | |
999 } | |
1519 | 1000 switch ( uSpellID ) |
1295 | 1001 { |
1002 case 17: | |
1003 v60 = 0; | |
1004 uSkill = 14; | |
1005 break; | |
1006 case 38: | |
1007 v35 = uSkill + 5; | |
1008 uSkill = 15; | |
1009 v60 = v35; | |
1010 break; | |
1011 case 51: | |
1012 v34 = uSkill + 5; | |
1013 uSkill = 9; | |
1014 v60 = v34; | |
1015 break; | |
1016 } | |
1519 | 1017 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 0); |
1018 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 1); | |
1019 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 2); | |
1020 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 3); | |
2101 | 1021 //v52 = 0; |
1022 //v50 = 0; | |
1023 //v48 = v60; | |
1024 //v46 = v15; | |
1295 | 1025 v36 = pParty->uTimePlayed + (signed int)(signed __int64)((double)(v9 << 7) * 0.033333335); |
2101 | 1026 //v37 = &pParty->pPartyBuffs[uSkill]; |
1027 pParty->pPartyBuffs[uSkill].Apply(v36, v15, v60, 0, 0); | |
1028 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0); | |
1029 return; | |
1030 case SPELL_FIRE_IMMOLATION: | |
1295 | 1031 if ( v15 == 2 || v15 == 3 || v15 != 4 ) |
1032 v38 = 60 * uSkill; | |
1033 else | |
1034 v38 = 600 * uSkill; | |
1519 | 1035 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 0); |
1036 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 1); | |
1037 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 2); | |
1038 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 3); | |
1295 | 1039 v52 = 0; |
1040 v50 = 0; | |
1041 v48 = uSkill; | |
1042 v46 = v15; | |
1043 v39 = (signed __int64)((double)(v38 << 7) * 0.033333335); | |
1044 v37 = &pParty->pPartyBuffs[PARTY_BUFF_IMMOLATION]; | |
1045 v36 = pParty->uTimePlayed + v39; | |
1046 v37->Apply(v36, v46, v48, v50, v52); | |
2101 | 1047 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0); |
1048 return; | |
1049 case SPELL_FIRE_PROTECTION_FROM_FIRE: | |
1050 case SPELL_AIR_PROTECTION_FROM_AIR: | |
1051 case SPELL_WATER_PROTECTION_FROM_WATER: | |
1052 case SPELL_EARTH_PROTECTION_FROM_EARTH: | |
1295 | 1053 goto LABEL_117; |
1054 default: | |
1055 return; | |
1056 } | |
1057 while ( (short)a1.uType != *(short *)v30 ) | |
1058 { | |
1059 ++v29; | |
1060 v30 += 56; | |
1061 if ( v29 >= (signed int)pObjectList->uNumObjects ) | |
1062 { | |
2101 | 1063 //v31 = 0; |
1064 a1.uObjectDescID = 0; | |
1295 | 1065 *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy); |
1066 a1.vPosition.x = fromx; | |
1067 a1.uAttributes = 16; | |
1068 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz); | |
1069 a1.field_60_distance_related_prolly_lod = v55; | |
1070 a1.uSpriteFrameID = 0; | |
1071 a1.spell_caster_pid = 8000 | OBJECT_Item; | |
1072 a1.spell_target_pid = 4; | |
1073 a1.uSoundID = 0; | |
2101 | 1074 //v51 = 0; |
1295 | 1075 v49 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; |
2101 | 1076 //v20 = yaw; |
1295 | 1077 v47 = (signed int)stru_5C6E00->uIntegerHalfPi / 2; |
2101 | 1078 a1.Create(yaw, v47, v49, 0); |
1079 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0); | |
1080 return; | |
1295 | 1081 } |
1082 } | |
1083 v31 = v29; | |
1084 a1.uObjectDescID = v31; | |
1085 *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy); | |
1086 a1.vPosition.x = fromx; | |
1087 a1.uAttributes = 16; | |
1088 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz); | |
1089 a1.field_60_distance_related_prolly_lod = v55; | |
1090 a1.uSpriteFrameID = 0; | |
1091 a1.spell_caster_pid = 8000 | OBJECT_Item; | |
1092 a1.spell_target_pid = 4; | |
1093 a1.uSoundID = 0; | |
2101 | 1094 //v51 = 0; |
1295 | 1095 v49 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; |
2101 | 1096 //v20 = yaw; |
1295 | 1097 v47 = (signed int)stru_5C6E00->uIntegerHalfPi / 2; |
2101 | 1098 a1.Create(yaw, v47, v49, 0); |
1099 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0); | |
1100 return; | |
1295 | 1101 } |
1102 LABEL_117: | |
1103 v44 = uSkill; | |
1104 a6_4 = 3600 * uSkill; | |
1105 if ( v15 == 1 ) | |
1106 { | |
1107 v60 = v44; | |
1108 goto LABEL_125; | |
1109 } | |
1110 if ( v15 == 2 ) | |
1111 { | |
1112 v44 = 2 * uSkill; | |
1113 v60 = v44; | |
1114 goto LABEL_125; | |
1115 } | |
1116 if ( v15 == 3 ) | |
1117 { | |
1118 v44 = 3 * uSkill; | |
1119 v60 = v44; | |
1120 goto LABEL_125; | |
1121 } | |
1122 if ( v15 == 4 ) | |
1123 { | |
1124 v44 = 4 * uSkill; | |
1125 v60 = v44; | |
1126 goto LABEL_125; | |
1127 } | |
1128 LABEL_125: | |
1519 | 1129 switch ( uSpellID ) |
1295 | 1130 { |
1131 case 3: | |
1132 uSkill = 6; | |
1133 break; | |
1134 case 14: | |
1135 uSkill = 0; | |
1136 break; | |
1137 case 25: | |
1138 uSkill = 17; | |
1139 break; | |
1140 case 36: | |
1141 uSkill = 4; | |
1142 break; | |
1143 case 58: | |
1144 uSkill = 12; | |
1145 break; | |
1146 case 69: | |
1147 uSkill = 1; | |
1148 break; | |
1149 } | |
1150 //v45 = spellnum_; | |
1519 | 1151 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 0); |
1152 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 1); | |
1153 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 2); | |
1154 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 3); | |
1295 | 1155 pParty->pPartyBuffs[uSkill].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)a6_4 * 4.2666669), v15, v60, 0, 0); |
1156 //levela = 1; | |
2101 | 1157 //LABEL_138: |
1295 | 1158 //if ( levela ) |
2101 | 1159 //LABEL_139: |
1519 | 1160 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0); |
1296 | 1161 } |
1162 //----- (00427769) -------------------------------------------------------- | |
2107
85e9766d6124
sub_427769_spell to sub_427769_isSpellQuickCastableOnShiftClick
Grumpy7
parents:
2037
diff
changeset
|
1163 bool sub_427769_isSpellQuickCastableOnShiftClick(unsigned int uSpellID) |
1296 | 1164 { |
2107
85e9766d6124
sub_427769_spell to sub_427769_isSpellQuickCastableOnShiftClick
Grumpy7
parents:
2037
diff
changeset
|
1165 return ( pSpellDatas[uSpellID].stats & 0xC ); |
1297 | 1166 } |
1167 //----- (0043AFE3) -------------------------------------------------------- | |
1168 int __fastcall _43AFE3_calc_spell_damage(int a1, int a2, signed int a3, int a4) | |
1169 { | |
1170 int result; // eax@1 | |
1171 unsigned int v5; // [sp-4h] [bp-8h]@9 | |
1172 | |
1173 result = 0; | |
1174 if ( a1 == 7 ) | |
1175 { | |
1176 if ( a3 <= 0 ) | |
1177 return result; | |
1178 if ( a3 <= 2 ) | |
1179 { | |
1180 v5 = 6; | |
1181 } | |
1182 else | |
1183 { | |
1184 if ( a3 == 3 ) | |
1185 { | |
1186 v5 = 8; | |
1187 } | |
1188 else | |
1189 { | |
1190 if ( a3 != 4 ) | |
1191 return result; | |
1192 v5 = 10; | |
1193 } | |
1194 } | |
1195 result = GetDiceResult(a2, v5); | |
1196 } | |
1197 else | |
1198 { | |
1199 if ( a1 == 44 ) | |
1200 result = a4 * (LOBYTE(pSpellDatas[40].field_10) + 2 * a2) / 100; | |
1201 else | |
1202 result = *((char *)&pSpellDatas[0].field_10 + 20 * a1) | |
1203 + GetDiceResult(a2, *((char *)&pSpellDatas[0].field_10 + 20 * a1 + 1)); | |
1204 } | |
1205 return result; | |
1295 | 1206 } |