World of Might and Magic  0.2.0
Open reimplementation of Might and Magic 6 7 8 game engine
Spells.cpp
См. документацию.
1 #include "Engine/Spells/Spells.h"
2 
3 #include <map>
4 #include <vector>
5 
6 #include "Engine/Engine.h"
9 #include "Engine/LOD.h"
10 #include "Engine/Objects/Actor.h"
13 #include "Engine/SpellFxRenderer.h"
14 
15 #include "../OurMath.h"
16 #include "../Party.h"
17 
19 
21 
23 
24 std::array<TownPortalData, 6> TownPortalList = // 4ECBB8
25  {{{Vec3_int_(-5121, 2107, 1), 1536, 0, 21, 0},
26  {Vec3_int_(-15148, -10240, 1473), 0, 0, 4, 0},
27  {Vec3_int_(-10519, 5375, 753), 512, 0, 3, 0},
28  {Vec3_int_(3114, -11055, 513), 0, 0, 10, 0},
29  {Vec3_int_(-158, 7624, 1), 512, 0, 7, 0},
30  {Vec3_int_(-1837, -4247, 65), 65, 0, 8, 0}}};
31 
32 struct SpellStats *pSpellStats = nullptr;
33 
34 std::array<stru324_spell_id_to_sprite_mapping, 103>
36  {{{SPRITE_SPELL_0, 0},
48 
60 
72 
84 
96 
108 
120 
132 
144 
148 
149 SpellData::SpellData(__int16 innormalMana, __int16 inExpertLevelMana,
150  __int16 inMasterLevelMana, __int16 inMagisterLevelMana,
151  __int16 inNormalLevelRecovery,
152  __int16 inExpertLevelRecovery,
153  __int16 inMasterLevelRecovery,
154  __int16 inMagisterLevelRecovery, __int8 inbaseDamage,
155  __int8 inbonusSkillDamage, __int16 instats)
156  : uNormalLevelMana(innormalMana),
157  uExpertLevelMana(inExpertLevelMana),
158  uMasterLevelMana(inMasterLevelMana),
159  uMagisterLevelMana(inMagisterLevelMana),
160  uNormalLevelRecovery(inNormalLevelRecovery),
161  uExpertLevelRecovery(inExpertLevelRecovery),
162  uMasterLevelRecovery(inMasterLevelRecovery),
163  uMagisterLevelRecovery(inMagisterLevelRecovery),
164  baseDamage(inbaseDamage),
165  bonusSkillDamage(inbonusSkillDamage),
166  stats(instats) {}
167 
168 // 9 spellbook pages 11 spells per page 9*11 =99 +1 zero struct at 0. It
169 // counted from 1!
170 std::array<SpellData, 100> pSpellDatas = {
171  {SpellData(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
172  SpellData(1, 1, 1, 1, 60, 60, 60, 40, 0, 0, 0), // 0 fire
173  SpellData(2, 2, 2, 2, 110, 110, 100, 90, 3, 3, 0),
174  SpellData(3, 3, 3, 3, 120, 120, 120, 120, 0, 0, 0),
175  SpellData(4, 4, 4, 4, 120, 120, 120, 120, 0, 0, 0),
176  SpellData(5, 5, 5, 5, 120, 120, 120, 120, 0, 0, 0),
177  SpellData(8, 8, 8, 8, 100, 100, 90, 80, 0, 6, 0),
178  SpellData(10, 10, 10, 10, 150, 150, 150, 150, 0, 6, 0),
179  SpellData(15, 15, 15, 15, 120, 120, 120, 120, 0, 6, 0),
180  SpellData(20, 20, 20, 20, 100, 100, 100, 90, 8, 1, 0),
181  SpellData(25, 25, 25, 25, 100, 100, 100, 90, 12, 1, 0),
182  SpellData(30, 30, 30, 30, 90, 90, 90, 90, 15, 15, 0),
183 
184  SpellData(1, 1, 1, 0, 60, 60, 60, 60, 0, 0, 0), // 1 air
185  SpellData(2, 2, 2, 2, 120, 120, 120, 100, 0, 0, 0),
186  SpellData(3, 3, 3, 3, 120, 120, 120, 120, 0, 0, 0),
187  SpellData(4, 4, 4, 4, 110, 100, 90, 80, 2, 1, 0),
188  SpellData(5, 5, 5, 5, 90, 90, 70, 50, 0, 0, 0),
189  SpellData(8, 8, 8, 8, 120, 120, 120, 120, 0, 0, 0),
190  SpellData(10, 10, 10, 10, 100, 100, 90, 70, 0, 8, 0),
191  SpellData(15, 15, 15, 15, 200, 200, 200, 200, 0, 0, 0),
192  SpellData(20, 20, 20, 20, 100, 100, 100, 90, 10, 10, 0),
193  SpellData(25, 25, 25, 25, 250, 250, 250, 250, 0, 0, 0),
194  SpellData(30, 30, 30, 30, 90, 90, 90, 90, 20, 1, 0),
195 
196  SpellData(1, 1, 1, 1, 60, 60, 60, 20, 0, 0, 0), // 2 water
197  SpellData(2, 2, 2, 2, 110, 100, 90, 70, 2, 2, 0),
198  SpellData(3, 3, 3, 3, 120, 120, 120, 120, 0, 0, 0),
199  SpellData(4, 4, 4, 4, 110, 100, 90, 80, 0, 4, 0),
200  SpellData(5, 5, 5, 5, 150, 150, 150, 150, 0, 0, 0),
201  SpellData(8, 8, 8, 8, 200, 200, 200, 200, 0, 0, 0),
202  SpellData(10, 10, 10, 10, 100, 100, 90, 80, 9, 9, 0),
203  SpellData(15, 15, 15, 15, 140, 140, 140, 140, 0, 0, 0),
204  SpellData(20, 20, 20, 20, 200, 200, 200, 200, 0, 0, 0),
205  SpellData(25, 25, 25, 25, 80, 80, 80, 80, 12, 3, 0),
206  SpellData(30, 30, 30, 30, 250, 250, 250, 250, 0, 0, 0),
207 
208  SpellData(1, 1, 1, 1, 80, 80, 80, 80, 0, 0, 0), // 3 earth
209  SpellData(2, 2, 2, 2, 100, 100, 100, 100, 0, 0, 0),
210  SpellData(3, 3, 3, 3, 120, 120, 120, 120, 0, 0, 0),
211  SpellData(4, 4, 4, 4, 110, 100, 90, 80, 5, 3, 0),
212  SpellData(5, 5, 5, 5, 120, 120, 120, 120, 0, 0, 0),
213  SpellData(8, 8, 8, 8, 100, 100, 90, 80, 0, 9, 0),
214  SpellData(10, 10, 10, 10, 140, 140, 140, 140, 0, 0, 0),
215  SpellData(15, 15, 15, 15, 90, 90, 90, 80, 0, 8, 0),
216  SpellData(20, 20, 20, 20, 150, 150, 150, 150, 0, 0, 0),
217  SpellData(25, 25, 25, 25, 100, 100, 100, 90, 20, 1, 0),
218  SpellData(30, 30, 30, 30, 90, 90, 90, 90, 25, 0, 0),
219 
220  SpellData(1, 1, 1, 1, 100, 100, 100, 100, 0, 0, 0), // 4 spirit
221  SpellData(2, 2, 2, 2, 100, 100, 100, 100, 0, 0, 0),
222  SpellData(3, 3, 3, 3, 90, 90, 90, 90, 0, 0, 0),
223  SpellData(4, 4, 4, 4, 120, 120, 120, 120, 0, 0, 0),
224  SpellData(5, 5, 5, 5, 120, 120, 120, 120, 0, 0, 0),
225  SpellData(8, 8, 8, 8, 120, 120, 120, 120, 0, 0, 0),
226  SpellData(10, 10, 10, 10, 120, 120, 120, 120, 0, 0, 0),
227  SpellData(15, 15, 15, 15, 100, 100, 100, 100, 10, 8, 0),
228  SpellData(20, 20, 20, 20, 240, 240, 240, 240, 0, 0, 0),
229  SpellData(25, 25, 25, 25, 150, 150, 150, 150, 0, 0, 0),
230  SpellData(30, 30, 30, 30, 1000, 1000, 1000, 1000, 0, 0, 0),
231 
232  SpellData(1, 1, 1, 1, 120, 120, 120, 120, 0, 0, 0), // 5 mind
233  SpellData(2, 2, 2, 2, 110, 110, 110, 110, 3, 3, 0),
234  SpellData(3, 3, 3, 3, 120, 120, 120, 120, 0, 0, 0),
235  SpellData(4, 4, 4, 4, 110, 100, 90, 80, 0, 0, 0),
236  SpellData(5, 5, 5, 5, 100, 100, 100, 100, 0, 0, 0),
237  SpellData(8, 8, 8, 8, 120, 120, 120, 120, 0, 0, 0),
238  SpellData(10, 10, 10, 10, 120, 120, 120, 120, 0, 0, 0),
239  SpellData(15, 15, 15, 15, 80, 80, 80, 80, 0, 0, 0),
240  SpellData(20, 20, 20, 20, 120, 120, 120, 120, 0, 0, 0),
241  SpellData(25, 25, 25, 25, 110, 110, 110, 100, 12, 12, 0),
242  SpellData(30, 30, 30, 30, 120, 120, 120, 120, 0, 0, 0),
243 
244  SpellData(1, 1, 1, 1, 120, 120, 120, 120, 0, 0, 0), // 6 body
245  SpellData(2, 2, 2, 2, 100, 100, 100, 100, 0, 0, 0),
246  SpellData(3, 3, 3, 3, 120, 120, 120, 120, 0, 0, 0),
247  SpellData(4, 4, 4, 4, 110, 100, 90, 80, 8, 2, 0),
248  SpellData(5, 5, 5, 5, 110, 110, 110, 110, 0, 0, 0),
249  SpellData(8, 8, 8, 8, 120, 120, 120, 120, 0, 0, 0),
250  SpellData(10, 10, 10, 10, 120, 120, 120, 120, 0, 0, 0),
251  SpellData(15, 15, 15, 15, 120, 120, 120, 120, 0, 0, 0),
252  SpellData(20, 20, 20, 20, 120, 120, 120, 120, 0, 0, 0),
253  SpellData(25, 25, 25, 25, 110, 110, 110, 100, 30, 5, 0),
254  SpellData(30, 30, 30, 30, 100, 100, 100, 100, 0, 0, 0),
255 
256  SpellData(5, 5, 5, 5, 110, 100, 90, 80, 0, 4, 0), // 7 light
257  SpellData(10, 10, 10, 10, 120, 110, 100, 90, 16, 16, 0),
258  SpellData(15, 15, 15, 15, 120, 110, 100, 90, 0, 0, 0),
259  SpellData(20, 20, 20, 20, 160, 140, 120, 100, 0, 0, 0),
260  SpellData(25, 25, 25, 25, 140, 140, 140, 140, 0, 0, 0),
261  SpellData(30, 30, 30, 30, 500, 500, 500, 500, 0, 0, 0),
262  SpellData(35, 35, 35, 35, 135, 135, 120, 100, 25, 1, 0),
263  SpellData(40, 40, 40, 40, 500, 500, 500, 500, 0, 0, 0),
264  SpellData(45, 45, 45, 45, 250, 250, 250, 250, 0, 0, 0),
265  SpellData(50, 50, 50, 50, 150, 150, 150, 135, 20, 20, 0),
266  SpellData(55, 55, 55, 55, 300, 300, 300, 300, 0, 0, 0),
267 
268  SpellData(10, 10, 10, 10, 140, 140, 140, 140, 0, 0, 0), // 8 dark
269  SpellData(15, 15, 15, 15, 120, 110, 100, 90, 25, 10, 0),
270  SpellData(20, 20, 20, 20, 120, 100, 90, 120, 0, 0, 0),
271  SpellData(25, 25, 25, 25, 120, 120, 120, 120, 0, 0, 0),
272  SpellData(30, 30, 30, 30, 90, 90, 80, 70, 6, 6, 0),
273  SpellData(35, 35, 35, 35, 120, 120, 100, 80, 0, 0, 0),
274  SpellData(40, 40, 40, 40, 110, 110, 110, 110, 0, 0, 0),
275  SpellData(45, 45, 45, 45, 200, 200, 200, 150, 0, 0, 0),
276  SpellData(50, 50, 50, 50, 120, 120, 120, 100, 0, 25, 0),
277  SpellData(55, 55, 55, 55, 250, 250, 250, 250, 50, 1, 0),
278  SpellData(60, 60, 60, 60, 300, 300, 300, 300, 25, 8, 0)}};
279 
280 std::array<SPELL_TYPE, 25> wand_spell_ids = {{
281  // 135 Wand of Fire 136 Wand of Sparks 137 Wand of
282  // Poison 138 Wand of Stunning 139 Wand of Harm
285  // 140 Fairy Wand of Light 141 Fairy Wand of Ice 142 Fairy
286  // Wand of Lashing 143 Fairy Wand of Mind 144 Fairy Wand of
287  // Swarms
290  // 145 Alacorn Wand of Fireballs 146 Alacorn Wand of Acid 147 Alacorn
291  // Wand of Lightning 148 Alacorn Wand of Blades 149 Alacorn Wand of
292  // Charms
295  // 150 Arcane Wand of Blasting 151 Arcane Wand of The Fist 152 Arcane
296  // Wand of Rocks 153 Arcane Wand of Paralyzing 154 Arcane Wand of
297  // Clouds
300  // 155 Mystic Wand of Implosion 156 Mystic Wand of Distortion 157 Mystic
301  // Wand of Sharpmetal 158 Mystic Wand of Shrinking 159 Mystic Wand of
302  // Incineration
305 }};
306 
307 std::array<std::array<struct SpellBookIconPos, 12>, 9> pIconPos = {{
308  {{{0, 0}, {17, 13}, {115, 2}, {217, 15}, {299, 6}, {28, 125},
309  {130, 133}, {294, 114}, {11, 232}, {134, 233}, {237, 171}, {296, 231}}},
310 
311  {{{0, 0}, {19, 9}, {117, 3}, {206, 13}, {285, 7}, {16, 123},
312  {113, 101}, {201, 118}, {317, 110}, {11, 230}, {149, 236}, {296, 234}}},
313 
314  {{{0, 0}, {17, 9}, {140, 0}, {210, 34}, {293, 5}, {15, 98},
315  {78, 121}, {175, 136}, {301, 115}, {15, 226}, {154, 225}, {272, 220}}},
316 
317  {{{0, 0}, {7, 9}, {156, 2}, {277, 9}, {11, 117}, {111, 82},
318  {180, 102}, {303, 108}, {10, 229}, {120, 221}, {201, 217}, {296, 225}}},
319 
320  {{{0, 0}, {18, 8}, {89, 15}, {192, 14}, {292, 7}, {22, 129},
321  {125, 146}, {217, 136}, {305, 115}, {22, 226}, {174, 237}, {290, 231}}},
322 
323  {{{0, 0}, {18, 12}, {148, 9}, {292, 7}, {17, 122}, {121, 99},
324  {220, 87}, {293, 112}, {13, 236}, {128, 213}, {220, 223}, {315, 223}}},
325 
326  {{{0, 0}, {23, 14}, {127, 8}, {204, 0}, {306, 8}, {14, 115},
327  {122, 132}, {200, 116}, {293, 122}, {20, 228}, {154, 228}, {294, 239}}},
328 
329  {{{0, 0}, {19, 14}, {124, 10}, {283, 12}, {8, 105}, {113, 89},
330  {190, 82}, {298, 108}, {18, 181}, {101, 204}, {204, 203}, {285, 218}}},
331 
332  {{{0, 0}, {18, 17}, {110, 16}, {201, 15}, {307, 15}, {18, 148},
333  {125, 166}, {201, 123}, {275, 120}, {28, 235}, {217, 222}, {324, 216}}}
334 }};
335 
336 //----- (00458585) --------------------------------------------------------
338  uSkill = 0;
339  uPower = 0;
340  expire_time.Reset();
341  uCaster = 0;
342  uFlags = 0;
343  if (uOverlayID) {
345  pOtherOverlayList->bRedraw = true;
346  uOverlayID = 0;
347  }
348 }
349 
350 //----- (004585CA) --------------------------------------------------------
352  if (this->expire_time && (this->expire_time < time)) {
353  expire_time.Reset();
354  uPower = 0;
355  uSkill = 0;
356  uOverlayID = 0;
357  return true;
358  }
359  return false;
360 }
361 
362 //----- (004584E0) --------------------------------------------------------
363 bool SpellBuff::Apply(GameTime expire_time, unsigned __int16 uSkillLevel,
364  unsigned __int16 uPower, int uOverlayID,
365  unsigned __int8 caster) {
366  if (this->expire_time && (expire_time < this->expire_time)) {
367  return false;
368  }
369 
370  this->uSkill = uSkillLevel;
371  this->uPower = uPower;
372  this->expire_time = expire_time;
373  if (this->uOverlayID && this->uOverlayID != uOverlayID) {
374  pOtherOverlayList->pOverlays[this->uOverlayID - 1].Reset();
375  pOtherOverlayList->bRedraw = true;
376  this->uOverlayID = 0;
377  }
378  this->uOverlayID = uOverlayID;
379  this->uCaster = caster;
380 
381  return true;
382 }
383 
384 //----- (0045384A) --------------------------------------------------------
386  std::map<String, SPELL_SCHOOL, ci_less> spellSchoolMaps;
387  spellSchoolMaps["fire"] = SPELL_SCHOOL_FIRE;
388  spellSchoolMaps["air"] = SPELL_SCHOOL_AIR;
389  spellSchoolMaps["water"] = SPELL_SCHOOL_WATER;
390  spellSchoolMaps["earth"] = SPELL_SCHOOL_EARTH;
391  spellSchoolMaps["spirit"] = SPELL_SCHOOL_SPIRIT;
392  spellSchoolMaps["mind"] = SPELL_SCHOOL_MIND;
393  spellSchoolMaps["body"] = SPELL_SCHOOL_BODY;
394  spellSchoolMaps["light"] = SPELL_SCHOOL_LIGHT;
395  spellSchoolMaps["dark"] = SPELL_SCHOOL_DARK;
396  spellSchoolMaps["magic"] = SPELL_SCHOOL_MAGIC;
397 
398  char *test_string;
399 
400  free(pSpellsTXT_Raw);
401  pSpellsTXT_Raw = (char *)pEvents_LOD->LoadCompressedTexture("spells.txt");
402 
403  strtok(pSpellsTXT_Raw, "\r");
404  for (int i = 1; i < 100; ++i) {
405  if (((i % 11) - 1) == 0) strtok(NULL, "\r");
406  test_string = strtok(NULL, "\r") + 1;
407 
408  extern std::vector<char *> Tokenize(char *input, const char separator);
409  auto tokens = Tokenize(test_string, '\t');
410 
411  pInfos[i].pName = RemoveQuotes(tokens[2]);
412  auto findResult = spellSchoolMaps.find(tokens[3]);
413  pInfos[i].uSchool = findResult == spellSchoolMaps.end()
415  : findResult->second;
416  pInfos[i].pShortName = RemoveQuotes(tokens[4]);
417  pInfos[i].pDescription = RemoveQuotes(tokens[5]);
418  pInfos[i].pBasicSkillDesc = RemoveQuotes(tokens[6]);
419  pInfos[i].pExpertSkillDesc = RemoveQuotes(tokens[7]);
420  pInfos[i].pMasterSkillDesc = RemoveQuotes(tokens[8]);
421  pInfos[i].pGrandmasterSkillDesc = RemoveQuotes(tokens[9]);
422  pSpellDatas[i].stats |= strchr(tokens[10], 'm') || strchr(tokens[10], 'M') ? 1 : 0;
423  pSpellDatas[i].stats |= strchr(tokens[10], 'e') || strchr(tokens[10], 'E') ? 2 : 0;
424  pSpellDatas[i].stats |= strchr(tokens[10], 'c') || strchr(tokens[10], 'C') ? 4 : 0;
425  pSpellDatas[i].stats |= strchr(tokens[10], 'x') || strchr(tokens[10], 'X') ? 8 : 0;
426  }
427 }
428 
429 void EventCastSpell(int uSpellID, int uSkillLevel, int uSkill, int fromx,
430  int fromy, int fromz, int tox, int toy, int toz) {
431  unsigned int skillMasteryPlusOne = uSkillLevel + 1;
432  Assert(skillMasteryPlusOne > 0 && skillMasteryPlusOne <= 4,
433  "Invalid mastery level");
434 
435  int64_t x_coord_delta = 0;
436  int64_t y_coord_delta = 0;
437  int64_t z_coord_delta = 0;
438  if (tox || toy || toz) {
439  x_coord_delta = tox - fromx;
440  y_coord_delta = toy - fromy;
441  z_coord_delta = toz - fromz;
442  } else {
443  x_coord_delta = pParty->vPosition.x - fromx;
444  y_coord_delta = pParty->vPosition.y - fromy;
445  z_coord_delta = (pParty->vPosition.z + pParty->sEyelevel) - fromz;
446  }
447 
448  int yaw = 0;
449  int pitch = 0;
450  double distance_to_target = sqrt((long double)(
451  x_coord_delta * x_coord_delta + y_coord_delta * y_coord_delta +
452  z_coord_delta * z_coord_delta));
453  if (distance_to_target <= 1.0) {
454  distance_to_target = 1;
455  } else {
456  int64_t ySquared = y_coord_delta * y_coord_delta;
457  int64_t xSquared = x_coord_delta * x_coord_delta;
458  int xy_distance = (int)sqrt((long double)(xSquared + ySquared));
459  yaw = stru_5C6E00->Atan2((int)x_coord_delta, (int)y_coord_delta);
460  pitch = stru_5C6E00->Atan2(xy_distance, (int)z_coord_delta);
461  }
462 
463  SpriteObject spell_sprites;
464 
465  switch (uSpellID) {
467  case SPELL_FIRE_FIREBALL:
472  case SPELL_EARTH_BLADES:
475  case SPELL_AIR_SPARKS:
477  spell_sprites.uType = spell_sprite_mapping[uSpellID].uSpriteType;
478  spell_sprites.containing_item.Reset();
479  spell_sprites.spell_id = uSpellID;
480  spell_sprites.spell_level = uSkill;
481  spell_sprites.spell_skill = skillMasteryPlusOne;
482  spell_sprites.uObjectDescID = pObjectList->ObjectIDByItemID(spell_sprites.uType);
483  spell_sprites.vPosition.x = fromx;
484  spell_sprites.vPosition.y = fromy;
485  spell_sprites.vPosition.z = fromz;
486  spell_sprites.uAttributes = 16;
487  spell_sprites.uSectorID = pIndoor->GetSector(fromx, fromy, fromz);
488  spell_sprites.field_60_distance_related_prolly_lod = distance_to_target;
489  spell_sprites.uSpriteFrameID = 0;
490  spell_sprites.spell_caster_pid = 8000 | OBJECT_Item;
491  spell_sprites.uSoundID = 0;
492  break;
493  }
494 
495  int spell_length = 0;
496  GameTime spell_expire_time;
497  int spell_power;
498  int launch_angle;
499  int launch_speed;
500  int spell_num_objects = 0;
501  int spell_spray_arc;
502  int spell_spray_angles;
503  int spriteid;
504 
505  switch (uSpellID) {
507  case SPELL_FIRE_FIREBALL:
512  case SPELL_EARTH_BLADES:
514  // v20 = yaw;
515  spell_sprites.spell_target_pid = 0;
516  spell_sprites.uFacing = yaw;
517  spell_sprites.uSoundID = 0;
518  launch_speed =
520  ->pObjects[(signed __int16)spell_sprites.uObjectDescID]
521  .uSpeed;
522  spriteid = spell_sprites.Create(yaw, pitch, launch_speed, 0);
523  // pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID],
524  // 0, 0, fromx, fromy, 0, 0, 0);
525  pAudioPlayer->PlaySpellSound(uSpellID, PID(OBJECT_Item, spriteid));
526  return;
528  spell_num_objects = (skillMasteryPlusOne * 2) - 1;
529  spell_sprites.spell_target_pid = 0;
530  spell_sprites.uFacing = yaw;
531  if (spell_num_objects == 1) {
532  launch_speed =
534  ->pObjects[(signed __int16)spell_sprites.uObjectDescID]
535  .uSpeed;
536  spriteid = spell_sprites.Create(yaw, pitch, launch_speed, 0);
537  } else {
538  spell_spray_arc =
539  (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360;
540  spell_spray_angles = spell_spray_arc / (spell_num_objects - 1);
541  for (int i = spell_spray_arc / -2; i <= spell_spray_arc / 2;
542  i += spell_spray_angles) {
543  spell_sprites.uFacing = i + yaw;
544  spriteid = spell_sprites.Create(
545  i + yaw, pitch,
546  pObjectList->pObjects[spell_sprites.uObjectDescID]
547  .uSpeed,
548  0);
549  }
550  }
551  // pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID],
552  // 0, 0, fromx, fromy, 0, 0, 0);
553  pAudioPlayer->PlaySpellSound(uSpellID, PID(OBJECT_Item, spriteid));
554  return;
555  case SPELL_AIR_SPARKS:
556  spell_num_objects = (skillMasteryPlusOne * 2) + 1;
557  spell_spray_arc =
558  (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360;
559  spell_spray_angles = spell_spray_arc / (spell_num_objects - 1);
560  spell_sprites.spell_target_pid = 4;
561  for (int i = spell_spray_arc / -2; i <= spell_spray_arc / 2;
562  i += spell_spray_angles) {
563  spell_sprites.uFacing = i + yaw;
564  spriteid = spell_sprites.Create(
565  i + yaw, pitch,
566  pObjectList->pObjects[spell_sprites.uObjectDescID].uSpeed,
567  0);
568  }
569  // pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID],
570  // 0, 0, fromx, fromy, 0, 0, 0);
571  pAudioPlayer->PlaySpellSound(uSpellID, PID(OBJECT_Item, spriteid));
572  return;
575  spell_sprites.spell_target_pid = 4;
576  launch_speed =
577  pObjectList->pObjects[spell_sprites.uObjectDescID].uSpeed;
578  launch_angle = stru_5C6E00->uIntegerHalfPi / 2;
579  spriteid = spell_sprites.Create(yaw, launch_angle, launch_speed, 0);
580  // pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID],
581  // 0, 0, fromx, fromy, 0, 0, 0);
582  pAudioPlayer->PlaySpellSound(uSpellID, PID(OBJECT_Item, spriteid));
583  return;
584 
585  case SPELL_FIRE_HASTE:
586  if (skillMasteryPlusOne > 0) {
587  if (skillMasteryPlusOne <= 2)
588  spell_length = 60 * (uSkill + 60);
589  else if (skillMasteryPlusOne == 3)
590  spell_length = 180 * (uSkill + 20);
591  else if (skillMasteryPlusOne == 4)
592  spell_length = 240 * (uSkill + 15);
593  }
594  for (uint i = 0; i < 4; ++i)
595  if (pParty->pPlayers[i].IsWeak()) return;
598  skillMasteryPlusOne, 0, 0, 0);
599  spell_fx_renderer->SetPlayerBuffAnim(uSpellID, 0);
600  spell_fx_renderer->SetPlayerBuffAnim(uSpellID, 1);
601  spell_fx_renderer->SetPlayerBuffAnim(uSpellID, 2);
602  spell_fx_renderer->SetPlayerBuffAnim(uSpellID, 3);
603  // pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID],
604  // 0, 0, fromx, fromy, 0, 0, 0); // звук алтаря
605  pAudioPlayer->PlaySpellSound(uSpellID, 0);
606  return;
607  case SPELL_AIR_SHIELD:
610  switch (skillMasteryPlusOne) {
611  case 1:
612  case 2:
613  spell_length = 300 * (uSkill + 12);
614  break;
615  case 3:
616  spell_length = 900 * (uSkill + 4);
617  break;
618  case 4:
619  spell_length = 3600 * (uSkill + 1);
620  break;
621  }
622  switch (uSpellID) {
623  case SPELL_AIR_SHIELD:
624  spell_num_objects = 0;
625  uSkill = 14;
626  break;
628  spell_num_objects = uSkill + 5;
629  uSkill = 15;
630  break;
632  spell_num_objects = uSkill + 5;
633  uSkill = 9;
634  break;
635  }
636  spell_fx_renderer->SetPlayerBuffAnim(uSpellID, 0);
637  spell_fx_renderer->SetPlayerBuffAnim(uSpellID, 1);
638  spell_fx_renderer->SetPlayerBuffAnim(uSpellID, 2);
639  spell_fx_renderer->SetPlayerBuffAnim(uSpellID, 3);
640  spell_expire_time =
642  pParty->pPartyBuffs[uSkill].Apply(spell_expire_time,
643  skillMasteryPlusOne,
644  spell_num_objects, 0, 0);
645  // pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID],
646  // 0, 0, fromx, fromy, 0, 0, 0);
647  pAudioPlayer->PlaySpellSound(uSpellID, 0);
648  return;
650  if (skillMasteryPlusOne == 4)
651  spell_length = 600 * uSkill;
652  else
653  spell_length = 60 * uSkill;
654  spell_fx_renderer->SetPlayerBuffAnim(uSpellID, 0);
655  spell_fx_renderer->SetPlayerBuffAnim(uSpellID, 1);
656  spell_fx_renderer->SetPlayerBuffAnim(uSpellID, 2);
657  spell_fx_renderer->SetPlayerBuffAnim(uSpellID, 3);
658 
659  spell_expire_time =
662  spell_expire_time, skillMasteryPlusOne, uSkill, 0, 0);
663  // pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID],
664  // 0, 0, fromx, fromy, 0, 0, 0);
665  pAudioPlayer->PlaySpellSound(uSpellID, 0);
666  return;
673  spell_length = 3600 * uSkill;
674  spell_num_objects = uSkill * skillMasteryPlusOne;
675 
676  switch (uSpellID) {
678  uSkill = PARTY_BUFF_RESIST_FIRE;
679  break;
681  uSkill = PARTY_BUFF_RESIST_AIR;
682  break;
684  uSkill = PARTY_BUFF_RESIST_WATER;
685  break;
687  uSkill = PARTY_BUFF_RESIST_EARTH;
688  break;
690  uSkill = PARTY_BUFF_RESIST_MIND;
691  break;
693  uSkill = PARTY_BUFF_RESIST_BODY;
694  break;
695  }
696  spell_fx_renderer->SetPlayerBuffAnim(uSpellID, 0);
697  spell_fx_renderer->SetPlayerBuffAnim(uSpellID, 1);
698  spell_fx_renderer->SetPlayerBuffAnim(uSpellID, 2);
699  spell_fx_renderer->SetPlayerBuffAnim(uSpellID, 3);
700  pParty->pPartyBuffs[uSkill].Apply(
702  skillMasteryPlusOne, spell_num_objects, 0, 0);
703  // pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID],
704  // 0, 0, fromx, fromy, 0, 0, 0);
705  pAudioPlayer->PlaySpellSound(uSpellID, 0);
706  return;
708  switch (skillMasteryPlusOne) {
709  case 2:
710  spell_length = 10800 * uSkill;
711  spell_power = 3 * uSkill + 10;
712  break;
713  case 3:
714  spell_length = 18000 * uSkill;
715  spell_power = 5 * uSkill + 10;
716  break;
717  case 4:
718  spell_length = 14400 * uSkill;
719  spell_power = 4 * uSkill + 10;
720  break;
721  }
722  spell_fx_renderer->SetPlayerBuffAnim(uSpellID, 0);
723  spell_fx_renderer->SetPlayerBuffAnim(uSpellID, 1);
724  spell_fx_renderer->SetPlayerBuffAnim(uSpellID, 2);
725  spell_fx_renderer->SetPlayerBuffAnim(uSpellID, 3);
726 
727  spell_expire_time =
730  spell_expire_time, skillMasteryPlusOne, spell_power, 0, 0);
731  // pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID],
732  // 0, 0, fromx, fromy, 0, 0, 0);
733  pAudioPlayer->PlaySpellSound(uSpellID, 0);
734  return;
735  default:
736  return;
737  }
738 }
739 
740 //----- (00427769) --------------------------------------------------------
741 bool sub_427769_isSpellQuickCastableOnShiftClick(unsigned int uSpellID) {
742  return (pSpellDatas[uSpellID].stats & 0xC) != 0;
743 }
744 //----- (0043AFE3) --------------------------------------------------------
745 int _43AFE3_calc_spell_damage(int spellId, int spellLevel,
746  signed int skillMastery, int currentHp) {
747  int result; // eax@1
748  unsigned int v5; // [sp-4h] [bp-8h]@9
749 
750  result = 0;
751  if (spellId == SPELL_FIRE_FIRE_SPIKE) {
752  switch (skillMastery) {
753  case 1:
754  case 2:
755  v5 = 6;
756  break;
757  case 3:
758  v5 = 8;
759  break;
760  case 4:
761  v5 = 10;
762  break;
763  default:
764  return 0;
765  }
766  result = GetDiceResult(spellLevel, v5);
767  } else if (spellId == SPELL_EARTH_MASS_DISTORTION) {
768  result = currentHp *
770  2 * spellLevel) /
771  100;
772  } else {
773  result =
774  pSpellDatas[spellId].baseDamage +
775  GetDiceResult(spellLevel, pSpellDatas[spellId].bonusSkillDamage);
776  }
777 
778  return result;
779 }
spell_fx_renderer
SpellFxRenderer * spell_fx_renderer
Definition: Spells.cpp:22
SpriteObject
Definition: SpriteObject.h:189
SPRITE_SPELL_MIND_BERSERK
@ SPRITE_SPELL_MIND_BERSERK
Definition: SpriteObject.h:128
spell_sprite_mapping
std::array< stru324_spell_id_to_sprite_mapping, 103 > spell_sprite_mapping
Definition: Spells.cpp:35
SPELL_LIGHT_PARALYZE
@ SPELL_LIGHT_PARALYZE
Definition: Spells.h:100
ObjectDesc::uSpeed
int16_t uSpeed
Definition: ObjectList.h:31
SPELL_EARTH_STONESKIN
@ SPELL_EARTH_STONESKIN
Definition: Spells.h:53
Party::vPosition
Vec3_int_ vPosition
Definition: Party.h:250
Engine_::IocContainer
Definition: IocContainer.h:15
SPRITE_SPELL_SPIRIT_TURN_UNDEAD
@ SPRITE_SPELL_SPIRIT_TURN_UNDEAD
Definition: SpriteObject.h:111
SPRITE_SPELL_AIR_WIZARD_EYE
@ SPRITE_SPELL_AIR_WIZARD_EYE
Definition: SpriteObject.h:59
PARTY_BUFF_DAY_OF_GODS
@ PARTY_BUFF_DAY_OF_GODS
Definition: Party.h:73
SPRITE_SPELL_MIND_PSYCHIC_SHOCK
@ SPRITE_SPELL_MIND_PSYCHIC_SHOCK
Definition: SpriteObject.h:132
SPRITE_SPELL_BODY_FLYING_FIST
@ SPRITE_SPELL_BODY_FLYING_FIST
Definition: SpriteObject.h:145
stru193_math::uIntegerDoublePi
static const unsigned int uIntegerDoublePi
Definition: OurMath.h:90
SPRITE_SPELL_AIR_LIGHNING_BOLT
@ SPRITE_SPELL_AIR_LIGHNING_BOLT
Definition: SpriteObject.h:65
SPRITE_BLASTER_PROJECTILE
@ SPRITE_BLASTER_PROJECTILE
Definition: SpriteObject.h:30
RemoveQuotes
char * RemoveQuotes(char *str)
Definition: Strings.h:17
SPRITE_SPELL_SPIRIT_FATE
@ SPRITE_SPELL_SPIRIT_FATE
Definition: SpriteObject.h:110
SPELL_SCHOOL_FIRE
@ SPELL_SCHOOL_FIRE
Definition: Spells.h:132
Tokenize
std::vector< char * > Tokenize(char *input, const char separator)
Definition: Strings.cpp:30
SpriteObject::uFacing
unsigned __int16 uFacing
Definition: SpriteObject.h:220
SPRITE_SPELL_AIR_SPARKS
@ SPRITE_SPELL_AIR_SPARKS
Definition: SpriteObject.h:62
LOD.h
Party::GetPlayingTime
GameTime & GetPlayingTime()
Definition: Party.h:230
SPELL_LIGHT_LIGHT_BOLT
@ SPELL_LIGHT_LIGHT_BOLT
Definition: Spells.h:97
SPRITE_SPELL_FIRE_HASTE
@ SPRITE_SPELL_FIRE_HASTE
Definition: SpriteObject.h:47
SPELL_SCHOOL_WATER
@ SPELL_SCHOOL_WATER
Definition: Spells.h:134
SpriteObject::field_60_distance_related_prolly_lod
char field_60_distance_related_prolly_lod
Definition: SpriteObject.h:234
OBJECT_Item
@ OBJECT_Item
Definition: Actor.h:66
SPELL_WATER_POISON_SPRAY
@ SPELL_WATER_POISON_SPRAY
Definition: Spells.h:38
PARTY_BUFF_IMMOLATION
@ PARTY_BUFF_IMMOLATION
Definition: Party.h:81
SPRITE_SPELL_BODY_CURE_POISON
@ SPRITE_SPELL_BODY_CURE_POISON
Definition: SpriteObject.h:141
SPRITE_SPELL_LIGHT_DAY_OF_PROTECTION
@ SPRITE_SPELL_LIGHT_DAY_OF_PROTECTION
Definition: SpriteObject.h:160
SPRITE_SPELL_FIRE_TORCH_LIGHT
@ SPRITE_SPELL_FIRE_TORCH_LIGHT
Definition: SpriteObject.h:42
SpellStats::pInfos
SpellInfo pInfos[100]
Definition: Spells.h:192
LOD::File::LoadCompressedTexture
void * LoadCompressedTexture(const String &pContainer, size_t *data_size=nullptr)
Definition: LOD.cpp:921
pIconPos
std::array< std::array< struct SpellBookIconPos, 12 >, 9 > pIconPos
Definition: Spells.cpp:307
SpellInfo::uSchool
SPELL_SCHOOL uSchool
Definition: Spells.h:183
SPRITE_SPELL_MIND_ENSLAVE
@ SPRITE_SPELL_MIND_ENSLAVE
Definition: SpriteObject.h:133
SpellBuff::IsBuffExpiredToTime
bool IsBuffExpiredToTime(GameTime time)
Definition: Spells.cpp:351
OtherOverlayList::bRedraw
int bRedraw
Definition: Overlays.h:38
SPELL_EARTH_ROCK_BLAST
@ SPELL_EARTH_ROCK_BLAST
Definition: Spells.h:56
Party::sEyelevel
int sEyelevel
Definition: Party.h:239
SpriteObject::uSectorID
__int16 uSectorID
Definition: SpriteObject.h:223
SpellBuff::uSkill
unsigned __int16 uSkill
Definition: Spells.h:167
SpriteObject.h
SPRITE_SPELL_DARK_DRAGON_BREATH
@ SPRITE_SPELL_DARK_DRAGON_BREATH
Definition: SpriteObject.h:176
SpellInfo::pName
char * pName
Definition: Spells.h:176
stru193_math::uIntegerHalfPi
static const unsigned int uIntegerHalfPi
Definition: OurMath.h:89
SPELL_SCHOOL_SPIRIT
@ SPELL_SCHOOL_SPIRIT
Definition: Spells.h:138
SPELL_EARTH_DEADLY_SWARM
@ SPELL_EARTH_DEADLY_SWARM
Definition: Spells.h:52
SPRITE_SPELL_EARTH_MASS_DISTORTION
@ SPRITE_SPELL_EARTH_MASS_DISTORTION
Definition: SpriteObject.h:106
SPELL_FIRE_FIRE_SPIKE
@ SPELL_FIRE_FIRE_SPIKE
Definition: Spells.h:19
SPRITE_SPELL_LIGHT_SUMMON_ELEMENTAL
@ SPRITE_SPELL_LIGHT_SUMMON_ELEMENTAL
Definition: SpriteObject.h:156
SPRITE_SPELL_SPIRIT_REMOVE_CURSE
@ SPRITE_SPELL_SPIRIT_REMOVE_CURSE
Definition: SpriteObject.h:113
SPRITE_SPELL_DARK_SACRIFICE
@ SPRITE_SPELL_DARK_SACRIFICE
Definition: SpriteObject.h:175
SPELL_BODY_HARM
@ SPELL_BODY_HARM
Definition: Spells.h:88
SPRITE_SPELL_BODY_HAMMERHANDS
@ SPRITE_SPELL_BODY_HAMMERHANDS
Definition: SpriteObject.h:142
Overlays.h
GetDiceResult
int GetDiceResult(unsigned int uNumDice, unsigned int uDiceSides)
Definition: OurMath.cpp:194
SPRITE_SPELL_FIRE_FIRE_AURA
@ SPRITE_SPELL_FIRE_FIRE_AURA
Definition: SpriteObject.h:46
SPRITE_SPELL_AIR_STARBURST
@ SPRITE_SPELL_AIR_STARBURST
Definition: SpriteObject.h:71
pSpellsTXT_Raw
char * pSpellsTXT_Raw
Definition: mm7_data.cpp:679
ObjectList::ObjectIDByItemID
unsigned int ObjectIDByItemID(unsigned int uItemID)
Definition: ObjectList.cpp:7
SPELL_EARTH_PROTECTION_FROM_EARTH
@ SPELL_EARTH_PROTECTION_FROM_EARTH
Definition: Spells.h:51
int64_t
__int64 int64_t
Definition: alext.h:31
Party::pPlayers
std::array< Player, 4 > pPlayers
Definition: Party.h:310
SPELL_EARTH_DEATH_BLOSSOM
@ SPELL_EARTH_DEATH_BLOSSOM
Definition: Spells.h:58
SPRITE_SPELL_SPIRIT_HEROISM
@ SPRITE_SPELL_SPIRIT_HEROISM
Definition: SpriteObject.h:115
SPRITE_SPELL_EARTH_SLOW
@ SPRITE_SPELL_EARTH_SLOW
Definition: SpriteObject.h:92
PARTY_BUFF_RESIST_AIR
@ PARTY_BUFF_RESIST_AIR
Definition: Party.h:71
SPRITE_SPELL_FIRE_FIRE_BOLT
@ SPRITE_SPELL_FIRE_FIRE_BOLT
Definition: SpriteObject.h:43
SpriteObject::uType
SPRITE_OBJECT_TYPE uType
Definition: SpriteObject.h:215
SPELL_MIND_MIND_BLAST
@ SPELL_MIND_MIND_BLAST
Definition: Spells.h:74
SpellFxRenderer.h
SPELL_FIRE_PROTECTION_FROM_FIRE
@ SPELL_FIRE_PROTECTION_FROM_FIRE
Definition: Spells.h:15
SPRITE_SPELL_BODY_CURE_WEAKNESS
@ SPRITE_SPELL_BODY_CURE_WEAKNESS
Definition: SpriteObject.h:135
SpellData
Definition: Spells.h:206
SPELL_MIND_PROTECTION_FROM_MIND
@ SPELL_MIND_PROTECTION_FROM_MIND
Definition: Spells.h:75
input
GLenum GLenum GLenum input
Definition: SDL_opengl_glext.h:9377
SPELL_DARK_SHARPMETAL
@ SPELL_DARK_SHARPMETAL
Definition: Spells.h:113
SPELL_WATER_ICE_BOLT
@ SPELL_WATER_ICE_BOLT
Definition: Spells.h:40
SPRITE_SPELL_FIRE_INFERNO
@ SPRITE_SPELL_FIRE_INFERNO
Definition: SpriteObject.h:55
ItemGen::Reset
void Reset()
Definition: Items.cpp:133
PARTY_BUFF_RESIST_MIND
@ PARTY_BUFF_RESIST_MIND
Definition: Party.h:83
SPRITE_SPELL_EARTH_ROCK_BLAST
@ SPRITE_SPELL_EARTH_ROCK_BLAST
Definition: SpriteObject.h:100
SpriteObject::uSpriteFrameID
unsigned __int16 uSpriteFrameID
Definition: SpriteObject.h:224
SPELL_AIR_PROTECTION_FROM_AIR
@ SPELL_AIR_PROTECTION_FROM_AIR
Definition: Spells.h:27
SPRITE_SPELL_MIND_MIND_BLAST
@ SPRITE_SPELL_MIND_MIND_BLAST
Definition: SpriteObject.h:122
pIndoor
IndoorLocation * pIndoor
Definition: Indoor.cpp:49
Engine.h
SPRITE_SPELL_WATER_LLOYDS_BEACON
@ SPRITE_SPELL_WATER_LLOYDS_BEACON
Definition: SpriteObject.h:89
SPRITE_SPELL_SPIRIT_SHARED_LIFE
@ SPRITE_SPELL_SPIRIT_SHARED_LIFE
Definition: SpriteObject.h:118
SPRITE_SPELL_SPIRIT_RAISE_DEAD
@ SPRITE_SPELL_SPIRIT_RAISE_DEAD
Definition: SpriteObject.h:117
SPRITE_SPELL_LIGHT_DIVINE_INTERVENTION
@ SPRITE_SPELL_LIGHT_DIVINE_INTERVENTION
Definition: SpriteObject.h:164
SPRITE_SPELL_DARK_SHARPMETAL
@ SPRITE_SPELL_DARK_SHARPMETAL
Definition: SpriteObject.h:171
result
GLuint64EXT * result
Definition: SDL_opengl_glext.h:9435
SpriteObject::uObjectDescID
unsigned __int16 uObjectDescID
Definition: SpriteObject.h:217
SPELL_FIRE_FIRE_BOLT
@ SPELL_FIRE_FIRE_BOLT
Definition: Spells.h:14
Party::pPartyBuffs
std::array< SpellBuff, 20 > pPartyBuffs
Definition: Party.h:309
TownPortalList
std::array< TownPortalData, 6 > TownPortalList
Definition: Spells.cpp:24
SPRITE_SPELL_EARTH_TELEKINESIS
@ SPRITE_SPELL_EARTH_TELEKINESIS
Definition: SpriteObject.h:102
GameTime::Reset
void Reset()
Definition: Time.h:58
SpellBuff::Reset
void Reset()
Definition: Spells.cpp:337
SPRITE_SPELL_EARTH_PROTECTION_FROM_EARTH
@ SPRITE_SPELL_EARTH_PROTECTION_FROM_EARTH
Definition: SpriteObject.h:93
Actor.h
SPRITE_SPELL_LIGHT_DAY_OF_THE_GODS
@ SPRITE_SPELL_LIGHT_DAY_OF_THE_GODS
Definition: SpriteObject.h:157
SPRITE_SPELL_BODY_POWER_CURE
@ SPRITE_SPELL_BODY_POWER_CURE
Definition: SpriteObject.h:147
OtherOverlayList::pOverlays
OtherOverlay pOverlays[50]
Definition: Overlays.h:36
SPRITE_SPELL_MIND_PROTECTION_FROM_MIND
@ SPRITE_SPELL_MIND_PROTECTION_FROM_MIND
Definition: SpriteObject.h:124
SPRITE_SPELL_SPIRIT_SPIRIT_LASH
@ SPRITE_SPELL_SPIRIT_SPIRIT_LASH
Definition: SpriteObject.h:116
SPRITE_SPELL_BODY_CURE_DISEASE
@ SPRITE_SPELL_BODY_CURE_DISEASE
Definition: SpriteObject.h:143
SPRITE_SPELL_DARK_PAIN_REFLECTION
@ SPRITE_SPELL_DARK_PAIN_REFLECTION
Definition: SpriteObject.h:174
SPRITE_SPELL_EARTH_DEATH_BLOSSOM
@ SPRITE_SPELL_EARTH_DEATH_BLOSSOM
Definition: SpriteObject.h:103
SpriteObject::vPosition
struct Vec3_int_ vPosition
Definition: SpriteObject.h:218
pParty
Party * pParty
Definition: Party.cpp:30
SPRITE_SPELL_FIRE_PROTECTION_FROM_FIRE
@ SPRITE_SPELL_FIRE_PROTECTION_FROM_FIRE
Definition: SpriteObject.h:45
SPELL_WATER_ICE_BLAST
@ SPELL_WATER_ICE_BLAST
Definition: Spells.h:46
SPRITE_SPELL_DARK_SOULDRINKER
@ SPRITE_SPELL_DARK_SOULDRINKER
Definition: SpriteObject.h:179
SPELL_SCHOOL_DARK
@ SPELL_SCHOOL_DARK
Definition: Spells.h:142
SPRITE_SPELL_AIR_JUMP
@ SPRITE_SPELL_AIR_JUMP
Definition: SpriteObject.h:63
PARTY_BUFF_RESIST_WATER
@ PARTY_BUFF_RESIST_WATER
Definition: Party.h:88
SPRITE_SPELL_BODY_HARM
@ SPRITE_SPELL_BODY_HARM
Definition: SpriteObject.h:138
SPRITE_SPELL_EARTH_DEADLY_SWARM
@ SPRITE_SPELL_EARTH_DEADLY_SWARM
Definition: SpriteObject.h:94
AudioPlayer::PlaySpellSound
void PlaySpellSound(unsigned int spell, unsigned int pid)
Definition: AudioPlayer.cpp:476
SPRITE_SPELL_LIGHT_HOUR_OF_POWER
@ SPRITE_SPELL_LIGHT_HOUR_OF_POWER
Definition: SpriteObject.h:161
SPRITE_SPELL_AIR_SHIELD
@ SPRITE_SPELL_AIR_SHIELD
Definition: SpriteObject.h:64
SpellStats::Initialize
void Initialize()
Definition: Spells.cpp:385
wand_spell_ids
std::array< SPELL_TYPE, 25 > wand_spell_ids
Definition: Spells.cpp:280
SPELL_MIND_CHARM
@ SPELL_MIND_CHARM
Definition: Spells.h:77
SPRITE_SPELL_FIRE_IMMOLATION
@ SPRITE_SPELL_FIRE_IMMOLATION
Definition: SpriteObject.h:52
SPRITE_SPELL_BODY_REGENERATION
@ SPRITE_SPELL_BODY_REGENERATION
Definition: SpriteObject.h:140
SPELL_SCHOOL_MIND
@ SPELL_SCHOOL_MIND
Definition: Spells.h:139
SPELL_SCHOOL_AIR
@ SPELL_SCHOOL_AIR
Definition: Spells.h:133
SPELL_FIRE_IMMOLATION
@ SPELL_FIRE_IMMOLATION
Definition: Spells.h:20
SPRITE_SPELL_WATER_TOWN_PORTAL
@ SPRITE_SPELL_WATER_TOWN_PORTAL
Definition: SpriteObject.h:85
Indoor.h
PARTY_BUFF_HASTE
@ PARTY_BUFF_HASTE
Definition: Party.h:79
SPRITE_SPELL_MIND_MASS_FEAR
@ SPRITE_SPELL_MIND_MASS_FEAR
Definition: SpriteObject.h:129
pSpellDatas
std::array< SpellData, 100 > pSpellDatas
Definition: Spells.cpp:170
SPELL_SCHOOL_EARTH
@ SPELL_SCHOOL_EARTH
Definition: Spells.h:135
SpriteObject::spell_id
int spell_id
Definition: SpriteObject.h:228
SPRITE_SPELL_WATER_ACID_BURST
@ SPRITE_SPELL_WATER_ACID_BURST
Definition: SpriteObject.h:82
SPRITE_SPELL_WATER_ENCHANT_ITEM
@ SPRITE_SPELL_WATER_ENCHANT_ITEM
Definition: SpriteObject.h:84
SPELL_EARTH_STUN
@ SPELL_EARTH_STUN
Definition: Spells.h:49
SPELL_AIR_SHIELD
@ SPELL_AIR_SHIELD
Definition: Spells.h:30
SPRITE_SPELL_BODY_PROTECTION_FROM_BODY
@ SPRITE_SPELL_BODY_PROTECTION_FROM_BODY
Definition: SpriteObject.h:137
SPRITE_SPELL_DARK_TOXIC_CLOUD
@ SPRITE_SPELL_DARK_TOXIC_CLOUD
Definition: SpriteObject.h:168
SPRITE_SPELL_WATER_AWAKEN
@ SPRITE_SPELL_WATER_AWAKEN
Definition: SpriteObject.h:74
SPRITE_SPELL_FIRE_METEOR_SHOWER
@ SPRITE_SPELL_FIRE_METEOR_SHOWER
Definition: SpriteObject.h:53
SpellInfo::pExpertSkillDesc
char * pExpertSkillDesc
Definition: Spells.h:180
SPRITE_SPELL_EARTH_STONE_TO_FLESH
@ SPRITE_SPELL_EARTH_STONE_TO_FLESH
Definition: SpriteObject.h:99
SpellBuff::expire_time
GameTime expire_time
Definition: Spells.h:165
SPRITE_SPELL_DARK_VAMPIRIC_WEAPON
@ SPRITE_SPELL_DARK_VAMPIRIC_WEAPON
Definition: SpriteObject.h:169
SpellBuff::uOverlayID
unsigned __int16 uOverlayID
Definition: Spells.h:168
Spells.h
SPRITE_SPELL_WATER_WATER_WALK
@ SPRITE_SPELL_WATER_WATER_WALK
Definition: SpriteObject.h:80
SPRITE_SPELL_MIND_REMOVE_FEAR
@ SPRITE_SPELL_MIND_REMOVE_FEAR
Definition: SpriteObject.h:121
pEvents_LOD
LODFile_IconsBitmaps * pEvents_LOD
Definition: LOD.cpp:10
pSpellStats
struct SpellStats * pSpellStats
Definition: Spells.cpp:32
EventCastSpell
void EventCastSpell(int uSpellID, int uSkillLevel, int uSkill, int fromx, int fromy, int fromz, int tox, int toy, int toz)
Definition: Spells.cpp:429
SPRITE_SPELL_AIR_IMPLOSION
@ SPRITE_SPELL_AIR_IMPLOSION
Definition: SpriteObject.h:68
LEVEL_Indoor
@ LEVEL_Indoor
Definition: Indoor.h:286
SpriteObject::Create
int Create(int yaw, int pitch, int a4, int a5)
Definition: SpriteObject.cpp:56
SpriteObject::containing_item
struct ItemGen containing_item
Definition: SpriteObject.h:227
SPELL_FIRE_FIREBALL
@ SPELL_FIRE_FIREBALL
Definition: Spells.h:18
AudioPlayer.h
SpellStats
Definition: Spells.h:189
SPRITE_SPELL_WATER_RECHARGE_ITEM
@ SPRITE_SPELL_WATER_RECHARGE_ITEM
Definition: SpriteObject.h:81
SPRITE_SPELL_SPIRIT_BLESS
@ SPRITE_SPELL_SPIRIT_BLESS
Definition: SpriteObject.h:109
SpriteObject::uSoundID
unsigned __int16 uSoundID
Definition: SpriteObject.h:221
SPRITE_SPELL_SPIRIT_DETECT_LIFE
@ SPRITE_SPELL_SPIRIT_DETECT_LIFE
Definition: SpriteObject.h:108
SPELL_BODY_PROTECTION_FROM_BODY
@ SPELL_BODY_PROTECTION_FROM_BODY
Definition: Spells.h:87
SPRITE_SPELL_MIND_CURE_INSANITY
@ SPRITE_SPELL_MIND_CURE_INSANITY
Definition: SpriteObject.h:131
SPELL_SCHOOL_BODY
@ SPELL_SCHOOL_BODY
Definition: Spells.h:140
SpellFxRenderer
Definition: SpellFxRenderer.h:97
SPRITE_SPELL_WATER_POISON_SPRAY
@ SPRITE_SPELL_WATER_POISON_SPRAY
Definition: SpriteObject.h:75
SPRITE_SPELL_FIRE_INCINERATE
@ SPRITE_SPELL_FIRE_INCINERATE
Definition: SpriteObject.h:56
SPRITE_SPELL_MIND_CURE_PARALYSIS
@ SPRITE_SPELL_MIND_CURE_PARALYSIS
Definition: SpriteObject.h:127
stru193_math::Atan2
unsigned int Atan2(int x, int y)
Definition: OurMath.cpp:46
SPRITE_SPELL_LIGHT_DESTROY_UNDEAD
@ SPRITE_SPELL_LIGHT_DESTROY_UNDEAD
Definition: SpriteObject.h:151
pOtherOverlayList
struct OtherOverlayList * pOtherOverlayList
Definition: Overlays.cpp:19
SPELL_SCHOOL_NONE
@ SPELL_SCHOOL_NONE
Definition: Spells.h:136
SPRITE_SPELL_DARK_REANIMATE
@ SPRITE_SPELL_DARK_REANIMATE
Definition: SpriteObject.h:166
PARTY_BUFF_RESIST_EARTH
@ PARTY_BUFF_RESIST_EARTH
Definition: Party.h:75
SPELL_SPIRIT_SPIRIT_LASH
@ SPELL_SPIRIT_SPIRIT_LASH
Definition: Spells.h:68
SPELL_AIR_SPARKS
@ SPELL_AIR_SPARKS
Definition: Spells.h:28
SpriteObject::spell_level
int spell_level
Definition: SpriteObject.h:229
SpellBuff::uCaster
unsigned __int8 uCaster
Definition: Spells.h:169
SPRITE_SPELL_LIGHT_PRISMATIC_LIGHT
@ SPRITE_SPELL_LIGHT_PRISMATIC_LIGHT
Definition: SpriteObject.h:158
SPRITE_SPELL_LIGHT_DISPEL_MAGIC
@ SPRITE_SPELL_LIGHT_DISPEL_MAGIC
Definition: SpriteObject.h:153
SPRITE_SPELL_EARTH_STUN
@ SPRITE_SPELL_EARTH_STUN
Definition: SpriteObject.h:91
SPELL_EARTH_MASS_DISTORTION
@ SPELL_EARTH_MASS_DISTORTION
Definition: Spells.h:59
SpriteObject::spell_target_pid
int spell_target_pid
Definition: SpriteObject.h:233
SPRITE_SPELL_BODY_PROTECTION_FROM_MAGIC
@ SPRITE_SPELL_BODY_PROTECTION_FROM_MAGIC
Definition: SpriteObject.h:144
SPELL_WATER_ACID_BURST
@ SPELL_WATER_ACID_BURST
Definition: Spells.h:43
SPRITE_ARROW_PROJECTILE
@ SPRITE_ARROW_PROJECTILE
Definition: SpriteObject.h:28
SPRITE_SPELL_SPIRIT_PRESERVATION
@ SPRITE_SPELL_SPIRIT_PRESERVATION
Definition: SpriteObject.h:114
uint
unsigned int uint
Definition: MM7.h:4
SPELL_AIR_IMPLOSION
@ SPELL_AIR_IMPLOSION
Definition: Spells.h:33
SPELL_WATER_PROTECTION_FROM_WATER
@ SPELL_WATER_PROTECTION_FROM_WATER
Definition: Spells.h:39
SpellBuff::uPower
unsigned __int16 uPower
Definition: Spells.h:166
SPRITE_SPELL_EARTH_STONESKIN
@ SPRITE_SPELL_EARTH_STONESKIN
Definition: SpriteObject.h:96
SPRITE_SPELL_LIGHT_SUNRAY
@ SPRITE_SPELL_LIGHT_SUNRAY
Definition: SpriteObject.h:162
SPRITE_SPELL_AIR_FEATHER_FALL
@ SPRITE_SPELL_AIR_FEATHER_FALL
Definition: SpriteObject.h:60
SpriteObject::spell_skill
int spell_skill
Definition: SpriteObject.h:230
SPRITE_SPELL_WATER_ICE_BOLT
@ SPRITE_SPELL_WATER_ICE_BOLT
Definition: SpriteObject.h:78
SPELL_EARTH_BLADES
@ SPELL_EARTH_BLADES
Definition: Spells.h:54
stru_5C6E00
struct stru193_math * stru_5C6E00
Definition: mm7_data.cpp:19
SpellInfo::pShortName
char * pShortName
Definition: Spells.h:177
SPRITE_SPELL_LIGHT_PARALYZE
@ SPRITE_SPELL_LIGHT_PARALYZE
Definition: SpriteObject.h:155
PARTY_BUFF_RESIST_BODY
@ PARTY_BUFF_RESIST_BODY
Definition: Party.h:72
PARTY_BUFF_RESIST_FIRE
@ PARTY_BUFF_RESIST_FIRE
Definition: Party.h:77
uCurrentlyLoadedLevelType
LEVEL_TYPE uCurrentlyLoadedLevelType
Definition: Indoor.cpp:52
SPRITE_SPELL_MIND_TELEPATHY
@ SPRITE_SPELL_MIND_TELEPATHY
Definition: SpriteObject.h:125
SPRITE_SPELL_BODY_FIRST_AID
@ SPRITE_SPELL_BODY_FIRST_AID
Definition: SpriteObject.h:136
IndoorLocation::GetSector
int GetSector(int sX, int sY, int sZ)
Definition: Indoor.cpp:1279
SPRITE_SPELL_WATER_PROTECTION_FROM_WATER
@ SPRITE_SPELL_WATER_PROTECTION_FROM_WATER
Definition: SpriteObject.h:77
SPRITE_SPELL_DARK_CONTROL_UNDEAD
@ SPRITE_SPELL_DARK_CONTROL_UNDEAD
Definition: SpriteObject.h:173
ObjectList::pObjects
struct ObjectDesc * pObjects
Definition: ObjectList.h:54
SPELL_AIR_LIGHNING_BOLT
@ SPELL_AIR_LIGHNING_BOLT
Definition: Spells.h:31
pAudioPlayer
AudioPlayer * pAudioPlayer
Definition: AudioPlayer.cpp:20
SpellInfo::pDescription
char * pDescription
Definition: Spells.h:178
SPRITE_SPELL_MIND_CHARM
@ SPRITE_SPELL_MIND_CHARM
Definition: SpriteObject.h:126
SPELL_BODY_FLYING_FIST
@ SPELL_BODY_FLYING_FIST
Definition: Spells.h:94
SPRITE_SPELL_FIRE_FIREBALL
@ SPRITE_SPELL_FIRE_FIREBALL
Definition: SpriteObject.h:48
ObjectList.h
SPRITE_SPELL_WATER_ICE_BLAST
@ SPRITE_SPELL_WATER_ICE_BLAST
Definition: SpriteObject.h:86
SpellFxRenderer::SetPlayerBuffAnim
void SetPlayerBuffAnim(uint16_t uSpellID, uint16_t uPlayerID)
Definition: SpellFxRenderer.cpp:1103
SPELL_DARK_TOXIC_CLOUD
@ SPELL_DARK_TOXIC_CLOUD
Definition: Spells.h:110
Engine_::IocContainer::ResolveSpellFxRenderer
static SpellFxRenderer * ResolveSpellFxRenderer()
Definition: IocContainer.cpp:74
SPRITE_SPELL_AIR_FLY
@ SPRITE_SPELL_AIR_FLY
Definition: SpriteObject.h:70
SpellBuff::Apply
bool Apply(GameTime time, unsigned __int16 uSkillLevel, unsigned __int16 uPower, int uOverlayID, unsigned __int8 caster)
Definition: Spells.cpp:363
SpriteObject::uAttributes
unsigned __int16 uAttributes
Definition: SpriteObject.h:222
SPRITE_SPELL_0
@ SPRITE_SPELL_0
Definition: SpriteObject.h:8
SPELL_DARK_SHRINKING_RAY
@ SPELL_DARK_SHRINKING_RAY
Definition: Spells.h:112
SpellInfo::pBasicSkillDesc
char * pBasicSkillDesc
Definition: Spells.h:179
SPELL_SCHOOL_LIGHT
@ SPELL_SCHOOL_LIGHT
Definition: Spells.h:141
SPELL_FIRE_HASTE
@ SPELL_FIRE_HASTE
Definition: Spells.h:17
SPRITE_SPELL_AIR_INVISIBILITY
@ SPRITE_SPELL_AIR_INVISIBILITY
Definition: SpriteObject.h:67
sub_427769_isSpellQuickCastableOnShiftClick
bool sub_427769_isSpellQuickCastableOnShiftClick(unsigned int uSpellID)
Definition: Spells.cpp:741
SPRITE_SPELL_DARK_SHRINKING_RAY
@ SPRITE_SPELL_DARK_SHRINKING_RAY
Definition: SpriteObject.h:170
SPRITE_SPELL_LIGHT_LIGHT_BOLT
@ SPRITE_SPELL_LIGHT_LIGHT_BOLT
Definition: SpriteObject.h:149
SPRITE_SPELL_SPIRIT_RESSURECTION
@ SPRITE_SPELL_SPIRIT_RESSURECTION
Definition: SpriteObject.h:119
GameTime
Definition: Time.h:14
SPELL_FIRE_INCINERATE
@ SPELL_FIRE_INCINERATE
Definition: Spells.h:23
SPRITE_SPELL_EARTH_BLADES
@ SPRITE_SPELL_EARTH_BLADES
Definition: SpriteObject.h:97
pObjectList
struct ObjectList * pObjectList
Definition: ObjectList.cpp:5
SPELL_SPIRIT_HEROISM
@ SPELL_SPIRIT_HEROISM
Definition: Spells.h:67
SpellData::SpellData
SpellData(__int16 innormalMana, __int16 inExpertLevelMana, __int16 inMasterLevelMana, __int16 inMagisterLevelMana, __int16 inNormalLevelRecovery, __int16 inExpertLevelRecovery, __int16 inMasterLevelRecovery, __int16 inMagisterLevelRecovery, __int8 inbaseDamage, __int8 inbonusSkillDamage, __int16 instats)
Definition: Spells.cpp:149
SPRITE_SPELL_AIR_PROTECTION_FROM_AIR
@ SPRITE_SPELL_AIR_PROTECTION_FROM_AIR
Definition: SpriteObject.h:61
GameTime::FromSeconds
static GameTime FromSeconds(int seconds)
Definition: Time.h:83
SpellBuff::uFlags
unsigned __int8 uFlags
Definition: Spells.h:170
SPRITE_SPELL_DARK_ARMAGEDDON
@ SPRITE_SPELL_DARK_ARMAGEDDON
Definition: SpriteObject.h:178
SpellInfo::pGrandmasterSkillDesc
char * pGrandmasterSkillDesc
Definition: Spells.h:182
SPELL_SCHOOL_MAGIC
@ SPELL_SCHOOL_MAGIC
Definition: Spells.h:137
SpriteObject::spell_caster_pid
int spell_caster_pid
Definition: SpriteObject.h:232
SPELL_LIGHT_DAY_OF_THE_GODS
@ SPELL_LIGHT_DAY_OF_THE_GODS
Definition: Spells.h:102
SpellInfo::pMasterSkillDesc
char * pMasterSkillDesc
Definition: Spells.h:181
_43AFE3_calc_spell_damage
int _43AFE3_calc_spell_damage(int spellId, int spellLevel, signed int skillMastery, int currentHp)
Definition: Spells.cpp:745
OtherOverlay::Reset
void Reset()
Definition: Overlays.cpp:203
SPRITE_SPELL_FIRE_FIRE_SPIKE
@ SPRITE_SPELL_FIRE_FIRE_SPIKE
Definition: SpriteObject.h:50