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