annotate Party.cpp @ 1014:a704435d3285

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