annotate CastSpellInfo.cpp @ 2183:172cfb4ee150

CastSpell
author Ritor1
date Thu, 23 Jan 2014 23:35:10 +0600
parents e1e4a8a20b5f
children e0863f5beee0
rev   line source
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1 #include "CastSpellInfo.h"
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2 #include "Actor.h"
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3 #include "Party.h"
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4 #include "mm7_data.h"
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
5 #include "MM7.h"
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
6 #include "BSPModel.h"
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
7 #include "Mouse.h"
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
8 #include "stru6.h"
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
9 #include "Game.h"
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
10 #include "GUIWindow.h"
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
11 #include "GUIFont.h"
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
12 #include "AudioPlayer.h"
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
13 #include "Outdoor.h"
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
14 #include "Overlays.h"
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
15 #include "Events.h"
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
16 #include "Viewport.h"
2037
7a9477135943 Renamed Math.h -> OurMath.h (file resolution was sometimes ambiguous)
Nomad
parents: 1980
diff changeset
17 #include "OurMath.h"
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
18 #include "SpriteObject.h"
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
19 #include "ObjectList.h"
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
20 #include "stru123.h"
2044
28cb79ae2f6f Time.h rename
Ritor1
parents: 2037
diff changeset
21 #include "Timer.h"
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
22 #include "IconFrameTable.h"
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
23 #include "Awards.h"
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
24 #include "TurnEngine.h"
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
25 #include "texts.h"
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
26 #include "LOD.h"
1828
35c1e4ff6ba7 party_finds_gold to Party::PartyFindsGold, cleaned up, moved Level/Decoration.h reference out of Indoor.h
Grumpy7
parents: 1793
diff changeset
27 #include "Level/Decoration.h"
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
28
1517
c3da3c2985b8 Clean CastSpellInfo. (1)
yoctozepto
parents: 1514
diff changeset
29 const size_t CastSpellInfoCount = 10;
c3da3c2985b8 Clean CastSpellInfo. (1)
yoctozepto
parents: 1514
diff changeset
30 std::array<CastSpellInfo, CastSpellInfoCount> pCastSpellInfo;
c3da3c2985b8 Clean CastSpellInfo. (1)
yoctozepto
parents: 1514
diff changeset
31
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
32 //----- (00427E01) --------------------------------------------------------
1517
c3da3c2985b8 Clean CastSpellInfo. (1)
yoctozepto
parents: 1514
diff changeset
33 void CastSpellInfoHelpers::_427E01_cast_spell()
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
34 {
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
35 int spell_level; // edi@1
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
36 CastSpellInfo *pCastSpell; // ebx@2
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
37 signed int v6; // eax@14
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
38 unsigned __int16 v11; // cx@45
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
39 signed int i; // esi@76
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
40 __int16 v23; // ax@88
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
41 signed __int64 v54; // qax@164
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
42 signed __int64 v58; // qax@177
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
43 Actor *pActor; // edi@177
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
44 unsigned __int16 v60; // ax@184
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
45 int v61; // ecx@184
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
46 double v90; // st7@245
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
47 Player *v92; // eax@255
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
48 int v105; // edi@271
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
49 int v111; // eax@274
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
50 Actor *v112; // esi@278
2182
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
51 int dist_X; // eax@278
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
52 int new_dist_Y;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
53 int dist_Z;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
54 int v114; // ebx@278
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
55 unsigned int v115; // ecx@278
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
56 int v116; // edx@279
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
57 int v117; // edx@281
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
58 int v118; // edx@283
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
59 signed int v122; // eax@286
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
60 int v127; // eax@296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
61 int v153; // ecx@322
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
62 int v154; // eax@322
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
63 int v155; // eax@323
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
64 int v156; // eax@323
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
65 int v162; // edi@340
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
66 signed int v164; // eax@340
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
67 signed int v165; // edi@340
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
68 signed int v168; // edi@343
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
69 int v169; // eax@344
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
70 signed int v174; // edi@355
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
71 int v188; // esi@369
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
72 int v189; // edi@369
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
73 signed int v191; // edi@379
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
74 signed int v205; // edi@405
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
75 int v206; // eax@407
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
76 __int16 v207; // cx@407
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
77 int v208; // eax@411
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
78 signed int v209; // ecx@412
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
79 int v210; // edx@412
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
80 signed int v211; // ecx@412
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
81 int v212; // eax@413
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
82 int v213; // eax@413
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
83 int v214; // eax@413
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
84 int v215; // eax@415
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
85 double v216; // st7@415
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
86 double v217; // st6@415
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
87 signed __int64 v218; // qtt@423
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
88 char v223; // al@438
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
89 int v227; // esi@453
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
90 unsigned int v228; // edi@454
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
91 int v229; // edi@466
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
92 ItemGen *v240; // ecx@472
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
93 double v241; // st7@478
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
94 ItemGen *v245; // edi@492
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
95 int v254; // eax@513
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
96 int v255; // esi@513
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
97 int v256; // ecx@513
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
98 int v257; // edx@514
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
99 int v258; // ecx@514
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
100 char v259; // al@516
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
101 int v260; // eax@518
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
102 int v261; // esi@519
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
103 int v262; // edx@521
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
104 int *v263; // ecx@521
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
105 int v264; // esi@521
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
106 int v265; // edx@521
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
107 int *ii; // eax@522
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
108 int v267; // eax@524
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
109 int v268; // eax@524
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
110 char v271; // al@531
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
111 int v277; // edx@548
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
112 int v278; // ecx@548
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
113 char v279; // al@550
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
114 int v280; // eax@552
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
115 int *v281; // esi@553
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
116 int v282; // edx@555
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
117 int *v283; // ecx@555
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
118 int v284; // esi@555
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
119 int v285; // edx@555
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
120 int *l; // eax@556
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
121 ItemGen *v294; // esi@575
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
122 int v295; // edx@575
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
123 int kk; // edi@575
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
124 char v313; // al@606pGame->GetStru6()
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
125 const char *v317; // ecx@617
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
126 Player *v318; // ecx@619
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
127 unsigned int v319; // edi@627
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
128 int v323; // edi@635
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
129 char *v324; // eax@635
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
130 Player *v325; // ecx@640
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
131 int v328; // ecx@651
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
132 int v329; // ecx@652
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
133 int v330; // edi@654
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
134 signed int v342; // edi@668
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
135 signed int v343; // edi@670
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
136 unsigned __int64 v344; // ST08_8@670
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
137 Player *v351; // edi@680
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
138 Player *v357; // edi@694
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
139 Actor *v369; // edi@705
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
140 int v373; // eax@715
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
141 int v374; // eax@717
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
142 int v376; // eax@717
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
143 Player *v377; // ecx@719
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
144 int v381; // edi@727
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
145 int v382; // ecx@727
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
146 Player *v383; // eax@728
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
147 int v384; // eax@733
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
148 int v388; // edi@740
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
149 int v396; // eax@752
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
150 int v397; // eax@757
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
151 int v398; // eax@757
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
152 int v399; // eax@757
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
153 Actor *v417; // eax@787
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
154 int v418; // ecx@789
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
155 __int16 v419; // ax@791
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
156 signed int v420; // eax@793
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
157 ItemGen *v421; // edx@793
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
158 const char *v422; // eax@801
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
159 signed int v426; // eax@815
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
160 Actor *v433; // edi@832
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
161 int v435; // ecx@837
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
162 int v440; // eax@843
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
163 int v441; // eax@847
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
164 signed int v445; // edi@857
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
165 __int16 v448; // ax@864
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
166 char *v449; // esi@870
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
167 int v450; // eax@870
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
168 signed int v460; // eax@895
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
169 Actor *v461; // eax@897
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
170 unsigned __int16 v462; // cx@897
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
171 signed int v463; // edx@897
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
172 int v470; // edi@913
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
173 int v471; // eax@917
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
174 int v472; // eax@917
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
175 int v498; // edi@931
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
176 int v499; // eax@935
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
177 int v500; // eax@935
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
178 Player *v501; // edi@939
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
179 int v505; // eax@943
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
180 int v507; // edi@944
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
181 signed int v509; // eax@944
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
182 Actor *v518; // edx@957
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
183 __int16 v519; // cx@958
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
184 int v531; // eax@982
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
185 int v533; // edi@983
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
186 signed int v535; // eax@983
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
187 signed int v536; // edi@983
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
188 stru6 *v537; // eax@984
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
189 double v549; // st7@991
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
190 unsigned __int16 v550; // di@991
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
191 Player *v553; // edi@1001
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
192 unsigned __int16 v562; // di@1005
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
193 signed int v563; // eax@1010
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
194 unsigned int v564; // ecx@1011
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
195 signed int v565; // eax@1012
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
196 Player **v566; // ecx@1012
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
197 int v567; // eax@1012
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
198 Player *v571; // eax@1013
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
199 char *v572; // ecx@1013
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
200 signed int v576; // eax@1025
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
201 Player *v577; // eax@1026
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
202 int v578; // eax@1028
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
203 __int16 v579; // ax@1029
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
204 int v581; // edi@1031
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
205 char *v585; // esi@1034
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
206 signed int v587; // eax@1035
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
207 char v591; // al@1048
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
208 ItemGen *v592; // esi@1052
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
209 int v596; // esi@1066
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
210 unsigned int v597; // edi@1067
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
211 NPCData *pNPCData; // eax@1089
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
212 int v606; // edx@1091
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
213 AwardType *v607; // ecx@1100
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
214 __int16 v608; // ax@1102
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
215 signed int v609; // eax@1104
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
216 int v610; // edi@1106
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
217 unsigned int v611; // eax@1106
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
218 Player *v612; // edi@1106
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
219 DDM_DLV_Header *v613; // eax@1108
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
220 int v615; // edi@1119
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
221 Player *v619; // edi@1123
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
222 signed __int64 v623; // qax@1127
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
223 int v625; // edi@1129
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
224 signed int v627; // eax@1129
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
225 signed int v628; // edi@1129
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
226 int v629; // ecx@1130
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
227 Player *v630; // eax@1131
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
228 int v631; // eax@1137
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
229 int v635; // edi@1142
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
230 int v642; // edi@1156
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
231 int v643; // eax@1156
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
232 int v644; // eax@1156
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
233 signed int v645; // eax@1158
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
234 unsigned int v656; // [sp-4h] [bp-E88h]@639
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
235 int v659; // [sp+0h] [bp-E84h]@123
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
236 Actor *v661; // [sp+0h] [bp-E84h]@164
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
237 unsigned __int64 v663; // [sp+0h] [bp-E84h]@639
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
238 const char *v664; // [sp+0h] [bp-E84h]@802
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
239 int v666; // [sp+4h] [bp-E80h]@12
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
240 PLAYER_SKILL_TYPE v667; // [sp+4h] [bp-E80h]@25
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
241 int v675; // [sp+4h] [bp-E80h]@800
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
242 int v679[800]; // [sp+14h] [bp-E70h]@515
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
243 AIDirection a3; // [sp+C94h] [bp-1F0h]@21
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
244 int v681[4]; // [sp+CB0h] [bp-1D4h]@1137
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
245 int v682[4]; // [sp+CC0h] [bp-1C4h]@731
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
246 ItemGen v683; // [sp+CD0h] [bp-1B4h]@791
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
247 int v684; // [sp+D04h] [bp-180h]@416
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
248 unsigned __int64 v685; // [sp+D08h] [bp-17Ch]@416
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
249 unsigned __int64 v687; // [sp+D24h] [bp-160h]@327
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
250 Vec3_int_ v688; // [sp+D2Ch] [bp-158h]@943
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
251 Vec3_int_ v691; // [sp+D38h] [bp-14Ch]@137
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
252 Vec3_int_ v694; // [sp+D44h] [bp-140h]@982
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
253 Vec3_int_ v697; // [sp+D50h] [bp-134h]@129
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
254 Vec3_int_ v700; // [sp+D5Ch] [bp-128h]@339
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
255 Vec3_int_ v701; // [sp+D68h] [bp-11Ch]@286
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
256 Vec3_int_ v704; // [sp+D74h] [bp-110h]@132
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
257 Vec3_int_ v707; // [sp+D80h] [bp-104h]@1127
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
258 int v710; // [sp+D8Ch] [bp-F8h]@1156
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
259 __int64 v712; // [sp+D94h] [bp-F0h]@991
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
260 int v713; // [sp+D9Ch] [bp-E8h]@324
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
261 int n; // [sp+DA0h] [bp-E4h]@1
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
262 AIDirection v715; // [sp+DA4h] [bp-E0h]@21
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
263 __int64 v717; // [sp+DC4h] [bp-C0h]@271
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
264 float v718; // [sp+DCCh] [bp-B8h]@176
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
265 signed int sRecoveryTime; // [sp+DD0h] [bp-B4h]@53
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
266 char *y; // [sp+DD4h] [bp-B0h]@325
2182
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
267 int v721;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
268 int mon_id;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
269 int dist_Y; // [sp+DD8h] [bp-ACh]@163
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
270 int v723; // [sp+E4Ch] [bp-38h]@1
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
271 ItemGen *_this; // [sp+E50h] [bp-34h]@23
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
272 float v725; // [sp+E54h] [bp-30h]@23
2182
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
273 int buff_resist;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
274 Player *v726; // [sp+E58h] [bp-2Ch]@131
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
275 float v727; // [sp+E5Ch] [bp-28h]@1
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
276 unsigned int uRequiredMana; // [sp+E60h] [bp-24h]@53
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
277 Player *pPlayer; // [sp+E64h] [bp-20h]@8
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
278 int v730; // [sp+E68h] [bp-1Ch]@53
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
279 Player *v730b;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
280 ItemGen *v730c;
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
281 int skill_level; // [sp+E6Ch] [bp-18h]@48
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
282 signed int v732; // [sp+E70h] [bp-14h]@325
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
283 unsigned __int64 v733; // [sp+E74h] [bp-10h]@1
2182
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
284 int duration;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
285 signed int a2; // [sp+E7Ch] [bp-8h]@14
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
286 int amount; // [sp+E80h] [bp-4h]@1
2183
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
287 int obj_type;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
288
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
289 SpriteObject pSpellSprite; // [sp+DDCh] [bp-A8h]@1
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
290
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
291 spell_level = 0;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
292 amount = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
293 LODWORD(v733) = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
294 v723 = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
295 v727 = 0.0;
1517
c3da3c2985b8 Clean CastSpellInfo. (1)
yoctozepto
parents: 1514
diff changeset
296 for(n = 0; n < CastSpellInfoCount; ++n)
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
297 {
1517
c3da3c2985b8 Clean CastSpellInfo. (1)
yoctozepto
parents: 1514
diff changeset
298 pCastSpell = &pCastSpellInfo[n];
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
299 HIDWORD(v733) = (int)pCastSpell;
1519
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
300 if ( pCastSpell->uSpellID == 0 )
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
301 continue;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
302
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
303 if (pParty->Invisible())
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
304 pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].Reset();
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
305
1519
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
306 if ( pCastSpell->uFlags & 0x3CA )
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
307 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
308 if ( !pParty->pPlayers[pCastSpell->uPlayerID].CanAct() )
1517
c3da3c2985b8 Clean CastSpellInfo. (1)
yoctozepto
parents: 1514
diff changeset
309 _427D48();
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
310 continue;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
311 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
312 pPlayer = &pParty->pPlayers[pCastSpell->uPlayerID];
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
313
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
314 a2 = pCastSpell->spell_target_pid;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
315 if (!pCastSpell->spell_target_pid)
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
316 {
1519
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
317 if (pCastSpell->uSpellID == SPELL_LIGHT_DESTROY_UNDEAD ||
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
318 pCastSpell->uSpellID == SPELL_SPIRIT_TURN_UNDEAD ||
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
319 pCastSpell->uSpellID == SPELL_DARK_CONTROL_UNDEAD )
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
320 v666 = 1;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
321 else
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
322 v666 = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
323
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
324 a2 = stru_50C198.FindClosestActor(5120, 1, v666);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
325 v6 = pMouse->uPointingObjectID;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
326 if ( pMouse->uPointingObjectID && PID_TYPE(v6) == OBJECT_Actor && pActors[PID_ID(v6)].CanAct() )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
327 a2 = pMouse->uPointingObjectID;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
328 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
329
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
330
1519
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
331 pSpellSprite.uType = stru_4E3ACC[pCastSpell->uSpellID].uType;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
332 if (pSpellSprite.uType)
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
333 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
334 if (PID_TYPE(a2) == OBJECT_Actor)
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
335 {
1910
8d3723ca71e6 Actor::GetDirectionInfo changed the signature to a less confusing one
Grumpy7
parents: 1906
diff changeset
336 Actor::GetDirectionInfo(PID(OBJECT_Player, pCastSpell->uPlayerID + 1), a2, &v715, 0);
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
337 spell_level = v723;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
338 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
339 else
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
340 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
341 v715.uYawAngle = pParty->sRotationY;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
342 v715.uPitchAngle = pParty->sRotationX;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
343 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
344 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
345
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
346 LODWORD(v725) = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
347 _this = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
348 if (pCastSpell->forced_spell_skill_level)
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
349 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
350 v11 = pCastSpell->forced_spell_skill_level;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
351 v723 = v11 & 0x3F; // 6 bytes
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
352 spell_level = v723;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
353 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
354 else
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
355 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
356 //v667 = PLAYER_SKILL_STAFF;
1519
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
357 if (pCastSpell->uSpellID < SPELL_AIR_WIZARD_EYE)
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
358 v667 = PLAYER_SKILL_FIRE;
1519
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
359 else if (pCastSpell->uSpellID < SPELL_WATER_AWAKEN)
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
360 v667 = PLAYER_SKILL_AIR;
1519
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
361 else if (pCastSpell->uSpellID < SPELL_EARTH_STUN)
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
362 v667 = PLAYER_SKILL_WATER;
1519
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
363 else if (pCastSpell->uSpellID < SPELL_SPIRIT_DETECT_LIFE)
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
364 v667 = PLAYER_SKILL_EARTH;
1519
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
365 else if (pCastSpell->uSpellID < SPELL_MIND_REMOVE_FEAR)
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
366 v667 = PLAYER_SKILL_SPIRIT;
1519
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
367 else if (pCastSpell->uSpellID < SPELL_BODY_CURE_WEAKNESS)
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
368 v667 = PLAYER_SKILL_MIND;
1519
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
369 else if (pCastSpell->uSpellID < SPELL_LIGHT_LIGHT_BOLT)
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
370 v667 = PLAYER_SKILL_BODY;
1519
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
371 else if (pCastSpell->uSpellID < SPELL_DARK_REANIMATE)
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
372 v667 = PLAYER_SKILL_LIGHT;
1519
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
373 else if (pCastSpell->uSpellID < SPELL_BOW_ARROW)
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
374 v667 = PLAYER_SKILL_DARK;
1519
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
375 else if (pCastSpell->uSpellID == SPELL_BOW_ARROW)
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
376 v667 = PLAYER_SKILL_BOW;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
377 else assert(false && "Unknown spell");
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
378
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
379 LODWORD(v725) = v667;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
380 v723 = pPlayer->GetActualSkillLevel(v667) & 0x3F;
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
381 spell_level = v723;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
382 v11 = pPlayer->pActiveSkills[LODWORD(v725)];
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
383 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
384
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
385 skill_level = SkillToMastery(v11);
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
386
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
387 if (pCastSpell->forced_spell_skill_level)
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
388 uRequiredMana = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
389 else
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
390 uRequiredMana = pSpellDatas[pCastSpell->uSpellID].mana_per_skill[skill_level - 1];
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
391 sRecoveryTime = pSpellDatas[pCastSpell->uSpellID].recovery_per_skill[skill_level - 1];
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
392
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
393 if (LODWORD(v725) == PLAYER_SKILL_DARK && pParty->uCurrentHour == 0 && pParty->uCurrentMinute == 0 ||
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
394 LODWORD(v725) == PLAYER_SKILL_LIGHT && pParty->uCurrentHour == 12 && pParty->uCurrentMinute == 0)
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
395 uRequiredMana = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
396
1519
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
397 if (pCastSpell->uSpellID < SPELL_BOW_ARROW && pPlayer->sMana < uRequiredMana)
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
398 {
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
399 ShowStatusBarString(pGlobalTXT_LocalizationStrings[586], 2); // "Not enough spell points"
1519
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
400 pCastSpell->uSpellID = 0;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
401 continue;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
402 }
1519
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
403 v730 = pCastSpell->uSpellID;
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
404 if (pPlayer->IsCursed() && pCastSpell->uSpellID < SPELL_BOW_ARROW && rand() % 100 < 50)//
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
405 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
406 if (!pParty->bTurnBasedModeOn)
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
407 pPlayer->SetRecoveryTime((signed __int64)(flt_6BE3A4_debug_recmod1 * 213.3333333333333));
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
408 else
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
409 {
1517
c3da3c2985b8 Clean CastSpellInfo. (1)
yoctozepto
parents: 1514
diff changeset
410 pParty->pTurnBasedPlayerRecoveryTimes[pCastSpellInfo[n].uPlayerID] = 100;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
411 pPlayer->SetRecoveryTime(sRecoveryTime);
1448
5a5d0c713d47 some turn engine renaming
Gloval
parents: 1362
diff changeset
412 pTurnEngine->ApplyPlayerAction();
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
413 }
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
414 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // "Spell failed"
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
415 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
1519
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
416 pCastSpellInfo[n].uSpellID = 0;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
417 pPlayer->sMana -= uRequiredMana;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
418 return;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
419 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
420
1519
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
421 switch ( pCastSpell->uSpellID )
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
422 {
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
423 case SPELL_101:
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
424 assert(false && "Unknown spell effect #101 (prolly flaming bow arrow");
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
425 case SPELL_BOW_ARROW://
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
426 {
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
427 amount = 1;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
428 if ( SkillToMastery(pPlayer->pActiveSkills[PLAYER_SKILL_BOW]) >= 3 )
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
429 amount = 2;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
430 sRecoveryTime = pPlayer->GetAttackRecoveryTime(true);
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
431 pSpellSprite.stru_24.Reset();
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
432 pSpellSprite.spell_level = spell_level;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
433 pSpellSprite.spell_id = pCastSpell->uSpellID;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
434 pSpellSprite.spell_skill = skill_level;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
435 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
436 if ( pPlayer->WearsItem(ITEM_ARTEFACT_ULLYSES, EQUIP_BOW) )
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
437 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(0xBD6u);
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
438 pSpellSprite.vPosition.x = pParty->vPosition.x;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
439 pSpellSprite.vPosition.y = pParty->vPosition.y;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
440 pSpellSprite.uAttributes = 0;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
441 pSpellSprite.uSpriteFrameID = 0;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
442 pSpellSprite.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
443 pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
444 pSpellSprite.spell_target_pid = a2;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
445 pSpellSprite.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance);
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
446 pSpellSprite.uFacing = LOWORD(v715.uYawAngle);
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
447 pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
448 pPlayer = &pParty->pPlayers[pCastSpell->uPlayerID];
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
449 memcpy(&pSpellSprite.stru_24, &pPlayer->pInventoryItemList[pPlayer->pEquipment.uBow-1], sizeof(pSpellSprite.stru_24));
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
450 pSpellSprite.uAttributes = 256;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
451 if ( pParty->bTurnBasedModeOn == 1 )
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
452 pSpellSprite.uAttributes = 260;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
453 for ( i = 0; i < amount; ++i )
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
454 {
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
455 if ( i )
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
456 pSpellSprite.vPosition.z += 32;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
457 pSpellSprite.uSectorID = pIndoor->GetSector(pSpellSprite.vPosition.x, pSpellSprite.vPosition.y, pSpellSprite.vPosition.z);
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
458 if ( pSpellSprite.Create(v715.uYawAngle, v715.uPitchAngle, pObjectList->pObjects[(signed __int16)pSpellSprite.uObjectDescID].uSpeed,
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
459 pCastSpell->uPlayerID + 1) != -1 && pParty->bTurnBasedModeOn == 1 )
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
460 ++pTurnEngine->pending_actions;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
461 }
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
462 break;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
463 }
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
464 case SPELL_LASER_PROJECTILE://
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
465 {
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
466 sRecoveryTime = pPlayer->GetAttackRecoveryTime(0);
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
467 pSpellSprite.stru_24.Reset();
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
468 pSpellSprite.spell_id = pCastSpell->uSpellID;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
469 pSpellSprite.spell_level = v723;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
470 pSpellSprite.spell_skill = skill_level;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
471 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
472 pSpellSprite.vPosition.x = pParty->vPosition.x;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
473 pSpellSprite.vPosition.y = pParty->vPosition.y;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
474 pSpellSprite.uAttributes = 0;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
475 pSpellSprite.uSpriteFrameID = 0;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
476 pSpellSprite.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 2;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
477 pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
478 pSpellSprite.spell_target_pid = a2;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
479 pSpellSprite.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance);
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
480 pSpellSprite.uFacing = LOWORD(v715.uYawAngle);
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
481 pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
482 pPlayer = &pParty->pPlayers[pCastSpell->uPlayerID];
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
483 memcpy(&pSpellSprite.stru_24, &pPlayer->pInventoryItemList[pPlayer->pEquipment.uMainHand - 1],sizeof(pSpellSprite.stru_24));
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
484 // &pParty->pPlayers[pCastSpell->uPlayerID].spellbook.pDarkSpellbook.bIsSpellAvailable[36
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
485 // * pParty->pPlayers[pCastSpell->uPlayerID].pEquipment.uMainHand + 5], );
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
486 pSpellSprite.uSectorID = pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.y, pSpellSprite.vPosition.z);
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
487 HIBYTE(pSpellSprite.uAttributes) |= 1;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
488 if ( pParty->bTurnBasedModeOn == 1 )
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
489 LOBYTE(pSpellSprite.uAttributes) |= 4;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
490 if ( pSpellSprite.Create(v715.uYawAngle, v715.uPitchAngle, pObjectList->pObjects[(signed __int16)pSpellSprite.uObjectDescID].uSpeed,
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
491 pCastSpell->uPlayerID + 1) != -1 && pParty->bTurnBasedModeOn == 1 )
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
492 ++pTurnEngine->pending_actions;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
493 break;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
494 }
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
495 case SPELL_FIRE_TORCH_LIGHT://
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
496 {
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
497 switch (skill_level)
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
498 {
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
499 case 1: amount = 2; break;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
500 case 2: amount = 3; break;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
501 case 3:
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
502 case 4: amount = 4; break;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
503 default:
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
504 assert(false);
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
505 }
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
506 if ( !pPlayer->CanCastSpell(uRequiredMana) )
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
507 break;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
508 pParty->pPartyBuffs[PARTY_BUFF_TORCHLIGHT].Apply(pParty->uTimePlayed + (signed __int64)((double)(signed int)3600 * spell_level * 4.2666669), skill_level, amount, 0, 0);
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
509 LODWORD(v727) = 1;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
510 break;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
511 }
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
512 case SPELL_FIRE_FIRE_SPIKE://
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
513 {
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
514 switch (skill_level)
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
515 {
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
516 case 1: amount = 3; break;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
517 case 2: amount = 5; break;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
518 case 3: amount = 7; break;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
519 case 4: amount = 9; break;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
520 default:
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
521 assert(false);
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
522 }
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
523 int _v733 = 0;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
524 for (uint i = 0; i < uNumSpriteObjects; ++i)
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
525 {
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
526 SpriteObject* object = &pSpriteObjects[i];
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
527 if (object->uType && object->spell_id == SPELL_FIRE_FIRE_SPIKE && object->spell_caster_pid == PID(OBJECT_Player, pCastSpell->uPlayerID))
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
528 ++_v733;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
529 }
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
530 if ( _v733 > amount )
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
531 {
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
532 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
533 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
534 pCastSpell->uSpellID = 0;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
535 continue;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
536 }
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
537 if ( !pPlayer->CanCastSpell(uRequiredMana) )
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
538 break;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
539 pSpellSprite.stru_24.Reset();
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
540 pSpellSprite.spell_id = pCastSpell->uSpellID;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
541 pSpellSprite.spell_level = spell_level;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
542 pSpellSprite.spell_skill = skill_level;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
543 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
544 pSpellSprite.vPosition.y = pParty->vPosition.y;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
545 pSpellSprite.vPosition.x = pParty->vPosition.x;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
546 pSpellSprite.uAttributes = 0;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
547 pSpellSprite.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
548 pSpellSprite.uSectorID = pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.y, pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3);
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
549 pSpellSprite.uSpriteFrameID = 0;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
550 pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
551 pSpellSprite.spell_target_pid = a2;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
552 pSpellSprite.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance);
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
553 pSpellSprite.uFacing = LOWORD(v715.uYawAngle);
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
554 pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
555 if ( pParty->bTurnBasedModeOn == 1 )
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
556 LOBYTE(pSpellSprite.uAttributes) |= 4;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
557 v659 = pObjectList->pObjects[(signed __int16)pSpellSprite.uObjectDescID].uSpeed;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
558 if ( pSpellSprite.Create(pParty->sRotationY, pParty->sRotationX + 10, v659, pCastSpell->uPlayerID + 1) != -1 && pParty->bTurnBasedModeOn == 1 )
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
559 ++pTurnEngine->pending_actions;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
560 LODWORD(v727) = 1;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
561 break;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
562 }
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
563 case SPELL_AIR_IMPLOSION://
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
564 {
2182
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
565 mon_id = PID_ID(a2);
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
566 if ( !pPlayer->CanCastSpell(uRequiredMana) )
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
567 break;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
568 if (!a2)
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
569 {
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
570 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
571 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
572 pCastSpell->uSpellID = 0;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
573 continue;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
574 }
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
575 if (PID_TYPE(a2) == OBJECT_Actor)
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
576 {
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
577 v697.x = 0;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
578 v697.y = 0;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
579 v697.z = 0;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
580 pSpellSprite.stru_24.Reset();
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
581 pSpellSprite.spell_id = pCastSpell->uSpellID;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
582 pSpellSprite.spell_level = spell_level;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
583 pSpellSprite.spell_skill = skill_level;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
584 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
585 pSpellSprite.uAttributes = 0;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
586 pSpellSprite.uSectorID = 0;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
587 pSpellSprite.uSpriteFrameID = 0;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
588 pSpellSprite.field_60_distance_related_prolly_lod = 0;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
589 pSpellSprite.uFacing = 0;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
590 pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
591 pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
2182
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
592 pSpellSprite.vPosition.x = pActors[mon_id].vPosition.x;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
593 pSpellSprite.vPosition.z = pActors[mon_id].vPosition.z;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
594 pSpellSprite.vPosition.y = pActors[mon_id].vPosition.y;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
595 pSpellSprite.spell_target_pid = PID(OBJECT_Actor, mon_id);
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
596 DamageMonsterFromParty(PID(OBJECT_Item, pSpellSprite.Create(0, 0, 0, 0)), mon_id, &v697);
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
597 }
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
598 LODWORD(v727) = 1;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
599 break;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
600 }
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
601 case SPELL_EARTH_MASS_DISTORTION://
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
602 {
2182
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
603 mon_id = PID_ID(a2);
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
604 if ( !pPlayer->CanCastSpell(uRequiredMana) )
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
605 break;
2182
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
606 if ( stru_50C198.GetMagicalResistance(&pActors[mon_id], 3) )
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
607 {
2182
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
608 pActors[mon_id].pActorBuffs[ACTOR_BUFF_MASS_DISTORTION].Apply(pMiscTimer->uTotalGameTimeElapsed + 128, 0, 0, 0, 0);
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
609 v704.x = 0;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
610 v704.y = 0;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
611 v704.z = 0;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
612 pSpellSprite.stru_24.Reset();
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
613 pSpellSprite.spell_id = pCastSpell->uSpellID;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
614 pSpellSprite.spell_level = spell_level;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
615 pSpellSprite.spell_skill = skill_level;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
616 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
617 pSpellSprite.uAttributes = 0;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
618 pSpellSprite.uSectorID = 0;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
619 pSpellSprite.uSpriteFrameID = 0;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
620 pSpellSprite.field_60_distance_related_prolly_lod = 0;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
621 pSpellSprite.uFacing = 0;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
622 pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
623 pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
2182
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
624 pSpellSprite.vPosition.x = pActors[mon_id].vPosition.x;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
625 pSpellSprite.vPosition.y = pActors[mon_id].vPosition.y;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
626 pSpellSprite.vPosition.z = pActors[mon_id].vPosition.z;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
627 pSpellSprite.spell_target_pid = PID(OBJECT_Actor, mon_id);
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
628 DamageMonsterFromParty(PID(OBJECT_Item, pSpellSprite.Create(0, 0, 0, 0)), mon_id, &v704);
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
629 }
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
630 LODWORD(v727) = 1;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
631 break;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
632 }
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
633 case SPELL_LIGHT_DESTROY_UNDEAD://
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
634 {
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
635 if ( !pPlayer->CanCastSpell(uRequiredMana) || !a2 || PID_TYPE(a2) != OBJECT_Actor)
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
636 break;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
637 //v730 = a2 >> 3;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
638 //HIDWORD(v733) = (int)&pActors[PID_ID(a2)];
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
639 v691.x = 0;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
640 v691.y = 0;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
641 v691.z = 0;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
642 pSpellSprite.stru_24.Reset();
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
643 pSpellSprite.spell_id = pCastSpell->uSpellID;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
644 pSpellSprite.spell_level = spell_level;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
645 pSpellSprite.spell_skill = skill_level;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
646 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
647 pSpellSprite.vPosition.x = pActors[PID_ID(a2)].vPosition.x;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
648 pSpellSprite.vPosition.y = pActors[PID_ID(a2)].vPosition.y;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
649 pSpellSprite.vPosition.z = pActors[PID_ID(a2)].vPosition.z;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
650 pSpellSprite.uAttributes = 0;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
651 pSpellSprite.uSectorID = pIndoor->GetSector(pSpellSprite.vPosition.x, pSpellSprite.vPosition.y, pSpellSprite.vPosition.z);
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
652 pSpellSprite.uSpriteFrameID = 0;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
653 pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
654 pSpellSprite.spell_target_pid = a2;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
655 pSpellSprite.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance);
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
656 pSpellSprite.uFacing = LOWORD(v715.uYawAngle);
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
657 pSpellSprite.uAttributes |= 0x80u;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
658 pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
659 int obj_id = pSpellSprite.Create(0, 0, 0, 0);
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
660 if ( !MonsterStats::BelongsToSupertype(pActor->pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) )
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
661 {
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
662 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
663 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
664 pCastSpell->uSpellID = 0;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
665 continue;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
666 }
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
667 DamageMonsterFromParty(PID(OBJECT_Item, obj_id), PID_ID(a2), &v691);
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
668 LODWORD(v727) = 1;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
669 break;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
670 }
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
671 case SPELL_FIRE_FIRE_BOLT://
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
672 case SPELL_FIRE_FIREBALL://
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
673 case SPELL_FIRE_INCINERATE://
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
674 case SPELL_AIR_LIGHNING_BOLT://
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
675 case SPELL_WATER_ICE_BOLT://
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
676 case SPELL_WATER_ICE_BLAST://
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
677 case SPELL_EARTH_STUN://
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
678 case SPELL_EARTH_DEADLY_SWARM://
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
679 case SPELL_MIND_MIND_BLAST://
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
680 case SPELL_MIND_PSYCHIC_SHOCK://
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
681 case SPELL_BODY_HARM://
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
682 case SPELL_LIGHT_LIGHT_BOLT://
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
683 case SPELL_DARK_DRAGON_BREATH://
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
684 {
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
685 if ( !pPlayer->CanCastSpell(uRequiredMana) )
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
686 break;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
687 pSpellSprite.stru_24.Reset();
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
688 pSpellSprite.spell_id = pCastSpell->uSpellID;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
689 pSpellSprite.spell_level = spell_level;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
690 pSpellSprite.spell_skill = skill_level;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
691 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
692 pSpellSprite.vPosition.y = pParty->vPosition.y;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
693 pSpellSprite.vPosition.x = pParty->vPosition.x;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
694 pSpellSprite.uAttributes = 0;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
695 pSpellSprite.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
696 if (uCurrentlyLoadedLevelType == LEVEL_Indoor)
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
697 pSpellSprite.uSectorID = pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.y, pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3);
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
698 else
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
699 pSpellSprite.uSectorID = 0;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
700 pSpellSprite.uSpriteFrameID = 0;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
701 pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
702 pSpellSprite.spell_target_pid = a2;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
703 pSpellSprite.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance);
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
704 pSpellSprite.uFacing = LOWORD(v715.uYawAngle);
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
705 pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
706 if ( pParty->bTurnBasedModeOn == 1 )
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
707 LOBYTE(pSpellSprite.uAttributes) |= 4;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
708 if ( pCastSpell->uSpellID == SPELL_AIR_LIGHNING_BOLT )
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
709 LOBYTE(pSpellSprite.uAttributes) |= 0x40;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
710 v659 = pObjectList->pObjects[(signed __int16)pSpellSprite.uObjectDescID].uSpeed;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
711 if ( pSpellSprite.Create(v715.uYawAngle, v715.uPitchAngle, v659, pCastSpell->uPlayerID + 1) != -1 && pParty->bTurnBasedModeOn == 1 )
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
712 ++pTurnEngine->pending_actions;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
713 LODWORD(v727) = 1;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
714 break;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
715 }
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
716 case SPELL_WATER_ACID_BURST://
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
717 case SPELL_EARTH_BLADES://
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
718 case SPELL_BODY_FLYING_FIST://
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
719 case SPELL_DARK_TOXIC_CLOUD://
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
720 {
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
721 if ( !pPlayer->CanCastSpell(uRequiredMana) )
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
722 break;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
723 pSpellSprite.stru_24.Reset();
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
724 pSpellSprite.spell_id = pCastSpell->uSpellID;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
725 pSpellSprite.spell_level = spell_level;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
726 pSpellSprite.spell_skill = skill_level;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
727 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
728 pSpellSprite.uAttributes = 0;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
729 pSpellSprite.vPosition.x = pParty->vPosition.x;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
730 pSpellSprite.vPosition.y = pParty->vPosition.y;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
731 pSpellSprite.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 2;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
732 pSpellSprite.uSectorID = pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.y, pSpellSprite.vPosition.z);
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
733 pSpellSprite.uSpriteFrameID = 0;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
734 pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
735 pSpellSprite.spell_target_pid = a2;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
736 pSpellSprite.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance);
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
737 pSpellSprite.uFacing = LOWORD(v715.uYawAngle);
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
738 pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
739 if ( pParty->bTurnBasedModeOn == 1 )
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
740 LOBYTE(pSpellSprite.uAttributes) |= 4;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
741 v659 = pObjectList->pObjects[(signed __int16)pSpellSprite.uObjectDescID].uSpeed;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
742 if ( pSpellSprite.Create(v715.uYawAngle, v715.uPitchAngle, v659, pCastSpell->uPlayerID + 1) != -1 && pParty->bTurnBasedModeOn == 1 )
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
743 ++pTurnEngine->pending_actions;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
744 LODWORD(v727) = 1;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
745 break;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
746 }
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
747 case SPELL_LIGHT_SUNRAY://
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
748 {
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
749 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
750 || uCurrentlyLoadedLevelType == LEVEL_Outdoor && (pParty->uCurrentHour < 5 || pParty->uCurrentHour >= 21) )//
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
751 {
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
752 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
753 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
754 pCastSpell->uSpellID = 0;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
755 continue;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
756 }
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
757 if ( pPlayer->CanCastSpell(uRequiredMana) )
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
758 {
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
759 pSpellSprite.stru_24.Reset();
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
760 pSpellSprite.spell_id = pCastSpell->uSpellID;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
761 pSpellSprite.spell_skill = skill_level;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
762 pSpellSprite.spell_level = spell_level;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
763 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
764 pSpellSprite.uAttributes = 0;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
765 pSpellSprite.vPosition.x = pParty->vPosition.x;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
766 pSpellSprite.vPosition.y = pParty->vPosition.y;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
767 pSpellSprite.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
768 pSpellSprite.uSectorID = pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.y, pSpellSprite.vPosition.z);
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
769 pSpellSprite.uSpriteFrameID = 0;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
770 pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
771 pSpellSprite.spell_target_pid = a2;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
772 pSpellSprite.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance);
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
773 pSpellSprite.uFacing = LOWORD(v715.uYawAngle);
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
774 pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
775 if ( pParty->bTurnBasedModeOn == 1 )
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
776 LOBYTE(pSpellSprite.uAttributes) |= 4;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
777 v659 = pObjectList->pObjects[(signed __int16)pSpellSprite.uObjectDescID].uSpeed;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
778 if ( pSpellSprite.Create(v715.uYawAngle, v715.uPitchAngle, v659, pCastSpell->uPlayerID + 1) != -1 && pParty->bTurnBasedModeOn == 1 )
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
779 ++pTurnEngine->pending_actions;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
780 LODWORD(v727) = 1;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
781 }
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
782 break;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
783 }
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
784 case SPELL_LIGHT_PARALYZE://
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
785 {
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
786 if ( !pPlayer->CanCastSpell(uRequiredMana) )
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
787 break;
2182
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
788 mon_id = PID_ID(a2);
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
789 if (PID_TYPE(a2) == OBJECT_Actor && stru_50C198.GetMagicalResistance(&pActors[mon_id], 9) )
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
790 {
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
791 Actor::AI_Stand(PID_ID(a2), 4, 0x80, 0);
2182
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
792 pActors[mon_id].pActorBuffs[ACTOR_BUFF_PARALYZED].Apply(pParty->uTimePlayed + (signed __int64)((double)(signed int)23040 * spell_level * 0.033333335), skill_level, 0, 0, 0);
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
793 pActors[mon_id].uAttributes |= 0x80000;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
794 pActors[mon_id].vVelocity.x = 0;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
795 pActors[mon_id].vVelocity.y = 0;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
796 pGame->GetStru6()->_4A7E89_sparkles_on_actor_after_it_casts_buff(&pActors[mon_id], 0);
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
797 }
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
798 LODWORD(v727) = 1;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
799 break;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
800 }
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
801 case SPELL_EARTH_SLOW://
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
802 {
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
803 switch (skill_level)
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
804 {
2182
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
805 case 1: LODWORD(v733) = 180 * spell_level; amount = 2; break;//LODWORD(v733)???
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
806 case 2: LODWORD(v733) = 300 * spell_level; amount = 2; break;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
807 case 3: LODWORD(v733) = 300 * spell_level; amount = 4; break;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
808 case 4: LODWORD(v733) = 300 * spell_level; amount = 8; break;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
809 default:
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
810 assert(false);
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
811 }
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
812 if ( !pPlayer->CanCastSpell(uRequiredMana) )
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
813 break;
2181
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
814 //v721 = 836 * PID_ID(a2);
2182
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
815 mon_id = PID_ID(a2);
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
816 if (PID_TYPE(a2) == OBJECT_Actor && stru_50C198.GetMagicalResistance(&pActors[mon_id], 3) )
2181
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
817 {
2182
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
818 pActors[mon_id].pActorBuffs[ACTOR_BUFF_SLOWED].Apply(pParty->uTimePlayed + (signed __int64)((double)(signed int)23040 * spell_level * 0.033333335), skill_level, amount, 0, 0);
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
819 pActors[mon_id].uAttributes |= 0x80000;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
820 pGame->GetStru6()->_4A7E89_sparkles_on_actor_after_it_casts_buff(&pActors[mon_id], 0);
2181
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
821 }
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
822 LODWORD(v727) = 1;
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
823 break;
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
824 }
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
825 case SPELL_MIND_CHARM://
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
826 {
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
827 v61 = PID_ID(a2);
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
828 if ( !pPlayer->CanCastSpell(uRequiredMana) )
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
829 break;
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
830 if ( stru_50C198.GetMagicalResistance(&pActors[v61], 7) )
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
831 {
2181
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
832 uint power = 300 * spell_level;
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
833 if ( skill_level == 2 )
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
834 power = 600 * spell_level;
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
835 else if ( skill_level == 3 )
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
836 power = 29030400;
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
837
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
838 pActors[v61].pActorBuffs[ACTOR_BUFF_BERSERK].Reset();
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
839 pActors[v61].pActorBuffs[ACTOR_BUFF_ENSLAVED].Reset();
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
840 pActors[v61].pActorBuffs[ACTOR_BUFF_CHARM].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)(power << 7) * 0.033333335), skill_level, 0, 0, 0);
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
841 pSpellSprite.stru_24.Reset();
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
842 pSpellSprite.spell_id = pCastSpell->uSpellID;
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
843 pSpellSprite.spell_level = spell_level;
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
844 pSpellSprite.spell_skill = skill_level;
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
845 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
846 pSpellSprite.vPosition.x = pActors[v61].vPosition.x;
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
847 pSpellSprite.vPosition.y = pActors[v61].vPosition.y;
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
848 pSpellSprite.vPosition.z = pActors[v61].vPosition.z + pActors[v61].uActorHeight;
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
849 pSpellSprite.uAttributes = 0;
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
850 pSpellSprite.uSectorID = pIndoor->GetSector(pActors[v61].vPosition.x, pActors[v61].vPosition.y, pSpellSprite.vPosition.z);
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
851 pSpellSprite.uSpriteFrameID = 0;
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
852 pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
853 pSpellSprite.spell_target_pid = a2;
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
854 pSpellSprite.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance);
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
855 pSpellSprite.uFacing = LOWORD(v715.uYawAngle);
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
856 LOBYTE(pSpellSprite.uAttributes) |= 0x80u;
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
857 pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
858 pSpellSprite.Create(0, 0, 0, pCastSpell->uPlayerID + 1);
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
859 }
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
860 LODWORD(v727) = 1;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
861 break;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
862 }
2181
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
863 case SPELL_DARK_SHRINKING_RAY://
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
864 {
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
865 if ( !pPlayer->CanCastSpell(uRequiredMana) )
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
866 break;
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
867 pSpellSprite.stru_24.Reset();
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
868 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
869 pSpellSprite.vPosition.x = pParty->vPosition.x;
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
870 pSpellSprite.vPosition.y = pParty->vPosition.y;
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
871 pSpellSprite.uAttributes = 0;
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
872 pSpellSprite.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3;
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
873 pSpellSprite.uSectorID = pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.y, pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3);
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
874 pSpellSprite.uSpriteFrameID = 0;
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
875 pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
876 pSpellSprite.spell_target_pid = a2;
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
877 pSpellSprite.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance);
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
878 pSpellSprite.uFacing = LOWORD(v715.uYawAngle);
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
879 pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
880 pSpellSprite.spell_skill = skill_level;
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
881 pSpellSprite.spell_id = SPELL_FIRE_PROTECTION_FROM_FIRE;
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
882 pSpellSprite.spell_level = 300 * spell_level;
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
883 if ( pParty->bTurnBasedModeOn == 1 )
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
884 LOBYTE(pSpellSprite.uAttributes) |= 4;
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
885 v659 = pObjectList->pObjects[(signed __int16)pSpellSprite.uObjectDescID].uSpeed;
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
886 if ( pSpellSprite.Create(v715.uYawAngle, v715.uPitchAngle, v659, pCastSpell->uPlayerID + 1) != -1 && pParty->bTurnBasedModeOn == 1 )
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
887 ++pTurnEngine->pending_actions;
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
888 LODWORD(v727) = 1;
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
889 break;
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
890 }
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
891 case SPELL_FIRE_FIRE_AURA: //
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
892 {
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
893 switch (skill_level)
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
894 {
2182
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
895 case 1: duration = 3600 * spell_level; amount = 10; break; //
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
896 case 2: duration = 3600 * spell_level; amount = 11; break; //
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
897 case 3: duration = 3600 * spell_level; amount = 12; break;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
898 case 4: duration = 0; amount = 12; break;
2181
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
899 default:
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
900 assert(false);
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
901 }
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
902 if ( !pPlayer->CanCastSpell(uRequiredMana) )
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
903 break;
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
904 v730c = &pParty->pPlayers[pCastSpell->uPlayerID_2].pInventoryItemList[a2];
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
905 ItemDesc* _item = &pItemsTable->pItems[v730c->uItemID];
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
906 v730c->UpdateTempBonus(pParty->uTimePlayed);
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
907 if ( v730c->uItemID < 64 || v730c->uItemID > 65
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
908 && !v730c->IsBroken()
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
909 && !v730c->uSpecEnchantmentType
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
910 && !v730c->uEnchantmentType
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
911 && ( _item->uEquipType == EQUIP_SINGLE_HANDED || _item->uEquipType == EQUIP_TWO_HANDED || _item->uEquipType == EQUIP_BOW)
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
912 && !pItemsTable->IsMaterialNonCommon(v730c) )
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
913 {
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
914 v730c->uSpecEnchantmentType = amount;
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
915 if ( skill_level != 4 )
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
916 {
2182
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
917 v730c->uExpireTime = pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)duration << 7) * 0.033333335);
2181
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
918 v730c->uAttributes |= ITEM_TEMP_BONUS;
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
919 }
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
920 v730c->uAttributes |= ITEM_AURA_EFFECT_RED;
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
921 _50C9A8_item_enchantment_timer = 256;
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
922 LODWORD(v727) = 1;
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
923 break;
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
924 }
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
925 _50C9D0_AfterEnchClickEventId = 113;
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
926 _50C9D4_AfterEnchClickEventSecondParam = 0;
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
927 _50C9D8_AfterEnchClickEventTimeout = 1;
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
928 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
929 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
930 pCastSpell->uSpellID = 0;
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
931 continue;
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
932 }
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
933 case SPELL_BODY_REGENERATION://
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
934 {
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
935 switch (skill_level)
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
936 {
2182
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
937 case 1: amount = 1; break;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
938 case 2: amount = 1; break;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
939 case 3: amount = 3; break;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
940 case 4: amount = 10; break;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
941 default:
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
942 assert(false);
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
943 }
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
944 if ( !pPlayer->CanCastSpell(uRequiredMana) )
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
945 break;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
946 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, pCastSpell->uPlayerID_2);
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
947 pParty->pPlayers[pCastSpell->uPlayerID_2].pPlayerBuffs[PLAYER_BUFF_REGENERATION].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(3600 * spell_level) * 4.2666669), skill_level, amount, 0, 0);
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
948 LODWORD(v727) = 1;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
949 break;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
950 }
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
951 case SPELL_FIRE_PROTECTION_FROM_FIRE://
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
952 case SPELL_AIR_PROTECTION_FROM_AIR://
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
953 case SPELL_WATER_PROTECTION_FROM_WATER://
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
954 case SPELL_EARTH_PROTECTION_FROM_EARTH://
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
955 case SPELL_MIND_PROTECTION_FROM_MIND://
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
956 case SPELL_BODY_PROTECTION_FROM_BODY://
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
957 {
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
958 switch (skill_level)
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
959 {
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
960 case 1:
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
961 case 2:
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
962 case 3:
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
963 case 4: amount = skill_level * spell_level; break;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
964 default:
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
965 assert(false);
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
966 }
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
967 switch (pCastSpell->uSpellID)
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
968 {
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
969 case SPELL_FIRE_PROTECTION_FROM_FIRE:
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
970 buff_resist = PARTY_BUFF_RESIST_FIRE;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
971 break;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
972 case SPELL_AIR_PROTECTION_FROM_AIR:
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
973 buff_resist = PARTY_BUFF_RESIST_AIR;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
974 break;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
975 case SPELL_WATER_PROTECTION_FROM_WATER:
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
976 buff_resist = PARTY_BUFF_RESIST_WATER;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
977 break;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
978 case SPELL_EARTH_PROTECTION_FROM_EARTH:
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
979 buff_resist = PARTY_BUFF_RESIST_EARTH;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
980 break;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
981 case SPELL_MIND_PROTECTION_FROM_MIND:
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
982 buff_resist = PARTY_BUFF_RESIST_MIND;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
983 break;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
984 case SPELL_BODY_PROTECTION_FROM_BODY:
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
985 buff_resist = PARTY_BUFF_RESIST_BODY;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
986 break;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
987 default:
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
988 assert(false);
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
989 continue;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
990 }
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
991 if ( !pPlayer->CanCastSpell(uRequiredMana) )
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
992 break;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
993 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 0);
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
994 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 1);
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
995 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 2);
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
996 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 3);
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
997 //v90 = (double)(signed int)(3600 * spell_level) * 4.2666669;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
998 pParty->pPartyBuffs[buff_resist].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)(3600 * spell_level) * 4.2666669), skill_level, amount, 0, 0);
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
999 LODWORD(v727) = 1;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1000 break;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1001 }
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1002 case SPELL_FIRE_HASTE://
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1003 {
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1004 switch (skill_level)
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1005 {
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1006 case 1: duration = 60 * (spell_level + 60); break;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1007 case 2: duration = 60 * (spell_level + 60); break;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1008 case 3: duration = 180 * (spell_level + 20); break;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1009 case 4: duration = 240 * (spell_level + 15); break;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1010 default:
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1011 assert(false);
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1012 }
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1013 if ( pPlayer->CanCastSpell(uRequiredMana) )
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1014 {
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1015 LODWORD(v727) = 1;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1016 for ( uint pl_id = 0; pl_id < 4; pl_id++ )
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1017 {
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1018 if ( pParty->pPlayers[pl_id].pConditions[Condition_Weak] )
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1019 LODWORD(v727) = 0;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1020 }
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1021 if (LODWORD(v727))
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1022 {
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1023 pParty->pPartyBuffs[PARTY_BUFF_HASTE].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)duration << 7) * 0.033333335), skill_level, 0, 0, 0);
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1024 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 0);
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1025 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 1);
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1026 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 2);
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1027 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 3);
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1028 }
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1029 }
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1030 break;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1031 }
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1032 case SPELL_SPIRIT_BLESS://
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1033 {
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1034 switch (skill_level)
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1035 {
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1036 case 1: duration = 300 * (spell_level + 12); break;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1037 case 2: duration = 300 * (spell_level + 12); break;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1038 case 3: duration = 900 * (spell_level + 4); break;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1039 case 4: duration = 3600 * (spell_level + 1); break;
2181
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
1040 default:
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
1041 assert(false);
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
1042 }
2182
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1043 amount = spell_level + 5;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1044 if ( !pPlayer->CanCastSpell(uRequiredMana) )
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1045 break;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1046 if ( skill_level == 1 )
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1047 {
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1048 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, pCastSpell->uPlayerID_2);
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1049 v111 = pOtherOverlayList->_4418B1(10000, pCastSpell->uPlayerID_2 + 310, 0, 65536);
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1050 pParty->pPlayers[pCastSpell->uPlayerID_2].pPlayerBuffs[PLAYER_BUFF_BLESS].Apply(pParty->uTimePlayed +
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1051 (signed int)(signed __int64)((double)(signed int)((int)duration << 7) * 0.033333335), 1, amount, v111, 0);
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1052 LODWORD(v727) = 1;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1053 break;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1054 }
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1055 for ( uint pl_id = 0; pl_id < 4; pl_id++ )
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1056 {
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1057 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, pl_id);
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1058 v111 = pOtherOverlayList->_4418B1(10000, pl_id + 310, 0, 65536);
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1059 pParty->pPlayers[pl_id].pPlayerBuffs[1].Apply(pParty->uTimePlayed +
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1060 (signed int)(signed __int64)((double)(signed int)((int)duration << 7) * 0.033333335), skill_level, amount, v111, 0);
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1061 }
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1062 LODWORD(v727) = 1;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1063 break;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1064 }
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1065 case SPELL_SPIRIT_SPIRIT_LASH://
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1066 {
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1067 if ( pPlayer->CanCastSpell(uRequiredMana) && a2 && PID_TYPE(a2) == OBJECT_Actor)
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1068 {
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1069 int mon_id = PID_ID(a2);
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1070 dist_X = abs(pActors[mon_id].vPosition.x - pParty->vPosition.x);
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1071 dist_Y = abs(pActors[mon_id].vPosition.y - pParty->vPosition.y);
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1072 dist_Z = abs(pActors[mon_id].vPosition.z - pParty->vPosition.z);
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1073 int count = dist_X;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1074 new_dist_Y = dist_Y;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1075 if ( dist_X < dist_Y )
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1076 {
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1077 v116 = dist_X;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1078 dist_X = dist_Y;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1079 new_dist_Y = v116;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1080 }
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1081 if ( dist_X < dist_Z )
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1082 {
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1083 v117 = dist_X;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1084 dist_X = dist_Z;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1085 dist_Z = v117;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1086 }
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1087 if ( new_dist_Y < dist_Z )
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1088 {
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1089 v118 = dist_Z;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1090 dist_Z = new_dist_Y;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1091 new_dist_Y = v118;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1092 }
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1093 count = ((unsigned int)(11 * new_dist_Y) >> 5) + (dist_Z >> 2) + dist_X;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1094 if ( (double)count <= 307.2 )
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1095 {
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1096 v701.x = 0;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1097 v701.y = 0;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1098 v701.z = 0;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1099 pSpellSprite.stru_24.Reset();
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1100 pSpellSprite.spell_id = pCastSpell->uSpellID;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1101 pSpellSprite.spell_level = v723;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1102 pSpellSprite.spell_skill = skill_level;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1103 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1104 pSpellSprite.uAttributes = 0;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1105 pSpellSprite.uSectorID = 0;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1106 pSpellSprite.uSpriteFrameID = 0;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1107 pSpellSprite.field_60_distance_related_prolly_lod = 0;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1108 pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1109 pSpellSprite.uFacing = 0;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1110 pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1111 pSpellSprite.vPosition.x = pActors[mon_id].vPosition.x;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1112 pSpellSprite.vPosition.y = pActors[mon_id].vPosition.y;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1113 pSpellSprite.vPosition.z = pActors[mon_id].vPosition.z - (unsigned int)(signed __int64)((double)pActors[mon_id].uActorHeight * -0.8);
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1114 pSpellSprite.spell_target_pid = PID(OBJECT_Actor, a2);
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1115 DamageMonsterFromParty(PID(OBJECT_Item, pSpellSprite.Create(0, 0, 0, 0)), mon_id, &v701);
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1116 LODWORD(v727) = 1;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1117 }
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1118 else
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1119 {
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1120 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2);//" !!!"
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1121 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1122 pCastSpell->uSpellID = 0;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1123 }
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1124 }
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1125 break;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1126 }
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1127 case SPELL_AIR_SHIELD://
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1128 case SPELL_EARTH_STONESKIN://
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1129 case SPELL_SPIRIT_HEROISM://
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1130 {
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1131 switch (skill_level)
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1132 {
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1133 case 1: duration = 300 * (spell_level + 12); break;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1134 case 2: duration = 300 * (spell_level + 12); break;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1135 case 3: duration = 900 * (spell_level + 4); break;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1136 case 4: duration = 3600 * (spell_level + 1); break;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1137 default:
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1138 assert(false);
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1139 }
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1140 switch (pCastSpell->uSpellID)
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1141 {
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1142 case SPELL_AIR_SHIELD:
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1143 amount = 0;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1144 buff_resist = PARTY_BUFF_SHIELD;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1145 break;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1146 case SPELL_EARTH_STONESKIN:
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1147 amount = spell_level + 5;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1148 buff_resist = PARTY_BUFF_STONE_SKIN;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1149 break;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1150 case SPELL_SPIRIT_HEROISM:
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1151 amount = spell_level + 5;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1152 buff_resist = PARTY_BUFF_HEROISM;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1153 break;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1154 default:
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1155 assert(false);
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1156 continue;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1157 }
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1158 if ( !pPlayer->CanCastSpell(uRequiredMana) )
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1159 break;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1160 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 0);
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1161 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 1);
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1162 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 2);
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1163 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 3);
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1164 pParty->pPartyBuffs[buff_resist].Apply(pParty->uTimePlayed +
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1165 (signed int)(signed __int64)((double)(signed int)((int)duration << 7) * 0.033333335), skill_level, amount, 0, 0);
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1166 LODWORD(v727) = 1;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1167 break;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1168 }
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1169 case SPELL_FIRE_IMMOLATION://
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1170 {
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1171 if ( skill_level == 4 )
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1172 duration = 600 * spell_level;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1173 else
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1174 duration = 60 * spell_level;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1175 if ( !pPlayer->CanCastSpell(uRequiredMana) )
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1176 break;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1177 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 0);
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1178 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 1);
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1179 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 2);
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1180 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 3);
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1181 pParty->pPartyBuffs[PARTY_BUFF_IMMOLATION].Apply(pParty->uTimePlayed +
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1182 (signed __int64)((double)(signed int)((int)duration << 7) * 0.033333335), skill_level, spell_level, 0, 0);
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1183 LODWORD(v727) = 1;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1184 break;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1185 }
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1186 case SPELL_FIRE_METEOR_SHOWER://
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1187 {
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1188 //if (skill_level < 3)//
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1189 //break;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1190 int meteor_num;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1191 if ( skill_level == 4 )
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1192 meteor_num = 20;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1193 else
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1194 meteor_num = 16;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1195 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor)
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1196 {
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1197 ShowStatusBarString(pGlobalTXT_LocalizationStrings[491], 2); // Can't cast Meteor Shower indoors!
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1198 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1199 pCastSpell->uSpellID = 0;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1200 continue;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1201 }
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1202 if ( !pPlayer->CanCastSpell(uRequiredMana) )
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1203 break;
2183
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1204 obj_type = PID_TYPE(a2);
2182
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1205 mon_id = PID_ID(a2);
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1206 if (obj_type == OBJECT_Actor)// .,
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1207 {
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1208 dist_X = pActors[mon_id].vPosition.x;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1209 dist_Y = pActors[mon_id].vPosition.y;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1210 dist_Z = pActors[mon_id].vPosition.z;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1211 }
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1212 else
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1213 {
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1214 dist_X = pParty->vPosition.x + fixpoint_mul(2048, stru_5C6E00->Cos(pParty->sRotationY));
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1215 dist_Y = pParty->vPosition.y + fixpoint_mul(2048, stru_5C6E00->Sin(pParty->sRotationY));
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1216 dist_Z = pParty->vPosition.z;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1217 }
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1218 unsigned __int64 k = 0;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1219 int j = 0;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1220 if ( meteor_num > 0 )
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1221 {
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1222 v730 = obj_type == OBJECT_Actor ? a2 : 0;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1223 for ( meteor_num; meteor_num; meteor_num-- )
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1224 {
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1225 a2 = rand() % 1000;
2183
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1226 if ( sqrt(((double)a2 - 2500) * ((double)a2 - 2500) + j * j + k * k) <= 1.0 )
2182
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1227 {
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1228 LODWORD(v687) = 0;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1229 HIDWORD(v687) = 0;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1230 }
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1231 else
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1232 {
2183
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1233 HIDWORD(v687) = stru_5C6E00->Atan2((signed __int64)sqrt((float)(j * j + k * k)), (double)a2 - 2500);
2182
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1234 LODWORD(v687) = stru_5C6E00->Atan2(j, k);
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1235 }
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1236 pSpellSprite.stru_24.Reset();
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1237 pSpellSprite.spell_id = pCastSpell->uSpellID;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1238 pSpellSprite.spell_level = spell_level;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1239 pSpellSprite.spell_skill = skill_level;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1240 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1241 pSpellSprite.uAttributes = 0;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1242 pSpellSprite.vPosition.x = dist_X;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1243 pSpellSprite.vPosition.y = dist_Y;
2183
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1244 pSpellSprite.vPosition.z = a2 + dist_Z;
2182
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1245 pSpellSprite.uSectorID = 0;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1246 pSpellSprite.uSpriteFrameID = 0;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1247 pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1248 pSpellSprite.spell_target_pid = v730;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1249 pSpellSprite.field_60_distance_related_prolly_lod = stru_50C198._427546(a2 + 2500);
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1250 pSpellSprite.uFacing = v687;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1251 pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1252 if ( pParty->bTurnBasedModeOn == 1 )
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1253 pSpellSprite.uAttributes = 4;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1254 if ( pSpellSprite.Create(v687, SHIDWORD(v687), pObjectList->pObjects[(signed __int16)pSpellSprite.uObjectDescID].uSpeed, 0) != -1 && pParty->bTurnBasedModeOn == 1 )
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1255 ++pTurnEngine->pending_actions;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1256 j = rand() % 1024 - 512;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1257 k = rand() % 1024 - 512;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1258 }
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1259 }
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1260 LODWORD(v727) = 1;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1261 break;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1262 }
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1263 case SPELL_FIRE_INFERNO://
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1264 {
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1265 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor)
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1266 {
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1267 ShowStatusBarString(pGlobalTXT_LocalizationStrings[492], 2); // Can't cast Inferno outdoors!
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1268 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1269 pCastSpell->uSpellID = 0;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1270 continue;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1271 }
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1272 if ( !pPlayer->CanCastSpell(uRequiredMana) )
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1273 break;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1274 int mon_num = pRenderer->_466_GetActorsInViewport(4096);
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1275 v700.x = 0;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1276 v700.y = 0;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1277 v700.z = 0;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1278 pSpellSprite.stru_24.Reset();
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1279 pSpellSprite.spell_id = pCastSpell->uSpellID;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1280 pSpellSprite.spell_level = spell_level;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1281 pSpellSprite.spell_skill = skill_level;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1282 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1283 pSpellSprite.uAttributes = 0;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1284 pSpellSprite.uSectorID = 0;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1285 pSpellSprite.uSpriteFrameID = 0;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1286 pSpellSprite.field_60_distance_related_prolly_lod = 0;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1287 pSpellSprite.uFacing = 0;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1288 pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1289 pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1290 for ( uint i = 0; i < mon_num; i++ )
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1291 {
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1292 pSpellSprite.vPosition.x = pActors[_50BF30_actors_in_viewport_ids[i]].vPosition.x;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1293 pSpellSprite.vPosition.y = pActors[_50BF30_actors_in_viewport_ids[i]].vPosition.y;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1294 pSpellSprite.vPosition.z = pActors[_50BF30_actors_in_viewport_ids[i]].vPosition.z - (unsigned int)(signed __int64)((double)pActors[_50BF30_actors_in_viewport_ids[i]].uActorHeight * -0.8);
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1295 pSpellSprite.spell_target_pid = PID(OBJECT_Actor, _50BF30_actors_in_viewport_ids[i]);
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1296 DamageMonsterFromParty(PID(OBJECT_Item, pSpellSprite.Create(0, 0, 0, 0)), _50BF30_actors_in_viewport_ids[i], &v700);
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1297 pGame->GetStru6()->_4A81CA(&pSpellSprite);
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1298 pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xFF3C1E, 0x40);
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1299 }
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1300 LODWORD(v727) = 1;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1301 break;
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1302 }
2183
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1303 case SPELL_AIR_WIZARD_EYE://
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1304 {
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1305 duration = 3600 * spell_level;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1306 if ( !pPlayer->CanCastSpell(uRequiredMana) )
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1307 break;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1308 for ( uint pl_id = 0; pl_id < 4; pl_id++ )
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1309 v169 = pOtherOverlayList->_4418B1(2000, pl_id + 100, 0, 65536);
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1310 pParty->pPartyBuffs[PARTY_BUFF_WIZARD_EYE].Apply(pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)duration << 7) * 0.033333335), skill_level, 0, v169, 0);
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1311 LODWORD(v727) = 1;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1312 break;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1313 }
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1314 case SPELL_AIR_FEATHER_FALL://
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1315 {
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1316 switch (skill_level)
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1317 {
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1318 case 1: duration = 300 * spell_level; break;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1319 case 2: duration = 600 * spell_level; break;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1320 case 3: duration = 3600 * spell_level; break;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1321 case 4: duration = 3600 * spell_level; break;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1322 default:
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1323 assert(false);
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1324 }
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1325 if ( !pPlayer->CanCastSpell(uRequiredMana) )
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1326 break;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1327 for ( uint pl_id = 0; pl_id < 4; pl_id++ )
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1328 pOtherOverlayList->_4418B1(2010, pl_id + 100, 0, 65536);
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1329 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 0);
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1330 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 1);
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1331 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 2);
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1332 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 3);
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1333
2183
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1334 pParty->pPartyBuffs[PARTY_BUFF_FEATHER_FALL].Apply(pParty->uTimePlayed +
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1335 (signed int)(signed __int64)((double)(signed int)((int)duration << 7) * 0.033333335), skill_level, 0, 0, 0);
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1336 LODWORD(v727) = 1;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1337 break;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1338 }
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1339 case SPELL_AIR_SPARKS://
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1340 {
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1341 switch (skill_level)
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1342 {
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1343 case 1: amount = 3; break;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1344 case 2: amount = 5; break;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1345 case 3: amount = 7; break;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1346 case 4: amount = 9; break;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1347 default:
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1348 assert(false);
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1349 }
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1350 if ( !pPlayer->CanCastSpell(uRequiredMana) )
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1351 break;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1352 int _v726 = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1353 pSpellSprite.stru_24.Reset();
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1354 pSpellSprite.spell_id = pCastSpell->uSpellID;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1355 pSpellSprite.spell_level = spell_level;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1356 pSpellSprite.spell_skill = skill_level;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1357 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1358 pSpellSprite.vPosition.y = pParty->vPosition.y;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1359 pSpellSprite.vPosition.x = pParty->vPosition.x;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1360 pSpellSprite.uAttributes = 0;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1361 pSpellSprite.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1362 pSpellSprite.uSectorID = pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.y,
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1363 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3);
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1364 pSpellSprite.uSpriteFrameID = 0;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1365 pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1366 pSpellSprite.spell_target_pid = a2;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1367 pSpellSprite.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance);
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1368 pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1369 if ( pParty->bTurnBasedModeOn == 1 )
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1370 LOBYTE(pSpellSprite.uAttributes) |= 4;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1371 v188 = (signed int)_v726 / -2;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1372 v189 = (signed int)_v726 / 2;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1373 while ( v188 <= v189 )
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1374 {
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1375 pSpellSprite.uFacing = v188 + LOWORD(v715.uYawAngle);
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1376 if ( pSpellSprite.Create((signed __int16)(v188 + LOWORD(v715.uYawAngle)), v715.uPitchAngle,
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1377 pObjectList->pObjects[(signed __int16)pSpellSprite.uObjectDescID].uSpeed, pCastSpell->uPlayerID + 1) != -1
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1378 && pParty->bTurnBasedModeOn == 1 )
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1379 ++pTurnEngine->pending_actions;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1380 v188 += _v726 / (amount - 1);
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1381 }
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1382 LODWORD(v727) = 1;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1383 break;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1384 }
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1385 case SPELL_AIR_JUMP://
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1386 {
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1387 if ( pParty->uFlags & PARTY_FLAGS_1_FALLING)
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1388 {
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1389 ShowStatusBarString(pGlobalTXT_LocalizationStrings[493], 2); // Can't cast Jump while airborne!
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1390 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1391 break;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1392 }
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1393 if ( !pPlayer->CanCastSpell(uRequiredMana) )
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1394 break;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1395 for ( uint pl_id = 0; pl_id < 4; pl_id++ )
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1396 pOtherOverlayList->_4418B1(2040, pl_id + 100, 0, 65536);
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1397 pParty->uFlags |= 0x100;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1398 pParty->uFallSpeed = 1000;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1399 LODWORD(v727) = 1;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1400 break;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1401 }
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1402 case SPELL_AIR_INVISIBILITY://
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1403 {
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1404 switch (skill_level)
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1405 {
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1406 case 1: duration = 600 * spell_level; amount = spell_level; break;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1407 case 2: duration = 600 * spell_level; amount = 2 * spell_level; break;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1408 case 3: duration = 600 * spell_level; amount = 3 * spell_level; break;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1409 case 4: duration = 3600 * spell_level; amount = 4 * spell_level; break;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1410 default:
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1411 assert(false);
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1412 }
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1413 if (pParty->uFlags & (PARTY_FLAGS_1_ALERT_RED | PARTY_FLAGS_1_ALERT_YELLOW))
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1414 {
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1415 ShowStatusBarString(pGlobalTXT_LocalizationStrings[638], 2); // There are hostile creatures nearby!
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1416 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1417 pCastSpell->uSpellID = 0;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1418 continue;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1419 }
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1420 if ( pPlayer->CanCastSpell(uRequiredMana) )
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1421 {
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1422 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 0);
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1423 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 1);
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1424 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 2);
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1425 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 3);
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1426 pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].Apply(pParty->uTimePlayed +
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1427 (signed int)(signed __int64)((double)(signed int)((int)duration << 7) * 0.033333335), skill_level, amount, 0, 0);
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1428 LODWORD(v727) = 1;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1429 }
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1430 break;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1431 }
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1432 case SPELL_AIR_FLY://
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1433 {
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1434 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor)
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1435 {
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1436 ShowStatusBarString(pGlobalTXT_LocalizationStrings[494], 2); // Can not cast Fly indoors!
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1437 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1438 break;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1439 }
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1440 if ( !pPlayers[pCastSpell->uPlayerID + 1]->GetMaxMana() )
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1441 {
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1442 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1443 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1444 break;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1445 }
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1446 if ( skill_level == 1 || skill_level == 2 || skill_level == 3 )
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1447 amount = 1;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1448 else
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1449 amount = 0;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1450 if ( !pPlayer->CanCastSpell(uRequiredMana) )
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1451 break;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1452 for ( uint pl_id = 0; pl_id < 4; pl_id++)
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1453 pOtherOverlayList->_4418B1(2090, pl_id + 100, 0, 65536);
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1454 v206 = pOtherOverlayList->_4418B1(10008, 203, 0, 65536);
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1455 pParty->pPartyBuffs[PARTY_BUFF_FLY].Apply(pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)(3600 * spell_level) << 7)
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1456 * 0.033333335), skill_level, amount, v206, pCastSpell->uPlayerID + 1);
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1457 LODWORD(v727) = 1;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1458 break;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1459 }
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1460 case SPELL_AIR_STARBURST://
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1461 {
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1462 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor)
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1463 {
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1464 ShowStatusBarString(pGlobalTXT_LocalizationStrings[495], 2); // Can't cast Starburst indoors!
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1465 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1466 pCastSpell->uSpellID = 0;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1467 continue;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1468 }
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1469 if ( !pPlayer->CanCastSpell(uRequiredMana) )
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1470 break;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1471 obj_type = PID_TYPE(a2);
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1472 mon_id = PID_ID(a2);
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1473 if ( obj_type == OBJECT_Actor )
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1474 {
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1475 dist_X = pActors[mon_id].vPosition.x;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1476 dist_Y = pActors[mon_id].vPosition.y;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1477 dist_Z = pActors[mon_id].vPosition.z;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1478 }
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1479 else
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1480 {
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1481 dist_X = pParty->vPosition.x + fixpoint_mul(2048, stru_5C6E00->Cos(pParty->sRotationY));
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1482 dist_Y = pParty->vPosition.y + fixpoint_mul(2048, stru_5C6E00->Sin(pParty->sRotationY));
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1483 dist_Z = pParty->vPosition.z;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1484 }
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1485 unsigned __int64 k = 0;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1486 int j = 0;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1487 v730 = obj_type == OBJECT_Actor ? a2 : 0;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1488 for ( uint star_num = 20; star_num; star_num-- )
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1489 {
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1490 a2 = rand() % 1000;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1491 if ( sqrt(((double)a2 + (double)dist_Z - (double)(dist_Z + 2500)) * ((double)a2 + (double)dist_Z - (double)(dist_Z + 2500))
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1492 + j * j + k * k) <= 1.0 )
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1493 {
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1494 LODWORD(v685) = 0;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1495 HIDWORD(v685) = 0;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1496 }
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1497 else
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1498 {
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1499 HIDWORD(v685) = stru_5C6E00->Atan2((signed __int64)sqrt(j * j + k * k), ((double)a2 + (double)dist_Z - (double)(dist_Z + 2500)));
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1500 LODWORD(v685) = stru_5C6E00->Atan2(j, k);
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1501 }
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1502 pSpellSprite.stru_24.Reset();
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1503 pSpellSprite.spell_id = pCastSpell->uSpellID;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1504 pSpellSprite.spell_level = spell_level;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1505 pSpellSprite.spell_skill = skill_level;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1506 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1507 pSpellSprite.uAttributes = 0;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1508 pSpellSprite.vPosition.x = dist_X;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1509 pSpellSprite.vPosition.y = dist_Y;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1510 pSpellSprite.vPosition.z = (int)(a2 + (dist_Z + 2500));
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1511 pSpellSprite.uSectorID = 0;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1512 pSpellSprite.uSpriteFrameID = 0;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1513 pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1514 pSpellSprite.spell_target_pid = v730;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1515 pSpellSprite.field_60_distance_related_prolly_lod = stru_50C198._427546(a2 + 2500);
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1516 pSpellSprite.uFacing = v685;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1517 pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1518 if ( pParty->bTurnBasedModeOn == 1 )
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1519 pSpellSprite.uAttributes = 4;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1520 if ( pSpellSprite.Create(v685, SHIDWORD(v685), pObjectList->pObjects[(signed __int16)pSpellSprite.uObjectDescID].uSpeed, 0) != -1
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1521 && pParty->bTurnBasedModeOn == 1 )
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1522 ++pTurnEngine->pending_actions;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1523 j = rand() % 1024 - 512;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1524 k = rand() % 1024 - 512;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1525 }
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1526 LODWORD(v727) = 1;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1527 break;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1528 }
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1529 case SPELL_WATER_AWAKEN://
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1530 {
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1531 switch (skill_level)
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1532 {
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1533 case 1: amount = 180 * spell_level; break;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1534 case 2: amount = 3600 * spell_level; break;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1535 case 3: amount = 86400 * spell_level; break;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1536 case 4: amount = 0; break;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1537 default:
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1538 assert(false);
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1539 }
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1540 if ( !pPlayer->CanCastSpell(uRequiredMana) )
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1541 break;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1542 for( int i=0; i < 4; i++ )
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1543 {
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1544 if ( skill_level == 4 )
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1545 {
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1546 if ( pParty->pPlayers[i].pConditions[Condition_Sleep] )
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1547 {
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1548 //*((int *)v222 + 4) = 0;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1549 //*((int *)v222 + 5) = 0;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1550 pParty->pPlayers[i].pConditions[Condition_Sleep] = 0;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1551 pParty->pPlayers[i].PlaySound(SPEECH_103, 0);
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1552 }
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1553 }
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1554 else
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1555 {
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1556 if ( pParty->pPlayers[i].DiscardConditionIfLastsLongerThan(2, pParty->uTimePlayed -
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1557 (signed int)(signed __int64)((double)(amount << 7) * 0.033333335)) )
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1558 pParty->pPlayers[i].PlaySound(SPEECH_103, 0);
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1559 }
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1560 }
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1561 LODWORD(v727) = 1;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1562 break;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1563 }
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1564 case SPELL_WATER_POISON_SPRAY://
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1565 {
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1566 switch (skill_level)
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1567 {
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1568 case 1: amount = 1; break;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1569 case 2: amount = 3; break;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1570 case 3: amount = 5; break;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1571 case 4: amount = 7; break;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1572 default:
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1573 assert(false);
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1574 }
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1575 if ( !pPlayer->CanCastSpell(uRequiredMana) )
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1576 break;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1577 signed int _v733 = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1578 if ( amount == 1 )
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1579 {
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1580 pSpellSprite.stru_24.Reset();
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1581 pSpellSprite.spell_id = pCastSpell->uSpellID;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1582 pSpellSprite.spell_skill = skill_level;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1583 pSpellSprite.spell_level = spell_level;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1584 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1585 pSpellSprite.uAttributes = 0;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1586 pSpellSprite.vPosition.x = pParty->vPosition.x;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1587 pSpellSprite.vPosition.y = pParty->vPosition.y;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1588 pSpellSprite.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1589 pSpellSprite.uSectorID = pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.y, pSpellSprite.vPosition.z);
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1590 pSpellSprite.uSpriteFrameID = 0;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1591 pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1592 pSpellSprite.spell_target_pid = a2;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1593 pSpellSprite.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance);
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1594 pSpellSprite.uFacing = LOWORD(v715.uYawAngle);
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1595 pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1596 if ( pParty->bTurnBasedModeOn == 1 )
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1597 LOBYTE(pSpellSprite.uAttributes) |= 4;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1598 v659 = pObjectList->pObjects[(signed __int16)pSpellSprite.uObjectDescID].uSpeed;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1599 if ( pSpellSprite.Create(v715.uYawAngle, v715.uPitchAngle, v659, pCastSpell->uPlayerID + 1) != -1 && pParty->bTurnBasedModeOn == 1 )
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1600 ++pTurnEngine->pending_actions;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1601 }
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1602 else
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1603 {
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1604 pSpellSprite.stru_24.Reset();
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1605 pSpellSprite.spell_id = pCastSpell->uSpellID;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1606 pSpellSprite.spell_level = spell_level;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1607 pSpellSprite.spell_skill = skill_level;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1608 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1609 pSpellSprite.vPosition.y = pParty->vPosition.y;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1610 pSpellSprite.vPosition.x = pParty->vPosition.x;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1611 pSpellSprite.uAttributes = 0;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1612 pSpellSprite.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1613 pSpellSprite.uSectorID = pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.y, pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3);
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1614 pSpellSprite.uSpriteFrameID = 0;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1615 pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1616 pSpellSprite.spell_target_pid = a2;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1617 pSpellSprite.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance);
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1618 pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1619 if ( pParty->bTurnBasedModeOn == 1 )
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1620 LOBYTE(pSpellSprite.uAttributes) |= 4;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1621 v227 = _v733 / -2;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1622 signed int _y = _v733 / 2;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1623 if ( v227 <= _y )
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1624 {
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1625 v228 = v715.uYawAngle;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1626 do
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1627 {
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1628 pSpellSprite.uFacing = v227 + v228;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1629 if ( pSpellSprite.Create(pSpellSprite.uFacing, v715.uPitchAngle, pObjectList->pObjects[(signed __int16)pSpellSprite.uObjectDescID].uSpeed,
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1630 pCastSpell->uPlayerID + 1) != -1 && pParty->bTurnBasedModeOn == 1 )
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1631 ++pTurnEngine->pending_actions;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1632 v227 += _v733 / (amount - 1);
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1633 }
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1634 while ( v227 <= _y );
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1635 }
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1636 }
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1637 LODWORD(v727) = 1;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1638 break;
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1639 }
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1640 case SPELL_WATER_WATER_WALK:
172cfb4ee150 CastSpell
Ritor1
parents: 2182
diff changeset
1641 {
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1642 if ( !pPlayers[pCastSpell->uPlayerID + 1]->GetMaxMana() )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1643 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1644 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1645 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1646 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1647 }
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
1648 if ( skill_level == 2 || skill_level != 3 && skill_level != 4 )
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
1649 v229 = 600 * spell_level;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1650 else
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
1651 v229 = 3600 * spell_level;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1652 LODWORD(v733) = v229;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1653 if ( !pPlayer->CanCastSpell(uRequiredMana) )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1654 break;
2182
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1655 v169 = pOtherOverlayList->_4418B1(10005, 201, 0, 65536);
1519
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
1656 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 0);
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
1657 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 1);
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
1658 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 2);
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
1659 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 3);
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1660
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
1661 pParty->pPartyBuffs[PARTY_BUFF_WATER_WALK].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(v229 << 7) * 0.033333335),
2182
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
1662 skill_level, amount, v169, pCastSpell->uPlayerID + 1);
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
1663 if ( skill_level == 4 )
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1664 pParty->pPartyBuffs[PARTY_BUFF_WATER_WALK].uFlags = 1;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1665 LODWORD(v727) = 1;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1666 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1667 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1668 case SPELL_WATER_RECHARGE_ITEM:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1669 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1670 if ( !pPlayer->CanCastSpell(uRequiredMana) )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1671 break;
1384
b51332ab228f changed a few member variables in Player to slightly less confusing names
Grumpy7
parents: 1362
diff changeset
1672 v240 = &pParty->pPlayers[pCastSpell->uPlayerID_2].pInventoryItemList[a2];
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1673
1709
8251e59fd7c1 ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents: 1682
diff changeset
1674 if ( v240->GetItemEquipType() != 12 || v240->uAttributes & 2 )
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1675 {
1682
3c451fd02fcf OnInventoryLeftClick cleanup
Grumpy7
parents: 1643
diff changeset
1676 _50C9D0_AfterEnchClickEventId = 113;
3c451fd02fcf OnInventoryLeftClick cleanup
Grumpy7
parents: 1643
diff changeset
1677 _50C9D4_AfterEnchClickEventSecondParam = 0;
3c451fd02fcf OnInventoryLeftClick cleanup
Grumpy7
parents: 1643
diff changeset
1678 _50C9D8_AfterEnchClickEventTimeout = 1;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1679
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1680 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1681 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
1519
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
1682 pCastSpell->uSpellID = 0;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1683 continue;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1684 }
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
1685 if ( skill_level == 1 || skill_level == 2 )
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1686 v241 = (double)v723 * 0.0099999998 + 0.5;
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
1687 else if ( skill_level == 3 )
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1688 v241 = (double)v723 * 0.0099999998 + 0.69999999;
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
1689 else if ( skill_level == 4 )
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1690 v241 = (double)v723 * 0.0099999998 + 0.80000001;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1691 else
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1692 v241 = 0.0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1693 if ( v241 > 1.0 )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1694 v241 = 1.0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1695 int uNewCharges = v240->uMaxCharges * v241;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1696 v240->uMaxCharges = uNewCharges;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1697 v240->uNumCharges = uNewCharges;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1698 if ( uNewCharges <= 0 )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1699 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1700 v240 = 0;
1682
3c451fd02fcf OnInventoryLeftClick cleanup
Grumpy7
parents: 1643
diff changeset
1701 _50C9D0_AfterEnchClickEventId = 113;
3c451fd02fcf OnInventoryLeftClick cleanup
Grumpy7
parents: 1643
diff changeset
1702 _50C9D4_AfterEnchClickEventSecondParam = 0;
3c451fd02fcf OnInventoryLeftClick cleanup
Grumpy7
parents: 1643
diff changeset
1703 _50C9D8_AfterEnchClickEventTimeout = 1;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1704 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2u);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1705 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
1519
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
1706 pCastSpell->uSpellID = 0;
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
1707 spell_level = v723;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1708 continue;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1709 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1710 v240->uAttributes |= 0x40u;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1711 _50C9A8_item_enchantment_timer = 256;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1712 LODWORD(v727) = 1;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1713 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1714 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1715 case SPELL_WATER_ENCHANT_ITEM:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1716 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1717 if ( !pPlayer->CanCastSpell(uRequiredMana) )
1682
3c451fd02fcf OnInventoryLeftClick cleanup
Grumpy7
parents: 1643
diff changeset
1718 break;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1719 uRequiredMana = 0;
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
1720 amount = 10 * spell_level;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1721 v730 = 1;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1722 pPlayer = &pParty->pPlayers[pCastSpell->uPlayerID_2];
1384
b51332ab228f changed a few member variables in Player to slightly less confusing names
Grumpy7
parents: 1362
diff changeset
1723 v245 = &pPlayer->pInventoryItemList[a2];
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1724 ItemDesc *_v725 = &pItemsTable->pItems[v245->uItemID];
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1725 if (
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
1726 skill_level == 1 || skill_level == 2 && _v725->uEquipType > 2 ||
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
1727 skill_level == 3 || skill_level == 4 &&
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1728 v245->uItemID <= 134 &&
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1729 v245->uSpecEnchantmentType == 0 &&
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1730 v245->uEnchantmentType == 0 &&
1599
bb2378f58767 Player::GetItemsBonus removed majority of labels
Grumpy7
parents: 1567
diff changeset
1731 v245->m_enchantmentStrength== 0 &&
1567
9f8b3e904e14 Player::ReceiveDamage, very small edits; prepended "Is" to item functions returning bool values (broken, indetified, stolen)
Grumpy7
parents: 1558
diff changeset
1732 !v245->IsBroken() )
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1733 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1734 if ( v245->GetValue() < 450 ||
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
1735 (v245->GetValue() < 250 && (skill_level == 3 || skill_level == 4) && _v725->uEquipType >= 0 && _v725->uEquipType <= 2)
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1736 )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1737 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1738 v730 = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1739 }
2080
Ritor1
parents: 2057
diff changeset
1740
1409
c9e3b93ec570 Highlighted locations with "using uninitialized variable" warning.
Nomad
parents: 1408
diff changeset
1741 __debugbreak(); // castspellinfo.cpp(1962): warning C4700: uninitialized local variable 'v271' used
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
1742 if ( rand() % 100 < 10 * spell_level ||
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
1743 (rand() % 100 < 80 && (skill_level == 3 || skill_level == 4 )) ||
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1744 v245->GetValue() < 450 ||
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
1745 (v245->GetValue() < 250 && (skill_level == 3 || skill_level == 4) && v271 >= 0 && v271 <= 2)
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1746 )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1747 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1748 v313 = _v725->uEquipType;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1749 if ( _v725->uEquipType >= 3 && _v725->uEquipType <= 11 )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1750 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1751 v295 = rand() % 10;// pItemsTable->field_116D8[pItemsTable->pItems[_this->uItemID].uEquipType];
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1752 v245->uEnchantmentType = 0;
1409
c9e3b93ec570 Highlighted locations with "using uninitialized variable" warning.
Nomad
parents: 1408
diff changeset
1753 __debugbreak(); // castspellinfo.cpp(1971): warning C4700: uninitialized local variable 'v294' used
1709
8251e59fd7c1 ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents: 1682
diff changeset
1754 for ( kk = pItemsTable->pEnchantments[0].to_item[v245->GetItemEquipType() + 1];
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1755 ;
1709
8251e59fd7c1 ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents: 1682
diff changeset
1756 kk += pItemsTable->pEnchantments[v294->uEnchantmentType].to_item[v245->GetItemEquipType() + 1] )
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1757 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1758 ++v245->uEnchantmentType;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1759 if ( kk >= v295 )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1760 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1761 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1762 v255 = 10;//pItemsTable->field_116D8[17];
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1763 v256 = 10;//pItemsTable->field_116D8[16];
1599
bb2378f58767 Player::GetItemsBonus removed majority of labels
Grumpy7
parents: 1567
diff changeset
1764 v245->m_enchantmentStrength = v256 + rand() % (v255 - v256 + 1);
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1765 v245->uAttributes |= 0x20u;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1766 _50C9A8_item_enchantment_timer = 256;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1767 LODWORD(v727) = 1;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1768 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1769 }
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
1770 else if ( skill_level == 3 || skill_level == 4)
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1771 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1772 v257 = pItemsTable->pSpecialEnchantments_count;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1773 v258 = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1774 v725 = 0.0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1775 int _v733 = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1776 if ( pItemsTable->pSpecialEnchantments_count > 0 )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1777 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1778 v730 = (int)&v679;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1779 do
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1780 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1781 v259 = LOBYTE(pItemsTable->pSpecialEnchantments[v258 + 1].pBonusStatement);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1782 if ( !v259 || v259 == 1 )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1783 {
1709
8251e59fd7c1 ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents: 1682
diff changeset
1784 v260 = *(&pItemsTable->pSpecialEnchantments[0].to_item_apply[v245->GetItemEquipType()
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1785 + 4]
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1786 + v258 * 28);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1787 LODWORD(v725) += v260;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1788 if ( v260 )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1789 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1790 v261 = v730;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1791 v730 += 4;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1792 *(int *)v261 = _v733;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1793 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1794 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1795 ++_v733;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1796 ++v258;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1797 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1798 while ( _v733 < v257 );
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1799 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1800 v262 = rand() % SLODWORD(v725);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1801 v263 = v679;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1802 v245->uSpecEnchantmentType = v679[0];
1709
8251e59fd7c1 ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents: 1682
diff changeset
1803 v264 = pItemsTable->pSpecialEnchantments[*v263].to_item_apply[v245->GetItemEquipType() + 4];
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1804 v265 = v262 + 1;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1805 if ( v264 < v265 )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1806 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1807 for ( ii = v679; ; ii = (int *)v732 )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1808 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1809 v267 = (int)(ii + 1);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1810 v732 = v267;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1811 v268 = *(int *)v267;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1812 *(int *)(v245 + 12) = v268;
1709
8251e59fd7c1 ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents: 1682
diff changeset
1813 v264 += pItemsTable->pSpecialEnchantments[v268].to_item_apply[v245->GetItemEquipType()
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1814 + 4];
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1815 if ( v264 >= v265 )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1816 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1817 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1818 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1819
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1820 v277 = pItemsTable->pSpecialEnchantments_count;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1821 v278 = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1822 v725 = 0.0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1823 _v733 = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1824 if ( pItemsTable->pSpecialEnchantments_count > 0 )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1825 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1826 int *_v730 = v679;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1827 do
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1828 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1829 v279 = LOBYTE(pItemsTable->pSpecialEnchantments[v278].pBonusStatement);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1830 if ( !v279 || v279 == 1 )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1831 {
1709
8251e59fd7c1 ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents: 1682
diff changeset
1832 v280 = *(&pItemsTable->pSpecialEnchantments[v278].to_item_apply[v245->GetItemEquipType()]);
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1833 _v733 += v280;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1834 if ( v280 )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1835 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1836 v281 = _v730;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1837 ++_v730;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1838 *v281 = _v733;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1839 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1840 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1841 ++_v733;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1842 ++v278;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1843 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1844 while ( _v733 < v277 );
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1845 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1846 v282 = rand() % _v733;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1847 v283 = v679;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1848 v245->uSpecEnchantmentType = v679[0];
1709
8251e59fd7c1 ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents: 1682
diff changeset
1849 v284 = pItemsTable->pSpecialEnchantments[*v283].to_item_apply[v245->GetItemEquipType() ];
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1850 v285 = v282 + 1;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1851 for ( l = v679; v284 < v285; ++l )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1852 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1853 v245->uSpecEnchantmentType = *(l+1);
1709
8251e59fd7c1 ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents: 1682
diff changeset
1854 v284 += pItemsTable->pSpecialEnchantments[*(l+1)].to_item_apply[v245->GetItemEquipType()];
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1855 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1856 ++v245->uSpecEnchantmentType;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1857 v245->uAttributes |= 0x20u;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1858 _50C9A8_item_enchantment_timer = 256;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1859 LODWORD(v727) = 1;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1860 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1861 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1862 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1863 else
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1864 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1865 if ( !(BYTE1(v245->uAttributes) & 2) )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1866 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1867 v245->uAttributes |= 2;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1868 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1869 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1870
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1871 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1872
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1873 if ( LODWORD(v727) == 0 )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1874 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1875 v317 = pGlobalTXT_LocalizationStrings[428];
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1876 if ( v730 == 0 )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1877 v317 = pGlobalTXT_LocalizationStrings[585];
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1878 ShowStatusBarString(v317, 2u);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1879 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1880 v318 = &pParty->pPlayers[pCastSpell->uPlayerID_2];
1519
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
1881 pCastSpell->uSpellID = 0;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1882 v318->PlaySound(SPEECH_43, 0);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1883 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1884
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1885 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1886 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1887 case SPELL_WATER_TOWN_PORTAL:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1888 {
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
1889 amount = 10 * spell_level;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1890 if ( pPlayer->sMana < (signed int)uRequiredMana )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1891 break;
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
1892 if ( pParty->uFlags & (PARTY_FLAGS_1_ALERT_RED | PARTY_FLAGS_1_ALERT_YELLOW) && skill_level != 4 || rand() % 100 >= amount && skill_level != 4 )
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1893 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1894 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1895 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
1519
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
1896 pCastSpell->uSpellID = 0;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1897 continue;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1898 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1899 town_portal_caster_id = LOBYTE(pCastSpell->uPlayerID);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1900 pMessageQueue_50CBD0->AddMessage(UIMSG_OnCastTownPortal, 0, 0);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1901 LODWORD(v727) = 1;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1902 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1903 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1904 case SPELL_WATER_LLOYDS_BEACON:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1905 {
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
1906 LODWORD(v733) = 604800 * spell_level;
1477
7ef4b64f6329 * LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents: 1459
diff changeset
1907 if ( !_stricmp(pCurrentMapName, "d05.blv") )
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1908 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1909 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1910 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
1519
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
1911 pCastSpell->uSpellID = 0;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1912 continue;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1913 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1914 v319 = uRequiredMana;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1915 if ( pPlayer->sMana >= (signed int)uRequiredMana )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1916 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1917 pEventTimer->Pause();
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1918 pMessageQueue_50CBD0->AddMessage(UIMSG_OnCastLloydsBeacon, 0, 0);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1919 qword_506350 = (signed int)v733;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1920 _506348_current_lloyd_playerid = pCastSpell->uPlayerID;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1921 ::uRequiredMana = v319;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1922 ::sRecoveryTime = sRecoveryTime;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1923 dword_50633C = pCastSpell->sound_id;
1519
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
1924 dword_506338 = pCastSpell->uSpellID;
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
1925 pCastSpell->uFlags |= 0x20u;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1926 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1927 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1928 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1929 case SPELL_EARTH_STONE_TO_FLESH:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1930 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1931 __debugbreak(); // missing GM ?
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
1932 switch (skill_level)
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1933 {
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
1934 case 1: amount = 3600 * spell_level; break;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
1935 case 2: amount = 3600 * spell_level; break;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
1936 case 3: amount = 86400 * spell_level; break;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1937 case 4: break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1938 default:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1939 assert(false);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1940 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1941 //LABEL_634:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1942 if ( !pPlayer->CanCastSpell(uRequiredMana) )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1943 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1944 v323 = pCastSpell->uPlayerID_2;
2057
b7485a6502f2 AgressorAtackInfo
Ritor1
parents: 2044
diff changeset
1945 v324 = (char *)&pParty->pPlayers[v323].pConditions[Condition_Pertified];
b7485a6502f2 AgressorAtackInfo
Ritor1
parents: 2044
diff changeset
1946 if ( !pParty->pPlayers[v323].pConditions[Condition_Pertified] )
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1947 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1948 LODWORD(v727) = 1;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1949 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1950 }
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
1951 if ( skill_level == 4 )
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1952 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1953 *(int *)v324 = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1954 *((int *)v324 + 1) = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1955 LODWORD(v727) = 1;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1956 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1957 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1958 v732 = amount << 7;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1959 v663 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1960 v656 = 15;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1961 v325 = &pParty->pPlayers[v323];
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1962 v325->DiscardConditionIfLastsLongerThan(v656, v663);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1963 LODWORD(v727) = 1;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1964 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1965 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1966 case SPELL_EARTH_ROCK_BLAST:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1967 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1968 if ( !pPlayer->CanCastSpell(uRequiredMana) )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1969 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1970 pSpellSprite.stru_24.Reset();
1519
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
1971 pSpellSprite.spell_id = pCastSpell->uSpellID;
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
1972 pSpellSprite.spell_level = spell_level;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
1973 pSpellSprite.spell_skill = skill_level;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1974 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1975 pSpellSprite.vPosition.y = pParty->vPosition.y;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1976 pSpellSprite.vPosition.x = pParty->vPosition.x;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1977 pSpellSprite.uAttributes = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1978 pSpellSprite.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3;
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
1979 pSpellSprite.uSectorID = pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.y, pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3);
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1980 pSpellSprite.uSpriteFrameID = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1981 pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1982 pSpellSprite.spell_target_pid = a2;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1983 pSpellSprite.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1984 pSpellSprite.uFacing = LOWORD(pParty->sRotationY);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1985 pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1986 if ( pParty->bTurnBasedModeOn == 1 )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1987 LOBYTE(pSpellSprite.uAttributes) |= 4u;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1988
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1989 v659 = pObjectList->pObjects[(signed __int16)pSpellSprite.uObjectDescID].uSpeed;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1990 if ( pSpellSprite.Create(pParty->sRotationY, pParty->sRotationX, v659, pCastSpell->uPlayerID + 1) != -1 && pParty->bTurnBasedModeOn == 1 )
1450
8ff3c675a726 more renaming TE
Gloval
parents: 1449
diff changeset
1991 ++pTurnEngine->pending_actions;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1992 LODWORD(v727) = 1;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1993 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1994 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1995 case SPELL_EARTH_DEATH_BLOSSOM:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1996 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1997 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor)
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1998 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
1999 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2000 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
1519
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
2001 pCastSpell->uSpellID = 0;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2002 continue;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2003 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2004 if ( !pPlayer->CanCastSpell(uRequiredMana) )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2005 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2006 pSpellSprite.uType = 4090;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2007 pSpellSprite.stru_24.Reset();
1519
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
2008 pSpellSprite.spell_id = pCastSpell->uSpellID;
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2009 pSpellSprite.spell_level = spell_level;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2010 pSpellSprite.spell_skill = skill_level;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2011 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2012 pSpellSprite.vPosition.x = pParty->vPosition.x;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2013 pSpellSprite.vPosition.y = pParty->vPosition.y;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2014 pSpellSprite.uAttributes = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2015 pSpellSprite.uSectorID = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2016 pSpellSprite.uSpriteFrameID = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2017 pSpellSprite.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2018 pSpellSprite.field_60_distance_related_prolly_lod = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2019 pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2020 pSpellSprite.spell_target_pid = a2;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2021 pSpellSprite.uFacing = LOWORD(pParty->sRotationY);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2022 pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2023 if ( pParty->bTurnBasedModeOn == 1 )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2024 pSpellSprite.uAttributes = 4;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2025
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2026 v659 = pObjectList->pObjects[(signed __int16)pSpellSprite.uObjectDescID].uSpeed;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2027 if ( pSpellSprite.Create(pParty->sRotationY, stru_5C6E00->uIntegerHalfPi / 2, v659, 0) != -1 && pParty->bTurnBasedModeOn == 1 )
1450
8ff3c675a726 more renaming TE
Gloval
parents: 1449
diff changeset
2028 ++pTurnEngine->pending_actions;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2029 LODWORD(v727) = 1;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2030 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2031 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2032 case SPELL_SPIRIT_DETECT_LIFE:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2033 {
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2034 v328 = skill_level - 2;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2035 if ( v328 )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2036 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2037 v329 = v328 - 1;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2038 if ( v329 && v329 != 1 )
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2039 v330 = 600 * spell_level;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2040 else
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2041 v330 = 3600 * spell_level;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2042 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2043 else
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2044 {
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2045 v330 = 1800 * spell_level;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2046 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2047 LODWORD(v733) = v330;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2048 if ( !pPlayer->CanCastSpell(uRequiredMana) )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2049 break;
1519
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
2050 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 0);
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
2051 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 1);
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
2052 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 2);
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
2053 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 3);
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2054
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2055 pParty->pPartyBuffs[PARTY_BUFF_DETECT_LIFE].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), skill_level, 0, 0, 0);
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2056 LODWORD(v727) = 1;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2057 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2058 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2059 case SPELL_SPIRIT_FATE:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2060 {
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2061 switch (skill_level)
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2062 {
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2063 case 1: amount = 1 * spell_level; break;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2064 case 2: amount = 2 * spell_level; break;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2065 case 3: amount = 4 * spell_level; break;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2066 case 4: amount = 6 * spell_level; break;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2067 default:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2068 assert(false);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2069 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2070 LODWORD(v733) = 300;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2071 if ( !pPlayer->CanCastSpell(uRequiredMana) )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2072 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2073 v342 = pCastSpell->spell_target_pid;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2074 if ( v342 == 0 )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2075 {
1519
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
2076 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, pCastSpell->uPlayerID_2);
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2077
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2078 pParty->pPlayers[pCastSpell->uPlayerID_2].pPlayerBuffs[PLAYER_BUFF_FATE].Apply(pParty->uTimePlayed + 1280, skill_level, amount, 0, 0);
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2079 LODWORD(v727) = 1;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2080 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2081 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2082 if (PID_TYPE(v342) == OBJECT_Actor)
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2083 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2084 v343 = PID_ID(v342);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2085 HIDWORD(v344) = 0 + ((pParty->uTimePlayed + 1280) >> 32);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2086 LODWORD(v344) = LODWORD(pParty->uTimePlayed) + 1280;
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2087 pActors[v343].pActorBuffs[ACTOR_BUFF_FATE].Apply(v344, skill_level, amount, 0, 0);
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2088 BYTE2(pActors[v343].uAttributes) |= 8u;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2089 //v672 = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2090 v661 = &pActors[v343];
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2091 pGame->GetStru6()->_4A7E89_sparkles_on_actor_after_it_casts_buff(v661, 0);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2092 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2093 LODWORD(v727) = 1;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2094 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2095 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2096 case SPELL_SPIRIT_REMOVE_CURSE:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2097 {
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2098 switch (skill_level)
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2099 {
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2100 case 1: amount = 3600 * spell_level; break;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2101 case 2: amount = 3600 * spell_level; break;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2102 case 3: amount = 86400 * spell_level; break;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2103 case 4: amount = 0; break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2104 default:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2105 assert(false);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2106 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2107 if ( !pPlayer->CanCastSpell(uRequiredMana) )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2108 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2109 v351 = &pParty->pPlayers[pCastSpell->uPlayerID_2];
2057
b7485a6502f2 AgressorAtackInfo
Ritor1
parents: 2044
diff changeset
2110 if ( !v351->pConditions[Condition_Cursed] )
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2111 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2112 LODWORD(v727) = 1;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2113 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2114 }
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2115 if ( skill_level == 4 )
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2116 {
2057
b7485a6502f2 AgressorAtackInfo
Ritor1
parents: 2044
diff changeset
2117 LODWORD(v351->pConditions[Condition_Cursed]) = 0;
b7485a6502f2 AgressorAtackInfo
Ritor1
parents: 2044
diff changeset
2118 HIDWORD(v351->pConditions[Condition_Cursed]) = 0;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2119 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2120 else
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2121 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2122 v732 = amount << 7;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2123 v351->DiscardConditionIfLastsLongerThan(0, (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335));
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2124 if ( HIDWORD(pParty->pPlayers[pCastSpell->uPlayerID_2].pConditions[0]) | LODWORD(pParty->pPlayers[pCastSpell->uPlayerID_2].pConditions[0]) )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2125 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2126 LODWORD(v727) = 1;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2127 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2128 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2129 }
1519
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
2130 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, pCastSpell->uPlayerID_2);
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2131 LODWORD(v727) = 1;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2132 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2133 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2134 case SPELL_SPIRIT_PRESERVATION:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2135 {
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2136 if ( skill_level == 4 )
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2137 LODWORD(v733) = 900 * (spell_level + 4);
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2138 else
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2139 LODWORD(v733) = 300 * (spell_level + 12);
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2140 if ( !pPlayer->CanCastSpell(uRequiredMana) )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2141 break;
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2142 if ( skill_level == 1 || skill_level == 2 )
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2143 {
1519
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
2144 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, pCastSpell->uPlayerID_2);
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2145 pParty->pPlayers[pCastSpell->uPlayerID_2].pPlayerBuffs[PLAYER_BUFF_PRESERVATION].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), skill_level, 0, 0, 0);
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2146 LODWORD(v727) = 1;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2147 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2148 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2149 a2 = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2150 v717 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335);
1861
a86c60679949 changing most of party arrays to std::arrays, some minor cleanups in actor.cpp
Grumpy7
parents: 1829
diff changeset
2151 v357 = pParty->pPlayers.data();//[0].pPlayerBuffs[11];
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2152 do
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2153 {
1519
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
2154 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, a2);
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2155 v357->pPlayerBuffs[PLAYER_BUFF_PRESERVATION].Apply(pParty->uTimePlayed + v717, skill_level, 0, 0, 0);
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2156 ++a2;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2157 ++v357;// = (SpellBuff *)((char *)v357 + 6972);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2158 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2159 while ( v357 <= &pParty->pPlayers[3] );
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2160 LODWORD(v727) = 1;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2161 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2162 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2163 case SPELL_SPIRIT_TURN_UNDEAD:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2164 {
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2165 if ( skill_level == 1 || skill_level == 2)
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2166 LODWORD(v733) = 60 * (spell_level + 3);
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2167 else
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2168 LODWORD(v733) = 300 * spell_level + 180;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2169 if ( !pPlayer->CanCastSpell(uRequiredMana) )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2170 break;
2182
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
2171 int _v726 = pRenderer->_466_GetActorsInViewport(4096);
2155
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
2172 pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xFFFFFF, 192);
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2173 ++pSpellSprite.uType;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2174 pSpellSprite.stru_24.Reset();
1519
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
2175 pSpellSprite.spell_id = pCastSpell->uSpellID;
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2176 pSpellSprite.spell_level = spell_level;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2177 pSpellSprite.spell_skill = skill_level;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2178 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2179 pSpellSprite.uAttributes = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2180 pSpellSprite.uSectorID = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2181 pSpellSprite.uSpriteFrameID = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2182 pSpellSprite.field_60_distance_related_prolly_lod = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2183 pSpellSprite.uFacing = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2184 pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2185 pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2186 for ( a2 = 0; a2 < (signed int)_v726; ++a2 )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2187 {
2182
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
2188 v369 = &pActors[_50BF30_actors_in_viewport_ids[a2]];
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2189 if ( MonsterStats::BelongsToSupertype(v369->pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2190 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2191 pSpellSprite.vPosition.x = v369->vPosition.x;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2192 pSpellSprite.vPosition.y = v369->vPosition.y;
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2080
diff changeset
2193 pSpellSprite.vPosition.z = v369->vPosition.z - (unsigned int)(signed __int64)((double)v369->uActorHeight * -0.8);
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2194
2182
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
2195 pSpellSprite.spell_target_pid = PID(OBJECT_Actor, _50BF30_actors_in_viewport_ids[a2]);
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2196 pSpellSprite.Create(0, 0, 0, 0);
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2197 v369->pActorBuffs[ACTOR_BUFF_AFRAID].Apply(pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335),
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2198 skill_level, 0, 0, 0);
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2199 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2200 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2201 LODWORD(v727) = 1;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2202 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2203 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2204 case SPELL_SPIRIT_RAISE_DEAD:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2205 {
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2206 if ( skill_level == 4 )
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2207 amount = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2208 else
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2209 amount = 86400 * spell_level;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2210 if ( !pPlayer->CanCastSpell(uRequiredMana) )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2211 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2212 pOtherOverlayList->_4418B1(5080, pCastSpell->uPlayerID_2 + 100, 0, 65536);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2213 v373 = pCastSpell->uPlayerID_2;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2214 if ( !(HIDWORD(pParty->pPlayers[v373].pConditions[14]) | LODWORD(pParty->pPlayers[v373].pConditions[14])) )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2215 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2216 LODWORD(v727) = 1;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2217 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2218 }
2181
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
2219 //v14 = skill_level == 4;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2220 pParty->pPlayers[v373].sHealth = 1;
2181
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
2221 if ( skill_level == 4 )
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2222 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2223 v374 = pCastSpell->uPlayerID_2;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2224 LODWORD(pParty->pPlayers[v374].pConditions[14]) = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2225 HIDWORD(pParty->pPlayers[v374].pConditions[14]) = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2226 v376 = pCastSpell->uPlayerID_2;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2227 LODWORD(pParty->pPlayers[v376].pConditions[13]) = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2228 HIDWORD(pParty->pPlayers[v376].pConditions[13]) = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2229 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2230 else
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2231 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2232 *(float *)&a2 = (double)(amount << 7) * 0.033333335;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2233 pParty->pPlayers[pCastSpell->uPlayerID_2].DiscardConditionIfLastsLongerThan(
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2234 0xEu,
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2235 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2));
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2236 pParty->pPlayers[pCastSpell->uPlayerID_2].DiscardConditionIfLastsLongerThan(
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2237 0xDu,
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2238 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2));
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2239 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2240 v377 = &pParty->pPlayers[pCastSpell->uPlayerID_2];
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2241 v377->SetCondition(1, 0);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2242 LODWORD(v727) = 1;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2243 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2244 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2245 case SPELL_SPIRIT_SHARED_LIFE:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2246 {
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2247 if ( skill_level == 4 )
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2248 amount = 4 * spell_level;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2249 else
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2250 amount = 3 * spell_level;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2251 if ( !pPlayer->CanCastSpell(uRequiredMana) )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2252 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2253 v381 = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2254 signed int _v733 = amount;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2255 v730 = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2256 v382 = 1;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2257 do
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2258 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2259 v383 = pPlayers[v382];
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2260 if ( !v383->pConditions[14] && !v383->pConditions[15] && !v383->pConditions[16] )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2261 v682[v381++] = v382;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2262 ++v382;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2263 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2264 while ( v382 <= 4 );
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2265 v384 = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2266 v730 = v381;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2267 if ( v381 > 0 )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2268 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2269 do
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2270 _v733 += pPlayers[v682[v384++]]->sHealth;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2271 while ( v384 < v381 );
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2272 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2273 v732 = (signed __int64)((double)_v733 / (double)v730);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2274 _v733 = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2275 if ( v381 > 0 )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2276 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2277 do
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2278 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2279 //v385 = (ItemGen **)&pPlayers[v682[HIDWORD(v733)]];
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2280 v726 = pPlayers[v682[_v733]];
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2281 v726->sHealth = v732;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2282 //v386 = v726->GetMaxHealth();
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2283 if ( v726->sHealth > v726->GetMaxHealth())
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2284 v726->sHealth = v726->GetMaxHealth();
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2285 if ( v726->sHealth > 0 )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2286 {
1361
b3ac17fd12de Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents: 1340
diff changeset
2287 v726->SetUnconcious(0);
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2288 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2289 v388 = _v733;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2290
1519
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
2291 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, LOWORD(v682[_v733]) - 1);
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2292 _v733 = v388 + 1;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2293 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2294 while ( v388 + 1 < v730 );
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2295 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2296 LODWORD(v727) = 1;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2297 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2298 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2299 case SPELL_SPIRIT_RESSURECTION:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2300 {
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2301 switch (skill_level)
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2302 {
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2303 case 1: amount = 180 * spell_level; break;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2304 case 2: amount = 10800 * spell_level; break;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2305 case 3: amount = 259200 * spell_level; break;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2306 case 4: amount = 0; break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2307 default:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2308 assert(false);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2309 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2310 if ( !pPlayer->CanCastSpell(uRequiredMana) )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2311 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2312 v396 = pCastSpell->uPlayerID_2;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2313 if ( HIDWORD(pParty->pPlayers[v396].pConditions[16]) | LODWORD(pParty->pPlayers[v396].pConditions[16])
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2314 || HIDWORD(pParty->pPlayers[v396].pConditions[14]) | LODWORD(pParty->pPlayers[v396].pConditions[14]) )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2315 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2316 if ( !(HIDWORD(pParty->pPlayers[v396].pConditions[1]) | LODWORD(pParty->pPlayers[v396].pConditions[1])) )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2317 pParty->pPlayers[v396].PlaySound(SPEECH_25, 0);
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2318 if ( skill_level == 4 )
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2319 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2320 v397 = pCastSpell->uPlayerID_2;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2321 LODWORD(pParty->pPlayers[v397].pConditions[16]) = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2322 HIDWORD(pParty->pPlayers[v397].pConditions[16]) = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2323 v398 = pCastSpell->uPlayerID_2;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2324 LODWORD(pParty->pPlayers[v398].pConditions[14]) = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2325 HIDWORD(pParty->pPlayers[v398].pConditions[14]) = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2326 v399 = pCastSpell->uPlayerID_2;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2327 LODWORD(pParty->pPlayers[v399].pConditions[13]) = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2328 HIDWORD(pParty->pPlayers[v399].pConditions[13]) = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2329 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2330 else
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2331 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2332 *(float *)&a2 = (double)(amount << 7) * 0.033333335;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2333 pParty->pPlayers[pCastSpell->uPlayerID_2].DiscardConditionIfLastsLongerThan( 0x10u,
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2334 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2));
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2335 pParty->pPlayers[pCastSpell->uPlayerID_2].DiscardConditionIfLastsLongerThan( 0xEu,
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2336 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2));
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2337 pParty->pPlayers[pCastSpell->uPlayerID_2].DiscardConditionIfLastsLongerThan( 0xDu,
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2338 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2));
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2339 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2340 pParty->pPlayers[pCastSpell->uPlayerID_2].SetCondition(1u, 1);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2341 pParty->pPlayers[pCastSpell->uPlayerID_2].sHealth = 1;
1519
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
2342 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, pCastSpell->uPlayerID_2);
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2343 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2344 LODWORD(v727) = 1;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2345 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2346 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2347 case SPELL_MIND_CURE_PARALYSIS:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2348 {
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2349 switch (skill_level)
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2350 {
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2351 case 1: amount = 3600 * spell_level; break;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2352 case 2: amount = 3600 * spell_level; break;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2353 case 3: amount = 86400 * spell_level; break;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2354 case 4: amount = 0; break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2355 default:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2356 assert(false);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2357 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2358 if ( !pPlayer->CanCastSpell(uRequiredMana) )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2359 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2360
1519
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
2361 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, pCastSpell->uPlayerID_2);
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2362 v323 = pCastSpell->uPlayerID_2;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2363 v324 = (char *)&pParty->pPlayers[v323].pConditions[12];
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2364 if ( !pParty->pPlayers[v323].pConditions[12] )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2365 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2366 LODWORD(v727) = 1;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2367 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2368 }
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2369 if ( skill_level == 4 )
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2370 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2371 *(int *)v324 = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2372 *((int *)v324 + 1) = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2373 LODWORD(v727) = 1;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2374 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2375 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2376 v663 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2377 v656 = 12;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2378 v325 = &pParty->pPlayers[v323];
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2379 v325->DiscardConditionIfLastsLongerThan(v656, v663);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2380 LODWORD(v727) = 1;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2381 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2382 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2383 case SPELL_MIND_REMOVE_FEAR:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2384 {
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2385 switch (skill_level)
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2386 {
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2387 case 1: amount = 180 * spell_level; break;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2388 case 2: amount = 3600 * spell_level; break;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2389 case 3: amount = 86400 * spell_level; break;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2390 case 4: amount = 0; break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2391 default:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2392 assert(false);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2393 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2394
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2395 if ( !pPlayer->CanCastSpell(uRequiredMana) )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2396 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2397
1519
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
2398 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, pCastSpell->uPlayerID_2);
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2399 v323 = pCastSpell->uPlayerID_2;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2400 v324 = (char *)&pParty->pPlayers[v323].pConditions[3];
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2401 if ( !pParty->pPlayers[v323].pConditions[3] )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2402 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2403 LODWORD(v727) = 1;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2404 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2405 }
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2406 if ( skill_level == 4 )
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2407 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2408 *(int *)v324 = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2409 *((int *)v324 + 1) = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2410 LODWORD(v727) = 1;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2411 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2412 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2413 v663 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2414 v656 = 3;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2415 v325 = &pParty->pPlayers[v323];
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2416 v325->DiscardConditionIfLastsLongerThan(v656, v663);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2417 LODWORD(v727) = 1;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2418 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2419 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2420 case SPELL_MIND_TELEPATHY:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2421 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2422 if ( !pPlayer->CanCastSpell(uRequiredMana) )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2423 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2424 if (PID_TYPE(a2) != OBJECT_Actor)
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2425 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2426 LODWORD(v727) = 1;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2427 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2428 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2429 v417 = &pActors[PID_ID(a2)];
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2430 Actor * _v730 = v417;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2431 if ( !(BYTE2(v417->uAttributes) & 0x80) )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2432 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2433 v417->SetRandomGoldIfTheresNoItem();
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2434 v417 = _v730;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2435 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2436 v418 = v417->array_000234[3].uItemID;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2437 signed int _v733 = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2438 if ( pItemsTable->pItems[v418].uEquipType == 18 )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2439 _v733 = v417->array_000234[3].uSpecEnchantmentType;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2440
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2441 //ItemGen::ItemGen(&v683);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2442 v683.Reset();
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2443
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2444 v419 = _v730->uCarriedItemID;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2445 if (v419)
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2446 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2447 v683.uItemID = v419;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2448 //goto LABEL_799;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2449 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2450 else
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2451 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2452 v420 = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2453 v421 = _v730->array_000234;
1709
8251e59fd7c1 ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents: 1682
diff changeset
2454 while ( !v421->uItemID || v421->GetItemEquipType() == 18 )
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2455 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2456 ++v420;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2457 ++v421;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2458 if ( v420 >= 4 )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2459 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2460 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2461 if ( v420 < 4 )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2462 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2463 memcpy(&v683, &_v730->array_000234[v420], sizeof(v683));
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2464 spell_level = v723;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2465 //v1 = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2466 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2467 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2468 // LABEL_799:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2469 if ( _v733 != 0 )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2470 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2471 v675 = _v733;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2472 if (v683.uItemID)
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2473 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2474 v422 = v683.GetDisplayName();
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2475 sprintf(pTmpBuf2.data(), "(%s), and %d gold", v422, v675);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2476
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2477 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2478 else
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2479 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2480 v664 = "%d gold";
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2481 sprintf(pTmpBuf2.data(), v664, v675);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2482 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2483 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2484 else
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2485 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2486 if (v683.uItemID)
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2487 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2488 const char *_v675 = v683.GetDisplayName();
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2489 v664 = "(%s)";
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2490 sprintf(pTmpBuf2.data(), v664, _v675);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2491 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2492 else
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2493 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2494 strcpy(pTmpBuf2.data(), "nothing");
2181
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
2495 ShowStatusBarString(pTmpBuf2.data(), 2);
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2496 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2497 }
2181
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
2498 ShowStatusBarString(pTmpBuf2.data(), 2);
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2499 pSpellSprite.stru_24.Reset();
1519
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
2500 pSpellSprite.spell_id = pCastSpell->uSpellID;
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2501 pSpellSprite.spell_level = spell_level;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2502 pSpellSprite.spell_skill = skill_level;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2503 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2504 pSpellSprite.vPosition.x = _v730->vPosition.x;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2505 pSpellSprite.vPosition.y = _v730->vPosition.y;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2506 pSpellSprite.vPosition.z = _v730->uActorHeight;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2507 pSpellSprite.uAttributes = 0;
2181
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
2508 pSpellSprite.uSectorID = pIndoor->GetSector(pSpellSprite.vPosition.x, pSpellSprite.vPosition.y, pSpellSprite.vPosition.z);
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2509 pSpellSprite.uSpriteFrameID = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2510 pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2511 pSpellSprite.spell_target_pid = a2;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2512 pSpellSprite.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2513 pSpellSprite.uFacing = LOWORD(v715.uYawAngle);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2514 LOBYTE(pSpellSprite.uAttributes) |= 0x80u;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2515 pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2516 pSpellSprite.Create(0, 0, 0, pCastSpell->uPlayerID + 1);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2517 LODWORD(v727) = 1;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2518 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2519 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2520 case SPELL_MIND_BERSERK:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2521 {
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2522 switch (skill_level)
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2523 {
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2524 case 1: amount = 300 * spell_level; break;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2525 case 2: amount = 300 * spell_level; break;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2526 case 3: amount = 600 * spell_level; break;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2527 case 4: amount = 3600; break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2528 default:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2529 assert(false);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2530 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2531 if ( !pPlayer->CanCastSpell(uRequiredMana) )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2532 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2533 v426 = PID_ID(a2);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2534 if (PID_TYPE(a2) != OBJECT_Actor)
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2535 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2536 LODWORD(v727) = 1;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2537 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2538 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2539 v730 = 836 * v426;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2540 if ( stru_50C198.GetMagicalResistance(&pActors[v426], 7u) )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2541 {
1947
33f3103b062b pActorBuffs[1] to pActorBuffs[ACTOR_BUFF_CHARM]
Grumpy7
parents: 1946
diff changeset
2542 pActors[v426].pActorBuffs[ACTOR_BUFF_CHARM].Reset();
1956
542c13cd72e2 pActorBuffs[12] to pActorBuffs[ACTOR_BUFF_ENSLAVED]
Grumpy7
parents: 1955
diff changeset
2543 pActors[v426].pActorBuffs[ACTOR_BUFF_ENSLAVED].Reset();
1953
23cb27a497a0 pActorBuffs[9] to pActorBuffs[ACTOR_BUFF_BERSERK]
Grumpy7
parents: 1951
diff changeset
2544 pActors[v426].pActorBuffs[ACTOR_BUFF_BERSERK].Apply(
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2545 pParty->uTimePlayed + (signed __int64)((double)(amount << 7) * 0.033333335),
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2546 skill_level, 0, 0, 0);
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2547 pActors[v426].pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Long;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2548 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2549 pSpellSprite.stru_24.Reset();
1519
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
2550 pSpellSprite.spell_id = pCastSpell->uSpellID;
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2551 pSpellSprite.spell_level = spell_level;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2552 pSpellSprite.spell_skill = skill_level;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2553 v60 = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2554 v61 = v426;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2555 pSpellSprite.uObjectDescID = v60;
2181
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
2556 pSpellSprite.vPosition.x = pActors[v61].vPosition.x;
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
2557 pSpellSprite.vPosition.y = pActors[v61].vPosition.y;
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
2558 pSpellSprite.vPosition.z = pActors[v61].vPosition.z + pActors[v61].uActorHeight;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2559 pSpellSprite.uAttributes = 0;
2181
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
2560 pSpellSprite.uSectorID = pIndoor->GetSector(pActors[v61].vPosition.x, pActors[v61].vPosition.y, pSpellSprite.vPosition.z);
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2561 pSpellSprite.uSpriteFrameID = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2562 pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2563 pSpellSprite.spell_target_pid = a2;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2564 pSpellSprite.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2565 pSpellSprite.uFacing = LOWORD(v715.uYawAngle);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2566 LOBYTE(pSpellSprite.uAttributes) |= 0x80u;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2567 pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2568 pSpellSprite.Create(0, 0, 0, pCastSpell->uPlayerID + 1);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2569 LODWORD(v727) = 1;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2570 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2571 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2572 case SPELL_MIND_ENSLAVE:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2573 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2574 if ( !pPlayer->CanCastSpell(uRequiredMana) )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2575 break;
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2576 amount = 600 * spell_level;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2577 if (PID_TYPE(a2) != OBJECT_Actor)
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2578 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2579 LODWORD(v727) = 1;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2580 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2581 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2582 v730 = 836 * PID_ID(a2);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2583 if ( MonsterStats::BelongsToSupertype(pActors[PID_ID(a2)].pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2584 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2585 if ( stru_50C198.GetMagicalResistance(&pActors[PID_ID(a2)], 7u) )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2586 {
1953
23cb27a497a0 pActorBuffs[9] to pActorBuffs[ACTOR_BUFF_BERSERK]
Grumpy7
parents: 1951
diff changeset
2587 pActors[PID_ID(a2)].pActorBuffs[ACTOR_BUFF_BERSERK].Reset();
1947
33f3103b062b pActorBuffs[1] to pActorBuffs[ACTOR_BUFF_CHARM]
Grumpy7
parents: 1946
diff changeset
2588 pActors[PID_ID(a2)].pActorBuffs[ACTOR_BUFF_CHARM].Reset();
1956
542c13cd72e2 pActorBuffs[12] to pActorBuffs[ACTOR_BUFF_ENSLAVED]
Grumpy7
parents: 1955
diff changeset
2589 pActors[PID_ID(a2)].pActorBuffs[ACTOR_BUFF_ENSLAVED].Apply(pParty->uTimePlayed + (signed __int64)((double)(amount << 7) * 0.033333335),
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2590 skill_level, 0, 0, 0);
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2591 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2592 pSpellSprite.stru_24.Reset();
1519
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
2593 pSpellSprite.spell_id = pCastSpell->uSpellID;
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2594 pSpellSprite.spell_level = spell_level;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2595 pSpellSprite.spell_skill = skill_level;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2596 v60 = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2597 v61 = PID_ID(a2);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2598 pSpellSprite.uObjectDescID = v60;
2181
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
2599 pSpellSprite.vPosition.x = pActors[v61].vPosition.x;
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
2600 pSpellSprite.vPosition.y = pActors[v61].vPosition.y;
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
2601 pSpellSprite.vPosition.z = pActors[v61].vPosition.z + pActors[v61].uActorHeight;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2602 pSpellSprite.uAttributes = 0;
2181
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
2603 pSpellSprite.uSectorID = pIndoor->GetSector(pActors[v61].vPosition.x, pActors[v61].vPosition.y, pSpellSprite.vPosition.z);
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2604 pSpellSprite.uSpriteFrameID = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2605 pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2606 pSpellSprite.spell_target_pid = a2;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2607 pSpellSprite.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2608 pSpellSprite.uFacing = LOWORD(v715.uYawAngle);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2609 LOBYTE(pSpellSprite.uAttributes) |= 0x80u;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2610 pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2611 pSpellSprite.Create(0, 0, 0, pCastSpell->uPlayerID + 1);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2612 LODWORD(v727) = 1;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2613 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2614 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2615 case SPELL_MIND_MASS_FEAR:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2616 {
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2617 if ( skill_level == 4 )
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2618 amount = 300 * spell_level;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2619 else
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2620 amount = 180 * spell_level;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2621 if ( !pPlayer->CanCastSpell(uRequiredMana) )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2622 break;
2182
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
2623 int _v726 = pRenderer->_466_GetActorsInViewport(4096);
2155
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
2624 pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xA0A0Au, 192);
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2625 ++pSpellSprite.uType;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2626 pSpellSprite.stru_24.Reset();
1519
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
2627 pSpellSprite.spell_id = pCastSpell->uSpellID;
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2628 pSpellSprite.spell_level = spell_level;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2629 pSpellSprite.spell_skill = skill_level;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2630 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2631 pSpellSprite.uAttributes = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2632 pSpellSprite.uSectorID = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2633 pSpellSprite.uSpriteFrameID = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2634 pSpellSprite.field_60_distance_related_prolly_lod = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2635 pSpellSprite.uFacing = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2636 pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2637 pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2638 for ( a2 = 0; a2 < (signed int)_v726; ++a2 )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2639 {
2182
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
2640 v433 = &pActors[_50BF30_actors_in_viewport_ids[a2]];
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2641 if ( MonsterStats::BelongsToSupertype(v433->pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2642 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2643 pSpellSprite.vPosition.x = v433->vPosition.x;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2644 pSpellSprite.vPosition.y = v433->vPosition.y;
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2080
diff changeset
2645 pSpellSprite.vPosition.z = v433->vPosition.z - (unsigned int)(signed __int64)((double)v433->uActorHeight * -0.8);
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2646
2182
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
2647 pSpellSprite.spell_target_pid = PID(OBJECT_Actor, _50BF30_actors_in_viewport_ids[a2]);
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2648 pSpellSprite.Create(0, 0, 0, 0);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2649 if ( stru_50C198.GetMagicalResistance(v433, 7u) )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2650 {
1950
8509a59af88f pActorBuffs[4] to pActorBuffs[ACTOR_BUFF_AFRAID]
Grumpy7
parents: 1947
diff changeset
2651 v433->pActorBuffs[ACTOR_BUFF_AFRAID].Apply(pParty->uTimePlayed + (signed __int64)((double)(amount << 7) * 0.033333335),
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2652 skill_level, 0, 0, 0);
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2653 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2654 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2655 LODWORD(v727) = 1;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2656 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2657 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2658 case SPELL_MIND_CURE_INSANITY:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2659 {
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2660 v435 = skill_level - 2;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2661 if ( skill_level == 4 )
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2662 amount = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2663 else
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2664 amount = 86400 * spell_level;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2665 if ( !pPlayer->CanCastSpell(uRequiredMana) )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2666 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2667
1519
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
2668 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, pCastSpell->uPlayerID_2);
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2669 v440 = pCastSpell->uPlayerID_2;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2670 if ( HIDWORD(pParty->pPlayers[v440].pConditions[5]) | LODWORD(pParty->pPlayers[v440].pConditions[5]) )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2671 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2672 if ( !(HIDWORD(pParty->pPlayers[v440].pConditions[1]) | LODWORD(pParty->pPlayers[v440].pConditions[1])) )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2673 pParty->pPlayers[v440].PlaySound(SPEECH_25, 0);
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2674 if ( skill_level == 4 )
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2675 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2676 v441 = pCastSpell->uPlayerID_2;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2677 LODWORD(pParty->pPlayers[v441].pConditions[5]) = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2678 HIDWORD(pParty->pPlayers[v441].pConditions[5]) = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2679 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2680 else
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2681 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2682 pParty->pPlayers[pCastSpell->uPlayerID_2].DiscardConditionIfLastsLongerThan(5u,
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2683 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335));
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2684 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2685 v377 = &pParty->pPlayers[pCastSpell->uPlayerID_2];
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2686 v377->SetCondition(1, 0);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2687 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2688 LODWORD(v727) = 1;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2689 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2690 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2691 case SPELL_EARTH_TELEKINESIS:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2692 {
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2693 switch (skill_level)
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2694 {
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2695 case 1: amount = 2 * spell_level; break;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2696 case 2: amount = 2 * spell_level; break;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2697 case 3: amount = 3 * spell_level; break;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2698 case 4: amount = 4 * spell_level; break;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2699 default:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2700 assert(false);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2701 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2702 if ( !pPlayer->CanCastSpell(uRequiredMana) )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2703 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2704 v445 = PID_ID(a2);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2705 if (PID_TYPE(a2) == OBJECT_Item)
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2706 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2707 v449 = (char *)&pSpriteObjects[v445].stru_24;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2708 v450 = *(int *)v449;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2709 if ( pItemsTable->pItems[v450].uEquipType == 18 )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2710 {
1828
35c1e4ff6ba7 party_finds_gold to Party::PartyFindsGold, cleaned up, moved Level/Decoration.h reference out of Indoor.h
Grumpy7
parents: 1793
diff changeset
2711 pParty->PartyFindsGold(*((int *)v449 + 3), 0);
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2712 viewparams->bRedrawGameUI = 1;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2713 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2714 else
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2715 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2716 sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[471], pItemsTable->pItems[v450].pUnidentifiedName);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2717 ShowStatusBarString(pTmpBuf2.data(), 2u);
1558
30db6d265ceb Changed the new Assert macro definition slightly, Party::AddItem (for some reason in players.cpp) renamed to Party::AddItemToParty, cleaned up; some unused variables in previous functions removed
Grumpy7
parents: 1519
diff changeset
2718 if ( !pParty->AddItemToParty(&pSpriteObjects[v445].stru_24) )
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2719 pParty->SetHoldingItem(&pSpriteObjects[v445].stru_24);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2720 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2721 SpriteObject::OnInteraction(v445);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2722 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2723 else
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2724 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2725 if (PID_TYPE(a2) == OBJECT_Actor)
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2726 {
1966
7840fe323f67 stru319::LootActor(struct Actor *pActor) to Actor::LootActor
Grumpy7
parents: 1956
diff changeset
2727 pActors[v445].LootActor();
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2728 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2729 else
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2730 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2731 if (PID_TYPE(a2) != OBJECT_Decoration)
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2732 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2733 if (PID_TYPE(a2) != OBJECT_BModel)
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2734 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2735 LODWORD(v727) = 1;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2736 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2737 }
1408
204cce84300b FindSound
Ritor1
parents: 1384
diff changeset
2738 OpenedTelekinesis = true;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2739 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor)
1408
204cce84300b FindSound
Ritor1
parents: 1384
diff changeset
2740 v448 = pIndoor->pFaceExtras[pIndoor->pFaces[v445].uFaceExtraID].uEventID;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2741 else
1408
204cce84300b FindSound
Ritor1
parents: 1384
diff changeset
2742 v448 = pOutdoor->pBModels[a2 >> 9].pFaces[v445 & 0x3F].sCogTriggeredID;
204cce84300b FindSound
Ritor1
parents: 1384
diff changeset
2743 EventProcessor(v448, a2, 1);
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2744 LODWORD(v727) = 1;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2745 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2746 }
1408
204cce84300b FindSound
Ritor1
parents: 1384
diff changeset
2747 OpenedTelekinesis = true;
1514
965af46e8793 Rename LevelDecoration::field_16_event_id to LevelDecoration::uEventID.
yoctozepto
parents: 1477
diff changeset
2748 if ( pLevelDecorations[v445].uEventID )
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2749 {
1408
204cce84300b FindSound
Ritor1
parents: 1384
diff changeset
2750 EventProcessor(v448, a2, 1);
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2751 LODWORD(v727) = 1;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2752 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2753 }
1408
204cce84300b FindSound
Ritor1
parents: 1384
diff changeset
2754 if ( pLevelDecorations[v445].IsInteractive() )
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2755 {
1408
204cce84300b FindSound
Ritor1
parents: 1384
diff changeset
2756 activeLevelDecoration = &pLevelDecorations[v445];
1736
c6fe09a06712 Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents: 1709
diff changeset
2757 EventProcessor(stru_5E4C90_MapPersistVars._decor_events[pLevelDecorations[v445]._idx_in_stru123 - 75] + 380, 0, 1);
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2758 activeLevelDecoration = NULL;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2759 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2760 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2761 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2762 LODWORD(v727) = 1;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2763 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2764 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2765 case SPELL_BODY_CURE_WEAKNESS:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2766 {
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2767 switch (skill_level)
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2768 {
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2769 case 1: amount = 180 * spell_level; break;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2770 case 2: amount = 3600 * spell_level; break;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2771 case 3: amount = 86400 * spell_level; break;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2772 case 4: amount = 0; break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2773 default:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2774 assert(false);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2775 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2776 if ( !pPlayer->CanCastSpell(uRequiredMana) )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2777 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2778
1519
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
2779 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, pCastSpell->uPlayerID_2);
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2780 v323 = pCastSpell->uPlayerID_2;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2781 v324 = (char *)&pParty->pPlayers[v323].pConditions[1];
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2782 if ( !pParty->pPlayers[v323].pConditions[1] )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2783 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2784 LODWORD(v727) = 1;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2785 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2786 }
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2787 if ( skill_level == 4 )
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2788 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2789 *(int *)v324 = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2790 *((int *)v324 + 1) = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2791 LODWORD(v727) = 1;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2792 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2793 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2794 v663 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2795 v656 = 1;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2796 v325 = &pParty->pPlayers[v323];
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2797 v325->DiscardConditionIfLastsLongerThan(v656, v663);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2798 LODWORD(v727) = 1;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2799 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2800 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2801 case SPELL_BODY_FIRST_AID:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2802 {
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2803 switch (skill_level)
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2804 {
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2805 case 1: amount = 2 * spell_level + 5; break;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2806 case 2: amount = 3 * spell_level + 5; break;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2807 case 3: amount = 4 * spell_level + 5; break;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2808 case 4: amount = 5 * spell_level + 5; break;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2809 default:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2810 assert(false);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2811 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2812 if ( !pPlayer->CanCastSpell(uRequiredMana) )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2813 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2814 v460 = pCastSpell->spell_target_pid;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2815 if (!v460)
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2816 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2817 pParty->pPlayers[pCastSpell->uPlayerID_2].Heal(amount);
1519
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
2818 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, pCastSpell->uPlayerID_2);
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2819 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2820 else
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2821 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2822 if (PID_TYPE(v460) == OBJECT_Actor)
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2823 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2824 v461 = &pActors[PID_ID(v460)];
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2825 v462 = v461->uAIState;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2826 v463 = v461->pMonsterInfo.uHP;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2827 if ( v462 != 5 )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2828 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2829 if ( v462 != 4 )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2830 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2831 if ( v462 != 19 )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2832 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2833 if ( v462 != 11 )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2834 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2835 v461->sCurrentHP += amount;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2836 if ( v461->sCurrentHP > v463 )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2837 v461->sCurrentHP = v463;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2838 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2839 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2840 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2841 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2842 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2843 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2844 LODWORD(v727) = 1;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2845 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2846 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2847 case SPELL_BODY_CURE_POISON:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2848 {
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2849 switch (skill_level)
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2850 {
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2851 case 1: amount = 3600 * spell_level; break;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2852 case 2: amount = 3600 * spell_level; break;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2853 case 3: amount = 86400 * spell_level; break;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2854 case 4: amount = 0; break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2855 default:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2856 assert(false);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2857 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2858 if ( !pPlayer->CanCastSpell(uRequiredMana) )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2859 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2860
1519
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
2861 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, pCastSpell->uPlayerID_2);
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2862 v470 = pCastSpell->uPlayerID_2;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2863 if ( !(HIDWORD(pParty->pPlayers[v470].pConditions[6]) | LODWORD(pParty->pPlayers[v470].pConditions[6]))
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2864 && !(HIDWORD(pParty->pPlayers[v470].pConditions[8]) | LODWORD(pParty->pPlayers[v470].pConditions[8]))
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2865 && !(HIDWORD(pParty->pPlayers[v470].pConditions[10]) | LODWORD(pParty->pPlayers[v470].pConditions[10])) )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2866 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2867 LODWORD(v727) = 1;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2868 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2869 }
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2870 if ( skill_level == 4 )
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2871 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2872 LODWORD(pParty->pPlayers[v470].pConditions[6]) = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2873 HIDWORD(pParty->pPlayers[v470].pConditions[6]) = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2874 v471 = pCastSpell->uPlayerID_2;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2875 LODWORD(pParty->pPlayers[v471].pConditions[8]) = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2876 HIDWORD(pParty->pPlayers[v471].pConditions[8]) = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2877 v472 = pCastSpell->uPlayerID_2;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2878 LODWORD(pParty->pPlayers[v472].pConditions[10]) = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2879 HIDWORD(pParty->pPlayers[v472].pConditions[10]) = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2880 LODWORD(v727) = 1;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2881 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2882 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2883 *(float *)&a2 = (double)(amount << 7) * 0.033333335;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2884 pParty->pPlayers[v470].DiscardConditionIfLastsLongerThan(
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2885 6u,
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2886 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2));
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2887 pParty->pPlayers[pCastSpell->uPlayerID_2].DiscardConditionIfLastsLongerThan(
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2888 8u,
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2889 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2));
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2890 v663 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2891 v656 = 10;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2892 v325 = &pParty->pPlayers[pCastSpell->uPlayerID_2];
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2893 v325->DiscardConditionIfLastsLongerThan(v656, v663);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2894 LODWORD(v727) = 1;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2895 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2896 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2897 case SPELL_BODY_PROTECTION_FROM_MAGIC:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2898 {
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2899 amount = spell_level;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2900 LODWORD(v733) = 3600 * spell_level;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2901 if ( !pPlayer->CanCastSpell(uRequiredMana) )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2902 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2903
1519
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
2904 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 0);
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
2905 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 1);
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
2906 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 2);
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
2907 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 3);
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2908
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2909 pParty->pPartyBuffs[PARTY_BUFF_PROTECTION_FROM_MAGIC].Apply(pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), skill_level, spell_level, 0, 0);
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2910 LODWORD(v727) = 1;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2911 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2912 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2913 case SPELL_BODY_HAMMERHANDS:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2914 {
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2915 LODWORD(v733) = 3600 * spell_level;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2916 amount = spell_level;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2917 if ( !pPlayer->CanCastSpell(uRequiredMana) )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2918 break;
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2919 if ( skill_level == 4 )
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2920 {
1519
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
2921 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 0);
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
2922 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 1);
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
2923 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 2);
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
2924 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 3);
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2925 v732 = (int)v733 << 7;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2926 v717 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335);
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2927 pParty->pPlayers[0].pPlayerBuffs[PLAYER_BUFF_HAMMERHANDS].Apply(pParty->uTimePlayed + v717, 4u, spell_level, spell_level, 0);
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2928 pParty->pPlayers[1].pPlayerBuffs[PLAYER_BUFF_HAMMERHANDS].Apply(pParty->uTimePlayed + v717, 4u, spell_level, spell_level, 0);
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2929 pParty->pPlayers[2].pPlayerBuffs[PLAYER_BUFF_HAMMERHANDS].Apply(pParty->uTimePlayed + v717, 4u, spell_level, spell_level, 0);
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2930
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2931 pParty->pPlayers[3].pPlayerBuffs[PLAYER_BUFF_HAMMERHANDS].Apply(pParty->uTimePlayed + v717, 4, spell_level, spell_level, 0);
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2932 LODWORD(v727) = 1;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2933 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2934 }
1519
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
2935 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, pCastSpell->uPlayerID_2);
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2936
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2937 pParty->pPlayers[pCastSpell->uPlayerID_2].pPlayerBuffs[PLAYER_BUFF_HAMMERHANDS].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), skill_level, spell_level, spell_level, 0);
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2938 LODWORD(v727) = 1;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2939 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2940 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2941 case SPELL_BODY_CURE_DISEASE:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2942 {
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2943 if ( skill_level == 4 )
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2944 amount = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2945 else
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2946 amount = 86400 * spell_level;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2947 if ( !pPlayer->CanCastSpell(uRequiredMana) )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2948 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2949
1519
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
2950 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, pCastSpell->uPlayerID_2);
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2951 v498 = pCastSpell->uPlayerID_2;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2952 if ( !(HIDWORD(pParty->pPlayers[v498].pConditions[7]) | LODWORD(pParty->pPlayers[v498].pConditions[7]))
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2953 && !(HIDWORD(pParty->pPlayers[v498].pConditions[9]) | LODWORD(pParty->pPlayers[v498].pConditions[9]))
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2954 && !(HIDWORD(pParty->pPlayers[v498].pConditions[11]) | LODWORD(pParty->pPlayers[v498].pConditions[11])) )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2955 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2956 LODWORD(v727) = 1;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2957 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2958 }
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2959 if ( skill_level == 4 )
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2960 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2961 LODWORD(pParty->pPlayers[v498].pConditions[7]) = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2962 HIDWORD(pParty->pPlayers[v498].pConditions[7]) = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2963 v499 = pCastSpell->uPlayerID_2;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2964 LODWORD(pParty->pPlayers[v499].pConditions[9]) = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2965 HIDWORD(pParty->pPlayers[v499].pConditions[9]) = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2966 v500 = pCastSpell->uPlayerID_2;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2967 LODWORD(pParty->pPlayers[v500].pConditions[11]) = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2968 HIDWORD(pParty->pPlayers[v500].pConditions[11]) = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2969 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2970 else
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2971 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2972 *(float *)&a2 = (double)(amount << 7) * 0.033333335;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2973 pParty->pPlayers[v498].DiscardConditionIfLastsLongerThan(
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2974 7u,
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2975 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2));
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2976 pParty->pPlayers[pCastSpell->uPlayerID_2].DiscardConditionIfLastsLongerThan(
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2977 9u,
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2978 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2));
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2979 v663 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2980 v656 = 11;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2981 v325 = &pParty->pPlayers[pCastSpell->uPlayerID_2];
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2982 v325->DiscardConditionIfLastsLongerThan(v656, v663);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2983 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2984 LODWORD(v727) = 1;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2985 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2986 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2987 case SPELL_BODY_POWER_CURE:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2988 {
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
2989 amount = 5 * spell_level + 10;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2990 if ( !pPlayer->CanCastSpell(uRequiredMana) )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2991 break;
1861
a86c60679949 changing most of party arrays to std::arrays, some minor cleanups in actor.cpp
Grumpy7
parents: 1829
diff changeset
2992 v501 = pParty->pPlayers.data();
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2993 int v1 = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2994 do
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2995 {
1519
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
2996 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, v1);
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2997 v501->Heal(amount);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2998 ++v501;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
2999 ++v1;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3000 }
1861
a86c60679949 changing most of party arrays to std::arrays, some minor cleanups in actor.cpp
Grumpy7
parents: 1829
diff changeset
3001 while ( (signed int)v501 < (signed int)pParty->pHirelings.data() );
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3002 LODWORD(v727) = 1;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3003 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3004 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3005 case SPELL_LIGHT_DISPEL_MAGIC:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3006 {
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
3007 sRecoveryTime -= spell_level;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3008 if ( !pPlayer->CanCastSpell(uRequiredMana) )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3009 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3010
2155
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
3011 pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xAFF0A, 192);
2182
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
3012 v505 = pRenderer->_466_GetActorsInViewport(4096);
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3013 ++pSpellSprite.uType;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3014 //signed int _v733 = v505;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3015 v688.x = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3016 v688.y = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3017 v688.z = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3018 pSpellSprite.stru_24.Reset();
1519
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
3019 pSpellSprite.spell_id = pCastSpell->uSpellID;
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
3020 pSpellSprite.spell_level = spell_level;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
3021 pSpellSprite.spell_skill = skill_level;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3022 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3023 pSpellSprite.uAttributes = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3024 pSpellSprite.uSectorID = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3025 pSpellSprite.uSpriteFrameID = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3026 pSpellSprite.field_60_distance_related_prolly_lod = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3027 pSpellSprite.uFacing = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3028 pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3029 pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3030 a2 = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3031 for ( a2 = 0; a2 < v505; ++a2 )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3032 {
2182
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
3033 v507 = _50BF30_actors_in_viewport_ids[a2];
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3034 pSpellSprite.vPosition.x = pActors[v507].vPosition.x;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3035 pSpellSprite.vPosition.y = pActors[v507].vPosition.y;
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2080
diff changeset
3036 pSpellSprite.vPosition.z = pActors[v507].vPosition.z - (unsigned int)(signed __int64)((double)pActors[v507].uActorHeight * -0.8);
2182
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
3037 pSpellSprite.spell_target_pid = PID(OBJECT_Actor, _50BF30_actors_in_viewport_ids[a2]);
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3038 v509 = pSpellSprite.Create(0, 0, 0, 0);
2182
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
3039 DamageMonsterFromParty(PID(OBJECT_Item, v509), _50BF30_actors_in_viewport_ids[a2], &v688);
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3040 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3041 for ( a2 = 0; a2 < v505; ++a2 )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3042 {
2182
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
3043 pActor = &pActors[_50BF30_actors_in_viewport_ids[a2]];
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3044 pSpellSprite.vPosition.x = pActor->vPosition.x;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3045 pSpellSprite.vPosition.y = pActor->vPosition.y;
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2080
diff changeset
3046 pSpellSprite.vPosition.z = pActor->vPosition.z - (unsigned int)(signed __int64)((double)pActor->uActorHeight * -0.8);
2182
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
3047 pSpellSprite.spell_target_pid = PID(OBJECT_Actor, _50BF30_actors_in_viewport_ids[a2]);
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3048 pSpellSprite.Create(0, 0, 0, 0);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3049 for (int i = 0; i < 22; ++i)
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3050 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3051 pActor->pActorBuffs[i].Reset();
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3052 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3053 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3054 LODWORD(v727) = 1;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3055 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3056 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3057 case SPELL_LIGHT_SUMMON_ELEMENTAL:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3058 {
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
3059 switch (skill_level)
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3060 {
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
3061 case 1: v733 = 300 * spell_level; amount = 1; break;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
3062 case 2: v733 = 300 * spell_level; amount = 1; break;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
3063 case 3: v733 = 900 * spell_level; amount = 3; break;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
3064 case 4: v733 = 900 * spell_level; amount = 5; break;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3065 default:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3066 assert(false);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3067 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3068 //v733 = __PAIR__(0, v516);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3069 signed int _v733 = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3070 if ( (signed int)uNumActors > 0 )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3071 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3072 v518 = pActors.data();//[0].uAIState;
1980
c1c74df0a33e changing most of auto types to their actual types
Grumpy7
parents: 1975
diff changeset
3073 size_t _v726 = uNumActors;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3074 do
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3075 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3076 v519 = v518->uAIState;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3077 if ( v518->uAIState != 5 && v519 != 11 && v519 != 19 && PID(OBJECT_Player, pCastSpell->uPlayerID) == v518->uSummonerID )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3078 ++_v733;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3079 ++v518;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3080 --_v726;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3081 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3082 while ( _v726 != 0 );
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3083 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3084 if ( _v733 >= amount )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3085 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3086 ShowStatusBarString(pGlobalTXT_LocalizationStrings[648], 2); // This character can't summon any more monsters!
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3087 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
1519
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
3088 pCastSpell->uSpellID = 0;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3089 continue;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3090 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3091 if ( !pPlayer->CanCastSpell(uRequiredMana) )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3092 break;
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
3093 sub_44FA4C_spawn_light_elemental(pCastSpell->uPlayerID, skill_level, v733);
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3094 LODWORD(v727) = 1;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3095 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3096 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3097 case SPELL_LIGHT_DAY_OF_THE_GODS:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3098 {
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
3099 switch (skill_level)
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3100 {
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
3101 case 1: LODWORD(v733) = 10800 * spell_level; amount = 3 * spell_level + 10; break;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
3102 case 2: LODWORD(v733) = 10800 * spell_level; amount = 3 * spell_level + 10; break;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
3103 case 3: LODWORD(v733) = 14400 * spell_level; amount = 4 * spell_level + 10; break;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
3104 case 4: LODWORD(v733) = 18000 * spell_level; amount = 5 * spell_level + 10; break;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3105 default:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3106 assert(false);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3107 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3108 if ( !pPlayer->CanCastSpell(uRequiredMana) )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3109 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3110
1519
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
3111 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 0);
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
3112 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 1);
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
3113 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 2);
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
3114 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 3);
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3115
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
3116 pParty->pPartyBuffs[PARTY_BUFF_DAY_OF_GODS].Apply(pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), skill_level, amount, 0, 0);
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3117 LODWORD(v727) = 1;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3118 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3119 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3120 case SPELL_LIGHT_PRISMATIC_LIGHT:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3121 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3122 //v67 = 2;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3123 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor)
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3124 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3125 ShowStatusBarString(pGlobalTXT_LocalizationStrings[497], 2); // Can't cast Prismatic Light outdoors!
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3126 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
1519
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
3127 pCastSpell->uSpellID = 0;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3128 continue;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3129 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3130 if ( !pPlayer->CanCastSpell(uRequiredMana) )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3131 break;
2182
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
3132 v531 = pRenderer->_466_GetActorsInViewport(4096);
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3133 ++pSpellSprite.uType;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3134 v694.x = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3135 v694.y = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3136 v694.z = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3137 pSpellSprite.stru_24.Reset();
1519
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
3138 pSpellSprite.spell_id = pCastSpell->uSpellID;
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
3139 pSpellSprite.spell_level = spell_level;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
3140 pSpellSprite.spell_skill = skill_level;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3141 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3142 pSpellSprite.uAttributes = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3143 pSpellSprite.uSectorID = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3144 pSpellSprite.uSpriteFrameID = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3145 pSpellSprite.field_60_distance_related_prolly_lod = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3146 pSpellSprite.uFacing = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3147 pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3148 pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3149 a2 = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3150 if ( (signed int)v531 > 0 )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3151 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3152 do
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3153 {
2182
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
3154 v533 = _50BF30_actors_in_viewport_ids[a2];
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3155 pSpellSprite.vPosition.x = pActors[v533].vPosition.x;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3156 pSpellSprite.vPosition.y = pActors[v533].vPosition.y;
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2080
diff changeset
3157 pSpellSprite.vPosition.z = pActors[v533].vPosition.z - (unsigned int)(signed __int64)((double)pActors[v533].uActorHeight * -0.8);
2182
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
3158 pSpellSprite.spell_target_pid = PID(OBJECT_Actor, _50BF30_actors_in_viewport_ids[a2]);
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3159 v535 = pSpellSprite.Create(0, 0, 0, 0);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3160 v536 = a2;
2182
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
3161 DamageMonsterFromParty(PID(OBJECT_Item, v535), _50BF30_actors_in_viewport_ids[a2], &v694);
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3162 a2 = v536 + 1;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3163 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3164 while ( v536 + 1 < (signed int)v531 );
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3165 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3166 v537 = pGame->GetStru6();
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3167 pGame->GetStru6()->_4A8BFC();
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3168 LODWORD(v727) = 1;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3169 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3170 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3171 case SPELL_LIGHT_DAY_OF_PROTECTION:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3172 {
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
3173 switch (skill_level)
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3174 {
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
3175 case 1: LODWORD(v733) = 14400 * spell_level; amount = 4 * spell_level; break;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
3176 case 2: LODWORD(v733) = 14400 * spell_level; amount = 4 * spell_level; break;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
3177 case 3: LODWORD(v733) = 14400 * spell_level; amount = 4 * spell_level; break;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
3178 case 4: LODWORD(v733) = 18000 * spell_level; amount = 5 * spell_level; break;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3179 default:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3180 assert(false);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3181 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3182 v730 = LODWORD(v733);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3183 if ( !pPlayer->CanCastSpell(uRequiredMana) )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3184 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3185
1519
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
3186 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 0);
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
3187 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 1);
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
3188 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 2);
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
3189 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 3);
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3190
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3191 v732 = v730 << 7;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3192 v549 = (double)(v730 << 7) * 0.033333335;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3193 *((float *)&v733 + 1) = v549;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3194 v712 = (signed __int64)v549;
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
3195 pParty->pPartyBuffs[PARTY_BUFF_RESIST_BODY].Apply(pParty->uTimePlayed + (signed __int64)v549, skill_level, amount, 0, 0);
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
3196 pParty->pPartyBuffs[PARTY_BUFF_RESIST_MIND].Apply(pParty->uTimePlayed + v712, skill_level, amount, 0, 0);
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
3197 pParty->pPartyBuffs[PARTY_BUFF_RESIST_FIRE].Apply(pParty->uTimePlayed + v712, skill_level, amount, 0, 0);
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
3198 pParty->pPartyBuffs[PARTY_BUFF_RESIST_WATER].Apply(pParty->uTimePlayed + v712, skill_level, amount, 0, 0);
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
3199 pParty->pPartyBuffs[PARTY_BUFF_RESIST_AIR].Apply(pParty->uTimePlayed + v712, skill_level, amount, 0, 0);
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
3200 pParty->pPartyBuffs[PARTY_BUFF_RESIST_EARTH].Apply(pParty->uTimePlayed + v712, skill_level, amount, 0, 0);
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
3201 v550 = spell_level + 5;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3202 pParty->pPartyBuffs[PARTY_BUFF_FEATHER_FALL].Apply(
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3203 (signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)),
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
3204 skill_level,
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3205 v550, 0, 0);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3206
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
3207 pParty->pPartyBuffs[PARTY_BUFF_WIZARD_EYE].Apply((signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), skill_level, v550, 0, 0);
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3208 LODWORD(v727) = 1;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3209 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3210 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3211 case SPELL_LIGHT_HOUR_OF_POWER:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3212 {
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
3213 switch (skill_level)
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3214 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3215 case 1: LODWORD(v733) = 4; amount = 4; break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3216 case 2: LODWORD(v733) = 4; amount = 4; break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3217 case 3: LODWORD(v733) = 12; amount = 12; break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3218 case 4: LODWORD(v733) = 20; amount = 15; break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3219 default:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3220 assert(false);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3221 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3222 if ( !pPlayer->CanCastSpell(uRequiredMana) )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3223 break;
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
3224 y = (char *)(60 * (spell_level * LODWORD(v733) + 60));
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
3225 v732 = (300 * amount * spell_level + 60) << 7;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
3226 v730 = spell_level + 5;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3227 int _v726 = 0;
1861
a86c60679949 changing most of party arrays to std::arrays, some minor cleanups in actor.cpp
Grumpy7
parents: 1829
diff changeset
3228 v553 = pParty->pPlayers.data();//[0].pConditions[1];
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3229 *((float *)&v733) = (double)v732 * 0.033333335;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3230 do
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3231 {
1519
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
3232 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 0);
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
3233 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 1);
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
3234 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 2);
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
3235 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 3);
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3236
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3237 //((SpellBuff *)(v553 + 6056))->Apply(
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
3238 v553->pPlayerBuffs[4].Apply((signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733)), skill_level, v730, 0, 0);
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3239 if ( *(_QWORD *)v553 )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3240 _v726 = 1;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3241 ++v553;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3242 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3243 while ( v553 <= &pParty->pPlayers[3] );
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
3244 v562 = skill_level;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
3245 pParty->pPartyBuffs[PARTY_BUFF_HEROISM].Apply((signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733)), skill_level, v730, 0, 0);
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3246 pParty->pPartyBuffs[PARTY_BUFF_SHIELD].Apply((signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733)), v562, 0, 0, 0);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3247 pParty->pPartyBuffs[PARTY_BUFF_STONE_SKIN].Apply((signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733)), v562, v730, 0, 0);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3248 if (!_v726)
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3249 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3250 pParty->pPartyBuffs[PARTY_BUFF_HASTE].Apply((signed __int64)((double)(signed int)((int)y << 7) * 0.033333335 + (double)(signed __int64)pParty->uTimePlayed), v562, v730, 0, 0);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3251 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3252 LODWORD(v727) = 1;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3253 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3254 }
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
3255 case SPELL_LIGHT_DIVINE_INTERVENTION://
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3256 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3257 amount = 3;
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
3258 if ( pPlayer->uNumDivineInterventionCastsThisDay >= 3 )
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3259 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3260 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3261 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
1519
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
3262 pCastSpell->uSpellID = 0;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3263 continue;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3264 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3265 if ( !pPlayer->CanCastSpell(uRequiredMana) )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3266 break;
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
3267 for ( uint pl_id = 0; pl_id < 4; pl_id++ )
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3268 {
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
3269 for ( v563 = 0; v563 <= 19; v563++)
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3270 {
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
3271 LODWORD(pPlayers[pl_id]->pConditions[v563]) = 0;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
3272 HIDWORD(pPlayers[pl_id]->pConditions[v563]) = 0;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3273 }
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
3274 pPlayers[pl_id]->sHealth = pPlayers[pl_id]->GetMaxHealth();
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
3275 pPlayers[pl_id]->sMana = pPlayers[pl_id]->GetMaxMana();
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
3276 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, pl_id);
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3277 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3278 if ( pPlayer->sAgeModifier + 10 >= 120 )
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
3279 pPlayer->sAgeModifier = 120;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3280 else
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
3281 pPlayer->sAgeModifier = pPlayer->sAgeModifier + 10;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
3282 sRecoveryTime += -5 * spell_level;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
3283 ++pPlayer->uNumDivineInterventionCastsThisDay;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3284 LODWORD(v727) = 1;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3285 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3286 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3287 case SPELL_DARK_REANIMATE:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3288 {
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
3289 switch (skill_level)
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3290 {
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
3291 case 1: amount = 2 * spell_level; break;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
3292 case 2: amount = 3 * spell_level; break;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
3293 case 3: amount = 4 * spell_level; break;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
3294 case 4: amount = 5 * spell_level; break;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3295 default:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3296 assert(false);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3297 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3298 if ( !pPlayer->CanCastSpell(uRequiredMana) )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3299 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3300 v576 = pCastSpell->spell_target_pid;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3301 if (!v576)
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3302 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3303 v585 = (char *)&pParty->pPlayers[pCastSpell->uPlayerID_2];
1519
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
3304 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, pCastSpell->uPlayerID_2);
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3305 if ( *((_QWORD *)v585 + 14) )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3306 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3307 ((Player *)v585)->SetCondition(0x11u, 1);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3308 v587 = ((Player *)v585)->GetSexByVoice();
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3309 ReloadPlayerPortraits(pCastSpell->uPlayerID_2, (v587 != 0) + 23);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3310 *((_QWORD *)v585 + 17) = pParty->uTimePlayed;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3311 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3312 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3313 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3314 v577 = (Player *)(PID_ID(v576));
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3315 //v726 = v577;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3316 if ( v577 == (Player *)-1 )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3317 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3318 ShowStatusBarString(pGlobalTXT_LocalizationStrings[496], 2); // No valid target exists!
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3319 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
1519
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
3320 pCastSpell->uSpellID = 0;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3321 continue;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3322 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3323 v578 = (int)&pActors[(int)v577];
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3324 v721 = v578;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3325 if ( *(short *)(v578 + 40) > 0 || (v579 = *(short *)(v578 + 176), v579 != 5) && v579 != 4 )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3326 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3327 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3328 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
1519
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
3329 pCastSpell->uSpellID = 0;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3330 continue;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3331 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3332 ++pSpellSprite.uType;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3333 pSpellSprite.stru_24.Reset();
1519
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
3334 pSpellSprite.spell_id = pCastSpell->uSpellID;
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
3335 pSpellSprite.spell_level = spell_level;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
3336 pSpellSprite.spell_skill = skill_level;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3337 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3338 pSpellSprite.uAttributes = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3339 pSpellSprite.uSectorID = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3340 pSpellSprite.uSpriteFrameID = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3341 pSpellSprite.field_60_distance_related_prolly_lod = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3342 v581 = v721;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3343 pSpellSprite.uFacing = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3344 pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3345 pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3346 pSpellSprite.vPosition.x = *(short *)(v721 + 142);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3347 pSpellSprite.vPosition.y = *(short *)(v721 + 144);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3348 v732 = *(short *)(v721 + 138);
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2080
diff changeset
3349 pSpellSprite.vPosition.z = *(short *)(v721 + 146) - (unsigned int)(signed __int64)((double)v732 * -0.8);
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3350 pSpellSprite.spell_target_pid = PID(OBJECT_Actor, (int)v577);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3351 pSpellSprite.Create(0, 0, 0, 0);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3352 if ( *(char *)(v581 + 52) > amount )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3353 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3354 Actor::Resurrect((unsigned int)v577);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3355 *(char *)(v581 + 61) = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3356 *(char *)(v581 + 53) = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3357 *(char *)(v581 + 54) = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3358 *(char *)(v581 + 55) = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3359 *(char *)(v581 + 56) = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3360 *(char *)(v581 + 57) = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3361 *(int *)(v581 + 712) = 9999;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3362 *(char *)(v581 + 38) &= 0xF7u;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3363 *(int *)(v581 + 708) = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3364 ((SpellBuff *)(v581 + 356))->Reset();
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3365 ((SpellBuff *)(v581 + 228))->Reset();
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3366 ((SpellBuff *)(v581 + 404))->Reset();
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3367 if ( *(short *)(v581 + 40) > 10 * amount )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3368 *(short *)(v581 + 40) = 10 * amount;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3369 LODWORD(v727) = 1;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3370 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3371 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3372 case SPELL_DARK_VAMPIRIC_WEAPON:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3373 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3374 amount = 16;
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
3375 if ( skill_level == 4 )
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3376 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3377 LODWORD(v733) = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3378 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3379 else
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3380 {
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
3381 LODWORD(v733) = 3600 * spell_level;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3382 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3383 if ( !pPlayer->CanCastSpell(uRequiredMana) )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3384 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3385 __debugbreak();
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3386 //HIDWORD(v733) = (int)(char *)&pParty + 6972 * pCastSpell->uPlayerID_2 + 36 * a2 + 3040;
1384
b51332ab228f changed a few member variables in Player to slightly less confusing names
Grumpy7
parents: 1362
diff changeset
3387 ItemGen *_v733 = &pParty->pPlayers[pCastSpell->uPlayerID_2].pInventoryItemList[a2];
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3388 ItemDesc *_v732 = &pItemsTable->pItems[_v733->uItemID];
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3389 _v733->UpdateTempBonus(pParty->uTimePlayed);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3390 if ( _v733->uItemID >= 64 && _v733->uItemID <= 65
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3391 || LOBYTE(_v733->uAttributes) & 2
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3392 || _v733->uSpecEnchantmentType != 0
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3393 || _v733->uEnchantmentType != 0
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3394 || (v591 = _v732->uEquipType) != 0 && v591 != 1 && v591 != 2
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3395 || pItemsTable->IsMaterialNonCommon(_v733) )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3396 {
1682
3c451fd02fcf OnInventoryLeftClick cleanup
Grumpy7
parents: 1643
diff changeset
3397 _50C9D0_AfterEnchClickEventId = 113;
3c451fd02fcf OnInventoryLeftClick cleanup
Grumpy7
parents: 1643
diff changeset
3398 _50C9D4_AfterEnchClickEventSecondParam = 0;
3c451fd02fcf OnInventoryLeftClick cleanup
Grumpy7
parents: 1643
diff changeset
3399 _50C9D8_AfterEnchClickEventTimeout = 1;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3400
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3401 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3402 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
1519
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
3403 pCastSpell->uSpellID = 0;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3404 continue;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3405 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3406 v592 = _v733;
2181
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
3407 //v14 = skill_level == 4;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3408 _v733->uSpecEnchantmentType = 16;
2181
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
3409 if ( skill_level != 4 )
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3410 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3411 v732 = (int)v733 << 7;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3412 v592->uExpireTime = pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3413 v592->uAttributes |= 8u;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3414 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3415 LOBYTE(v592->uAttributes) |= 0x80u;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3416 _50C9A8_item_enchantment_timer = 256;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3417 LODWORD(v727) = 1;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3418 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3419 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3420 case SPELL_DARK_SHARPMETAL:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3421 {
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
3422 switch (skill_level)
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3423 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3424 case 1: amount = 5; break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3425 case 2: amount = 5; break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3426 case 3: amount = 7; break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3427 case 4: amount = 9; break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3428 default:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3429 assert(false);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3430 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3431 if ( !pPlayer->CanCastSpell(uRequiredMana) )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3432 break;
1980
c1c74df0a33e changing most of auto types to their actual types
Grumpy7
parents: 1975
diff changeset
3433 signed int _v726 = ((signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360);
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3434 pSpellSprite.stru_24.Reset();
1519
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
3435 pSpellSprite.spell_id = pCastSpell->uSpellID;
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
3436 pSpellSprite.spell_level = spell_level;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
3437 pSpellSprite.spell_skill = skill_level;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3438 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3439 pSpellSprite.vPosition.x = pParty->vPosition.x;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3440 pSpellSprite.vPosition.y = pParty->vPosition.y;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3441 pSpellSprite.uAttributes = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3442 pSpellSprite.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 2;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3443 pSpellSprite.uSectorID = pIndoor->GetSector(
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3444 pParty->vPosition.x,
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3445 pParty->vPosition.y,
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3446 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 2);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3447 pSpellSprite.uSpriteFrameID = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3448 pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3449 pSpellSprite.spell_target_pid = a2;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3450 pSpellSprite.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3451 pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3452 if ( pParty->bTurnBasedModeOn == 1 )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3453 LOBYTE(pSpellSprite.uAttributes) |= 4u;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3454 v596 = (signed int)_v726 / -2;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3455 y = (char *)((signed int)_v726 / 2);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3456 if ( (signed int)_v726 / -2 <= (signed int)_v726 / 2 )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3457 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3458 v597 = v715.uYawAngle;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3459 do
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3460 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3461 pSpellSprite.uFacing = v596 + v597;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3462 if ( pSpellSprite.Create(
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3463 v596 + v597,
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3464 v715.uPitchAngle,
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3465 pObjectList->pObjects[(signed __int16)pSpellSprite.uObjectDescID].uSpeed,
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3466 pCastSpell->uPlayerID + 1) != -1
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3467 && pParty->bTurnBasedModeOn == 1 )
1450
8ff3c675a726 more renaming TE
Gloval
parents: 1449
diff changeset
3468 ++pTurnEngine->pending_actions;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3469 v596 += _v726 / (amount - 1);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3470 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3471 while ( v596 <= (signed int)y );
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3472 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3473 LODWORD(v727) = 1;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3474 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3475 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3476 case SPELL_DARK_CONTROL_UNDEAD:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3477 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3478 if ( !pPlayer->CanCastSpell(uRequiredMana) )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3479 break;
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
3480 switch (skill_level)
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3481 {
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
3482 case 1: LODWORD(v733) = 180 * spell_level; break;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
3483 case 2: LODWORD(v733) = 180 * spell_level; break;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
3484 case 3: LODWORD(v733) = 300 * spell_level; break;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3485 case 4: LODWORD(v733) = 29030400; break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3486 default:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3487 assert(false);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3488 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3489 if (PID_TYPE(a2) != OBJECT_Actor)
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3490 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3491 LODWORD(v727) = 1;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3492 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3493 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3494 pActor = &pActors[PID_ID(a2)];
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3495 if ( !MonsterStats::BelongsToSupertype(pActor->pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3496 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3497 if ( !stru_50C198.GetMagicalResistance(pActor, 0xAu) )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3498 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3499 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3500 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
1519
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
3501 pCastSpell->uSpellID = 0;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3502 continue;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3503 }
1953
23cb27a497a0 pActorBuffs[9] to pActorBuffs[ACTOR_BUFF_BERSERK]
Grumpy7
parents: 1951
diff changeset
3504 pActor->pActorBuffs[ACTOR_BUFF_BERSERK].Reset();
1947
33f3103b062b pActorBuffs[1] to pActorBuffs[ACTOR_BUFF_CHARM]
Grumpy7
parents: 1946
diff changeset
3505 pActor->pActorBuffs[ACTOR_BUFF_CHARM].Reset();
1956
542c13cd72e2 pActorBuffs[12] to pActorBuffs[ACTOR_BUFF_ENSLAVED]
Grumpy7
parents: 1955
diff changeset
3506 pActor->pActorBuffs[ACTOR_BUFF_ENSLAVED].Apply(pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335),
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
3507 skill_level, 0, 0, 0);
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3508 pSpellSprite.stru_24.Reset();
1519
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
3509 pSpellSprite.spell_id = pCastSpell->uSpellID;
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
3510 pSpellSprite.spell_level = spell_level;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
3511 pSpellSprite.spell_skill = skill_level;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3512 v60 = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3513
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3514 pSpellSprite.uObjectDescID = v60;
2181
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
3515 pSpellSprite.vPosition.x = pActor->vPosition.x;
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
3516 pSpellSprite.vPosition.y = pActor->vPosition.y;
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
3517 pSpellSprite.vPosition.z = pActor->vPosition.z + pActor->uActorHeight;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3518 pSpellSprite.uAttributes = 0;
2181
17b3e40daedc _427E01_cast_spell continue
Ritor1
parents: 2179
diff changeset
3519 pSpellSprite.uSectorID = pIndoor->GetSector(pActor->vPosition.x, pActor->vPosition.y, pSpellSprite.vPosition.z);
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3520 pSpellSprite.uSpriteFrameID = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3521 pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3522 pSpellSprite.spell_target_pid = a2;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3523 pSpellSprite.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3524 pSpellSprite.uFacing = LOWORD(v715.uYawAngle);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3525 LOBYTE(pSpellSprite.uAttributes) |= 0x80u;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3526 pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3527 pSpellSprite.Create(0, 0, 0, pCastSpell->uPlayerID + 1);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3528 LODWORD(v727) = 1;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3529 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3530 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3531 case SPELL_DARK_SACRIFICE:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3532 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3533 if ( !pPlayer->CanCastSpell(uRequiredMana) )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3534 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3535 int _v733 = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3536 memset(&achieved_awards, 0, 4000);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3537 int i = 0;
1861
a86c60679949 changing most of party arrays to std::arrays, some minor cleanups in actor.cpp
Grumpy7
parents: 1829
diff changeset
3538 pNPCData = pParty->pHirelings.data();
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3539 do
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3540 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3541 if ( pNPCData->pName != 0)
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3542 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3543 v606 = _v733++;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3544 achieved_awards[v606] = (AwardType)(i + 1);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3545 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3546 ++i;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3547 ++pNPCData;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3548 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3549 while ( pNPCData <= &pParty->pHirelings[1] );
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3550 i = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3551 if ( (signed int)pNPCStats->uNumNewNPCs > 0)
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3552 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3553 pNPCData = pNPCStats->pNewNPCData;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3554 //__debugbreak(); // data offset
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3555 AwardType *_v734 = &achieved_awards[_v733];
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3556 do
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3557 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3558 if ( pNPCData->uFlags & 0x80
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3559 && (!pParty->pHirelings[0].pName || strcmp(pNPCData->pName, pParty->pHirelings[0].pName))
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3560 && (!pParty->pHirelings[1].pName || strcmp(pNPCData->pName, pParty->pHirelings[1].pName)) )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3561 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3562 v607 = _v734;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3563 ++_v734;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3564 *v607 = (AwardType)(i + 3);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3565 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3566 ++i;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3567 ++pNPCData;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3568 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3569 while ( (signed int)i < (signed int)pNPCStats->uNumNewNPCs );
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3570 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3571 v608 = pCastSpell->uPlayerID_2;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3572 if ( v608 != 4 && v608 != 5
1793
4dee76d79c78 dword_5B65CC to npcIdToDismissAfterDialogue, Party::field_709 to Party::hirelingScrollPosition
Grumpy7
parents: 1736
diff changeset
3573 || (v609 = (signed int)*(&pFontCChar + v608 + pParty->hirelingScrollPosition), v609 <= 0)
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3574 || v609 >= 3 )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3575 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3576 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3577 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
1519
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
3578 pCastSpell->uSpellID = 0;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3579 continue;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3580 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3581 v610 = 76 * v609;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3582 //*((int *)&pParty->pPlayers[3].pInstalledBeacons[4].uBeaconTime + 19 * v609) = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3583 pParty->pHirelings[v609-1].evt_B = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3584 v611 = pIconsFrameTable->FindIcon("spell96");
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3585 //*(int *)((char *)&pParty->pPlayers[3].pInstalledBeacons[4].uBeaconTime + v610 + 4) = pIconsFrameTable->GetIconAnimLength(v611);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3586 pParty->pHirelings[v609-1].evt_C = pIconsFrameTable->GetIconAnimLength(v611);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3587 //*(int *)((char *)&pParty->pPlayers[3].pInstalledBeacons[3].field_18 + v610) = 1;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3588 pParty->pHirelings[v609-1].evt_A = 1;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3589
1861
a86c60679949 changing most of party arrays to std::arrays, some minor cleanups in actor.cpp
Grumpy7
parents: 1829
diff changeset
3590 v612 = pParty->pPlayers.data();
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3591 do
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3592 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3593 v612->sHealth = v612->GetMaxHealth();
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3594 v612->sMana = v612->GetMaxMana();
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3595 ++v612;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3596 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3597 while ( v612 <= &pParty->pPlayers[3] );
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3598 v613 = &pOutdoor->ddm;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3599 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor)
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3600 v613 = &pIndoor->dlv;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3601 v613->uReputation += 15;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3602 if ( v613->uReputation > 10000 )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3603 v613->uReputation = 10000;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3604 LODWORD(v727) = 1;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3605 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3606 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3607 case SPELL_DARK_PAIN_REFLECTION:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3608 {
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
3609 switch (skill_level)
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3610 {
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
3611 case 1: LODWORD(v733) = 300 * (spell_level + 12); break;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
3612 case 2: LODWORD(v733) = 300 * (spell_level + 12); break;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
3613 case 3: LODWORD(v733) = 300 * (spell_level + 12); break;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
3614 case 4: LODWORD(v733) = 900 * (spell_level + 4); break;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3615 default:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3616 assert(false);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3617 }
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
3618 amount = spell_level + 5;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3619 if ( !pPlayer->CanCastSpell(uRequiredMana) )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3620 break;
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
3621 if ( skill_level != 3 && skill_level != 4 )
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3622 {
1519
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
3623 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, pCastSpell->uPlayerID_2);
2182
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
3624 pParty->pPlayers[pCastSpell->uPlayerID_2].pPlayerBuffs[PLAYER_BUFF_PAIN_REFLECTION].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), skill_level, amount, 0, 0);
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3625 LODWORD(v727) = 1;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3626 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3627 }
2182
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
3628 for ( uint pl_id = 0; pl_id , 4; pl_id++ )
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3629 {
2182
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
3630 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, pl_id);
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
3631 pParty->pPlayers[pl_id].pPlayerBuffs[PLAYER_BUFF_PAIN_REFLECTION].Apply(pParty->uTimePlayed +
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
3632 (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), skill_level, amount, 0, 0);
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3633 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3634 LODWORD(v727) = 1;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3635 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3636 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3637 case SPELL_DARK_SOULDRINKER:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3638 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3639 if ( !pPlayer->CanCastSpell(uRequiredMana) )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3640 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3641 pGame->GetIndoorCamera();
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3642 v623 = (signed __int64)pGame->pIndoorCameraD3D->GetPickDepth();
2182
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
3643 signed int _v733 = pRenderer->_466_GetActorsInViewport(v623);
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3644 v707.x = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3645 v707.y = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3646 v707.z = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3647 pSpellSprite.stru_24.Reset();
1519
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
3648 pSpellSprite.spell_id = pCastSpell->uSpellID;
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
3649 pSpellSprite.spell_level = spell_level;
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
3650 pSpellSprite.spell_skill = skill_level;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3651 pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3652 pSpellSprite.uAttributes = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3653 pSpellSprite.uSectorID = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3654 pSpellSprite.uSpriteFrameID = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3655 pSpellSprite.field_60_distance_related_prolly_lod = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3656 pSpellSprite.uFacing = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3657 pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3658 pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3659 a2 = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3660 int _v726 = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3661 if ( _v733 > 0 )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3662 {
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
3663 _v726 = (_v733 * (7 * spell_level + 25));
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3664 do
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3665 {
2182
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
3666 v625 = _50BF30_actors_in_viewport_ids[a2];
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3667 pSpellSprite.vPosition.x = pActors[v625].vPosition.x;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3668 pSpellSprite.vPosition.y = pActors[v625].vPosition.y;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3669 //v732 = pActors[v625].uActorHeight;
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2080
diff changeset
3670 pSpellSprite.vPosition.z = pActors[v625].vPosition.z - (unsigned int)(signed __int64)((double)pActors[v625].uActorHeight * -0.8);
2182
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
3671 pSpellSprite.spell_target_pid = PID(OBJECT_Actor, _50BF30_actors_in_viewport_ids[a2]);
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3672 v627 = pSpellSprite.Create(0, 0, 0, 0);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3673 v628 = a2;
2182
e1e4a8a20b5f _46А6АС_GetActorsInViewport
Ritor1
parents: 2181
diff changeset
3674 DamageMonsterFromParty(PID(OBJECT_Item, v627), _50BF30_actors_in_viewport_ids[a2], &v707);
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3675 a2 = v628 + 1;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3676 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3677 while ( v628 + 1 < _v733 );
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3678 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3679 v730 = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3680 v629 = 1;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3681 do
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3682 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3683 v630 = pPlayers[v629];
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3684 if ( !v630->pConditions[2]
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3685 && !v630->pConditions[12]
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3686 && !v630->pConditions[13]
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3687 && !v630->pConditions[14]
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3688 && !v630->pConditions[15]
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3689 && !v630->pConditions[16] )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3690 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3691 v631 = v730++;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3692 v681[v631] = v629;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3693 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3694 ++v629;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3695 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3696 while ( v629 <= 4 );
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3697 v732 = (signed __int64)((double)(signed int)_v726 / (double)v730);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3698 _v733 = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3699 if ( v730 > 0 )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3700 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3701 do
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3702 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3703 //v632 = 4 * v681[HIDWORD(v733)] + 10965188;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3704 v726 = pPlayers[v681[_v733]];
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3705 //v633 = pPlayers[v681[HIDWORD(v733)]];
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3706 v726->sHealth += v732;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3707 //v726 = *(Player **)v632;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3708 //v634 = v726->GetMaxHealth();
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3709 if ( v726->sHealth > v726->GetMaxHealth())
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3710 v726->sHealth = v726->GetMaxHealth();
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3711 v635 = _v733;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3712
1519
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
3713 pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, WORD2(v733));
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3714 _v733 = v635 + 1;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3715 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3716 while ( v635 + 1 < v730 );
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3717 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3718 pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0, 0x40u);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3719 LODWORD(v727) = 1;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3720 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3721 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3722 case SPELL_DARK_ARMAGEDDON:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3723 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3724 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor)
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3725 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3726 ShowStatusBarString(pGlobalTXT_LocalizationStrings[499], 2); // Can't cast Armageddon indoors!
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3727 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
1519
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
3728 pCastSpell->uSpellID = 0;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3729 continue;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3730 }
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
3731 if ( skill_level == 4)
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3732 amount = 4;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3733 else
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3734 amount = 3;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3735 if ( pPlayer->uNumArmageddonCasts >= amount || pParty->armageddon_timer > 0 )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3736 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3737 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3738 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
1519
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
3739 pCastSpell->uSpellID = 0;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3740 continue;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3741 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3742 if ( !pPlayer->CanCastSpell(uRequiredMana) )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3743 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3744 pParty->armageddon_timer = 256;
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
3745 pParty->armageddonDamage = spell_level;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3746 ++pPlayer->uNumArmageddonCasts;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3747 if ( pParty->bTurnBasedModeOn == 1 )
1450
8ff3c675a726 more renaming TE
Gloval
parents: 1449
diff changeset
3748 ++pTurnEngine->pending_actions;
1980
c1c74df0a33e changing most of auto types to their actual types
Grumpy7
parents: 1975
diff changeset
3749 int _v726 = 50;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3750 do
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3751 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3752 v642 = rand() % 4096 - 2048;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3753 v643 = rand();
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3754 v721 = v642 + pParty->vPosition.x;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3755 y = (char *)(pParty->vPosition.y + v643 % 4096 - 2048);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3756 v732 = GetTerrainHeightsAroundParty2(v642 + pParty->vPosition.x, (int)y, &v710, 0);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3757 v644 = rand();
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3758 sub_42F7EB_DropItemAt(0xFE6u, v721, (int)y, v732 + 16, v644 % 500 + 500, 1, 0, 0, 0);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3759 --_v726;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3760 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3761 while ( _v726 != 0 );
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3762 LODWORD(v727) = 1;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3763 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3764 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3765
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3766 default:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3767 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3768 }
1519
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
3769 if ( pCastSpell->uFlags & 0x20 )
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3770 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3771 if ( v727 != 0.0 )
1519
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
3772 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[pCastSpell->uSpellID], 0, 0, -1, 0, pCastSpell->sound_id, 0, 0);
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3773 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3774 else
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3775 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3776 if ( sRecoveryTime < 0 )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3777 sRecoveryTime = 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3778 if ( pParty->bTurnBasedModeOn )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3779 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3780 v645 = sRecoveryTime;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3781 pParty->pTurnBasedPlayerRecoveryTimes[pCastSpell->uPlayerID] = sRecoveryTime;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3782 pPlayer->SetRecoveryTime(v645);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3783 if ( !some_active_character )
1448
5a5d0c713d47 some turn engine renaming
Gloval
parents: 1362
diff changeset
3784 pTurnEngine->ApplyPlayerAction();
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3785 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3786 else
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3787 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3788 pPlayer->SetRecoveryTime(
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3789 (signed __int64)(flt_6BE3A4_debug_recmod1 * (double)sRecoveryTime * 2.133333333333333));
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3790 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3791 if ( v727 != 0.0 )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3792 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3793 pPlayer->PlaySound(SPEECH_49, 0);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3794 if ( v727 != 0.0 )
1519
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
3795 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[pCastSpell->uSpellID], 0, 0, -1, 0, pCastSpell->sound_id, 0, 0);
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3796 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3797 }
1519
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
3798 pCastSpell->uSpellID = 0;
2179
f0b5ca2dfb73 _427E01_cast_spell continue
Ritor1
parents: 2155
diff changeset
3799 spell_level = v723;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3800 continue;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3801 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3802
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3803 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3804 //----- (00427DA0) --------------------------------------------------------
1519
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
3805 size_t PushCastSpellInfo(uint16_t uSpellID, uint16_t uPlayerID, __int16 skill_level, uint16_t uFlags, int spell_sound_id)
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3806 {
1517
c3da3c2985b8 Clean CastSpellInfo. (1)
yoctozepto
parents: 1514
diff changeset
3807 for (size_t i = 0; i < CastSpellInfoCount; i++)
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3808 {
1519
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
3809 if (!pCastSpellInfo[i].uSpellID)
1429
c7489dd19f88 BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents: 1420
diff changeset
3810 {
1519
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
3811 pCastSpellInfo[i].uSpellID = uSpellID;
1517
c3da3c2985b8 Clean CastSpellInfo. (1)
yoctozepto
parents: 1514
diff changeset
3812 pCastSpellInfo[i].uPlayerID = uPlayerID;
1519
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
3813 if (uFlags & 0x10)
1517
c3da3c2985b8 Clean CastSpellInfo. (1)
yoctozepto
parents: 1514
diff changeset
3814 pCastSpellInfo[i].uPlayerID_2 = uPlayerID;
c3da3c2985b8 Clean CastSpellInfo. (1)
yoctozepto
parents: 1514
diff changeset
3815 pCastSpellInfo[i].field_6 = 0;
c3da3c2985b8 Clean CastSpellInfo. (1)
yoctozepto
parents: 1514
diff changeset
3816 pCastSpellInfo[i].spell_target_pid = 0;
1519
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
3817 pCastSpellInfo[i].uFlags = uFlags;
1517
c3da3c2985b8 Clean CastSpellInfo. (1)
yoctozepto
parents: 1514
diff changeset
3818 pCastSpellInfo[i].forced_spell_skill_level = skill_level;
c3da3c2985b8 Clean CastSpellInfo. (1)
yoctozepto
parents: 1514
diff changeset
3819 pCastSpellInfo[i].sound_id = spell_sound_id;
1429
c7489dd19f88 BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents: 1420
diff changeset
3820 return i;
c7489dd19f88 BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents: 1420
diff changeset
3821 }
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3822 }
1429
c7489dd19f88 BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents: 1420
diff changeset
3823 return -1;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3824 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3825 //----- (00427D48) --------------------------------------------------------
1517
c3da3c2985b8 Clean CastSpellInfo. (1)
yoctozepto
parents: 1514
diff changeset
3826 void CastSpellInfoHelpers::_427D48()
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3827 {
1517
c3da3c2985b8 Clean CastSpellInfo. (1)
yoctozepto
parents: 1514
diff changeset
3828 for (size_t i = 0; i < CastSpellInfoCount; i++)
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3829 {
1519
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
3830 if (pCastSpellInfo[i].uSpellID && pCastSpellInfo[i].uFlags & 0x3CA)
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3831 {
1519
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
3832 pCastSpellInfo[i].uSpellID = 0;
1517
c3da3c2985b8 Clean CastSpellInfo. (1)
yoctozepto
parents: 1514
diff changeset
3833 pGUIWindow_Settings->Release();
c3da3c2985b8 Clean CastSpellInfo. (1)
yoctozepto
parents: 1514
diff changeset
3834 pGUIWindow_Settings = 0;
c3da3c2985b8 Clean CastSpellInfo. (1)
yoctozepto
parents: 1514
diff changeset
3835 pMouse->SetCursorBitmap("MICON1");
c3da3c2985b8 Clean CastSpellInfo. (1)
yoctozepto
parents: 1514
diff changeset
3836 GameUI_Footer_TimeLeft = 0;
1682
3c451fd02fcf OnInventoryLeftClick cleanup
Grumpy7
parents: 1643
diff changeset
3837 _50C9A0_IsEnchantingInProgress = 0;
1517
c3da3c2985b8 Clean CastSpellInfo. (1)
yoctozepto
parents: 1514
diff changeset
3838 back_to_game();
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3839 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3840 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3841 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3842 //----- (0042777D) --------------------------------------------------------
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3843 void _42777D_CastSpell_UseWand_ShootArrow(int a1, unsigned int uPlayerID, unsigned int a4, __int16 a5, int a6)
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3844 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3845 //bool result; // eax@2
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3846 //__int16 v6; // bx@4
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3847 //Player *v7; // eax@4
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3848 //char v8; // zf@12
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3849 unsigned __int16 v9; // cx@16
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3850 unsigned int v10; // eax@18
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3851 unsigned __int8 v11; // sf@18
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3852 unsigned __int8 v12; // of@18
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3853 unsigned __int16 v13; // cx@21
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3854 unsigned int v14; // eax@23
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3855 //stru277 *v15; // esi@27
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3856 //stru277 *v16; // eax@28
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3857 //GUIWindow *v17; // eax@43
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3858 //GUIWindow *v18; // [sp-30h] [bp-48h]@44
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3859 //unsigned int v19; // [sp-2Ch] [bp-44h]@44
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3860 //unsigned int v20; // [sp-28h] [bp-40h]@44
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3861 //unsigned int v21; // [sp-24h] [bp-3Ch]@44
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3862 //unsigned int v22; // [sp-20h] [bp-38h]@44
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3863 //int v23; // [sp-1Ch] [bp-34h]@44
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3864 //int v24; // [sp-18h] [bp-30h]@44
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3865 //unsigned int v25; // [sp-14h] [bp-2Ch]@43
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3866 //unsigned int v26; // [sp-10h] [bp-28h]@43
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3867 //unsigned __int8 v27; // [sp-Ch] [bp-24h]@43
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3868 //char *v28; // [sp-8h] [bp-20h]@43
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3869 //Texture *v29; // [sp-4h] [bp-1Ch]@43
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3870 //__int16 a3a; // [sp+10h] [bp-8h]@1
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3871 //__int16 a2a; // [sp+14h] [bp-4h]@1
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3872
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3873 //a3a = uPlayerID;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3874 //a2a = a1;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3875
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3876 //if ( pParty->bTurnBasedModeOn != 1
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3877 // || (result = pTurnEngine->field_4, pTurnEngine->field_4 != 1) && pTurnEngine->field_4 != 3 )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3878 if (pParty->bTurnBasedModeOn)
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3879 {
1340
22cb507446a4 turnengine refactoring continue
Gloval
parents: 1326
diff changeset
3880 if (pTurnEngine->turn_stage == 1 || pTurnEngine->turn_stage == 3)
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3881 return;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3882 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3883
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3884
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3885 //v6 = a5;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3886 //v7 = &pParty->pPlayers[uPlayerID];
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3887 assert(uPlayerID < 4);
1980
c1c74df0a33e changing most of auto types to their actual types
Grumpy7
parents: 1975
diff changeset
3888 Player* player = &pParty->pPlayers[uPlayerID];
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3889 if ( !(a5 & 0x10) )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3890 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3891 switch ( a1 )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3892 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3893 case SPELL_SPIRIT_FATE:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3894 case SPELL_BODY_FIRST_AID:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3895 case SPELL_DARK_REANIMATE:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3896 //HIBYTE(v6) = HIBYTE(a5) | 1;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3897 a5 |= 0x0100;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3898 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3899
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3900 case SPELL_FIRE_FIRE_AURA:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3901 case SPELL_WATER_RECHARGE_ITEM:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3902 case SPELL_WATER_ENCHANT_ITEM:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3903 case SPELL_DARK_VAMPIRIC_WEAPON:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3904 //LOBYTE(v6) = a5 | 0x80;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3905 a5 |= 0x0080;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3906 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3907
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3908 case SPELL_FIRE_FIRE_BOLT:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3909 case SPELL_FIRE_FIREBALL:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3910 case SPELL_FIRE_INCINERATE:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3911 case SPELL_AIR_LIGHNING_BOLT:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3912 case SPELL_AIR_IMPLOSION:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3913 case SPELL_WATER_POISON_SPRAY:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3914 case SPELL_WATER_ICE_BOLT:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3915 case SPELL_WATER_ACID_BURST:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3916 case SPELL_WATER_ICE_BLAST:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3917 case SPELL_EARTH_STUN:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3918 case SPELL_EARTH_SLOW:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3919 case SPELL_EARTH_DEADLY_SWARM:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3920 case SPELL_EARTH_BLADES:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3921 case SPELL_EARTH_MASS_DISTORTION:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3922 case SPELL_SPIRIT_SPIRIT_LASH:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3923 case SPELL_MIND_MIND_BLAST:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3924 case SPELL_MIND_CHARM:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3925 case SPELL_MIND_PSYCHIC_SHOCK:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3926 case SPELL_BODY_HARM:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3927 case SPELL_BODY_FLYING_FIST:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3928 case SPELL_LIGHT_LIGHT_BOLT:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3929 case SPELL_LIGHT_DESTROY_UNDEAD:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3930 case SPELL_LIGHT_SUNRAY:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3931 case SPELL_DARK_TOXIC_CLOUD:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3932 case SPELL_DARK_SHRINKING_RAY:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3933 case SPELL_DARK_SHARPMETAL:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3934 case SPELL_DARK_DRAGON_BREATH:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3935 if ( !a6 )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3936 a5 |= 0x0008;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3937 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3938 case SPELL_MIND_TELEPATHY:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3939 case SPELL_MIND_BERSERK:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3940 case SPELL_MIND_ENSLAVE:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3941 case SPELL_LIGHT_PARALYZE:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3942 case SPELL_DARK_CONTROL_UNDEAD:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3943 //LABEL_9:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3944 //v6 = a5 | 8;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3945 a5 |= 0x0008;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3946 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3947
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3948 case SPELL_EARTH_TELEKINESIS:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3949 a5 |= 0x0040;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3950 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3951
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3952 case SPELL_SPIRIT_BLESS:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3953 if (a4 && ~a4 & 0x01C0)
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3954 //goto LABEL_25;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3955 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3956 a5 |= 0x0002;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3957 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3958 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3959 else if ((player->pActiveSkills[PLAYER_SKILL_SPIRIT] & 0x1C0) == 0)
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3960 //goto LABEL_25;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3961 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3962 a5 |= 0x0002;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3963 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3964 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3965 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3966
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3967 case SPELL_SPIRIT_PRESERVATION:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3968 v9 = a4;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3969 if ( !a4 )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3970 v9 = player->pActiveSkills[PLAYER_SKILL_SPIRIT];
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3971 //goto LABEL_18;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3972 v10 = SkillToMastery(v9);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3973 v12 = __OFSUB__(v10, 3);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3974 v11 = ((v10 - 3) & 0x80000000u) != 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3975 //goto LABEL_24;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3976 if ( v11 ^ v12 )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3977 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3978 a5 |= 0x0002;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3979 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3980 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3981 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3982
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3983 case SPELL_DARK_PAIN_REFLECTION:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3984 v9 = a4;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3985 if ( !a4 )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3986 v9 = player->pActiveSkills[PLAYER_SKILL_DARK];
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3987 //LABEL_18:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3988 v10 = SkillToMastery(v9);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3989 v12 = __OFSUB__(v10, 3);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3990 v11 = ((v10 - 3) & 0x80000000u) != 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3991 //goto LABEL_24;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3992 if ( v11 ^ v12 )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3993 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3994 a5 |= 0x0002;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3995 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3996 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3997 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3998
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
3999 case SPELL_BODY_HAMMERHANDS:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4000 v13 = a4;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4001 if ( !a4 )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4002 v13 = player->pActiveSkills[PLAYER_SKILL_BODY];
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4003 v14 = SkillToMastery(v13);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4004 v12 = __OFSUB__(v14, 4);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4005 v11 = ((v14 - 4) & 0x80000000u) != 0;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4006 //LABEL_24:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4007 if ( v11 ^ v12 )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4008 //goto LABEL_25;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4009 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4010 a5 |= 0x0002;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4011 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4012 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4013 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4014
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4015 case SPELL_EARTH_STONE_TO_FLESH:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4016 case SPELL_SPIRIT_REMOVE_CURSE:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4017 case SPELL_SPIRIT_RAISE_DEAD:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4018 case SPELL_SPIRIT_RESSURECTION:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4019 case SPELL_MIND_REMOVE_FEAR:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4020 case SPELL_MIND_CURE_PARALYSIS:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4021 case SPELL_MIND_CURE_INSANITY:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4022 case SPELL_BODY_CURE_WEAKNESS:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4023 case SPELL_BODY_REGENERATION:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4024 case SPELL_BODY_CURE_POISON:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4025 case SPELL_BODY_CURE_DISEASE:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4026 //LABEL_25:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4027 //v6 = a5 | 2;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4028 a5 |= 0x0002;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4029 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4030
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4031 case SPELL_DARK_SACRIFICE:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4032 //HIBYTE(v6) = HIBYTE(a5) | 2;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4033 a5 |= 0x0200;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4034 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4035 default:
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4036 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4037 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4038 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4039
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4040
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4041 if (a5 & 0x3CA)
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4042 {
1517
c3da3c2985b8 Clean CastSpellInfo. (1)
yoctozepto
parents: 1514
diff changeset
4043 for (uint i = 0; i < CastSpellInfoCount; ++i)
1519
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
4044 if (pCastSpellInfo[i].uFlags & 0x3CA)
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4045 {
1519
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
4046 pCastSpellInfo[i].uSpellID = 0;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4047 break;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4048 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4049 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4050
1517
c3da3c2985b8 Clean CastSpellInfo. (1)
yoctozepto
parents: 1514
diff changeset
4051 for (uint i = 0; i < CastSpellInfoCount; ++i)
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4052 {
1980
c1c74df0a33e changing most of auto types to their actual types
Grumpy7
parents: 1975
diff changeset
4053 CastSpellInfo* spell = &pCastSpellInfo[i];
1519
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
4054 if (!spell->uSpellID)
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4055 continue;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4056
1519
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
4057 spell->uSpellID = 0;
4c787c28ddce Clean CastSpellInfo. (2)
yoctozepto
parents: 1517
diff changeset
4058 if (spell->uFlags & 0x3CA)
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4059 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4060 pGUIWindow_Settings->Release();
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4061 pGUIWindow_Settings = nullptr;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4062 pMouse->SetCursorBitmap("MICON1");
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4063 GameUI_Footer_TimeLeft = 0;
1682
3c451fd02fcf OnInventoryLeftClick cleanup
Grumpy7
parents: 1643
diff changeset
4064 _50C9A0_IsEnchantingInProgress = 0;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4065 back_to_game();
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4066 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4067 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4068
1517
c3da3c2985b8 Clean CastSpellInfo. (1)
yoctozepto
parents: 1514
diff changeset
4069 int result = PushCastSpellInfo(a1, uPlayerID, a4, a5, a6);
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4070 if ( result != -1 )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4071 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4072 if ( a5 & 2 )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4073 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4074 if ( pGUIWindow_Settings )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4075 return;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4076 pGUIWindow_Settings = GUIWindow::Create(0, 0, 640, 480, WINDOW_CastSpell, (int)&pCastSpellInfo[result], 0);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4077 pGUIWindow_Settings->CreateButton(52, 422, 35, 0, 2, 0, UIMSG_CastSpell_Character_Big_Improvement, 0, 49, "", 0);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4078 pGUIWindow_Settings->CreateButton(165, 422, 35, 0, 2, 0, UIMSG_CastSpell_Character_Big_Improvement, 1, 50, "", 0);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4079 pGUIWindow_Settings->CreateButton(280, 422, 35, 0, 2, 0, UIMSG_CastSpell_Character_Big_Improvement, 2, 51, "", 0);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4080 pGUIWindow_Settings->CreateButton(390, 422, 35, 0, 2, 0, UIMSG_CastSpell_Character_Big_Improvement, 3, 52, "", 0);
1829
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
4081 pParty->sub_421B2C_PlaceInInventory_or_DropPickedItem();
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4082 return;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4083 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4084 if ( a5 & 8 )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4085 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4086 if ( pGUIWindow_Settings )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4087 return;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4088
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4089 pGUIWindow_Settings = GUIWindow::Create(0, 0, 640, 480, WINDOW_CastSpell, (int)&pCastSpellInfo[result], 0);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4090 pGUIWindow_Settings->CreateButton(game_viewport_x, game_viewport_y, game_viewport_width, game_viewport_height, 1, 0, UIMSG_CastSpell_Shoot_Monster, 0, 0, "", 0);
1829
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
4091 pParty->sub_421B2C_PlaceInInventory_or_DropPickedItem();
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4092 return;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4093 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4094 if ( a5 & 0x40 )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4095 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4096 if ( pGUIWindow_Settings )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4097 return;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4098
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4099 pGUIWindow_Settings = GUIWindow::Create(0, 0, 640, 480, WINDOW_CastSpell, (int)&pCastSpellInfo[result], 0);
1326
e70fe5d77928 UIMSG_CastSpell_Telekinesis
Ritor1
parents: 1296
diff changeset
4100 pGUIWindow_Settings->CreateButton(game_viewport_x, game_viewport_y, game_viewport_width, game_viewport_height, 1, 0, UIMSG_CastSpell_Telekinesis, 0, 0, "", 0);
1829
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
4101 pParty->sub_421B2C_PlaceInInventory_or_DropPickedItem();
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4102 return;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4103 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4104 if ( (char)a5 < 0 )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4105 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4106 if ( pGUIWindow_Settings )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4107 return;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4108 ++pIcons_LOD->uTexturePacksCount;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4109 if ( !pIcons_LOD->uNumPrevLoadedFiles )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4110 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles;
1455
bfe342ae0c1f DrawPaperdoll cleaning
Ritor1
parents: 1450
diff changeset
4111 pGUIWindow_Settings = pCastSpellInfo[result].GetCastSpellInInventoryWindow();
1682
3c451fd02fcf OnInventoryLeftClick cleanup
Grumpy7
parents: 1643
diff changeset
4112 _50C9A0_IsEnchantingInProgress = 1;
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4113 some_active_character = uActiveCharacter;
1829
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
4114 pParty->sub_421B2C_PlaceInInventory_or_DropPickedItem();
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4115 return;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4116 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4117 if ( HIBYTE(a5) & 1 )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4118 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4119 if ( pGUIWindow_Settings )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4120 return;
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4121 pGUIWindow_Settings = GUIWindow::Create(0, 0, 640, 480, WINDOW_CastSpell, (int)&pCastSpellInfo[result], 0);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4122 pGUIWindow_Settings->CreateButton(0x34u, 0x1A6u, 0x23u, 0, 2, 0, UIMSG_CastSpell_Character_Small_Improvement, 0, 0x31u, "", 0);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4123 pGUIWindow_Settings->CreateButton(0xA5u, 0x1A6u, 0x23u, 0, 2, 0, UIMSG_CastSpell_Character_Small_Improvement, 1, 0x32u, "", 0);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4124 pGUIWindow_Settings->CreateButton(0x118u, 0x1A6u, 0x23u, 0, 2, 0, UIMSG_CastSpell_Character_Small_Improvement, 2, 0x33u, "", 0);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4125 pGUIWindow_Settings->CreateButton(0x186u, 0x1A6u, 0x23u, 0, 2, 0, UIMSG_CastSpell_Character_Small_Improvement, 3, 0x34u, "", 0);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4126 pGUIWindow_Settings->CreateButton(8, 8, game_viewport_width, game_viewport_height, 1, 0, UIMSG_CastSpell_Monster_Improvement, 0, 0, "", NULL);
1829
e4e27261d84e sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1828
diff changeset
4127 pParty->sub_421B2C_PlaceInInventory_or_DropPickedItem();
1296
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4128 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4129 if ( HIBYTE(a5) & 2 && !pGUIWindow_Settings )
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4130 {
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4131 pGUIWindow_Settings = GUIWindow::Create(0, 0, 640, 480, WINDOW_CastSpell, (int)&pCastSpellInfo[result], 0);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4132 pBtn_NPCLeft = pGUIWindow_Settings->CreateButton(469, 178,
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4133 pIcons_LOD->GetTexture(uTextureID_Btn_NPCLeft)->uTextureWidth,
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4134 pIcons_LOD->GetTexture(uTextureID_Btn_NPCLeft)->uTextureHeight,
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4135 1, 0, UIMSG_ScrollNPCPanel, 0, 0, "",
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4136 pIcons_LOD->GetTexture(uTextureID_Btn_NPCLeft), 0);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4137 pBtn_NPCRight = pGUIWindow_Settings->CreateButton(626, 178,
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4138 pIcons_LOD->GetTexture(uTextureID_Btn_NPCRight)->uTextureWidth,
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4139 pIcons_LOD->GetTexture(uTextureID_Btn_NPCRight)->uTextureHeight,
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4140 1, 0, UIMSG_ScrollNPCPanel, 1, 0, "",
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4141 pIcons_LOD->GetTexture(uTextureID_Btn_NPCRight), 0);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4142 pGUIWindow_Settings->CreateButton(491, 149, 64, 74, 1, 0, UIMSG_HiredNPC_CastSpell, 4, 0x35u, "", 0);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4143 pGUIWindow_Settings->CreateButton(561, 149, 64, 74, 1, 0, UIMSG_HiredNPC_CastSpell, 5, 0x36u, "", 0);
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4144 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4145 }
c423f946dc99 moving files continue
Ritor1
parents:
diff changeset
4146 }