0
|
1 #include "Party.h"
|
|
2 #include "MapInfo.h"
|
|
3 #include "Time.h"
|
|
4 #include "AudioPlayer.h"
|
|
5 #include "IconFrameTable.h"
|
|
6 #include "Mouse.h"
|
|
7 #include "PlayerFrameTable.h"
|
|
8 #include "TurnEngine.h"
|
|
9 #include "stru279.h"
|
|
10 #include "Viewport.h"
|
|
11 #include "Actor.h"
|
|
12 #include "GUIWindow.h"
|
|
13
|
|
14 #include "mm7_data.h"
|
|
15
|
|
16
|
|
17
|
|
18
|
|
19
|
|
20
|
|
21
|
|
22 Party *pParty; // idb
|
|
23
|
|
24 struct ActionQueue *pPartyActionQueue = new ActionQueue;
|
|
25
|
|
26
|
|
27
|
|
28
|
|
29 //----- (004760C1) --------------------------------------------------------
|
|
30 void ActionQueue::Add(PartyAction action)
|
|
31 {
|
|
32 if (uNumActions < 30)
|
|
33 pActions[uNumActions++] = action;
|
|
34 }
|
|
35
|
|
36 //----- (00497FC5) --------------------------------------------------------
|
|
37 bool Party::_497FC5_check_party_perception_against_level()
|
|
38 {
|
|
39 int uMaxPerception; // edi@1
|
|
40 Player *v2; // esi@1
|
|
41 signed int v3; // ebx@1
|
|
42 Player *v4; // ecx@2
|
|
43 signed int v5; // eax@3
|
|
44 bool result; // eax@7
|
|
45
|
|
46 uMaxPerception = 0;
|
|
47 v2 = this->pPlayers;
|
|
48 v3 = 4;
|
|
49 do
|
|
50 {
|
|
51 if ( v2->CanAct() )
|
|
52 {
|
|
53 v5 = v2->GetPerception();
|
|
54 if ( v5 > uMaxPerception )
|
|
55 uMaxPerception = v5;
|
|
56 }
|
|
57 ++v2;
|
|
58 --v3;
|
|
59 }
|
|
60 while ( v3 );
|
|
61 if ( uLevelMapStatsID && (signed int)uLevelMapStatsID < 77 )
|
|
62 result = uMaxPerception >= 2 * pMapStats->pInfos[uLevelMapStatsID]._per;
|
|
63 else
|
|
64 result = 0;
|
|
65 return result;
|
|
66 }
|
|
67
|
|
68 //----- (004936E1) --------------------------------------------------------
|
|
69 void Party::SetHoldingItem(ItemGen *pItem)
|
|
70 {
|
|
71 Party *v2; // esi@1
|
|
72
|
|
73 v2 = this;
|
|
74 sub_421B2C_PlaceInInventory_or_DropPickedItem();
|
|
75 memcpy(&v2->pPickedItem, pItem, sizeof(v2->pPickedItem));
|
|
76 pMouse->SetCursorBitmapFromItemID(v2->pPickedItem.uItemID);
|
|
77 }
|
|
78
|
|
79 //----- (0049370F) --------------------------------------------------------
|
|
80 int Party::GetNextActiveCharacter()
|
|
81 {
|
|
82 Party *v1; // esi@1
|
|
83 int v2; // eax@4
|
|
84 signed int v4; // ecx@6
|
89
|
85 Player *v5; // edx@6
|
0
|
86 Player *v6; // eax@7
|
89
|
87 Player *v7; // ecx@23
|
0
|
88 signed int v8; // esi@23
|
|
89 signed int v9; // edx@23
|
|
90 Player **v10; // edi@23
|
|
91 Player *v11; // eax@24
|
|
92 int v12; // [sp+Ch] [bp-4h]@1
|
|
93
|
|
94 v1 = this;
|
|
95 v12 = 0;
|
|
96 if ( pParty->bTurnBasedModeOn == 1 )
|
|
97 {
|
|
98 if ( pTurnEngine->field_4 != 2 || (pTurnEngine->pQueue[0].uPackedID & 7) != 4 )
|
|
99 return 0;
|
|
100 v2 = pTurnEngine->pQueue[0].uPackedID >> 3;
|
|
101 return v2 + 1;
|
|
102 }
|
|
103 v4 = 0;
|
89
|
104 v5 = v1->pPlayers;//[0].uTimeToRecovery;
|
0
|
105 while ( 1 )
|
|
106 {
|
|
107 v6 = ::pPlayers[v4 + 1];
|
|
108 if ( v6->pConditions[2]
|
|
109 || v6->pConditions[12]
|
|
110 || v6->pConditions[13]
|
|
111 || v6->pConditions[14]
|
|
112 || v6->pConditions[15]
|
|
113 || v6->pConditions[16]
|
89
|
114 || v5->uTimeToRecovery )
|
0
|
115 {
|
|
116 byte_AE3368[v4] = 1;
|
|
117 }
|
89
|
118 else if ( !byte_AE3368[v4] )
|
0
|
119 break;
|
|
120 ++v4;
|
89
|
121 ++v5;
|
0
|
122 if ( v4 >= 4 )
|
89
|
123 break;
|
0
|
124 }
|
89
|
125 if(v4<4)
|
|
126 {
|
|
127 v12 = v4;
|
|
128 byte_AE3368[v4] = 1;
|
|
129 }
|
0
|
130 if ( (unsigned __int8)(byte_AE3369 & byte_AE336A & byte_AE336B) & byte_AE3368[0] )
|
|
131 memset(byte_AE3368, 0, 4u);
|
|
132 v2 = v12;
|
|
133 if ( v12 )
|
|
134 return v2 + 1;
|
89
|
135 v7 = v1->pPlayers;//[0].uSpeedBonus;
|
0
|
136 v8 = 0;
|
|
137 v9 = 1;
|
|
138 v10 = &::pPlayers[1];
|
|
139 while ( 2 )
|
|
140 {
|
|
141 v11 = *v10;
|
|
142 if ( !(*v10)->pConditions[2]
|
|
143 && !v11->pConditions[12]
|
|
144 && !v11->pConditions[13]
|
|
145 && !v11->pConditions[14]
|
|
146 && !v11->pConditions[15]
|
|
147 && !v11->pConditions[16]
|
89
|
148 && !v7->uTimeToRecovery )
|
0
|
149 {
|
|
150 if ( v12 )
|
|
151 {
|
89
|
152 if ( v7->uSpeedBonus > v8 )
|
0
|
153 {
|
89
|
154 v8 = v7->uSpeedBonus;
|
|
155 v12 = v9;
|
0
|
156 }
|
|
157 }
|
|
158 else
|
|
159 {
|
|
160 v8 = *(short *)v7;
|
|
161 v12 = v9;
|
|
162 }
|
|
163 }
|
|
164 ++v10;
|
|
165 ++v9;
|
89
|
166 ++v7;
|
0
|
167 if ( v9 - 1 < 4 )
|
|
168 continue;
|
|
169 return v12;
|
|
170 }
|
|
171 }
|
|
172
|
|
173
|
|
174 //----- (00493244) --------------------------------------------------------
|
|
175 bool Party::HasItem(unsigned int uItemID)
|
|
176 {
|
89
|
177 Player *v2; // edx@1
|
0
|
178 signed int v3; // ecx@2
|
|
179 ItemGen *v4; // eax@2
|
|
180
|
89
|
181 v2 = pParty->pPlayers;//[0].pInventoryItems;
|
|
182 while ( v2 <= &pParty->pPlayers[3] )
|
0
|
183 {
|
|
184 v3 = 0;
|
89
|
185 v4 = v2->pInventoryItems;
|
0
|
186 do
|
|
187 {
|
|
188 if ( v4->uItemID == uItemID )
|
|
189 return 1;
|
|
190 ++v3;
|
|
191 ++v4;
|
|
192 }
|
|
193 while ( v3 < 138 );
|
89
|
194 ++v2;
|
0
|
195 }
|
|
196 return 0;
|
|
197 }
|
|
198
|
|
199
|
|
200 //----- (00492AD5) --------------------------------------------------------
|
|
201 __int16 Party::SetFood(unsigned int uNumFood)
|
|
202 {
|
|
203 __int16 result; // ax@1
|
|
204
|
|
205 pUIAnim_Food->uAnimTime = 0;
|
|
206 pParty->uNumFoodRations = uNumFood;
|
|
207 result = 8 * pIconsFrameTable->pIcons[(signed __int16)pUIAnim_Food->uIconID].uAnimLength;
|
|
208 pUIAnim_Food->uAnimLength = 8 * pIconsFrameTable->pIcons[(signed __int16)pUIAnim_Food->uIconID].uAnimLength;
|
|
209 return result;
|
|
210 }
|
|
211
|
|
212 //----- (00492B03) --------------------------------------------------------
|
|
213 void Party::TakeFood(unsigned int uNumFood)
|
|
214 {
|
|
215 if ( ((pParty->uNumFoodRations - uNumFood) & 0x80000000u) == 0 )
|
|
216 pParty->uNumFoodRations -= uNumFood;
|
|
217 else
|
|
218 pParty->uNumFoodRations = 0;
|
|
219 pUIAnim_Food->uAnimTime = 0;
|
|
220 pUIAnim_Food->uAnimLength = 8 * pIconsFrameTable->pIcons[(signed __int16)pUIAnim_Food->uIconID].uAnimLength;
|
|
221 }
|
|
222
|
|
223 //----- (00492B42) --------------------------------------------------------
|
|
224 __int16 Party::GiveFood(unsigned int _this)
|
|
225 {
|
|
226 __int16 result; // ax@1
|
|
227
|
|
228 pParty->uNumFoodRations += _this;
|
|
229 pUIAnim_Food->uAnimTime = 0;
|
|
230 result = 8 * pIconsFrameTable->pIcons[(signed __int16)pUIAnim_Food->uIconID].uAnimLength;
|
|
231 pUIAnim_Food->uAnimLength = 8 * pIconsFrameTable->pIcons[(signed __int16)pUIAnim_Food->uIconID].uAnimLength;
|
|
232 return result;
|
|
233 }
|
|
234
|
|
235 //----- (00492B70) --------------------------------------------------------
|
|
236 void Party::SetGold(unsigned int uNumGold)
|
|
237 {
|
|
238 pParty->uNumGold = uNumGold;
|
|
239 pUIAnim_Gold->uAnimTime = 0;
|
|
240 pUIAnim_Gold->uAnimLength = 8 * pIconsFrameTable->pIcons[(signed __int16)pUIAnim_Gold->uIconID].uAnimLength;
|
|
241 pAudioPlayer->PlaySound(SOUND_GoldReceived, 0, 0, -1, 0, 0, 0, 0);
|
|
242 }
|
|
243
|
|
244 //----- (00492BB6) --------------------------------------------------------
|
|
245 void Party::TakeGold(unsigned int uNumGold)
|
|
246 {
|
|
247 if ( uNumGold <= pParty->uNumGold )
|
|
248 pParty->uNumGold -= uNumGold;
|
|
249 else
|
|
250 pParty->uNumGold = 0;
|
|
251 pUIAnim_Gold->uAnimTime = 0;
|
|
252 pUIAnim_Gold->uAnimLength = 8 * pIconsFrameTable->pIcons[(signed __int16)pUIAnim_Gold->uIconID].uAnimLength;
|
|
253 pAudioPlayer->PlaySound(SOUND_GoldReceived, 0, 0, -1, 0, 0, 0, 0);
|
|
254 }
|
|
255
|
|
256 //----- (0049135E) --------------------------------------------------------
|
|
257 unsigned int Party::GetPartyFame()
|
|
258 {
|
|
259 signed int v1; // eax@1
|
89
|
260 Player *v2; // ecx@1
|
0
|
261 signed int v3; // edx@1
|
|
262
|
|
263 v1 = 0;
|
89
|
264 v2 = this->pPlayers;//[0].uExperience;
|
0
|
265 v3 = 4; // (E exp) / 1000
|
|
266 do
|
|
267 {
|
89
|
268 v1 += (int)v2->uExperience; // needs review
|
|
269 ++v2;
|
0
|
270 --v3;
|
|
271 }
|
|
272 while ( v3 );
|
|
273 return v1 / 1000;
|
|
274 }
|
|
275
|
|
276 //----- (0049137D) --------------------------------------------------------
|
|
277 void Party::CreateDefaultParty(char bGiveItems)
|
|
278 {
|
|
279 Party *pParty; // esi@1
|
|
280 signed __int16 v3; // ax@1
|
|
281 int pResMagicBase; // ecx@1
|
|
282 Player *pCharacter; // esi@3
|
|
283 signed int uSpellBookPageCount; // edx@5
|
|
284 int pMagicSkills; // eax@5
|
|
285 int uSkillIdx; // eax@11
|
|
286 //unsigned __int8 v9; // zf@37
|
|
287 //char v10; // sf@37
|
|
288 //unsigned __int8 v11; // of@37
|
|
289 char *pAttributes; // eax@38
|
|
290 signed int v13; // ecx@38
|
|
291 int uMaxSP; // eax@42
|
|
292 unsigned int v15; // [sp-4h] [bp-44h]@14
|
|
293 unsigned int v16; // [sp-4h] [bp-44h]@26
|
|
294 int v17; // [sp+10h] [bp-30h]@1
|
|
295 int v18; // [sp+14h] [bp-2Ch]@11
|
|
296 signed int uNumPlayers; // [sp+18h] [bp-28h]@1
|
|
297 ItemGen Dst; // [sp+1Ch] [bp-24h]@10
|
|
298
|
|
299 pParty = this;
|
|
300 strcpy(this->pPlayers[0].pName, pGlobalTXT_LocalizationStrings[509]); //Zoltan
|
|
301 pParty->pPlayers[0].field_1928 = 17;
|
|
302 pParty->pPlayers[0].uFace = 17;
|
|
303 pParty->pPlayers[0].field_1924 = 17;
|
|
304 pParty->pPlayers[0].uVoiceID = 17;
|
|
305 pParty->pPlayers[0].uMight = 30;
|
|
306 pParty->pPlayers[0].uIntelligence = 5;
|
|
307 pParty->pPlayers[0].uWillpower = 5;
|
|
308 pParty->pPlayers[0].uEndurance = 13;
|
|
309 pParty->pPlayers[0].uAccuracy = 13;
|
|
310 pParty->pPlayers[0].uSpeed = 14;
|
|
311 pParty->pPlayers[0].uLuck = 7;
|
|
312 pParty->pPlayers[0].pActiveSkills[9] = 1; // leather
|
|
313 pParty->pPlayers[0].pActiveSkills[33] = 1; // armsmaster
|
|
314 pParty->pPlayers[0].pActiveSkills[5] = 1; // bow
|
|
315 pParty->pPlayers[0].pActiveSkills[1] = 1; // sword
|
|
316 pParty->pPlayers[1].field_1928 = 3;
|
|
317 pParty->pPlayers[1].uFace = 3;
|
|
318 pParty->pPlayers[1].field_1924 = 3;
|
|
319 pParty->pPlayers[1].uVoiceID = 3;
|
|
320 strcpy(pParty->pPlayers[1].pName, pGlobalTXT_LocalizationStrings[506]); //Roderic
|
|
321 pParty->pPlayers[1].uMight = 13;
|
|
322 pParty->pPlayers[1].uIntelligence = 9;
|
|
323 pParty->pPlayers[1].uWillpower = 9;
|
|
324 pParty->pPlayers[1].uEndurance = 13;
|
|
325 pParty->pPlayers[1].uAccuracy = 13;
|
|
326 pParty->pPlayers[1].uSpeed = 13;
|
|
327 pParty->pPlayers[1].uLuck = 13;
|
|
328 pParty->pPlayers[1].pActiveSkills[9] = 1; // leather
|
|
329 pParty->pPlayers[1].pActiveSkills[34] = 1; // stealing
|
|
330 pParty->pPlayers[1].pActiveSkills[2] = 1; // dagger
|
|
331 pParty->pPlayers[1].pActiveSkills[29] = 1; // disarm trap
|
|
332 pParty->pPlayers[2].field_1928 = 14;
|
|
333 pParty->pPlayers[2].uFace = 14;
|
|
334 pParty->pPlayers[2].field_1924 = 14;
|
|
335 pParty->pPlayers[2].uVoiceID = 14;
|
|
336 strcpy(pParty->pPlayers[2].pName, pGlobalTXT_LocalizationStrings[508]); // Serena
|
|
337 pParty->pPlayers[2].uMight = 12;
|
|
338 pParty->pPlayers[2].uIntelligence = 9;
|
|
339 pParty->pPlayers[2].uWillpower = 20;
|
|
340 pParty->pPlayers[2].uEndurance = 22;
|
|
341 pParty->pPlayers[2].uAccuracy = 7;
|
|
342 pParty->pPlayers[2].uSpeed = 13;
|
|
343 pParty->pPlayers[2].uLuck = 7;
|
|
344 pParty->pPlayers[2].pActiveSkills[35] = 1; // alchemy
|
|
345 pParty->pPlayers[2].pActiveSkills[9] = 1; // leather
|
|
346 pParty->pPlayers[2].pActiveSkills[18] = 1; // body
|
|
347 pParty->pPlayers[2].pActiveSkills[6] = 1; // mace
|
|
348 strcpy(pParty->pPlayers[3].pName, pGlobalTXT_LocalizationStrings[507]); // Alexis
|
|
349 v3 = 10;
|
|
350 pParty->pPlayers[3].field_1928 = 10;
|
|
351 pParty->pPlayers[3].uFace = 10;
|
|
352 pResMagicBase = (int)&pParty->pPlayers[0].sResMagicBase;
|
|
353 pParty->pPlayers[3].uEndurance = 13;
|
|
354 pParty->pPlayers[3].uAccuracy = 13;
|
|
355 pParty->pPlayers[3].uSpeed = 13;
|
|
356 pParty->pPlayers[3].field_1924 = 10;
|
|
357 pParty->pPlayers[3].uVoiceID = 10;
|
|
358 pParty->pPlayers[3].uMight = 5;
|
|
359 pParty->pPlayers[3].uIntelligence = 30;
|
|
360 pParty->pPlayers[3].uWillpower = 9;
|
|
361 pParty->pPlayers[3].uLuck = 7;
|
|
362 pParty->pPlayers[3].pActiveSkills[9] = 1; // leather
|
|
363 pParty->pPlayers[3].pActiveSkills[13] = 1; // air
|
|
364 pParty->pPlayers[3].pActiveSkills[12] = 1; // fire
|
|
365 pParty->pPlayers[3].pActiveSkills[0] = 1; // staff
|
|
366 pCharacter = &pParty->pPlayers[0];
|
|
367 //uNumPlayers = 4;
|
|
368 //while ( 1 )
|
|
369 for (uNumPlayers = 0; uNumPlayers < 4; uNumPlayers++)
|
|
370 {
|
|
371 if ( !pCharacter->uClass )
|
|
372 *(short *)pResMagicBase = v3; //player[i].pResMagicBase
|
|
373 uSpellBookPageCount = 0;
|
|
374 //pMagicSkills = pPlayers[uNumPlayers].pActiveSkills[12];// Skills
|
|
375 //while ( !*(short *)pMagicSkills ) //player[i].skillFire
|
|
376 for (int i = 0; i < 9; i++)//for Magic Book
|
|
377 {
|
|
378 //++uSpellBookPageCount;
|
|
379 //pMagicSkills++;
|
|
380 //if ( uSpellBookPageCount >= 9 )
|
|
381 //goto LABEL_10;
|
|
382 if (pPlayers[uNumPlayers].pActiveSkills[12+i])
|
|
383 ++uSpellBookPageCount;
|
|
384 }
|
|
385 pCharacter->pNumSpellBookPage = uSpellBookPageCount;
|
|
386 //LABEL_10:
|
|
387 pCharacter->uExpressionTimePassed = 0;
|
|
388 Dst.Reset();
|
|
389 if ( bGiveItems )
|
|
390 {
|
|
391 pItemsTable->GenerateItem(2, 40, &Dst);
|
|
392 pCharacter->AddItem2(-1, &Dst);
|
|
393 //uSkillIdx = 0;
|
|
394 //v18 = 0;
|
|
395 //do
|
|
396 for (uSkillIdx = 0; uSkillIdx < 36; uSkillIdx++)
|
|
397 {
|
|
398 if ( pCharacter->pActiveSkills[uSkillIdx] )
|
|
399 {
|
|
400 switch ( uSkillIdx )
|
|
401 {
|
|
402 case PLAYER_SKILL_STAFF:
|
|
403 v15 = ITEM_STAFF_1;
|
|
404 pCharacter->WearItem(v15);
|
|
405 break;
|
|
406 case PLAYER_SKILL_SWORD:
|
|
407 v15 = ITEM_LONGSWORD_1;
|
|
408 pCharacter->WearItem(v15);
|
|
409 break;
|
|
410 case PLAYER_SKILL_DAGGER:
|
|
411 v15 = ITEM_DAGGER_1;
|
|
412 pCharacter->WearItem(v15);
|
|
413 break;
|
|
414 case PLAYER_SKILL_AXE:
|
|
415 v15 = ITEM_AXE_1;
|
|
416 pCharacter->WearItem(v15);
|
|
417 break;
|
|
418 case PLAYER_SKILL_SPEAR:
|
|
419 v15 = ITEM_SPEAR_1;
|
|
420 pCharacter->WearItem(v15);
|
|
421 break;
|
|
422 case PLAYER_SKILL_BOW:
|
|
423 v15 = ITEM_CROSSBOW_1;
|
|
424 pCharacter->WearItem(v15);
|
|
425 break;
|
|
426 case PLAYER_SKILL_MACE:
|
|
427 v15 = ITEM_MACE_1;
|
|
428 pCharacter->WearItem(v15);
|
|
429 break;
|
|
430 case PLAYER_SKILL_SHIELD:
|
|
431 v15 = ITEM_BUCKLER_1;
|
|
432 pCharacter->WearItem(v15);
|
|
433 break;
|
|
434 case PLAYER_SKILL_LEATHER:
|
|
435 v15 = ITEM_LEATHER_1;
|
|
436 pCharacter->WearItem(v15);
|
|
437 break;
|
|
438 case PLAYER_SKILL_CHAIN:
|
|
439 v15 = ITEM_CHAINMAIL_1;
|
|
440 pCharacter->WearItem(v15);
|
|
441 break;
|
|
442 case PLAYER_SKILL_PLATE:
|
|
443 v15 = ITEM_PLATE_1;
|
|
444 pCharacter->WearItem(v15);
|
|
445 break;
|
|
446 case PLAYER_SKILL_FIRE:
|
|
447 v16 = ITEM_SPELLBOOK_FIRE_STRIKE;
|
|
448 pCharacter->AddItem(-1, v16);
|
|
449 break;
|
|
450 case PLAYER_SKILL_AIR:
|
|
451 v16 = ITEM_SPELLBOOK_AIR_FEATHER_FALL;
|
|
452 pCharacter->AddItem(-1, v16);
|
|
453 break;
|
|
454 case PLAYER_SKILL_WATER:
|
|
455 v16 = ITEM_SPELLBOOK_WATER_POISON_SPRAY;
|
|
456 pCharacter->AddItem(-1, v16);
|
|
457 break;
|
|
458 case PLAYER_SKILL_EARTH:
|
|
459 v16 = ITEM_SPELLBOOK_EARTH_SLOW;
|
|
460 pCharacter->AddItem(-1, v16);
|
|
461 break;
|
|
462 case PLAYER_SKILL_SPIRIT:
|
|
463 v16 = ITEM_SPELLBOOK_SPIRIT_BLESS;
|
|
464 pCharacter->AddItem(-1, v16);
|
|
465 break;
|
|
466 case PLAYER_SKILL_MIND:
|
|
467 v16 = ITEM_SPELLBOOK_MIND_MIND_BLAST;
|
|
468 pCharacter->AddItem(-1, v16);
|
|
469 break;
|
|
470 case PLAYER_SKILL_BODY:
|
|
471 v16 = ITEM_SPELLBOOK_BODY_FIRST_AID;
|
|
472 pCharacter->AddItem(-1, v16);
|
|
473 break;
|
|
474 case PLAYER_SKILL_ITEM_ID:
|
|
475 case PLAYER_SKILL_REPAIR:
|
|
476 case PLAYER_SKILL_MEDITATION:
|
|
477 case PLAYER_SKILL_PERCEPTION:
|
|
478 case PLAYER_SKILL_DIPLOMACY:
|
|
479 case PLAYER_SKILL_TRAP_DISARM:
|
|
480 case PLAYER_SKILL_LEARNING:
|
|
481 pCharacter->AddItem(-1, ITEM_POTION_BOTTLE);
|
|
482 v16 = 5 * (rand() % 3 + 40); // simple reagent
|
|
483 pCharacter->AddItem(-1, v16);
|
|
484 break;
|
|
485 case PLAYER_SKILL_DODGE:
|
|
486 v16 = ITEM_BOOTS_1;
|
|
487 pCharacter->AddItem(-1, v16);
|
|
488 break;
|
|
489 case PLAYER_SKILL_UNARMED:
|
|
490 v16 = ITEM_GAUNTLETS_1;
|
|
491 pCharacter->AddItem(-1, v16);
|
|
492 break;
|
|
493 default:
|
|
494 break;
|
|
495 }
|
|
496 }
|
|
497 //uSkillIdx = v18 + 1;
|
|
498 //v11 = uSkillIdx > 36;
|
|
499 //v9 = v18 == 35;
|
|
500 //v10 = uSkillIdx - 35 < 0;
|
|
501 }
|
|
502 //while (uSkillIdx < 36);
|
|
503 pAttributes = (char *)&pCharacter->pInventoryItems[0].uAttributes;
|
|
504 //v13 = 138;
|
|
505 for (v13 = 138; v13 > 0; --v13)
|
|
506 {
|
|
507 if ( *((int *)pAttributes - 5) )
|
|
508 *(int *)pAttributes |= 1;
|
|
509 pAttributes += 36;
|
|
510 //--v13;
|
|
511 }
|
|
512 //while ( v13 );
|
|
513 }
|
|
514 pCharacter->sHealth = pCharacter->GetMaxHealth();
|
|
515 pCharacter->sMana = pCharacter->GetMaxMana();
|
|
516 pCharacter++;
|
|
517 //uNumPlayers--;
|
|
518 //if (!uNumPlayers)
|
|
519 //break;
|
|
520 pResMagicBase = (int)pCharacter;
|
|
521 v3 = 10;
|
|
522 }
|
|
523 }
|
|
524
|
|
525 //----- (004917CE) --------------------------------------------------------
|
|
526 int Party::Reset()
|
|
527 {
|
|
528 //Party *v1; // esi@1
|
|
529 //unsigned __int64 *pTimePlayed; // edi@1
|
|
530 //bool v3; // edx@1
|
|
531 //Player **v4; // eax@1
|
|
532 //Player *v5; // ecx@1
|
|
533 PLAYER_SEX pSex; // cl@3
|
|
534 PLAYER_SEX v7; // al@6
|
|
535 PLAYER_SEX v8; // al@9
|
|
536 PLAYER_SEX v9; // cl@12
|
|
537 //Player *v12; // edx@17
|
|
538 //signed int v13; // edi@18
|
|
539 SpellBuff *v14; // ebx@21
|
|
540 signed int v15; // edi@21
|
|
541
|
|
542 field_708 = 15;
|
|
543 sEyelevel = 160;
|
|
544 uFlags2 = 0;
|
|
545 uNumGold = 200;
|
|
546 uNumGoldInBank = 0;
|
|
547 uNumFoodRations = 7;
|
|
548 uAlignment = 1;
|
|
549
|
|
550 SetUserInterface(uAlignment, true);
|
|
551
|
|
552 uTimePlayed = 0x21C00u;
|
|
553 uLastRegenerationTime = 0x21C00;
|
|
554
|
|
555 bTurnBasedModeOn = false;
|
|
556
|
|
557 uActiveCharacter = 1;
|
|
558 ::pPlayers[0] = pPlayers;
|
|
559 for (uint i = 0; i < 4; ++i)
|
|
560 ::pPlayers[i + 1] = &pPlayers[i];
|
|
561
|
|
562 pPlayers[0].Reset(0);
|
|
563 pPlayers[1].Reset(4);
|
|
564 pPlayers[2].Reset(24);
|
|
565 pPlayers[3].Reset(32);
|
|
566 pPlayers[0].uFace = 17;
|
|
567 pPlayers[0].field_1924 = 17;
|
|
568 pPlayers[0].uVoiceID = 17;
|
|
569 pPlayers[0].SetInitialStats();
|
|
570
|
|
571 switch ( pPlayers[0].uVoiceID )
|
|
572 {
|
|
573 case 0:
|
|
574 case 1:
|
|
575 case 2:
|
|
576 case 3:
|
|
577 case 8:
|
|
578 case 9:
|
|
579 case 12:
|
|
580 case 13:
|
|
581 case 16:
|
|
582 case 17:
|
|
583 case 20:
|
|
584 case 23:
|
|
585 default:
|
|
586 pSex = SEX_MALE;
|
|
587 break;
|
|
588 case 4:
|
|
589 case 5:
|
|
590 case 6:
|
|
591 case 7:
|
|
592 case 10:
|
|
593 case 11:
|
|
594 case 14:
|
|
595 case 15:
|
|
596 case 18:
|
|
597 case 19:
|
|
598 case 21:
|
|
599 case 24:
|
|
600 pSex = SEX_FEMALE;
|
|
601 break;
|
|
602 }
|
|
603 pPlayers[0].uSex = pSex;
|
|
604 pPlayers[0].RandomizeName();
|
|
605 strcpy(pPlayers[0].pName, pGlobalTXT_LocalizationStrings[509]);
|
|
606
|
|
607
|
|
608 pPlayers[1].uFace = 3;
|
|
609 pPlayers[1].field_1924 = 3;
|
|
610 pPlayers[1].uVoiceID = 3;
|
|
611 pPlayers[1].SetInitialStats();
|
|
612 v7 = SEX_MALE;
|
|
613 switch (pPlayers[1].uVoiceID)
|
|
614 {
|
|
615 case 0:
|
|
616 case 1:
|
|
617 case 2:
|
|
618 case 3:
|
|
619 case 8:
|
|
620 case 9:
|
|
621 case 0xCu:
|
|
622 case 0xDu:
|
|
623 case 0x10u:
|
|
624 case 0x11u:
|
|
625 case 0x14u:
|
|
626 case 0x17u:
|
|
627 v7 = SEX_MALE;
|
|
628 break;
|
|
629 case 4:
|
|
630 case 5:
|
|
631 case 6:
|
|
632 case 7:
|
|
633 case 0xAu:
|
|
634 case 0xBu:
|
|
635 case 0xEu:
|
|
636 case 0xFu:
|
|
637 case 0x12u:
|
|
638 case 0x13u:
|
|
639 case 0x15u:
|
|
640 case 0x18u:
|
|
641 v7 = SEX_FEMALE;
|
|
642 break;
|
|
643 default:
|
|
644 break;
|
|
645 }
|
|
646 pPlayers[1].uSex = v7;
|
|
647 pPlayers[1].RandomizeName();
|
|
648 strcpy(pPlayers[1].pName, pGlobalTXT_LocalizationStrings[506]);
|
|
649 pPlayers[2].uFace = 14;
|
|
650 pPlayers[2].field_1924 = 14;
|
|
651 pPlayers[2].uVoiceID = 14;
|
|
652 pPlayers[2].SetInitialStats();
|
|
653 v8 = SEX_MALE;
|
|
654 switch (pPlayers[2].uVoiceID)
|
|
655 {
|
|
656 case 0:
|
|
657 case 1:
|
|
658 case 2:
|
|
659 case 3:
|
|
660 case 8:
|
|
661 case 9:
|
|
662 case 0xCu:
|
|
663 case 0xDu:
|
|
664 case 0x10u:
|
|
665 case 0x11u:
|
|
666 case 0x14u:
|
|
667 case 0x17u:
|
|
668 v8 = SEX_MALE;
|
|
669 break;
|
|
670 case 4:
|
|
671 case 5:
|
|
672 case 6:
|
|
673 case 7:
|
|
674 case 0xAu:
|
|
675 case 0xBu:
|
|
676 case 0xEu:
|
|
677 case 0xFu:
|
|
678 case 0x12u:
|
|
679 case 0x13u:
|
|
680 case 0x15u:
|
|
681 case 0x18u:
|
|
682 v8 = SEX_FEMALE;
|
|
683 break;
|
|
684 default:
|
|
685 break;
|
|
686 }
|
|
687 pPlayers[2].uSex = v8;
|
|
688 pPlayers[2].RandomizeName();
|
|
689 strcpy(pPlayers[2].pName, pGlobalTXT_LocalizationStrings[508]);
|
|
690 pPlayers[3].uFace = 10;
|
|
691 pPlayers[3].field_1924 = 10;
|
|
692 pPlayers[3].uVoiceID = 10;
|
|
693 pPlayers[3].SetInitialStats();
|
|
694 v9 = SEX_MALE;
|
|
695 switch (pPlayers[3].uVoiceID)
|
|
696 {
|
|
697 case 0u:
|
|
698 case 1u:
|
|
699 case 2u:
|
|
700 case 3u:
|
|
701 case 8u:
|
|
702 case 9u:
|
|
703 case 0xCu:
|
|
704 case 0xDu:
|
|
705 case 0x10u:
|
|
706 case 0x11u:
|
|
707 case 0x14u:
|
|
708 case 0x17u:
|
|
709 v9 = SEX_MALE;
|
|
710 break;
|
|
711 case 4u:
|
|
712 case 5u:
|
|
713 case 6u:
|
|
714 case 7u:
|
|
715 case 0xAu:
|
|
716 case 0xBu:
|
|
717 case 0xEu:
|
|
718 case 0xFu:
|
|
719 case 0x12u:
|
|
720 case 0x13u:
|
|
721 case 0x15u:
|
|
722 case 0x18u:
|
|
723 v9 = SEX_FEMALE;
|
|
724 break;
|
|
725 default:
|
|
726 break;
|
|
727 }
|
|
728 pPlayers[3].uSex = v9;
|
|
729 pPlayers[3].RandomizeName();
|
|
730 strcpy(pPlayers[3].pName, pGlobalTXT_LocalizationStrings[507]);
|
|
731
|
|
732
|
|
733
|
|
734 for (uint i = 0; i < 4; ++i)
|
|
735 {
|
|
736 pPlayers[i].uTimeToRecovery = 0;
|
|
737 for (uint j = 0; j < 20; ++j)
|
|
738 pPlayers[i].pConditions[j] = 0;
|
|
739
|
|
740 for (uint j = 0; j < 24; ++j)
|
|
741 pPlayers[i].pPlayerBuffs[j].Reset();
|
|
742
|
|
743 pPlayers[i].uExpressionID = 1;
|
|
744 pPlayers[i].uExpressionTimePassed = 0;
|
|
745 pPlayers[i].uExpressionTimeLength = rand() % 256 + 128;
|
|
746 }
|
|
747
|
|
748 for (uint i = 1; i < 20; ++i)
|
|
749 pPartyBuffs[i].Reset();
|
|
750
|
|
751
|
|
752 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 100;
|
|
753 uFlags = 0;
|
|
754
|
|
755 memset(_award_bits, 0, 64);
|
|
756 _449B7E_toggle_bit(_award_bits, 1, 1);
|
|
757 _449B7E_toggle_bit(_award_bits, 2, 1);
|
|
758 _449B7E_toggle_bit(_award_bits, 3, 1);
|
|
759 _449B7E_toggle_bit(_award_bits, 4, 1);
|
|
760 _449B7E_toggle_bit(_award_bits, 5, 1);
|
|
761 _449B7E_toggle_bit(_award_bits, 6, 1);
|
|
762
|
|
763
|
|
764 memcpy(pNPCStats->pNewNPCData, pNPCStats->pNPCData, 0x94BCu);
|
|
765 memcpy(pNPCStats->pGroups_copy, pNPCStats->pGroups, 0x66u);
|
|
766 pNPCStats->pNewNPCData[3].uFlags |= 0x80u;
|
|
767 _494035_timed_effects__water_walking_damage__etc();
|
|
768 pEventTimer->Pause();
|
|
769 return 0;
|
|
770 }
|
|
771
|
|
772
|
|
773
|
|
774 //----- (0043AD34) --------------------------------------------------------
|
|
775 void Party::Yell()
|
|
776 {
|
|
777 void *v0; // esi@5
|
|
778 int v1; // edi@9
|
|
779 int v2; // ebx@9
|
|
780 int v3; // eax@9
|
|
781 unsigned int v4; // [sp+8h] [bp-4h]@4
|
|
782
|
|
783 if ( (signed __int64)pParty->pPartyBuffs[11].uExpireTime > 0 )
|
|
784 pParty->pPartyBuffs[11].Reset();
|
|
785 if ( pParty->bTurnBasedModeOn != 1 )
|
|
786 {
|
|
787 v4 = 0;
|
|
788 if ( (signed int)uNumActors > 0 )
|
|
789 {
|
|
790 v0 = &pActors[0].pMonsterInfo.uMovementType;
|
|
791 do
|
|
792 {
|
|
793 if ( ((Actor *)((char *)v0 - 59))->Actor::CanAct() && *((char *)v0 + 2) != 4 && *(char *)v0 != 5 )
|
|
794 {
|
|
795 v1 = abs(*(short *)((char *)v0 + 83) - pParty->vPosition.x);
|
|
796 v2 = abs(*(short *)((char *)v0 + 85) - pParty->vPosition.y);
|
|
797 v3 = abs(*(short *)((char *)v0 + 87) - pParty->vPosition.z);
|
|
798 if ( (double)sub_4621DA(v1, v2, v3) < 512.0 )
|
|
799 Actor::_402968(v4, 4, 0, 0);
|
|
800 }
|
|
801 ++v4;
|
|
802 v0 = (char *)v0 + 836;
|
|
803 }
|
|
804 while ( (signed int)v4 < (signed int)uNumActors );
|
|
805 }
|
|
806 }
|
|
807 }
|
|
808
|
|
809 //----- (00491BF9) --------------------------------------------------------
|
|
810 void Party::ResetPosMiscAndSpellBuffs()
|
|
811 {
|
|
812 Party *v1; // esi@1
|
89
|
813 Player *v2; // edi@1
|
0
|
814 SpellBuff *v3; // ebx@2
|
|
815 SpellBuff *v4; // esi@5
|
|
816 signed int v5; // edi@5
|
|
817 signed int v6; // [sp+8h] [bp-8h]@1
|
|
818 signed int v7; // [sp+Ch] [bp-4h]@2
|
|
819
|
|
820 v1 = this;
|
|
821 this->vPosition.y = 0;
|
|
822 this->vPosition.z = 0;
|
|
823 this->vPosition.x = 0;
|
|
824 this->uFallStartY = 0;
|
|
825 this->sRotationY = 0;
|
|
826 this->sRotationX = 0;
|
|
827 this->uFallSpeed = 0;
|
|
828 this->field_28 = 0;
|
|
829 this->uDefaultPartyHeight = 120;
|
|
830 this->field_14 = 37;
|
|
831 this->field_18 = 25;
|
|
832 this->uWalkSpeed = 384;
|
|
833 this->field_20_prolly_turn_speed = 90;
|
|
834 this->field_24 = 5;
|
|
835 this->field_6FC = 0;
|
|
836 this->field_708 = 15;
|
|
837 this->field_0 = 25;
|
89
|
838 v2 = this->pPlayers;//[0].pPlayerBuffs;
|
0
|
839 v6 = 4;
|
|
840 do
|
|
841 {
|
89
|
842 v3 = v2->pPlayerBuffs;
|
0
|
843 v7 = 24;
|
|
844 do
|
|
845 {
|
|
846 v3->Reset();
|
|
847 ++v3;
|
|
848 --v7;
|
|
849 }
|
|
850 while ( v7 );
|
89
|
851 ++v2;
|
0
|
852 --v6;
|
|
853 }
|
|
854 while ( v6 );
|
|
855 v4 = v1->pPartyBuffs;
|
|
856 v5 = 20;
|
|
857 do
|
|
858 {
|
|
859 v4->Reset();
|
|
860 ++v4;
|
|
861 --v5;
|
|
862 }
|
|
863 while ( v5 );
|
|
864 }
|
|
865
|
|
866 //----- (004909F4) --------------------------------------------------------
|
|
867 void Party::_4909F4()
|
|
868 {
|
82
|
869 Player *v1; // esi@2
|
0
|
870 unsigned int v2; // eax@3
|
|
871 __int16 v3; // cx@5
|
|
872 int v4; // edx@27
|
|
873 signed int v5; // eax@52
|
|
874 PlayerFrame *v6; // edx@53
|
82
|
875 NPCData *v7; // esi@60
|
0
|
876 signed int v8; // ebp@61
|
|
877 int v9; // ebx@62
|
|
878 unsigned int v10; // edi@62
|
|
879 signed int v11; // [sp+0h] [bp-4h]@2
|
|
880
|
|
881 if ( dword_A75070 != stru_51076C.field_8 )
|
|
882 {
|
|
883 dword_A75070 = stru_51076C.field_8;
|
82
|
884 v1 = this->pPlayers;//(char *)&this->pPlayers[0].uExpressionID;
|
0
|
885 v11 = 4;
|
|
886 do
|
|
887 {
|
83
|
888 v2 = v1->GetMajorConditionIdx();
|
0
|
889 if ( v2 == 18 || v2 == 17 )
|
|
890 {
|
82
|
891 v1->uExpressionTimePassed += LOWORD(pMiscTimer->uTimeElapsed);
|
|
892 if ( (unsigned __int16)v1->uExpressionTimePassed >= v1->uExpressionTimeLength )
|
0
|
893 {
|
82
|
894 if ( v1->uExpressionID != 1 || rand() % 5 )
|
0
|
895 {
|
82
|
896 v1->uExpressionTimePassed = 0;
|
|
897 v1->uExpressionID = 1;
|
|
898 v1->uExpressionTimeLength = rand() % 256 + 32;
|
0
|
899 }
|
|
900 else
|
|
901 {
|
|
902 v4 = rand() % 100;
|
|
903 if ( v4 >= 25 )
|
|
904 {
|
|
905 if ( v4 >= 31 )
|
|
906 {
|
|
907 if ( v4 >= 37 )
|
|
908 {
|
|
909 if ( v4 >= 43 )
|
|
910 {
|
|
911 if ( v4 >= 46 )
|
|
912 {
|
|
913 if ( v4 >= 52 )
|
|
914 {
|
|
915 if ( v4 >= 58 )
|
|
916 {
|
|
917 if ( v4 >= 64 )
|
|
918 {
|
|
919 if ( v4 >= 70 )
|
|
920 {
|
|
921 if ( v4 >= 76 )
|
|
922 {
|
|
923 if ( v4 >= 82 )
|
|
924 {
|
|
925 if ( v4 >= 88 )
|
82
|
926 v1->uExpressionID = (v4 >= 94) + 29;
|
0
|
927 else
|
82
|
928 v1->uExpressionID = 57;
|
0
|
929 }
|
|
930 else
|
|
931 {
|
82
|
932 v1->uExpressionID = 56;
|
0
|
933 }
|
|
934 }
|
|
935 else
|
|
936 {
|
82
|
937 v1->uExpressionID = 55;
|
0
|
938 }
|
|
939 }
|
|
940 else
|
|
941 {
|
82
|
942 v1->uExpressionID = 54;
|
0
|
943 }
|
|
944 }
|
|
945 else
|
|
946 {
|
82
|
947 v1->uExpressionID = 20;
|
0
|
948 }
|
|
949 }
|
|
950 else
|
|
951 {
|
82
|
952 v1->uExpressionID = 19;
|
0
|
953 }
|
|
954 }
|
|
955 else
|
|
956 {
|
82
|
957 v1->uExpressionID = 18;
|
0
|
958 }
|
|
959 }
|
|
960 else
|
|
961 {
|
82
|
962 v1->uExpressionID = 17;
|
0
|
963 }
|
|
964 }
|
|
965 else
|
|
966 {
|
82
|
967 v1->uExpressionID = 16;
|
0
|
968 }
|
|
969 }
|
|
970 else
|
|
971 {
|
82
|
972 v1->uExpressionID = 15;
|
0
|
973 }
|
|
974 }
|
|
975 else
|
|
976 {
|
82
|
977 v1->uExpressionID = 14;
|
0
|
978 }
|
|
979 }
|
|
980 else
|
|
981 {
|
82
|
982 v1->uExpressionID = 13;
|
0
|
983 }
|
|
984 v5 = 0;
|
82
|
985 v1->uExpressionTimePassed = 0;
|
|
986 if ( (signed int)pPlayerFrameTable->uNumFrames <= 0 )
|
0
|
987 {
|
|
988 LABEL_56:
|
|
989 v5 = 0;
|
|
990 }
|
|
991 else
|
|
992 {
|
|
993 v6 = pPlayerFrameTable->pFrames;
|
82
|
994 while ( v6->uSequenceID != v1->uExpressionID )
|
0
|
995 {
|
|
996 ++v5;
|
|
997 ++v6;
|
|
998 if ( v5 >= (signed int)pPlayerFrameTable->uNumFrames )
|
|
999 goto LABEL_56;
|
|
1000 }
|
|
1001 }
|
82
|
1002 v1->uExpressionTimeLength = 8 * pPlayerFrameTable->pFrames[v5].uAnimLength;
|
0
|
1003 }
|
|
1004 }
|
|
1005 }
|
|
1006 else
|
|
1007 {
|
82
|
1008 v3 = v1->uExpressionID;
|
|
1009 if ( v1->uExpressionID != 34 && v3 != 35 && v3 != 36
|
|
1010 || (signed int)(pMiscTimer->uTimeElapsed + v1->uExpressionTimePassed) >= v1->uExpressionTimeLength )
|
0
|
1011 {
|
82
|
1012 v1->uExpressionTimeLength = 0;
|
|
1013 v1->uExpressionTimePassed = 0;
|
0
|
1014 switch ( v2 )
|
|
1015 {
|
|
1016 case 0xEu:
|
82
|
1017 v1->uExpressionID = 98;
|
0
|
1018 break;
|
|
1019 case 0xFu:
|
82
|
1020 v1->uExpressionID = 12;
|
0
|
1021 break;
|
|
1022 case 0x10u:
|
82
|
1023 v1->uExpressionID = 99;
|
0
|
1024 break;
|
|
1025 case 0u:
|
82
|
1026 v1->uExpressionID = 2;
|
0
|
1027 break;
|
|
1028 case 1u:
|
82
|
1029 v1->uExpressionID = 3;
|
0
|
1030 break;
|
|
1031 case 2u:
|
82
|
1032 v1->uExpressionID = 4;
|
0
|
1033 break;
|
|
1034 case 3u:
|
82
|
1035 v1->uExpressionID = 5;
|
0
|
1036 break;
|
|
1037 case 4u:
|
82
|
1038 v1->uExpressionID = 6;
|
0
|
1039 break;
|
|
1040 case 5u:
|
82
|
1041 v1->uExpressionID = 7;
|
0
|
1042 break;
|
|
1043 case 6u:
|
|
1044 case 8u:
|
|
1045 case 0xAu:
|
82
|
1046 v1->uExpressionID = 8;
|
0
|
1047 break;
|
|
1048 case 7u:
|
|
1049 case 9u:
|
|
1050 case 0xBu:
|
82
|
1051 v1->uExpressionID = 9;
|
0
|
1052 break;
|
|
1053 case 0xCu:
|
82
|
1054 v1->uExpressionID = 10;
|
0
|
1055 break;
|
|
1056 case 0xDu:
|
82
|
1057 v1->uExpressionID = 11;
|
0
|
1058 break;
|
|
1059 default:
|
|
1060 break;
|
|
1061 }
|
|
1062 }
|
|
1063 else
|
|
1064 {
|
82
|
1065 v1->uExpressionTimePassed += LOWORD(pMiscTimer->uTimeElapsed);
|
|
1066 }
|
0
|
1067 }
|
82
|
1068 ++v1;
|
0
|
1069 --v11;
|
|
1070 }
|
|
1071 while ( v11 );
|
82
|
1072 v7 = pParty->pHirelings;//(char *)&pParty->pHirelings[0].evtb;
|
0
|
1073 do
|
|
1074 {
|
82
|
1075 v8 = v7->evtc;
|
0
|
1076 if ( v8 )
|
|
1077 {
|
82
|
1078 v9 = v7->bDrawSomeAnim;
|
|
1079 v10 = pMiscTimer->uTimeElapsed + v7->evtb;
|
0
|
1080 if ( (signed int)v10 >= v8 )
|
|
1081 {
|
|
1082 v9 = 0;
|
|
1083 v8 = 0;
|
|
1084 v10 = 0;
|
82
|
1085 memset(v7, 0, 0x4Cu);
|
0
|
1086 pParty->field_709 = 0;
|
|
1087 //sub_44A56A();Ritor1: it's temporarily
|
|
1088 viewparams->bRedrawGameUI = 1;
|
|
1089 }
|
82
|
1090 v7->evtb = v10;
|
|
1091 v7->evtc = v8;
|
|
1092 v7->bDrawSomeAnim = v9;
|
0
|
1093 }
|
82
|
1094 ++v7;
|
0
|
1095 }
|
82
|
1096 while ( v7 <= &pParty->pHirelings[1] );
|
0
|
1097 }
|
|
1098 }
|
|
1099 // A75070: using guessed type int dword_A75070;
|
|
1100
|
|
1101 //----- (00490D02) --------------------------------------------------------
|
|
1102 void Party::RestAndHeal()
|
|
1103 {
|
|
1104 SpellBuff *v1; // esi@1
|
|
1105 Player *v2; // esi@4
|
|
1106 signed int v3; // ebx@4
|
|
1107 SpellBuff *v4; // edi@4
|
|
1108 int v5; // eax@9
|
|
1109 char v6; // zf@9
|
83
|
1110 ItemGen *v7; // eax@10
|
0
|
1111 signed int v8; // ecx@10
|
|
1112 int v9; // eax@18
|
|
1113 int v10; // eax@25
|
|
1114 signed int v11; // ecx@26
|
|
1115 signed int v12; // [sp-4h] [bp-1Ch]@26
|
|
1116 Party *v13; // [sp+Ch] [bp-Ch]@1
|
|
1117 signed int v14; // [sp+10h] [bp-8h]@10
|
|
1118 signed int v15; // [sp+14h] [bp-4h]@3
|
|
1119
|
|
1120 v13 = this;
|
|
1121 v1 = pParty->pPartyBuffs;
|
|
1122 do
|
|
1123 {
|
|
1124 v1->Reset();
|
|
1125 ++v1;
|
|
1126 }
|
|
1127 while ( (signed int)v1 < (signed int)pParty->pPlayers );
|
|
1128 v15 = 0;
|
|
1129 do
|
|
1130 {
|
|
1131 v2 = &pParty->pPlayers[v15];
|
|
1132 v3 = 20;
|
|
1133 v4 = v2->pPlayerBuffs;
|
|
1134 do
|
|
1135 {
|
|
1136 v4->Reset();
|
|
1137 ++v4;
|
|
1138 --v3;
|
|
1139 }
|
|
1140 while ( v3 );
|
|
1141 v2->Zero();
|
|
1142 if ( v2->pConditions[14] || v2->pConditions[15] || v2->pConditions[16] )
|
|
1143 goto LABEL_33;
|
|
1144 LODWORD(v2->pConditions[13]) = 0;
|
|
1145 HIDWORD(v2->pConditions[13]) = 0;
|
|
1146 LODWORD(v2->pConditions[4]) = 0;
|
|
1147 HIDWORD(v2->pConditions[4]) = 0;
|
|
1148 LODWORD(v2->pConditions[2]) = 0;
|
|
1149 HIDWORD(v2->pConditions[2]) = 0;
|
|
1150 LODWORD(v2->pConditions[3]) = 0;
|
|
1151 HIDWORD(v2->pConditions[3]) = 0;
|
|
1152 LODWORD(v2->pConditions[1]) = 0;
|
|
1153 HIDWORD(v2->pConditions[1]) = 0;
|
|
1154 v2->uTimeToRecovery = 0;
|
|
1155 v2->sHealth = v2->GetMaxHealth();
|
|
1156 v5 = v2->GetMaxMana();
|
|
1157 v6 = v2->uClass == 35;
|
|
1158 v2->sMana = v5;
|
|
1159 if ( v6 )
|
|
1160 {
|
|
1161 v14 = 0;
|
83
|
1162 v7 = v2->pInventoryItems;//[0].field_1A;
|
0
|
1163 v8 = 138;
|
|
1164 do
|
|
1165 {
|
83
|
1166 if ( v7->uItemID == 601 && (unsigned __int8)v7->field_1A== v15 + 1 )
|
0
|
1167 v14 = 1;
|
83
|
1168 ++v7;
|
0
|
1169 --v8;
|
|
1170 }
|
|
1171 while ( v8 );
|
|
1172 if ( !v14 )
|
|
1173 {
|
|
1174 v2->sHealth = v2->GetMaxHealth() / 2;
|
|
1175 v2->sMana = v2->GetMaxMana() / 2;
|
|
1176 }
|
|
1177 }
|
|
1178 if ( !v2->pConditions[17] )
|
|
1179 {
|
|
1180 if ( v2->pConditions[10] || v2->pConditions[11] )
|
|
1181 {
|
|
1182 v11 = 4;
|
|
1183 v12 = 4;
|
|
1184 }
|
|
1185 else
|
|
1186 {
|
|
1187 if ( !v2->pConditions[8] && !v2->pConditions[9] )
|
|
1188 {
|
|
1189 if ( !v2->pConditions[6] && !v2->pConditions[7] )
|
|
1190 goto LABEL_30;
|
|
1191 v2->sHealth /= 2;
|
|
1192 v10 = v2->sMana / 2;
|
|
1193 goto LABEL_29;
|
|
1194 }
|
|
1195 v11 = 3;
|
|
1196 v12 = 3;
|
|
1197 }
|
|
1198 v2->sHealth /= v11;
|
|
1199 v10 = v2->sMana / v12;
|
|
1200 LABEL_29:
|
|
1201 v2->sMana = v10;
|
|
1202 goto LABEL_30;
|
|
1203 }
|
|
1204 v9 = v2->sHealth;
|
|
1205 v2->sMana = 0;
|
|
1206 v2->sHealth = v9 / 2;
|
|
1207 LABEL_30:
|
|
1208 if ( v2->pConditions[5] )
|
|
1209 v2->sMana = 0;
|
|
1210 _4909F4();
|
|
1211 LABEL_33:
|
|
1212 ++v15;
|
|
1213 }
|
|
1214 while ( v15 < 4 );
|
|
1215 pParty->field_764 = 0;
|
|
1216 } |