Mercurial > mm7
annotate Spells.cpp @ 2283:53d4e8539ca1
StorylineText::Initialize using tokenizer
author | Grumpy7 |
---|---|
date | Fri, 14 Mar 2014 23:33:07 +0100 |
parents | f5680ba9c96d |
children | 983b8c995127 |
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 { |
2282 | 292 std::map<std::string, SPELL_SCHOOL, ci_less> spellSchoolMaps; |
293 spellSchoolMaps["fire"] = SPELL_SCHOOL_FIRE; | |
294 spellSchoolMaps["air"] = SPELL_SCHOOL_AIR; | |
295 spellSchoolMaps["water"] = SPELL_SCHOOL_WATER; | |
296 spellSchoolMaps["earth"] = SPELL_SCHOOL_EARTH; | |
297 spellSchoolMaps["spirit"] = SPELL_SCHOOL_SPIRIT; | |
298 spellSchoolMaps["mind"] = SPELL_SCHOOL_MIND; | |
299 spellSchoolMaps["body"] = SPELL_SCHOOL_BODY; | |
300 spellSchoolMaps["light"] = SPELL_SCHOOL_LIGHT; | |
301 spellSchoolMaps["dark"] = SPELL_SCHOOL_DARK; | |
302 spellSchoolMaps["magic"] = SPELL_SCHOOL_MAGIC; | |
303 | |
191 | 304 char* test_string; |
189 | 305 |
191 | 306 if ( pSpellsTXT_Raw ) |
1583 | 307 free(pSpellsTXT_Raw); |
191 | 308 pSpellsTXT_Raw = NULL; |
189 | 309 |
191 | 310 pSpellsTXT_Raw = (char *)pEvents_LOD->LoadRaw("spells.txt", 0); |
311 strtok(pSpellsTXT_Raw, "\r"); | |
312 strtok(NULL, "\r"); | |
313 for(int i=1; i<100; ++i) | |
2282 | 314 { |
315 test_string=strtok(NULL, "\r")+1; | |
316 auto tokens = Tokenize(test_string, '\t'); | |
317 pInfos[i].pName=RemoveQuotes(tokens[2]); | |
318 auto findResult = spellSchoolMaps.find(tokens[3]); | |
319 pInfos[i].uSchool = findResult == spellSchoolMaps.end() ? SPELL_SCHOOL_NONE : findResult->second; | |
320 pInfos[i].pShortName=RemoveQuotes(tokens[4]); | |
321 pInfos[i].pDescription=RemoveQuotes(tokens[5]); | |
322 pInfos[i].pBasicSkillDesc=RemoveQuotes(tokens[6]); | |
323 pInfos[i].pExpertSkillDesc=RemoveQuotes(tokens[7]); | |
324 pInfos[i].pMasterSkillDesc=RemoveQuotes(tokens[8]); | |
325 pInfos[i].pGrandmasterSkillDesc=RemoveQuotes(tokens[9]); | |
326 pSpellDatas[i].stats |= strchr(tokens[10], 'm') || strchr(tokens[10], 'M') ? 1 : 0; | |
327 pSpellDatas[i].stats |= strchr(tokens[10], 'e') || strchr(tokens[10], 'E') ? 2 : 0; | |
328 pSpellDatas[i].stats |= strchr(tokens[10], 'c') || strchr(tokens[10], 'C') ? 4 : 0; | |
329 pSpellDatas[i].stats |= strchr(tokens[10], 'x') || strchr(tokens[10], 'X') ? 8 : 0; | |
330 if ((i % 11)==0) | |
331 strtok(NULL, "\r"); | |
332 } | |
191 | 333 |
2282 | 334 } |
1295 | 335 //----- (00448DF8) -------------------------------------------------------- |
1519 | 336 void __fastcall EventCastSpell(int uSpellID, int uSkillLevel, int uSkill, int fromx, int fromy, int fromz, int tox, int toy, int toz)//sub_448DF8 |
1295 | 337 { |
338 int v9; // esi@1 | |
339 double v10; // st7@4 | |
340 double v11; // st6@4 | |
341 double v12; // st5@4 | |
342 double v13; // st7@6 | |
343 int v14; // ST44_4@7 | |
344 signed int v15; // ebx@9 | |
345 signed int v16; // edx@15 | |
346 char *v17; // ecx@16 | |
347 unsigned __int16 v18; // ax@20 | |
348 char *v19; // ecx@31 | |
349 int v20; // edx@35 | |
350 signed int v21; // edx@37 | |
351 char *v22; // ecx@38 | |
352 unsigned __int16 v23; // ax@41 | |
353 int i; // esi@42 | |
354 signed int v25; // edx@55 | |
355 char *v26; // ecx@56 | |
356 unsigned __int16 v27; // ax@59 | |
357 int j; // esi@60 | |
358 signed int v29; // edx@66 | |
359 char *v30; // ecx@67 | |
360 unsigned __int16 v31; // ax@70 | |
361 //Player *v32; // eax@80 | |
362 //unsigned __int16 v33; // si@85 | |
363 int v34; // eax@96 | |
364 int v35; // eax@97 | |
365 unsigned __int64 v36; // qax@99 | |
366 SpellBuff *v37; // ecx@99 | |
367 int v38; // esi@103 | |
368 signed __int64 v39; // qax@105 | |
369 int v40; // ebx@108 | |
370 int v41; // ebx@109 | |
371 int v42; // esi@111 | |
372 int v43; // ebx@111 | |
373 int v44; // eax@117 | |
374 //unsigned __int16 v45; // si@137 | |
375 unsigned __int16 v46; // [sp-8h] [bp-BCh]@99 | |
376 int v47; // [sp-4h] [bp-B8h]@35 | |
377 unsigned __int16 v48; // [sp-4h] [bp-B8h]@99 | |
378 int v49; // [sp+0h] [bp-B4h]@35 | |
379 int v50; // [sp+0h] [bp-B4h]@99 | |
380 int v51; // [sp+4h] [bp-B0h]@35 | |
381 unsigned __int8 v52; // [sp+4h] [bp-B0h]@99 | |
382 float v53; // [sp+14h] [bp-A0h]@4 | |
383 float v54; // [sp+18h] [bp-9Ch]@4 | |
384 int v55; // [sp+28h] [bp-8Ch]@7 | |
385 unsigned int yaw; // [sp+30h] [bp-84h]@7 | |
386 int pitch; // [sp+34h] [bp-80h]@7 | |
387 //SpriteObject a1; // [sp+38h] [bp-7Ch]@12 | |
388 int v59; // [sp+A8h] [bp-Ch]@1 | |
389 int v60; // [sp+ACh] [bp-8h]@1 | |
390 //int spellnum_; // [sp+B0h] [bp-4h]@1 | |
391 //signed int levela; // [sp+BCh] [bp+8h]@80 | |
392 int a6_4; // [sp+C8h] [bp+14h]@117 | |
393 float a7a; // [sp+CCh] [bp+18h]@6 | |
394 signed int a7b; // [sp+CCh] [bp+18h]@12 | |
395 int a7c; // [sp+CCh] [bp+18h]@29 | |
396 int a7d; // [sp+CCh] [bp+18h]@55 | |
397 float a8a; // [sp+D0h] [bp+1Ch]@6 | |
398 int a8b; // [sp+D0h] [bp+1Ch]@37 | |
399 int a8c; // [sp+D0h] [bp+1Ch]@55 | |
400 float toza; // [sp+D4h] [bp+20h]@6 | |
401 | |
402 v9 = 0; | |
403 v59 = uSkillLevel + 1; | |
1519 | 404 //spellnum_ = uSpellID; |
1295 | 405 v60 = 0; |
406 if ( tox || toy || toz ) | |
407 { | |
408 v10 = (double)tox - (double)fromx; | |
409 v53 = v10; | |
410 v11 = (double)toy - (double)fromy; | |
411 v54 = v11; | |
412 v12 = (double)toz; | |
413 } | |
414 else | |
415 { | |
416 v10 = (double)pParty->vPosition.x - (double)fromx; | |
417 v53 = v10; | |
418 v11 = (double)pParty->vPosition.y - (double)fromy; | |
419 v54 = v11; | |
420 v12 = (double)(pParty->vPosition.z + pParty->sEyelevel); | |
421 } | |
422 a7a = v12 - (double)fromz; | |
423 toza = v11 * v11; | |
424 a8a = v10 * v10; | |
425 v13 = sqrt(a7a * a7a + a8a + toza); | |
426 if ( v13 <= 1.0 ) | |
427 { | |
428 LOBYTE(v55) = 1; | |
429 yaw = 0; | |
430 pitch = 0; | |
431 } | |
432 else | |
433 { | |
434 v55 = (signed __int64)v13; | |
435 v14 = (signed __int64)sqrt(a8a + toza); | |
436 yaw = stru_5C6E00->Atan2((signed __int64)v53, (signed __int64)v54); | |
437 pitch = stru_5C6E00->Atan2(v14, (signed __int64)a7a); | |
438 } | |
439 v15 = v59; | |
440 if ( v59 <= 0 || v59 > 4 ) | |
441 v15 = 1; | |
442 a7b = v15; | |
443 | |
444 SpriteObject a1; // [sp+38h] [bp-7Ch]@12 | |
445 //SpriteObject::SpriteObject(&a1); | |
446 | |
1519 | 447 a1.uType = stru_4E3ACC[uSpellID].uType; |
448 if ( uSpellID > 58 ) | |
1295 | 449 { |
2101 | 450 if ( uSpellID == SPELL_BODY_PROTECTION_FROM_BODY ) |
1295 | 451 goto LABEL_117; |
2101 | 452 if ( uSpellID != SPELL_LIGHT_DAY_OF_THE_GODS ) |
1295 | 453 return; |
454 v40 = v15 - 2; | |
455 if ( v40 ) | |
456 { | |
457 v41 = v40 - 1; | |
458 if ( !v41 ) | |
459 { | |
460 v42 = 14400 * uSkill; | |
461 v43 = 4 * uSkill + 10; | |
462 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 0); | |
463 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 1u); | |
464 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 2u); | |
465 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 3u); | |
466 v39 = (signed __int64)((double)(v42 << 7) * 0.033333335); | |
467 v37 = &pParty->pPartyBuffs[PARTY_BUFF_DAY_OF_GODS]; | |
468 v36 = pParty->uTimePlayed + v39; | |
469 v37->Apply(v36, a7b, v43, 0, 0); | |
2101 | 470 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0); |
471 return; | |
1295 | 472 } |
473 if ( v41 == 1 ) | |
474 { | |
475 v42 = 18000 * uSkill; | |
476 v43 = 5 * uSkill + 10; | |
477 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 0); | |
478 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 1u); | |
479 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 2u); | |
480 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 3u); | |
481 v39 = (signed __int64)((double)(v42 << 7) * 0.033333335); | |
482 v37 = &pParty->pPartyBuffs[PARTY_BUFF_DAY_OF_GODS]; | |
483 v36 = pParty->uTimePlayed + v39; | |
484 v37->Apply(v36, a7b, v43, 0, 0); | |
2101 | 485 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0); |
486 return; | |
1295 | 487 } |
488 } | |
489 v42 = 10800 * uSkill; | |
490 v43 = 3 * uSkill + 10; | |
491 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 0); | |
492 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 1u); | |
493 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 2u); | |
494 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 3u); | |
495 v39 = (signed __int64)((double)(v42 << 7) * 0.033333335); | |
496 v37 = &pParty->pPartyBuffs[PARTY_BUFF_DAY_OF_GODS]; | |
497 v36 = pParty->uTimePlayed + v39; | |
498 v37->Apply(v36, a7b, v43, 0, 0); | |
2101 | 499 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0); |
500 return; | |
1295 | 501 } |
1519 | 502 if ( uSpellID != 58 ) |
1295 | 503 { |
1519 | 504 switch ( uSpellID ) |
1295 | 505 { |
2101 | 506 case SPELL_FIRE_FIRE_BOLT: |
507 case SPELL_FIRE_FIREBALL: | |
508 case SPELL_AIR_LIGHNING_BOLT: | |
509 case SPELL_WATER_ICE_BOLT: | |
510 case SPELL_WATER_ACID_BURST: | |
511 case SPELL_WATER_ICE_BLAST: | |
512 case SPELL_EARTH_BLADES: | |
513 case SPELL_EARTH_ROCK_BLAST: | |
1295 | 514 a1.stru_24.Reset(); |
515 v16 = 0; | |
1519 | 516 a1.spell_id = uSpellID; |
1295 | 517 a1.spell_level = uSkill; |
518 a1.spell_skill = v15; | |
519 if ( (signed int)pObjectList->uNumObjects <= 0 ) | |
520 { | |
2101 | 521 //v18 = 0; |
522 a1.uObjectDescID = 0; | |
1295 | 523 *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy); |
524 a1.vPosition.x = fromx; | |
525 a1.uAttributes = 16; | |
526 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz); | |
527 a1.field_60_distance_related_prolly_lod = v55; | |
2101 | 528 //v20 = yaw; |
1295 | 529 a1.uSpriteFrameID = 0; |
530 a1.spell_caster_pid = 8000 | OBJECT_Item; | |
531 a1.spell_target_pid = 0; | |
532 a1.uFacing = yaw; | |
533 a1.uSoundID = 0; | |
534 v49 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; | |
2101 | 535 a1.Create(yaw, pitch, v49, 0); |
536 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0); | |
537 return; | |
1295 | 538 } |
539 v17 = (char *)&pObjectList->pObjects->uObjectID; | |
540 while ( (short)a1.uType != *(short *)v17 ) | |
541 { | |
542 ++v16; | |
543 v17 += 56; | |
544 if ( v16 >= (signed int)pObjectList->uNumObjects ) | |
545 { | |
2101 | 546 //v18 = 0; |
547 a1.uObjectDescID = 0; | |
1295 | 548 *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy); |
549 a1.vPosition.x = fromx; | |
550 a1.uAttributes = 16; | |
551 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz); | |
552 a1.field_60_distance_related_prolly_lod = v55; | |
2101 | 553 //v20 = yaw; |
1295 | 554 a1.uSpriteFrameID = 0; |
555 a1.spell_caster_pid = 8000 | OBJECT_Item; | |
556 a1.spell_target_pid = 0; | |
557 a1.uFacing = yaw; | |
558 a1.uSoundID = 0; | |
559 v49 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; | |
2101 | 560 a1.Create(yaw, pitch, v49, 0); |
561 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0); | |
562 return; | |
1295 | 563 } |
564 } | |
565 v18 = v16; | |
566 a1.uObjectDescID = v18; | |
567 *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy); | |
568 a1.vPosition.x = fromx; | |
569 a1.uAttributes = 16; | |
570 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz); | |
571 a1.field_60_distance_related_prolly_lod = v55; | |
2101 | 572 //v20 = yaw; |
1295 | 573 a1.uSpriteFrameID = 0; |
574 a1.spell_caster_pid = 8000 | OBJECT_Item; | |
575 a1.spell_target_pid = 0; | |
576 a1.uFacing = yaw; | |
577 a1.uSoundID = 0; | |
578 v49 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; | |
2101 | 579 a1.Create(yaw, pitch, v49, 0); |
580 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0); | |
581 return; | |
582 case SPELL_WATER_POISON_SPRAY: | |
1295 | 583 switch ( v15 ) |
584 { | |
585 case 1: | |
586 v60 = 1; | |
587 break; | |
588 case 2: | |
589 v60 = 3; | |
590 break; | |
591 case 3: | |
592 v60 = 5; | |
593 break; | |
594 case 4: | |
595 v60 = 7; | |
596 break; | |
597 } | |
598 a7c = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360; | |
599 if ( v60 != 1 ) | |
600 { | |
601 a8b = a7c / (v60 - 1); | |
602 a1.stru_24.Reset(); | |
603 v21 = 0; | |
1519 | 604 a1.spell_id = uSpellID; |
1295 | 605 a1.spell_level = uSkill; |
606 a1.spell_skill = v15; | |
607 if ( (signed int)pObjectList->uNumObjects <= 0 ) | |
608 v23 = 0; | |
609 else | |
610 { | |
611 v22 = (char *)&pObjectList->pObjects->uObjectID; | |
612 while ( (short)a1.uType != *(short *)v22 ) | |
613 { | |
614 ++v21; | |
615 v22 += 56; | |
616 if ( v21 >= (signed int)pObjectList->uNumObjects ) | |
617 { | |
618 v23 = 0; | |
619 a1.uObjectDescID = v23; | |
620 *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy); | |
621 a1.vPosition.x = fromx; | |
622 a1.uAttributes = 16; | |
623 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz); | |
624 a1.field_60_distance_related_prolly_lod = v55; | |
625 a1.uSpriteFrameID = 0; | |
626 a1.spell_caster_pid = 8000 | OBJECT_Item; | |
627 a1.spell_target_pid = 4; | |
628 a1.uSoundID = 0; | |
629 for ( i = a7c / -2; i <= a7c / 2; i += a8b ) | |
630 { | |
631 a1.uFacing = i + yaw; | |
632 a1.Create((signed __int16)(i + (short)yaw), pitch, pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, 0); | |
633 } | |
2101 | 634 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0); |
635 return; | |
1295 | 636 } |
637 } | |
638 v23 = v21; | |
639 } | |
640 a1.uObjectDescID = v23; | |
641 *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy); | |
642 a1.vPosition.x = fromx; | |
643 a1.uAttributes = 16; | |
644 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz); | |
645 a1.field_60_distance_related_prolly_lod = v55; | |
646 a1.uSpriteFrameID = 0; | |
647 a1.spell_caster_pid = 8000 | OBJECT_Item; | |
648 a1.spell_target_pid = 4; | |
649 a1.uSoundID = 0; | |
650 for ( i = a7c / -2; i <= a7c / 2; i += a8b ) | |
651 { | |
652 a1.uFacing = i + yaw; | |
653 a1.Create((signed __int16)(i + (short)yaw), pitch, pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, 0); | |
654 } | |
2101 | 655 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0); |
656 return; | |
1295 | 657 } |
658 a1.stru_24.Reset(); | |
1519 | 659 a1.spell_id = uSpellID; |
1295 | 660 a1.spell_level = uSkill; |
661 a1.spell_skill = v15; | |
662 if ( (signed int)pObjectList->uNumObjects <= 0 ) | |
663 { | |
2101 | 664 //v18 = 0; |
665 a1.uObjectDescID = 0; | |
666 *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy); | |
667 a1.vPosition.x = fromx; | |
668 a1.uAttributes = 16; | |
669 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz); | |
670 a1.field_60_distance_related_prolly_lod = v55; | |
671 //v20 = yaw; | |
672 a1.uSpriteFrameID = 0; | |
673 a1.spell_caster_pid = 8000 | OBJECT_Item; | |
674 a1.spell_target_pid = 0; | |
675 a1.uFacing = yaw; | |
676 a1.uSoundID = 0; | |
677 //v51 = 0; | |
678 v49 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; | |
679 //v47 = pitch; | |
680 a1.Create(yaw, pitch, v49, 0); | |
681 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0); | |
682 return; | |
683 } | |
684 //v19 = (char *)&pObjectList->pObjects->uObjectID; | |
685 for ( v16 = 0; v16 < (signed int)pObjectList->uNumObjects; ++v16 ) | |
686 { | |
687 if ( (short)a1.uType == pObjectList->pObjects[v16].uObjectID ) | |
1295 | 688 { |
2101 | 689 //v18 = v16; |
690 a1.uObjectDescID = v16; | |
1295 | 691 *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy); |
692 a1.vPosition.x = fromx; | |
693 a1.uAttributes = 16; | |
694 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz); | |
695 a1.field_60_distance_related_prolly_lod = v55; | |
2101 | 696 //v20 = yaw; |
1295 | 697 a1.uSpriteFrameID = 0; |
698 a1.spell_caster_pid = 8000 | OBJECT_Item; | |
699 a1.spell_target_pid = 0; | |
700 a1.uFacing = yaw; | |
701 a1.uSoundID = 0; | |
2101 | 702 //v51 = 0; |
1295 | 703 v49 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; |
2101 | 704 //v47 = pitch; |
705 a1.Create(yaw, pitch, v49, 0); | |
706 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0); | |
707 return; | |
1295 | 708 } |
2101 | 709 //v19 += 56; |
1295 | 710 } |
2101 | 711 //v18 = 0; |
712 a1.uObjectDescID = 0; | |
1295 | 713 *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy); |
714 a1.vPosition.x = fromx; | |
715 a1.uAttributes = 16; | |
716 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz); | |
717 a1.field_60_distance_related_prolly_lod = v55; | |
2101 | 718 //v20 = yaw; |
1295 | 719 a1.uSpriteFrameID = 0; |
720 a1.spell_caster_pid = 8000 | OBJECT_Item; | |
721 a1.spell_target_pid = 0; | |
722 a1.uFacing = yaw; | |
723 a1.uSoundID = 0; | |
2101 | 724 //v51 = 0; |
1295 | 725 v49 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; |
2101 | 726 //v47 = pitch; |
727 a1.Create(yaw, pitch, v49, 0); | |
728 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0); | |
729 return; | |
730 case SPELL_AIR_SPARKS: | |
1295 | 731 switch ( v15 ) |
732 { | |
733 case 1: | |
734 v60 = 3; | |
735 break; | |
736 case 2: | |
737 v60 = 5; | |
738 break; | |
739 case 3: | |
740 v60 = 7; | |
741 break; | |
742 case 4: | |
743 v60 = 9; | |
744 break; | |
745 } | |
746 a7d = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360; | |
747 a8c = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360 / (v60 - 1); | |
748 a1.stru_24.Reset(); | |
749 v25 = 0; | |
1519 | 750 a1.spell_id = uSpellID; |
1295 | 751 a1.spell_level = uSkill; |
752 a1.spell_skill = v15; | |
753 if ( (signed int)pObjectList->uNumObjects <= 0 ) | |
754 { | |
2101 | 755 //v27 = 0; |
756 a1.uObjectDescID = 0; | |
1295 | 757 *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy); |
758 a1.vPosition.x = fromx; | |
759 a1.uAttributes = 16; | |
760 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz); | |
761 a1.field_60_distance_related_prolly_lod = v55; | |
762 a1.uSpriteFrameID = 0; | |
763 a1.spell_caster_pid = 8000 | OBJECT_Item; | |
764 a1.spell_target_pid = 4; | |
765 a1.uSoundID = 0; | |
766 for ( j = a7d / -2; j <= a7d / 2; j += a8c ) | |
767 { | |
768 a1.uFacing = j + yaw; | |
769 a1.Create((signed __int16)(j + (short)yaw), pitch, pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, 0); | |
770 } | |
2101 | 771 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0); |
772 return; | |
1295 | 773 } |
774 v26 = (char *)&pObjectList->pObjects->uObjectID; | |
775 while ( (short)a1.uType != *(short *)v26 ) | |
776 { | |
777 ++v25; | |
778 v26 += 56; | |
779 if ( v25 >= (signed int)pObjectList->uNumObjects ) | |
780 { | |
781 v27 = 0; | |
782 a1.uObjectDescID = v27; | |
783 *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy); | |
784 a1.vPosition.x = fromx; | |
785 a1.uAttributes = 16; | |
786 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz); | |
787 a1.field_60_distance_related_prolly_lod = v55; | |
788 a1.uSpriteFrameID = 0; | |
789 a1.spell_caster_pid = 8000 | OBJECT_Item; | |
790 a1.spell_target_pid = 4; | |
791 a1.uSoundID = 0; | |
792 for ( j = a7d / -2; j <= a7d / 2; j += a8c ) | |
793 { | |
794 a1.uFacing = j + yaw; | |
795 a1.Create((signed __int16)(j + (short)yaw), pitch, pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, 0); | |
796 } | |
2101 | 797 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0); |
798 return; | |
1295 | 799 } |
800 } | |
801 v27 = v25; | |
802 a1.uObjectDescID = v27; | |
803 *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy); | |
804 a1.vPosition.x = fromx; | |
805 a1.uAttributes = 16; | |
806 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz); | |
807 a1.field_60_distance_related_prolly_lod = v55; | |
808 a1.uSpriteFrameID = 0; | |
809 a1.spell_caster_pid = 8000 | OBJECT_Item; | |
810 a1.spell_target_pid = 4; | |
811 a1.uSoundID = 0; | |
812 for ( j = a7d / -2; j <= a7d / 2; j += a8c ) | |
813 { | |
814 a1.uFacing = j + yaw; | |
2101 | 815 a1.Create((signed __int16)(j + (short)yaw), pitch, |
816 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, 0); | |
1295 | 817 } |
2101 | 818 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0); |
819 return; | |
820 case SPELL_EARTH_DEATH_BLOSSOM: | |
1295 | 821 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor ) |
822 return; | |
823 a1.stru_24.Reset(); | |
824 v29 = 0; | |
1519 | 825 a1.spell_id = uSpellID; |
1295 | 826 a1.spell_level = uSkill; |
827 a1.spell_skill = v15; | |
828 if ( (signed int)pObjectList->uNumObjects <= 0 ) | |
829 { | |
2101 | 830 //v31 = 0; |
831 a1.uObjectDescID = 0; | |
1295 | 832 *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy); |
833 a1.vPosition.x = fromx; | |
834 a1.uAttributes = 16; | |
835 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz); | |
836 a1.field_60_distance_related_prolly_lod = v55; | |
837 a1.uSpriteFrameID = 0; | |
838 a1.spell_caster_pid = 8000 | OBJECT_Item; | |
839 a1.spell_target_pid = 4; | |
840 a1.uSoundID = 0; | |
2101 | 841 //v51 = 0; |
1295 | 842 v49 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; |
2101 | 843 //v20 = yaw; |
1295 | 844 v47 = (signed int)stru_5C6E00->uIntegerHalfPi / 2; |
2101 | 845 a1.Create(yaw, v47, v49, 0); |
846 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0); | |
847 return; | |
1295 | 848 } |
849 v30 = (char *)&pObjectList->pObjects->uObjectID; | |
850 break; | |
851 | |
852 case SPELL_FIRE_HASTE: | |
853 if ( v15 > 0 ) | |
854 { | |
855 if ( v15 <= 2 ) | |
856 v9 = 60 * (uSkill + 60); | |
2106 | 857 else if ( v15 == 3 ) |
858 v9 = 180 * (uSkill + 20); | |
859 else if ( v15 == 4 ) | |
860 v9 = 240 * (uSkill + 15); | |
1295 | 861 } |
862 //levela = 1; | |
863 //v32 = pParty->pPlayers;//[0].pConditions[1]; | |
864 //do | |
865 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
|
866 if (pParty->pPlayers[i].IsWeak()) |
1295 | 867 return; |
868 //while ( v32 <= &pParty->pPlayers[3] ); | |
869 //if ( !levela ) | |
870 // return; | |
871 pParty->pPartyBuffs[PARTY_BUFF_HASTE].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(v9 * 128) * 0.033333335), | |
2101 | 872 v15, 0, 0, 0); |
1295 | 873 //v33 = spellnum_; |
1519 | 874 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 0); |
875 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 1); | |
876 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 2); | |
877 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 3); | |
2105 | 878 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0);//çâóê àëòàðÿ |
2101 | 879 return; |
880 case SPELL_AIR_SHIELD: | |
881 case SPELL_EARTH_STONESKIN: | |
882 case SPELL_SPIRIT_HEROISM: | |
1295 | 883 switch ( v15 ) |
884 { | |
885 case 1: | |
886 case 2: | |
887 v9 = 300 * (uSkill + 12); | |
888 break; | |
889 case 3: | |
890 v9 = 900 * (uSkill + 4); | |
891 break; | |
892 case 4: | |
893 v9 = 3600 * (uSkill + 1); | |
894 break; | |
895 } | |
1519 | 896 switch ( uSpellID ) |
1295 | 897 { |
898 case 17: | |
899 v60 = 0; | |
900 uSkill = 14; | |
901 break; | |
902 case 38: | |
903 v35 = uSkill + 5; | |
904 uSkill = 15; | |
905 v60 = v35; | |
906 break; | |
907 case 51: | |
908 v34 = uSkill + 5; | |
909 uSkill = 9; | |
910 v60 = v34; | |
911 break; | |
912 } | |
1519 | 913 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 0); |
914 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 1); | |
915 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 2); | |
916 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 3); | |
2101 | 917 //v52 = 0; |
918 //v50 = 0; | |
919 //v48 = v60; | |
920 //v46 = v15; | |
1295 | 921 v36 = pParty->uTimePlayed + (signed int)(signed __int64)((double)(v9 << 7) * 0.033333335); |
2101 | 922 //v37 = &pParty->pPartyBuffs[uSkill]; |
923 pParty->pPartyBuffs[uSkill].Apply(v36, v15, v60, 0, 0); | |
924 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0); | |
925 return; | |
926 case SPELL_FIRE_IMMOLATION: | |
1295 | 927 if ( v15 == 2 || v15 == 3 || v15 != 4 ) |
928 v38 = 60 * uSkill; | |
929 else | |
930 v38 = 600 * uSkill; | |
1519 | 931 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 0); |
932 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 1); | |
933 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 2); | |
934 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 3); | |
1295 | 935 v52 = 0; |
936 v50 = 0; | |
937 v48 = uSkill; | |
938 v46 = v15; | |
939 v39 = (signed __int64)((double)(v38 << 7) * 0.033333335); | |
940 v37 = &pParty->pPartyBuffs[PARTY_BUFF_IMMOLATION]; | |
941 v36 = pParty->uTimePlayed + v39; | |
942 v37->Apply(v36, v46, v48, v50, v52); | |
2101 | 943 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0); |
944 return; | |
945 case SPELL_FIRE_PROTECTION_FROM_FIRE: | |
946 case SPELL_AIR_PROTECTION_FROM_AIR: | |
947 case SPELL_WATER_PROTECTION_FROM_WATER: | |
948 case SPELL_EARTH_PROTECTION_FROM_EARTH: | |
1295 | 949 goto LABEL_117; |
950 default: | |
951 return; | |
952 } | |
953 while ( (short)a1.uType != *(short *)v30 ) | |
954 { | |
955 ++v29; | |
956 v30 += 56; | |
957 if ( v29 >= (signed int)pObjectList->uNumObjects ) | |
958 { | |
2101 | 959 //v31 = 0; |
960 a1.uObjectDescID = 0; | |
1295 | 961 *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy); |
962 a1.vPosition.x = fromx; | |
963 a1.uAttributes = 16; | |
964 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz); | |
965 a1.field_60_distance_related_prolly_lod = v55; | |
966 a1.uSpriteFrameID = 0; | |
967 a1.spell_caster_pid = 8000 | OBJECT_Item; | |
968 a1.spell_target_pid = 4; | |
969 a1.uSoundID = 0; | |
2101 | 970 //v51 = 0; |
1295 | 971 v49 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; |
2101 | 972 //v20 = yaw; |
1295 | 973 v47 = (signed int)stru_5C6E00->uIntegerHalfPi / 2; |
2101 | 974 a1.Create(yaw, v47, v49, 0); |
975 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0); | |
976 return; | |
1295 | 977 } |
978 } | |
979 v31 = v29; | |
980 a1.uObjectDescID = v31; | |
981 *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy); | |
982 a1.vPosition.x = fromx; | |
983 a1.uAttributes = 16; | |
984 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz); | |
985 a1.field_60_distance_related_prolly_lod = v55; | |
986 a1.uSpriteFrameID = 0; | |
987 a1.spell_caster_pid = 8000 | OBJECT_Item; | |
988 a1.spell_target_pid = 4; | |
989 a1.uSoundID = 0; | |
2101 | 990 //v51 = 0; |
1295 | 991 v49 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; |
2101 | 992 //v20 = yaw; |
1295 | 993 v47 = (signed int)stru_5C6E00->uIntegerHalfPi / 2; |
2101 | 994 a1.Create(yaw, v47, v49, 0); |
995 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0); | |
996 return; | |
1295 | 997 } |
998 LABEL_117: | |
999 v44 = uSkill; | |
1000 a6_4 = 3600 * uSkill; | |
1001 if ( v15 == 1 ) | |
1002 { | |
1003 v60 = v44; | |
1004 goto LABEL_125; | |
1005 } | |
1006 if ( v15 == 2 ) | |
1007 { | |
1008 v44 = 2 * uSkill; | |
1009 v60 = v44; | |
1010 goto LABEL_125; | |
1011 } | |
1012 if ( v15 == 3 ) | |
1013 { | |
1014 v44 = 3 * uSkill; | |
1015 v60 = v44; | |
1016 goto LABEL_125; | |
1017 } | |
1018 if ( v15 == 4 ) | |
1019 { | |
1020 v44 = 4 * uSkill; | |
1021 v60 = v44; | |
1022 goto LABEL_125; | |
1023 } | |
1024 LABEL_125: | |
1519 | 1025 switch ( uSpellID ) |
1295 | 1026 { |
1027 case 3: | |
1028 uSkill = 6; | |
1029 break; | |
1030 case 14: | |
1031 uSkill = 0; | |
1032 break; | |
1033 case 25: | |
1034 uSkill = 17; | |
1035 break; | |
1036 case 36: | |
1037 uSkill = 4; | |
1038 break; | |
1039 case 58: | |
1040 uSkill = 12; | |
1041 break; | |
1042 case 69: | |
1043 uSkill = 1; | |
1044 break; | |
1045 } | |
1046 //v45 = spellnum_; | |
1519 | 1047 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 0); |
1048 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 1); | |
1049 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 2); | |
1050 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 3); | |
1295 | 1051 pParty->pPartyBuffs[uSkill].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)a6_4 * 4.2666669), v15, v60, 0, 0); |
1052 //levela = 1; | |
2101 | 1053 //LABEL_138: |
1295 | 1054 //if ( levela ) |
2101 | 1055 //LABEL_139: |
1519 | 1056 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0); |
1296 | 1057 } |
1058 //----- (00427769) -------------------------------------------------------- | |
2107
85e9766d6124
sub_427769_spell to sub_427769_isSpellQuickCastableOnShiftClick
Grumpy7
parents:
2037
diff
changeset
|
1059 bool sub_427769_isSpellQuickCastableOnShiftClick(unsigned int uSpellID) |
1296 | 1060 { |
2107
85e9766d6124
sub_427769_spell to sub_427769_isSpellQuickCastableOnShiftClick
Grumpy7
parents:
2037
diff
changeset
|
1061 return ( pSpellDatas[uSpellID].stats & 0xC ); |
1297 | 1062 } |
1063 //----- (0043AFE3) -------------------------------------------------------- | |
1064 int __fastcall _43AFE3_calc_spell_damage(int a1, int a2, signed int a3, int a4) | |
1065 { | |
1066 int result; // eax@1 | |
1067 unsigned int v5; // [sp-4h] [bp-8h]@9 | |
1068 | |
1069 result = 0; | |
1070 if ( a1 == 7 ) | |
1071 { | |
1072 if ( a3 <= 0 ) | |
1073 return result; | |
1074 if ( a3 <= 2 ) | |
1075 { | |
1076 v5 = 6; | |
1077 } | |
1078 else | |
1079 { | |
1080 if ( a3 == 3 ) | |
1081 { | |
1082 v5 = 8; | |
1083 } | |
1084 else | |
1085 { | |
1086 if ( a3 != 4 ) | |
1087 return result; | |
1088 v5 = 10; | |
1089 } | |
1090 } | |
1091 result = GetDiceResult(a2, v5); | |
1092 } | |
1093 else | |
1094 { | |
1095 if ( a1 == 44 ) | |
1096 result = a4 * (LOBYTE(pSpellDatas[40].field_10) + 2 * a2) / 100; | |
1097 else | |
1098 result = *((char *)&pSpellDatas[0].field_10 + 20 * a1) | |
1099 + GetDiceResult(a2, *((char *)&pSpellDatas[0].field_10 + 20 * a1 + 1)); | |
1100 } | |
1101 return result; | |
1295 | 1102 } |