annotate Party.cpp @ 20:d3536563ef2d

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