Mercurial > mm7
annotate Spells.cpp @ 2328:04efed9483ff
EventCastSpell removing unused vars
author | Grumpy7 |
---|---|
date | Tue, 01 Apr 2014 23:32:14 +0200 |
parents | 5e4d90305d06 |
children | 4791895e4396 |
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 }}; |
2323
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
50 |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
51 |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
52 |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
53 SpellData::SpellData( __int16 innormalMana, __int16 inExpertLevelMana, __int16 inMasterLevelMana, __int16 inMagisterLevelMana, |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
54 __int16 inNormalLevelRecovery, __int16 inExpertLevelRecovery, __int16 inMasterLevelRecovery, __int16 inMagisterLevelRecovery, |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
55 __int8 inbaseDamage, __int8 inbonusSkillDamage, __int16 instats ): |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
56 uNormalLevelMana(innormalMana), |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
57 uExpertLevelMana(inExpertLevelMana), |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
58 uMasterLevelMana(inMasterLevelMana), |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
59 uMagisterLevelMana(inMagisterLevelMana), |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
60 uNormalLevelRecovery(inNormalLevelRecovery), |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
61 uExpertLevelRecovery(inExpertLevelRecovery), |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
62 uMasterLevelRecovery(inMasterLevelRecovery), |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
63 uMagisterLevelRecovery(inMagisterLevelRecovery), |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
64 baseDamage(inbaseDamage), |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
65 bonusSkillDamage(inbonusSkillDamage), |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
66 stats(instats) |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
67 { |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
68 |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
69 } |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
70 |
363 | 71 //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
|
72 std::array<SpellData, 100> pSpellDatas={{ |
2323
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
73 SpellData(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), |
363 | 74 |
2323
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
75 SpellData(1, 1, 1, 1, 60, 60, 60, 40, 0, 0, 0),//0 fire |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
76 SpellData(2, 2, 2, 2, 110, 110, 100, 90, 3, 3, 0), |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
77 SpellData(3, 3, 3, 3, 120, 120, 120, 120, 0, 0, 0), |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
78 SpellData(4, 4, 4, 4, 120, 120, 120, 120, 0, 0, 0), |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
79 SpellData(5, 5, 5, 5, 120, 120, 120, 120, 0, 0, 0), |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
80 SpellData(8, 8, 8, 8, 100, 100, 90, 80, 0, 6, 0), |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
81 SpellData(10, 10, 10, 10, 150, 150, 150, 150, 0, 6, 0), |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
82 SpellData(15, 15, 15, 15, 120, 120, 120, 120, 0, 6, 0), |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
83 SpellData(20, 20, 20, 20, 100, 100, 100, 90, 8, 1, 0), |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
84 SpellData(25, 25, 25, 25, 100, 100, 100, 90, 12, 1, 0), |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
85 SpellData(30, 30, 30, 30, 90, 90, 90, 90, 15, 15, 0), |
363 | 86 |
2323
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
87 SpellData(1, 1, 1, 0, 60, 60, 60, 60, 0, 0, 0), //1 air |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
88 SpellData(2, 2, 2, 2, 120, 120, 120, 100, 0, 0, 0), |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
89 SpellData(3, 3, 3, 3, 120, 120, 120, 120, 0, 0, 0), |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
90 SpellData(4, 4, 4, 4, 110, 100, 90, 80, 2, 1, 0), |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
91 SpellData(5, 5, 5, 5, 90, 90, 70, 50, 0, 0, 0), |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
92 SpellData(8, 8, 8, 8, 120, 120, 120, 120, 0, 0, 0), |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
93 SpellData(10, 10, 10, 10, 100, 100, 90, 70, 0, 8, 0), |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
94 SpellData(15, 15, 15, 15, 200, 200, 200, 200, 0, 0, 0), |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
95 SpellData(20, 20, 20, 20, 100, 100, 100, 90, 10, 10, 0), |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
96 SpellData(25, 25, 25, 25, 250, 250, 250, 250, 0, 0, 0), |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
97 SpellData(30, 30, 30, 30, 90, 90, 90, 90, 20, 1, 0), |
363 | 98 |
2323
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
99 SpellData(1, 1, 1, 1, 60, 60, 60, 20, 0, 0, 0), //2 water |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
100 SpellData(2, 2, 2, 2, 110, 100, 90, 70, 2, 2, 0), |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
101 SpellData(3, 3, 3, 3, 120, 120, 120, 120, 0, 0, 0), |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
102 SpellData(4, 4, 4, 4, 110, 100, 90, 80, 0, 4, 0), |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
103 SpellData(5, 5, 5, 5, 150, 150, 150, 150, 0, 0, 0), |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
104 SpellData(8, 8, 8, 8, 200, 200, 200, 200, 0, 0, 0), |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
105 SpellData(10, 10, 10, 10, 100, 100, 90, 80, 9, 9, 0), |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
106 SpellData(15, 15, 15, 15, 140, 140, 140, 140, 0, 0, 0), |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
107 SpellData(20, 20, 20, 20, 200, 200, 200, 200, 0, 0, 0), |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
108 SpellData(25, 25, 25, 25, 80, 80, 80, 80, 12, 3, 0), |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
109 SpellData(30, 30, 30, 30, 250, 250, 250, 250, 0, 0, 0), |
363 | 110 |
2323
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
111 SpellData(1, 1, 1, 1, 80, 80, 80, 80, 0, 0, 0), //3 earth |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
112 SpellData(2, 2, 2, 2, 100, 100, 100, 100, 0, 0, 0), |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
113 SpellData(3, 3, 3, 3, 120, 120, 120, 120, 0, 0, 0), |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
114 SpellData(4, 4, 4, 4, 110, 100, 90, 80, 5, 3, 0), |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
115 SpellData(5, 5, 5, 5, 120, 120, 120, 120, 0, 0, 0), |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
116 SpellData(8, 8, 8, 8, 100, 100, 90, 80, 0, 9, 0), |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
117 SpellData(10, 10, 10, 10, 140, 140, 140, 140, 0, 0, 0), |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
118 SpellData(15, 15, 15, 15, 90, 90, 90, 80, 0, 8, 0), |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
119 SpellData(20, 20, 20, 20, 150, 150, 150, 150, 0, 0, 0), |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
120 SpellData(25, 25, 25, 25, 100, 100, 100, 90, 20, 1, 0), |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
121 SpellData(30, 30, 30, 30, 90, 90, 90, 90, 25, 0, 0), |
363 | 122 |
2323
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
123 SpellData(1, 1, 1, 1, 100, 100, 100, 100, 0, 0, 0), //4 spirit |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
124 SpellData(2, 2, 2, 2, 100, 100, 100, 100, 0, 0, 0), |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
125 SpellData(3, 3, 3, 3, 90, 90, 90, 90, 0, 0, 0), |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
126 SpellData(4, 4, 4, 4, 120, 120, 120, 120, 0, 0, 0), |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
127 SpellData(5, 5, 5, 5, 120, 120, 120, 120, 0, 0, 0), |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
128 SpellData(8, 8, 8, 8, 120, 120, 120, 120, 0, 0, 0), |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
129 SpellData(10, 10, 10, 10, 120, 120, 120, 120, 0, 0, 0), |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
130 SpellData(15, 15, 15, 15, 100, 100, 100, 100, 10, 8, 0), |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
131 SpellData(20, 20, 20, 20, 240, 240, 240, 240, 0, 0, 0), |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
132 SpellData(25, 25, 25, 25, 150, 150, 150, 150, 0, 0, 0), |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
133 SpellData(30, 30, 30, 30, 1000, 1000, 1000, 1000, 0, 0, 0), |
363 | 134 |
2323
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
135 SpellData(1, 1, 1, 1, 120, 120, 120, 120, 0, 0, 0), //5 mind |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
136 SpellData(2, 2, 2, 2, 110, 110, 110, 110, 3, 3, 0), |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
137 SpellData(3, 3, 3, 3, 120, 120, 120, 120, 0, 0, 0), |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
138 SpellData(4, 4, 4, 4, 110, 100, 90, 80, 0, 0, 0), |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
139 SpellData(5, 5, 5, 5, 100, 100, 100, 100, 0, 0, 0), |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
140 SpellData(8, 8, 8, 8, 120, 120, 120, 120, 0, 0, 0), |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
141 SpellData(10, 10, 10, 10, 120, 120, 120, 120, 0, 0, 0), |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
142 SpellData(15, 15, 15, 15, 80, 80, 80, 80, 0, 0, 0), |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
143 SpellData(20, 20, 20, 20, 120, 120, 120, 120, 0, 0, 0), |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
144 SpellData(25, 25, 25, 25, 110, 110, 110, 100, 12, 12, 0), |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
145 SpellData(30, 30, 30, 30, 120, 120, 120, 120, 0, 0, 0), |
363 | 146 |
2323
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
147 SpellData(1, 1, 1, 1, 120, 120, 120, 120, 0, 0, 0), //6 body |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
148 SpellData(2, 2, 2, 2, 100, 100, 100, 100, 0, 0, 0), |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
149 SpellData(3, 3, 3, 3, 120, 120, 120, 120, 0, 0, 0), |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
150 SpellData(4, 4, 4, 4, 110, 100, 90, 80, 8, 2, 0), |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
151 SpellData(5, 5, 5, 5, 110, 110, 110, 110, 0, 0, 0), |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
152 SpellData(8, 8, 8, 8, 120, 120, 120, 120, 0, 0, 0), |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
153 SpellData(10, 10, 10, 10, 120, 120, 120, 120, 0, 0, 0), |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
154 SpellData(15, 15, 15, 15, 120, 120, 120, 120, 0, 0, 0), |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
155 SpellData(20, 20, 20, 20, 120, 120, 120, 120, 0, 0, 0), |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
156 SpellData(25, 25, 25, 25, 110, 110, 110, 100, 30, 5, 0), |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
157 SpellData(30, 30, 30, 30, 100, 100, 100, 100, 0, 0, 0), |
363 | 158 |
2323
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
159 SpellData(5, 5, 5, 5, 110, 100, 90, 80, 0, 4, 0), //7 light |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
160 SpellData(10, 10, 10, 10, 120, 110, 100, 90, 16, 16, 0), |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
161 SpellData(15, 15, 15, 15, 120, 110, 100, 90, 0, 0, 0), |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
162 SpellData(20, 20, 20, 20, 160, 140, 120, 100, 0, 0, 0), |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
163 SpellData(25, 25, 25, 25, 140, 140, 140, 140, 0, 0, 0), |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
164 SpellData(30, 30, 30, 30, 500, 500, 500, 500, 0, 0, 0), |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
165 SpellData(35, 35, 35, 35, 135, 135, 120, 100, 25, 1, 0), |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
166 SpellData(40, 40, 40, 40, 500, 500, 500, 500, 0, 0, 0), |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
167 SpellData(45, 45, 45, 45, 250, 250, 250, 250, 0, 0, 0), |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
168 SpellData(50, 50, 50, 50, 150, 150, 150, 135, 20, 20, 0), |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
169 SpellData(55, 55, 55, 55, 300, 300, 300, 300, 0, 0, 0), |
363 | 170 |
2323
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
171 SpellData(10, 10, 10, 10, 140, 140, 140, 140, 0, 0, 0), //8 dark |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
172 SpellData(15, 15, 15, 15, 120, 110, 100, 90, 25, 10, 0), |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
173 SpellData(20, 20, 20, 20, 120, 100, 90, 120, 0, 0, 0), |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
174 SpellData(25, 25, 25, 25, 120, 120, 120, 120, 0, 0, 0), |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
175 SpellData(30, 30, 30, 30, 90, 90, 80, 70, 6, 6, 0), |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
176 SpellData(35, 35, 35, 35, 120, 120, 100, 80, 0, 0, 0), |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
177 SpellData(40, 40, 40, 40, 110, 110, 110, 110, 0, 0, 0), |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
178 SpellData(45, 45, 45, 45, 200, 200, 200, 150, 0, 0, 0), |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
179 SpellData(50, 50, 50, 50, 120, 120, 120, 100, 0, 25, 0), |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
180 SpellData(55, 55, 55, 55, 250, 250, 250, 250, 50, 1, 0), |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
181 SpellData(60, 60, 60, 60, 300, 300, 300, 300, 25, 8, 0) |
1206
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
182 }}; |
0 | 183 |
1206
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
184 std::array<unsigned int, 25> wand_spell_ids = |
490 | 185 { |
186 // 135 Wand of Fire 136 Wand of Sparks 137 Wand of Poison 138 Wand of Stunning 139 Wand of Harm | |
187 SPELL_FIRE_FIRE_BOLT, SPELL_AIR_SPARKS, SPELL_WATER_POISON_SPRAY, SPELL_EARTH_STUN, SPELL_BODY_HARM, | |
188 // 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 | |
189 SPELL_LIGHT_LIGHT_BOLT, SPELL_WATER_ICE_BOLT, SPELL_SPIRIT_SPIRIT_LASH, SPELL_MIND_MIND_BLAST, SPELL_EARTH_DEADLY_SWARM, | |
190 // 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 | |
191 SPELL_FIRE_FIREBALL, SPELL_WATER_ACID_BURST, SPELL_AIR_LIGHNING_BOLT, SPELL_EARTH_BLADES, SPELL_MIND_CHARM, | |
192 // 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 | |
193 SPELL_WATER_ICE_BLAST, SPELL_BODY_FLYING_FIST, SPELL_EARTH_ROCK_BLAST, SPELL_LIGHT_PARALYZE, SPELL_DARK_TOXIC_CLOUD, | |
194 // 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 | |
195 SPELL_AIR_IMPLOSION, SPELL_EARTH_MASS_DISTORTION, SPELL_DARK_SHARPMETAL, SPELL_DARK_SHRINKING_RAY, SPELL_FIRE_INCINERATE | |
196 }; | |
197 | |
198 | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1165
diff
changeset
|
199 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
|
200 {{ //0 1 2 3 4 5 6 7 8 9 10 11 |
357 | 201 {0, 3, 1, 8, 11, 7, 4, 10, 6, 2, 5, 9}, |
202 {0, 11, 2, 9, 6, 8, 5, 10, 3, 7, 1, 4}, | |
203 {0, 4, 8, 9, 1, 10, 3, 11, 7, 6, 2, 5}, | |
204 {0, 7, 10, 8, 2, 11, 1, 5, 3, 6, 4, 9}, | |
205 {0, 5, 10, 11, 7, 2, 8, 1, 4, 9, 3, 6}, | |
206 {0, 5, 9, 8, 3, 7, 6, 4, 1, 11, 2, 10}, | |
207 {0, 1, 6, 9, 3, 5, 8, 11, 7, 10, 4, 2}, | |
208 {0, 1, 10, 11, 9, 4, 3, 6, 5, 7, 8, 2}, | |
209 {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
|
210 }}; |
0 | 211 |
1206
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
212 std::array<std::array<struct SpellBookIconPos, 12>, 9> pIconPos={{ |
363 | 213 |
1206
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
214 { 0, 0, 17, 13, 115, 2, 217, 15, |
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
215 299, 6, 28, 125, 130, 133, 294, 114, |
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
216 11, 232, 134, 233, 237, 171, 296, 231}, |
0 | 217 |
1206
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
218 { 0, 0, 19, 9, 117, 3, 206, 13, |
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
219 285, 7, 16, 123, 113, 101, 201, 118, |
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
220 317, 110, 11, 230, 149, 236, 296, 234}, |
357 | 221 |
1206
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
222 { 0, 0, 17, 9, 140, 0, 210, 34, |
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
223 293, 5, 15, 98, 78, 121, 175, 136, |
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
224 301, 115, 15, 226, 154, 225, 272, 220}, |
357 | 225 |
1206
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
226 { 0, 0, 7, 9, 156, 2, 277, 9, |
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
227 11, 117, 111, 82, 180, 102, 303, 108, |
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
228 10, 229, 120, 221, 201, 217, 296, 225}, |
357 | 229 |
1206
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
230 { 0, 0, 18, 8, 89, 15, 192, 14, |
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
231 292, 7, 22, 129, 125, 146, 217, 136, |
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
232 305, 115, 22, 226, 174, 237, 290, 231}, |
357 | 233 |
1206
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
234 { 0, 0, 18, 12, 148, 9, 292, 7, |
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
235 17, 122, 121, 99, 220, 87, 293, 112, |
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
236 13, 236, 128, 213, 220, 223, 315, 223}, |
357 | 237 |
1206
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
238 { 0, 0, 23, 14, 127, 8, 204, 0, |
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
239 306, 8, 14, 115, 122, 132, 200, 116, |
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
240 293, 122, 20, 228, 154, 228, 294, 239}, |
357 | 241 |
1206
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
242 { 0, 0, 19, 14, 124, 10, 283, 12, |
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
243 8, 105, 113, 89, 190, 82, 298, 108, |
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
244 18, 181, 101, 204, 204, 203, 285, 218}, |
357 | 245 |
1206
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
246 { 0, 0, 18, 17, 110, 16, 201, 15, |
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
247 307, 15, 18, 148, 125, 166, 201, 123, |
ab6560001f5b
arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents:
1205
diff
changeset
|
248 275, 120, 28, 235, 217, 222, 324, 216}}}; |
0 | 249 |
250 | |
251 //----- (0042EB31) -------------------------------------------------------- | |
252 bool SpellBuff::NotExpired() | |
253 { | |
189 | 254 return (signed __int64)this->uExpireTime > 0 ? true:false; |
0 | 255 } |
256 | |
257 | |
258 //----- (00458585) -------------------------------------------------------- | |
259 void SpellBuff::Reset() | |
260 { | |
982 | 261 uSkill = 0; |
262 uPower = 0; | |
263 uExpireTime = 0i64; | |
264 uCaster = 0; | |
265 uFlags = 0; | |
266 if (uOverlayID) | |
0 | 267 { |
982 | 268 pOtherOverlayList->pOverlays[uOverlayID - 1].Reset(); |
142 | 269 pOtherOverlayList->bRedraw = true; |
982 | 270 uOverlayID = 0; |
0 | 271 } |
272 } | |
273 | |
274 //----- (004585CA) -------------------------------------------------------- | |
1340 | 275 bool SpellBuff::IsBuffExpiredToTime( __int64 time_end ) |
276 { | |
277 if (uExpireTime && (uExpireTime < time_end)) | |
0 | 278 { |
982 | 279 uExpireTime = 0; |
280 uPower = 0; | |
281 uSkill = 0; | |
282 uOverlayID = 0; | |
283 return true; | |
0 | 284 } |
982 | 285 return false; |
0 | 286 } |
287 | |
288 //----- (004584E0) -------------------------------------------------------- | |
1340 | 289 bool SpellBuff::Apply( signed __int64 uExpireTime, unsigned __int16 uSkillLevel, unsigned __int16 uPower, int uOverlayID, unsigned __int8 caster ) |
290 { | |
291 if (this->uExpireTime && (uExpireTime < this->uExpireTime)) | |
982 | 292 return false; |
0 | 293 |
982 | 294 this->uSkill = uSkillLevel; |
295 this->uPower = uPower; | |
296 this->uExpireTime = uExpireTime; | |
297 if (this->uOverlayID && this->uOverlayID != uOverlayID) | |
0 | 298 { |
982 | 299 pOtherOverlayList->pOverlays[this->uOverlayID - 1].Reset(); |
300 pOtherOverlayList->bRedraw = true; | |
301 this->uOverlayID = 0; | |
0 | 302 } |
982 | 303 this->uOverlayID = uOverlayID; |
304 this->uCaster = caster; | |
305 | |
306 return true; | |
0 | 307 } |
308 | |
309 //----- (0045384A) -------------------------------------------------------- | |
310 void SpellStats::Initialize() | |
982 | 311 { |
2282 | 312 std::map<std::string, SPELL_SCHOOL, ci_less> spellSchoolMaps; |
313 spellSchoolMaps["fire"] = SPELL_SCHOOL_FIRE; | |
314 spellSchoolMaps["air"] = SPELL_SCHOOL_AIR; | |
315 spellSchoolMaps["water"] = SPELL_SCHOOL_WATER; | |
316 spellSchoolMaps["earth"] = SPELL_SCHOOL_EARTH; | |
317 spellSchoolMaps["spirit"] = SPELL_SCHOOL_SPIRIT; | |
318 spellSchoolMaps["mind"] = SPELL_SCHOOL_MIND; | |
319 spellSchoolMaps["body"] = SPELL_SCHOOL_BODY; | |
320 spellSchoolMaps["light"] = SPELL_SCHOOL_LIGHT; | |
321 spellSchoolMaps["dark"] = SPELL_SCHOOL_DARK; | |
322 spellSchoolMaps["magic"] = SPELL_SCHOOL_MAGIC; | |
323 | |
191 | 324 char* test_string; |
189 | 325 |
191 | 326 if ( pSpellsTXT_Raw ) |
1583 | 327 free(pSpellsTXT_Raw); |
191 | 328 pSpellsTXT_Raw = NULL; |
189 | 329 |
191 | 330 pSpellsTXT_Raw = (char *)pEvents_LOD->LoadRaw("spells.txt", 0); |
331 strtok(pSpellsTXT_Raw, "\r"); | |
332 strtok(NULL, "\r"); | |
333 for(int i=1; i<100; ++i) | |
2282 | 334 { |
335 test_string=strtok(NULL, "\r")+1; | |
336 auto tokens = Tokenize(test_string, '\t'); | |
337 pInfos[i].pName=RemoveQuotes(tokens[2]); | |
338 auto findResult = spellSchoolMaps.find(tokens[3]); | |
339 pInfos[i].uSchool = findResult == spellSchoolMaps.end() ? SPELL_SCHOOL_NONE : findResult->second; | |
340 pInfos[i].pShortName=RemoveQuotes(tokens[4]); | |
341 pInfos[i].pDescription=RemoveQuotes(tokens[5]); | |
342 pInfos[i].pBasicSkillDesc=RemoveQuotes(tokens[6]); | |
343 pInfos[i].pExpertSkillDesc=RemoveQuotes(tokens[7]); | |
344 pInfos[i].pMasterSkillDesc=RemoveQuotes(tokens[8]); | |
345 pInfos[i].pGrandmasterSkillDesc=RemoveQuotes(tokens[9]); | |
346 pSpellDatas[i].stats |= strchr(tokens[10], 'm') || strchr(tokens[10], 'M') ? 1 : 0; | |
347 pSpellDatas[i].stats |= strchr(tokens[10], 'e') || strchr(tokens[10], 'E') ? 2 : 0; | |
348 pSpellDatas[i].stats |= strchr(tokens[10], 'c') || strchr(tokens[10], 'C') ? 4 : 0; | |
349 pSpellDatas[i].stats |= strchr(tokens[10], 'x') || strchr(tokens[10], 'X') ? 8 : 0; | |
350 if ((i % 11)==0) | |
351 strtok(NULL, "\r"); | |
352 } | |
353 } | |
1295 | 354 //----- (00448DF8) -------------------------------------------------------- |
1519 | 355 void __fastcall EventCastSpell(int uSpellID, int uSkillLevel, int uSkill, int fromx, int fromy, int fromz, int tox, int toy, int toz)//sub_448DF8 |
1295 | 356 { |
357 int v9; // esi@1 | |
2328 | 358 signed __int64 v10; // st7@4 |
359 signed __int64 v11; // st6@4 | |
360 signed __int64 v12; // st5@4 | |
1295 | 361 double v13; // st7@6 |
362 int v14; // ST44_4@7 | |
2326
c889e521af1f
some EventCastSpell cleanups - removing labels, changing some numbers to enums
Grumpy7
parents:
2323
diff
changeset
|
363 uint skillMasteryPlusOne; // ebx@9 |
2328 | 364 uint v16; // edx@15 |
1295 | 365 int i; // esi@42 |
2328 | 366 uint v25; // edx@55 |
1295 | 367 int j; // esi@60 |
368 unsigned __int16 v31; // ax@70 | |
369 unsigned __int64 v36; // qax@99 | |
370 SpellBuff *v37; // ecx@99 | |
371 int v38; // esi@103 | |
372 signed __int64 v39; // qax@105 | |
373 int v42; // esi@111 | |
374 int v43; // ebx@111 | |
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 unsigned __int8 v52; // [sp+4h] [bp-B0h]@99 | |
381 int v55; // [sp+28h] [bp-8Ch]@7 | |
382 unsigned int yaw; // [sp+30h] [bp-84h]@7 | |
383 int pitch; // [sp+34h] [bp-80h]@7 | |
384 //SpriteObject a1; // [sp+38h] [bp-7Ch]@12 | |
385 int v60; // [sp+ACh] [bp-8h]@1 | |
386 //int spellnum_; // [sp+B0h] [bp-4h]@1 | |
387 //signed int levela; // [sp+BCh] [bp+8h]@80 | |
388 int a6_4; // [sp+C8h] [bp+14h]@117 | |
389 int a7c; // [sp+CCh] [bp+18h]@29 | |
390 int a7d; // [sp+CCh] [bp+18h]@55 | |
2328 | 391 signed __int64 xSquared; // [sp+D0h] [bp+1Ch]@6 |
1295 | 392 int a8b; // [sp+D0h] [bp+1Ch]@37 |
393 int a8c; // [sp+D0h] [bp+1Ch]@55 | |
2328 | 394 signed __int64 ySquared; // [sp+D4h] [bp+20h]@6 |
1295 | 395 |
396 v9 = 0; | |
2326
c889e521af1f
some EventCastSpell cleanups - removing labels, changing some numbers to enums
Grumpy7
parents:
2323
diff
changeset
|
397 skillMasteryPlusOne = uSkillLevel + 1; |
1519 | 398 //spellnum_ = uSpellID; |
1295 | 399 v60 = 0; |
400 if ( tox || toy || toz ) | |
401 { | |
2328 | 402 v10 = tox - fromx; |
403 v11 = toy - fromy; | |
404 v12 = toz - fromz; | |
1295 | 405 } |
406 else | |
407 { | |
2328 | 408 v10 = pParty->vPosition.x - fromx; |
409 v11 = pParty->vPosition.y - fromy; | |
410 v12 = (pParty->vPosition.z + pParty->sEyelevel) - fromz; | |
1295 | 411 } |
2328 | 412 v13 = sqrt(v10 * v10 + v11 * v11 + v12 * v12); |
1295 | 413 if ( v13 <= 1.0 ) |
414 { | |
2328 | 415 v55 = 1; |
1295 | 416 yaw = 0; |
417 pitch = 0; | |
418 } | |
419 else | |
420 { | |
2328 | 421 v55 = (int)v13; |
422 ySquared = v11 * v11; | |
423 xSquared = v10 * v10; | |
424 v14 = (int)sqrt(xSquared + ySquared); | |
425 yaw = stru_5C6E00->Atan2((int)v10, (int)v11); | |
426 pitch = stru_5C6E00->Atan2(v14, (int)v12); | |
1295 | 427 } |
2326
c889e521af1f
some EventCastSpell cleanups - removing labels, changing some numbers to enums
Grumpy7
parents:
2323
diff
changeset
|
428 Assert(skillMasteryPlusOne > 0 && skillMasteryPlusOne <= 4, "Invalid mastery level"); |
1295 | 429 |
430 SpriteObject a1; // [sp+38h] [bp-7Ch]@12 | |
431 //SpriteObject::SpriteObject(&a1); | |
432 | |
1519 | 433 a1.uType = stru_4E3ACC[uSpellID].uType; |
2327
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
434 switch ( uSpellID ) |
1295 | 435 { |
2327
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
436 case SPELL_FIRE_FIRE_BOLT: |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
437 case SPELL_FIRE_FIREBALL: |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
438 case SPELL_AIR_LIGHNING_BOLT: |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
439 case SPELL_WATER_ICE_BOLT: |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
440 case SPELL_WATER_ACID_BURST: |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
441 case SPELL_WATER_ICE_BLAST: |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
442 case SPELL_EARTH_BLADES: |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
443 case SPELL_EARTH_ROCK_BLAST: |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
444 a1.stru_24.Reset(); |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
445 v16 = 0; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
446 a1.spell_id = uSpellID; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
447 a1.spell_level = uSkill; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
448 a1.spell_skill = skillMasteryPlusOne; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
449 while (v16 < pObjectList->uNumObjects) |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
450 { |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
451 if ( a1.uType == pObjectList->pObjects[v16].uObjectID) |
1295 | 452 { |
2327
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
453 break; |
1295 | 454 } |
2327
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
455 v16++; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
456 } |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
457 a1.uObjectDescID = v16; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
458 *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy); |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
459 a1.vPosition.x = fromx; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
460 a1.uAttributes = 16; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
461 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz); |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
462 a1.field_60_distance_related_prolly_lod = v55; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
463 //v20 = yaw; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
464 a1.uSpriteFrameID = 0; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
465 a1.spell_caster_pid = 8000 | OBJECT_Item; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
466 a1.spell_target_pid = 0; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
467 a1.uFacing = yaw; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
468 a1.uSoundID = 0; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
469 v49 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
470 a1.Create(yaw, pitch, v49, 0); |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
471 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0); |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
472 return; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
473 case SPELL_WATER_POISON_SPRAY: |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
474 switch ( skillMasteryPlusOne ) |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
475 { |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
476 case 1: |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
477 v60 = 1; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
478 break; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
479 case 2: |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
480 v60 = 3; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
481 break; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
482 case 3: |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
483 v60 = 5; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
484 break; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
485 case 4: |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
486 v60 = 7; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
487 break; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
488 } |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
489 a1.stru_24.Reset(); |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
490 a1.spell_id = uSpellID; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
491 a1.spell_level = uSkill; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
492 a1.spell_skill = skillMasteryPlusOne; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
493 v16 = 0; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
494 while (v16 < pObjectList->uNumObjects) |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
495 { |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
496 if ( a1.uType == pObjectList->pObjects[v16].uObjectID) |
1295 | 497 { |
2327
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
498 break; |
1295 | 499 } |
2327
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
500 v16++; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
501 } |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
502 a1.uObjectDescID = v16; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
503 *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy); |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
504 a1.vPosition.x = fromx; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
505 a1.uAttributes = 16; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
506 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz); |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
507 a1.field_60_distance_related_prolly_lod = v55; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
508 //v20 = yaw; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
509 a1.uSpriteFrameID = 0; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
510 a1.spell_caster_pid = 8000 | OBJECT_Item; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
511 a1.spell_target_pid = 0; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
512 a1.uFacing = yaw; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
513 a1.uSoundID = 0; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
514 //v51 = 0; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
515 if ( v60 == 1 ) |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
516 { |
1295 | 517 v49 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; |
2101 | 518 //v47 = pitch; |
519 a1.Create(yaw, pitch, v49, 0); | |
2327
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
520 } |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
521 else |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
522 { |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
523 a7c = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
524 a8b = a7c / (v60 - 1); |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
525 for ( i = a7c / -2; i <= a7c / 2; i += a8b ) |
1295 | 526 { |
2327
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
527 a1.uFacing = i + yaw; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
528 a1.Create((signed __int16)(i + (short)yaw), pitch, pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, 0); |
1295 | 529 } |
2327
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
530 } |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
531 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0); |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
532 return; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
533 case SPELL_AIR_SPARKS: |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
534 switch ( skillMasteryPlusOne ) |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
535 { |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
536 case 1: |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
537 v60 = 3; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
538 break; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
539 case 2: |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
540 v60 = 5; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
541 break; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
542 case 3: |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
543 v60 = 7; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
544 break; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
545 case 4: |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
546 v60 = 9; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
547 break; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
548 } |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
549 a7d = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
550 a8c = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360 / (v60 - 1); |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
551 a1.stru_24.Reset(); |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
552 v25 = 0; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
553 a1.spell_id = uSpellID; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
554 a1.spell_level = uSkill; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
555 a1.spell_skill = skillMasteryPlusOne; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
556 while (v25 < pObjectList->uNumObjects) |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
557 { |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
558 if ( a1.uType == pObjectList->pObjects[v25].uObjectID) |
1295 | 559 { |
2327
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
560 break; |
1295 | 561 } |
2327
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
562 v25++; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
563 } |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
564 a1.uObjectDescID = v25; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
565 *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy); |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
566 a1.vPosition.x = fromx; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
567 a1.uAttributes = 16; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
568 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz); |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
569 a1.field_60_distance_related_prolly_lod = v55; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
570 a1.uSpriteFrameID = 0; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
571 a1.spell_caster_pid = 8000 | OBJECT_Item; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
572 a1.spell_target_pid = 4; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
573 a1.uSoundID = 0; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
574 for ( j = a7d / -2; j <= a7d / 2; j += a8c ) |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
575 { |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
576 a1.uFacing = j + yaw; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
577 a1.Create((signed __int16)(j + (short)yaw), pitch, pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, 0); |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
578 } |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
579 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0); |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
580 return; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
581 case SPELL_EARTH_DEATH_BLOSSOM: |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
582 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor ) |
2101 | 583 return; |
2327
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
584 a1.stru_24.Reset(); |
2328 | 585 v31 = 0; |
2327
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
586 a1.spell_id = uSpellID; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
587 a1.spell_level = uSkill; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
588 a1.spell_skill = skillMasteryPlusOne; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
589 while (v31 < pObjectList->uNumObjects) |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
590 { |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
591 if ( a1.uType == pObjectList->pObjects[v31].uObjectID) |
1295 | 592 { |
2327
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
593 break; |
1295 | 594 } |
2327
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
595 v31++; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
596 } |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
597 a1.uObjectDescID = v31; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
598 *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy); |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
599 a1.vPosition.x = fromx; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
600 a1.uAttributes = 16; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
601 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz); |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
602 a1.field_60_distance_related_prolly_lod = v55; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
603 a1.uSpriteFrameID = 0; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
604 a1.spell_caster_pid = 8000 | OBJECT_Item; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
605 a1.spell_target_pid = 4; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
606 a1.uSoundID = 0; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
607 //v51 = 0; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
608 v49 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
609 //v20 = yaw; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
610 v47 = (signed int)stru_5C6E00->uIntegerHalfPi / 2; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
611 a1.Create(yaw, v47, v49, 0); |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
612 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0); |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
613 return; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
614 |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
615 case SPELL_FIRE_HASTE: |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
616 if ( skillMasteryPlusOne > 0 ) |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
617 { |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
618 if ( skillMasteryPlusOne <= 2 ) |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
619 v9 = 60 * (uSkill + 60); |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
620 else if ( skillMasteryPlusOne == 3 ) |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
621 v9 = 180 * (uSkill + 20); |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
622 else if ( skillMasteryPlusOne == 4 ) |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
623 v9 = 240 * (uSkill + 15); |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
624 } |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
625 //levela = 1; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
626 //v32 = pParty->pPlayers;//[0].pConditions[1]; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
627 //do |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
628 for (uint i = 0; i < 4; ++i) |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
629 if (pParty->pPlayers[i].IsWeak()) |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
630 return; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
631 //while ( v32 <= &pParty->pPlayers[3] ); |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
632 //if ( !levela ) |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
633 // return; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
634 pParty->pPartyBuffs[PARTY_BUFF_HASTE].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(v9 * 128) * 0.033333335), |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
635 skillMasteryPlusOne, 0, 0, 0); |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
636 //v33 = spellnum_; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
637 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 0); |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
638 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 1); |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
639 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 2); |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
640 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 3); |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
641 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0);//çâóê àëòàðÿ |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
642 return; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
643 case SPELL_AIR_SHIELD: |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
644 case SPELL_EARTH_STONESKIN: |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
645 case SPELL_SPIRIT_HEROISM: |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
646 switch ( skillMasteryPlusOne ) |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
647 { |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
648 case 1: |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
649 case 2: |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
650 v9 = 300 * (uSkill + 12); |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
651 break; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
652 case 3: |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
653 v9 = 900 * (uSkill + 4); |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
654 break; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
655 case 4: |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
656 v9 = 3600 * (uSkill + 1); |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
657 break; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
658 } |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
659 switch ( uSpellID ) |
1295 | 660 { |
2327
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
661 case SPELL_AIR_SHIELD: |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
662 v60 = 0; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
663 uSkill = 14; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
664 break; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
665 case SPELL_EARTH_STONESKIN: |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
666 v60 = uSkill + 5; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
667 uSkill = 15; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
668 break; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
669 case SPELL_SPIRIT_HEROISM: |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
670 v60 = uSkill + 5; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
671 uSkill = 9; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
672 break; |
1295 | 673 } |
2327
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
674 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 0); |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
675 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 1); |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
676 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 2); |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
677 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 3); |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
678 //v52 = 0; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
679 //v50 = 0; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
680 //v48 = v60; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
681 //v46 = v15; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
682 v36 = pParty->uTimePlayed + (signed int)(signed __int64)((double)(v9 << 7) * 0.033333335); |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
683 //v37 = &pParty->pPartyBuffs[uSkill]; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
684 pParty->pPartyBuffs[uSkill].Apply(v36, skillMasteryPlusOne, v60, 0, 0); |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
685 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0); |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
686 return; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
687 case SPELL_FIRE_IMMOLATION: |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
688 if (skillMasteryPlusOne == 4) |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
689 v38 = 600 * uSkill; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
690 else |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
691 v38 = 60 * uSkill; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
692 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 0); |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
693 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 1); |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
694 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 2); |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
695 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 3); |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
696 v52 = 0; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
697 v50 = 0; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
698 v48 = uSkill; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
699 v46 = skillMasteryPlusOne; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
700 v39 = (signed __int64)((double)(v38 << 7) * 0.033333335); |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
701 v37 = &pParty->pPartyBuffs[PARTY_BUFF_IMMOLATION]; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
702 v36 = pParty->uTimePlayed + v39; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
703 v37->Apply(v36, v46, v48, v50, v52); |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
704 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0); |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
705 return; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
706 case SPELL_FIRE_PROTECTION_FROM_FIRE: |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
707 case SPELL_AIR_PROTECTION_FROM_AIR: |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
708 case SPELL_WATER_PROTECTION_FROM_WATER: |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
709 case SPELL_EARTH_PROTECTION_FROM_EARTH: |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
710 case SPELL_MIND_PROTECTION_FROM_MIND: |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
711 case SPELL_BODY_PROTECTION_FROM_BODY: |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
712 a6_4 = 3600 * uSkill; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
713 switch (skillMasteryPlusOne) |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
714 { |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
715 case 1: |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
716 v60 = uSkill; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
717 break; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
718 case 2: |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
719 v60 = 2 * uSkill; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
720 break; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
721 case 3: |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
722 v60 = 3 * uSkill; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
723 break; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
724 case 4: |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
725 v60 = 4 * uSkill; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
726 break; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
727 } |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
728 switch ( uSpellID ) |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
729 { |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
730 case SPELL_FIRE_PROTECTION_FROM_FIRE: |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
731 uSkill = PARTY_BUFF_RESIST_FIRE; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
732 break; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
733 case SPELL_AIR_PROTECTION_FROM_AIR: |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
734 uSkill = PARTY_BUFF_RESIST_AIR; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
735 break; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
736 case SPELL_WATER_PROTECTION_FROM_WATER: |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
737 uSkill = PARTY_BUFF_RESIST_WATER; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
738 break; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
739 case SPELL_EARTH_PROTECTION_FROM_EARTH: |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
740 uSkill = PARTY_BUFF_RESIST_EARTH; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
741 break; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
742 case SPELL_MIND_PROTECTION_FROM_MIND: |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
743 uSkill = PARTY_BUFF_RESIST_MIND; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
744 break; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
745 case SPELL_BODY_PROTECTION_FROM_BODY: |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
746 uSkill = PARTY_BUFF_RESIST_BODY; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
747 break; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
748 } |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
749 //v45 = spellnum_; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
750 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 0); |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
751 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 1); |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
752 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 2); |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
753 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 3); |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
754 pParty->pPartyBuffs[uSkill].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)a6_4 * 4.2666669), skillMasteryPlusOne, v60, 0, 0); |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
755 //levela = 1; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
756 //LABEL_138: |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
757 //if ( levela ) |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
758 //LABEL_139: |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
759 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0); |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
760 return; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
761 case SPELL_LIGHT_DAY_OF_THE_GODS : |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
762 switch (skillMasteryPlusOne) |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
763 { |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
764 case 2: |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
765 v42 = 10800 * uSkill; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
766 v43 = 3 * uSkill + 10; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
767 break; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
768 case 3: |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
769 v42 = 18000 * uSkill; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
770 v43 = 5 * uSkill + 10; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
771 break; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
772 case 4: |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
773 v42 = 14400 * uSkill; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
774 v43 = 4 * uSkill + 10; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
775 break; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
776 } |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
777 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 0); |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
778 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 1); |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
779 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 2); |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
780 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 3); |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
781 v39 = (signed __int64)((double)(v42 << 7) * 0.033333335); |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
782 v37 = &pParty->pPartyBuffs[PARTY_BUFF_DAY_OF_GODS]; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
783 v36 = pParty->uTimePlayed + v39; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
784 v37->Apply(v36, skillMasteryPlusOne, v43, 0, 0); |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
785 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0); |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
786 return; |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
787 default: |
5e4d90305d06
EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
Grumpy7
parents:
2326
diff
changeset
|
788 return; |
1295 | 789 } |
1296 | 790 } |
791 //----- (00427769) -------------------------------------------------------- | |
2107
85e9766d6124
sub_427769_spell to sub_427769_isSpellQuickCastableOnShiftClick
Grumpy7
parents:
2037
diff
changeset
|
792 bool sub_427769_isSpellQuickCastableOnShiftClick(unsigned int uSpellID) |
1296 | 793 { |
2328 | 794 return ( pSpellDatas[uSpellID].stats & 0xC ) != 0; |
1297 | 795 } |
796 //----- (0043AFE3) -------------------------------------------------------- | |
2323
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
797 int _43AFE3_calc_spell_damage(int spellId, int spellLevel, signed int skillMastery, int currentHp) |
1297 | 798 { |
799 int result; // eax@1 | |
800 unsigned int v5; // [sp-4h] [bp-8h]@9 | |
801 | |
802 result = 0; | |
2323
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
803 if ( spellId == SPELL_FIRE_FIRE_SPIKE ) |
1297 | 804 { |
2323
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
805 switch (skillMastery) |
1297 | 806 { |
2323
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
807 case 1: |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
808 case 2: |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
809 v5 = 6; |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
810 case 3: |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
811 v5 = 8; |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
812 case 4: |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
813 v5 = 10; |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
814 default: |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
815 return 0; |
1297 | 816 } |
2323
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
817 result = GetDiceResult(spellLevel, v5); |
1297 | 818 } |
2323
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
819 else if ( spellId == SPELL_EARTH_MASS_DISTORTION ) |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
820 result = currentHp * (pSpellDatas[SPELL_EARTH_MASS_DISTORTION].baseDamage + 2 * spellLevel) / 100; |
1297 | 821 else |
2323
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
822 result = pSpellDatas[spellId].baseDamage |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
823 + GetDiceResult(spellLevel, pSpellDatas[spellId].bonusSkillDamage); |
983b8c995127
_43AFE3_calc_spell_damage moved to spells.h, cleaned it up a bit
Grumpy7
parents:
2282
diff
changeset
|
824 |
1297 | 825 return result; |
1295 | 826 } |