annotate CastSpellInfo.cpp @ 1955:0c5326e2044a

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