comparison Spells.cpp @ 2333:82851980e3d8

Слияние
author Ritor1
date Wed, 02 Apr 2014 20:53:47 +0600
parents 4791895e4396
children ddb803517a48
comparison
equal deleted inserted replaced
2332:defd2526c94c 2333:82851980e3d8
45 {9000, 0}, {9010, 0}, {9020, 0}, {9030, 0}, {9040, 0}, {9050, 0}, {9060, 0}, {9070, 0}, {9080, 0}, {9090, 0}, {9100, 0}, 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}, 46 {545, 0},
47 {545, 0}, 47 {545, 0},
48 {555, 0} 48 {555, 0}
49 }}; 49 }};
50
51
52
53 SpellData::SpellData( __int16 innormalMana, __int16 inExpertLevelMana, __int16 inMasterLevelMana, __int16 inMagisterLevelMana,
54 __int16 inNormalLevelRecovery, __int16 inExpertLevelRecovery, __int16 inMasterLevelRecovery, __int16 inMagisterLevelRecovery,
55 __int8 inbaseDamage, __int8 inbonusSkillDamage, __int16 instats ):
56 uNormalLevelMana(innormalMana),
57 uExpertLevelMana(inExpertLevelMana),
58 uMasterLevelMana(inMasterLevelMana),
59 uMagisterLevelMana(inMagisterLevelMana),
60 uNormalLevelRecovery(inNormalLevelRecovery),
61 uExpertLevelRecovery(inExpertLevelRecovery),
62 uMasterLevelRecovery(inMasterLevelRecovery),
63 uMagisterLevelRecovery(inMagisterLevelRecovery),
64 baseDamage(inbaseDamage),
65 bonusSkillDamage(inbonusSkillDamage),
66 stats(instats)
67 {
68
69 }
70
50 //9 spellbook pages 11 spells per page 9*11 =99 +1 zero struct at 0. It counted from 1! 71 //9 spellbook pages 11 spells per page 9*11 =99 +1 zero struct at 0. It counted from 1!
51 std::array<SpellData, 100> pSpellDatas={{ 72 std::array<SpellData, 100> pSpellDatas={{
52 {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 73 SpellData(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
53 74
54 {1, 1, 1, 1, 60, 60, 60, 40, 0, 0},//0 75 SpellData(1, 1, 1, 1, 60, 60, 60, 40, 0, 0, 0),//0 fire
55 {2, 2, 2, 2, 110, 110, 100, 90, 768, 0}, 76 SpellData(2, 2, 2, 2, 110, 110, 100, 90, 3, 3, 0),
56 {3, 3, 3, 3, 120, 120, 120, 120, 0, 0}, 77 SpellData(3, 3, 3, 3, 120, 120, 120, 120, 0, 0, 0),
57 {4, 4, 4, 4, 120, 120, 120, 120, 0, 0}, 78 SpellData(4, 4, 4, 4, 120, 120, 120, 120, 0, 0, 0),
58 {5, 5, 5, 5, 120, 120, 120, 120, 0, 0}, 79 SpellData(5, 5, 5, 5, 120, 120, 120, 120, 0, 0, 0),
59 {8, 8, 8, 8, 100, 100, 90, 80, 1536, 0}, 80 SpellData(8, 8, 8, 8, 100, 100, 90, 80, 0, 6, 0),
60 {10, 10, 10, 10, 150, 150, 150, 150, 1536, 0}, 81 SpellData(10, 10, 10, 10, 150, 150, 150, 150, 0, 6, 0),
61 {15, 15, 15, 15, 120, 120, 120, 120, 1536, 0}, 82 SpellData(15, 15, 15, 15, 120, 120, 120, 120, 0, 6, 0),
62 {20, 20, 20, 20, 100, 100, 100, 90, 264, 0}, 83 SpellData(20, 20, 20, 20, 100, 100, 100, 90, 8, 1, 0),
63 {25, 25, 25, 25, 100, 100, 100, 90, 268, 0}, 84 SpellData(25, 25, 25, 25, 100, 100, 100, 90, 12, 1, 0),
64 {30, 30, 30, 30, 90, 90, 90, 90, 3855, 0}, 85 SpellData(30, 30, 30, 30, 90, 90, 90, 90, 15, 15, 0),
65 86
66 {1, 1, 1, 0, 60, 60, 60, 60, 0, 0}, //1 87 SpellData(1, 1, 1, 0, 60, 60, 60, 60, 0, 0, 0), //1 air
67 {2, 2, 2, 2, 120, 120, 120, 100, 0, 0}, 88 SpellData(2, 2, 2, 2, 120, 120, 120, 100, 0, 0, 0),
68 {3, 3, 3, 3, 120, 120, 120, 120, 0, 0}, 89 SpellData(3, 3, 3, 3, 120, 120, 120, 120, 0, 0, 0),
69 {4, 4, 4, 4, 110, 100, 90, 80, 258, 0}, 90 SpellData(4, 4, 4, 4, 110, 100, 90, 80, 2, 1, 0),
70 {5, 5, 5, 5, 90, 90, 70, 50, 0, 0}, 91 SpellData(5, 5, 5, 5, 90, 90, 70, 50, 0, 0, 0),
71 {8, 8, 8, 8, 120, 120, 120, 120, 0, 0}, 92 SpellData(8, 8, 8, 8, 120, 120, 120, 120, 0, 0, 0),
72 {10, 10, 10, 10, 100, 100, 90, 70, 2048, 0}, 93 SpellData(10, 10, 10, 10, 100, 100, 90, 70, 0, 8, 0),
73 {15, 15, 15, 15, 200, 200, 200, 200, 0, 0}, 94 SpellData(15, 15, 15, 15, 200, 200, 200, 200, 0, 0, 0),
74 {20, 20, 20, 20, 100, 100, 100, 90, 2570, 0}, 95 SpellData(20, 20, 20, 20, 100, 100, 100, 90, 10, 10, 0),
75 {25, 25, 25, 25, 250, 250, 250, 250, 0, 0}, 96 SpellData(25, 25, 25, 25, 250, 250, 250, 250, 0, 0, 0),
76 {30, 30, 30, 30, 90, 90, 90, 90, 276, 0}, 97 SpellData(30, 30, 30, 30, 90, 90, 90, 90, 20, 1, 0),
77 98
78 {1, 1, 1, 1, 60, 60, 60, 20, 0, 0}, //2 99 SpellData(1, 1, 1, 1, 60, 60, 60, 20, 0, 0, 0), //2 water
79 {2, 2, 2, 2, 110, 100, 90, 70, 514, 0}, 100 SpellData(2, 2, 2, 2, 110, 100, 90, 70, 2, 2, 0),
80 {3, 3, 3, 3, 120, 120, 120, 120, 0, 0}, 101 SpellData(3, 3, 3, 3, 120, 120, 120, 120, 0, 0, 0),
81 {4, 4, 4, 4, 110, 100, 90, 80, 1024, 0}, 102 SpellData(4, 4, 4, 4, 110, 100, 90, 80, 0, 4, 0),
82 {5, 5, 5, 5, 150, 150, 150, 150, 0, 0}, 103 SpellData(5, 5, 5, 5, 150, 150, 150, 150, 0, 0, 0),
83 {8, 8, 8, 8, 200, 200, 200, 200, 0, 0}, 104 SpellData(8, 8, 8, 8, 200, 200, 200, 200, 0, 0, 0),
84 {10, 10, 10, 10, 100, 100, 90, 80, 2313, 0}, 105 SpellData(10, 10, 10, 10, 100, 100, 90, 80, 9, 9, 0),
85 {15, 15, 15, 15, 140, 140, 140, 140, 0, 0}, 106 SpellData(15, 15, 15, 15, 140, 140, 140, 140, 0, 0, 0),
86 {20, 20, 20, 20, 200, 200, 200, 200, 0, 0}, 107 SpellData(20, 20, 20, 20, 200, 200, 200, 200, 0, 0, 0),
87 {25, 25, 25, 25, 80, 80, 80, 80, 780, 0}, 108 SpellData(25, 25, 25, 25, 80, 80, 80, 80, 12, 3, 0),
88 {30, 30, 30, 30, 250, 250, 250, 250, 0, 0}, 109 SpellData(30, 30, 30, 30, 250, 250, 250, 250, 0, 0, 0),
89 110
90 {1, 1, 1, 1, 80, 80, 80, 80, 0, 0}, //3 111 SpellData(1, 1, 1, 1, 80, 80, 80, 80, 0, 0, 0), //3 earth
91 {2, 2, 2, 2, 100, 100, 100, 100, 0, 0}, 112 SpellData(2, 2, 2, 2, 100, 100, 100, 100, 0, 0, 0),
92 {3, 3, 3, 3, 120, 120, 120, 120, 0, 0}, 113 SpellData(3, 3, 3, 3, 120, 120, 120, 120, 0, 0, 0),
93 {4, 4, 4, 4, 110, 100, 90, 80, 773, 0}, 114 SpellData(4, 4, 4, 4, 110, 100, 90, 80, 5, 3, 0),
94 {5, 5, 5, 5, 120, 120, 120, 120, 0, 0}, 115 SpellData(5, 5, 5, 5, 120, 120, 120, 120, 0, 0, 0),
95 {8, 8, 8, 8, 100, 100, 90, 80, 2304, 0}, 116 SpellData(8, 8, 8, 8, 100, 100, 90, 80, 0, 9, 0),
96 {10, 10, 10, 10, 140, 140, 140, 140, 0, 0}, 117 SpellData(10, 10, 10, 10, 140, 140, 140, 140, 0, 0, 0),
97 {15, 15, 15, 15, 90, 90, 90, 80, 2048, 0}, 118 SpellData(15, 15, 15, 15, 90, 90, 90, 80, 0, 8, 0),
98 {20, 20, 20, 20, 150, 150, 150, 150, 0, 0}, 119 SpellData(20, 20, 20, 20, 150, 150, 150, 150, 0, 0, 0),
99 {25, 25, 25, 25, 100, 100, 100, 90, 276, 0}, 120 SpellData(25, 25, 25, 25, 100, 100, 100, 90, 20, 1, 0),
100 {30, 30, 30, 30, 90, 90, 90, 90, 25, 0}, 121 SpellData(30, 30, 30, 30, 90, 90, 90, 90, 25, 0, 0),
101 122
102 {1, 1, 1, 1, 100, 100, 100, 100, 0, 0}, //4 123 SpellData(1, 1, 1, 1, 100, 100, 100, 100, 0, 0, 0), //4 spirit
103 {2, 2, 2, 2, 100, 100, 100, 100, 0, 0}, 124 SpellData(2, 2, 2, 2, 100, 100, 100, 100, 0, 0, 0),
104 {3, 3, 3, 3, 90, 90, 90, 90, 0, 0}, 125 SpellData(3, 3, 3, 3, 90, 90, 90, 90, 0, 0, 0),
105 {4, 4, 4, 4, 120, 120, 120, 120, 0, 0}, 126 SpellData(4, 4, 4, 4, 120, 120, 120, 120, 0, 0, 0),
106 {5, 5, 5, 5, 120, 120, 120, 120, 0, 0}, 127 SpellData(5, 5, 5, 5, 120, 120, 120, 120, 0, 0, 0),
107 {8, 8, 8, 8, 120, 120, 120, 120, 0, 0}, 128 SpellData(8, 8, 8, 8, 120, 120, 120, 120, 0, 0, 0),
108 {10, 10, 10, 10, 120, 120, 120, 120, 0, 0}, 129 SpellData(10, 10, 10, 10, 120, 120, 120, 120, 0, 0, 0),
109 {15, 15, 15, 15, 100, 100, 100, 100, 2058, 0}, 130 SpellData(15, 15, 15, 15, 100, 100, 100, 100, 10, 8, 0),
110 {20, 20, 20, 20, 240, 240, 240, 240, 0, 0}, 131 SpellData(20, 20, 20, 20, 240, 240, 240, 240, 0, 0, 0),
111 {25, 25, 25, 25, 150, 150, 150, 150, 0, 0}, 132 SpellData(25, 25, 25, 25, 150, 150, 150, 150, 0, 0, 0),
112 {30, 30, 30, 30, 1000, 1000, 1000, 1000, 0, 0}, 133 SpellData(30, 30, 30, 30, 1000, 1000, 1000, 1000, 0, 0, 0),
113 134
114 {1, 1, 1, 1, 120, 120, 120, 120, 0, 0}, //5 135 SpellData(1, 1, 1, 1, 120, 120, 120, 120, 0, 0, 0), //5 mind
115 {2, 2, 2, 2, 110, 110, 110, 110, 771, 0}, 136 SpellData(2, 2, 2, 2, 110, 110, 110, 110, 3, 3, 0),
116 {3, 3, 3, 3, 120, 120, 120, 120, 0, 0}, 137 SpellData(3, 3, 3, 3, 120, 120, 120, 120, 0, 0, 0),
117 {4, 4, 4, 4, 110, 100, 90, 80, 0, 0}, 138 SpellData(4, 4, 4, 4, 110, 100, 90, 80, 0, 0, 0),
118 {5, 5, 5, 5, 100, 100, 100, 100, 0, 0}, 139 SpellData(5, 5, 5, 5, 100, 100, 100, 100, 0, 0, 0),
119 {8, 8, 8, 8, 120, 120, 120, 120, 0, 0}, 140 SpellData(8, 8, 8, 8, 120, 120, 120, 120, 0, 0, 0),
120 {10, 10, 10, 10, 120, 120, 120, 120, 0, 0}, 141 SpellData(10, 10, 10, 10, 120, 120, 120, 120, 0, 0, 0),
121 {15, 15, 15, 15, 80, 80, 80, 80, 0, 0}, 142 SpellData(15, 15, 15, 15, 80, 80, 80, 80, 0, 0, 0),
122 {20, 20, 20, 20, 120, 120, 120, 120, 0, 0}, 143 SpellData(20, 20, 20, 20, 120, 120, 120, 120, 0, 0, 0),
123 {25, 25, 25, 25, 110, 110, 110, 100, 268, 0}, 144 SpellData(25, 25, 25, 25, 110, 110, 110, 100, 12, 12, 0),
124 {30, 30, 30, 30, 120, 120, 120, 120, 0, 0}, 145 SpellData(30, 30, 30, 30, 120, 120, 120, 120, 0, 0, 0),
125 146
126 {1, 1, 1, 1, 120, 120, 120, 120, 0, 0}, //6 147 SpellData(1, 1, 1, 1, 120, 120, 120, 120, 0, 0, 0), //6 body
127 {2, 2, 2, 2, 100, 100, 100, 100, 0, 0}, 148 SpellData(2, 2, 2, 2, 100, 100, 100, 100, 0, 0, 0),
128 {3, 3, 3, 3, 120, 120, 120, 120, 0, 0}, 149 SpellData(3, 3, 3, 3, 120, 120, 120, 120, 0, 0, 0),
129 {4, 4, 4, 4, 110, 100, 90, 80, 520, 0}, 150 SpellData(4, 4, 4, 4, 110, 100, 90, 80, 8, 2, 0),
130 {5, 5, 5, 5, 110, 110, 110, 110, 0, 0}, 151 SpellData(5, 5, 5, 5, 110, 110, 110, 110, 0, 0, 0),
131 {8, 8, 8, 8, 120, 120, 120, 120, 0, 0}, 152 SpellData(8, 8, 8, 8, 120, 120, 120, 120, 0, 0, 0),
132 {10, 10, 10, 10, 120, 120, 120, 120, 0, 0}, 153 SpellData(10, 10, 10, 10, 120, 120, 120, 120, 0, 0, 0),
133 {15, 15, 15, 15, 120, 120, 120, 120, 0, 0}, 154 SpellData(15, 15, 15, 15, 120, 120, 120, 120, 0, 0, 0),
134 {20, 20, 20, 20, 120, 120, 120, 120, 0, 0}, 155 SpellData(20, 20, 20, 20, 120, 120, 120, 120, 0, 0, 0),
135 {25, 25, 25, 25, 110, 110, 110, 100, 1310, 0}, 156 SpellData(25, 25, 25, 25, 110, 110, 110, 100, 30, 5, 0),
136 {30, 30, 30, 30, 100, 100, 100, 100, 0, 0}, 157 SpellData(30, 30, 30, 30, 100, 100, 100, 100, 0, 0, 0),
137 158
138 {5, 5, 5, 5, 110, 100, 90, 80, 1024, 0}, //7 159 SpellData(5, 5, 5, 5, 110, 100, 90, 80, 0, 4, 0), //7 light
139 {10, 10, 10, 10, 120, 110, 100, 90, 4112, 0}, 160 SpellData(10, 10, 10, 10, 120, 110, 100, 90, 16, 16, 0),
140 {15, 15, 15, 15, 120, 110, 100, 90, 0, 0}, 161 SpellData(15, 15, 15, 15, 120, 110, 100, 90, 0, 0, 0),
141 {20, 20, 20, 20, 160, 140, 120, 100, 0, 0}, 162 SpellData(20, 20, 20, 20, 160, 140, 120, 100, 0, 0, 0),
142 {25, 25, 25, 25, 140, 140, 140, 140, 0, 0}, 163 SpellData(25, 25, 25, 25, 140, 140, 140, 140, 0, 0, 0),
143 {30, 30, 30, 30, 500, 500, 500, 500, 0, 0}, 164 SpellData(30, 30, 30, 30, 500, 500, 500, 500, 0, 0, 0),
144 {35, 35, 35, 35, 135, 135, 120, 100, 281, 0}, 165 SpellData(35, 35, 35, 35, 135, 135, 120, 100, 25, 1, 0),
145 {40, 40, 40, 40, 500, 500, 500, 500, 0, 0}, 166 SpellData(40, 40, 40, 40, 500, 500, 500, 500, 0, 0, 0),
146 {45, 45, 45, 45, 250, 250, 250, 250, 0, 0}, 167 SpellData(45, 45, 45, 45, 250, 250, 250, 250, 0, 0, 0),
147 {50, 50, 50, 50, 150, 150, 150, 135, 5140, 0}, 168 SpellData(50, 50, 50, 50, 150, 150, 150, 135, 20, 20, 0),
148 {55, 55, 55, 55, 300, 300, 300, 300, 0, 0}, 169 SpellData(55, 55, 55, 55, 300, 300, 300, 300, 0, 0, 0),
149 170
150 {10, 10, 10, 10, 140, 140, 140, 140, 0, 0}, //8 171 SpellData(10, 10, 10, 10, 140, 140, 140, 140, 0, 0, 0), //8 dark
151 {15, 15, 15, 15, 120, 110, 100, 90, 2585, 0}, 172 SpellData(15, 15, 15, 15, 120, 110, 100, 90, 25, 10, 0),
152 {20, 20, 20, 20, 120, 100, 90, 120, 0, 0}, 173 SpellData(20, 20, 20, 20, 120, 100, 90, 120, 0, 0, 0),
153 {25, 25, 25, 25, 120, 120, 120, 120, 0, 0}, 174 SpellData(25, 25, 25, 25, 120, 120, 120, 120, 0, 0, 0),
154 {30, 30, 30, 30, 90, 90, 80, 70, 1542, 0}, 175 SpellData(30, 30, 30, 30, 90, 90, 80, 70, 6, 6, 0),
155 {35, 35, 35, 35, 120, 120, 100, 80, 0, 0}, 176 SpellData(35, 35, 35, 35, 120, 120, 100, 80, 0, 0, 0),
156 {40, 40, 40, 40, 110, 110, 110, 110, 0, 0}, 177 SpellData(40, 40, 40, 40, 110, 110, 110, 110, 0, 0, 0),
157 {45, 45, 45, 45, 200, 200, 200, 150, 0, 0}, 178 SpellData(45, 45, 45, 45, 200, 200, 200, 150, 0, 0, 0),
158 {50, 50, 50, 50, 120, 120, 120, 100, 6400, 0}, 179 SpellData(50, 50, 50, 50, 120, 120, 120, 100, 0, 25, 0),
159 {55, 55, 55, 55, 250, 250, 250, 250, 306, 0}, 180 SpellData(55, 55, 55, 55, 250, 250, 250, 250, 50, 1, 0),
160 {60, 60, 60, 60, 300, 300, 300, 300, 2073, 0} 181 SpellData(60, 60, 60, 60, 300, 300, 300, 300, 25, 8, 0)
161 }}; 182 }};
162
163 183
164 std::array<unsigned int, 25> wand_spell_ids = 184 std::array<unsigned int, 25> wand_spell_ids =
165 { 185 {
166 // 135 Wand of Fire 136 Wand of Sparks 137 Wand of Poison 138 Wand of Stunning 139 Wand of Harm 186 // 135 Wand of Fire 136 Wand of Sparks 137 Wand of Poison 138 Wand of Stunning 139 Wand of Harm
167 SPELL_FIRE_FIRE_BOLT, SPELL_AIR_SPARKS, SPELL_WATER_POISON_SPRAY, SPELL_EARTH_STUN, SPELL_BODY_HARM, 187 SPELL_FIRE_FIRE_BOLT, SPELL_AIR_SPARKS, SPELL_WATER_POISON_SPRAY, SPELL_EARTH_STUN, SPELL_BODY_HARM,
328 pSpellDatas[i].stats |= strchr(tokens[10], 'c') || strchr(tokens[10], 'C') ? 4 : 0; 348 pSpellDatas[i].stats |= strchr(tokens[10], 'c') || strchr(tokens[10], 'C') ? 4 : 0;
329 pSpellDatas[i].stats |= strchr(tokens[10], 'x') || strchr(tokens[10], 'X') ? 8 : 0; 349 pSpellDatas[i].stats |= strchr(tokens[10], 'x') || strchr(tokens[10], 'X') ? 8 : 0;
330 if ((i % 11)==0) 350 if ((i % 11)==0)
331 strtok(NULL, "\r"); 351 strtok(NULL, "\r");
332 } 352 }
333
334 } 353 }
335 //----- (00448DF8) -------------------------------------------------------- 354 //----- (00448DF8) --------------------------------------------------------
336 void __fastcall EventCastSpell(int uSpellID, int uSkillLevel, int uSkill, int fromx, int fromy, int fromz, int tox, int toy, int toz)//sub_448DF8 355 void __fastcall EventCastSpell(int uSpellID, int uSkillLevel, int uSkill, int fromx, int fromy, int fromz, int tox, int toy, int toz)//sub_448DF8
337 { 356 {
338 int v9; // esi@1 357 int v9; // esi@1
339 double v10; // st7@4 358 signed __int64 v10; // st7@4
340 double v11; // st6@4 359 signed __int64 v11; // st6@4
341 double v12; // st5@4 360 signed __int64 v12; // st5@4
342 double v13; // st7@6 361 double v13; // st7@6
343 int v14; // ST44_4@7 362 int v14; // ST44_4@7
344 signed int v15; // ebx@9 363 uint skillMasteryPlusOne; // ebx@9
345 signed int v16; // edx@15 364 uint v16; // edx@15
346 char *v17; // ecx@16
347 unsigned __int16 v18; // ax@20
348 char *v19; // ecx@31
349 int v20; // edx@35
350 signed int v21; // edx@37
351 char *v22; // ecx@38
352 unsigned __int16 v23; // ax@41
353 int i; // esi@42 365 int i; // esi@42
354 signed int v25; // edx@55
355 char *v26; // ecx@56
356 unsigned __int16 v27; // ax@59
357 int j; // esi@60 366 int j; // esi@60
358 signed int v29; // edx@66
359 char *v30; // ecx@67
360 unsigned __int16 v31; // ax@70
361 //Player *v32; // eax@80
362 //unsigned __int16 v33; // si@85
363 int v34; // eax@96
364 int v35; // eax@97
365 unsigned __int64 v36; // qax@99 367 unsigned __int64 v36; // qax@99
366 SpellBuff *v37; // ecx@99 368 SpellBuff *v37; // ecx@99
367 int v38; // esi@103 369 int v38; // esi@103
368 signed __int64 v39; // qax@105 370 signed __int64 v39; // qax@105
369 int v40; // ebx@108
370 int v41; // ebx@109
371 int v42; // esi@111 371 int v42; // esi@111
372 int v43; // ebx@111 372 int v43; // ebx@111
373 int v44; // eax@117
374 //unsigned __int16 v45; // si@137
375 unsigned __int16 v46; // [sp-8h] [bp-BCh]@99
376 int v47; // [sp-4h] [bp-B8h]@35 373 int v47; // [sp-4h] [bp-B8h]@35
377 unsigned __int16 v48; // [sp-4h] [bp-B8h]@99
378 int v49; // [sp+0h] [bp-B4h]@35 374 int v49; // [sp+0h] [bp-B4h]@35
379 int v50; // [sp+0h] [bp-B4h]@99
380 int v51; // [sp+4h] [bp-B0h]@35
381 unsigned __int8 v52; // [sp+4h] [bp-B0h]@99
382 float v53; // [sp+14h] [bp-A0h]@4
383 float v54; // [sp+18h] [bp-9Ch]@4
384 int v55; // [sp+28h] [bp-8Ch]@7 375 int v55; // [sp+28h] [bp-8Ch]@7
385 unsigned int yaw; // [sp+30h] [bp-84h]@7 376 unsigned int yaw; // [sp+30h] [bp-84h]@7
386 int pitch; // [sp+34h] [bp-80h]@7 377 int pitch; // [sp+34h] [bp-80h]@7
387 //SpriteObject a1; // [sp+38h] [bp-7Ch]@12
388 int v59; // [sp+A8h] [bp-Ch]@1
389 int v60; // [sp+ACh] [bp-8h]@1 378 int v60; // [sp+ACh] [bp-8h]@1
390 //int spellnum_; // [sp+B0h] [bp-4h]@1
391 //signed int levela; // [sp+BCh] [bp+8h]@80
392 int a6_4; // [sp+C8h] [bp+14h]@117 379 int a6_4; // [sp+C8h] [bp+14h]@117
393 float a7a; // [sp+CCh] [bp+18h]@6
394 signed int a7b; // [sp+CCh] [bp+18h]@12
395 int a7c; // [sp+CCh] [bp+18h]@29 380 int a7c; // [sp+CCh] [bp+18h]@29
396 int a7d; // [sp+CCh] [bp+18h]@55 381 int a7d; // [sp+CCh] [bp+18h]@55
397 float a8a; // [sp+D0h] [bp+1Ch]@6 382 signed __int64 xSquared; // [sp+D0h] [bp+1Ch]@6
398 int a8b; // [sp+D0h] [bp+1Ch]@37 383 int a8b; // [sp+D0h] [bp+1Ch]@37
399 int a8c; // [sp+D0h] [bp+1Ch]@55 384 int a8c; // [sp+D0h] [bp+1Ch]@55
400 float toza; // [sp+D4h] [bp+20h]@6 385 signed __int64 ySquared; // [sp+D4h] [bp+20h]@6
401 386
402 v9 = 0; 387 v9 = 0;
403 v59 = uSkillLevel + 1; 388 skillMasteryPlusOne = uSkillLevel + 1;
404 //spellnum_ = uSpellID; 389 //spellnum_ = uSpellID;
405 v60 = 0; 390 v60 = 0;
406 if ( tox || toy || toz ) 391 if ( tox || toy || toz )
407 { 392 {
408 v10 = (double)tox - (double)fromx; 393 v10 = tox - fromx;
409 v53 = v10; 394 v11 = toy - fromy;
410 v11 = (double)toy - (double)fromy; 395 v12 = toz - fromz;
411 v54 = v11;
412 v12 = (double)toz;
413 } 396 }
414 else 397 else
415 { 398 {
416 v10 = (double)pParty->vPosition.x - (double)fromx; 399 v10 = pParty->vPosition.x - fromx;
417 v53 = v10; 400 v11 = pParty->vPosition.y - fromy;
418 v11 = (double)pParty->vPosition.y - (double)fromy; 401 v12 = (pParty->vPosition.z + pParty->sEyelevel) - fromz;
419 v54 = v11; 402 }
420 v12 = (double)(pParty->vPosition.z + pParty->sEyelevel); 403 v13 = sqrt(v10 * v10 + v11 * v11 + v12 * v12);
421 }
422 a7a = v12 - (double)fromz;
423 toza = v11 * v11;
424 a8a = v10 * v10;
425 v13 = sqrt(a7a * a7a + a8a + toza);
426 if ( v13 <= 1.0 ) 404 if ( v13 <= 1.0 )
427 { 405 {
428 LOBYTE(v55) = 1; 406 v55 = 1;
429 yaw = 0; 407 yaw = 0;
430 pitch = 0; 408 pitch = 0;
431 } 409 }
432 else 410 else
433 { 411 {
434 v55 = (signed __int64)v13; 412 v55 = (int)v13;
435 v14 = (signed __int64)sqrt(a8a + toza); 413 ySquared = v11 * v11;
436 yaw = stru_5C6E00->Atan2((signed __int64)v53, (signed __int64)v54); 414 xSquared = v10 * v10;
437 pitch = stru_5C6E00->Atan2(v14, (signed __int64)a7a); 415 v14 = (int)sqrt(xSquared + ySquared);
438 } 416 yaw = stru_5C6E00->Atan2((int)v10, (int)v11);
439 v15 = v59; 417 pitch = stru_5C6E00->Atan2(v14, (int)v12);
440 if ( v59 <= 0 || v59 > 4 ) 418 }
441 v15 = 1; 419 Assert(skillMasteryPlusOne > 0 && skillMasteryPlusOne <= 4, "Invalid mastery level");
442 a7b = v15;
443 420
444 SpriteObject a1; // [sp+38h] [bp-7Ch]@12 421 SpriteObject a1; // [sp+38h] [bp-7Ch]@12
445 //SpriteObject::SpriteObject(&a1); 422 //SpriteObject::SpriteObject(&a1);
446 423
447 a1.uType = stru_4E3ACC[uSpellID].uType; 424 switch ( uSpellID )
448 if ( uSpellID > 58 ) 425 {
449 { 426 case SPELL_FIRE_FIRE_BOLT:
450 if ( uSpellID == SPELL_BODY_PROTECTION_FROM_BODY ) 427 case SPELL_FIRE_FIREBALL:
451 goto LABEL_117; 428 case SPELL_AIR_LIGHNING_BOLT:
452 if ( uSpellID != SPELL_LIGHT_DAY_OF_THE_GODS ) 429 case SPELL_WATER_ICE_BOLT:
453 return; 430 case SPELL_WATER_ACID_BURST:
454 v40 = v15 - 2; 431 case SPELL_WATER_ICE_BLAST:
455 if ( v40 ) 432 case SPELL_EARTH_BLADES:
456 { 433 case SPELL_EARTH_ROCK_BLAST:
457 v41 = v40 - 1; 434 case SPELL_WATER_POISON_SPRAY:
458 if ( !v41 ) 435 case SPELL_AIR_SPARKS:
459 { 436 case SPELL_EARTH_DEATH_BLOSSOM:
437 a1.uType = stru_4E3ACC[uSpellID].uType;
438 a1.stru_24.Reset();
439 a1.spell_id = uSpellID;
440 a1.spell_level = uSkill;
441 a1.spell_skill = skillMasteryPlusOne;
442 v16 = 0;
443 while (v16 < pObjectList->uNumObjects)
444 {
445 if ( a1.uType == pObjectList->pObjects[v16].uObjectID)
446 {
447 break;
448 }
449 v16++;
450 }
451 a1.uObjectDescID = v16;
452 a1.vPosition.x = fromx;
453 a1.vPosition.y = fromy;
454 a1.vPosition.z = fromz;
455 a1.uAttributes = 16;
456 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz);
457 a1.field_60_distance_related_prolly_lod = v55;
458 a1.uSpriteFrameID = 0;
459 a1.spell_caster_pid = 8000 | OBJECT_Item;
460 a1.uSoundID = 0;
461 break;
462 }
463
464 switch ( uSpellID )
465 {
466 case SPELL_FIRE_FIRE_BOLT:
467 case SPELL_FIRE_FIREBALL:
468 case SPELL_AIR_LIGHNING_BOLT:
469 case SPELL_WATER_ICE_BOLT:
470 case SPELL_WATER_ACID_BURST:
471 case SPELL_WATER_ICE_BLAST:
472 case SPELL_EARTH_BLADES:
473 case SPELL_EARTH_ROCK_BLAST:
474 //v20 = yaw;
475 a1.spell_target_pid = 0;
476 a1.uFacing = yaw;
477 a1.uSoundID = 0;
478 v49 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed;
479 a1.Create(yaw, pitch, v49, 0);
480 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0);
481 return;
482 case SPELL_WATER_POISON_SPRAY:
483 switch ( skillMasteryPlusOne )
484 {
485 case 1:
486 v60 = 1;
487 break;
488 case 2:
489 v60 = 3;
490 break;
491 case 3:
492 v60 = 5;
493 break;
494 case 4:
495 v60 = 7;
496 break;
497 }
498 a1.spell_target_pid = 0;
499 a1.uFacing = yaw;
500 if ( v60 == 1 )
501 {
502 v49 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed;
503 a1.Create(yaw, pitch, v49, 0);
504 }
505 else
506 {
507 a7c = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360;
508 a8b = a7c / (v60 - 1);
509 for ( i = a7c / -2; i <= a7c / 2; i += a8b )
510 {
511 a1.uFacing = i + yaw;
512 a1.Create((signed __int16)(i + (short)yaw), pitch, pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, 0);
513 }
514 }
515 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0);
516 return;
517 case SPELL_AIR_SPARKS:
518 switch ( skillMasteryPlusOne )
519 {
520 case 1:
521 v60 = 3;
522 break;
523 case 2:
524 v60 = 5;
525 break;
526 case 3:
527 v60 = 7;
528 break;
529 case 4:
530 v60 = 9;
531 break;
532 }
533 a7d = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360;
534 a8c = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360 / (v60 - 1);
535 a1.spell_target_pid = 4;
536 for ( j = a7d / -2; j <= a7d / 2; j += a8c )
537 {
538 a1.uFacing = j + yaw;
539 a1.Create((signed __int16)(j + (short)yaw), pitch, pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, 0);
540 }
541 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0);
542 return;
543 case SPELL_EARTH_DEATH_BLOSSOM:
544 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
545 return;
546 a1.spell_target_pid = 4;
547 v49 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed;
548 v47 = (signed int)stru_5C6E00->uIntegerHalfPi / 2;
549 a1.Create(yaw, v47, v49, 0);
550 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0);
551 return;
552
553 case SPELL_FIRE_HASTE:
554 if ( skillMasteryPlusOne > 0 )
555 {
556 if ( skillMasteryPlusOne <= 2 )
557 v9 = 60 * (uSkill + 60);
558 else if ( skillMasteryPlusOne == 3 )
559 v9 = 180 * (uSkill + 20);
560 else if ( skillMasteryPlusOne == 4 )
561 v9 = 240 * (uSkill + 15);
562 }
563 for (uint i = 0; i < 4; ++i)
564 if (pParty->pPlayers[i].IsWeak())
565 return;
566 pParty->pPartyBuffs[PARTY_BUFF_HASTE].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(v9 * 128) * 0.033333335), skillMasteryPlusOne, 0, 0, 0);
567 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 0);
568 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 1);
569 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 2);
570 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 3);
571 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0);//
572 return;
573 case SPELL_AIR_SHIELD:
574 case SPELL_EARTH_STONESKIN:
575 case SPELL_SPIRIT_HEROISM:
576 switch ( skillMasteryPlusOne )
577 {
578 case 1:
579 case 2:
580 v9 = 300 * (uSkill + 12);
581 break;
582 case 3:
583 v9 = 900 * (uSkill + 4);
584 break;
585 case 4:
586 v9 = 3600 * (uSkill + 1);
587 break;
588 }
589 switch ( uSpellID )
590 {
591 case SPELL_AIR_SHIELD:
592 v60 = 0;
593 uSkill = 14;
594 break;
595 case SPELL_EARTH_STONESKIN:
596 v60 = uSkill + 5;
597 uSkill = 15;
598 break;
599 case SPELL_SPIRIT_HEROISM:
600 v60 = uSkill + 5;
601 uSkill = 9;
602 break;
603 }
604 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 0);
605 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 1);
606 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 2);
607 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 3);
608 v36 = pParty->uTimePlayed + (signed int)(signed __int64)((double)(v9 << 7) * 0.033333335);
609 pParty->pPartyBuffs[uSkill].Apply(v36, skillMasteryPlusOne, v60, 0, 0);
610 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0);
611 return;
612 case SPELL_FIRE_IMMOLATION:
613 if (skillMasteryPlusOne == 4)
614 v38 = 600 * uSkill;
615 else
616 v38 = 60 * uSkill;
617 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 0);
618 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 1);
619 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 2);
620 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 3);
621 v39 = (signed __int64)((double)(v38 << 7) * 0.033333335);
622 v36 = pParty->uTimePlayed + v39;
623 pParty->pPartyBuffs[PARTY_BUFF_IMMOLATION].Apply(v36, skillMasteryPlusOne, uSkill, 0, 0);
624 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0);
625 return;
626 case SPELL_FIRE_PROTECTION_FROM_FIRE:
627 case SPELL_AIR_PROTECTION_FROM_AIR:
628 case SPELL_WATER_PROTECTION_FROM_WATER:
629 case SPELL_EARTH_PROTECTION_FROM_EARTH:
630 case SPELL_MIND_PROTECTION_FROM_MIND:
631 case SPELL_BODY_PROTECTION_FROM_BODY:
632 a6_4 = 3600 * uSkill;
633 switch (skillMasteryPlusOne)
634 {
635 case 1:
636 v60 = uSkill;
637 break;
638 case 2:
639 v60 = 2 * uSkill;
640 break;
641 case 3:
642 v60 = 3 * uSkill;
643 break;
644 case 4:
645 v60 = 4 * uSkill;
646 break;
647 }
648 switch ( uSpellID )
649 {
650 case SPELL_FIRE_PROTECTION_FROM_FIRE:
651 uSkill = PARTY_BUFF_RESIST_FIRE;
652 break;
653 case SPELL_AIR_PROTECTION_FROM_AIR:
654 uSkill = PARTY_BUFF_RESIST_AIR;
655 break;
656 case SPELL_WATER_PROTECTION_FROM_WATER:
657 uSkill = PARTY_BUFF_RESIST_WATER;
658 break;
659 case SPELL_EARTH_PROTECTION_FROM_EARTH:
660 uSkill = PARTY_BUFF_RESIST_EARTH;
661 break;
662 case SPELL_MIND_PROTECTION_FROM_MIND:
663 uSkill = PARTY_BUFF_RESIST_MIND;
664 break;
665 case SPELL_BODY_PROTECTION_FROM_BODY:
666 uSkill = PARTY_BUFF_RESIST_BODY;
667 break;
668 }
669 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 0);
670 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 1);
671 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 2);
672 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 3);
673 pParty->pPartyBuffs[uSkill].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)a6_4 * 4.2666669), skillMasteryPlusOne, v60, 0, 0);
674 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0);
675 return;
676 case SPELL_LIGHT_DAY_OF_THE_GODS :
677 switch (skillMasteryPlusOne)
678 {
679 case 2:
680 v42 = 10800 * uSkill;
681 v43 = 3 * uSkill + 10;
682 break;
683 case 3:
684 v42 = 18000 * uSkill;
685 v43 = 5 * uSkill + 10;
686 break;
687 case 4:
460 v42 = 14400 * uSkill; 688 v42 = 14400 * uSkill;
461 v43 = 4 * uSkill + 10; 689 v43 = 4 * uSkill + 10;
462 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 0); 690 break;
463 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 1u); 691 }
464 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 2u); 692 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 0);
465 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 3u); 693 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 1);
466 v39 = (signed __int64)((double)(v42 << 7) * 0.033333335); 694 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 2);
467 v37 = &pParty->pPartyBuffs[PARTY_BUFF_DAY_OF_GODS]; 695 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 3);
468 v36 = pParty->uTimePlayed + v39; 696 v39 = (signed __int64)((double)(v42 << 7) * 0.033333335);
469 v37->Apply(v36, a7b, v43, 0, 0); 697 v36 = pParty->uTimePlayed + v39;
470 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0); 698 pParty->pPartyBuffs[PARTY_BUFF_DAY_OF_GODS].Apply(v36, skillMasteryPlusOne, v43, 0, 0);
471 return; 699 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0);
472 } 700 return;
473 if ( v41 == 1 ) 701 default:
474 { 702 return;
475 v42 = 18000 * uSkill; 703 }
476 v43 = 5 * uSkill + 10;
477 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 0);
478 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 1u);
479 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 2u);
480 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 3u);
481 v39 = (signed __int64)((double)(v42 << 7) * 0.033333335);
482 v37 = &pParty->pPartyBuffs[PARTY_BUFF_DAY_OF_GODS];
483 v36 = pParty->uTimePlayed + v39;
484 v37->Apply(v36, a7b, v43, 0, 0);
485 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0);
486 return;
487 }
488 }
489 v42 = 10800 * uSkill;
490 v43 = 3 * uSkill + 10;
491 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 0);
492 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 1u);
493 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 2u);
494 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 3u);
495 v39 = (signed __int64)((double)(v42 << 7) * 0.033333335);
496 v37 = &pParty->pPartyBuffs[PARTY_BUFF_DAY_OF_GODS];
497 v36 = pParty->uTimePlayed + v39;
498 v37->Apply(v36, a7b, v43, 0, 0);
499 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0);
500 return;
501 }
502 if ( uSpellID != 58 )
503 {
504 switch ( uSpellID )
505 {
506 case SPELL_FIRE_FIRE_BOLT:
507 case SPELL_FIRE_FIREBALL:
508 case SPELL_AIR_LIGHNING_BOLT:
509 case SPELL_WATER_ICE_BOLT:
510 case SPELL_WATER_ACID_BURST:
511 case SPELL_WATER_ICE_BLAST:
512 case SPELL_EARTH_BLADES:
513 case SPELL_EARTH_ROCK_BLAST:
514 a1.stru_24.Reset();
515 v16 = 0;
516 a1.spell_id = uSpellID;
517 a1.spell_level = uSkill;
518 a1.spell_skill = v15;
519 if ( (signed int)pObjectList->uNumObjects <= 0 )
520 {
521 //v18 = 0;
522 a1.uObjectDescID = 0;
523 *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy);
524 a1.vPosition.x = fromx;
525 a1.uAttributes = 16;
526 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz);
527 a1.field_60_distance_related_prolly_lod = v55;
528 //v20 = yaw;
529 a1.uSpriteFrameID = 0;
530 a1.spell_caster_pid = 8000 | OBJECT_Item;
531 a1.spell_target_pid = 0;
532 a1.uFacing = yaw;
533 a1.uSoundID = 0;
534 v49 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed;
535 a1.Create(yaw, pitch, v49, 0);
536 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0);
537 return;
538 }
539 v17 = (char *)&pObjectList->pObjects->uObjectID;
540 while ( (short)a1.uType != *(short *)v17 )
541 {
542 ++v16;
543 v17 += 56;
544 if ( v16 >= (signed int)pObjectList->uNumObjects )
545 {
546 //v18 = 0;
547 a1.uObjectDescID = 0;
548 *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy);
549 a1.vPosition.x = fromx;
550 a1.uAttributes = 16;
551 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz);
552 a1.field_60_distance_related_prolly_lod = v55;
553 //v20 = yaw;
554 a1.uSpriteFrameID = 0;
555 a1.spell_caster_pid = 8000 | OBJECT_Item;
556 a1.spell_target_pid = 0;
557 a1.uFacing = yaw;
558 a1.uSoundID = 0;
559 v49 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed;
560 a1.Create(yaw, pitch, v49, 0);
561 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0);
562 return;
563 }
564 }
565 v18 = v16;
566 a1.uObjectDescID = v18;
567 *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy);
568 a1.vPosition.x = fromx;
569 a1.uAttributes = 16;
570 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz);
571 a1.field_60_distance_related_prolly_lod = v55;
572 //v20 = yaw;
573 a1.uSpriteFrameID = 0;
574 a1.spell_caster_pid = 8000 | OBJECT_Item;
575 a1.spell_target_pid = 0;
576 a1.uFacing = yaw;
577 a1.uSoundID = 0;
578 v49 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed;
579 a1.Create(yaw, pitch, v49, 0);
580 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0);
581 return;
582 case SPELL_WATER_POISON_SPRAY:
583 switch ( v15 )
584 {
585 case 1:
586 v60 = 1;
587 break;
588 case 2:
589 v60 = 3;
590 break;
591 case 3:
592 v60 = 5;
593 break;
594 case 4:
595 v60 = 7;
596 break;
597 }
598 a7c = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360;
599 if ( v60 != 1 )
600 {
601 a8b = a7c / (v60 - 1);
602 a1.stru_24.Reset();
603 v21 = 0;
604 a1.spell_id = uSpellID;
605 a1.spell_level = uSkill;
606 a1.spell_skill = v15;
607 if ( (signed int)pObjectList->uNumObjects <= 0 )
608 v23 = 0;
609 else
610 {
611 v22 = (char *)&pObjectList->pObjects->uObjectID;
612 while ( (short)a1.uType != *(short *)v22 )
613 {
614 ++v21;
615 v22 += 56;
616 if ( v21 >= (signed int)pObjectList->uNumObjects )
617 {
618 v23 = 0;
619 a1.uObjectDescID = v23;
620 *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy);
621 a1.vPosition.x = fromx;
622 a1.uAttributes = 16;
623 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz);
624 a1.field_60_distance_related_prolly_lod = v55;
625 a1.uSpriteFrameID = 0;
626 a1.spell_caster_pid = 8000 | OBJECT_Item;
627 a1.spell_target_pid = 4;
628 a1.uSoundID = 0;
629 for ( i = a7c / -2; i <= a7c / 2; i += a8b )
630 {
631 a1.uFacing = i + yaw;
632 a1.Create((signed __int16)(i + (short)yaw), pitch, pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, 0);
633 }
634 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0);
635 return;
636 }
637 }
638 v23 = v21;
639 }
640 a1.uObjectDescID = v23;
641 *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy);
642 a1.vPosition.x = fromx;
643 a1.uAttributes = 16;
644 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz);
645 a1.field_60_distance_related_prolly_lod = v55;
646 a1.uSpriteFrameID = 0;
647 a1.spell_caster_pid = 8000 | OBJECT_Item;
648 a1.spell_target_pid = 4;
649 a1.uSoundID = 0;
650 for ( i = a7c / -2; i <= a7c / 2; i += a8b )
651 {
652 a1.uFacing = i + yaw;
653 a1.Create((signed __int16)(i + (short)yaw), pitch, pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, 0);
654 }
655 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0);
656 return;
657 }
658 a1.stru_24.Reset();
659 a1.spell_id = uSpellID;
660 a1.spell_level = uSkill;
661 a1.spell_skill = v15;
662 if ( (signed int)pObjectList->uNumObjects <= 0 )
663 {
664 //v18 = 0;
665 a1.uObjectDescID = 0;
666 *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy);
667 a1.vPosition.x = fromx;
668 a1.uAttributes = 16;
669 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz);
670 a1.field_60_distance_related_prolly_lod = v55;
671 //v20 = yaw;
672 a1.uSpriteFrameID = 0;
673 a1.spell_caster_pid = 8000 | OBJECT_Item;
674 a1.spell_target_pid = 0;
675 a1.uFacing = yaw;
676 a1.uSoundID = 0;
677 //v51 = 0;
678 v49 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed;
679 //v47 = pitch;
680 a1.Create(yaw, pitch, v49, 0);
681 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0);
682 return;
683 }
684 //v19 = (char *)&pObjectList->pObjects->uObjectID;
685 for ( v16 = 0; v16 < (signed int)pObjectList->uNumObjects; ++v16 )
686 {
687 if ( (short)a1.uType == pObjectList->pObjects[v16].uObjectID )
688 {
689 //v18 = v16;
690 a1.uObjectDescID = v16;
691 *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy);
692 a1.vPosition.x = fromx;
693 a1.uAttributes = 16;
694 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz);
695 a1.field_60_distance_related_prolly_lod = v55;
696 //v20 = yaw;
697 a1.uSpriteFrameID = 0;
698 a1.spell_caster_pid = 8000 | OBJECT_Item;
699 a1.spell_target_pid = 0;
700 a1.uFacing = yaw;
701 a1.uSoundID = 0;
702 //v51 = 0;
703 v49 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed;
704 //v47 = pitch;
705 a1.Create(yaw, pitch, v49, 0);
706 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0);
707 return;
708 }
709 //v19 += 56;
710 }
711 //v18 = 0;
712 a1.uObjectDescID = 0;
713 *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy);
714 a1.vPosition.x = fromx;
715 a1.uAttributes = 16;
716 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz);
717 a1.field_60_distance_related_prolly_lod = v55;
718 //v20 = yaw;
719 a1.uSpriteFrameID = 0;
720 a1.spell_caster_pid = 8000 | OBJECT_Item;
721 a1.spell_target_pid = 0;
722 a1.uFacing = yaw;
723 a1.uSoundID = 0;
724 //v51 = 0;
725 v49 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed;
726 //v47 = pitch;
727 a1.Create(yaw, pitch, v49, 0);
728 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0);
729 return;
730 case SPELL_AIR_SPARKS:
731 switch ( v15 )
732 {
733 case 1:
734 v60 = 3;
735 break;
736 case 2:
737 v60 = 5;
738 break;
739 case 3:
740 v60 = 7;
741 break;
742 case 4:
743 v60 = 9;
744 break;
745 }
746 a7d = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360;
747 a8c = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360 / (v60 - 1);
748 a1.stru_24.Reset();
749 v25 = 0;
750 a1.spell_id = uSpellID;
751 a1.spell_level = uSkill;
752 a1.spell_skill = v15;
753 if ( (signed int)pObjectList->uNumObjects <= 0 )
754 {
755 //v27 = 0;
756 a1.uObjectDescID = 0;
757 *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy);
758 a1.vPosition.x = fromx;
759 a1.uAttributes = 16;
760 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz);
761 a1.field_60_distance_related_prolly_lod = v55;
762 a1.uSpriteFrameID = 0;
763 a1.spell_caster_pid = 8000 | OBJECT_Item;
764 a1.spell_target_pid = 4;
765 a1.uSoundID = 0;
766 for ( j = a7d / -2; j <= a7d / 2; j += a8c )
767 {
768 a1.uFacing = j + yaw;
769 a1.Create((signed __int16)(j + (short)yaw), pitch, pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, 0);
770 }
771 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0);
772 return;
773 }
774 v26 = (char *)&pObjectList->pObjects->uObjectID;
775 while ( (short)a1.uType != *(short *)v26 )
776 {
777 ++v25;
778 v26 += 56;
779 if ( v25 >= (signed int)pObjectList->uNumObjects )
780 {
781 v27 = 0;
782 a1.uObjectDescID = v27;
783 *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy);
784 a1.vPosition.x = fromx;
785 a1.uAttributes = 16;
786 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz);
787 a1.field_60_distance_related_prolly_lod = v55;
788 a1.uSpriteFrameID = 0;
789 a1.spell_caster_pid = 8000 | OBJECT_Item;
790 a1.spell_target_pid = 4;
791 a1.uSoundID = 0;
792 for ( j = a7d / -2; j <= a7d / 2; j += a8c )
793 {
794 a1.uFacing = j + yaw;
795 a1.Create((signed __int16)(j + (short)yaw), pitch, pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, 0);
796 }
797 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0);
798 return;
799 }
800 }
801 v27 = v25;
802 a1.uObjectDescID = v27;
803 *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy);
804 a1.vPosition.x = fromx;
805 a1.uAttributes = 16;
806 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz);
807 a1.field_60_distance_related_prolly_lod = v55;
808 a1.uSpriteFrameID = 0;
809 a1.spell_caster_pid = 8000 | OBJECT_Item;
810 a1.spell_target_pid = 4;
811 a1.uSoundID = 0;
812 for ( j = a7d / -2; j <= a7d / 2; j += a8c )
813 {
814 a1.uFacing = j + yaw;
815 a1.Create((signed __int16)(j + (short)yaw), pitch,
816 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, 0);
817 }
818 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0);
819 return;
820 case SPELL_EARTH_DEATH_BLOSSOM:
821 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
822 return;
823 a1.stru_24.Reset();
824 v29 = 0;
825 a1.spell_id = uSpellID;
826 a1.spell_level = uSkill;
827 a1.spell_skill = v15;
828 if ( (signed int)pObjectList->uNumObjects <= 0 )
829 {
830 //v31 = 0;
831 a1.uObjectDescID = 0;
832 *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy);
833 a1.vPosition.x = fromx;
834 a1.uAttributes = 16;
835 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz);
836 a1.field_60_distance_related_prolly_lod = v55;
837 a1.uSpriteFrameID = 0;
838 a1.spell_caster_pid = 8000 | OBJECT_Item;
839 a1.spell_target_pid = 4;
840 a1.uSoundID = 0;
841 //v51 = 0;
842 v49 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed;
843 //v20 = yaw;
844 v47 = (signed int)stru_5C6E00->uIntegerHalfPi / 2;
845 a1.Create(yaw, v47, v49, 0);
846 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0);
847 return;
848 }
849 v30 = (char *)&pObjectList->pObjects->uObjectID;
850 break;
851
852 case SPELL_FIRE_HASTE:
853 if ( v15 > 0 )
854 {
855 if ( v15 <= 2 )
856 v9 = 60 * (uSkill + 60);
857 else if ( v15 == 3 )
858 v9 = 180 * (uSkill + 20);
859 else if ( v15 == 4 )
860 v9 = 240 * (uSkill + 15);
861 }
862 //levela = 1;
863 //v32 = pParty->pPlayers;//[0].pConditions[1];
864 //do
865 for (uint i = 0; i < 4; ++i)
866 if (pParty->pPlayers[i].IsWeak())
867 return;
868 //while ( v32 <= &pParty->pPlayers[3] );
869 //if ( !levela )
870 // return;
871 pParty->pPartyBuffs[PARTY_BUFF_HASTE].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(v9 * 128) * 0.033333335),
872 v15, 0, 0, 0);
873 //v33 = spellnum_;
874 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 0);
875 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 1);
876 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 2);
877 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 3);
878 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0);//
879 return;
880 case SPELL_AIR_SHIELD:
881 case SPELL_EARTH_STONESKIN:
882 case SPELL_SPIRIT_HEROISM:
883 switch ( v15 )
884 {
885 case 1:
886 case 2:
887 v9 = 300 * (uSkill + 12);
888 break;
889 case 3:
890 v9 = 900 * (uSkill + 4);
891 break;
892 case 4:
893 v9 = 3600 * (uSkill + 1);
894 break;
895 }
896 switch ( uSpellID )
897 {
898 case 17:
899 v60 = 0;
900 uSkill = 14;
901 break;
902 case 38:
903 v35 = uSkill + 5;
904 uSkill = 15;
905 v60 = v35;
906 break;
907 case 51:
908 v34 = uSkill + 5;
909 uSkill = 9;
910 v60 = v34;
911 break;
912 }
913 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 0);
914 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 1);
915 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 2);
916 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 3);
917 //v52 = 0;
918 //v50 = 0;
919 //v48 = v60;
920 //v46 = v15;
921 v36 = pParty->uTimePlayed + (signed int)(signed __int64)((double)(v9 << 7) * 0.033333335);
922 //v37 = &pParty->pPartyBuffs[uSkill];
923 pParty->pPartyBuffs[uSkill].Apply(v36, v15, v60, 0, 0);
924 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0);
925 return;
926 case SPELL_FIRE_IMMOLATION:
927 if ( v15 == 2 || v15 == 3 || v15 != 4 )
928 v38 = 60 * uSkill;
929 else
930 v38 = 600 * uSkill;
931 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 0);
932 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 1);
933 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 2);
934 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 3);
935 v52 = 0;
936 v50 = 0;
937 v48 = uSkill;
938 v46 = v15;
939 v39 = (signed __int64)((double)(v38 << 7) * 0.033333335);
940 v37 = &pParty->pPartyBuffs[PARTY_BUFF_IMMOLATION];
941 v36 = pParty->uTimePlayed + v39;
942 v37->Apply(v36, v46, v48, v50, v52);
943 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0);
944 return;
945 case SPELL_FIRE_PROTECTION_FROM_FIRE:
946 case SPELL_AIR_PROTECTION_FROM_AIR:
947 case SPELL_WATER_PROTECTION_FROM_WATER:
948 case SPELL_EARTH_PROTECTION_FROM_EARTH:
949 goto LABEL_117;
950 default:
951 return;
952 }
953 while ( (short)a1.uType != *(short *)v30 )
954 {
955 ++v29;
956 v30 += 56;
957 if ( v29 >= (signed int)pObjectList->uNumObjects )
958 {
959 //v31 = 0;
960 a1.uObjectDescID = 0;
961 *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy);
962 a1.vPosition.x = fromx;
963 a1.uAttributes = 16;
964 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz);
965 a1.field_60_distance_related_prolly_lod = v55;
966 a1.uSpriteFrameID = 0;
967 a1.spell_caster_pid = 8000 | OBJECT_Item;
968 a1.spell_target_pid = 4;
969 a1.uSoundID = 0;
970 //v51 = 0;
971 v49 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed;
972 //v20 = yaw;
973 v47 = (signed int)stru_5C6E00->uIntegerHalfPi / 2;
974 a1.Create(yaw, v47, v49, 0);
975 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0);
976 return;
977 }
978 }
979 v31 = v29;
980 a1.uObjectDescID = v31;
981 *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy);
982 a1.vPosition.x = fromx;
983 a1.uAttributes = 16;
984 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz);
985 a1.field_60_distance_related_prolly_lod = v55;
986 a1.uSpriteFrameID = 0;
987 a1.spell_caster_pid = 8000 | OBJECT_Item;
988 a1.spell_target_pid = 4;
989 a1.uSoundID = 0;
990 //v51 = 0;
991 v49 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed;
992 //v20 = yaw;
993 v47 = (signed int)stru_5C6E00->uIntegerHalfPi / 2;
994 a1.Create(yaw, v47, v49, 0);
995 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0);
996 return;
997 }
998 LABEL_117:
999 v44 = uSkill;
1000 a6_4 = 3600 * uSkill;
1001 if ( v15 == 1 )
1002 {
1003 v60 = v44;
1004 goto LABEL_125;
1005 }
1006 if ( v15 == 2 )
1007 {
1008 v44 = 2 * uSkill;
1009 v60 = v44;
1010 goto LABEL_125;
1011 }
1012 if ( v15 == 3 )
1013 {
1014 v44 = 3 * uSkill;
1015 v60 = v44;
1016 goto LABEL_125;
1017 }
1018 if ( v15 == 4 )
1019 {
1020 v44 = 4 * uSkill;
1021 v60 = v44;
1022 goto LABEL_125;
1023 }
1024 LABEL_125:
1025 switch ( uSpellID )
1026 {
1027 case 3:
1028 uSkill = 6;
1029 break;
1030 case 14:
1031 uSkill = 0;
1032 break;
1033 case 25:
1034 uSkill = 17;
1035 break;
1036 case 36:
1037 uSkill = 4;
1038 break;
1039 case 58:
1040 uSkill = 12;
1041 break;
1042 case 69:
1043 uSkill = 1;
1044 break;
1045 }
1046 //v45 = spellnum_;
1047 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 0);
1048 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 1);
1049 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 2);
1050 pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 3);
1051 pParty->pPartyBuffs[uSkill].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)a6_4 * 4.2666669), v15, v60, 0, 0);
1052 //levela = 1;
1053 //LABEL_138:
1054 //if ( levela )
1055 //LABEL_139:
1056 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0);
1057 } 704 }
1058 //----- (00427769) -------------------------------------------------------- 705 //----- (00427769) --------------------------------------------------------
1059 bool sub_427769_isSpellQuickCastableOnShiftClick(unsigned int uSpellID) 706 bool sub_427769_isSpellQuickCastableOnShiftClick(unsigned int uSpellID)
1060 { 707 {
1061 return ( pSpellDatas[uSpellID].stats & 0xC ); 708 return ( pSpellDatas[uSpellID].stats & 0xC ) != 0;
1062 } 709 }
1063 //----- (0043AFE3) -------------------------------------------------------- 710 //----- (0043AFE3) --------------------------------------------------------
1064 int __fastcall _43AFE3_calc_spell_damage(int a1, int a2, signed int a3, int a4) 711 int _43AFE3_calc_spell_damage(int spellId, int spellLevel, signed int skillMastery, int currentHp)
1065 { 712 {
1066 int result; // eax@1 713 int result; // eax@1
1067 unsigned int v5; // [sp-4h] [bp-8h]@9 714 unsigned int v5; // [sp-4h] [bp-8h]@9
1068 715
1069 result = 0; 716 result = 0;
1070 if ( a1 == 7 ) 717 if ( spellId == SPELL_FIRE_FIRE_SPIKE )
1071 { 718 {
1072 if ( a3 <= 0 ) 719 switch (skillMastery)
1073 return result;
1074 if ( a3 <= 2 )
1075 { 720 {
721 case 1:
722 case 2:
1076 v5 = 6; 723 v5 = 6;
724 case 3:
725 v5 = 8;
726 case 4:
727 v5 = 10;
728 default:
729 return 0;
1077 } 730 }
1078 else 731 result = GetDiceResult(spellLevel, v5);
1079 { 732 }
1080 if ( a3 == 3 ) 733 else if ( spellId == SPELL_EARTH_MASS_DISTORTION )
1081 { 734 result = currentHp * (pSpellDatas[SPELL_EARTH_MASS_DISTORTION].baseDamage + 2 * spellLevel) / 100;
1082 v5 = 8;
1083 }
1084 else
1085 {
1086 if ( a3 != 4 )
1087 return result;
1088 v5 = 10;
1089 }
1090 }
1091 result = GetDiceResult(a2, v5);
1092 }
1093 else 735 else
1094 { 736 result = pSpellDatas[spellId].baseDamage
1095 if ( a1 == 44 ) 737 + GetDiceResult(spellLevel, pSpellDatas[spellId].bonusSkillDamage);
1096 result = a4 * (LOBYTE(pSpellDatas[40].field_10) + 2 * a2) / 100; 738
1097 else
1098 result = *((char *)&pSpellDatas[0].field_10 + 20 * a1)
1099 + GetDiceResult(a2, *((char *)&pSpellDatas[0].field_10 + 20 * a1 + 1));
1100 }
1101 return result; 739 return result;
1102 } 740 }