annotate Party.cpp @ 1380:635500df9320

Слияние
author Ritor1
date Tue, 16 Jul 2013 14:11:43 +0600
parents 9014784ae84f
children b51332ab228f
rev   line source
1165
29a8defbad9e temporary _CRT_SECURE_NO_WARNINGS to remove some warnings
Grumpy7
parents: 1071
diff changeset
1 #ifdef _MSC_VER
29a8defbad9e temporary _CRT_SECURE_NO_WARNINGS to remove some warnings
Grumpy7
parents: 1071
diff changeset
2 #define _CRT_SECURE_NO_WARNINGS
29a8defbad9e temporary _CRT_SECURE_NO_WARNINGS to remove some warnings
Grumpy7
parents: 1071
diff changeset
3 #endif
29a8defbad9e temporary _CRT_SECURE_NO_WARNINGS to remove some warnings
Grumpy7
parents: 1071
diff changeset
4
130
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
5 #include <assert.h>
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
6
0
Ritor1
parents:
diff changeset
7 #include "Party.h"
Ritor1
parents:
diff changeset
8 #include "MapInfo.h"
Ritor1
parents:
diff changeset
9 #include "Time.h"
Ritor1
parents:
diff changeset
10 #include "AudioPlayer.h"
Ritor1
parents:
diff changeset
11 #include "IconFrameTable.h"
Ritor1
parents:
diff changeset
12 #include "Mouse.h"
Ritor1
parents:
diff changeset
13 #include "PlayerFrameTable.h"
Ritor1
parents:
diff changeset
14 #include "TurnEngine.h"
Ritor1
parents:
diff changeset
15 #include "Viewport.h"
Ritor1
parents:
diff changeset
16 #include "Actor.h"
Ritor1
parents:
diff changeset
17 #include "GUIWindow.h"
189
038a4d09406f new texts file, fix text rendender error
Gloval
parents: 141
diff changeset
18 #include "texts.h"
0
Ritor1
parents:
diff changeset
19
Ritor1
parents:
diff changeset
20 #include "mm7_data.h"
828
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 783
diff changeset
21 #include "MM7.h"
1295
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
22 #include "Outdoor.h"
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
23 #include "Indoor.h"
1297
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
24 #include "Texture.h"
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
25 #include "LOD.h"
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
26 #include "Sprites.h"
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
27 #include "SpriteObject.h"
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
28 #include "ObjectList.h"
1361
b3ac17fd12de Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents: 1359
diff changeset
29 #include "Conditions.h"
0
Ritor1
parents:
diff changeset
30
Ritor1
parents:
diff changeset
31 Party *pParty; // idb
Ritor1
parents:
diff changeset
32
Ritor1
parents:
diff changeset
33 struct ActionQueue *pPartyActionQueue = new ActionQueue;
Ritor1
parents:
diff changeset
34
Ritor1
parents:
diff changeset
35
Ritor1
parents:
diff changeset
36
1035
306ec23b37df 004C1EE5 & other stuff
Nomad
parents: 1014
diff changeset
37
306ec23b37df 004C1EE5 & other stuff
Nomad
parents: 1014
diff changeset
38
306ec23b37df 004C1EE5 & other stuff
Nomad
parents: 1014
diff changeset
39 //----- (0044A56A) --------------------------------------------------------
306ec23b37df 004C1EE5 & other stuff
Nomad
parents: 1014
diff changeset
40 void Party::CountHirelings()
306ec23b37df 004C1EE5 & other stuff
Nomad
parents: 1014
diff changeset
41 {
306ec23b37df 004C1EE5 & other stuff
Nomad
parents: 1014
diff changeset
42 field_70A = 0;
306ec23b37df 004C1EE5 & other stuff
Nomad
parents: 1014
diff changeset
43
306ec23b37df 004C1EE5 & other stuff
Nomad
parents: 1014
diff changeset
44 for (int i = 0; i < pNPCStats->uNumNewNPCs; ++i)
306ec23b37df 004C1EE5 & other stuff
Nomad
parents: 1014
diff changeset
45 {
306ec23b37df 004C1EE5 & other stuff
Nomad
parents: 1014
diff changeset
46 auto npc = pNPCStats->pNewNPCData + i;
306ec23b37df 004C1EE5 & other stuff
Nomad
parents: 1014
diff changeset
47 if (npc->Hired() &&
306ec23b37df 004C1EE5 & other stuff
Nomad
parents: 1014
diff changeset
48 (!pHirelings[0].pName || strcmp(npc->pName, pHirelings[0].pName)))
306ec23b37df 004C1EE5 & other stuff
Nomad
parents: 1014
diff changeset
49 {
306ec23b37df 004C1EE5 & other stuff
Nomad
parents: 1014
diff changeset
50 if (!pHirelings[1].pName || strcmp(npc->pName, pHirelings[1].pName))
306ec23b37df 004C1EE5 & other stuff
Nomad
parents: 1014
diff changeset
51 ++field_70A;
306ec23b37df 004C1EE5 & other stuff
Nomad
parents: 1014
diff changeset
52 }
306ec23b37df 004C1EE5 & other stuff
Nomad
parents: 1014
diff changeset
53 }
306ec23b37df 004C1EE5 & other stuff
Nomad
parents: 1014
diff changeset
54 }
306ec23b37df 004C1EE5 & other stuff
Nomad
parents: 1014
diff changeset
55
306ec23b37df 004C1EE5 & other stuff
Nomad
parents: 1014
diff changeset
56
783
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
57 // inlined
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
58 //----- (mm6c::004858D0) --------------------------------------------------
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
59 void Party::Zero()
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
60 {
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
61
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
62 uFlags2 = 0;
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
63 uNumGoldInBank = 0;
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
64
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
65 uCurrentYear = 0;
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
66 uCurrentMonth = 0;
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
67 uCurrentMonthWeek = 0;
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
68 uDaysPlayed = 0;
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
69 uCurrentHour = 0;
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
70 uCurrentMinute = 0;
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
71 uCurrentTimeSecond = 0;
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
72
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
73 field_6FC = 0;
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
74 days_played_without_rest = 0;
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
75
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
76 vPosition.y = 0;
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
77 vPosition.z = 0;
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
78 vPosition.x = 0;
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
79 uFallStartY = 0;
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
80 sRotationY = 0;
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
81 sRotationX = 0;
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
82 uFallSpeed = 0;
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
83 field_28 = 0;
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
84 uDefaultPartyHeight = 120;
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
85 field_14 = 37;
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
86 y_rotation_granularity = 25;
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
87 uWalkSpeed = 384;
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
88 y_rotation_speed = 90;
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
89 field_24 = 5;
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
90 field_6FC = 0;
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
91 field_708 = 15;
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
92 field_0 = 25;
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
93 }
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
94
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
95 //inlined
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
96 //----- (mm6c::0045BE90) --------------------------------------------------
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
97 void ActionQueue::Reset()
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
98 {
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
99 uNumActions = 0;
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
100 }
0
Ritor1
parents:
diff changeset
101
Ritor1
parents:
diff changeset
102 //----- (004760C1) --------------------------------------------------------
Ritor1
parents:
diff changeset
103 void ActionQueue::Add(PartyAction action)
Ritor1
parents:
diff changeset
104 {
Ritor1
parents:
diff changeset
105 if (uNumActions < 30)
Ritor1
parents:
diff changeset
106 pActions[uNumActions++] = action;
Ritor1
parents:
diff changeset
107 }
Ritor1
parents:
diff changeset
108
Ritor1
parents:
diff changeset
109 //----- (00497FC5) --------------------------------------------------------
Ritor1
parents:
diff changeset
110 bool Party::_497FC5_check_party_perception_against_level()
Ritor1
parents:
diff changeset
111 {
Ritor1
parents:
diff changeset
112 int uMaxPerception; // edi@1
Ritor1
parents:
diff changeset
113 Player *v2; // esi@1
Ritor1
parents:
diff changeset
114 signed int v3; // ebx@1
Ritor1
parents:
diff changeset
115 Player *v4; // ecx@2
Ritor1
parents:
diff changeset
116 signed int v5; // eax@3
Ritor1
parents:
diff changeset
117 bool result; // eax@7
Ritor1
parents:
diff changeset
118
Ritor1
parents:
diff changeset
119 uMaxPerception = 0;
Ritor1
parents:
diff changeset
120 v2 = this->pPlayers;
Ritor1
parents:
diff changeset
121 v3 = 4;
Ritor1
parents:
diff changeset
122 do
Ritor1
parents:
diff changeset
123 {
Ritor1
parents:
diff changeset
124 if ( v2->CanAct() )
Ritor1
parents:
diff changeset
125 {
Ritor1
parents:
diff changeset
126 v5 = v2->GetPerception();
Ritor1
parents:
diff changeset
127 if ( v5 > uMaxPerception )
Ritor1
parents:
diff changeset
128 uMaxPerception = v5;
Ritor1
parents:
diff changeset
129 }
Ritor1
parents:
diff changeset
130 ++v2;
Ritor1
parents:
diff changeset
131 --v3;
Ritor1
parents:
diff changeset
132 }
Ritor1
parents:
diff changeset
133 while ( v3 );
Ritor1
parents:
diff changeset
134 if ( uLevelMapStatsID && (signed int)uLevelMapStatsID < 77 )
Ritor1
parents:
diff changeset
135 result = uMaxPerception >= 2 * pMapStats->pInfos[uLevelMapStatsID]._per;
Ritor1
parents:
diff changeset
136 else
Ritor1
parents:
diff changeset
137 result = 0;
Ritor1
parents:
diff changeset
138 return result;
Ritor1
parents:
diff changeset
139 }
Ritor1
parents:
diff changeset
140
Ritor1
parents:
diff changeset
141 //----- (004936E1) --------------------------------------------------------
Ritor1
parents:
diff changeset
142 void Party::SetHoldingItem(ItemGen *pItem)
Ritor1
parents:
diff changeset
143 {
Ritor1
parents:
diff changeset
144 sub_421B2C_PlaceInInventory_or_DropPickedItem();
201
30aa44013f7a On Items
Nomad
parents: 198
diff changeset
145 memcpy(&pPickedItem, pItem, sizeof(pPickedItem));
30aa44013f7a On Items
Nomad
parents: 198
diff changeset
146 pMouse->SetCursorBitmapFromItemID(pPickedItem.uItemID);
0
Ritor1
parents:
diff changeset
147 }
Ritor1
parents:
diff changeset
148
Ritor1
parents:
diff changeset
149 //----- (0049370F) --------------------------------------------------------
Ritor1
parents:
diff changeset
150 int Party::GetNextActiveCharacter()
Ritor1
parents:
diff changeset
151 {
Ritor1
parents:
diff changeset
152 Party *v1; // esi@1
Ritor1
parents:
diff changeset
153 int v2; // eax@4
Ritor1
parents:
diff changeset
154 signed int v4; // ecx@6
89
98cd93e14777 pointer fixes
zipi
parents: 83
diff changeset
155 Player *v5; // edx@6
0
Ritor1
parents:
diff changeset
156 Player *v6; // eax@7
89
98cd93e14777 pointer fixes
zipi
parents: 83
diff changeset
157 Player *v7; // ecx@23
0
Ritor1
parents:
diff changeset
158 signed int v8; // esi@23
Ritor1
parents:
diff changeset
159 signed int v9; // edx@23
Ritor1
parents:
diff changeset
160 Player **v10; // edi@23
Ritor1
parents:
diff changeset
161 Player *v11; // eax@24
Ritor1
parents:
diff changeset
162 int v12; // [sp+Ch] [bp-4h]@1
Ritor1
parents:
diff changeset
163
Ritor1
parents:
diff changeset
164 v1 = this;
Ritor1
parents:
diff changeset
165 v12 = 0;
Ritor1
parents:
diff changeset
166 if ( pParty->bTurnBasedModeOn == 1 )
Ritor1
parents:
diff changeset
167 {
1340
22cb507446a4 turnengine refactoring continue
Gloval
parents: 1310
diff changeset
168 if ( pTurnEngine->turn_stage != 2 || PID_TYPE(pTurnEngine->pQueue[0].uPackedID) != OBJECT_Player)
0
Ritor1
parents:
diff changeset
169 return 0;
848
ceef50611567 * AI fixed (temporary)
zipi
parents: 828
diff changeset
170 v2 = PID_ID(pTurnEngine->pQueue[0].uPackedID);
0
Ritor1
parents:
diff changeset
171 return v2 + 1;
Ritor1
parents:
diff changeset
172 }
Ritor1
parents:
diff changeset
173 v4 = 0;
89
98cd93e14777 pointer fixes
zipi
parents: 83
diff changeset
174 v5 = v1->pPlayers;//[0].uTimeToRecovery;
0
Ritor1
parents:
diff changeset
175 while ( 1 )
Ritor1
parents:
diff changeset
176 {
Ritor1
parents:
diff changeset
177 v6 = ::pPlayers[v4 + 1];
Ritor1
parents:
diff changeset
178 if ( v6->pConditions[2]
Ritor1
parents:
diff changeset
179 || v6->pConditions[12]
Ritor1
parents:
diff changeset
180 || v6->pConditions[13]
Ritor1
parents:
diff changeset
181 || v6->pConditions[14]
Ritor1
parents:
diff changeset
182 || v6->pConditions[15]
Ritor1
parents:
diff changeset
183 || v6->pConditions[16]
89
98cd93e14777 pointer fixes
zipi
parents: 83
diff changeset
184 || v5->uTimeToRecovery )
0
Ritor1
parents:
diff changeset
185 {
Ritor1
parents:
diff changeset
186 byte_AE3368[v4] = 1;
Ritor1
parents:
diff changeset
187 }
89
98cd93e14777 pointer fixes
zipi
parents: 83
diff changeset
188 else if ( !byte_AE3368[v4] )
0
Ritor1
parents:
diff changeset
189 break;
Ritor1
parents:
diff changeset
190 ++v4;
89
98cd93e14777 pointer fixes
zipi
parents: 83
diff changeset
191 ++v5;
0
Ritor1
parents:
diff changeset
192 if ( v4 >= 4 )
89
98cd93e14777 pointer fixes
zipi
parents: 83
diff changeset
193 break;
0
Ritor1
parents:
diff changeset
194 }
89
98cd93e14777 pointer fixes
zipi
parents: 83
diff changeset
195 if(v4<4)
98cd93e14777 pointer fixes
zipi
parents: 83
diff changeset
196 {
98cd93e14777 pointer fixes
zipi
parents: 83
diff changeset
197 v12 = v4;
98cd93e14777 pointer fixes
zipi
parents: 83
diff changeset
198 byte_AE3368[v4] = 1;
98cd93e14777 pointer fixes
zipi
parents: 83
diff changeset
199 }
0
Ritor1
parents:
diff changeset
200 if ( (unsigned __int8)(byte_AE3369 & byte_AE336A & byte_AE336B) & byte_AE3368[0] )
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
201 memset(byte_AE3368.data(), 0, 4u);
0
Ritor1
parents:
diff changeset
202 v2 = v12;
Ritor1
parents:
diff changeset
203 if ( v12 )
Ritor1
parents:
diff changeset
204 return v2 + 1;
89
98cd93e14777 pointer fixes
zipi
parents: 83
diff changeset
205 v7 = v1->pPlayers;//[0].uSpeedBonus;
0
Ritor1
parents:
diff changeset
206 v8 = 0;
Ritor1
parents:
diff changeset
207 v9 = 1;
Ritor1
parents:
diff changeset
208 v10 = &::pPlayers[1];
Ritor1
parents:
diff changeset
209 while ( 2 )
Ritor1
parents:
diff changeset
210 {
Ritor1
parents:
diff changeset
211 v11 = *v10;
Ritor1
parents:
diff changeset
212 if ( !(*v10)->pConditions[2]
Ritor1
parents:
diff changeset
213 && !v11->pConditions[12]
Ritor1
parents:
diff changeset
214 && !v11->pConditions[13]
Ritor1
parents:
diff changeset
215 && !v11->pConditions[14]
Ritor1
parents:
diff changeset
216 && !v11->pConditions[15]
Ritor1
parents:
diff changeset
217 && !v11->pConditions[16]
89
98cd93e14777 pointer fixes
zipi
parents: 83
diff changeset
218 && !v7->uTimeToRecovery )
0
Ritor1
parents:
diff changeset
219 {
Ritor1
parents:
diff changeset
220 if ( v12 )
Ritor1
parents:
diff changeset
221 {
89
98cd93e14777 pointer fixes
zipi
parents: 83
diff changeset
222 if ( v7->uSpeedBonus > v8 )
0
Ritor1
parents:
diff changeset
223 {
89
98cd93e14777 pointer fixes
zipi
parents: 83
diff changeset
224 v8 = v7->uSpeedBonus;
98cd93e14777 pointer fixes
zipi
parents: 83
diff changeset
225 v12 = v9;
0
Ritor1
parents:
diff changeset
226 }
Ritor1
parents:
diff changeset
227 }
Ritor1
parents:
diff changeset
228 else
Ritor1
parents:
diff changeset
229 {
Ritor1
parents:
diff changeset
230 v8 = *(short *)v7;
Ritor1
parents:
diff changeset
231 v12 = v9;
Ritor1
parents:
diff changeset
232 }
Ritor1
parents:
diff changeset
233 }
Ritor1
parents:
diff changeset
234 ++v10;
Ritor1
parents:
diff changeset
235 ++v9;
89
98cd93e14777 pointer fixes
zipi
parents: 83
diff changeset
236 ++v7;
0
Ritor1
parents:
diff changeset
237 if ( v9 - 1 < 4 )
Ritor1
parents:
diff changeset
238 continue;
Ritor1
parents:
diff changeset
239 return v12;
Ritor1
parents:
diff changeset
240 }
Ritor1
parents:
diff changeset
241 }
Ritor1
parents:
diff changeset
242
Ritor1
parents:
diff changeset
243
Ritor1
parents:
diff changeset
244 //----- (00493244) --------------------------------------------------------
Ritor1
parents:
diff changeset
245 bool Party::HasItem(unsigned int uItemID)
Ritor1
parents:
diff changeset
246 {
89
98cd93e14777 pointer fixes
zipi
parents: 83
diff changeset
247 Player *v2; // edx@1
0
Ritor1
parents:
diff changeset
248 signed int v3; // ecx@2
Ritor1
parents:
diff changeset
249 ItemGen *v4; // eax@2
Ritor1
parents:
diff changeset
250
89
98cd93e14777 pointer fixes
zipi
parents: 83
diff changeset
251 v2 = pParty->pPlayers;//[0].pInventoryItems;
98cd93e14777 pointer fixes
zipi
parents: 83
diff changeset
252 while ( v2 <= &pParty->pPlayers[3] )
0
Ritor1
parents:
diff changeset
253 {
Ritor1
parents:
diff changeset
254 v3 = 0;
89
98cd93e14777 pointer fixes
zipi
parents: 83
diff changeset
255 v4 = v2->pInventoryItems;
0
Ritor1
parents:
diff changeset
256 do
Ritor1
parents:
diff changeset
257 {
Ritor1
parents:
diff changeset
258 if ( v4->uItemID == uItemID )
Ritor1
parents:
diff changeset
259 return 1;
Ritor1
parents:
diff changeset
260 ++v3;
Ritor1
parents:
diff changeset
261 ++v4;
Ritor1
parents:
diff changeset
262 }
Ritor1
parents:
diff changeset
263 while ( v3 < 138 );
89
98cd93e14777 pointer fixes
zipi
parents: 83
diff changeset
264 ++v2;
0
Ritor1
parents:
diff changeset
265 }
Ritor1
parents:
diff changeset
266 return 0;
Ritor1
parents:
diff changeset
267 }
Ritor1
parents:
diff changeset
268
Ritor1
parents:
diff changeset
269
Ritor1
parents:
diff changeset
270 //----- (00492AD5) --------------------------------------------------------
593
Nomad
parents: 592
diff changeset
271 void Party::SetFood(unsigned int uNumFood)
0
Ritor1
parents:
diff changeset
272 {
Ritor1
parents:
diff changeset
273 pUIAnim_Food->uAnimTime = 0;
Ritor1
parents:
diff changeset
274 pParty->uNumFoodRations = uNumFood;
592
96f48cfdd657 some flags
Nomad
parents: 566
diff changeset
275 pUIAnim_Food->uAnimLength = 8 * pIconsFrameTable->pIcons[pUIAnim_Food->uIconID].uAnimLength;
0
Ritor1
parents:
diff changeset
276 }
Ritor1
parents:
diff changeset
277
Ritor1
parents:
diff changeset
278 //----- (00492B03) --------------------------------------------------------
Ritor1
parents:
diff changeset
279 void Party::TakeFood(unsigned int uNumFood)
Ritor1
parents:
diff changeset
280 {
592
96f48cfdd657 some flags
Nomad
parents: 566
diff changeset
281 if (pParty->uNumFoodRations <= uNumFood)
96f48cfdd657 some flags
Nomad
parents: 566
diff changeset
282 pParty->uNumFoodRations = 0;
0
Ritor1
parents:
diff changeset
283 else
592
96f48cfdd657 some flags
Nomad
parents: 566
diff changeset
284 pParty->uNumFoodRations -= uNumFood;
96f48cfdd657 some flags
Nomad
parents: 566
diff changeset
285
0
Ritor1
parents:
diff changeset
286 pUIAnim_Food->uAnimTime = 0;
592
96f48cfdd657 some flags
Nomad
parents: 566
diff changeset
287 pUIAnim_Food->uAnimLength = 8 * pIconsFrameTable->pIcons[pUIAnim_Food->uIconID].uAnimLength;
0
Ritor1
parents:
diff changeset
288 }
Ritor1
parents:
diff changeset
289
Ritor1
parents:
diff changeset
290 //----- (00492B42) --------------------------------------------------------
592
96f48cfdd657 some flags
Nomad
parents: 566
diff changeset
291 void Party::GiveFood(unsigned int _this)
0
Ritor1
parents:
diff changeset
292 {
Ritor1
parents:
diff changeset
293 pParty->uNumFoodRations += _this;
Ritor1
parents:
diff changeset
294 pUIAnim_Food->uAnimTime = 0;
592
96f48cfdd657 some flags
Nomad
parents: 566
diff changeset
295 pUIAnim_Food->uAnimLength = 8 * pIconsFrameTable->pIcons[pUIAnim_Food->uIconID].uAnimLength;
0
Ritor1
parents:
diff changeset
296 }
Ritor1
parents:
diff changeset
297
Ritor1
parents:
diff changeset
298 //----- (00492B70) --------------------------------------------------------
Ritor1
parents:
diff changeset
299 void Party::SetGold(unsigned int uNumGold)
Ritor1
parents:
diff changeset
300 {
Ritor1
parents:
diff changeset
301 pParty->uNumGold = uNumGold;
Ritor1
parents:
diff changeset
302 pUIAnim_Gold->uAnimTime = 0;
592
96f48cfdd657 some flags
Nomad
parents: 566
diff changeset
303 pUIAnim_Gold->uAnimLength = 8 * pIconsFrameTable->pIcons[pUIAnim_Gold->uIconID].uAnimLength;
0
Ritor1
parents:
diff changeset
304 pAudioPlayer->PlaySound(SOUND_GoldReceived, 0, 0, -1, 0, 0, 0, 0);
Ritor1
parents:
diff changeset
305 }
Ritor1
parents:
diff changeset
306
Ritor1
parents:
diff changeset
307 //----- (00492BB6) --------------------------------------------------------
Ritor1
parents:
diff changeset
308 void Party::TakeGold(unsigned int uNumGold)
Ritor1
parents:
diff changeset
309 {
Ritor1
parents:
diff changeset
310 if ( uNumGold <= pParty->uNumGold )
Ritor1
parents:
diff changeset
311 pParty->uNumGold -= uNumGold;
Ritor1
parents:
diff changeset
312 else
Ritor1
parents:
diff changeset
313 pParty->uNumGold = 0;
Ritor1
parents:
diff changeset
314 pUIAnim_Gold->uAnimTime = 0;
592
96f48cfdd657 some flags
Nomad
parents: 566
diff changeset
315 pUIAnim_Gold->uAnimLength = 8 * pIconsFrameTable->pIcons[pUIAnim_Gold->uIconID].uAnimLength;
0
Ritor1
parents:
diff changeset
316 pAudioPlayer->PlaySound(SOUND_GoldReceived, 0, 0, -1, 0, 0, 0, 0);
Ritor1
parents:
diff changeset
317 }
Ritor1
parents:
diff changeset
318
Ritor1
parents:
diff changeset
319 //----- (0049135E) --------------------------------------------------------
Ritor1
parents:
diff changeset
320 unsigned int Party::GetPartyFame()
Ritor1
parents:
diff changeset
321 {
566
fcbb3c281217 QuickRef reputation string fix
Nomad
parents: 487
diff changeset
322 unsigned __int64 total_exp = 0;
fcbb3c281217 QuickRef reputation string fix
Nomad
parents: 487
diff changeset
323 for (uint i = 0; i < 4; ++i)
fcbb3c281217 QuickRef reputation string fix
Nomad
parents: 487
diff changeset
324 total_exp += pPlayers[i].uExperience;
fcbb3c281217 QuickRef reputation string fix
Nomad
parents: 487
diff changeset
325 return total_exp / 1000;
0
Ritor1
parents:
diff changeset
326 }
Ritor1
parents:
diff changeset
327
Ritor1
parents:
diff changeset
328 //----- (0049137D) --------------------------------------------------------
Ritor1
parents:
diff changeset
329 void Party::CreateDefaultParty(char bGiveItems)
Ritor1
parents:
diff changeset
330 {
Ritor1
parents:
diff changeset
331 Party *pParty; // esi@1
Ritor1
parents:
diff changeset
332 signed __int16 v3; // ax@1
135
9b0d651821f1 Party creation screen: sorcerer class icon fixed
Nomad
parents: 130
diff changeset
333 //int pResMagicBase; // ecx@1
0
Ritor1
parents:
diff changeset
334 Player *pCharacter; // esi@3
321
15decc249a94 quick fix to spells commit (wasnt compiling)
Nomad
parents: 291
diff changeset
335 //signed int uSpellBookPageCount; // edx@5
0
Ritor1
parents:
diff changeset
336 int pMagicSkills; // eax@5
Ritor1
parents:
diff changeset
337 int uSkillIdx; // eax@11
Ritor1
parents:
diff changeset
338 //unsigned __int8 v9; // zf@37
Ritor1
parents:
diff changeset
339 //char v10; // sf@37
Ritor1
parents:
diff changeset
340 //unsigned __int8 v11; // of@37
1071
a7e63532b9a8 pointer cleaning
zipi
parents: 1060
diff changeset
341 ItemGen *pItems; // eax@38
0
Ritor1
parents:
diff changeset
342 signed int v13; // ecx@38
Ritor1
parents:
diff changeset
343 int uMaxSP; // eax@42
Ritor1
parents:
diff changeset
344 unsigned int v15; // [sp-4h] [bp-44h]@14
Ritor1
parents:
diff changeset
345 unsigned int v16; // [sp-4h] [bp-44h]@26
Ritor1
parents:
diff changeset
346 int v17; // [sp+10h] [bp-30h]@1
Ritor1
parents:
diff changeset
347 int v18; // [sp+14h] [bp-2Ch]@11
Ritor1
parents:
diff changeset
348 signed int uNumPlayers; // [sp+18h] [bp-28h]@1
Ritor1
parents:
diff changeset
349 ItemGen Dst; // [sp+1Ch] [bp-24h]@10
Ritor1
parents:
diff changeset
350
130
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
351
0
Ritor1
parents:
diff changeset
352 pParty = this;
130
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
353
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
354 pHireling1Name[0] = 0;
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
355 pHireling2Name[0] = 0;
134
1c6d36681f7f Margaret
Ritor1
parents: 130
diff changeset
356 pParty->field_709 = 0;
130
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
357 memset(pHirelings, 0, 2 * sizeof(*pHirelings));
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
358
0
Ritor1
parents:
diff changeset
359 strcpy(this->pPlayers[0].pName, pGlobalTXT_LocalizationStrings[509]); //Zoltan
1014
a704435d3285 comtinue player cleaning
Gloval
parents: 937
diff changeset
360 pParty->pPlayers[0].uPrevFace = 17;
a704435d3285 comtinue player cleaning
Gloval
parents: 937
diff changeset
361 pParty->pPlayers[0].uCurrentFace = 17;
a704435d3285 comtinue player cleaning
Gloval
parents: 937
diff changeset
362 pParty->pPlayers[0].uPrevVoiceID = 17;
0
Ritor1
parents:
diff changeset
363 pParty->pPlayers[0].uVoiceID = 17;
Ritor1
parents:
diff changeset
364 pParty->pPlayers[0].uMight = 30;
Ritor1
parents:
diff changeset
365 pParty->pPlayers[0].uIntelligence = 5;
Ritor1
parents:
diff changeset
366 pParty->pPlayers[0].uWillpower = 5;
Ritor1
parents:
diff changeset
367 pParty->pPlayers[0].uEndurance = 13;
Ritor1
parents:
diff changeset
368 pParty->pPlayers[0].uAccuracy = 13;
Ritor1
parents:
diff changeset
369 pParty->pPlayers[0].uSpeed = 14;
Ritor1
parents:
diff changeset
370 pParty->pPlayers[0].uLuck = 7;
135
9b0d651821f1 Party creation screen: sorcerer class icon fixed
Nomad
parents: 130
diff changeset
371 pParty->pPlayers[0].pActiveSkills[PLAYER_SKILL_LEATHER] = 1; // leather
9b0d651821f1 Party creation screen: sorcerer class icon fixed
Nomad
parents: 130
diff changeset
372 pParty->pPlayers[0].pActiveSkills[PLAYER_SKILL_ARMSMASTER] = 1; // armsmaster
9b0d651821f1 Party creation screen: sorcerer class icon fixed
Nomad
parents: 130
diff changeset
373 pParty->pPlayers[0].pActiveSkills[PLAYER_SKILL_BOW] = 1; // bow
9b0d651821f1 Party creation screen: sorcerer class icon fixed
Nomad
parents: 130
diff changeset
374 pParty->pPlayers[0].pActiveSkills[PLAYER_SKILL_SWORD] = 1; // sword
1014
a704435d3285 comtinue player cleaning
Gloval
parents: 937
diff changeset
375 pParty->pPlayers[1].uPrevFace = 3;
a704435d3285 comtinue player cleaning
Gloval
parents: 937
diff changeset
376 pParty->pPlayers[1].uCurrentFace = 3;
a704435d3285 comtinue player cleaning
Gloval
parents: 937
diff changeset
377 pParty->pPlayers[1].uPrevVoiceID = 3;
0
Ritor1
parents:
diff changeset
378 pParty->pPlayers[1].uVoiceID = 3;
Ritor1
parents:
diff changeset
379 strcpy(pParty->pPlayers[1].pName, pGlobalTXT_LocalizationStrings[506]); //Roderic
Ritor1
parents:
diff changeset
380 pParty->pPlayers[1].uMight = 13;
Ritor1
parents:
diff changeset
381 pParty->pPlayers[1].uIntelligence = 9;
Ritor1
parents:
diff changeset
382 pParty->pPlayers[1].uWillpower = 9;
Ritor1
parents:
diff changeset
383 pParty->pPlayers[1].uEndurance = 13;
Ritor1
parents:
diff changeset
384 pParty->pPlayers[1].uAccuracy = 13;
Ritor1
parents:
diff changeset
385 pParty->pPlayers[1].uSpeed = 13;
Ritor1
parents:
diff changeset
386 pParty->pPlayers[1].uLuck = 13;
135
9b0d651821f1 Party creation screen: sorcerer class icon fixed
Nomad
parents: 130
diff changeset
387 pParty->pPlayers[1].pActiveSkills[PLAYER_SKILL_LEATHER] = 1; // leather
9b0d651821f1 Party creation screen: sorcerer class icon fixed
Nomad
parents: 130
diff changeset
388 pParty->pPlayers[1].pActiveSkills[PLAYER_SKILL_STEALING] = 1; // stealing
9b0d651821f1 Party creation screen: sorcerer class icon fixed
Nomad
parents: 130
diff changeset
389 pParty->pPlayers[1].pActiveSkills[PLAYER_SKILL_DAGGER] = 1; // dagger
9b0d651821f1 Party creation screen: sorcerer class icon fixed
Nomad
parents: 130
diff changeset
390 pParty->pPlayers[1].pActiveSkills[PLAYER_SKILL_TRAP_DISARM] = 1; // disarm trap
1014
a704435d3285 comtinue player cleaning
Gloval
parents: 937
diff changeset
391 pParty->pPlayers[2].uPrevFace = 14;
a704435d3285 comtinue player cleaning
Gloval
parents: 937
diff changeset
392 pParty->pPlayers[2].uCurrentFace = 14;
a704435d3285 comtinue player cleaning
Gloval
parents: 937
diff changeset
393 pParty->pPlayers[2].uPrevVoiceID = 14;
0
Ritor1
parents:
diff changeset
394 pParty->pPlayers[2].uVoiceID = 14;
Ritor1
parents:
diff changeset
395 strcpy(pParty->pPlayers[2].pName, pGlobalTXT_LocalizationStrings[508]); // Serena
Ritor1
parents:
diff changeset
396 pParty->pPlayers[2].uMight = 12;
Ritor1
parents:
diff changeset
397 pParty->pPlayers[2].uIntelligence = 9;
Ritor1
parents:
diff changeset
398 pParty->pPlayers[2].uWillpower = 20;
Ritor1
parents:
diff changeset
399 pParty->pPlayers[2].uEndurance = 22;
Ritor1
parents:
diff changeset
400 pParty->pPlayers[2].uAccuracy = 7;
Ritor1
parents:
diff changeset
401 pParty->pPlayers[2].uSpeed = 13;
Ritor1
parents:
diff changeset
402 pParty->pPlayers[2].uLuck = 7;
135
9b0d651821f1 Party creation screen: sorcerer class icon fixed
Nomad
parents: 130
diff changeset
403 pParty->pPlayers[2].pActiveSkills[PLAYER_SKILL_ALCHEMY] = 1; // alchemy
9b0d651821f1 Party creation screen: sorcerer class icon fixed
Nomad
parents: 130
diff changeset
404 pParty->pPlayers[2].pActiveSkills[PLAYER_SKILL_LEATHER] = 1; // leather
9b0d651821f1 Party creation screen: sorcerer class icon fixed
Nomad
parents: 130
diff changeset
405 pParty->pPlayers[2].pActiveSkills[PLAYER_SKILL_BODY] = 1; // body
9b0d651821f1 Party creation screen: sorcerer class icon fixed
Nomad
parents: 130
diff changeset
406 pParty->pPlayers[2].pActiveSkills[PLAYER_SKILL_MACE] = 1; // mace
0
Ritor1
parents:
diff changeset
407 strcpy(pParty->pPlayers[3].pName, pGlobalTXT_LocalizationStrings[507]); // Alexis
Ritor1
parents:
diff changeset
408 v3 = 10;
1014
a704435d3285 comtinue player cleaning
Gloval
parents: 937
diff changeset
409 pParty->pPlayers[3].uPrevFace = 10;
a704435d3285 comtinue player cleaning
Gloval
parents: 937
diff changeset
410 pParty->pPlayers[3].uCurrentFace = 10;
135
9b0d651821f1 Party creation screen: sorcerer class icon fixed
Nomad
parents: 130
diff changeset
411 //pResMagicBase = (int)&pParty->pPlayers[0].sResMagicBase;
0
Ritor1
parents:
diff changeset
412 pParty->pPlayers[3].uEndurance = 13;
Ritor1
parents:
diff changeset
413 pParty->pPlayers[3].uAccuracy = 13;
Ritor1
parents:
diff changeset
414 pParty->pPlayers[3].uSpeed = 13;
1014
a704435d3285 comtinue player cleaning
Gloval
parents: 937
diff changeset
415 pParty->pPlayers[3].uPrevVoiceID = 10;
0
Ritor1
parents:
diff changeset
416 pParty->pPlayers[3].uVoiceID = 10;
Ritor1
parents:
diff changeset
417 pParty->pPlayers[3].uMight = 5;
Ritor1
parents:
diff changeset
418 pParty->pPlayers[3].uIntelligence = 30;
Ritor1
parents:
diff changeset
419 pParty->pPlayers[3].uWillpower = 9;
Ritor1
parents:
diff changeset
420 pParty->pPlayers[3].uLuck = 7;
135
9b0d651821f1 Party creation screen: sorcerer class icon fixed
Nomad
parents: 130
diff changeset
421 pParty->pPlayers[3].pActiveSkills[PLAYER_SKILL_LEATHER] = 1; // leather
9b0d651821f1 Party creation screen: sorcerer class icon fixed
Nomad
parents: 130
diff changeset
422 pParty->pPlayers[3].pActiveSkills[PLAYER_SKILL_AIR] = 1; // air
9b0d651821f1 Party creation screen: sorcerer class icon fixed
Nomad
parents: 130
diff changeset
423 pParty->pPlayers[3].pActiveSkills[PLAYER_SKILL_FIRE] = 1; // fire
9b0d651821f1 Party creation screen: sorcerer class icon fixed
Nomad
parents: 130
diff changeset
424 pParty->pPlayers[3].pActiveSkills[PLAYER_SKILL_STAFF] = 1; // staff
0
Ritor1
parents:
diff changeset
425 //uNumPlayers = 4;
Ritor1
parents:
diff changeset
426 //while ( 1 )
Ritor1
parents:
diff changeset
427 for (uNumPlayers = 0; uNumPlayers < 4; uNumPlayers++)
Ritor1
parents:
diff changeset
428 {
135
9b0d651821f1 Party creation screen: sorcerer class icon fixed
Nomad
parents: 130
diff changeset
429 pCharacter = &pParty->pPlayers[uNumPlayers];
9b0d651821f1 Party creation screen: sorcerer class icon fixed
Nomad
parents: 130
diff changeset
430 if (pCharacter->classType == PLAYER_CLASS_KNIGHT)
9b0d651821f1 Party creation screen: sorcerer class icon fixed
Nomad
parents: 130
diff changeset
431 pCharacter->sResMagicBase = v3; //player[i].pResMagicBase
321
15decc249a94 quick fix to spells commit (wasnt compiling)
Nomad
parents: 291
diff changeset
432 //uSpellBookPageCount = 0;
0
Ritor1
parents:
diff changeset
433 //pMagicSkills = pPlayers[uNumPlayers].pActiveSkills[12];// Skills
Ritor1
parents:
diff changeset
434 //while ( !*(short *)pMagicSkills ) //player[i].skillFire
321
15decc249a94 quick fix to spells commit (wasnt compiling)
Nomad
parents: 291
diff changeset
435 pCharacter->lastOpenedSpellbookPage = 0;
0
Ritor1
parents:
diff changeset
436 for (int i = 0; i < 9; i++)//for Magic Book
Ritor1
parents:
diff changeset
437 {
Ritor1
parents:
diff changeset
438 //++uSpellBookPageCount;
Ritor1
parents:
diff changeset
439 //pMagicSkills++;
Ritor1
parents:
diff changeset
440 //if ( uSpellBookPageCount >= 9 )
Ritor1
parents:
diff changeset
441 //goto LABEL_10;
Ritor1
parents:
diff changeset
442 if (pPlayers[uNumPlayers].pActiveSkills[12+i])
321
15decc249a94 quick fix to spells commit (wasnt compiling)
Nomad
parents: 291
diff changeset
443 {
15decc249a94 quick fix to spells commit (wasnt compiling)
Nomad
parents: 291
diff changeset
444 pCharacter->lastOpenedSpellbookPage = i;
15decc249a94 quick fix to spells commit (wasnt compiling)
Nomad
parents: 291
diff changeset
445 break;
15decc249a94 quick fix to spells commit (wasnt compiling)
Nomad
parents: 291
diff changeset
446 }
0
Ritor1
parents:
diff changeset
447 }
Ritor1
parents:
diff changeset
448 //LABEL_10:
Ritor1
parents:
diff changeset
449 pCharacter->uExpressionTimePassed = 0;
Ritor1
parents:
diff changeset
450 Dst.Reset();
Ritor1
parents:
diff changeset
451 if ( bGiveItems )
Ritor1
parents:
diff changeset
452 {
439
6b8118542175 recipie item
Gloval
parents: 398
diff changeset
453 pItemsTable->GenerateItem(2, 40, &Dst); //ring
0
Ritor1
parents:
diff changeset
454 pCharacter->AddItem2(-1, &Dst);
Ritor1
parents:
diff changeset
455 //uSkillIdx = 0;
Ritor1
parents:
diff changeset
456 //v18 = 0;
Ritor1
parents:
diff changeset
457 //do
Ritor1
parents:
diff changeset
458 for (uSkillIdx = 0; uSkillIdx < 36; uSkillIdx++)
Ritor1
parents:
diff changeset
459 {
Ritor1
parents:
diff changeset
460 if ( pCharacter->pActiveSkills[uSkillIdx] )
Ritor1
parents:
diff changeset
461 {
Ritor1
parents:
diff changeset
462 switch ( uSkillIdx )
Ritor1
parents:
diff changeset
463 {
Ritor1
parents:
diff changeset
464 case PLAYER_SKILL_STAFF:
Ritor1
parents:
diff changeset
465 v15 = ITEM_STAFF_1;
Ritor1
parents:
diff changeset
466 pCharacter->WearItem(v15);
Ritor1
parents:
diff changeset
467 break;
Ritor1
parents:
diff changeset
468 case PLAYER_SKILL_SWORD:
Ritor1
parents:
diff changeset
469 v15 = ITEM_LONGSWORD_1;
Ritor1
parents:
diff changeset
470 pCharacter->WearItem(v15);
Ritor1
parents:
diff changeset
471 break;
Ritor1
parents:
diff changeset
472 case PLAYER_SKILL_DAGGER:
Ritor1
parents:
diff changeset
473 v15 = ITEM_DAGGER_1;
Ritor1
parents:
diff changeset
474 pCharacter->WearItem(v15);
Ritor1
parents:
diff changeset
475 break;
Ritor1
parents:
diff changeset
476 case PLAYER_SKILL_AXE:
Ritor1
parents:
diff changeset
477 v15 = ITEM_AXE_1;
Ritor1
parents:
diff changeset
478 pCharacter->WearItem(v15);
Ritor1
parents:
diff changeset
479 break;
Ritor1
parents:
diff changeset
480 case PLAYER_SKILL_SPEAR:
Ritor1
parents:
diff changeset
481 v15 = ITEM_SPEAR_1;
Ritor1
parents:
diff changeset
482 pCharacter->WearItem(v15);
Ritor1
parents:
diff changeset
483 break;
Ritor1
parents:
diff changeset
484 case PLAYER_SKILL_BOW:
Ritor1
parents:
diff changeset
485 v15 = ITEM_CROSSBOW_1;
Ritor1
parents:
diff changeset
486 pCharacter->WearItem(v15);
Ritor1
parents:
diff changeset
487 break;
Ritor1
parents:
diff changeset
488 case PLAYER_SKILL_MACE:
Ritor1
parents:
diff changeset
489 v15 = ITEM_MACE_1;
Ritor1
parents:
diff changeset
490 pCharacter->WearItem(v15);
Ritor1
parents:
diff changeset
491 break;
Ritor1
parents:
diff changeset
492 case PLAYER_SKILL_SHIELD:
Ritor1
parents:
diff changeset
493 v15 = ITEM_BUCKLER_1;
Ritor1
parents:
diff changeset
494 pCharacter->WearItem(v15);
Ritor1
parents:
diff changeset
495 break;
Ritor1
parents:
diff changeset
496 case PLAYER_SKILL_LEATHER:
Ritor1
parents:
diff changeset
497 v15 = ITEM_LEATHER_1;
Ritor1
parents:
diff changeset
498 pCharacter->WearItem(v15);
Ritor1
parents:
diff changeset
499 break;
Ritor1
parents:
diff changeset
500 case PLAYER_SKILL_CHAIN:
Ritor1
parents:
diff changeset
501 v15 = ITEM_CHAINMAIL_1;
Ritor1
parents:
diff changeset
502 pCharacter->WearItem(v15);
Ritor1
parents:
diff changeset
503 break;
Ritor1
parents:
diff changeset
504 case PLAYER_SKILL_PLATE:
Ritor1
parents:
diff changeset
505 v15 = ITEM_PLATE_1;
Ritor1
parents:
diff changeset
506 pCharacter->WearItem(v15);
Ritor1
parents:
diff changeset
507 break;
Ritor1
parents:
diff changeset
508 case PLAYER_SKILL_FIRE:
Ritor1
parents:
diff changeset
509 v16 = ITEM_SPELLBOOK_FIRE_STRIKE;
Ritor1
parents:
diff changeset
510 pCharacter->AddItem(-1, v16);
Ritor1
parents:
diff changeset
511 break;
Ritor1
parents:
diff changeset
512 case PLAYER_SKILL_AIR:
Ritor1
parents:
diff changeset
513 v16 = ITEM_SPELLBOOK_AIR_FEATHER_FALL;
Ritor1
parents:
diff changeset
514 pCharacter->AddItem(-1, v16);
Ritor1
parents:
diff changeset
515 break;
Ritor1
parents:
diff changeset
516 case PLAYER_SKILL_WATER:
Ritor1
parents:
diff changeset
517 v16 = ITEM_SPELLBOOK_WATER_POISON_SPRAY;
Ritor1
parents:
diff changeset
518 pCharacter->AddItem(-1, v16);
Ritor1
parents:
diff changeset
519 break;
Ritor1
parents:
diff changeset
520 case PLAYER_SKILL_EARTH:
Ritor1
parents:
diff changeset
521 v16 = ITEM_SPELLBOOK_EARTH_SLOW;
Ritor1
parents:
diff changeset
522 pCharacter->AddItem(-1, v16);
Ritor1
parents:
diff changeset
523 break;
Ritor1
parents:
diff changeset
524 case PLAYER_SKILL_SPIRIT:
Ritor1
parents:
diff changeset
525 v16 = ITEM_SPELLBOOK_SPIRIT_BLESS;
Ritor1
parents:
diff changeset
526 pCharacter->AddItem(-1, v16);
Ritor1
parents:
diff changeset
527 break;
Ritor1
parents:
diff changeset
528 case PLAYER_SKILL_MIND:
Ritor1
parents:
diff changeset
529 v16 = ITEM_SPELLBOOK_MIND_MIND_BLAST;
Ritor1
parents:
diff changeset
530 pCharacter->AddItem(-1, v16);
Ritor1
parents:
diff changeset
531 break;
Ritor1
parents:
diff changeset
532 case PLAYER_SKILL_BODY:
Ritor1
parents:
diff changeset
533 v16 = ITEM_SPELLBOOK_BODY_FIRST_AID;
Ritor1
parents:
diff changeset
534 pCharacter->AddItem(-1, v16);
Ritor1
parents:
diff changeset
535 break;
Ritor1
parents:
diff changeset
536 case PLAYER_SKILL_ITEM_ID:
Ritor1
parents:
diff changeset
537 case PLAYER_SKILL_REPAIR:
Ritor1
parents:
diff changeset
538 case PLAYER_SKILL_MEDITATION:
Ritor1
parents:
diff changeset
539 case PLAYER_SKILL_PERCEPTION:
Ritor1
parents:
diff changeset
540 case PLAYER_SKILL_DIPLOMACY:
Ritor1
parents:
diff changeset
541 case PLAYER_SKILL_TRAP_DISARM:
Ritor1
parents:
diff changeset
542 case PLAYER_SKILL_LEARNING:
Ritor1
parents:
diff changeset
543 pCharacter->AddItem(-1, ITEM_POTION_BOTTLE);
Ritor1
parents:
diff changeset
544 v16 = 5 * (rand() % 3 + 40); // simple reagent
Ritor1
parents:
diff changeset
545 pCharacter->AddItem(-1, v16);
Ritor1
parents:
diff changeset
546 break;
Ritor1
parents:
diff changeset
547 case PLAYER_SKILL_DODGE:
Ritor1
parents:
diff changeset
548 v16 = ITEM_BOOTS_1;
Ritor1
parents:
diff changeset
549 pCharacter->AddItem(-1, v16);
Ritor1
parents:
diff changeset
550 break;
Ritor1
parents:
diff changeset
551 case PLAYER_SKILL_UNARMED:
Ritor1
parents:
diff changeset
552 v16 = ITEM_GAUNTLETS_1;
Ritor1
parents:
diff changeset
553 pCharacter->AddItem(-1, v16);
Ritor1
parents:
diff changeset
554 break;
Ritor1
parents:
diff changeset
555 default:
Ritor1
parents:
diff changeset
556 break;
Ritor1
parents:
diff changeset
557 }
Ritor1
parents:
diff changeset
558 }
Ritor1
parents:
diff changeset
559 //uSkillIdx = v18 + 1;
Ritor1
parents:
diff changeset
560 //v11 = uSkillIdx > 36;
Ritor1
parents:
diff changeset
561 //v9 = v18 == 35;
Ritor1
parents:
diff changeset
562 //v10 = uSkillIdx - 35 < 0;
Ritor1
parents:
diff changeset
563 }
Ritor1
parents:
diff changeset
564 //while (uSkillIdx < 36);
1071
a7e63532b9a8 pointer cleaning
zipi
parents: 1060
diff changeset
565 pItems = pCharacter->pInventoryItems;
0
Ritor1
parents:
diff changeset
566 //v13 = 138;
1071
a7e63532b9a8 pointer cleaning
zipi
parents: 1060
diff changeset
567 for (int i = 0; i < 138; i++)
0
Ritor1
parents:
diff changeset
568 {
1071
a7e63532b9a8 pointer cleaning
zipi
parents: 1060
diff changeset
569 if ( pItems->uItemID )
a7e63532b9a8 pointer cleaning
zipi
parents: 1060
diff changeset
570 pItems->uAttributes |= 1;
a7e63532b9a8 pointer cleaning
zipi
parents: 1060
diff changeset
571 ++pItems;
0
Ritor1
parents:
diff changeset
572 //--v13;
Ritor1
parents:
diff changeset
573 }
Ritor1
parents:
diff changeset
574 //while ( v13 );
Ritor1
parents:
diff changeset
575 }
Ritor1
parents:
diff changeset
576 pCharacter->sHealth = pCharacter->GetMaxHealth();
Ritor1
parents:
diff changeset
577 pCharacter->sMana = pCharacter->GetMaxMana();
135
9b0d651821f1 Party creation screen: sorcerer class icon fixed
Nomad
parents: 130
diff changeset
578 //pCharacter++;
0
Ritor1
parents:
diff changeset
579 //uNumPlayers--;
Ritor1
parents:
diff changeset
580 //if (!uNumPlayers)
Ritor1
parents:
diff changeset
581 //break;
135
9b0d651821f1 Party creation screen: sorcerer class icon fixed
Nomad
parents: 130
diff changeset
582 //pResMagicBase = (int)pCharacter;
0
Ritor1
parents:
diff changeset
583 v3 = 10;
Ritor1
parents:
diff changeset
584 }
Ritor1
parents:
diff changeset
585 }
Ritor1
parents:
diff changeset
586
Ritor1
parents:
diff changeset
587 //----- (004917CE) --------------------------------------------------------
Ritor1
parents:
diff changeset
588 int Party::Reset()
Ritor1
parents:
diff changeset
589 {
Ritor1
parents:
diff changeset
590 //Party *v1; // esi@1
Ritor1
parents:
diff changeset
591 //unsigned __int64 *pTimePlayed; // edi@1
Ritor1
parents:
diff changeset
592 //bool v3; // edx@1
Ritor1
parents:
diff changeset
593 //Player **v4; // eax@1
Ritor1
parents:
diff changeset
594 //Player *v5; // ecx@1
Ritor1
parents:
diff changeset
595 PLAYER_SEX pSex; // cl@3
Ritor1
parents:
diff changeset
596 PLAYER_SEX v7; // al@6
Ritor1
parents:
diff changeset
597 PLAYER_SEX v8; // al@9
Ritor1
parents:
diff changeset
598 PLAYER_SEX v9; // cl@12
Ritor1
parents:
diff changeset
599 //Player *v12; // edx@17
Ritor1
parents:
diff changeset
600 //signed int v13; // edi@18
Ritor1
parents:
diff changeset
601 SpellBuff *v14; // ebx@21
Ritor1
parents:
diff changeset
602 signed int v15; // edi@21
783
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
603
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
604 Zero();
0
Ritor1
parents:
diff changeset
605
Ritor1
parents:
diff changeset
606 field_708 = 15;
Ritor1
parents:
diff changeset
607 sEyelevel = 160;
Ritor1
parents:
diff changeset
608 uNumGold = 200;
Ritor1
parents:
diff changeset
609 uNumFoodRations = 7;
Ritor1
parents:
diff changeset
610
783
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
611
373
edd2d8b7e3c4 Interface reloading fix & party alignment enum
Nomad
parents: 351
diff changeset
612 alignment = PartyAlignment_Neutral;
edd2d8b7e3c4 Interface reloading fix & party alignment enum
Nomad
parents: 351
diff changeset
613 SetUserInterface(alignment, true);
0
Ritor1
parents:
diff changeset
614
Ritor1
parents:
diff changeset
615 uTimePlayed = 0x21C00u;
Ritor1
parents:
diff changeset
616 uLastRegenerationTime = 0x21C00;
Ritor1
parents:
diff changeset
617
Ritor1
parents:
diff changeset
618 bTurnBasedModeOn = false;
Ritor1
parents:
diff changeset
619
Ritor1
parents:
diff changeset
620 uActiveCharacter = 1;
Ritor1
parents:
diff changeset
621 ::pPlayers[0] = pPlayers;
Ritor1
parents:
diff changeset
622 for (uint i = 0; i < 4; ++i)
Ritor1
parents:
diff changeset
623 ::pPlayers[i + 1] = &pPlayers[i];
Ritor1
parents:
diff changeset
624
135
9b0d651821f1 Party creation screen: sorcerer class icon fixed
Nomad
parents: 130
diff changeset
625 pPlayers[0].Reset(PLAYER_CLASS_KNIGHT);
9b0d651821f1 Party creation screen: sorcerer class icon fixed
Nomad
parents: 130
diff changeset
626 pPlayers[1].Reset(PLAYER_CLASS_THEIF);
9b0d651821f1 Party creation screen: sorcerer class icon fixed
Nomad
parents: 130
diff changeset
627 pPlayers[2].Reset(PLAYER_CLASS_CLERIC);
9b0d651821f1 Party creation screen: sorcerer class icon fixed
Nomad
parents: 130
diff changeset
628 pPlayers[3].Reset(PLAYER_CLASS_SORCERER);
1014
a704435d3285 comtinue player cleaning
Gloval
parents: 937
diff changeset
629 pPlayers[0].uCurrentFace = 17;
a704435d3285 comtinue player cleaning
Gloval
parents: 937
diff changeset
630 pPlayers[0].uPrevVoiceID = 17;
0
Ritor1
parents:
diff changeset
631 pPlayers[0].uVoiceID = 17;
Ritor1
parents:
diff changeset
632 pPlayers[0].SetInitialStats();
Ritor1
parents:
diff changeset
633
Ritor1
parents:
diff changeset
634 switch ( pPlayers[0].uVoiceID )
Ritor1
parents:
diff changeset
635 {
Ritor1
parents:
diff changeset
636 case 0:
Ritor1
parents:
diff changeset
637 case 1:
Ritor1
parents:
diff changeset
638 case 2:
Ritor1
parents:
diff changeset
639 case 3:
Ritor1
parents:
diff changeset
640 case 8:
Ritor1
parents:
diff changeset
641 case 9:
Ritor1
parents:
diff changeset
642 case 12:
Ritor1
parents:
diff changeset
643 case 13:
Ritor1
parents:
diff changeset
644 case 16:
Ritor1
parents:
diff changeset
645 case 17:
Ritor1
parents:
diff changeset
646 case 20:
Ritor1
parents:
diff changeset
647 case 23:
Ritor1
parents:
diff changeset
648 default:
Ritor1
parents:
diff changeset
649 pSex = SEX_MALE;
Ritor1
parents:
diff changeset
650 break;
Ritor1
parents:
diff changeset
651 case 4:
Ritor1
parents:
diff changeset
652 case 5:
Ritor1
parents:
diff changeset
653 case 6:
Ritor1
parents:
diff changeset
654 case 7:
Ritor1
parents:
diff changeset
655 case 10:
Ritor1
parents:
diff changeset
656 case 11:
Ritor1
parents:
diff changeset
657 case 14:
Ritor1
parents:
diff changeset
658 case 15:
Ritor1
parents:
diff changeset
659 case 18:
Ritor1
parents:
diff changeset
660 case 19:
Ritor1
parents:
diff changeset
661 case 21:
Ritor1
parents:
diff changeset
662 case 24:
Ritor1
parents:
diff changeset
663 pSex = SEX_FEMALE;
Ritor1
parents:
diff changeset
664 break;
Ritor1
parents:
diff changeset
665 }
Ritor1
parents:
diff changeset
666 pPlayers[0].uSex = pSex;
Ritor1
parents:
diff changeset
667 pPlayers[0].RandomizeName();
Ritor1
parents:
diff changeset
668 strcpy(pPlayers[0].pName, pGlobalTXT_LocalizationStrings[509]);
Ritor1
parents:
diff changeset
669
Ritor1
parents:
diff changeset
670
1014
a704435d3285 comtinue player cleaning
Gloval
parents: 937
diff changeset
671 pPlayers[1].uCurrentFace = 3;
a704435d3285 comtinue player cleaning
Gloval
parents: 937
diff changeset
672 pPlayers[1].uPrevVoiceID = 3;
0
Ritor1
parents:
diff changeset
673 pPlayers[1].uVoiceID = 3;
Ritor1
parents:
diff changeset
674 pPlayers[1].SetInitialStats();
Ritor1
parents:
diff changeset
675 v7 = SEX_MALE;
Ritor1
parents:
diff changeset
676 switch (pPlayers[1].uVoiceID)
Ritor1
parents:
diff changeset
677 {
Ritor1
parents:
diff changeset
678 case 0:
Ritor1
parents:
diff changeset
679 case 1:
Ritor1
parents:
diff changeset
680 case 2:
Ritor1
parents:
diff changeset
681 case 3:
Ritor1
parents:
diff changeset
682 case 8:
Ritor1
parents:
diff changeset
683 case 9:
Ritor1
parents:
diff changeset
684 case 0xCu:
Ritor1
parents:
diff changeset
685 case 0xDu:
Ritor1
parents:
diff changeset
686 case 0x10u:
Ritor1
parents:
diff changeset
687 case 0x11u:
Ritor1
parents:
diff changeset
688 case 0x14u:
Ritor1
parents:
diff changeset
689 case 0x17u:
Ritor1
parents:
diff changeset
690 v7 = SEX_MALE;
Ritor1
parents:
diff changeset
691 break;
Ritor1
parents:
diff changeset
692 case 4:
Ritor1
parents:
diff changeset
693 case 5:
Ritor1
parents:
diff changeset
694 case 6:
Ritor1
parents:
diff changeset
695 case 7:
Ritor1
parents:
diff changeset
696 case 0xAu:
Ritor1
parents:
diff changeset
697 case 0xBu:
Ritor1
parents:
diff changeset
698 case 0xEu:
Ritor1
parents:
diff changeset
699 case 0xFu:
Ritor1
parents:
diff changeset
700 case 0x12u:
Ritor1
parents:
diff changeset
701 case 0x13u:
Ritor1
parents:
diff changeset
702 case 0x15u:
Ritor1
parents:
diff changeset
703 case 0x18u:
Ritor1
parents:
diff changeset
704 v7 = SEX_FEMALE;
Ritor1
parents:
diff changeset
705 break;
Ritor1
parents:
diff changeset
706 default:
Ritor1
parents:
diff changeset
707 break;
Ritor1
parents:
diff changeset
708 }
Ritor1
parents:
diff changeset
709 pPlayers[1].uSex = v7;
Ritor1
parents:
diff changeset
710 pPlayers[1].RandomizeName();
Ritor1
parents:
diff changeset
711 strcpy(pPlayers[1].pName, pGlobalTXT_LocalizationStrings[506]);
1014
a704435d3285 comtinue player cleaning
Gloval
parents: 937
diff changeset
712 pPlayers[2].uCurrentFace = 14;
a704435d3285 comtinue player cleaning
Gloval
parents: 937
diff changeset
713 pPlayers[2].uPrevVoiceID = 14;
0
Ritor1
parents:
diff changeset
714 pPlayers[2].uVoiceID = 14;
Ritor1
parents:
diff changeset
715 pPlayers[2].SetInitialStats();
Ritor1
parents:
diff changeset
716 v8 = SEX_MALE;
Ritor1
parents:
diff changeset
717 switch (pPlayers[2].uVoiceID)
Ritor1
parents:
diff changeset
718 {
Ritor1
parents:
diff changeset
719 case 0:
Ritor1
parents:
diff changeset
720 case 1:
Ritor1
parents:
diff changeset
721 case 2:
Ritor1
parents:
diff changeset
722 case 3:
Ritor1
parents:
diff changeset
723 case 8:
Ritor1
parents:
diff changeset
724 case 9:
Ritor1
parents:
diff changeset
725 case 0xCu:
Ritor1
parents:
diff changeset
726 case 0xDu:
Ritor1
parents:
diff changeset
727 case 0x10u:
Ritor1
parents:
diff changeset
728 case 0x11u:
Ritor1
parents:
diff changeset
729 case 0x14u:
Ritor1
parents:
diff changeset
730 case 0x17u:
Ritor1
parents:
diff changeset
731 v8 = SEX_MALE;
Ritor1
parents:
diff changeset
732 break;
Ritor1
parents:
diff changeset
733 case 4:
Ritor1
parents:
diff changeset
734 case 5:
Ritor1
parents:
diff changeset
735 case 6:
Ritor1
parents:
diff changeset
736 case 7:
Ritor1
parents:
diff changeset
737 case 0xAu:
Ritor1
parents:
diff changeset
738 case 0xBu:
Ritor1
parents:
diff changeset
739 case 0xEu:
Ritor1
parents:
diff changeset
740 case 0xFu:
Ritor1
parents:
diff changeset
741 case 0x12u:
Ritor1
parents:
diff changeset
742 case 0x13u:
Ritor1
parents:
diff changeset
743 case 0x15u:
Ritor1
parents:
diff changeset
744 case 0x18u:
Ritor1
parents:
diff changeset
745 v8 = SEX_FEMALE;
Ritor1
parents:
diff changeset
746 break;
Ritor1
parents:
diff changeset
747 default:
Ritor1
parents:
diff changeset
748 break;
Ritor1
parents:
diff changeset
749 }
Ritor1
parents:
diff changeset
750 pPlayers[2].uSex = v8;
Ritor1
parents:
diff changeset
751 pPlayers[2].RandomizeName();
Ritor1
parents:
diff changeset
752 strcpy(pPlayers[2].pName, pGlobalTXT_LocalizationStrings[508]);
1014
a704435d3285 comtinue player cleaning
Gloval
parents: 937
diff changeset
753 pPlayers[3].uCurrentFace = 10;
a704435d3285 comtinue player cleaning
Gloval
parents: 937
diff changeset
754 pPlayers[3].uPrevVoiceID = 10;
0
Ritor1
parents:
diff changeset
755 pPlayers[3].uVoiceID = 10;
Ritor1
parents:
diff changeset
756 pPlayers[3].SetInitialStats();
Ritor1
parents:
diff changeset
757 v9 = SEX_MALE;
Ritor1
parents:
diff changeset
758 switch (pPlayers[3].uVoiceID)
Ritor1
parents:
diff changeset
759 {
Ritor1
parents:
diff changeset
760 case 0u:
Ritor1
parents:
diff changeset
761 case 1u:
Ritor1
parents:
diff changeset
762 case 2u:
Ritor1
parents:
diff changeset
763 case 3u:
Ritor1
parents:
diff changeset
764 case 8u:
Ritor1
parents:
diff changeset
765 case 9u:
Ritor1
parents:
diff changeset
766 case 0xCu:
Ritor1
parents:
diff changeset
767 case 0xDu:
Ritor1
parents:
diff changeset
768 case 0x10u:
Ritor1
parents:
diff changeset
769 case 0x11u:
Ritor1
parents:
diff changeset
770 case 0x14u:
Ritor1
parents:
diff changeset
771 case 0x17u:
Ritor1
parents:
diff changeset
772 v9 = SEX_MALE;
Ritor1
parents:
diff changeset
773 break;
Ritor1
parents:
diff changeset
774 case 4u:
Ritor1
parents:
diff changeset
775 case 5u:
Ritor1
parents:
diff changeset
776 case 6u:
Ritor1
parents:
diff changeset
777 case 7u:
Ritor1
parents:
diff changeset
778 case 0xAu:
Ritor1
parents:
diff changeset
779 case 0xBu:
Ritor1
parents:
diff changeset
780 case 0xEu:
Ritor1
parents:
diff changeset
781 case 0xFu:
Ritor1
parents:
diff changeset
782 case 0x12u:
Ritor1
parents:
diff changeset
783 case 0x13u:
Ritor1
parents:
diff changeset
784 case 0x15u:
Ritor1
parents:
diff changeset
785 case 0x18u:
Ritor1
parents:
diff changeset
786 v9 = SEX_FEMALE;
Ritor1
parents:
diff changeset
787 break;
Ritor1
parents:
diff changeset
788 default:
Ritor1
parents:
diff changeset
789 break;
Ritor1
parents:
diff changeset
790 }
Ritor1
parents:
diff changeset
791 pPlayers[3].uSex = v9;
Ritor1
parents:
diff changeset
792 pPlayers[3].RandomizeName();
Ritor1
parents:
diff changeset
793 strcpy(pPlayers[3].pName, pGlobalTXT_LocalizationStrings[507]);
Ritor1
parents:
diff changeset
794
Ritor1
parents:
diff changeset
795
Ritor1
parents:
diff changeset
796
Ritor1
parents:
diff changeset
797 for (uint i = 0; i < 4; ++i)
Ritor1
parents:
diff changeset
798 {
Ritor1
parents:
diff changeset
799 pPlayers[i].uTimeToRecovery = 0;
Ritor1
parents:
diff changeset
800 for (uint j = 0; j < 20; ++j)
Ritor1
parents:
diff changeset
801 pPlayers[i].pConditions[j] = 0;
Ritor1
parents:
diff changeset
802
Ritor1
parents:
diff changeset
803 for (uint j = 0; j < 24; ++j)
Ritor1
parents:
diff changeset
804 pPlayers[i].pPlayerBuffs[j].Reset();
Ritor1
parents:
diff changeset
805
130
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
806 pPlayers[i].expression = CHARACTER_EXPRESSION_1;
0
Ritor1
parents:
diff changeset
807 pPlayers[i].uExpressionTimePassed = 0;
Ritor1
parents:
diff changeset
808 pPlayers[i].uExpressionTimeLength = rand() % 256 + 128;
Ritor1
parents:
diff changeset
809 }
Ritor1
parents:
diff changeset
810
Ritor1
parents:
diff changeset
811 for (uint i = 1; i < 20; ++i)
Ritor1
parents:
diff changeset
812 pPartyBuffs[i].Reset();
Ritor1
parents:
diff changeset
813
Ritor1
parents:
diff changeset
814
1035
306ec23b37df 004C1EE5 & other stuff
Nomad
parents: 1014
diff changeset
815 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 100; // default character ui - stats
0
Ritor1
parents:
diff changeset
816 uFlags = 0;
1310
0665a061132b autonotes and quest tables overflow fixed
Gloval
parents: 1297
diff changeset
817 memset(_autonote_bits, 0, 26);
484
4bd56919f075 avard quest guild bits
Gloval
parents: 439
diff changeset
818 memset(_quest_bits, 0, 64);
598
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 566
diff changeset
819 memset(pIsArtifactFound, 0, 29);
1035
306ec23b37df 004C1EE5 & other stuff
Nomad
parents: 1014
diff changeset
820 _449B7E_toggle_bit(_quest_bits, PARTY_QUEST_EMERALD_RED_POTION_ACTIVE, 1);
306ec23b37df 004C1EE5 & other stuff
Nomad
parents: 1014
diff changeset
821 _449B7E_toggle_bit(_quest_bits, PARTY_QUEST_EMERALD_SEASHELL_ACTIVE, 1);
306ec23b37df 004C1EE5 & other stuff
Nomad
parents: 1014
diff changeset
822 _449B7E_toggle_bit(_quest_bits, PARTY_QUEST_EMERALD_LONGBOW_ACTIVE, 1);
306ec23b37df 004C1EE5 & other stuff
Nomad
parents: 1014
diff changeset
823 _449B7E_toggle_bit(_quest_bits, PARTY_QUEST_EMERALD_PLATE_ACTIVE, 1);
306ec23b37df 004C1EE5 & other stuff
Nomad
parents: 1014
diff changeset
824 _449B7E_toggle_bit(_quest_bits, PARTY_QUEST_EMERALD_LUTE_ACTIVE, 1);
306ec23b37df 004C1EE5 & other stuff
Nomad
parents: 1014
diff changeset
825 _449B7E_toggle_bit(_quest_bits, PARTY_QUEST_EMERALD_HAT_ACTIVE, 1);
0
Ritor1
parents:
diff changeset
826
487
d5da524ec901 shop entering fixed
Gloval
parents: 484
diff changeset
827 memset(field_3C._shop_ban_times,0,53*sizeof(__int64));
0
Ritor1
parents:
diff changeset
828
Ritor1
parents:
diff changeset
829 memcpy(pNPCStats->pNewNPCData, pNPCStats->pNPCData, 0x94BCu);
Ritor1
parents:
diff changeset
830 memcpy(pNPCStats->pGroups_copy, pNPCStats->pGroups, 0x66u);
655
6a2d29c21d09 Margaret disappear fixed
zipi
parents: 599
diff changeset
831 pNPCStats->pNewNPCData[3].uFlags |= 128;//|= 0x80u; Lady Margaret
0
Ritor1
parents:
diff changeset
832 _494035_timed_effects__water_walking_damage__etc();
Ritor1
parents:
diff changeset
833 pEventTimer->Pause();
Ritor1
parents:
diff changeset
834 return 0;
Ritor1
parents:
diff changeset
835 }
Ritor1
parents:
diff changeset
836
Ritor1
parents:
diff changeset
837
Ritor1
parents:
diff changeset
838 //----- (0043AD34) --------------------------------------------------------
Ritor1
parents:
diff changeset
839 void Party::Yell()
Ritor1
parents:
diff changeset
840 {
90
d61f6bc04bf2 more pointer fixes
zipi
parents: 89
diff changeset
841 Actor *v0; // esi@5
0
Ritor1
parents:
diff changeset
842 int v1; // edi@9
Ritor1
parents:
diff changeset
843 int v2; // ebx@9
Ritor1
parents:
diff changeset
844 int v3; // eax@9
Ritor1
parents:
diff changeset
845 unsigned int v4; // [sp+8h] [bp-4h]@4
Ritor1
parents:
diff changeset
846
1167
15ad868d972f pPartyBuffs - change plain numbers to enums
Grumpy7
parents: 1165
diff changeset
847 if ( (signed __int64)pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].uExpireTime > 0 )
15ad868d972f pPartyBuffs - change plain numbers to enums
Grumpy7
parents: 1165
diff changeset
848 pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].Reset();
0
Ritor1
parents:
diff changeset
849 if ( pParty->bTurnBasedModeOn != 1 )
Ritor1
parents:
diff changeset
850 {
Ritor1
parents:
diff changeset
851 v4 = 0;
Ritor1
parents:
diff changeset
852 if ( (signed int)uNumActors > 0 )
Ritor1
parents:
diff changeset
853 {
1202
0dbf6c4dd029 arrays to std::arrays phase 1
Grumpy7
parents: 1167
diff changeset
854 v0 = pActors.data();//[0].pMonsterInfo.uMovementType;
0
Ritor1
parents:
diff changeset
855 do
Ritor1
parents:
diff changeset
856 {
1035
306ec23b37df 004C1EE5 & other stuff
Nomad
parents: 1014
diff changeset
857 if ( v0->Actor::CanAct() && v0->pMonsterInfo.uHostilityType != MonsterInfo::Hostility_Long && v0->pMonsterInfo.uMovementType != 5 )
0
Ritor1
parents:
diff changeset
858 {
90
d61f6bc04bf2 more pointer fixes
zipi
parents: 89
diff changeset
859 v1 = abs(v0->vPosition.x - pParty->vPosition.x);
d61f6bc04bf2 more pointer fixes
zipi
parents: 89
diff changeset
860 v2 = abs(v0->vPosition.y - pParty->vPosition.y);
d61f6bc04bf2 more pointer fixes
zipi
parents: 89
diff changeset
861 v3 = abs(v0->vPosition.z - pParty->vPosition.z);
322
ce39b96acf5c Killing friendly peasants subs
Nomad
parents: 321
diff changeset
862 if (int_get_vector_length(v1, v2, v3) < 512)
1060
b79139c3b5c8 some AI cleaning
zipi
parents: 1035
diff changeset
863 Actor::AI_Flee(v4, 4, 0, 0);
0
Ritor1
parents:
diff changeset
864 }
Ritor1
parents:
diff changeset
865 ++v4;
90
d61f6bc04bf2 more pointer fixes
zipi
parents: 89
diff changeset
866 ++v0;
0
Ritor1
parents:
diff changeset
867 }
Ritor1
parents:
diff changeset
868 while ( (signed int)v4 < (signed int)uNumActors );
Ritor1
parents:
diff changeset
869 }
Ritor1
parents:
diff changeset
870 }
Ritor1
parents:
diff changeset
871 }
Ritor1
parents:
diff changeset
872
Ritor1
parents:
diff changeset
873 //----- (00491BF9) --------------------------------------------------------
Ritor1
parents:
diff changeset
874 void Party::ResetPosMiscAndSpellBuffs()
Ritor1
parents:
diff changeset
875 {
Ritor1
parents:
diff changeset
876 Party *v1; // esi@1
89
98cd93e14777 pointer fixes
zipi
parents: 83
diff changeset
877 Player *v2; // edi@1
0
Ritor1
parents:
diff changeset
878 SpellBuff *v3; // ebx@2
Ritor1
parents:
diff changeset
879 SpellBuff *v4; // esi@5
Ritor1
parents:
diff changeset
880 signed int v5; // edi@5
Ritor1
parents:
diff changeset
881 signed int v6; // [sp+8h] [bp-8h]@1
Ritor1
parents:
diff changeset
882 signed int v7; // [sp+Ch] [bp-4h]@2
Ritor1
parents:
diff changeset
883
Ritor1
parents:
diff changeset
884 v1 = this;
Ritor1
parents:
diff changeset
885 this->vPosition.y = 0;
Ritor1
parents:
diff changeset
886 this->vPosition.z = 0;
Ritor1
parents:
diff changeset
887 this->vPosition.x = 0;
Ritor1
parents:
diff changeset
888 this->uFallStartY = 0;
Ritor1
parents:
diff changeset
889 this->sRotationY = 0;
Ritor1
parents:
diff changeset
890 this->sRotationX = 0;
Ritor1
parents:
diff changeset
891 this->uFallSpeed = 0;
Ritor1
parents:
diff changeset
892 this->field_28 = 0;
Ritor1
parents:
diff changeset
893 this->uDefaultPartyHeight = 120;
Ritor1
parents:
diff changeset
894 this->field_14 = 37;
120
fe0e317c0de0 Camera rotation fixed. Sorta
Nomad
parents: 109
diff changeset
895 this->y_rotation_granularity = 25;
0
Ritor1
parents:
diff changeset
896 this->uWalkSpeed = 384;
122
48bea61a12a5 Camera rotation fixed (even more!)
Nomad
parents: 120
diff changeset
897 this->y_rotation_speed = 90;
0
Ritor1
parents:
diff changeset
898 this->field_24 = 5;
Ritor1
parents:
diff changeset
899 this->field_6FC = 0;
Ritor1
parents:
diff changeset
900 this->field_708 = 15;
Ritor1
parents:
diff changeset
901 this->field_0 = 25;
89
98cd93e14777 pointer fixes
zipi
parents: 83
diff changeset
902 v2 = this->pPlayers;//[0].pPlayerBuffs;
0
Ritor1
parents:
diff changeset
903 v6 = 4;
Ritor1
parents:
diff changeset
904 do
Ritor1
parents:
diff changeset
905 {
89
98cd93e14777 pointer fixes
zipi
parents: 83
diff changeset
906 v3 = v2->pPlayerBuffs;
0
Ritor1
parents:
diff changeset
907 v7 = 24;
Ritor1
parents:
diff changeset
908 do
Ritor1
parents:
diff changeset
909 {
Ritor1
parents:
diff changeset
910 v3->Reset();
Ritor1
parents:
diff changeset
911 ++v3;
Ritor1
parents:
diff changeset
912 --v7;
Ritor1
parents:
diff changeset
913 }
Ritor1
parents:
diff changeset
914 while ( v7 );
89
98cd93e14777 pointer fixes
zipi
parents: 83
diff changeset
915 ++v2;
0
Ritor1
parents:
diff changeset
916 --v6;
Ritor1
parents:
diff changeset
917 }
Ritor1
parents:
diff changeset
918 while ( v6 );
Ritor1
parents:
diff changeset
919 v4 = v1->pPartyBuffs;
Ritor1
parents:
diff changeset
920 v5 = 20;
Ritor1
parents:
diff changeset
921 do
Ritor1
parents:
diff changeset
922 {
Ritor1
parents:
diff changeset
923 v4->Reset();
Ritor1
parents:
diff changeset
924 ++v4;
Ritor1
parents:
diff changeset
925 --v5;
Ritor1
parents:
diff changeset
926 }
Ritor1
parents:
diff changeset
927 while ( v5 );
Ritor1
parents:
diff changeset
928 }
Ritor1
parents:
diff changeset
929
Ritor1
parents:
diff changeset
930 //----- (004909F4) --------------------------------------------------------
130
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
931 void Party::UpdatePlayersAndHirelingsEmotions()
0
Ritor1
parents:
diff changeset
932 {
130
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
933 //Player *v1; // esi@2
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
934 //unsigned int v2; // eax@3
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
935 //__int16 v3; // cx@5
0
Ritor1
parents:
diff changeset
936 int v4; // edx@27
130
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
937 //signed int v5; // eax@52
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
938 //PlayerFrame *v6; // edx@53
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
939 //NPCData *v7; // esi@60
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
940 //signed int v8; // ebp@61
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
941 //int v9; // ebx@62
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
942 //unsigned int v10; // edi@62
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
943 //signed int v11; // [sp+0h] [bp-4h]@2
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
944
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
945 //v1 = this->pPlayers;//(char *)&this->pPlayers[0].uExpressionID;
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
946 for (int i = 0; i < 4; ++i)
0
Ritor1
parents:
diff changeset
947 {
130
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
948 auto player = pPlayers + i;
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
949 player->uExpressionTimePassed += (unsigned short)pMiscTimer->uTimeElapsed;
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
950
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
951
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
952 auto condition = player->GetMajorConditionIdx();
1361
b3ac17fd12de Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents: 1359
diff changeset
953 if (condition == Condition_Good || condition == Condition_Zombie)
0
Ritor1
parents:
diff changeset
954 {
130
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
955 if (player->uExpressionTimePassed < player->uExpressionTimeLength)
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
956 continue;
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
957
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
958 player->uExpressionTimePassed = 0;
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
959 if (player->expression != 1 || rand() % 5)
0
Ritor1
parents:
diff changeset
960 {
130
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
961 player->expression = CHARACTER_EXPRESSION_1;
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
962 player->uExpressionTimeLength = rand() % 256 + 32;
0
Ritor1
parents:
diff changeset
963 }
Ritor1
parents:
diff changeset
964 else
Ritor1
parents:
diff changeset
965 {
130
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
966 v4 = rand() % 100;
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
967 if (v4 < 25) player->expression = CHARACTER_EXPRESSION_13;
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
968 else if (v4 < 31) player->expression = CHARACTER_EXPRESSION_14;
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
969 else if (v4 < 37) player->expression = CHARACTER_EXPRESSION_15;
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
970 else if (v4 < 43) player->expression = CHARACTER_EXPRESSION_16;
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
971 else if (v4 < 46) player->expression = CHARACTER_EXPRESSION_17;
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
972 else if (v4 < 52) player->expression = CHARACTER_EXPRESSION_18;
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
973 else if (v4 < 58) player->expression = CHARACTER_EXPRESSION_19;
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
974 else if (v4 < 64) player->expression = CHARACTER_EXPRESSION_20;
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
975 else if (v4 < 70) player->expression = CHARACTER_EXPRESSION_54;
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
976 else if (v4 < 76) player->expression = CHARACTER_EXPRESSION_55;
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
977 else if (v4 < 82) player->expression = CHARACTER_EXPRESSION_56;
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
978 else if (v4 < 88) player->expression = CHARACTER_EXPRESSION_57;
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
979 else if (v4 < 94) player->expression = CHARACTER_EXPRESSION_29;
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
980 else player->expression = CHARACTER_EXPRESSION_30;
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
981 }
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
982
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
983 for (int j = 0; j < pPlayerFrameTable->uNumFrames; ++j)
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
984 {
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
985 auto frame = pPlayerFrameTable->pFrames + j;
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
986 if (frame->expression == player->expression)
0
Ritor1
parents:
diff changeset
987 {
130
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
988 player->uExpressionTimeLength = 8 * pPlayerFrameTable->pFrames[j].uAnimLength;
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
989 break;
0
Ritor1
parents:
diff changeset
990 }
Ritor1
parents:
diff changeset
991 }
Ritor1
parents:
diff changeset
992 }
130
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
993 else if (player->expression != 34 &&
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
994 player->expression != 35 &&
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
995 player->expression != 36 ||
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
996 player->uExpressionTimePassed >= player->uExpressionTimeLength)
0
Ritor1
parents:
diff changeset
997 {
130
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
998 player->uExpressionTimeLength = 0;
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
999 player->uExpressionTimePassed = 0;
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
1000
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
1001 switch (condition)
0
Ritor1
parents:
diff changeset
1002 {
1361
b3ac17fd12de Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents: 1359
diff changeset
1003 case Condition_Dead: player->expression = CHARACTER_EXPRESSION_DEAD; break;
b3ac17fd12de Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents: 1359
diff changeset
1004 case Condition_Pertified: player->expression = CHARACTER_EXPRESSION_PERTIFIED; break;
b3ac17fd12de Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents: 1359
diff changeset
1005 case Condition_Eradicated: player->expression = CHARACTER_EXPRESSION_ERADICATED; break;
b3ac17fd12de Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents: 1359
diff changeset
1006 case Condition_Cursed: player->expression = CHARACTER_EXPRESSION_CURSED; break;
b3ac17fd12de Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents: 1359
diff changeset
1007 case Condition_Weak: player->expression = CHARACTER_EXPRESSION_WEAK; break;
b3ac17fd12de Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents: 1359
diff changeset
1008 case Condition_Sleep: player->expression = CHARACTER_EXPRESSION_SLEEP; break;
b3ac17fd12de Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents: 1359
diff changeset
1009 case Condition_Fear: player->expression = CHARACTER_EXPRESSION_FEAR; break;
b3ac17fd12de Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents: 1359
diff changeset
1010 case Condition_Drunk: player->expression = CHARACTER_EXPRESSION_DRUNK; break;
b3ac17fd12de Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents: 1359
diff changeset
1011 case Condition_Insane: player->expression = CHARACTER_EXPRESSION_INSANE; break;
b3ac17fd12de Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents: 1359
diff changeset
1012 case Condition_Poison1:
b3ac17fd12de Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents: 1359
diff changeset
1013 case Condition_Poison2:
b3ac17fd12de Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents: 1359
diff changeset
1014 case Condition_Poison3: player->expression = CHARACTER_EXPRESSION_POISONED; break;
b3ac17fd12de Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents: 1359
diff changeset
1015 case Condition_Disease1:
b3ac17fd12de Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents: 1359
diff changeset
1016 case Condition_Disease2:
b3ac17fd12de Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents: 1359
diff changeset
1017 case Condition_Disease3: player->expression = CHARACTER_EXPRESSION_DISEASED; break;
b3ac17fd12de Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents: 1359
diff changeset
1018 case Condition_Paralyzed: player->expression = CHARACTER_EXPRESSION_PARALYZED; break;
b3ac17fd12de Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents: 1359
diff changeset
1019 case Condition_Unconcious: player->expression = CHARACTER_EXPRESSION_UNCONCIOUS; break;
130
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
1020 default:
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
1021 assert(false);
0
Ritor1
parents:
diff changeset
1022 }
Ritor1
parents:
diff changeset
1023 }
130
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
1024 }
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
1025
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
1026
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
1027 for (int i = 0; i < 2; ++i)
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
1028 {
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
1029 auto hireling = pParty->pHirelings + i;
291
0ea5fbd16edb NPC mostly done
Gloval
parents: 201
diff changeset
1030 if (!hireling->evt_C)
130
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
1031 continue;
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
1032
291
0ea5fbd16edb NPC mostly done
Gloval
parents: 201
diff changeset
1033 hireling->evt_B += pMiscTimer->uTimeElapsed;
0ea5fbd16edb NPC mostly done
Gloval
parents: 201
diff changeset
1034 if (hireling->evt_B >= hireling->evt_C)
130
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
1035 {
291
0ea5fbd16edb NPC mostly done
Gloval
parents: 201
diff changeset
1036 hireling->evt_A = 0;
0ea5fbd16edb NPC mostly done
Gloval
parents: 201
diff changeset
1037 hireling->evt_B = 0;
0ea5fbd16edb NPC mostly done
Gloval
parents: 201
diff changeset
1038 hireling->evt_C = 0;
130
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
1039
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
1040 assert(sizeof(NPCData) == 0x4C);
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
1041 memset(hireling, 0, sizeof(*hireling));
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
1042
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
1043 pParty->field_709 = 0;
1035
306ec23b37df 004C1EE5 & other stuff
Nomad
parents: 1014
diff changeset
1044 pParty->CountHirelings();
306ec23b37df 004C1EE5 & other stuff
Nomad
parents: 1014
diff changeset
1045 viewparams->bRedrawGameUI = true;
130
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
1046 }
0
Ritor1
parents:
diff changeset
1047 }
Ritor1
parents:
diff changeset
1048 }
Ritor1
parents:
diff changeset
1049
Ritor1
parents:
diff changeset
1050 //----- (00490D02) --------------------------------------------------------
Ritor1
parents:
diff changeset
1051 void Party::RestAndHeal()
Ritor1
parents:
diff changeset
1052 {
910
Ritor1
parents: 860
diff changeset
1053 Player *pPlayer; // esi@4
83
be45fc285970 random fixes
zipi
parents: 82
diff changeset
1054 ItemGen *v7; // eax@10
0
Ritor1
parents:
diff changeset
1055 signed int v11; // ecx@26
Ritor1
parents:
diff changeset
1056 signed int v12; // [sp-4h] [bp-1Ch]@26
910
Ritor1
parents: 860
diff changeset
1057 bool have_vessels_soul; // [sp+10h] [bp-8h]@10
0
Ritor1
parents:
diff changeset
1058
910
Ritor1
parents: 860
diff changeset
1059 /* v1 = pParty->pPartyBuffs;
0
Ritor1
parents:
diff changeset
1060 do
Ritor1
parents:
diff changeset
1061 {
Ritor1
parents:
diff changeset
1062 v1->Reset();
Ritor1
parents:
diff changeset
1063 ++v1;
Ritor1
parents:
diff changeset
1064 }
Ritor1
parents:
diff changeset
1065 while ( (signed int)v1 < (signed int)pParty->pPlayers );
Ritor1
parents:
diff changeset
1066 v15 = 0;
Ritor1
parents:
diff changeset
1067 do
Ritor1
parents:
diff changeset
1068 {
910
Ritor1
parents: 860
diff changeset
1069 pPlayer = &pParty->pPlayers[v15];
0
Ritor1
parents:
diff changeset
1070 v3 = 20;
910
Ritor1
parents: 860
diff changeset
1071 v4 = pPlayer->pPlayerBuffs;
0
Ritor1
parents:
diff changeset
1072 do
Ritor1
parents:
diff changeset
1073 {
Ritor1
parents:
diff changeset
1074 v4->Reset();
Ritor1
parents:
diff changeset
1075 ++v4;
Ritor1
parents:
diff changeset
1076 --v3;
Ritor1
parents:
diff changeset
1077 }
910
Ritor1
parents: 860
diff changeset
1078 while ( v3 );*/
Ritor1
parents: 860
diff changeset
1079 for ( uint i = 0; i < 20; ++i )
Ritor1
parents: 860
diff changeset
1080 pParty->pPartyBuffs[i].Reset();
Ritor1
parents: 860
diff changeset
1081 for ( int pPlayerID = 0; pPlayerID < 4; ++pPlayerID )
Ritor1
parents: 860
diff changeset
1082 {
Ritor1
parents: 860
diff changeset
1083 pPlayer = &pParty->pPlayers[pPlayerID];
Ritor1
parents: 860
diff changeset
1084 for ( uint i = 0; i < 20; ++i )
Ritor1
parents: 860
diff changeset
1085 pPlayer->pPlayerBuffs[i].Reset();
Ritor1
parents: 860
diff changeset
1086
Ritor1
parents: 860
diff changeset
1087 pPlayer->Zero();
Ritor1
parents: 860
diff changeset
1088 if ( pPlayer->pConditions[14] || pPlayer->pConditions[15] || pPlayer->pConditions[16] )//Dead/Petrified/Eradicated
Ritor1
parents: 860
diff changeset
1089 continue;
Ritor1
parents: 860
diff changeset
1090 pPlayer->pConditions[13] = 0;//Unconcious
Ritor1
parents: 860
diff changeset
1091 pPlayer->pConditions[4] = 0;//Drunk
Ritor1
parents: 860
diff changeset
1092 pPlayer->pConditions[3] = 0;//Fear
Ritor1
parents: 860
diff changeset
1093 pPlayer->pConditions[2] = 0;//Sleep
Ritor1
parents: 860
diff changeset
1094 pPlayer->pConditions[1] = 0;//Weak
Ritor1
parents: 860
diff changeset
1095 pPlayer->uTimeToRecovery = 0;
Ritor1
parents: 860
diff changeset
1096 pPlayer->sHealth = pPlayer->GetMaxHealth();
Ritor1
parents: 860
diff changeset
1097 pPlayer->sMana = pPlayer->GetMaxMana();
Ritor1
parents: 860
diff changeset
1098 if ( pPlayer->classType == PLAYER_CLASS_LICH )
0
Ritor1
parents:
diff changeset
1099 {
910
Ritor1
parents: 860
diff changeset
1100 have_vessels_soul = false;
Ritor1
parents: 860
diff changeset
1101 v7 = pPlayer->pInventoryItems;//[0].field_1A;
Ritor1
parents: 860
diff changeset
1102 for ( uint i = 138; i; --i )
0
Ritor1
parents:
diff changeset
1103 {
910
Ritor1
parents: 860
diff changeset
1104 if ( v7->uItemID == 601 && (unsigned __int8)v7->uHolderPlayer == pPlayerID + 1 )
Ritor1
parents: 860
diff changeset
1105 have_vessels_soul = true;
83
be45fc285970 random fixes
zipi
parents: 82
diff changeset
1106 ++v7;
0
Ritor1
parents:
diff changeset
1107 }
910
Ritor1
parents: 860
diff changeset
1108 if ( !have_vessels_soul )
0
Ritor1
parents:
diff changeset
1109 {
910
Ritor1
parents: 860
diff changeset
1110 pPlayer->sHealth = pPlayer->GetMaxHealth() / 2;
Ritor1
parents: 860
diff changeset
1111 pPlayer->sMana = pPlayer->GetMaxMana() / 2;
0
Ritor1
parents:
diff changeset
1112 }
Ritor1
parents:
diff changeset
1113 }
910
Ritor1
parents: 860
diff changeset
1114 if ( !pPlayer->pConditions[17] )// Zombie
0
Ritor1
parents:
diff changeset
1115 {
910
Ritor1
parents: 860
diff changeset
1116 if ( pPlayer->pConditions[10] || pPlayer->pConditions[11] )
0
Ritor1
parents:
diff changeset
1117 {
Ritor1
parents:
diff changeset
1118 v11 = 4;
Ritor1
parents:
diff changeset
1119 v12 = 4;
Ritor1
parents:
diff changeset
1120 }
Ritor1
parents:
diff changeset
1121 else
Ritor1
parents:
diff changeset
1122 {
910
Ritor1
parents: 860
diff changeset
1123 if ( !pPlayer->pConditions[8] && !pPlayer->pConditions[9] )
0
Ritor1
parents:
diff changeset
1124 {
910
Ritor1
parents: 860
diff changeset
1125 if ( !pPlayer->pConditions[6] && !pPlayer->pConditions[7] )
Ritor1
parents: 860
diff changeset
1126 {
Ritor1
parents: 860
diff changeset
1127 if ( pPlayer->pConditions[5] )
Ritor1
parents: 860
diff changeset
1128 pPlayer->sMana = 0;
Ritor1
parents: 860
diff changeset
1129 UpdatePlayersAndHirelingsEmotions();
Ritor1
parents: 860
diff changeset
1130 continue;
Ritor1
parents: 860
diff changeset
1131 }
Ritor1
parents: 860
diff changeset
1132 pPlayer->sHealth /= 2;
Ritor1
parents: 860
diff changeset
1133 pPlayer->sMana = pPlayer->sMana / 2;
Ritor1
parents: 860
diff changeset
1134 if ( pPlayer->pConditions[5] )
Ritor1
parents: 860
diff changeset
1135 pPlayer->sMana = 0;
Ritor1
parents: 860
diff changeset
1136 UpdatePlayersAndHirelingsEmotions();
Ritor1
parents: 860
diff changeset
1137 continue;
0
Ritor1
parents:
diff changeset
1138 }
Ritor1
parents:
diff changeset
1139 v11 = 3;
Ritor1
parents:
diff changeset
1140 v12 = 3;
Ritor1
parents:
diff changeset
1141 }
910
Ritor1
parents: 860
diff changeset
1142 pPlayer->sHealth /= v11;
Ritor1
parents: 860
diff changeset
1143 pPlayer->sMana = pPlayer->sMana / v12;
Ritor1
parents: 860
diff changeset
1144 if ( pPlayer->pConditions[5] )
Ritor1
parents: 860
diff changeset
1145 pPlayer->sMana = 0;
Ritor1
parents: 860
diff changeset
1146 UpdatePlayersAndHirelingsEmotions();
Ritor1
parents: 860
diff changeset
1147 continue;
0
Ritor1
parents:
diff changeset
1148 }
910
Ritor1
parents: 860
diff changeset
1149 pPlayer->sMana = 0;
Ritor1
parents: 860
diff changeset
1150 pPlayer->sHealth = pPlayer->sHealth / 2;
Ritor1
parents: 860
diff changeset
1151 if ( pPlayer->pConditions[5] )
Ritor1
parents: 860
diff changeset
1152 pPlayer->sMana = 0;
130
1c471f3629fb Party expressions update
Nomad
parents: 122
diff changeset
1153 UpdatePlayersAndHirelingsEmotions();
0
Ritor1
parents:
diff changeset
1154 }
766
a464d28566a6 days_played_without_rest
Nomad
parents: 659
diff changeset
1155 pParty->days_played_without_rest = 0;
1295
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
1156 }
1359
60cdc3eac407 _449B57_test_bit(pParty->_quest_bits, 99) and _449B57_test_bit(pParty->_quest_bits, 100) changed to Party::IsPartyGood, Party::IsPartyEvil, respectively
Grumpy7
parents: 1340
diff changeset
1157
1295
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
1158 //----- (004938D1) --------------------------------------------------------
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
1159 void __fastcall Rest(unsigned int uHoursToSleep)
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
1160 {
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
1161 unsigned int v1; // esi@1
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
1162 double v2; // st7@3
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
1163 Player **v3; // esi@3
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
1164
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
1165 v1 = uHoursToSleep;
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
1166 if ( uHoursToSleep > 240 )
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
1167 InitializeActors();
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
1168 v2 = (double)(7680 * v1) * 0.033333335;
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
1169 pParty->uTimePlayed += (signed __int64)v2;
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
1170 v3 = &pPlayers[1];
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
1171 do
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
1172 {
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
1173 (*v3)->Recover((signed __int64)v2);
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
1174 ++v3;
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
1175 }
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
1176 while ( (signed int)v3 <= (signed int)&pPlayers[4] );
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
1177 _494035_timed_effects__water_walking_damage__etc();
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
1178 }
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
1179 //----- (004B1BDB) --------------------------------------------------------
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
1180 void __stdcall RestAndHeal(__int64 uNumMinutes)
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
1181 {
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
1182 signed __int64 v1; // ST2C_8@1
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
1183 signed __int64 v2; // qax@1
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
1184 signed __int64 v3; // ST1C_8@1
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
1185 unsigned __int64 v4; // qax@1
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
1186 unsigned int v5; // ebx@1
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
1187 Player *v6; // ebx@1
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
1188
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
1189 pParty->pHirelings[0].bHasUsedTheAbility = 0;
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
1190 pParty->pHirelings[1].bHasUsedTheAbility = 0;
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
1191 pParty->uTimePlayed += (signed __int64)((double)(7680 * uNumMinutes) * 0.033333335);
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
1192 v1 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed * 0.234375);
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
1193 v2 = v1 / 60 / 60;
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
1194 v3 = v2;
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
1195 v4 = (unsigned int)v2 / 0x18;
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
1196 v5 = (unsigned int)(v4 / 7) >> 2;
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
1197 pParty->uCurrentTimeSecond = v1 % 60;
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
1198 pParty->uCurrentMinute = v1 / 60 % 60;
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
1199 pParty->uCurrentHour = v3 % 24;
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
1200 pParty->uCurrentMonthWeek = v4 / 7 & 3;
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
1201 pParty->uDaysPlayed = (unsigned int)v4 % 0x1C;
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
1202 pParty->uCurrentMonth = v5 % 0xC;
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
1203 pParty->uCurrentYear = v5 / 0xC + game_starting_year;
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
1204 pParty->RestAndHeal();
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
1205 dword_507B94 = 1;
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
1206 v6 = pParty->pPlayers;//[0].uNumDivineInterventionCastsThisDay;
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
1207 do
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
1208 {
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
1209 v6->uTimeToRecovery = 0;
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
1210 memset(&v6->uTimeToRecovery, 0, 4u);
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
1211 ++v6;
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
1212 }
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
1213 while ( v6 <= &pParty->pPlayers[3] );
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
1214 pParty->UpdatePlayersAndHirelingsEmotions();
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
1215 }
1297
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1216 //----- (0041F5BE) --------------------------------------------------------
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1217 void __cdecl Sleep6Hours()
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1218 {
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1219 if ( _506F18_num_hours_to_sleep < 6 )
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1220 {
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1221 pParty->pPlayers[3].SetAsleep(false);
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1222 pParty->pPlayers[2].SetAsleep(false);
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1223 pParty->pPlayers[1].SetAsleep(false);
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1224 pParty->pPlayers[0].SetAsleep(false);
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1225 if ( _506F18_num_hours_to_sleep )
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1226 {
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1227 Rest(_506F18_num_hours_to_sleep);
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1228 _506F18_num_hours_to_sleep = 0;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1229 LoadActualSkyFrame();
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1230 }
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1231 if ( dword_506F14 == 2 )
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1232 {
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1233 pGUIWindow_CurrentMenu->Release();
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1234 pEventTimer->Resume();
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1235 if ( pTexture_RestUI_CurrentSkyFrame )
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1236 pTexture_RestUI_CurrentSkyFrame->Release();
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1237 if ( pTexture_RestUI_CurrentHourglassFrame )
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1238 pTexture_RestUI_CurrentHourglassFrame->Release();
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1239 pTexture_RestUI_CurrentHourglassFrame = 0;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1240 pTexture_RestUI_CurrentSkyFrame = 0;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1241 pIcons_LOD->_4114F2();
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1242 pIcons_LOD->SyncLoadedFilesCount();
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1243 pCurrentScreen = SCREEN_GAME;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1244 viewparams->bRedrawGameUI = 1;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1245 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor)
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1246 {
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1247 pOutdoor->UpdateSunlightVectors();
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1248 pOutdoor->UpdateFog();
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1249 }
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1250 }
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1251 dword_506F14 = 0;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1252 }
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1253 else
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1254 {
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1255 Rest(6u);
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1256 _506F18_num_hours_to_sleep -= 6;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1257 LoadActualSkyFrame();
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1258 }
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1259 viewparams->bRedrawGameUI = 1;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1260 }
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1261
1295
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
1262 //----- (0047752B) --------------------------------------------------------
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
1263 int __cdecl GetPartyReputation()
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
1264 {
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
1265 DDM_DLV_Header *v0; // ebx@1
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
1266 signed int v1; // esi@3
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
1267
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
1268 v0 = &pOutdoor->ddm;
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
1269 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor )
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
1270 v0 = &pIndoor->dlv;
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
1271 v1 = 0;
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
1272 if ( CheckHiredNPCSpeciality(Pirate) )
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
1273 v1 += 5;
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
1274 if ( CheckHiredNPCSpeciality(Burglar) )
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
1275 v1 += 5;
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
1276 if ( CheckHiredNPCSpeciality(Gypsy) )
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
1277 v1 += 5;
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
1278 if ( CheckHiredNPCSpeciality(Duper) )
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
1279 v1 += 5;
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
1280 if ( CheckHiredNPCSpeciality(FallenWizard) )
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
1281 v1 += 5;
86a83e12d795 moving files
Ritor1
parents: 1205
diff changeset
1282 return v1 + v0->uReputation;
1296
c423f946dc99 moving files continue
Ritor1
parents: 1295
diff changeset
1283 }
c423f946dc99 moving files continue
Ritor1
parents: 1295
diff changeset
1284 //----- (004269A2) --------------------------------------------------------
c423f946dc99 moving files continue
Ritor1
parents: 1295
diff changeset
1285 void __fastcall GivePartyExp(unsigned int pEXPNum)
c423f946dc99 moving files continue
Ritor1
parents: 1295
diff changeset
1286 {
c423f946dc99 moving files continue
Ritor1
parents: 1295
diff changeset
1287 signed int pActivePlayerCount; // ecx@1
c423f946dc99 moving files continue
Ritor1
parents: 1295
diff changeset
1288 int pLearningPercent; // eax@13
c423f946dc99 moving files continue
Ritor1
parents: 1295
diff changeset
1289
c423f946dc99 moving files continue
Ritor1
parents: 1295
diff changeset
1290 pActivePlayerCount = 0;
c423f946dc99 moving files continue
Ritor1
parents: 1295
diff changeset
1291 for ( uint i = 0; i < 4; ++i )
c423f946dc99 moving files continue
Ritor1
parents: 1295
diff changeset
1292 {
c423f946dc99 moving files continue
Ritor1
parents: 1295
diff changeset
1293 if ( !pParty->pPlayers[i].pConditions[13] && !pParty->pPlayers[i].pConditions[14] && !pParty->pPlayers[i].pConditions[15] && !pParty->pPlayers[i].pConditions[16] )
c423f946dc99 moving files continue
Ritor1
parents: 1295
diff changeset
1294 pActivePlayerCount ++;
c423f946dc99 moving files continue
Ritor1
parents: 1295
diff changeset
1295 }
c423f946dc99 moving files continue
Ritor1
parents: 1295
diff changeset
1296 if ( pActivePlayerCount )
c423f946dc99 moving files continue
Ritor1
parents: 1295
diff changeset
1297 {
c423f946dc99 moving files continue
Ritor1
parents: 1295
diff changeset
1298 pEXPNum = pEXPNum / pActivePlayerCount;
c423f946dc99 moving files continue
Ritor1
parents: 1295
diff changeset
1299 for ( uint i = 0; i < 4; ++i )
c423f946dc99 moving files continue
Ritor1
parents: 1295
diff changeset
1300 {
c423f946dc99 moving files continue
Ritor1
parents: 1295
diff changeset
1301 if ( !pParty->pPlayers[i].pConditions[13] && !pParty->pPlayers[i].pConditions[14] && !pParty->pPlayers[i].pConditions[15] && !pParty->pPlayers[i].pConditions[16] )
c423f946dc99 moving files continue
Ritor1
parents: 1295
diff changeset
1302 {
c423f946dc99 moving files continue
Ritor1
parents: 1295
diff changeset
1303 if ( pEXPNum )
c423f946dc99 moving files continue
Ritor1
parents: 1295
diff changeset
1304 {
c423f946dc99 moving files continue
Ritor1
parents: 1295
diff changeset
1305 pLearningPercent = pParty->pPlayers[i].GetLearningPercent();
c423f946dc99 moving files continue
Ritor1
parents: 1295
diff changeset
1306 pEXPNum = pEXPNum + pEXPNum * pLearningPercent / 100;
c423f946dc99 moving files continue
Ritor1
parents: 1295
diff changeset
1307 pParty->pPlayers[i].uExperience += pEXPNum;
c423f946dc99 moving files continue
Ritor1
parents: 1295
diff changeset
1308 if ( pParty->pPlayers[i].uExperience > 4000000000i64 )
c423f946dc99 moving files continue
Ritor1
parents: 1295
diff changeset
1309 {
c423f946dc99 moving files continue
Ritor1
parents: 1295
diff changeset
1310 pParty->pPlayers[i].uExperience = 0;
c423f946dc99 moving files continue
Ritor1
parents: 1295
diff changeset
1311 }
c423f946dc99 moving files continue
Ritor1
parents: 1295
diff changeset
1312 }
c423f946dc99 moving files continue
Ritor1
parents: 1295
diff changeset
1313 }
c423f946dc99 moving files continue
Ritor1
parents: 1295
diff changeset
1314 }
c423f946dc99 moving files continue
Ritor1
parents: 1295
diff changeset
1315 }
c423f946dc99 moving files continue
Ritor1
parents: 1295
diff changeset
1316 }
1297
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1317 //----- (00420C05) --------------------------------------------------------
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1318 void __fastcall party_finds_gold(unsigned int uNumGold, int _1_dont_share_with_followers___2_the_same_but_without_a_message__else_normal)
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1319 {
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1320 unsigned int v2; // edi@1
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1321 int v3; // ebp@1
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1322 unsigned int v4; // esi@1
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1323 int v5; // ecx@6
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1324 NPCData *v6; // eax@6
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1325 signed int v7; // edx@8
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1326 signed int v8; // ebx@10
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1327 char *v9; // edi@11
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1328 signed int v10; // ecx@17
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1329 int v11; // eax@21
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1330 NPCData *v12; // ecx@21
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1331 unsigned int v13; // ecx@23
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1332 signed int v14; // [sp+Ch] [bp-4h]@6
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1333
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1334 v2 = 0;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1335 v3 = 0;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1336 v4 = uNumGold;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1337 if ( _1_dont_share_with_followers___2_the_same_but_without_a_message__else_normal )
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1338 {
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1339 if ( _1_dont_share_with_followers___2_the_same_but_without_a_message__else_normal == 1 )
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1340 {
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1341 sprintf(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[467], uNumGold);// You found %lu gold!
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1342 }
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1343 else
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1344 {
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1345 if ( _1_dont_share_with_followers___2_the_same_but_without_a_message__else_normal == 2 )
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1346 pTmpBuf2[0] = 0;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1347 }
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1348 }
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1349 else
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1350 {
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1351 v14 = 0;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1352 v5 = 0;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1353 v6 = pParty->pHirelings;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1354 do
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1355 {
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1356 if ( v6->pName )
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1357 {
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1358 v7 = v14++;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1359 pTmpBuf[v7] = v5;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1360 }
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1361 ++v6;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1362 ++v5;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1363 }
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1364 while ( (signed int)v6 < (signed int)&pParty->pPickedItem );
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1365 v8 = 0;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1366 if ( (signed int)pNPCStats->uNumNewNPCs > 0 )
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1367 {
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1368 v9 = (char *)pNPCStats->pNewNPCData;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1369 do
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1370 {
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1371 if ( v9[8] & 0x80
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1372 && (!pParty->pHirelings[0].pName || strcmp(*(const char **)v9, pParty->pHirelings[0].pName))
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1373 && (!pParty->pHirelings[1].pName || strcmp(*(const char **)v9, pParty->pHirelings[1].pName)) )
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1374 {
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1375 v10 = v14++;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1376 pTmpBuf[v10] = v8 + 2;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1377 }
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1378 ++v8;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1379 v9 += 76;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1380 }
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1381 while ( v8 < (signed int)pNPCStats->uNumNewNPCs );
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1382 v2 = 0;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1383 }
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1384 if ( v14 > 0 )
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1385 {
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1386 do
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1387 {
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1388 v11 = (unsigned __int8)pTmpBuf[v2];
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1389 v12 = &pNPCStats->pNPCData[v11 + 499];
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1390 if ( (unsigned __int8)pTmpBuf[v2] < 2 )
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1391 v12 = &pParty->pHirelings[v11];
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1392 v13 = v12->uProfession;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1393 if ( v13 )
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1394 v3 += pNPCStats->pProfessions[v13].uHirePrice;//*(&pNPCStats->field_13A58 + 5 * v13);
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1395 ++v2;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1396 }
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1397 while ( (signed int)v2 < v14 );
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1398 }
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1399 if ( CheckHiredNPCSpeciality(Factor) )
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1400 v4 += (signed int)(10 * v4) / 100;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1401 if ( CheckHiredNPCSpeciality(Banker) )
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1402 v4 += (signed int)(20 * v4) / 100;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1403 if ( CheckHiredNPCSpeciality(Pirate) )
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1404 v4 += (signed int)(10 * v4) / 100;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1405 if ( v3 )
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1406 {
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1407 v3 = (signed int)(v4 * v3 / 100) / 100;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1408 if ( v3 < 1 )
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1409 v3 = 1;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1410 sprintf(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[466], v4, v3);// You found %lu gold (followers take %lu)!
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1411 }
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1412 else
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1413 {
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1414 sprintf(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[467], v4);// You found %lu gold!
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1415 }
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1416 v2 = 0;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1417 }
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1418 pParty->uNumGold += v4 - v3;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1419 pUIAnim_Gold->uAnimTime = v2;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1420 pUIAnim_Gold->uAnimLength = 8 * pIconsFrameTable->pIcons[(signed __int16)pUIAnim_Gold->uIconID].uAnimLength;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1421 if ( pTmpBuf2[0] )
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1422 ShowStatusBarString(pTmpBuf2.data(), 2u);
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1423 pAudioPlayer->PlaySound(SOUND_GoldReceived, v2, v2, -1, v2, v2, v2, v2);
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1424 }
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1425 //----- (00421B2C) --------------------------------------------------------
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1426 bool __cdecl sub_421B2C_PlaceInInventory_or_DropPickedItem()
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1427 {
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1428 unsigned int v0; // eax@2
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1429 Texture *v1; // ebx@2
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1430 int v2; // eax@3
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1431 Player *v3; // esi@5
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1432 int v4; // eax@6
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1433 unsigned __int16 v5; // dx@11
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1434 signed int v6; // eax@11
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1435 char *v7; // edi@12
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1436 __int16 v8; // ax@16
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1437 SpriteObject a1; // [sp+4h] [bp-78h]@11
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1438 int v11; // [sp+74h] [bp-8h]@2
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1439 int v12; // [sp+78h] [bp-4h]@5
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1440
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1441 if ( !pParty->pPickedItem.uItemID )
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1442 return 1;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1443 v0 = pIcons_LOD->LoadTexture(
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1444 pItemsTable->pItems[pParty->pPickedItem.uItemID].pIconName,
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1445 TEXTURE_16BIT_PALETTE);
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1446 v1 = pIcons_LOD->GetTexture(v0);
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1447 v11 = areWeLoadingTexture;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1448 if ( uActiveCharacter
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1449 && (v2 = pPlayers[uActiveCharacter]->AddItem(-1, pParty->pPickedItem.uItemID)) != 0 )
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1450 {
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1451 memcpy(&pPlayers[uActiveCharacter]->pInventoryItems[v2-1], &pParty->pPickedItem, 0x24u);
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1452 pMouse->RemoveHoldingItem();
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1453 }
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1454 else
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1455 {
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1456 v12 = 0;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1457 v3 = pParty->pPlayers;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1458 while ( v3 <= &pParty->pPlayers[3] )
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1459 {
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1460 v4 = v3->AddItem(-1, pParty->pPickedItem.uItemID);
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1461 if ( v4 )
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1462 {
1364
9014784ae84f Fixing an ancient bug in sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents: 1361
diff changeset
1463 memcpy(&pParty->pPlayers[v12].pInventoryItems[v4 - 1], &pParty->pPickedItem, 0x24u);
1297
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1464 pMouse->RemoveHoldingItem();
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1465 break;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1466 }
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1467 ++v12;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1468 ++v3;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1469 }
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1470 if ( v12 == 4 )
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1471 {
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1472 v5 = pItemsTable->pItems[pParty->pPickedItem.uItemID].uSpriteID;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1473 v6 = 0;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1474 a1.uType = pItemsTable->pItems[pParty->pPickedItem.uItemID].uSpriteID;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1475 if ( (signed int)pObjectList->uNumObjects <= 0 )
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1476 {
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1477 LOWORD(v6) = 0;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1478 }
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1479 else
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1480 {
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1481 v7 = (char *)&pObjectList->pObjects->uObjectID;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1482 while ( v5 != *(short *)v7 )
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1483 {
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1484 ++v6;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1485 v7 += 56;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1486 if ( v6 >= (signed int)pObjectList->uNumObjects )
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1487 {
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1488 LOWORD(v6) = 0;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1489 break;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1490 }
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1491 }
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1492 }
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1493 a1.spell_caster_pid = OBJECT_Player;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1494 a1.uObjectDescID = v6;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1495 a1.vPosition.y = pParty->vPosition.y;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1496 a1.vPosition.x = pParty->vPosition.x;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1497 a1.vPosition.z = pParty->sEyelevel + pParty->vPosition.z;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1498 a1.uSoundID = 0;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1499 a1.uFacing = 0;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1500 a1.uAttributes = 8;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1501 v8 = pIndoor->GetSector(
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1502 pParty->vPosition.x,
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1503 pParty->vPosition.y,
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1504 pParty->sEyelevel + pParty->vPosition.z);
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1505 a1.uSpriteFrameID = 0;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1506 a1.uSectorID = v8;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1507 memcpy(&a1.stru_24, &pParty->pPickedItem, sizeof(a1.stru_24));
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1508 a1.Create(pParty->sRotationY, 184, 200, 0);
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1509 pMouse->RemoveHoldingItem();
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1510 }
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1511 }
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1512 if ( !v11 )
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1513 {
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1514 v1->Release();
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1515 pIcons_LOD->SyncLoadedFilesCount();
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1516 }
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1517 return 1;
1359
60cdc3eac407 _449B57_test_bit(pParty->_quest_bits, 99) and _449B57_test_bit(pParty->_quest_bits, 100) changed to Party::IsPartyGood, Party::IsPartyEvil, respectively
Grumpy7
parents: 1340
diff changeset
1518 }
60cdc3eac407 _449B57_test_bit(pParty->_quest_bits, 99) and _449B57_test_bit(pParty->_quest_bits, 100) changed to Party::IsPartyGood, Party::IsPartyEvil, respectively
Grumpy7
parents: 1340
diff changeset
1519
60cdc3eac407 _449B57_test_bit(pParty->_quest_bits, 99) and _449B57_test_bit(pParty->_quest_bits, 100) changed to Party::IsPartyGood, Party::IsPartyEvil, respectively
Grumpy7
parents: 1340
diff changeset
1520
60cdc3eac407 _449B57_test_bit(pParty->_quest_bits, 99) and _449B57_test_bit(pParty->_quest_bits, 100) changed to Party::IsPartyGood, Party::IsPartyEvil, respectively
Grumpy7
parents: 1340
diff changeset
1521 bool Party::IsPartyEvil()
60cdc3eac407 _449B57_test_bit(pParty->_quest_bits, 99) and _449B57_test_bit(pParty->_quest_bits, 100) changed to Party::IsPartyGood, Party::IsPartyEvil, respectively
Grumpy7
parents: 1340
diff changeset
1522 {
60cdc3eac407 _449B57_test_bit(pParty->_quest_bits, 99) and _449B57_test_bit(pParty->_quest_bits, 100) changed to Party::IsPartyGood, Party::IsPartyEvil, respectively
Grumpy7
parents: 1340
diff changeset
1523 return _449B57_test_bit(_quest_bits, 100);
60cdc3eac407 _449B57_test_bit(pParty->_quest_bits, 99) and _449B57_test_bit(pParty->_quest_bits, 100) changed to Party::IsPartyGood, Party::IsPartyEvil, respectively
Grumpy7
parents: 1340
diff changeset
1524 }
60cdc3eac407 _449B57_test_bit(pParty->_quest_bits, 99) and _449B57_test_bit(pParty->_quest_bits, 100) changed to Party::IsPartyGood, Party::IsPartyEvil, respectively
Grumpy7
parents: 1340
diff changeset
1525
60cdc3eac407 _449B57_test_bit(pParty->_quest_bits, 99) and _449B57_test_bit(pParty->_quest_bits, 100) changed to Party::IsPartyGood, Party::IsPartyEvil, respectively
Grumpy7
parents: 1340
diff changeset
1526 bool Party::IsPartyGood()
60cdc3eac407 _449B57_test_bit(pParty->_quest_bits, 99) and _449B57_test_bit(pParty->_quest_bits, 100) changed to Party::IsPartyGood, Party::IsPartyEvil, respectively
Grumpy7
parents: 1340
diff changeset
1527 {
60cdc3eac407 _449B57_test_bit(pParty->_quest_bits, 99) and _449B57_test_bit(pParty->_quest_bits, 100) changed to Party::IsPartyGood, Party::IsPartyEvil, respectively
Grumpy7
parents: 1340
diff changeset
1528 return _449B57_test_bit(_quest_bits, 99);
1297
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
1529 }