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