annotate mm7_4.cpp @ 2115:90cc547a7927

Fixing hireling prices
author Grumpy7
date Mon, 23 Dec 2013 15:17:50 +0100
parents 2318216e5206
children 18dee3152c52
rev   line source
1165
29a8defbad9e temporary _CRT_SECURE_NO_WARNINGS to remove some warnings
Grumpy7
parents: 1110
diff changeset
1 #ifdef _MSC_VER
29a8defbad9e temporary _CRT_SECURE_NO_WARNINGS to remove some warnings
Grumpy7
parents: 1110
diff changeset
2 #define _CRT_SECURE_NO_WARNINGS
29a8defbad9e temporary _CRT_SECURE_NO_WARNINGS to remove some warnings
Grumpy7
parents: 1110
diff changeset
3 #endif
29a8defbad9e temporary _CRT_SECURE_NO_WARNINGS to remove some warnings
Grumpy7
parents: 1110
diff changeset
4
1262
0aeac0b9ca30 included header cleanup
Grumpy7
parents: 1254
diff changeset
5 #include "Texture.h"
0aeac0b9ca30 included header cleanup
Grumpy7
parents: 1254
diff changeset
6 #include "mm7_data.h"
1016
c45d51b3f4f4 Included header files cleanup
Grumpy7
parents: 990
diff changeset
7 #include "VideoPlayer.h"
c45d51b3f4f4 Included header files cleanup
Grumpy7
parents: 990
diff changeset
8 #include "Sprites.h"
c45d51b3f4f4 Included header files cleanup
Grumpy7
parents: 990
diff changeset
9 #include "BSPModel.h"
c45d51b3f4f4 Included header files cleanup
Grumpy7
parents: 990
diff changeset
10 #include "Mouse.h"
c45d51b3f4f4 Included header files cleanup
Grumpy7
parents: 990
diff changeset
11 #include "stru6.h"
c45d51b3f4f4 Included header files cleanup
Grumpy7
parents: 990
diff changeset
12
c45d51b3f4f4 Included header files cleanup
Grumpy7
parents: 990
diff changeset
13 #include "LightmapBuilder.h"
341
a8ee15a20bea EnterHouse
Nomad
parents: 336
diff changeset
14 #include "MM7.h"
0
Ritor1
parents:
diff changeset
15 #include "MapInfo.h"
Ritor1
parents:
diff changeset
16 #include "Game.h"
Ritor1
parents:
diff changeset
17 #include "GUIWindow.h"
Ritor1
parents:
diff changeset
18 #include "GUIFont.h"
Ritor1
parents:
diff changeset
19 #include "Party.h"
Ritor1
parents:
diff changeset
20 #include "AudioPlayer.h"
Ritor1
parents:
diff changeset
21 #include "Outdoor.h"
1277
1803172dffd9 header stuff
Grumpy7
parents: 1275
diff changeset
22 #include "Outdoor_stuff.h"
0
Ritor1
parents:
diff changeset
23 #include "LOD.h"
Ritor1
parents:
diff changeset
24 #include "Actor.h"
Ritor1
parents:
diff changeset
25 #include "Events.h"
Ritor1
parents:
diff changeset
26 #include "Viewport.h"
Ritor1
parents:
diff changeset
27 #include "FrameTableInc.h"
2037
7a9477135943 Renamed Math.h -> OurMath.h (file resolution was sometimes ambiguous)
Nomad
parents: 2030
diff changeset
28 #include "OurMath.h"
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents: 510
diff changeset
29 #include "SpriteObject.h"
0
Ritor1
parents:
diff changeset
30 #include "ObjectList.h"
Ritor1
parents:
diff changeset
31 #include "DecorationList.h"
2044
28cb79ae2f6f Time.h rename
Ritor1
parents: 2043
diff changeset
32 #include "Timer.h"
0
Ritor1
parents:
diff changeset
33 #include "IconFrameTable.h"
Ritor1
parents:
diff changeset
34 #include "PlayerFrameTable.h"
Ritor1
parents:
diff changeset
35 #include "Awards.h"
Ritor1
parents:
diff changeset
36 #include "TurnEngine.h"
Ritor1
parents:
diff changeset
37 #include "Events2D.h"
Ritor1
parents:
diff changeset
38 #include "stru159.h"
189
038a4d09406f new texts file, fix text rendender error
Gloval
parents: 180
diff changeset
39 #include "texts.h"
0
Ritor1
parents:
diff changeset
40 #include "Log.h"
1299
8c2f689b5f0b folder UI
Ritor1
parents: 1295
diff changeset
41 #include "UI\UIHouses.h"
1262
0aeac0b9ca30 included header cleanup
Grumpy7
parents: 1254
diff changeset
42 #include "Lights.h"
1828
35c1e4ff6ba7 party_finds_gold to Party::PartyFindsGold, cleaned up, moved Level/Decoration.h reference out of Indoor.h
Grumpy7
parents: 1827
diff changeset
43 #include "Level/Decoration.h"
0
Ritor1
parents:
diff changeset
44
Ritor1
parents:
diff changeset
45 //----- (0046CC4B) --------------------------------------------------------
1459
2ca62c9e7b3c Function names
Nomad
parents: 1458
diff changeset
46 void check_event_triggers()
0
Ritor1
parents:
diff changeset
47 {
Ritor1
parents:
diff changeset
48 LevelDecoration *v1; // esi@2
Ritor1
parents:
diff changeset
49
1513
4055b09160ae Clean and decouple. (2)
yoctozepto
parents: 1489
diff changeset
50 for (size_t i = 0; i < num_event_triggers; i++)
0
Ritor1
parents:
diff changeset
51 {
1513
4055b09160ae Clean and decouple. (2)
yoctozepto
parents: 1489
diff changeset
52 v1 = &pLevelDecorations[event_triggers[i]];
4055b09160ae Clean and decouple. (2)
yoctozepto
parents: 1489
diff changeset
53
4055b09160ae Clean and decouple. (2)
yoctozepto
parents: 1489
diff changeset
54 if (v1->uFlags & LEVEL_DECORATION_TRIGGERED_BY_TOUCH
4055b09160ae Clean and decouple. (2)
yoctozepto
parents: 1489
diff changeset
55 && v1->vPosition.GetDistanceTo(pParty->vPosition) < v1->uTriggerRange)
0
Ritor1
parents:
diff changeset
56 {
1514
965af46e8793 Rename LevelDecoration::field_16_event_id to LevelDecoration::uEventID.
yoctozepto
parents: 1513
diff changeset
57 EventProcessor(v1->uEventID, PID(OBJECT_Decoration,i), 1);
0
Ritor1
parents:
diff changeset
58 }
1513
4055b09160ae Clean and decouple. (2)
yoctozepto
parents: 1489
diff changeset
59 else if (v1->uFlags & LEVEL_DECORATION_TRIGGERED_BY_MONSTER)
0
Ritor1
parents:
diff changeset
60 {
1513
4055b09160ae Clean and decouple. (2)
yoctozepto
parents: 1489
diff changeset
61 for (size_t j = 0; j < uNumActors; j++)
0
Ritor1
parents:
diff changeset
62 {
1513
4055b09160ae Clean and decouple. (2)
yoctozepto
parents: 1489
diff changeset
63 if (v1->vPosition.GetDistanceTo(pActors[j].vPosition) < v1->uTriggerRange)
1514
965af46e8793 Rename LevelDecoration::field_16_event_id to LevelDecoration::uEventID.
yoctozepto
parents: 1513
diff changeset
64 EventProcessor(v1->uEventID, 0, 1);
0
Ritor1
parents:
diff changeset
65 }
Ritor1
parents:
diff changeset
66 }
1513
4055b09160ae Clean and decouple. (2)
yoctozepto
parents: 1489
diff changeset
67 else if (v1->uFlags & LEVEL_DECORATION_TRIGGERED_BY_OBJECT)
0
Ritor1
parents:
diff changeset
68 {
1513
4055b09160ae Clean and decouple. (2)
yoctozepto
parents: 1489
diff changeset
69 for (size_t j = 0; j < uNumSpriteObjects; j++)
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents: 510
diff changeset
70 {
1513
4055b09160ae Clean and decouple. (2)
yoctozepto
parents: 1489
diff changeset
71 if (v1->vPosition.GetDistanceTo(pSpriteObjects[j].vPosition) < v1->uTriggerRange)
1514
965af46e8793 Rename LevelDecoration::field_16_event_id to LevelDecoration::uEventID.
yoctozepto
parents: 1513
diff changeset
72 EventProcessor(v1->uEventID, 0, 1);
0
Ritor1
parents:
diff changeset
73 }
Ritor1
parents:
diff changeset
74 }
Ritor1
parents:
diff changeset
75 }
Ritor1
parents:
diff changeset
76 }
Ritor1
parents:
diff changeset
77 // 6836C8: using guessed type int 6836C8_num_decorations_6807E8;
Ritor1
parents:
diff changeset
78
Ritor1
parents:
diff changeset
79 //----- (0046DEF2) --------------------------------------------------------
Ritor1
parents:
diff changeset
80 unsigned int __fastcall sub_46DEF2(signed int a2, unsigned int uLayingItemID)
Ritor1
parents:
diff changeset
81 {
Ritor1
parents:
diff changeset
82 unsigned int result; // eax@1
Ritor1
parents:
diff changeset
83
Ritor1
parents:
diff changeset
84 result = uLayingItemID;
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents: 510
diff changeset
85 if ( pObjectList->pObjects[pSpriteObjects[uLayingItemID].uObjectDescID].uFlags & 0x10 )
0
Ritor1
parents:
diff changeset
86 result = _46BFFA_check_object_intercept(uLayingItemID, a2);
Ritor1
parents:
diff changeset
87 return result;
Ritor1
parents:
diff changeset
88 }
Ritor1
parents:
diff changeset
89
Ritor1
parents:
diff changeset
90 //----- (0046E0B2) --------------------------------------------------------
1458
934074e7fcc1 ModalWindow
Nomad
parents: 1453
diff changeset
91 void _46E0B2_collide_against_decorations()
0
Ritor1
parents:
diff changeset
92 {
Ritor1
parents:
diff changeset
93 BLVSector *v0; // ebp@1
Ritor1
parents:
diff changeset
94 LevelDecoration *v1; // edi@2
Ritor1
parents:
diff changeset
95 DecorationDesc *v2; // esi@3
Ritor1
parents:
diff changeset
96 int v3; // edx@4
Ritor1
parents:
diff changeset
97 int v4; // eax@4
Ritor1
parents:
diff changeset
98 int v5; // ecx@6
Ritor1
parents:
diff changeset
99 int v6; // ebx@8
Ritor1
parents:
diff changeset
100 int v7; // esi@8
Ritor1
parents:
diff changeset
101 int v8; // ebx@10
Ritor1
parents:
diff changeset
102 int v9; // esi@11
Ritor1
parents:
diff changeset
103 int v10; // edi@12
Ritor1
parents:
diff changeset
104 int v11; // eax@12
Ritor1
parents:
diff changeset
105 int v12; // esi@14
Ritor1
parents:
diff changeset
106 unsigned int v13; // eax@17
Ritor1
parents:
diff changeset
107 signed int i; // [sp+4h] [bp-14h]@1
Ritor1
parents:
diff changeset
108 int v15; // [sp+8h] [bp-10h]@10
Ritor1
parents:
diff changeset
109 int v16; // [sp+Ch] [bp-Ch]@10
Ritor1
parents:
diff changeset
110 int v17; // [sp+10h] [bp-8h]@10
Ritor1
parents:
diff changeset
111 int v18; // [sp+14h] [bp-4h]@8
Ritor1
parents:
diff changeset
112
Ritor1
parents:
diff changeset
113 v0 = &pIndoor->pSectors[stru_721530.uSectorID];
Ritor1
parents:
diff changeset
114 for ( i = 0; i < v0->uNumDecorations; ++i )
Ritor1
parents:
diff changeset
115 {
Ritor1
parents:
diff changeset
116 v1 = &pLevelDecorations[v0->pDecorationIDs[i]];
1489
a27cdb3d753e Cleanup of LevelDecoration and related.
yoctozepto
parents: 1477
diff changeset
117 if (!(v1->uFlags & LEVEL_DECORATION_INVISIBLE))
0
Ritor1
parents:
diff changeset
118 {
Ritor1
parents:
diff changeset
119 v2 = &pDecorationList->pDecorations[v1->uDecorationDescID];
380
2f67762d04f6 DecorationDesc: flags -> methods
Nomad
parents: 373
diff changeset
120 if (!v2->CanMoveThrough())
0
Ritor1
parents:
diff changeset
121 {
Ritor1
parents:
diff changeset
122 v3 = v2->uRadius;
Ritor1
parents:
diff changeset
123 v4 = v1->vPosition.x;
Ritor1
parents:
diff changeset
124 if ( stru_721530.sMaxX <= v4 + v3 )
Ritor1
parents:
diff changeset
125 {
Ritor1
parents:
diff changeset
126 if ( stru_721530.sMinX >= v4 - v3 )
Ritor1
parents:
diff changeset
127 {
Ritor1
parents:
diff changeset
128 v5 = v1->vPosition.y;
Ritor1
parents:
diff changeset
129 if ( stru_721530.sMaxY <= v5 + v3 )
Ritor1
parents:
diff changeset
130 {
Ritor1
parents:
diff changeset
131 if ( stru_721530.sMinY >= v5 - v3 )
Ritor1
parents:
diff changeset
132 {
Ritor1
parents:
diff changeset
133 v6 = v2->uDecorationHeight;
Ritor1
parents:
diff changeset
134 v7 = v1->vPosition.z;
Ritor1
parents:
diff changeset
135 v18 = v6;
Ritor1
parents:
diff changeset
136 if ( stru_721530.sMaxZ <= v7 + v6 )
Ritor1
parents:
diff changeset
137 {
Ritor1
parents:
diff changeset
138 if ( stru_721530.sMinZ >= v7 )
Ritor1
parents:
diff changeset
139 {
Ritor1
parents:
diff changeset
140 v16 = v4 - stru_721530.normal.x;
Ritor1
parents:
diff changeset
141 v15 = v5 - stru_721530.normal.y;
Ritor1
parents:
diff changeset
142 v8 = stru_721530.prolly_normal_d + v3;
1546
9a6567c6c76c stru141 & misc cleaning
Nomad
parents: 1545
diff changeset
143 v17 = ((v4 - stru_721530.normal.x) * stru_721530.direction.y
9a6567c6c76c stru141 & misc cleaning
Nomad
parents: 1545
diff changeset
144 - (v5 - stru_721530.normal.y) * stru_721530.direction.x) >> 16;
0
Ritor1
parents:
diff changeset
145 if ( abs(v17) <= stru_721530.prolly_normal_d + v3 )
Ritor1
parents:
diff changeset
146 {
1546
9a6567c6c76c stru141 & misc cleaning
Nomad
parents: 1545
diff changeset
147 v9 = (v16 * stru_721530.direction.x + v15 * stru_721530.direction.y) >> 16;
0
Ritor1
parents:
diff changeset
148 if ( v9 > 0 )
Ritor1
parents:
diff changeset
149 {
Ritor1
parents:
diff changeset
150 v10 = v1->vPosition.z;
1643
7182930263b3 fixpoint functions renaming
zipi
parents: 1640
diff changeset
151 v11 = stru_721530.normal.z + fixpoint_mul(stru_721530.direction.z, v9);
0
Ritor1
parents:
diff changeset
152 if ( v11 >= v10 )
Ritor1
parents:
diff changeset
153 {
Ritor1
parents:
diff changeset
154 if ( v11 <= v18 + v10 )
Ritor1
parents:
diff changeset
155 {
295
640a176c030f sub_42ECB5
Nomad
parents: 267
diff changeset
156 v12 = v9 - integer_sqrt(v8 * v8 - v17 * v17);
0
Ritor1
parents:
diff changeset
157 if ( v12 < 0 )
Ritor1
parents:
diff changeset
158 v12 = 0;
Ritor1
parents:
diff changeset
159 if ( v12 < stru_721530.field_7C )
Ritor1
parents:
diff changeset
160 {
Ritor1
parents:
diff changeset
161 stru_721530.field_7C = v12;
Ritor1
parents:
diff changeset
162 v13 = 8 * v0->pDecorationIDs[i];
Ritor1
parents:
diff changeset
163 LOBYTE(v13) = v13 | 5;
Ritor1
parents:
diff changeset
164 stru_721530.uFaceID = v13;
Ritor1
parents:
diff changeset
165 }
Ritor1
parents:
diff changeset
166 }
Ritor1
parents:
diff changeset
167 }
Ritor1
parents:
diff changeset
168 }
Ritor1
parents:
diff changeset
169 }
Ritor1
parents:
diff changeset
170 }
Ritor1
parents:
diff changeset
171 }
Ritor1
parents:
diff changeset
172 }
Ritor1
parents:
diff changeset
173 }
Ritor1
parents:
diff changeset
174 }
Ritor1
parents:
diff changeset
175 }
Ritor1
parents:
diff changeset
176 }
Ritor1
parents:
diff changeset
177 }
Ritor1
parents:
diff changeset
178 }
Ritor1
parents:
diff changeset
179 }
Ritor1
parents:
diff changeset
180
Ritor1
parents:
diff changeset
181 //----- (00487DA9) --------------------------------------------------------
1583
75fafd8ced59 Allocator (CMemory) bye-bye
Nomad
parents: 1567
diff changeset
182 void sub_487DA9()
0
Ritor1
parents:
diff changeset
183 {
1413
3881d2f94eb1 UseNPCSkill
Nomad
parents: 1411
diff changeset
184 for (int i = 0; i < 20000; ++i)
3881d2f94eb1 UseNPCSkill
Nomad
parents: 1411
diff changeset
185 array_77EC08[i].field_108 = 0;
0
Ritor1
parents:
diff changeset
186 }
Ritor1
parents:
diff changeset
187
Ritor1
parents:
diff changeset
188 //----- (0048A959) --------------------------------------------------------
2006
30c2b575d25c signed fixes
zipi
parents: 1980
diff changeset
189 signed int ReplaceHSV(unsigned int uColor, float h_replace, float s_replace, float v_replace)
0
Ritor1
parents:
diff changeset
190 {
Ritor1
parents:
diff changeset
191 float r = ((uColor & 0x00FF0000) >> 16) / 255.0f,
Ritor1
parents:
diff changeset
192 g = ((uColor & 0x0000FF00) >> 8) / 255.0f,
Ritor1
parents:
diff changeset
193 b = (uColor & 0x000000FF) / 255.0f;
Ritor1
parents:
diff changeset
194
Ritor1
parents:
diff changeset
195 float h, s, v;
Ritor1
parents:
diff changeset
196 RGB2HSV(&h, &s, r, g, b, &v);
Ritor1
parents:
diff changeset
197
Ritor1
parents:
diff changeset
198 if ( h_replace != -1.0 )
Ritor1
parents:
diff changeset
199 h = h_replace;
Ritor1
parents:
diff changeset
200 if ( s_replace != -1.0 )
Ritor1
parents:
diff changeset
201 s = s_replace;
Ritor1
parents:
diff changeset
202 if ( v_replace != -1.0 )
Ritor1
parents:
diff changeset
203 v = v_replace;
Ritor1
parents:
diff changeset
204 HSV2RGB(&r, &g, &b, h, s, v);
Ritor1
parents:
diff changeset
205
1413
3881d2f94eb1 UseNPCSkill
Nomad
parents: 1411
diff changeset
206 return (((uint)round(r * 255.0f) & 0xFF) << 16) |
3881d2f94eb1 UseNPCSkill
Nomad
parents: 1411
diff changeset
207 (((uint)round(g * 255.0f) & 0xFF) << 8) |
3881d2f94eb1 UseNPCSkill
Nomad
parents: 1411
diff changeset
208 (((uint)round(b * 255.0f) & 0xFF));
0
Ritor1
parents:
diff changeset
209 }
Ritor1
parents:
diff changeset
210
Ritor1
parents:
diff changeset
211 //----- (0048B561) --------------------------------------------------------
1029
c94d6a37d298 Pointing a face with mouse fixed.
Nomad
parents: 1026
diff changeset
212 int fixpoint_from_float(float val)
0
Ritor1
parents:
diff changeset
213 {
1029
c94d6a37d298 Pointing a face with mouse fixed.
Nomad
parents: 1026
diff changeset
214 // float X.Yf -> int XXXX YYYY
c94d6a37d298 Pointing a face with mouse fixed.
Nomad
parents: 1026
diff changeset
215 int left = floorf((val - 0.5f) + 0.5f);
c94d6a37d298 Pointing a face with mouse fixed.
Nomad
parents: 1026
diff changeset
216 int right = floorf((val - left) * 65536.0f);
c94d6a37d298 Pointing a face with mouse fixed.
Nomad
parents: 1026
diff changeset
217 return (left << 16) | right;
0
Ritor1
parents:
diff changeset
218 }
Ritor1
parents:
diff changeset
219
1640
afc1c3514dd5 Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents: 1638
diff changeset
220 int fixpoint_from_int(int lhv, int rhv)
afc1c3514dd5 Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents: 1638
diff changeset
221 {
afc1c3514dd5 Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents: 1638
diff changeset
222 return (lhv << 16) | rhv;
afc1c3514dd5 Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents: 1638
diff changeset
223 }
afc1c3514dd5 Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents: 1638
diff changeset
224
0
Ritor1
parents:
diff changeset
225 //----- (00491E3A) --------------------------------------------------------
1459
2ca62c9e7b3c Function names
Nomad
parents: 1458
diff changeset
226 void sub_491E3A()
0
Ritor1
parents:
diff changeset
227 {
Ritor1
parents:
diff changeset
228 Player *v0; // ebx@1
Ritor1
parents:
diff changeset
229 signed int v1; // esi@3
Ritor1
parents:
diff changeset
230 char *v2; // eax@4
Ritor1
parents:
diff changeset
231 unsigned int v3; // eax@7
Ritor1
parents:
diff changeset
232 unsigned int v4; // edx@8
Ritor1
parents:
diff changeset
233 char *v5; // ecx@9
Ritor1
parents:
diff changeset
234 int v6; // edi@17
Ritor1
parents:
diff changeset
235 Texture *v7; // ebx@18
Ritor1
parents:
diff changeset
236 struct IDirect3DTexture2 **v8; // eax@19
Ritor1
parents:
diff changeset
237 struct IDirect3DTexture2 *v9; // eax@20
Ritor1
parents:
diff changeset
238 struct IDirectDrawSurface **v10; // eax@22
Ritor1
parents:
diff changeset
239 struct IDirectDrawSurface *v11; // eax@23
Ritor1
parents:
diff changeset
240 int v12; // eax@26
Ritor1
parents:
diff changeset
241
1861
a86c60679949 changing most of party arrays to std::arrays, some minor cleanups in actor.cpp
Grumpy7
parents: 1838
diff changeset
242 v0 = pParty->pPlayers.data();
0
Ritor1
parents:
diff changeset
243 do
Ritor1
parents:
diff changeset
244 {
203
0c64754c7fd4 Voices work (at least in party creation screen)
Nomad
parents: 198
diff changeset
245 if (SoundSetAction[24][0])
0
Ritor1
parents:
diff changeset
246 {
Ritor1
parents:
diff changeset
247 v1 = 0;
764
90bcfb56c8f9 sound cleaning
Gloval
parents: 761
diff changeset
248 if ( (signed int)pSoundList->sNumSounds <= 0 )
0
Ritor1
parents:
diff changeset
249 {
Ritor1
parents:
diff changeset
250 LABEL_7:
Ritor1
parents:
diff changeset
251 v3 = 0;
Ritor1
parents:
diff changeset
252 }
Ritor1
parents:
diff changeset
253 else
Ritor1
parents:
diff changeset
254 {
Ritor1
parents:
diff changeset
255 v2 = (char *)&pSoundList->pSounds->uSoundID;
203
0c64754c7fd4 Voices work (at least in party creation screen)
Nomad
parents: 198
diff changeset
256 while ( *(int *)v2 != 2 * (SoundSetAction[24][0] + 50 * v0->uVoiceID) + 4998 )
0
Ritor1
parents:
diff changeset
257 {
Ritor1
parents:
diff changeset
258 ++v1;
Ritor1
parents:
diff changeset
259 v2 += 120;
764
90bcfb56c8f9 sound cleaning
Gloval
parents: 761
diff changeset
260 if ( v1 >= (signed int)pSoundList->sNumSounds )
0
Ritor1
parents:
diff changeset
261 goto LABEL_7;
Ritor1
parents:
diff changeset
262 }
Ritor1
parents:
diff changeset
263 v3 = v1;
Ritor1
parents:
diff changeset
264 }
764
90bcfb56c8f9 sound cleaning
Gloval
parents: 761
diff changeset
265 pSoundList->UnloadSound(v3, 1);
0
Ritor1
parents:
diff changeset
266 v4 = 0;
764
90bcfb56c8f9 sound cleaning
Gloval
parents: 761
diff changeset
267 if ( (signed int)pSoundList->sNumSounds <= 0 )
0
Ritor1
parents:
diff changeset
268 {
Ritor1
parents:
diff changeset
269 LABEL_12:
Ritor1
parents:
diff changeset
270 v4 = 0;
Ritor1
parents:
diff changeset
271 }
Ritor1
parents:
diff changeset
272 else
Ritor1
parents:
diff changeset
273 {
Ritor1
parents:
diff changeset
274 v5 = (char *)&pSoundList->pSounds->uSoundID;
203
0c64754c7fd4 Voices work (at least in party creation screen)
Nomad
parents: 198
diff changeset
275 while ( *(int *)v5 != 2 * (SoundSetAction[24][0] + 50 * v0->uVoiceID) + 4999 )
0
Ritor1
parents:
diff changeset
276 {
Ritor1
parents:
diff changeset
277 ++v4;
Ritor1
parents:
diff changeset
278 v5 += 120;
764
90bcfb56c8f9 sound cleaning
Gloval
parents: 761
diff changeset
279 if ( (signed int)v4 >= (signed int)pSoundList->sNumSounds )
0
Ritor1
parents:
diff changeset
280 goto LABEL_12;
Ritor1
parents:
diff changeset
281 }
Ritor1
parents:
diff changeset
282 }
764
90bcfb56c8f9 sound cleaning
Gloval
parents: 761
diff changeset
283 pSoundList->UnloadSound(v4, 1);
0
Ritor1
parents:
diff changeset
284 }
Ritor1
parents:
diff changeset
285 ++v0;
Ritor1
parents:
diff changeset
286 }
1861
a86c60679949 changing most of party arrays to std::arrays, some minor cleanups in actor.cpp
Grumpy7
parents: 1838
diff changeset
287 while ( (signed int)v0 < (signed int)pParty->pHirelings.data() );
0
Ritor1
parents:
diff changeset
288 v6 = pIcons_LOD->uNumLoadedFiles - 1;
33
a9e9c6989d04 20.01.13
Ritor1
parents: 8
diff changeset
289 if ( v6 >= pIcons_LOD->pFacesLock )
0
Ritor1
parents:
diff changeset
290 {
Ritor1
parents:
diff changeset
291 v7 = &pIcons_LOD->pTextures[v6];
Ritor1
parents:
diff changeset
292 do
Ritor1
parents:
diff changeset
293 {
Ritor1
parents:
diff changeset
294 v7->Release();
Ritor1
parents:
diff changeset
295 v8 = pIcons_LOD->pHardwareTextures;
Ritor1
parents:
diff changeset
296 if ( v8 )
Ritor1
parents:
diff changeset
297 {
Ritor1
parents:
diff changeset
298 v9 = v8[v6];
Ritor1
parents:
diff changeset
299 if ( v9 )
Ritor1
parents:
diff changeset
300 {
Ritor1
parents:
diff changeset
301 v9->Release();
Ritor1
parents:
diff changeset
302 pIcons_LOD->pHardwareTextures[v6] = 0;
Ritor1
parents:
diff changeset
303 }
Ritor1
parents:
diff changeset
304 }
Ritor1
parents:
diff changeset
305 v10 = pIcons_LOD->pHardwareSurfaces;
Ritor1
parents:
diff changeset
306 if ( v10 )
Ritor1
parents:
diff changeset
307 {
Ritor1
parents:
diff changeset
308 v11 = v10[v6];
Ritor1
parents:
diff changeset
309 if ( v11 )
Ritor1
parents:
diff changeset
310 {
Ritor1
parents:
diff changeset
311 v11->Release();
Ritor1
parents:
diff changeset
312 pIcons_LOD->pHardwareSurfaces[v6] = 0;
Ritor1
parents:
diff changeset
313 }
Ritor1
parents:
diff changeset
314 }
Ritor1
parents:
diff changeset
315 --v6;
Ritor1
parents:
diff changeset
316 --v7;
Ritor1
parents:
diff changeset
317 }
33
a9e9c6989d04 20.01.13
Ritor1
parents: 8
diff changeset
318 while ( v6 >= pIcons_LOD->pFacesLock );
a9e9c6989d04 20.01.13
Ritor1
parents: 8
diff changeset
319 }
a9e9c6989d04 20.01.13
Ritor1
parents: 8
diff changeset
320 v12 = pIcons_LOD->pFacesLock;
a9e9c6989d04 20.01.13
Ritor1
parents: 8
diff changeset
321 pIcons_LOD->pFacesLock = 0;
0
Ritor1
parents:
diff changeset
322 pIcons_LOD->uNumLoadedFiles = v12;
Ritor1
parents:
diff changeset
323 }
Ritor1
parents:
diff changeset
324 // 4ED498: using guessed type char byte_4ED498;
Ritor1
parents:
diff changeset
325
Ritor1
parents:
diff changeset
326 //----- (00493938) --------------------------------------------------------
2060
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
327 void _493938_regenerate()
0
Ritor1
parents:
diff changeset
328 {
2060
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
329 int current_time; // edi@1
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
330 int last_reg_time; // qax@1
0
Ritor1
parents:
diff changeset
331 int v4; // eax@2
Ritor1
parents:
diff changeset
332 int v5; // edi@5
2030
47ab41698f9d sudden drop in flight fix
Ritor1
parents: 2023
diff changeset
333 bool cursed_flag; // ecx@5
0
Ritor1
parents:
diff changeset
334 char v7; // sf@5
112
909822c91d47 pointer fixes
zipi
parents: 102
diff changeset
335 int *v8; // ecx@10
0
Ritor1
parents:
diff changeset
336 int v9; // edi@15
Ritor1
parents:
diff changeset
337 signed int v10; // eax@15
Ritor1
parents:
diff changeset
338 __int16 *v11; // edx@16
Ritor1
parents:
diff changeset
339 int v12; // eax@20
Ritor1
parents:
diff changeset
340 int v13; // ebx@20
Ritor1
parents:
diff changeset
341 unsigned int *v14; // esi@21
Ritor1
parents:
diff changeset
342 unsigned int v15; // ecx@21
Ritor1
parents:
diff changeset
343 unsigned int v16; // eax@21
Ritor1
parents:
diff changeset
344 int v18; // eax@21
Ritor1
parents:
diff changeset
345 signed int v19; // eax@21
2060
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
346 bool recovery_HP; // ebx@25
0
Ritor1
parents:
diff changeset
347 ITEM_EQUIP_TYPE v22; // edi@30
Ritor1
parents:
diff changeset
348 signed int v25; // eax@33
Ritor1
parents:
diff changeset
349 int v26; // eax@35
Ritor1
parents:
diff changeset
350 int v27; // eax@36
Ritor1
parents:
diff changeset
351 int v28; // eax@37
Ritor1
parents:
diff changeset
352 signed int v31; // ecx@53
Ritor1
parents:
diff changeset
353 char v41[400]; // [sp+4h] [bp-22Ch]@20
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents: 510
diff changeset
354 SpriteObject a1; // [sp+194h] [bp-9Ch]@15
0
Ritor1
parents:
diff changeset
355 Vec3_int_ a3; // [sp+204h] [bp-2Ch]@15
2060
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
356 bool has_dragon_flag; // [sp+210h] [bp-20h]@22
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
357 bool lich_jar_flag; // [sp+214h] [bp-1Ch]@25
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
358 bool zombie_flag; // [sp+218h] [bp-18h]@25
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
359 bool decrease_HP; // [sp+21Ch] [bp-14h]@25
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
360 bool lich_flag; // [sp+220h] [bp-10h]@25
0
Ritor1
parents:
diff changeset
361 int v49; // [sp+224h] [bp-Ch]@24
2060
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
362 bool recovery_SP; // [sp+228h] [bp-8h]@25
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
363 bool redraw_flag; // [sp+22Ch] [bp-4h]@2
0
Ritor1
parents:
diff changeset
364
2060
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
365 current_time = (signed int)(signed __int64)((double)(signed __int64)pParty->uTimePlayed * 0.234375) / 60;
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
366 last_reg_time = (signed int)(signed __int64)((double)pParty->uLastRegenerationTime * 0.234375) / 60;
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
367 if ( current_time >= (signed int)last_reg_time + 5 )
0
Ritor1
parents:
diff changeset
368 {
2060
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
369 redraw_flag = false;
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
370 v4 = (current_time - last_reg_time) / 5;
0
Ritor1
parents:
diff changeset
371 if (pParty->FlyActive())
Ritor1
parents:
diff changeset
372 {
Ritor1
parents:
diff changeset
373 if ( pParty->bFlying )
Ritor1
parents:
diff changeset
374 {
569
f451efdb7c8b * Party buff icons drawing (right panel)
Nomad
parents: 566
diff changeset
375 if ( !(pParty->pPartyBuffs[PARTY_BUFF_FLY].uFlags & 1) )
2030
47ab41698f9d sudden drop in flight fix
Ritor1
parents: 2023
diff changeset
376 {
569
f451efdb7c8b * Party buff icons drawing (right panel)
Nomad
parents: 566
diff changeset
377 v5 = v4 * pParty->pPartyBuffs[PARTY_BUFF_FLY].uPower;
2060
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
378 cursed_flag = pParty->pPlayers[pParty->pPartyBuffs[PARTY_BUFF_FLY].uCaster - 1].pConditions[Condition_Cursed];//cursed
2030
47ab41698f9d sudden drop in flight fix
Ritor1
parents: 2023
diff changeset
379 v7 = cursed_flag < v5;
47ab41698f9d sudden drop in flight fix
Ritor1
parents: 2023
diff changeset
380 //cursed_flag -= v5;
47ab41698f9d sudden drop in flight fix
Ritor1
parents: 2023
diff changeset
381 if ( !v7 )
0
Ritor1
parents:
diff changeset
382 {
Ritor1
parents:
diff changeset
383 pParty->uFlags &= 0xFFFFFFBFu;
2030
47ab41698f9d sudden drop in flight fix
Ritor1
parents: 2023
diff changeset
384 pParty->bFlying = false;
2060
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
385 redraw_flag = true;
0
Ritor1
parents:
diff changeset
386 }
Ritor1
parents:
diff changeset
387 }
Ritor1
parents:
diff changeset
388 }
Ritor1
parents:
diff changeset
389 }
569
f451efdb7c8b * Party buff icons drawing (right panel)
Nomad
parents: 566
diff changeset
390
0
Ritor1
parents:
diff changeset
391 if (pParty->WaterWalkActive())
Ritor1
parents:
diff changeset
392 {
569
f451efdb7c8b * Party buff icons drawing (right panel)
Nomad
parents: 566
diff changeset
393 if (pParty->uFlags & PARTY_FLAGS_1_STANDING_ON_WATER )
f451efdb7c8b * Party buff icons drawing (right panel)
Nomad
parents: 566
diff changeset
394 {
f451efdb7c8b * Party buff icons drawing (right panel)
Nomad
parents: 566
diff changeset
395 if ( !(pParty->pPartyBuffs[PARTY_BUFF_WATER_WALK].uFlags & 1) )
f451efdb7c8b * Party buff icons drawing (right panel)
Nomad
parents: 566
diff changeset
396 { // taking on water
2060
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
397 v8 = (int *)&pParty->pPlayers[pParty->pPartyBuffs[PARTY_BUFF_WATER_WALK].uCaster - 1].pConditions[Condition_Cursed];//&stru_AA1058[4].pSounds[6972 * pParty->pPartyBuffs[PARTY_BUFF_WATER_WALK].uCaster + 2000];
112
909822c91d47 pointer fixes
zipi
parents: 102
diff changeset
398 v7 = *v8 < v4;
909822c91d47 pointer fixes
zipi
parents: 102
diff changeset
399 *v8 -= v4;
0
Ritor1
parents:
diff changeset
400 if ( v7 )
Ritor1
parents:
diff changeset
401 {
112
909822c91d47 pointer fixes
zipi
parents: 102
diff changeset
402 *v8 = 0;
569
f451efdb7c8b * Party buff icons drawing (right panel)
Nomad
parents: 566
diff changeset
403 pParty->uFlags &= ~PARTY_FLAGS_1_STANDING_ON_WATER;
2060
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
404 redraw_flag = true;
0
Ritor1
parents:
diff changeset
405 }
Ritor1
parents:
diff changeset
406 }
Ritor1
parents:
diff changeset
407 }
Ritor1
parents:
diff changeset
408 }
569
f451efdb7c8b * Party buff icons drawing (right panel)
Nomad
parents: 566
diff changeset
409
2060
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
410 if (pParty->ImmolationActive())//Æåðòâà
0
Ritor1
parents:
diff changeset
411 {
Ritor1
parents:
diff changeset
412 a3.z = 0;
Ritor1
parents:
diff changeset
413 a3.y = 0;
Ritor1
parents:
diff changeset
414 a3.x = 0;
Ritor1
parents:
diff changeset
415 a1.stru_24.Reset();
822
c232f160e6f3 Named SpriteObject spell-related fields.
Nomad
parents: 819
diff changeset
416 a1.spell_level = pParty->pPartyBuffs[PARTY_BUFF_IMMOLATION].uPower;
c232f160e6f3 Named SpriteObject spell-related fields.
Nomad
parents: 819
diff changeset
417 a1.spell_skill = pParty->ImmolationSkillLevel();
0
Ritor1
parents:
diff changeset
418 v10 = 0;
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents: 510
diff changeset
419 a1.uType = 1070;
822
c232f160e6f3 Named SpriteObject spell-related fields.
Nomad
parents: 819
diff changeset
420 a1.spell_id = SPELL_FIRE_IMMOLATION;
0
Ritor1
parents:
diff changeset
421 if ( (signed int)pObjectList->uNumObjects <= 0 )
Ritor1
parents:
diff changeset
422 {
Ritor1
parents:
diff changeset
423 LABEL_19:
Ritor1
parents:
diff changeset
424 LOWORD(v10) = 0;
Ritor1
parents:
diff changeset
425 }
Ritor1
parents:
diff changeset
426 else
Ritor1
parents:
diff changeset
427 {
Ritor1
parents:
diff changeset
428 v11 = &pObjectList->pObjects->uObjectID;
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 917
diff changeset
429 while ( stru_4E3ACC[8].uType != *v11 )
0
Ritor1
parents:
diff changeset
430 {
Ritor1
parents:
diff changeset
431 ++v10;
Ritor1
parents:
diff changeset
432 v11 += 28;
Ritor1
parents:
diff changeset
433 if ( v10 >= (signed int)pObjectList->uNumObjects )
Ritor1
parents:
diff changeset
434 goto LABEL_19;
Ritor1
parents:
diff changeset
435 }
Ritor1
parents:
diff changeset
436 }
Ritor1
parents:
diff changeset
437 a1.uObjectDescID = v10;
Ritor1
parents:
diff changeset
438 a1.field_60_distance_related_prolly_lod = 0;
1167
15ad868d972f pPartyBuffs - change plain numbers to enums
Grumpy7
parents: 1165
diff changeset
439 v12 = 8 * pParty->pPartyBuffs[PARTY_BUFF_IMMOLATION].uCaster;
303
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 296
diff changeset
440 LOBYTE(v12) = v12 | OBJECT_Player;
0
Ritor1
parents:
diff changeset
441 a1.uAttributes = 0;
Ritor1
parents:
diff changeset
442 a1.uSectorID = 0;
Ritor1
parents:
diff changeset
443 a1.uSpriteFrameID = 0;
822
c232f160e6f3 Named SpriteObject spell-related fields.
Nomad
parents: 819
diff changeset
444 a1.spell_caster_pid = v12;
0
Ritor1
parents:
diff changeset
445 a1.uFacing = 0;
Ritor1
parents:
diff changeset
446 a1.uSoundID = 0;
1459
2ca62c9e7b3c Function names
Nomad
parents: 1458
diff changeset
447 v13 = _46A89E_immolation_effect((int)v41, 100, 307);
2060
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
448 for ( v9 = 0; v9 < v13; ++v9 )
0
Ritor1
parents:
diff changeset
449 {
2060
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
450 v14 = (unsigned int *)&v41[4 * v9];
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
451 v15 = *v14;
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
452 v16 = *v14;
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
453 a1.vPosition.x = pActors[v16].vPosition.x;
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
454 a1.vPosition.y = pActors[v16].vPosition.y;
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
455 a1.vPosition.z = pActors[v16].vPosition.z;
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
456 v18 = 8 * v15;
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
457 LOBYTE(v18) = PID(OBJECT_Actor,v15);
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
458 a1.spell_target_pid = v18;
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
459 v19 = a1.Create(0, 0, 0, 0);
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
460 DamageMonsterFromParty(PID(OBJECT_Item,v19), *v14, &a3);
0
Ritor1
parents:
diff changeset
461 }
Ritor1
parents:
diff changeset
462 }
2060
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
463
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
464 has_dragon_flag = false;
248
37dcbe8f3cca Dialogue stuff
Nomad
parents: 232
diff changeset
465 if (PartyHasDragon())
2060
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
466 has_dragon_flag = true;
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
467
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
468 for ( v49 = 0; v49 < 4; v49++ )
0
Ritor1
parents:
diff changeset
469 {
2060
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
470 recovery_HP = false;
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
471 recovery_SP = false;
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
472 decrease_HP = false;
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
473 lich_flag = false;
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
474 lich_jar_flag = false;
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
475 zombie_flag = false;
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
476
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
477 for ( int v22 = 0; (signed int)v22 < 16; v22++ )
0
Ritor1
parents:
diff changeset
478 {
2060
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
479 if ( pParty->pPlayers[v49].HasItemEquipped((ITEM_EQUIP_TYPE)v22) )
0
Ritor1
parents:
diff changeset
480 {
2060
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
481 uint _idx = pParty->pPlayers[v49].pEquipment.pIndices[v22];
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
482 if ( pParty->pPlayers[v49].pInventoryItemList[_idx - 1].uItemID > 134 )
2030
47ab41698f9d sudden drop in flight fix
Ritor1
parents: 2023
diff changeset
483 {
2060
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
484 if ( pParty->pPlayers[v49].pInventoryItemList[_idx - 1].uItemID == ITEM_RELIC_ETHRICS_STAFF )
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
485 decrease_HP = true;
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
486 if ( pParty->pPlayers[v49].pInventoryItemList[_idx - 1].uItemID == ITEM_ARTIFACT_HERMES_SANDALS )
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
487 {
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
488 recovery_HP = true;
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
489 recovery_SP = true;
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
490 }
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
491 if ( pParty->pPlayers[v49].pInventoryItemList[_idx - 1].uItemID == ITEM_ARTIFACT_MINDS_EYE )
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
492 recovery_SP = true;
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
493 if ( pParty->pPlayers[v49].pInventoryItemList[_idx - 1].uItemID == ITEM_ARTIFACT_HEROS_BELT )
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
494 recovery_HP = true;
0
Ritor1
parents:
diff changeset
495 }
Ritor1
parents:
diff changeset
496 else
Ritor1
parents:
diff changeset
497 {
2060
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
498 v25 = pParty->pPlayers[v49].pInventoryItemList[_idx - 1].uSpecEnchantmentType;
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
499 if ( v25 == 37 //of Regeneration("Regenerate 1hp/x while walking, etc")
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
500 && v25 == 44 //of Life("HP (+10), Regen hpts")
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
501 && v25 == 50 //of The Phoenix("Fire Res (+30), Regen hpts") &&
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
502 && v25 == 54 )// of The Troll("End (+15), Regen hpts")
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
503 recovery_HP = true;
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
504 if ( v25 == 38 //of Mana("Regenerate 1sp/x while walking, etc")
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
505 && v25 == 47 //of The Eclipse("SP (+10), Regen spts")
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
506 && v25 == 55 )//of The Unicorn("Luck (+15), Regen spts")
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
507 recovery_SP = true;
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
508 if ( v25 == 66 )// of Plenty("Regenerate 1 hp/x and 1 sp/x while walking, etc.")
2030
47ab41698f9d sudden drop in flight fix
Ritor1
parents: 2023
diff changeset
509 {
2060
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
510 recovery_HP = true;
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
511 recovery_SP = true;
2030
47ab41698f9d sudden drop in flight fix
Ritor1
parents: 2023
diff changeset
512 }
0
Ritor1
parents:
diff changeset
513 }
2060
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
514
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
515 if ( recovery_HP && !pParty->pPlayers[v49].pConditions[Condition_Dead]
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
516 && !pParty->pPlayers[v49].pConditions[Condition_Eradicated] )
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
517 {
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
518 ++pParty->pPlayers[v49].sHealth;
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
519 if ( pParty->pPlayers[v49].sHealth > pParty->pPlayers[v49].GetMaxHealth() )
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
520 pParty->pPlayers[v49].sHealth = pParty->pPlayers[v49].GetMaxHealth();
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
521 if ( pParty->pPlayers[v49].pConditions[Condition_Unconcious] && pParty->pPlayers[v49].sHealth > 0 )
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
522 pParty->pPlayers[v49].pConditions[Condition_Unconcious] = 0;
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
523 redraw_flag = true;
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
524 }
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
525
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
526 if ( recovery_SP )
0
Ritor1
parents:
diff changeset
527 {
2060
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
528 ++pParty->pPlayers[v49].sMana;
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
529 if ( pParty->pPlayers[v49].sMana > pParty->pPlayers[v49].GetMaxMana() )
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
530 pParty->pPlayers[v49].sMana = pParty->pPlayers[v49].GetMaxMana();
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
531 redraw_flag = true;
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
532 }
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
533
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
534 if ( decrease_HP && !pParty->pPlayers[v49].pConditions[Condition_Dead]
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
535 && !pParty->pPlayers[v49].pConditions[Condition_Eradicated] )
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
536 {
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
537 --pParty->pPlayers[v49].sHealth;
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
538 if ( !(pParty->pPlayers[v49].pConditions[Condition_Unconcious]) && pParty->pPlayers[v49].sHealth < 0 )
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
539 pParty->pPlayers[v49].pConditions[Condition_Unconcious] = pParty->uTimePlayed;
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
540 if ( pParty->pPlayers[v49].sHealth < 1 )
0
Ritor1
parents:
diff changeset
541 {
2060
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
542 if ( pParty->pPlayers[v49].sHealth + pParty->pPlayers[v49].uEndurance + pParty->pPlayers[v49].GetItemsBonus(CHARACTER_ATTRIBUTE_ENDURANCE) >= 1
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
543 || (signed __int64)pParty->pPlayers[v49].pPlayerBuffs[PLAYER_BUFF_PRESERVATION].uExpireTime > 0 )
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
544 pParty->pPlayers[v49].pConditions[Condition_Unconcious] = pParty->uTimePlayed;
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
545 else
0
Ritor1
parents:
diff changeset
546 {
2060
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
547 if ( !pParty->pPlayers[v49].pConditions[Condition_Dead] )
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
548 pParty->pPlayers[v49].pConditions[Condition_Dead] = pParty->uTimePlayed;
0
Ritor1
parents:
diff changeset
549 }
Ritor1
parents:
diff changeset
550 }
2060
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
551 redraw_flag = true;
0
Ritor1
parents:
diff changeset
552 }
Ritor1
parents:
diff changeset
553 }
Ritor1
parents:
diff changeset
554 }
2060
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
555
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
556 //regeneration
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
557 if ( pParty->pPlayers[v49].pPlayerBuffs[PLAYER_BUFF_REGENERATION].uExpireTime > 0
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
558 && !pParty->pPlayers[v49].pConditions[Condition_Dead]
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
559 && !pParty->pPlayers[v49].pConditions[Condition_Eradicated] )
0
Ritor1
parents:
diff changeset
560 {
2060
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
561 pParty->pPlayers[v49].sHealth += 5 * pParty->pPlayers[v49].pPlayerBuffs[PLAYER_BUFF_REGENERATION].uPower;
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
562 if ( pParty->pPlayers[v49].sHealth > pParty->pPlayers[v49].GetMaxHealth() )
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
563 pParty->pPlayers[v49].sHealth = pParty->pPlayers[v49].GetMaxHealth();
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
564 if ( pParty->pPlayers[v49].pConditions[Condition_Unconcious] && pParty->pPlayers[v49].sHealth > 0 )
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
565 pParty->pPlayers[v49].pConditions[Condition_Unconcious] = 0;
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
566 redraw_flag = true;
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
567 }
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
568
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
569 //for warlock
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
570 if ( has_dragon_flag && pParty->pPlayers[v49].classType == PLAYER_CLASS_WARLOCK )
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
571 {
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
572 ++pParty->pPlayers[v49].sMana;
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
573 if ( pParty->pPlayers[v49].sMana > pParty->pPlayers[v49].GetMaxMana() )
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
574 pParty->pPlayers[v49].sMana = pParty->pPlayers[v49].GetMaxMana();
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
575 redraw_flag = true;
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
576 }
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
577
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
578 //for lich
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
579 if ( pParty->pPlayers[v49].classType == PLAYER_CLASS_LICH )
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
580 {
2085
52abdea20b9e Door_switch_animation
Ritor1
parents: 2065
diff changeset
581 for ( v31 = 0; v31 < 126; ++v31 )
0
Ritor1
parents:
diff changeset
582 {
2060
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
583 if ( pParty->pPlayers[v49].pInventoryItemList[v31].uItemID == ITEM_LICH_JAR_FULL )
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
584 lich_jar_flag = true;
0
Ritor1
parents:
diff changeset
585 }
2060
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
586 lich_flag = true;
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
587 }
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
588 if ( lich_flag && !pParty->pPlayers[v49].pConditions[Condition_Dead]
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
589 && !pParty->pPlayers[v49].pConditions[Condition_Eradicated] )
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
590 {
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
591 if ( pParty->pPlayers[v49].sHealth > pParty->pPlayers[v49].GetMaxHealth() / 2 )
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
592 pParty->pPlayers[v49].sHealth = pParty->pPlayers[v49].sHealth - 2;
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
593 if ( pParty->pPlayers[v49].sMana > pParty->pPlayers[v49].GetMaxMana() / 2 )
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
594 pParty->pPlayers[v49].sMana = pParty->pPlayers[v49].sMana - 2;
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
595 }
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
596 if ( lich_jar_flag )
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
597 {
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
598 ++pParty->pPlayers[v49].sMana;
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
599 if ( pParty->pPlayers[v49].sMana > pParty->pPlayers[v49].GetMaxMana() )
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
600 pParty->pPlayers[v49].sMana = pParty->pPlayers[v49].GetMaxMana();
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
601 }
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
602
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
603 //for zombie
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
604 if ( pParty->pPlayers[v49].pConditions[Condition_Zombie] )
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
605 zombie_flag = true;
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
606 if ( zombie_flag && !pParty->pPlayers[v49].pConditions[Condition_Dead]
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
607 && !pParty->pPlayers[v49].pConditions[Condition_Eradicated] )
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
608 {
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
609 if ( pParty->pPlayers[v49].sHealth > pParty->pPlayers[v49].GetMaxHealth() / 2 )
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
610 pParty->pPlayers[v49].sHealth = pParty->pPlayers[v49].sHealth - 1;
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
611 if ( pParty->pPlayers[v49].sMana > 0 )
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
612 pParty->pPlayers[v49].sMana = pParty->pPlayers[v49].sMana - 1;
0
Ritor1
parents:
diff changeset
613 }
Ritor1
parents:
diff changeset
614 }
2060
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
615 pParty->uLastRegenerationTime = pParty->uTimePlayed;
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
616 if ( !viewparams->bRedrawGameUI )
72177f3603da _493938_regenerate()
Ritor1
parents: 2059
diff changeset
617 viewparams->bRedrawGameUI = redraw_flag;
0
Ritor1
parents:
diff changeset
618 }
Ritor1
parents:
diff changeset
619 }
Ritor1
parents:
diff changeset
620
Ritor1
parents:
diff changeset
621 //----- (00493F79) --------------------------------------------------------
1459
2ca62c9e7b3c Function names
Nomad
parents: 1458
diff changeset
622 void init_summoned_item(stru351_summoned_item *_this, __int64 duration)
0
Ritor1
parents:
diff changeset
623 {
Ritor1
parents:
diff changeset
624 signed __int64 v2; // ST2C_8@1
Ritor1
parents:
diff changeset
625 signed __int64 v3; // qax@1
351
5f36449527c6 stru351 -> summoned/spell-enchanted item
Nomad
parents: 348
diff changeset
626 //signed __int64 v4; // ST1C_8@1
0
Ritor1
parents:
diff changeset
627 unsigned __int64 v5; // qax@1
Ritor1
parents:
diff changeset
628 unsigned int v6; // ebx@1
Ritor1
parents:
diff changeset
629
1459
2ca62c9e7b3c Function names
Nomad
parents: 1458
diff changeset
630 v2 = (signed __int64)((double)duration * 0.234375);
0
Ritor1
parents:
diff changeset
631 v3 = v2 / 60 / 60;
351
5f36449527c6 stru351 -> summoned/spell-enchanted item
Nomad
parents: 348
diff changeset
632 //v4 = v3;
0
Ritor1
parents:
diff changeset
633 v5 = (unsigned int)v3 / 0x18;
Ritor1
parents:
diff changeset
634 v6 = (unsigned int)(v5 / 7) >> 2;
351
5f36449527c6 stru351 -> summoned/spell-enchanted item
Nomad
parents: 348
diff changeset
635 _this->field_0_expire_second = v2 % 60;
5f36449527c6 stru351 -> summoned/spell-enchanted item
Nomad
parents: 348
diff changeset
636 _this->field_4_expire_minute = v2 / 60 % 60;
5f36449527c6 stru351 -> summoned/spell-enchanted item
Nomad
parents: 348
diff changeset
637 _this->field_8_expire_hour = v3 % 24;
5f36449527c6 stru351 -> summoned/spell-enchanted item
Nomad
parents: 348
diff changeset
638 _this->field_10_expire_week = v5 / 7 & 3;
5f36449527c6 stru351 -> summoned/spell-enchanted item
Nomad
parents: 348
diff changeset
639 _this->field_C_expire_day = (unsigned int)v5 % 0x1C;
5f36449527c6 stru351 -> summoned/spell-enchanted item
Nomad
parents: 348
diff changeset
640 _this->field_14_exprie_month = v6 % 0xC;
352
ec6cc5cefa4b Game starting age (1168) moved to a variable
Nomad
parents: 351
diff changeset
641 _this->field_18_expire_year = v6 / 0xC + game_starting_year;
0
Ritor1
parents:
diff changeset
642 }
Ritor1
parents:
diff changeset
643
Ritor1
parents:
diff changeset
644 //----- (00494035) --------------------------------------------------------
1031
f93d17337113 UI stuff.
Nomad
parents: 1029
diff changeset
645 void _494035_timed_effects__water_walking_damage__etc()
0
Ritor1
parents:
diff changeset
646 {
Ritor1
parents:
diff changeset
647 signed __int64 v0; // qax@1
Ritor1
parents:
diff changeset
648 unsigned int v4; // edi@1
Ritor1
parents:
diff changeset
649 signed int v12; // edi@29
Ritor1
parents:
diff changeset
650 int v24; // ecx@60
Ritor1
parents:
diff changeset
651 int v26; // ecx@64
Ritor1
parents:
diff changeset
652 int v28; // ecx@68
Ritor1
parents:
diff changeset
653 int v30; // ecx@72
Ritor1
parents:
diff changeset
654 int v32; // ecx@76
Ritor1
parents:
diff changeset
655 int v34; // ecx@80
Ritor1
parents:
diff changeset
656 int v36; // ecx@84
Ritor1
parents:
diff changeset
657 int v38; // ecx@88
Ritor1
parents:
diff changeset
658 int v40; // ecx@92
Ritor1
parents:
diff changeset
659 int v42; // ecx@96
Ritor1
parents:
diff changeset
660 bool v43; // ebx@102
Ritor1
parents:
diff changeset
661 bool v46; // edi@111
Ritor1
parents:
diff changeset
662 unsigned int v56; // [sp-8h] [bp-38h]@55
Ritor1
parents:
diff changeset
663 int v59; // [sp-4h] [bp-34h]@55
Ritor1
parents:
diff changeset
664 unsigned int v61; // [sp+14h] [bp-1Ch]@1
Ritor1
parents:
diff changeset
665 signed int a2a; // [sp+18h] [bp-18h]@47
2062
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
666 signed int old_day; // [sp+1Ch] [bp-14h]@47
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
667 signed int old_hour;
0
Ritor1
parents:
diff changeset
668
2062
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
669 old_day = pParty->uDaysPlayed;
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
670 old_hour = pParty->uCurrentHour;
816
cfc65feef029 * Player Recovery Times
Nomad
parents: 809
diff changeset
671 //auto prev_time = pEventTimer->uTimeElapsed;
766
a464d28566a6 days_played_without_rest
Nomad
parents: 763
diff changeset
672 pParty->uTimePlayed += pEventTimer->uTimeElapsed;
2062
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
673 v0 = ((signed __int64)(pParty->uTimePlayed * 0.234375) / 60)/60i64;
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
674 v4 = (unsigned int)(((unsigned int)v0 / 24) / 7) >> 2;
0
Ritor1
parents:
diff changeset
675 pParty->uCurrentTimeSecond = (signed __int64)((double)(signed __int64)pParty->uTimePlayed * 0.234375) % 60;
2062
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
676 pParty->uCurrentMinute = ((signed __int64)(pParty->uTimePlayed * 0.234375) / 60) % 60;
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
677 pParty->uCurrentHour = v0 % 24;
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
678 pParty->uCurrentMonthWeek = ((unsigned int)v0 / 24) / 7 & 3;
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
679 pParty->uDaysPlayed = (unsigned int)((unsigned int)v0 / 24) % 28;
0
Ritor1
parents:
diff changeset
680 pParty->uCurrentMonth = v4 % 12;
352
ec6cc5cefa4b Game starting age (1168) moved to a variable
Nomad
parents: 351
diff changeset
681 pParty->uCurrentYear = v4 / 0xC + game_starting_year;
2062
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
682 if ( pParty->uCurrentHour >= 3 && (old_hour < 3 || pParty->uDaysPlayed > old_day) ) // new day dawns
0
Ritor1
parents:
diff changeset
683 {
Ritor1
parents:
diff changeset
684 pParty->pHirelings[0].bHasUsedTheAbility = false;
Ritor1
parents:
diff changeset
685 pParty->pHirelings[1].bHasUsedTheAbility = false;
Ritor1
parents:
diff changeset
686
Ritor1
parents:
diff changeset
687 for (uint i = 0; i < pNPCStats->uNumNewNPCs; ++i)
Ritor1
parents:
diff changeset
688 pNPCStats->pNewNPCData[i].bHasUsedTheAbility = false;
Ritor1
parents:
diff changeset
689
766
a464d28566a6 days_played_without_rest
Nomad
parents: 763
diff changeset
690 ++pParty->days_played_without_rest;
a464d28566a6 days_played_without_rest
Nomad
parents: 763
diff changeset
691 if (pParty->days_played_without_rest > 1)
0
Ritor1
parents:
diff changeset
692 {
Ritor1
parents:
diff changeset
693 for (uint i = 0; i < 4; ++i)
1361
b3ac17fd12de Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents: 1358
diff changeset
694 pParty->pPlayers[i].SetCondWeakWithBlockCheck(0);
766
a464d28566a6 days_played_without_rest
Nomad
parents: 763
diff changeset
695
a464d28566a6 days_played_without_rest
Nomad
parents: 763
diff changeset
696 if (pParty->uNumFoodRations)
a464d28566a6 days_played_without_rest
Nomad
parents: 763
diff changeset
697 Party::TakeFood(1);
0
Ritor1
parents:
diff changeset
698 else
Ritor1
parents:
diff changeset
699 for (uint i = 0; i < 4; ++i)
766
a464d28566a6 days_played_without_rest
Nomad
parents: 763
diff changeset
700 pParty->pPlayers[i].sHealth = pParty->pPlayers[i].sHealth / (pParty->days_played_without_rest + 1) + 1;
a464d28566a6 days_played_without_rest
Nomad
parents: 763
diff changeset
701
a464d28566a6 days_played_without_rest
Nomad
parents: 763
diff changeset
702 if (pParty->days_played_without_rest > 3)
2062
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
703 for ( uint i = 0; i < 4; ++i )
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
704 {
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
705 pParty->pPlayers[i].Zero();
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
706 if (!pParty->pPlayers[i].IsPertified() && !pParty->pPlayers[i].IsEradicated()
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
707 && !pParty->pPlayers[i].IsDead())
0
Ritor1
parents:
diff changeset
708 {
2062
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
709 if (rand() % 100 < 5 * pParty->days_played_without_rest)
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
710 pParty->pPlayers[i].SetCondDeadWithBlockCheck(0);
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
711 if (rand() % 100 < 10 * pParty->days_played_without_rest)
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
712 pParty->pPlayers[i].SetCondInsaneWithBlockCheck(0);
0
Ritor1
parents:
diff changeset
713 }
2062
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
714 }
766
a464d28566a6 days_played_without_rest
Nomad
parents: 763
diff changeset
715 }
a464d28566a6 days_played_without_rest
Nomad
parents: 763
diff changeset
716 if (uCurrentlyLoadedLevelType == LEVEL_Outdoor)
0
Ritor1
parents:
diff changeset
717 pOutdoor->SetFog();
Ritor1
parents:
diff changeset
718
Ritor1
parents:
diff changeset
719 for (uint i = 0; i < 4; ++i)
Ritor1
parents:
diff changeset
720 pParty->pPlayers[i].uNumDivineInterventionCastsThisDay = 0;
Ritor1
parents:
diff changeset
721 }
766
a464d28566a6 days_played_without_rest
Nomad
parents: 763
diff changeset
722
2062
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
723 if ( pParty->uFlags & 4 && pParty->field_6FC < (signed __int64)pParty->uTimePlayed )//water damage
0
Ritor1
parents:
diff changeset
724 {
2062
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
725 pParty->field_6FC = (signed __int64)pParty->uTimePlayed + 128;
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
726 viewparams->bRedrawGameUI = true;
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
727 for ( uint pl = 1; pl <= 4; ++pl )
0
Ritor1
parents:
diff changeset
728 {
2062
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
729 if ( pPlayers[pl]->WearsItem(ITEM_RELIC_HARECS_LEATHER, EQUIP_ARMOUR)
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
730 || pPlayers[pl]->HasEnchantedItemEquipped(71)
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
731 || pPlayers[pl]->pPlayerBuffs[PLAYER_BUFF_WATER_WALK].uExpireTime > 0 )
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
732 pPlayers[pl]->PlayEmotion(CHARACTER_EXPRESSION_37, 0);
0
Ritor1
parents:
diff changeset
733 else
Ritor1
parents:
diff changeset
734 {
2062
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
735 if ( !pPlayers[pl]->HasUnderwaterSuitEquipped() )
0
Ritor1
parents:
diff changeset
736 {
2062
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
737 pPlayers[pl]->ReceiveDamage((signed __int64)pPlayers[pl]->GetMaxHealth() * 0.1, DMGT_FIRE);
0
Ritor1
parents:
diff changeset
738 if ( pParty->uFlags & 4 )
Ritor1
parents:
diff changeset
739 {
2062
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
740 strcpy(GameUI_Footer_TimedString.data(), pGlobalTXT_LocalizationStrings[660]);// Âû òîíåòå!
783
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 775
diff changeset
741 GameUI_Footer_TimeLeft = 128;
0
Ritor1
parents:
diff changeset
742 }
Ritor1
parents:
diff changeset
743 }
2062
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
744 else
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
745 pPlayers[pl]->PlayEmotion(CHARACTER_EXPRESSION_37, 0);
0
Ritor1
parents:
diff changeset
746 }
2062
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
747 }
0
Ritor1
parents:
diff changeset
748 }
2062
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
749 if ( pParty->uFlags & 0x200 && pParty->field_6FC < (signed __int64)pParty->uTimePlayed ) //lava damage
0
Ritor1
parents:
diff changeset
750 {
2062
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
751 viewparams->bRedrawGameUI = true;
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
752 pParty->field_6FC = (signed __int64)pParty->uTimePlayed + 128;
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
753
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
754 for ( uint pl = 1; pl <= 4; pl++ )
0
Ritor1
parents:
diff changeset
755 {
2062
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
756 pPlayers[pl]->ReceiveDamage((signed __int64)pPlayers[pl]->GetMaxHealth() * 0.1, DMGT_FIRE);
0
Ritor1
parents:
diff changeset
757 if ( pParty->uFlags & 0x200 )
Ritor1
parents:
diff changeset
758 {
2062
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
759 strcpy(GameUI_Footer_TimedString.data(), pGlobalTXT_LocalizationStrings[661]); //Âû ãîðèòå!
783
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 775
diff changeset
760 GameUI_Footer_TimeLeft = 128;
0
Ritor1
parents:
diff changeset
761 }
Ritor1
parents:
diff changeset
762 }
Ritor1
parents:
diff changeset
763 }
Ritor1
parents:
diff changeset
764 _493938_regenerate();
2062
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
765 uint party_condition_flag = 4;
816
cfc65feef029 * Player Recovery Times
Nomad
parents: 809
diff changeset
766 a2a = pEventTimer->uTimeElapsed;
2063
7890930801a8 small fix
Ritor1
parents: 2062
diff changeset
767 if ( pParty->uFlags2 & PARTY_FLAGS_2_RUNNING )//çàìåäëåíèå âîññòàíîâëåíèÿ ïðè áåãå
816
cfc65feef029 * Player Recovery Times
Nomad
parents: 809
diff changeset
768 {
cfc65feef029 * Player Recovery Times
Nomad
parents: 809
diff changeset
769 a2a *= 0.5f;
cfc65feef029 * Player Recovery Times
Nomad
parents: 809
diff changeset
770 if (a2a < 1)
0
Ritor1
parents:
diff changeset
771 a2a = 1;
Ritor1
parents:
diff changeset
772 }
2062
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
773
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
774 for ( uint pl = 1; pl <= 4; pl++ )
0
Ritor1
parents:
diff changeset
775 {
2062
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
776 if ( pPlayers[pl]->uTimeToRecovery )
2063
7890930801a8 small fix
Ritor1
parents: 2062
diff changeset
777 pPlayers[pl]->Recover(a2a);//âîññòàíîâëåíèå àêòèâíîñòè
2062
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
778 if ( pPlayers[pl]->GetItemsBonus(CHARACTER_ATTRIBUTE_ENDURANCE) + pPlayers[pl]->sHealth + pPlayers[pl]->uEndurance >= 1
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
779 || (signed __int64)pPlayers[pl]->pPlayerBuffs[PLAYER_BUFF_PRESERVATION].uExpireTime > 0 )
0
Ritor1
parents:
diff changeset
780 {
2062
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
781 if ( pPlayers[pl]->sHealth < 1 )
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
782 pPlayers[pl]->SetCondition(Condition_Unconcious, 0);
0
Ritor1
parents:
diff changeset
783 }
Ritor1
parents:
diff changeset
784 else
2062
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
785 pPlayers[pl]->SetCondition(Condition_Dead, 0);
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
786 if ( pPlayers[pl]->field_E0 )
0
Ritor1
parents:
diff changeset
787 {
2062
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
788 v24 = pPlayers[pl]->field_E0 - pEventTimer->uTimeElapsed;
0
Ritor1
parents:
diff changeset
789 if ( v24 > 0 )
2062
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
790 pPlayers[pl]->field_E0 = v24;
0
Ritor1
parents:
diff changeset
791 else
Ritor1
parents:
diff changeset
792 {
2062
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
793 pPlayers[pl]->field_E0 = 0;
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
794 viewparams->bRedrawGameUI = true;
0
Ritor1
parents:
diff changeset
795 }
Ritor1
parents:
diff changeset
796 }
2062
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
797 if ( pPlayers[pl]->field_E4 )
0
Ritor1
parents:
diff changeset
798 {
2062
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
799 v26 = pPlayers[pl]->field_E4 - pEventTimer->uTimeElapsed;
0
Ritor1
parents:
diff changeset
800 if ( v26 > 0 )
2062
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
801 pPlayers[pl]->field_E4 = v26;
0
Ritor1
parents:
diff changeset
802 else
Ritor1
parents:
diff changeset
803 {
2062
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
804 pPlayers[pl]->field_E4 = 0;
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
805 viewparams->bRedrawGameUI = true;
0
Ritor1
parents:
diff changeset
806 }
Ritor1
parents:
diff changeset
807 }
2062
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
808 if ( pPlayers[pl]->field_E8 )
0
Ritor1
parents:
diff changeset
809 {
2062
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
810 v28 = pPlayers[pl]->field_E8 - pEventTimer->uTimeElapsed;
0
Ritor1
parents:
diff changeset
811 if ( v28 > 0 )
2062
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
812 pPlayers[pl]->field_E8 = v28;
0
Ritor1
parents:
diff changeset
813 else
Ritor1
parents:
diff changeset
814 {
2062
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
815 pPlayers[pl]->field_E8 = 0;
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
816 viewparams->bRedrawGameUI = true;
0
Ritor1
parents:
diff changeset
817 }
Ritor1
parents:
diff changeset
818 }
2062
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
819 if ( pPlayers[pl]->field_EC )
0
Ritor1
parents:
diff changeset
820 {
2062
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
821 v30 = pPlayers[pl]->field_EC - pEventTimer->uTimeElapsed;
0
Ritor1
parents:
diff changeset
822 if ( v30 > 0 )
2062
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
823 pPlayers[pl]->field_EC = v30;
0
Ritor1
parents:
diff changeset
824 else
Ritor1
parents:
diff changeset
825 {
2062
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
826 pPlayers[pl]->field_EC = 0;
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
827 viewparams->bRedrawGameUI = true;
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
828 }
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
829 }
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
830 if ( pPlayers[pl]->field_F0 )
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
831 {
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
832 v32 = pPlayers[pl]->field_F0 - pEventTimer->uTimeElapsed;
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
833 if ( v32 > 0 )
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
834 pPlayers[pl]->field_F0 = v32;
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
835 else
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
836 {
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
837 pPlayers[pl]->field_F0 = 0;
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
838 viewparams->bRedrawGameUI = true;
0
Ritor1
parents:
diff changeset
839 }
Ritor1
parents:
diff changeset
840 }
2062
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
841 if ( pPlayers[pl]->field_F4 )
0
Ritor1
parents:
diff changeset
842 {
2062
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
843 v34 = pPlayers[pl]->field_F4 - pEventTimer->uTimeElapsed;
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
844 if ( v34 > 0 )
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
845 pPlayers[pl]->field_F4 = v34;
0
Ritor1
parents:
diff changeset
846 else
Ritor1
parents:
diff changeset
847 {
2062
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
848 pPlayers[pl]->field_F4 = 0;
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
849 viewparams->bRedrawGameUI = true;
0
Ritor1
parents:
diff changeset
850 }
Ritor1
parents:
diff changeset
851 }
2062
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
852 if ( pPlayers[pl]->field_F8 )
0
Ritor1
parents:
diff changeset
853 {
2062
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
854 v36 = pPlayers[pl]->field_F8 - pEventTimer->uTimeElapsed;
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
855 if ( v36 > 0 )
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
856 pPlayers[pl]->field_F8 = v36;
0
Ritor1
parents:
diff changeset
857 else
Ritor1
parents:
diff changeset
858 {
2062
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
859 pPlayers[pl]->field_F8 = 0;
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
860 viewparams->bRedrawGameUI = true;
0
Ritor1
parents:
diff changeset
861 }
Ritor1
parents:
diff changeset
862 }
2062
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
863 if ( pPlayers[pl]->field_FC )
0
Ritor1
parents:
diff changeset
864 {
2062
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
865 v38 = pPlayers[pl]->field_FC - pEventTimer->uTimeElapsed;
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
866 if ( v38 > 0 )
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
867 pPlayers[pl]->field_FC = v38;
0
Ritor1
parents:
diff changeset
868 else
Ritor1
parents:
diff changeset
869 {
2062
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
870 pPlayers[pl]->field_FC = 0;
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
871 viewparams->bRedrawGameUI = true;
0
Ritor1
parents:
diff changeset
872 }
Ritor1
parents:
diff changeset
873 }
2062
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
874 if ( pPlayers[pl]->field_100 )
0
Ritor1
parents:
diff changeset
875 {
2062
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
876 v40 = pPlayers[pl]->field_100 - pEventTimer->uTimeElapsed;
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
877 if ( v40 > 0 )
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
878 pPlayers[pl]->field_100 = v40;
0
Ritor1
parents:
diff changeset
879 else
Ritor1
parents:
diff changeset
880 {
2062
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
881 pPlayers[pl]->field_100 = 0;
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
882 viewparams->bRedrawGameUI = true;
0
Ritor1
parents:
diff changeset
883 }
Ritor1
parents:
diff changeset
884 }
2062
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
885 if ( pPlayers[pl]->field_104 )
0
Ritor1
parents:
diff changeset
886 {
2062
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
887 v42 = pPlayers[pl]->field_104 - pEventTimer->uTimeElapsed;
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
888 if ( v42 > 0 )
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
889 pPlayers[pl]->field_104 = v42;
0
Ritor1
parents:
diff changeset
890 else
Ritor1
parents:
diff changeset
891 {
2062
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
892 pPlayers[pl]->field_104 = 0;
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
893 viewparams->bRedrawGameUI = true;
0
Ritor1
parents:
diff changeset
894 }
Ritor1
parents:
diff changeset
895 }
2062
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
896 if ( pPlayers[pl]->pConditions[Condition_Sleep] | pPlayers[pl]->pConditions[Condition_Paralyzed]
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
897 | pPlayers[pl]->pConditions[Condition_Unconcious] | pPlayers[pl]->pConditions[Condition_Dead]
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
898 | pPlayers[pl]->pConditions[Condition_Pertified] | pPlayers[pl]->pConditions[Condition_Eradicated] )
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
899 --party_condition_flag;
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
900 v43 = (signed __int64)pPlayers[pl]->pPlayerBuffs[PLAYER_BUFF_HASTE].uExpireTime > 0; //ñïåøêà
0
Ritor1
parents:
diff changeset
901
2062
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
902 for ( uint k = 0; k < 24; ++k )
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
903 pPlayers[pl]->pPlayerBuffs[k].IsBuffExpiredToTime(pParty->uTimePlayed);
0
Ritor1
parents:
diff changeset
904
2062
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
905 if ( v43 && (signed __int64)pPlayers[pl]->pPlayerBuffs[7].uExpireTime <= 0 )
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
906 pPlayers[pl]->SetCondition(Condition_Weak, 0);
0
Ritor1
parents:
diff changeset
907 }
2062
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
908
1167
15ad868d972f pPartyBuffs - change plain numbers to enums
Grumpy7
parents: 1165
diff changeset
909 v46 = (signed __int64)pParty->pPartyBuffs[PARTY_BUFF_HASTE].uExpireTime > 0;
0
Ritor1
parents:
diff changeset
910
Ritor1
parents:
diff changeset
911 for (uint i = 0; i < 20; ++i)
Ritor1
parents:
diff changeset
912 {
1340
22cb507446a4 turnengine refactoring continue
Gloval
parents: 1339
diff changeset
913 if (pParty->pPartyBuffs[i].IsBuffExpiredToTime(pParty->uTimePlayed) == 1)
2062
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
914 viewparams->bRedrawGameUI = true;
0
Ritor1
parents:
diff changeset
915 }
Ritor1
parents:
diff changeset
916
1167
15ad868d972f pPartyBuffs - change plain numbers to enums
Grumpy7
parents: 1165
diff changeset
917 if ( v46 && (signed __int64)pParty->pPartyBuffs[PARTY_BUFF_HASTE].uExpireTime <= 0 )
0
Ritor1
parents:
diff changeset
918 {
Ritor1
parents:
diff changeset
919 for (uint i = 0; i < 4; ++i)
Ritor1
parents:
diff changeset
920 pParty->pPlayers[i].SetCondition(1, 0);
Ritor1
parents:
diff changeset
921 }
Ritor1
parents:
diff changeset
922
Ritor1
parents:
diff changeset
923 for (uint i = 0; i < 2; ++i)
Ritor1
parents:
diff changeset
924 {
1980
c1c74df0a33e changing most of auto types to their actual types
Grumpy7
parents: 1914
diff changeset
925 SpellBuff* pBuf = &pParty->pPartyBuffs[dword_4EE07C[i]];
0
Ritor1
parents:
diff changeset
926 if (pBuf->uExpireTime == 0)
Ritor1
parents:
diff changeset
927 continue;
Ritor1
parents:
diff changeset
928
Ritor1
parents:
diff changeset
929 if ( !(pBuf->uFlags & 1) )
Ritor1
parents:
diff changeset
930 {
Ritor1
parents:
diff changeset
931 if (!pPlayers[pBuf->uCaster]->CanAct())
Ritor1
parents:
diff changeset
932 {
Ritor1
parents:
diff changeset
933 pBuf->Reset();
2065
87be06553c76 rename int _47F223_LooksLikeGenerateMonsterLoot() to void ArrangeSpriteObjects()
Ritor1
parents: 2063
diff changeset
934 if (dword_4EE07C[i] == PARTY_BUFF_FLY )
0
Ritor1
parents:
diff changeset
935 pParty->bFlying = false;
Ritor1
parents:
diff changeset
936 }
Ritor1
parents:
diff changeset
937 }
Ritor1
parents:
diff changeset
938 }
Ritor1
parents:
diff changeset
939
2062
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
940 if ( !party_condition_flag )
0
Ritor1
parents:
diff changeset
941 {
151
9abdd40a107b pCurrentScreen
Ritor1
parents: 150
diff changeset
942 if ( pCurrentScreen != SCREEN_REST )
0
Ritor1
parents:
diff changeset
943 {
2062
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
944 for ( uint pl = 1; pl <= 4; pl++ )
0
Ritor1
parents:
diff changeset
945 {
2062
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
946 if ( pPlayers[pl]->pConditions[Condition_Sleep] )
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
947 {
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
948 pPlayers[pl]->pConditions[Condition_Sleep] = 0;
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
949 party_condition_flag = 1;
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
950 break;
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
951 }
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
952 }
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
953 if ( !party_condition_flag || dword_5C35C0 )
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
954 uGameState = GAME_STATE_PARTY_DIED;
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
955 }
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
956 }
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
957
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
958 if ( uActiveCharacter )//âûáîð ñëåäóþùåãî ïîñëå ïðîïóñêàþùåãî õîä
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
959 {
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
960 if ( pCurrentScreen != SCREEN_REST )
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
961 {
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
962 if ( pPlayers[uActiveCharacter]->pConditions[Condition_Sleep]
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
963 || pPlayers[uActiveCharacter]->pConditions[Condition_Paralyzed]
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
964 || pPlayers[uActiveCharacter]->pConditions[Condition_Unconcious]
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
965 || pPlayers[uActiveCharacter]->pConditions[Condition_Dead]
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
966 || pPlayers[uActiveCharacter]->pConditions[Condition_Pertified]
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
967 || pPlayers[uActiveCharacter]->pConditions[Condition_Eradicated] )
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
968 {
c2a004e7458b _494035_timed_effects__water_walking_damage__etc()
Ritor1
parents: 2060
diff changeset
969 viewparams->bRedrawGameUI = true;
0
Ritor1
parents:
diff changeset
970 uActiveCharacter = pParty->GetNextActiveCharacter();
Ritor1
parents:
diff changeset
971 }
Ritor1
parents:
diff changeset
972 }
Ritor1
parents:
diff changeset
973 }
Ritor1
parents:
diff changeset
974 }
Ritor1
parents:
diff changeset
975
Ritor1
parents:
diff changeset
976 //----- (00494820) --------------------------------------------------------
758
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
977 unsigned int __fastcall _494820_training_time(unsigned int a1)
0
Ritor1
parents:
diff changeset
978 {
Ritor1
parents:
diff changeset
979 signed int v1; // eax@1
Ritor1
parents:
diff changeset
980
Ritor1
parents:
diff changeset
981 v1 = 5;
758
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
982 if ( a1 % 24 >= 5 )
0
Ritor1
parents:
diff changeset
983 v1 = 29;
758
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 749
diff changeset
984 return v1 - a1 % 24;
0
Ritor1
parents:
diff changeset
985 }
Ritor1
parents:
diff changeset
986
Ritor1
parents:
diff changeset
987 //----- (00494836) --------------------------------------------------------
Ritor1
parents:
diff changeset
988 int stru339_spell_sound::_494836(int uSoundID, int a6)
Ritor1
parents:
diff changeset
989 {
Ritor1
parents:
diff changeset
990 int v3; // esi@1
Ritor1
parents:
diff changeset
991 int result; // eax@1
2103
2318216e5206 stru_AA1058[i]._494836() continue
Ritor1
parents: 2102
diff changeset
992 //stru339_spell_sound *v5; // ebx@1
0
Ritor1
parents:
diff changeset
993 int *v6; // edi@2
Ritor1
parents:
diff changeset
994 unsigned int v7; // eax@3
Ritor1
parents:
diff changeset
995 int v8; // [sp+Ch] [bp-8h]@3
Ritor1
parents:
diff changeset
996 int v9; // [sp+10h] [bp-4h]@2
Ritor1
parents:
diff changeset
997 int a2a; // [sp+1Ch] [bp+8h]@1
2103
2318216e5206 stru_AA1058[i]._494836() continue
Ritor1
parents: 2102
diff changeset
998 //return 0;
0
Ritor1
parents:
diff changeset
999 v3 = 0;
Ritor1
parents:
diff changeset
1000 result = word_4EE088_sound_ids[uSoundID];
2103
2318216e5206 stru_AA1058[i]._494836() continue
Ritor1
parents: 2102
diff changeset
1001 //v5 = this;
0
Ritor1
parents:
diff changeset
1002 a2a = word_4EE088_sound_ids[uSoundID];
2103
2318216e5206 stru_AA1058[i]._494836() continue
Ritor1
parents: 2102
diff changeset
1003 if ( word_4EE088_sound_ids[uSoundID] )
0
Ritor1
parents:
diff changeset
1004 {
Ritor1
parents:
diff changeset
1005 v6 = this->pSoundsOffsets;
2103
2318216e5206 stru_AA1058[i]._494836() continue
Ritor1
parents: 2102
diff changeset
1006 for ( v9 = 0; v9 < 2; ++v9 )
0
Ritor1
parents:
diff changeset
1007 {
Ritor1
parents:
diff changeset
1008 v7 = a2a++;
2103
2318216e5206 stru_AA1058[i]._494836() continue
Ritor1
parents: 2102
diff changeset
1009 result = pSoundList->LoadSound(v7, (char *)this + v3, 44744 - v3, &v8, a6);
0
Ritor1
parents:
diff changeset
1010 if ( !result )
Ritor1
parents:
diff changeset
1011 break;
Ritor1
parents:
diff changeset
1012 a6 += 4;
Ritor1
parents:
diff changeset
1013 result = v8 + 256;
2103
2318216e5206 stru_AA1058[i]._494836() continue
Ritor1
parents: 2102
diff changeset
1014 this->pSoundsOffsets[v9] = v3;
0
Ritor1
parents:
diff changeset
1015 v3 += result;
2103
2318216e5206 stru_AA1058[i]._494836() continue
Ritor1
parents: 2102
diff changeset
1016 this->pSoundsSizes[v9] = v8 + 256;
0
Ritor1
parents:
diff changeset
1017 ++v6;
Ritor1
parents:
diff changeset
1018 }
Ritor1
parents:
diff changeset
1019 }
Ritor1
parents:
diff changeset
1020 return result;
Ritor1
parents:
diff changeset
1021 }
Ritor1
parents:
diff changeset
1022 // 4EE088: using guessed type __int16 word_4EE088_sound_ids[];
Ritor1
parents:
diff changeset
1023
Ritor1
parents:
diff changeset
1024 //----- (00494AED) --------------------------------------------------------
130
1c471f3629fb Party expressions update
Nomad
parents: 121
diff changeset
1025 unsigned int PlayerFrameTable::GetFrameIdByExpression(CHARACTER_EXPRESSION_ID expression)
0
Ritor1
parents:
diff changeset
1026 {
2103
2318216e5206 stru_AA1058[i]._494836() continue
Ritor1
parents: 2102
diff changeset
1027 for ( uint i = 0; i < this->uNumFrames; i++ )
0
Ritor1
parents:
diff changeset
1028 {
2103
2318216e5206 stru_AA1058[i]._494836() continue
Ritor1
parents: 2102
diff changeset
1029 if ( this->pFrames[i].expression == expression )
2318216e5206 stru_AA1058[i]._494836() continue
Ritor1
parents: 2102
diff changeset
1030 return i;
0
Ritor1
parents:
diff changeset
1031 }
2103
2318216e5206 stru_AA1058[i]._494836() continue
Ritor1
parents: 2102
diff changeset
1032 return 0;
0
Ritor1
parents:
diff changeset
1033 }
Ritor1
parents:
diff changeset
1034
Ritor1
parents:
diff changeset
1035 //----- (00494B10) --------------------------------------------------------
Ritor1
parents:
diff changeset
1036 PlayerFrame *PlayerFrameTable::GetFrameBy_x(unsigned int uFramesetID, unsigned int uFrameID)
Ritor1
parents:
diff changeset
1037 {
Ritor1
parents:
diff changeset
1038 unsigned int v3; // esi@1
Ritor1
parents:
diff changeset
1039 PlayerFrame *v4; // edi@1
Ritor1
parents:
diff changeset
1040 PlayerFrame *v5; // ecx@1
Ritor1
parents:
diff changeset
1041 __int16 v6; // dx@2
Ritor1
parents:
diff changeset
1042 int v7; // edx@3
Ritor1
parents:
diff changeset
1043 char *i; // eax@3
Ritor1
parents:
diff changeset
1044 int v9; // ecx@5
Ritor1
parents:
diff changeset
1045 PlayerFrame *result; // eax@6
Ritor1
parents:
diff changeset
1046
Ritor1
parents:
diff changeset
1047 v3 = uFramesetID;
Ritor1
parents:
diff changeset
1048 v4 = this->pFrames;
Ritor1
parents:
diff changeset
1049 v5 = &v4[uFramesetID];
Ritor1
parents:
diff changeset
1050 if ( v5->uFlags & 1 && (v6 = v5->uAnimLength) != 0 )
Ritor1
parents:
diff changeset
1051 {
Ritor1
parents:
diff changeset
1052 v7 = ((signed int)uFrameID >> 3) % (unsigned __int16)v6;
Ritor1
parents:
diff changeset
1053 for ( i = (char *)&v5->uAnimTime; ; i += 10 )
Ritor1
parents:
diff changeset
1054 {
Ritor1
parents:
diff changeset
1055 v9 = *(short *)i;
Ritor1
parents:
diff changeset
1056 if ( v7 <= v9 )
Ritor1
parents:
diff changeset
1057 break;
Ritor1
parents:
diff changeset
1058 v7 -= v9;
Ritor1
parents:
diff changeset
1059 ++v3;
Ritor1
parents:
diff changeset
1060 }
Ritor1
parents:
diff changeset
1061 result = &v4[v3];
Ritor1
parents:
diff changeset
1062 }
Ritor1
parents:
diff changeset
1063 else
Ritor1
parents:
diff changeset
1064 {
Ritor1
parents:
diff changeset
1065 result = &v4[uFramesetID];
Ritor1
parents:
diff changeset
1066 }
Ritor1
parents:
diff changeset
1067 return result;
Ritor1
parents:
diff changeset
1068 }
Ritor1
parents:
diff changeset
1069
Ritor1
parents:
diff changeset
1070 //----- (00494B5E) --------------------------------------------------------
554
9caf59edb1ee Cave and Temple load and even doesn't crash (for a while).
Nomad
parents: 526
diff changeset
1071 PlayerFrame *PlayerFrameTable::GetFrameBy_y(int *pFramesetID, int *pAnimTime, int a4)
0
Ritor1
parents:
diff changeset
1072 {
Ritor1
parents:
diff changeset
1073 PlayerFrameTable *v4; // edi@1
Ritor1
parents:
diff changeset
1074 int v5; // esi@1
Ritor1
parents:
diff changeset
1075 int v6; // eax@2
Ritor1
parents:
diff changeset
1076
Ritor1
parents:
diff changeset
1077 v4 = this;
554
9caf59edb1ee Cave and Temple load and even doesn't crash (for a while).
Nomad
parents: 526
diff changeset
1078 v5 = a4 + *pAnimTime;
9caf59edb1ee Cave and Temple load and even doesn't crash (for a while).
Nomad
parents: 526
diff changeset
1079 if ( v5 < 8 * this->pFrames[*pFramesetID].uAnimTime )
9caf59edb1ee Cave and Temple load and even doesn't crash (for a while).
Nomad
parents: 526
diff changeset
1080 {
9caf59edb1ee Cave and Temple load and even doesn't crash (for a while).
Nomad
parents: 526
diff changeset
1081 *pAnimTime = v5;
0
Ritor1
parents:
diff changeset
1082 }
Ritor1
parents:
diff changeset
1083 else
Ritor1
parents:
diff changeset
1084 {
Ritor1
parents:
diff changeset
1085 v6 = rand() % 4 + 21;
554
9caf59edb1ee Cave and Temple load and even doesn't crash (for a while).
Nomad
parents: 526
diff changeset
1086 *pFramesetID = v6;
9caf59edb1ee Cave and Temple load and even doesn't crash (for a while).
Nomad
parents: 526
diff changeset
1087 *pAnimTime = 8 * v5 % v4->pFrames[v6].uAnimTime;
9caf59edb1ee Cave and Temple load and even doesn't crash (for a while).
Nomad
parents: 526
diff changeset
1088 }
9caf59edb1ee Cave and Temple load and even doesn't crash (for a while).
Nomad
parents: 526
diff changeset
1089 return &v4->pFrames[*pFramesetID];
0
Ritor1
parents:
diff changeset
1090 }
Ritor1
parents:
diff changeset
1091
Ritor1
parents:
diff changeset
1092 //----- (00494BC3) --------------------------------------------------------
Ritor1
parents:
diff changeset
1093 void PlayerFrameTable::ToFile()
Ritor1
parents:
diff changeset
1094 {
Ritor1
parents:
diff changeset
1095 PlayerFrameTable *v1; // esi@1
Ritor1
parents:
diff changeset
1096 FILE *v2; // eax@1
Ritor1
parents:
diff changeset
1097 FILE *v3; // edi@1
Ritor1
parents:
diff changeset
1098
1980
c1c74df0a33e changing most of auto types to their actual types
Grumpy7
parents: 1914
diff changeset
1099 PlayerFrameTable* Str = this;
0
Ritor1
parents:
diff changeset
1100
Ritor1
parents:
diff changeset
1101 v1 = Str;
Ritor1
parents:
diff changeset
1102 v2 = fopen("data\\dpft.bin", "wb");
Ritor1
parents:
diff changeset
1103 v3 = v2;
Ritor1
parents:
diff changeset
1104 if ( !v2 )
1545
c4ab816fcc5e assert, Abortf, AbortWithError -> Assert, Error
Nomad
parents: 1529
diff changeset
1105 Error("Unable to save dpft.bin");
0
Ritor1
parents:
diff changeset
1106 fwrite(v1, 4u, 1u, v2);
Ritor1
parents:
diff changeset
1107 fwrite(v1->pFrames, 0xAu, v1->uNumFrames, v3);
Ritor1
parents:
diff changeset
1108 fclose(v3);
Ritor1
parents:
diff changeset
1109 }
Ritor1
parents:
diff changeset
1110
Ritor1
parents:
diff changeset
1111 //----- (00494C0F) --------------------------------------------------------
1477
7ef4b64f6329 * LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents: 1461
diff changeset
1112 void PlayerFrameTable::FromFile(void *data_mm6, void *data_mm7, void *data_mm8)
0
Ritor1
parents:
diff changeset
1113 {
1477
7ef4b64f6329 * LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents: 1461
diff changeset
1114 uint num_mm6_frames = data_mm6 ? *(int *)data_mm6 : 0,
7ef4b64f6329 * LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents: 1461
diff changeset
1115 num_mm7_frames = data_mm7 ? *(int *)data_mm7 : 0,
7ef4b64f6329 * LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents: 1461
diff changeset
1116 num_mm8_frames = data_mm8 ? *(int *)data_mm8 : 0;
7ef4b64f6329 * LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents: 1461
diff changeset
1117 uNumFrames = num_mm6_frames + num_mm7_frames + num_mm8_frames;
7ef4b64f6329 * LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents: 1461
diff changeset
1118 assert(uNumFrames);
7ef4b64f6329 * LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents: 1461
diff changeset
1119 assert(!num_mm8_frames);
7ef4b64f6329 * LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents: 1461
diff changeset
1120
1583
75fafd8ced59 Allocator (CMemory) bye-bye
Nomad
parents: 1567
diff changeset
1121 pFrames = (PlayerFrame *)malloc(uNumFrames * sizeof(PlayerFrame));
1477
7ef4b64f6329 * LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents: 1461
diff changeset
1122 memcpy(pFrames, (char *)data_mm7 + 4, num_mm7_frames * sizeof(PlayerFrame));
7ef4b64f6329 * LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents: 1461
diff changeset
1123 memcpy(pFrames + num_mm7_frames, (char *)data_mm6 + 4, num_mm6_frames * sizeof(PlayerFrame));
7ef4b64f6329 * LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents: 1461
diff changeset
1124 memcpy(pFrames + num_mm6_frames + num_mm7_frames, (char *)data_mm8 + 4, num_mm8_frames * sizeof(PlayerFrame));
0
Ritor1
parents:
diff changeset
1125 }
Ritor1
parents:
diff changeset
1126
Ritor1
parents:
diff changeset
1127 //----- (00494C5A) --------------------------------------------------------
Ritor1
parents:
diff changeset
1128 int PlayerFrameTable::FromFileTxt(const char *Args)
Ritor1
parents:
diff changeset
1129 {
Ritor1
parents:
diff changeset
1130 PlayerFrameTable *v2; // ebx@1
Ritor1
parents:
diff changeset
1131 FILE *v3; // eax@1
Ritor1
parents:
diff changeset
1132 int v4; // esi@3
Ritor1
parents:
diff changeset
1133 void *v5; // eax@10
Ritor1
parents:
diff changeset
1134 FILE *v6; // ST0C_4@12
Ritor1
parents:
diff changeset
1135 char *i; // eax@12
Ritor1
parents:
diff changeset
1136 __int16 v8; // ax@15
Ritor1
parents:
diff changeset
1137 const char *v9; // ST10_4@15
Ritor1
parents:
diff changeset
1138 unsigned __int16 v10; // ax@15
Ritor1
parents:
diff changeset
1139 const char *v11; // ST0C_4@15
Ritor1
parents:
diff changeset
1140 int j; // esi@15
Ritor1
parents:
diff changeset
1141 int v13; // eax@17
Ritor1
parents:
diff changeset
1142 int v14; // edx@22
Ritor1
parents:
diff changeset
1143 int v15; // ecx@23
Ritor1
parents:
diff changeset
1144 int v16; // eax@24
Ritor1
parents:
diff changeset
1145 signed int k; // eax@27
Ritor1
parents:
diff changeset
1146 PlayerFrame *v18; // edx@28
Ritor1
parents:
diff changeset
1147 int v19; // esi@28
Ritor1
parents:
diff changeset
1148 int l; // ecx@29
Ritor1
parents:
diff changeset
1149 char Buf; // [sp+Ch] [bp-2F8h]@3
Ritor1
parents:
diff changeset
1150 FrameTableTxtLine v23; // [sp+200h] [bp-104h]@4
Ritor1
parents:
diff changeset
1151 FrameTableTxtLine v24; // [sp+27Ch] [bp-88h]@4
Ritor1
parents:
diff changeset
1152 int v25; // [sp+2F8h] [bp-Ch]@3
Ritor1
parents:
diff changeset
1153 int v26; // [sp+2FCh] [bp-8h]@3
Ritor1
parents:
diff changeset
1154 FILE *File; // [sp+300h] [bp-4h]@1
Ritor1
parents:
diff changeset
1155 int Argsa; // [sp+30Ch] [bp+8h]@28
Ritor1
parents:
diff changeset
1156
Ritor1
parents:
diff changeset
1157 v2 = this;
Ritor1
parents:
diff changeset
1158 //TileTable::dtor((TileTable *)this);
Ritor1
parents:
diff changeset
1159 v3 = fopen(Args, "r");
Ritor1
parents:
diff changeset
1160 File = v3;
Ritor1
parents:
diff changeset
1161 if ( !v3 )
1545
c4ab816fcc5e assert, Abortf, AbortWithError -> Assert, Error
Nomad
parents: 1529
diff changeset
1162 Error("PlayerFrameTable::load - Unable to open file: %s.", Args);
0
Ritor1
parents:
diff changeset
1163 v4 = 0;
Ritor1
parents:
diff changeset
1164 v25 = 0;
Ritor1
parents:
diff changeset
1165 v26 = 1;
Ritor1
parents:
diff changeset
1166 if ( fgets(&Buf, 490, v3) )
Ritor1
parents:
diff changeset
1167 {
Ritor1
parents:
diff changeset
1168 do
Ritor1
parents:
diff changeset
1169 {
Ritor1
parents:
diff changeset
1170 *strchr(&Buf, 10) = 0;
703
a9c1fb7483c2 monster parser almost complete.
Gloval
parents: 701
diff changeset
1171 memcpy(&v24, txt_file_frametable_parser(&Buf, &v23), sizeof(v24));
701
d5b16a44d9b3 frame_table parser, new files for UI func
Gloval
parents: 697
diff changeset
1172 if ( v24.uPropCount && *v24.pProperties[0] != 47 )
d5b16a44d9b3 frame_table parser, new files for UI func
Gloval
parents: 697
diff changeset
1173 {
d5b16a44d9b3 frame_table parser, new files for UI func
Gloval
parents: 697
diff changeset
1174 if ( v24.uPropCount < 3 )
1545
c4ab816fcc5e assert, Abortf, AbortWithError -> Assert, Error
Nomad
parents: 1529
diff changeset
1175 Error("PlayerFrameTable::load, too few arguments, %s line %i.", Args, v26);
0
Ritor1
parents:
diff changeset
1176 ++v25;
Ritor1
parents:
diff changeset
1177 }
Ritor1
parents:
diff changeset
1178 ++v26;
Ritor1
parents:
diff changeset
1179 }
Ritor1
parents:
diff changeset
1180 while ( fgets(&Buf, 490, File) );
Ritor1
parents:
diff changeset
1181 v4 = v25;
Ritor1
parents:
diff changeset
1182 }
Ritor1
parents:
diff changeset
1183 v2->uNumFrames = v4;
1583
75fafd8ced59 Allocator (CMemory) bye-bye
Nomad
parents: 1567
diff changeset
1184 v5 = malloc(10 * v4);
0
Ritor1
parents:
diff changeset
1185 v2->pFrames = (PlayerFrame *)v5;
Ritor1
parents:
diff changeset
1186 if ( !v5 )
1545
c4ab816fcc5e assert, Abortf, AbortWithError -> Assert, Error
Nomad
parents: 1529
diff changeset
1187 Error("PlayerFrameTable::load - Out of Memory!");
0
Ritor1
parents:
diff changeset
1188 v6 = File;
Ritor1
parents:
diff changeset
1189 v2->uNumFrames = 0;
Ritor1
parents:
diff changeset
1190 fseek(v6, 0, 0);
Ritor1
parents:
diff changeset
1191 for ( i = fgets(&Buf, 490, File); i; i = fgets(&Buf, 490, File) )
Ritor1
parents:
diff changeset
1192 {
Ritor1
parents:
diff changeset
1193 *strchr(&Buf, 10) = 0;
703
a9c1fb7483c2 monster parser almost complete.
Gloval
parents: 701
diff changeset
1194 memcpy(&v24, txt_file_frametable_parser(&Buf, &v23), sizeof(v24));
701
d5b16a44d9b3 frame_table parser, new files for UI func
Gloval
parents: 697
diff changeset
1195 if ( v24.uPropCount && *v24.pProperties[0] != 47 )
0
Ritor1
parents:
diff changeset
1196 {
Ritor1
parents:
diff changeset
1197 v8 = atoi(v24.pProperties[0]);
Ritor1
parents:
diff changeset
1198 v9 = v24.pProperties[1];
130
1c471f3629fb Party expressions update
Nomad
parents: 121
diff changeset
1199 v2->pFrames[v2->uNumFrames].expression = (CHARACTER_EXPRESSION_ID)v8;
0
Ritor1
parents:
diff changeset
1200 v10 = atoi(v9);
Ritor1
parents:
diff changeset
1201 v11 = v24.pProperties[2];
Ritor1
parents:
diff changeset
1202 v2->pFrames[v2->uNumFrames].uTextureID = v10;
Ritor1
parents:
diff changeset
1203 v2->pFrames[v2->uNumFrames].uAnimTime = atoi(v11);
Ritor1
parents:
diff changeset
1204 v2->pFrames[v2->uNumFrames].uAnimLength = 0;
Ritor1
parents:
diff changeset
1205 v2->pFrames[v2->uNumFrames].uFlags = 0;
701
d5b16a44d9b3 frame_table parser, new files for UI func
Gloval
parents: 697
diff changeset
1206 for ( j = 3; j < v24.uPropCount; ++j )
0
Ritor1
parents:
diff changeset
1207 {
1104
5d5c78088274 strcmpi to stricmp conversion
Grumpy7
parents: 1093
diff changeset
1208 if ( !_stricmp(v24.pProperties[j], "New") )
0
Ritor1
parents:
diff changeset
1209 {
Ritor1
parents:
diff changeset
1210 v13 = (int)&v2->pFrames[v2->uNumFrames].uFlags;
Ritor1
parents:
diff changeset
1211 *(char *)v13 |= 4u;
Ritor1
parents:
diff changeset
1212 }
Ritor1
parents:
diff changeset
1213 }
Ritor1
parents:
diff changeset
1214 ++v2->uNumFrames;
Ritor1
parents:
diff changeset
1215 }
Ritor1
parents:
diff changeset
1216 }
Ritor1
parents:
diff changeset
1217 fclose(File);
Ritor1
parents:
diff changeset
1218 v14 = 0;
Ritor1
parents:
diff changeset
1219 if ( (signed int)(v2->uNumFrames - 1) > 0 )
Ritor1
parents:
diff changeset
1220 {
Ritor1
parents:
diff changeset
1221 v15 = 0;
Ritor1
parents:
diff changeset
1222 do
Ritor1
parents:
diff changeset
1223 {
Ritor1
parents:
diff changeset
1224 v16 = (int)&v2->pFrames[v15];
Ritor1
parents:
diff changeset
1225 if ( !(*(char *)(v16 + 18) & 4) )
Ritor1
parents:
diff changeset
1226 *(char *)(v16 + 8) |= 1u;
Ritor1
parents:
diff changeset
1227 ++v14;
Ritor1
parents:
diff changeset
1228 ++v15;
Ritor1
parents:
diff changeset
1229 }
Ritor1
parents:
diff changeset
1230 while ( v14 < (signed int)(v2->uNumFrames - 1) );
Ritor1
parents:
diff changeset
1231 }
Ritor1
parents:
diff changeset
1232 for ( k = 0; k < (signed int)v2->uNumFrames; *(short *)(Argsa + 6) = v19 )
Ritor1
parents:
diff changeset
1233 {
Ritor1
parents:
diff changeset
1234 v18 = v2->pFrames;
Ritor1
parents:
diff changeset
1235 Argsa = (int)&v18[k];
Ritor1
parents:
diff changeset
1236 v19 = *(short *)(Argsa + 4);
Ritor1
parents:
diff changeset
1237 if ( *(char *)(Argsa + 8) & 1 )
Ritor1
parents:
diff changeset
1238 {
Ritor1
parents:
diff changeset
1239 ++k;
Ritor1
parents:
diff changeset
1240 for ( l = (int)&v18[k]; *(char *)(l + 8) & 1; l += 10 )
Ritor1
parents:
diff changeset
1241 {
Ritor1
parents:
diff changeset
1242 v19 += *(short *)(l + 4);
Ritor1
parents:
diff changeset
1243 ++k;
Ritor1
parents:
diff changeset
1244 }
Ritor1
parents:
diff changeset
1245 LOWORD(v19) = v18[k].uAnimTime + v19;
Ritor1
parents:
diff changeset
1246 }
Ritor1
parents:
diff changeset
1247 ++k;
Ritor1
parents:
diff changeset
1248 }
Ritor1
parents:
diff changeset
1249 return 1;
Ritor1
parents:
diff changeset
1250 }
Ritor1
parents:
diff changeset
1251
Ritor1
parents:
diff changeset
1252 //----- (00495366) --------------------------------------------------------
Ritor1
parents:
diff changeset
1253 char *__fastcall sub_495366(unsigned __int8 a1, unsigned __int8 a2)
Ritor1
parents:
diff changeset
1254 {
Ritor1
parents:
diff changeset
1255 int v2; // edi@1
Ritor1
parents:
diff changeset
1256 int v3; // edx@2
Ritor1
parents:
diff changeset
1257 int v4; // esi@3
Ritor1
parents:
diff changeset
1258 int v5; // ebx@5
Ritor1
parents:
diff changeset
1259 signed int v7; // [sp+Ch] [bp-14h]@1
Ritor1
parents:
diff changeset
1260 signed int v8; // [sp+10h] [bp-10h]@1
Ritor1
parents:
diff changeset
1261 int **v9; // [sp+14h] [bp-Ch]@4
Ritor1
parents:
diff changeset
1262 signed int v10; // [sp+18h] [bp-8h]@3
Ritor1
parents:
diff changeset
1263 unsigned __int8 v11; // [sp+1Ch] [bp-4h]@1
Ritor1
parents:
diff changeset
1264
Ritor1
parents:
diff changeset
1265 v2 = a1;
Ritor1
parents:
diff changeset
1266 v11 = a2;
Ritor1
parents:
diff changeset
1267 v8 = 0;
Ritor1
parents:
diff changeset
1268 v7 = 0;
Ritor1
parents:
diff changeset
1269 if ( dword_AE336C == a1 )
Ritor1
parents:
diff changeset
1270 {
Ritor1
parents:
diff changeset
1271 v3 = dword_AE3370;
Ritor1
parents:
diff changeset
1272 }
Ritor1
parents:
diff changeset
1273 else
Ritor1
parents:
diff changeset
1274 {
Ritor1
parents:
diff changeset
1275 v4 = a2;
Ritor1
parents:
diff changeset
1276 dword_AE336C = a1;
Ritor1
parents:
diff changeset
1277 v10 = 0;
Ritor1
parents:
diff changeset
1278 if ( (signed int)pNPCStats->uNumNPCNames[v4] <= 0 )
1419
9a1adf08f4ed more label cleaning 2
zipi
parents: 1413
diff changeset
1279 {
9a1adf08f4ed more label cleaning 2
zipi
parents: 1413
diff changeset
1280 v3 = rand() % (signed int)pNPCStats->uNumNPCNames[v4];
9a1adf08f4ed more label cleaning 2
zipi
parents: 1413
diff changeset
1281 }
9a1adf08f4ed more label cleaning 2
zipi
parents: 1413
diff changeset
1282 else
9a1adf08f4ed more label cleaning 2
zipi
parents: 1413
diff changeset
1283 {
0
Ritor1
parents:
diff changeset
1284 v9 = (int **)((char *)pNPCStats->pNPCNames + v4 * 4);
Ritor1
parents:
diff changeset
1285 do
Ritor1
parents:
diff changeset
1286 {
Ritor1
parents:
diff changeset
1287 v5 = tolower(*(char *)*v9);
Ritor1
parents:
diff changeset
1288 if ( v5 == tolower(v2) )
Ritor1
parents:
diff changeset
1289 {
Ritor1
parents:
diff changeset
1290 if ( v8 )
Ritor1
parents:
diff changeset
1291 v7 = v10;
Ritor1
parents:
diff changeset
1292 else
Ritor1
parents:
diff changeset
1293 v8 = v10;
Ritor1
parents:
diff changeset
1294 }
Ritor1
parents:
diff changeset
1295 ++v10;
Ritor1
parents:
diff changeset
1296 v9 += 2;
Ritor1
parents:
diff changeset
1297 }
Ritor1
parents:
diff changeset
1298 while ( v10 < (signed int)pNPCStats->uNumNPCNames[v4] );
Ritor1
parents:
diff changeset
1299 if ( v8 && v8 != v7 )
Ritor1
parents:
diff changeset
1300 v3 = v8 + rand() % (v7 - v8);
Ritor1
parents:
diff changeset
1301 else
Ritor1
parents:
diff changeset
1302 v3 = rand() % (signed int)pNPCStats->uNumNPCNames[v4];
1419
9a1adf08f4ed more label cleaning 2
zipi
parents: 1413
diff changeset
1303 }
0
Ritor1
parents:
diff changeset
1304 }
Ritor1
parents:
diff changeset
1305 dword_AE3370 = v3;
Ritor1
parents:
diff changeset
1306 return pNPCStats->pNPCNames[0][v11 + 2 * v3];
Ritor1
parents:
diff changeset
1307 }
1459
2ca62c9e7b3c Function names
Nomad
parents: 1458
diff changeset
1308
0
Ritor1
parents:
diff changeset
1309
Ritor1
parents:
diff changeset
1310 //----- (00495430) --------------------------------------------------------
1838
211dfe2d8db1 changing global char* vars to const char* vars
Grumpy7
parents: 1828
diff changeset
1311 const char * GetReputationString( signed int a1 )
607
cfca6297e4ae ArmorShop fixes
Gloval
parents: 606
diff changeset
1312 {
566
fcbb3c281217 QuickRef reputation string fix
Nomad
parents: 554
diff changeset
1313 if (a1 >= 25)
fcbb3c281217 QuickRef reputation string fix
Nomad
parents: 554
diff changeset
1314 return pGlobalTXT_LocalizationStrings[379]; // Hated
fcbb3c281217 QuickRef reputation string fix
Nomad
parents: 554
diff changeset
1315 else if (a1 >= 6)
fcbb3c281217 QuickRef reputation string fix
Nomad
parents: 554
diff changeset
1316 return pGlobalTXT_LocalizationStrings[392]; // Unfriendly
fcbb3c281217 QuickRef reputation string fix
Nomad
parents: 554
diff changeset
1317 else if (a1 >= -5)
fcbb3c281217 QuickRef reputation string fix
Nomad
parents: 554
diff changeset
1318 return pGlobalTXT_LocalizationStrings[399]; // Neutral;
fcbb3c281217 QuickRef reputation string fix
Nomad
parents: 554
diff changeset
1319 else if (a1 >= -24)
fcbb3c281217 QuickRef reputation string fix
Nomad
parents: 554
diff changeset
1320 return pGlobalTXT_LocalizationStrings[402]; // Friendly
0
Ritor1
parents:
diff changeset
1321 else
566
fcbb3c281217 QuickRef reputation string fix
Nomad
parents: 554
diff changeset
1322 return pGlobalTXT_LocalizationStrings[434]; // Respected;
0
Ritor1
parents:
diff changeset
1323 }
Ritor1
parents:
diff changeset
1324
Ritor1
parents:
diff changeset
1325 //----- (00495461) --------------------------------------------------------
1838
211dfe2d8db1 changing global char* vars to const char* vars
Grumpy7
parents: 1828
diff changeset
1326 char *BuildDialogueString(const char *lpsz, unsigned __int8 uPlayerID, ItemGen *a3, char *a4, int a5, __int64 *a6)
0
Ritor1
parents:
diff changeset
1327 {
Ritor1
parents:
diff changeset
1328 Player *pPlayer; // ebx@3
1838
211dfe2d8db1 changing global char* vars to const char* vars
Grumpy7
parents: 1828
diff changeset
1329 const char *pText; // esi@7
0
Ritor1
parents:
diff changeset
1330 int v17; // eax@10
Ritor1
parents:
diff changeset
1331 signed __int64 v18; // qax@18
Ritor1
parents:
diff changeset
1332 unsigned __int8 *v20; // ebx@32
Ritor1
parents:
diff changeset
1333 int v21; // ecx@34
1453
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1334 int pReputation; // eax@45
0
Ritor1
parents:
diff changeset
1335 int v29; // eax@68
Ritor1
parents:
diff changeset
1336 __int16 v55[56]; // [sp+10h] [bp-128h]@34
351
5f36449527c6 stru351 -> summoned/spell-enchanted item
Nomad
parents: 348
diff changeset
1337 stru351_summoned_item v56; // [sp+80h] [bp-B8h]@107
0
Ritor1
parents:
diff changeset
1338 char a1[100]; // [sp+B8h] [bp-80h]@3
Ritor1
parents:
diff changeset
1339 int v63; // [sp+12Ch] [bp-Ch]@32
254
d1af3319bc44 BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents: 250
diff changeset
1340
1453
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1341 if ( IsBadStringPtrA(lpsz, 1) )
0
Ritor1
parents:
diff changeset
1342 return "Invalid String Passed";
254
d1af3319bc44 BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents: 250
diff changeset
1343
0
Ritor1
parents:
diff changeset
1344 a1[0] = 0;
1453
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1345 pPlayer = &pParty->pPlayers[uPlayerID];
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
1346 memset(pTmpBuf2.data(), 0, sizeof(pTmpBuf2));
254
d1af3319bc44 BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents: 250
diff changeset
1347
d1af3319bc44 BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents: 250
diff changeset
1348 NPCData *npc = nullptr;
0
Ritor1
parents:
diff changeset
1349 if ( dword_5C35D4 )
1211
fd3bea473c0c fix HouseNpcdata array addresiing
Gloval
parents: 1209
diff changeset
1350 npc = HouseNPCData[(unsigned int)((char *)pDialogueNPCCount + -(dword_591080 != 0))]; //- 1
254
d1af3319bc44 BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents: 250
diff changeset
1351 else
602
628694cd5744 Margaret working
zipi
parents: 569
diff changeset
1352 npc = GetNPCData(sDialogue_SpeakingActorNPC_ID);
254
d1af3319bc44 BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents: 250
diff changeset
1353
1453
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1354 //pText = a4;
1980
c1c74df0a33e changing most of auto types to their actual types
Grumpy7
parents: 1914
diff changeset
1355 uint len = strlen(lpsz);
254
d1af3319bc44 BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents: 250
diff changeset
1356 for (int i = 0, dst = 0; i < len; ++i)
d1af3319bc44 BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents: 250
diff changeset
1357 {
d1af3319bc44 BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents: 250
diff changeset
1358 char c = lpsz[i];
d1af3319bc44 BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents: 250
diff changeset
1359 if (c != '%')
d1af3319bc44 BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents: 250
diff changeset
1360 pTmpBuf2[dst++] = c;
d1af3319bc44 BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents: 250
diff changeset
1361 else
d1af3319bc44 BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents: 250
diff changeset
1362 {
d1af3319bc44 BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents: 250
diff changeset
1363 v17 = 10 * (int)(lpsz[i + 1] - '0') + lpsz[i + 2] - '0';
d1af3319bc44 BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents: 250
diff changeset
1364
d1af3319bc44 BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents: 250
diff changeset
1365 switch ( v17 )
d1af3319bc44 BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents: 250
diff changeset
1366 {
1453
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1367 case 1://Ïîäðîáíåå
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1368 strcat(pTmpBuf2.data(), npc->pName);
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1369 dst = strlen(pTmpBuf2.data());
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1370 i += 2;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1371 break;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1372 case 2:
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1373 strcat(pTmpBuf2.data(), pPlayer->pName);
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1374 dst = strlen(pTmpBuf2.data());
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1375 i += 2;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1376 break;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1377 case 3:
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1378 case 4:
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1379 strcat(pTmpBuf2.data(), a1);
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1380 dst = strlen(pTmpBuf2.data());
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1381 i += 2;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1382 break;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1383 case 5:
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1384 v18 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed * 0.234375) / 60 / 60 % 24;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1385 pText = pGlobalTXT_LocalizationStrings[397];// "evening"
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1386 if ( SHIDWORD(v18) <= 0 && SHIDWORD(v18) >= 0 && (unsigned int)v18 >= 5 && SHIDWORD(v18) <= 0 )
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1387 {
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1388 if ( SHIDWORD(v18) >= 0 && (unsigned int)v18 >= 11 )
0
Ritor1
parents:
diff changeset
1389 {
1453
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1390 if ( v18 < 20 )
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1391 pText = pGlobalTXT_LocalizationStrings[396];// "day"
0
Ritor1
parents:
diff changeset
1392 }
Ritor1
parents:
diff changeset
1393 else
Ritor1
parents:
diff changeset
1394 {
1453
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1395 pText = pGlobalTXT_LocalizationStrings[395];// "morning"
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1396 }
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1397 }
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1398 strcat(pTmpBuf2.data(), pText);
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1399 dst = strlen(pTmpBuf2.data());
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1400 i += 2;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1401 break;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1402 case 6:
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1403 if ( pPlayer->uSex )
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1404 pText = pGlobalTXT_LocalizationStrings[387];// "lady"
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1405 else
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1406 pText = pGlobalTXT_LocalizationStrings[385];// "sir"
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1407 strcat(pTmpBuf2.data(), pText);
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1408 dst = strlen(pTmpBuf2.data());
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1409 i += 2;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1410 break;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1411 case 7:
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1412 if ( pPlayer->uSex )
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1413 pText = pGlobalTXT_LocalizationStrings[389];// "Lady"
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1414 else
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1415 pText = pGlobalTXT_LocalizationStrings[386];// "Sir"
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1416 strcat(pTmpBuf2.data(), pText);
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1417 dst = strlen(pTmpBuf2.data());
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1418 i += 2;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1419 break;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1420 case 8:
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1421 v63 = 0;
1460
ff2118028c71 renaming _guilds_member_bits to _achieved_awards_bits
Gloval
parents: 1453
diff changeset
1422 v20 = (unsigned __int8 *)pPlayer->_achieved_awards_bits;
1477
7ef4b64f6329 * LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents: 1461
diff changeset
1423 for ( uint _i = 0; _i < 28; ++_i )
1453
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1424 {
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1425 if ( (unsigned __int16)_449B57_test_bit(v20, word_4EE150[i]) )
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1426 {
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1427 v21 = v63;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1428 ++v63;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1429 v55[v63] = word_4EE150[i];
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1430 }
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1431 }
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1432 if ( v63 )
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1433 {
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1434 if ( dword_A74CDC == -1 )
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1435 dword_A74CDC = rand() % v63;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1436 pText = (char *)pAwards[v55[dword_A74CDC]].pText;//(char *)dword_723E80_award_related[2 * v55[v24]];
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1437 }
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1438 else
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1439 pText = (char *)pNPCTopics[55].pText;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1440 strcat(pTmpBuf2.data(), pText);
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1441 dst = strlen(pTmpBuf2.data());
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1442 i += 2;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1443 break;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1444 case 9:
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1445 if ( npc->uSex )
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1446 pText = pGlobalTXT_LocalizationStrings[384];// "her"
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1447 else
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1448 pText = pGlobalTXT_LocalizationStrings[383];// "his"
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1449 strcat(pTmpBuf2.data(), pText);
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1450 dst = strlen(pTmpBuf2.data());
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1451 i += 2;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1452 break;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1453 case 10:
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1454 if ( pPlayer->uSex )
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1455 pText = pGlobalTXT_LocalizationStrings[389];// "Lady"
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1456 else
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1457 pText = pGlobalTXT_LocalizationStrings[388];// "Lord"
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1458 strcat(pTmpBuf2.data(), pText);
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1459 dst = strlen(pTmpBuf2.data());
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1460 i += 2;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1461 break;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1462 case 11:
1827
0c75c3e7e436 cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents: 1826
diff changeset
1463 pReputation = pParty->GetPartyReputation();
1453
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1464 if ( pReputation >= 25 )
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1465 pText = pGlobalTXT_LocalizationStrings[379];
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1466 else//v25 < 25
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1467 {
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1468 if ( pReputation < 6 )
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1469 {
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1470 if ( pReputation >= -5 )//6 >= v25 >= -5
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1471 pText = pGlobalTXT_LocalizationStrings[399];
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1472 else// v25 < -5
0
Ritor1
parents:
diff changeset
1473 {
1453
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1474 if ( pReputation < -24 )//-24 > v25
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1475 pText = pGlobalTXT_LocalizationStrings[434];
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1476 else// -5 > v25 > -24
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1477 pText = pGlobalTXT_LocalizationStrings[402];
0
Ritor1
parents:
diff changeset
1478 }
1453
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1479 }
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1480 else//25 > v25 > 6
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1481 pText = pGlobalTXT_LocalizationStrings[392];
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1482 }
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1483 strcat(pTmpBuf2.data(), pText);
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1484 dst = strlen(pTmpBuf2.data());
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1485 i += 2;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1486 break;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1487 case 12:
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1488 pReputation = npc->rep;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1489 if ( pReputation >= 25 )
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1490 pText = pGlobalTXT_LocalizationStrings[379];
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1491 else
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1492 {
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1493 if ( pReputation < 6 )
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1494 {
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1495 if ( pReputation >= -5 )
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1496 pText = pGlobalTXT_LocalizationStrings[399];
0
Ritor1
parents:
diff changeset
1497 else
Ritor1
parents:
diff changeset
1498 {
1453
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1499 if ( pReputation < -24 )
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1500 pText = pGlobalTXT_LocalizationStrings[434];
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1501 else
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1502 pText = pGlobalTXT_LocalizationStrings[402];
0
Ritor1
parents:
diff changeset
1503 }
Ritor1
parents:
diff changeset
1504 }
254
d1af3319bc44 BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents: 250
diff changeset
1505 else
1453
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1506 pText = pGlobalTXT_LocalizationStrings[392];
254
d1af3319bc44 BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents: 250
diff changeset
1507 }
1453
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1508 strcat(pTmpBuf2.data(), pText);
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1509 dst = strlen(pTmpBuf2.data());
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1510 i += 2;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1511 break;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1512 case 13:
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1513 strcat(pTmpBuf2.data(), sub_495366(pPlayer->pName[0], pPlayer->uSex));
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1514 dst = strlen(pTmpBuf2.data());
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1515 i += 2;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1516 break;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1517 case 14:
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1518 if ( npc->uSex )
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1519 pText = pGlobalTXT_LocalizationStrings[391];// "sister"
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1520 else
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1521 pText = pGlobalTXT_LocalizationStrings[390];// "brother"
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1522 strcat(pTmpBuf2.data(), pText);
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1523 dst = strlen(pTmpBuf2.data());
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1524 i += 2;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1525 break;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1526 case 15:
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1527 strcat(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[393]);// "daughter"
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1528 dst = strlen(pTmpBuf2.data());
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1529 i += 2;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1530 break;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1531 case 16:
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1532 if ( npc->uSex )
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1533 pText = pGlobalTXT_LocalizationStrings[391];// "sister"
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1534 else
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1535 pText = pGlobalTXT_LocalizationStrings[390];// "brother"
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1536 strcat(pTmpBuf2.data(), pText);
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1537 dst = strlen(pTmpBuf2.data());
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1538 i += 2;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1539 break;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1540 case 17://òåêñò íà¸ìíîãî ÍÏÑ
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1541 {
2115
90cc547a7927 Fixing hireling prices
Grumpy7
parents: 2103
diff changeset
1542 uint pay_percentage = pNPCStats->pProfessions[npc->uProfession].uHirePrice / 100;
1453
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1543 if ( !pay_percentage )
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1544 pay_percentage = 1;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1545 sprintf(a1, "%lu", pay_percentage);
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1546 strcat(pTmpBuf2.data(), a1);
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1547 dst = strlen(pTmpBuf2.data());
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1548 i += 2;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1549 break;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1550 }
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1551 case 18:
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1552 case 19:
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1553 case 20:
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1554 case 21:
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1555 case 22:
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1556 case 26:
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1557 strncpy(a1, lpsz + i + 1, 2);
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1558 sprintf(a1, "%lu", atoi(a1));
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1559 strcat(pTmpBuf2.data(), a1);
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1560 dst = strlen(pTmpBuf2.data());
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1561 i += 2;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1562 break;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1563 case 23:
1477
7ef4b64f6329 * LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents: 1461
diff changeset
1564 if ( pMapStats->GetMapInfo(pCurrentMapName) )
7ef4b64f6329 * LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents: 1461
diff changeset
1565 pText = pMapStats->pInfos[pMapStats->GetMapInfo(pCurrentMapName)].pName;
1453
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1566 else
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1567 pText = pGlobalTXT_LocalizationStrings[394];// "Unknown"
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1568 strcat(pTmpBuf2.data(), pText);
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1569 dst = strlen(pTmpBuf2.data());
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1570 i += 2;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1571 break;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1572 case 24://íàçâàíèå òîâàðà â ïðîäàæå
2069
259df09dfb50 32bits almost there
Nomad
parents: 2060
diff changeset
1573 sprintfex(a1, format_4E2D80, Color16(255, 255, 155), a3->GetDisplayName());
1453
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1574 strcat(pTmpBuf2.data(), a1);
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1575 dst = strlen(pTmpBuf2.data());
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1576 i += 2;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1577 break;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1578 case 25:
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1579 v29 = pPlayer->GetBaseBuyingPrice(a3->GetValue(), p2DEvents[(signed int)a4 - 1].fPriceMultiplier);
0
Ritor1
parents:
diff changeset
1580 switch ( a5 )
1453
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1581 {
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1582 case 3:
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1583 v29 = pPlayer->GetBaseSellingPrice(a3->GetValue(), p2DEvents[(signed int)a4 - 1].fPriceMultiplier);
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1584 break;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1585 case 4:
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1586 v29 = pPlayer->GetBaseIdentifyPrice(p2DEvents[(signed int)a4 - 1].fPriceMultiplier);
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1587 break;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1588 case 5:
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1589 v29 = pPlayer->GetBaseRepairPrice(a3->GetValue(), p2DEvents[(signed int)a4 - 1].fPriceMultiplier);
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1590 break;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1591 case 6:
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1592 v29 = pPlayer->GetBaseSellingPrice(a3->GetValue(), p2DEvents[(signed int)a4 - 1].fPriceMultiplier) / 2;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1593 break;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1594 }
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1595 sprintfex(a1, "%lu", v29);
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1596 strcat(pTmpBuf2.data(), a1);
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1597 dst = strlen(pTmpBuf2.data());
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1598 i += 2;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1599 break;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1600 case 27://òåêñò ïðîäàæè
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1601 v29 = pPlayer->GetBuyingPrice(a3->GetValue(), p2DEvents[(signed int)a4 - 1].fPriceMultiplier);
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1602 if ( a5 == 3 )
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1603 {
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1604 v29 = pPlayer->GetPriceSell(a3->GetValue(), p2DEvents[(signed int)a4 - 1].fPriceMultiplier);
1567
9f8b3e904e14 Player::ReceiveDamage, very small edits; prepended "Is" to item functions returning bool values (broken, indetified, stolen)
Grumpy7
parents: 1546
diff changeset
1605 if (a3->IsBroken())
1453
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1606 v29 = 1;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1607 sprintfex(a1, "%lu", v29);
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1608 strcat(pTmpBuf2.data(), a1);
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1609 dst = strlen(pTmpBuf2.data());
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1610 i += 2;
0
Ritor1
parents:
diff changeset
1611 break;
254
d1af3319bc44 BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents: 250
diff changeset
1612 }
1453
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1613 if ( a5 != 4 )
0
Ritor1
parents:
diff changeset
1614 {
1453
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1615 if ( a5 == 5 )
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1616 v29 = pPlayer->GetPriceRepair(a3->GetValue(), p2DEvents[(signed int)a4 - 1].fPriceMultiplier);
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1617 else
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1618 {
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1619 if ( a5 == 6 )
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1620 {
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1621 v29 = pPlayer->GetPriceSell(a3->GetValue(), p2DEvents[(signed int)a4 - 1].fPriceMultiplier) / 2;
1567
9f8b3e904e14 Player::ReceiveDamage, very small edits; prepended "Is" to item functions returning bool values (broken, indetified, stolen)
Grumpy7
parents: 1546
diff changeset
1622 if (a3->IsBroken())
1453
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1623 v29 = 1;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1624 if (!v29)
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1625 v29 = 1;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1626 sprintfex(a1, "%lu", v29);
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1627 strcat(pTmpBuf2.data(), a1);
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1628 dst = strlen(pTmpBuf2.data());
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1629 i += 2;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1630 break;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1631 }
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1632 }
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1633 sprintfex(a1, "%lu", v29);
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1634 strcat(pTmpBuf2.data(), a1);
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1635 dst = strlen(pTmpBuf2.data());
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1636 i += 2;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1637 break;
0
Ritor1
parents:
diff changeset
1638 }
1453
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1639 sprintfex(a1, "%lu", pPlayer->GetPriceIdentification(p2DEvents[(signed int)a4 - 1].fPriceMultiplier));
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1640 strcat(pTmpBuf2.data(), a1);
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1641 dst = strlen(pTmpBuf2.data());
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1642 i += 2;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1643 break;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1644 case 28://ïðîôåññèÿ
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1645 strcat(pTmpBuf2.data(), (char *)p2DEvents[(signed int)a4 - 1].pProprieterTitle);
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1646 dst = strlen(pTmpBuf2.data());
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1647 i += 2;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1648 break;
254
d1af3319bc44 BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents: 250
diff changeset
1649 case 29:
1453
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1650 sprintfex(a1, "%lu", pPlayer->GetPriceIdentification(p2DEvents[(signed int)a4 - 1].fPriceMultiplier));
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1651 strcat(pTmpBuf2.data(), a1);
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1652 dst = strlen(pTmpBuf2.data());
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1653 i += 2;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1654 break;
254
d1af3319bc44 BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents: 250
diff changeset
1655 case 30:
1453
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1656 if ( !a6 )
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1657 {
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1658 strcat(pTmpBuf2.data(), a4);
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1659 dst = strlen(pTmpBuf2.data());
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1660 i += 2;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1661 break;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1662 }
1459
2ca62c9e7b3c Function names
Nomad
parents: 1458
diff changeset
1663 init_summoned_item(&v56, *a6);
1453
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1664 sprintfex(a1, pGlobalTXT_LocalizationStrings[378], aMonthNames[v56.field_14_exprie_month], v56.field_C_expire_day + 1, v56.field_18_expire_year);
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1665 strcat(pTmpBuf2.data(), a1);
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1666 dst = strlen(pTmpBuf2.data());
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1667 i += 2;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1668 break;
254
d1af3319bc44 BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents: 250
diff changeset
1669 case 31:
d1af3319bc44 BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents: 250
diff changeset
1670 case 32:
d1af3319bc44 BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents: 250
diff changeset
1671 case 33:
d1af3319bc44 BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents: 250
diff changeset
1672 case 34:
1453
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1673 strcat(pTmpBuf2.data(), pParty->pPlayers[v17 - 31].pName);
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1674 dst = strlen(pTmpBuf2.data());
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1675 i += 2;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1676 break;
254
d1af3319bc44 BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents: 250
diff changeset
1677 default:
0
Ritor1
parents:
diff changeset
1678 if ( v17 <= 50 || v17 > 70 )
1453
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1679 {
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1680 strncpy(a1, lpsz + i + 1, 2);
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1681 sprintf(a1, "%lu", atoi(a1));
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1682 strcat(pTmpBuf2.data(), a1);
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1683 dst = strlen(pTmpBuf2.data());
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1684 i += 2;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1685 break;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1686 }
254
d1af3319bc44 BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents: 250
diff changeset
1687 if ( v17 - 51 >= 20 )
1453
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1688 {
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1689 strcat(pTmpBuf2.data(), a4);
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1690 dst = strlen(pTmpBuf2.data());
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1691 i += 2;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1692 break;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1693 }
1747
cecb080929c4 Party_stru0 renamed to PartyTimeStruct, fixed its members, renamed Party::field_3C to Party::PartyTimes, started Player::SetVariable refactoring start
Grumpy7
parents: 1709
diff changeset
1694 init_summoned_item(&v56, pParty->PartyTimes._s_times[v17-51]);
1453
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1695 sprintfex(a1, pGlobalTXT_LocalizationStrings[378], aMonthNames[v56.field_14_exprie_month], v56.field_C_expire_day + 1, v56.field_18_expire_year);
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1696 strcat(pTmpBuf2.data(), a1);
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1697 dst = strlen(pTmpBuf2.data());
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1698 i += 2;
dfc9484ed94c GetDayPart and Journal_Draw
Ritor1
parents: 1424
diff changeset
1699 break;
254
d1af3319bc44 BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents: 250
diff changeset
1700 }
d1af3319bc44 BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents: 250
diff changeset
1701 }
0
Ritor1
parents:
diff changeset
1702 }
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
1703 return pTmpBuf2.data();
0
Ritor1
parents:
diff changeset
1704 }
Ritor1
parents:
diff changeset
1705
Ritor1
parents:
diff changeset
1706 //----- (0049B04D) --------------------------------------------------------
734
2f4e33c1ed24 stru154
Nomad
parents: 731
diff changeset
1707 void stru154::GetFacePlaneAndClassify(ODMFace *a2, BSPVertexBuffer *a3)
0
Ritor1
parents:
diff changeset
1708 {
734
2f4e33c1ed24 stru154
Nomad
parents: 731
diff changeset
1709 //stru154 *v3; // edi@1
2f4e33c1ed24 stru154
Nomad
parents: 731
diff changeset
1710 //signed int v4; // eax@1
2f4e33c1ed24 stru154
Nomad
parents: 731
diff changeset
1711 //signed int result; // eax@9
2f4e33c1ed24 stru154
Nomad
parents: 731
diff changeset
1712 //signed int v6; // [sp-8h] [bp-18h]@8
0
Ritor1
parents:
diff changeset
1713 Vec3_float_ v; // [sp+4h] [bp-Ch]@1
734
2f4e33c1ed24 stru154
Nomad
parents: 731
diff changeset
1714 float v7;
0
Ritor1
parents:
diff changeset
1715
Ritor1
parents:
diff changeset
1716 v.x = 0.0;
Ritor1
parents:
diff changeset
1717 v.y = 0.0;
Ritor1
parents:
diff changeset
1718 v.z = 0.0;
734
2f4e33c1ed24 stru154
Nomad
parents: 731
diff changeset
1719 GetFacePlane(a2, a3, &v, &v7);
2f4e33c1ed24 stru154
Nomad
parents: 731
diff changeset
1720
2f4e33c1ed24 stru154
Nomad
parents: 731
diff changeset
1721 if (fabsf(a2->pFacePlane.vNormal.z) < 1e-6f)
2f4e33c1ed24 stru154
Nomad
parents: 731
diff changeset
1722 polygonType = POLYGON_VerticalWall;
2f4e33c1ed24 stru154
Nomad
parents: 731
diff changeset
1723 else if (fabsf(a2->pFacePlane.vNormal.x) < 1e-6f &&
2f4e33c1ed24 stru154
Nomad
parents: 731
diff changeset
1724 fabsf(a2->pFacePlane.vNormal.y) < 1e-6f)
2f4e33c1ed24 stru154
Nomad
parents: 731
diff changeset
1725 polygonType = POLYGON_Floor;
0
Ritor1
parents:
diff changeset
1726 else
734
2f4e33c1ed24 stru154
Nomad
parents: 731
diff changeset
1727 polygonType = POLYGON_InBetweenFloorAndWall;
2f4e33c1ed24 stru154
Nomad
parents: 731
diff changeset
1728
2f4e33c1ed24 stru154
Nomad
parents: 731
diff changeset
1729 face_plane.vNormal.x = v.x;
2f4e33c1ed24 stru154
Nomad
parents: 731
diff changeset
1730 face_plane.vNormal.y = v.y;
2f4e33c1ed24 stru154
Nomad
parents: 731
diff changeset
1731 face_plane.vNormal.z = v.z;
2f4e33c1ed24 stru154
Nomad
parents: 731
diff changeset
1732 face_plane.dist = v7;
0
Ritor1
parents:
diff changeset
1733 }
Ritor1
parents:
diff changeset
1734
Ritor1
parents:
diff changeset
1735 //----- (0049B0C9) --------------------------------------------------------
734
2f4e33c1ed24 stru154
Nomad
parents: 731
diff changeset
1736 void stru154::ClassifyPolygon(Vec3_float_ *pNormal, float dist)
0
Ritor1
parents:
diff changeset
1737 {
734
2f4e33c1ed24 stru154
Nomad
parents: 731
diff changeset
1738 if (fabsf(pNormal->z) < 1e-6f)
2f4e33c1ed24 stru154
Nomad
parents: 731
diff changeset
1739 polygonType = POLYGON_VerticalWall;
2f4e33c1ed24 stru154
Nomad
parents: 731
diff changeset
1740 else if (fabsf(pNormal->x) < 1e-6f &&
2f4e33c1ed24 stru154
Nomad
parents: 731
diff changeset
1741 fabsf(pNormal->y) < 1e-6f)
2f4e33c1ed24 stru154
Nomad
parents: 731
diff changeset
1742 polygonType = POLYGON_Floor;
0
Ritor1
parents:
diff changeset
1743 else
734
2f4e33c1ed24 stru154
Nomad
parents: 731
diff changeset
1744 polygonType = POLYGON_InBetweenFloorAndWall;
2f4e33c1ed24 stru154
Nomad
parents: 731
diff changeset
1745
2f4e33c1ed24 stru154
Nomad
parents: 731
diff changeset
1746 face_plane.vNormal.x = pNormal->x;
2f4e33c1ed24 stru154
Nomad
parents: 731
diff changeset
1747 face_plane.dist = dist;
2f4e33c1ed24 stru154
Nomad
parents: 731
diff changeset
1748 face_plane.vNormal.y = pNormal->y;
2f4e33c1ed24 stru154
Nomad
parents: 731
diff changeset
1749 face_plane.vNormal.z = pNormal->z;
0
Ritor1
parents:
diff changeset
1750 }
Ritor1
parents:
diff changeset
1751
Ritor1
parents:
diff changeset
1752 //----- (0049B13D) --------------------------------------------------------
734
2f4e33c1ed24 stru154
Nomad
parents: 731
diff changeset
1753 void stru154::GetFacePlane(ODMFace *pFace, BSPVertexBuffer *pVertices, Vec3_float_ *pOutNormal, float *pOutDist)
0
Ritor1
parents:
diff changeset
1754 {
Ritor1
parents:
diff changeset
1755 Vec3_float_ *v19; // eax@3
Ritor1
parents:
diff changeset
1756 Vec3_float_ v2; // [sp+4h] [bp-64h]@3
Ritor1
parents:
diff changeset
1757 float v26; // [sp+1Ch] [bp-4Ch]@3
Ritor1
parents:
diff changeset
1758 float v27; // [sp+20h] [bp-48h]@3
Ritor1
parents:
diff changeset
1759 float v28; // [sp+24h] [bp-44h]@3
Ritor1
parents:
diff changeset
1760 Vec3_float_ v1; // [sp+40h] [bp-28h]@1
Ritor1
parents:
diff changeset
1761 Vec3_float_ v38; // [sp+58h] [bp-10h]@3
734
2f4e33c1ed24 stru154
Nomad
parents: 731
diff changeset
1762
0
Ritor1
parents:
diff changeset
1763 v1.x = 0.0;
Ritor1
parents:
diff changeset
1764 v1.y = 0.0;
Ritor1
parents:
diff changeset
1765 v1.z = 0.0;
734
2f4e33c1ed24 stru154
Nomad
parents: 731
diff changeset
1766
2f4e33c1ed24 stru154
Nomad
parents: 731
diff changeset
1767 if (pFace->uNumVertices >= 2)
2f4e33c1ed24 stru154
Nomad
parents: 731
diff changeset
1768 {
2103
2318216e5206 stru_AA1058[i]._494836() continue
Ritor1
parents: 2102
diff changeset
1769 for ( int i = 0; i < pFace->uNumVertices - 2; i++ )
734
2f4e33c1ed24 stru154
Nomad
parents: 731
diff changeset
1770 {
2103
2318216e5206 stru_AA1058[i]._494836() continue
Ritor1
parents: 2102
diff changeset
1771 v1.x = pVertices->pVertices[pFace->pVertexIDs[i + 1]].x - pVertices->pVertices[pFace->pVertexIDs[i]].x;
2318216e5206 stru_AA1058[i]._494836() continue
Ritor1
parents: 2102
diff changeset
1772 v1.y = pVertices->pVertices[pFace->pVertexIDs[i + 1]].y - pVertices->pVertices[pFace->pVertexIDs[i]].y;
2318216e5206 stru_AA1058[i]._494836() continue
Ritor1
parents: 2102
diff changeset
1773 v1.z = pVertices->pVertices[pFace->pVertexIDs[i + 1]].z - pVertices->pVertices[pFace->pVertexIDs[i]].z;
2318216e5206 stru_AA1058[i]._494836() continue
Ritor1
parents: 2102
diff changeset
1774
2318216e5206 stru_AA1058[i]._494836() continue
Ritor1
parents: 2102
diff changeset
1775 v26 = pVertices->pVertices[pFace->pVertexIDs[i + 2]].x - pVertices->pVertices[pFace->pVertexIDs[i + 1]].x;
2318216e5206 stru_AA1058[i]._494836() continue
Ritor1
parents: 2102
diff changeset
1776 v27 = pVertices->pVertices[pFace->pVertexIDs[i + 2]].y - pVertices->pVertices[pFace->pVertexIDs[i + 1]].y;
2318216e5206 stru_AA1058[i]._494836() continue
Ritor1
parents: 2102
diff changeset
1777 v28 = pVertices->pVertices[pFace->pVertexIDs[i + 2]].z - pVertices->pVertices[pFace->pVertexIDs[i + 1]].z;
2318216e5206 stru_AA1058[i]._494836() continue
Ritor1
parents: 2102
diff changeset
1778
0
Ritor1
parents:
diff changeset
1779 v19 = Vec3_float_::Cross(&v1, &v2, v26, v27, v28);
Ritor1
parents:
diff changeset
1780 v38.x = v19->x;
Ritor1
parents:
diff changeset
1781 v38.y = v19->y;
Ritor1
parents:
diff changeset
1782 v38.z = v19->z;
734
2f4e33c1ed24 stru154
Nomad
parents: 731
diff changeset
1783 if ( v38.x != 0.0 || v38.y != 0.0 || v38.z != 0.0)
2f4e33c1ed24 stru154
Nomad
parents: 731
diff changeset
1784 {
2f4e33c1ed24 stru154
Nomad
parents: 731
diff changeset
1785 v38.Normalize();
2f4e33c1ed24 stru154
Nomad
parents: 731
diff changeset
1786
2f4e33c1ed24 stru154
Nomad
parents: 731
diff changeset
1787 pOutNormal->x = v38.x;
2f4e33c1ed24 stru154
Nomad
parents: 731
diff changeset
1788 pOutNormal->y = v38.y;
2f4e33c1ed24 stru154
Nomad
parents: 731
diff changeset
1789 pOutNormal->z = v38.z;
2f4e33c1ed24 stru154
Nomad
parents: 731
diff changeset
1790
2103
2318216e5206 stru_AA1058[i]._494836() continue
Ritor1
parents: 2102
diff changeset
1791 *pOutDist = -(pVertices->pVertices[pFace->pVertexIDs[i]].x * v38.x
2318216e5206 stru_AA1058[i]._494836() continue
Ritor1
parents: 2102
diff changeset
1792 + pVertices->pVertices[pFace->pVertexIDs[i]].y * v38.y
2318216e5206 stru_AA1058[i]._494836() continue
Ritor1
parents: 2102
diff changeset
1793 + pVertices->pVertices[pFace->pVertexIDs[i]].z * v38.z);
734
2f4e33c1ed24 stru154
Nomad
parents: 731
diff changeset
1794 return;
2f4e33c1ed24 stru154
Nomad
parents: 731
diff changeset
1795 }
2f4e33c1ed24 stru154
Nomad
parents: 731
diff changeset
1796 }
2f4e33c1ed24 stru154
Nomad
parents: 731
diff changeset
1797 }
2f4e33c1ed24 stru154
Nomad
parents: 731
diff changeset
1798
2103
2318216e5206 stru_AA1058[i]._494836() continue
Ritor1
parents: 2102
diff changeset
1799 pOutNormal->x = (double)(pFace->pFacePlane.vNormal.x & 0xFFFF) / 65535.0f + (double)(pFace->pFacePlane.vNormal.x >> 16);
2318216e5206 stru_AA1058[i]._494836() continue
Ritor1
parents: 2102
diff changeset
1800 pOutNormal->y = (double)(pFace->pFacePlane.vNormal.y & 0xFFFF) / 65535.0f + (double)(pFace->pFacePlane.vNormal.y >> 16);
2318216e5206 stru_AA1058[i]._494836() continue
Ritor1
parents: 2102
diff changeset
1801 pOutNormal->z = (double)(pFace->pFacePlane.vNormal.z & 0xFFFF) / 65535.0f + (double)(pFace->pFacePlane.vNormal.z >> 16);
2318216e5206 stru_AA1058[i]._494836() continue
Ritor1
parents: 2102
diff changeset
1802 *pOutDist = (double)(pFace->pFacePlane.dist & 0xFFFF) / 65535.0f + (double)(pFace->pFacePlane.dist >> 16);
0
Ritor1
parents:
diff changeset
1803 }
Ritor1
parents:
diff changeset
1804
Ritor1
parents:
diff changeset
1805 //----- (0049D700) --------------------------------------------------------
Ritor1
parents:
diff changeset
1806 unsigned int __fastcall GetMaxMipLevels(unsigned int uDim)
Ritor1
parents:
diff changeset
1807 {
Ritor1
parents:
diff changeset
1808 int v2; // ecx@1
Ritor1
parents:
diff changeset
1809 unsigned int v3; // eax@1
Ritor1
parents:
diff changeset
1810
Ritor1
parents:
diff changeset
1811 v2 = 0;
2103
2318216e5206 stru_AA1058[i]._494836() continue
Ritor1
parents: 2102
diff changeset
1812 v3 = uDim - 1;
0
Ritor1
parents:
diff changeset
1813 while ( v3 & 1 )
Ritor1
parents:
diff changeset
1814 {
Ritor1
parents:
diff changeset
1815 v3 >>= 1;
Ritor1
parents:
diff changeset
1816 ++v2;
Ritor1
parents:
diff changeset
1817 }
Ritor1
parents:
diff changeset
1818 return v3 == 0 ? v2 : 0;
Ritor1
parents:
diff changeset
1819 }
Ritor1
parents:
diff changeset
1820
Ritor1
parents:
diff changeset
1821 //----- (004A19D8) --------------------------------------------------------
737
225d92620998 004A19D8 refactored
Nomad
parents: 735
diff changeset
1822 unsigned int BlendColors(unsigned int a1, unsigned int a2)
0
Ritor1
parents:
diff changeset
1823 {
737
225d92620998 004A19D8 refactored
Nomad
parents: 735
diff changeset
1824 /*signed __int64 v2; // ST10_8@1
0
Ritor1
parents:
diff changeset
1825 double v3; // st7@1
Ritor1
parents:
diff changeset
1826 float v4; // ST24_4@1
Ritor1
parents:
diff changeset
1827 double v5; // ST10_8@1
Ritor1
parents:
diff changeset
1828 int v6; // ST1C_4@1
Ritor1
parents:
diff changeset
1829 float v7; // ST24_4@1
Ritor1
parents:
diff changeset
1830 double v8; // ST10_8@1
Ritor1
parents:
diff changeset
1831 unsigned __int8 v9; // ST20_1@1
Ritor1
parents:
diff changeset
1832 float v10; // ST24_4@1
Ritor1
parents:
diff changeset
1833 double v11; // ST10_8@1
Ritor1
parents:
diff changeset
1834 float v12; // ST24_4@1
737
225d92620998 004A19D8 refactored
Nomad
parents: 735
diff changeset
1835 double v13; // ST08_8@1*/
225d92620998 004A19D8 refactored
Nomad
parents: 735
diff changeset
1836
225d92620998 004A19D8 refactored
Nomad
parents: 735
diff changeset
1837 uint alpha = (uint)floorf(0.5f + (a1 >> 24) / 255.0f *
225d92620998 004A19D8 refactored
Nomad
parents: 735
diff changeset
1838 (a2 >> 24) / 255.0f * 255.0f),
225d92620998 004A19D8 refactored
Nomad
parents: 735
diff changeset
1839 red = (uint)floorf(0.5f + ((a1 >> 16) & 0xFF) / 255.0f *
225d92620998 004A19D8 refactored
Nomad
parents: 735
diff changeset
1840 ((a2 >> 16) & 0xFF) / 255.0f * 255.0f),
225d92620998 004A19D8 refactored
Nomad
parents: 735
diff changeset
1841 green = (uint)floorf(0.5f + ((a1 >> 8) & 0xFF) / 255.0f *
225d92620998 004A19D8 refactored
Nomad
parents: 735
diff changeset
1842 ((a2 >> 8) & 0xFF) / 255.0f * 255.0f),
225d92620998 004A19D8 refactored
Nomad
parents: 735
diff changeset
1843 blue = (uint)floorf(0.5f + ((a1 >> 0) & 0xFF) / 255.0f *
225d92620998 004A19D8 refactored
Nomad
parents: 735
diff changeset
1844 ((a2 >> 0) & 0xFF) / 255.0f * 255.0f);
225d92620998 004A19D8 refactored
Nomad
parents: 735
diff changeset
1845 return (alpha << 24) | (red << 16) | (green << 8) | blue;
225d92620998 004A19D8 refactored
Nomad
parents: 735
diff changeset
1846 /*v2 = a1 >> 24;
225d92620998 004A19D8 refactored
Nomad
parents: 735
diff changeset
1847 v3 = (double)v2 / 255.0f;
225d92620998 004A19D8 refactored
Nomad
parents: 735
diff changeset
1848 HIDWORD(v2) = 0;
0
Ritor1
parents:
diff changeset
1849 LODWORD(v2) = a2 >> 24;
737
225d92620998 004A19D8 refactored
Nomad
parents: 735
diff changeset
1850 v4 = v3 * (double)v2 / 255.0f * 255.0;
0
Ritor1
parents:
diff changeset
1851 v5 = v4 + 6.7553994e15;
Ritor1
parents:
diff changeset
1852 v6 = LODWORD(v5);
737
225d92620998 004A19D8 refactored
Nomad
parents: 735
diff changeset
1853 v7 = (double)((a1 >> 16) & 0xFFi64) / 255.0f * (double)((a2 >> 16) & 0xFF) * 0.0039215689 * 255.0;
0
Ritor1
parents:
diff changeset
1854 v8 = v7 + 6.7553994e15;
Ritor1
parents:
diff changeset
1855 v9 = LOBYTE(v8);
737
225d92620998 004A19D8 refactored
Nomad
parents: 735
diff changeset
1856 v10 = (double)((unsigned __int16)a1 >> 8) / 255.0f * (double)((unsigned __int16)a2 >> 8) / 255.0f * 255.0;
0
Ritor1
parents:
diff changeset
1857 v11 = v10 + 6.7553994e15;
737
225d92620998 004A19D8 refactored
Nomad
parents: 735
diff changeset
1858 v12 = (double)(a1 & 0xFFi64) / 255.0f * (double)(unsigned __int8)a2 / 255.0f * 255.0;
0
Ritor1
parents:
diff changeset
1859 v13 = v12 + 6.7553994e15;
737
225d92620998 004A19D8 refactored
Nomad
parents: 735
diff changeset
1860 return LOBYTE(v13) | ((LOBYTE(v11) | (((v6 << 8) | v9) << 8)) << 8);*/
0
Ritor1
parents:
diff changeset
1861 }
Ritor1
parents:
diff changeset
1862
2069
259df09dfb50 32bits almost there
Nomad
parents: 2060
diff changeset
1863 void Present32(unsigned __int32 *src, unsigned int src_pitch,
259df09dfb50 32bits almost there
Nomad
parents: 2060
diff changeset
1864 unsigned __int32 *dst, unsigned int dst_pitch)
0
Ritor1
parents:
diff changeset
1865 {
2069
259df09dfb50 32bits almost there
Nomad
parents: 2060
diff changeset
1866 for (uint y = 0; y < 8; ++y)
259df09dfb50 32bits almost there
Nomad
parents: 2060
diff changeset
1867 memcpy(dst + y * dst_pitch,
259df09dfb50 32bits almost there
Nomad
parents: 2060
diff changeset
1868 src + y * src_pitch, src_pitch * sizeof(__int32));
0
Ritor1
parents:
diff changeset
1869
2069
259df09dfb50 32bits almost there
Nomad
parents: 2060
diff changeset
1870 for (uint y = 8; y < 352; ++y)
0
Ritor1
parents:
diff changeset
1871 {
2069
259df09dfb50 32bits almost there
Nomad
parents: 2060
diff changeset
1872 memcpy(dst + y * dst_pitch,
259df09dfb50 32bits almost there
Nomad
parents: 2060
diff changeset
1873 src + y * src_pitch, 8 * sizeof(__int32));
259df09dfb50 32bits almost there
Nomad
parents: 2060
diff changeset
1874 memcpy(dst + 8 + game_viewport_width + y * dst_pitch,
259df09dfb50 32bits almost there
Nomad
parents: 2060
diff changeset
1875 src + 8 + game_viewport_width + y * src_pitch, 174/*172*/ * sizeof(__int32));
0
Ritor1
parents:
diff changeset
1876 }
Ritor1
parents:
diff changeset
1877
2069
259df09dfb50 32bits almost there
Nomad
parents: 2060
diff changeset
1878 for (uint y = 352; y < 480; ++y)
259df09dfb50 32bits almost there
Nomad
parents: 2060
diff changeset
1879 memcpy(dst + y * dst_pitch,
259df09dfb50 32bits almost there
Nomad
parents: 2060
diff changeset
1880 src + y * src_pitch, src_pitch * sizeof(__int32));
0
Ritor1
parents:
diff changeset
1881
2069
259df09dfb50 32bits almost there
Nomad
parents: 2060
diff changeset
1882 for (uint y = pViewport->uViewportTL_Y; y < pViewport->uViewportBR_Y + 1; ++y)
259df09dfb50 32bits almost there
Nomad
parents: 2060
diff changeset
1883 {
259df09dfb50 32bits almost there
Nomad
parents: 2060
diff changeset
1884 for (uint x = pViewport->uViewportTL_X; x < pViewport->uViewportBR_X; ++x)
259df09dfb50 32bits almost there
Nomad
parents: 2060
diff changeset
1885 {
259df09dfb50 32bits almost there
Nomad
parents: 2060
diff changeset
1886 //if (src[x + y * src_pitch] != (pRenderer->uTargetGMask | pRenderer->uTargetBMask))
259df09dfb50 32bits almost there
Nomad
parents: 2060
diff changeset
1887 if (src[x + y * src_pitch] != 0xFFF8FCF8) // FFF8FCF8 = Color32(Color16(g_mask | b_mask))
259df09dfb50 32bits almost there
Nomad
parents: 2060
diff changeset
1888 dst[x + y * dst_pitch] = src[x + y * src_pitch];
259df09dfb50 32bits almost there
Nomad
parents: 2060
diff changeset
1889 }
259df09dfb50 32bits almost there
Nomad
parents: 2060
diff changeset
1890 }
0
Ritor1
parents:
diff changeset
1891 }
Ritor1
parents:
diff changeset
1892
Ritor1
parents:
diff changeset
1893 //----- (004A597D) --------------------------------------------------------
Ritor1
parents:
diff changeset
1894 void Present_NoColorKey()
Ritor1
parents:
diff changeset
1895 {
Ritor1
parents:
diff changeset
1896 //unsigned __int16 *v0; // eax@4
Ritor1
parents:
diff changeset
1897 unsigned __int16 *v1; // esi@4
Ritor1
parents:
diff changeset
1898 void *v2; // edi@4
Ritor1
parents:
diff changeset
1899 //signed int v4; // ebx@4
Ritor1
parents:
diff changeset
1900 //signed int v5; // ebx@6
Ritor1
parents:
diff changeset
1901 //void *v6; // edi@7
Ritor1
parents:
diff changeset
1902 //const void *v7; // esi@7
Ritor1
parents:
diff changeset
1903 signed int v8; // ebx@8
Ritor1
parents:
diff changeset
1904 int v9; // eax@10
Ritor1
parents:
diff changeset
1905 unsigned int v10; // esi@10
Ritor1
parents:
diff changeset
1906 unsigned __int32 v11; // edi@10
Ritor1
parents:
diff changeset
1907 //int v12; // ecx@10
Ritor1
parents:
diff changeset
1908 unsigned int v13; // ebx@10
Ritor1
parents:
diff changeset
1909 int v14; // eax@11
Ritor1
parents:
diff changeset
1910 int v15; // eax@13
Ritor1
parents:
diff changeset
1911 int v16; // eax@14
Ritor1
parents:
diff changeset
1912 int v17; // eax@16
Ritor1
parents:
diff changeset
1913 HRESULT v18; // eax@22
Ritor1
parents:
diff changeset
1914 DDSURFACEDESC2 Dst; // [sp+Ch] [bp-98h]@3
2069
259df09dfb50 32bits almost there
Nomad
parents: 2060
diff changeset
1915 //int v20; // [sp+88h] [bp-1Ch]@10
0
Ritor1
parents:
diff changeset
1916 int v21; // [sp+8Ch] [bp-18h]@10
Ritor1
parents:
diff changeset
1917 __int32 v22; // [sp+90h] [bp-14h]@10
Ritor1
parents:
diff changeset
1918 //unsigned __int32 v23; // [sp+94h] [bp-10h]@10
Ritor1
parents:
diff changeset
1919 unsigned int v24; // [sp+98h] [bp-Ch]@4
Ritor1
parents:
diff changeset
1920 //unsigned int _this; // [sp+9Ch] [bp-8h]@10
Ritor1
parents:
diff changeset
1921 //LPVOID v26; // [sp+A0h] [bp-4h]@4
Ritor1
parents:
diff changeset
1922
Ritor1
parents:
diff changeset
1923 if ( !pRenderer->uNumSceneBegins )
Ritor1
parents:
diff changeset
1924 {
2069
259df09dfb50 32bits almost there
Nomad
parents: 2060
diff changeset
1925 if ( pRenderer->using_software_screen_buffer )
0
Ritor1
parents:
diff changeset
1926 {
Ritor1
parents:
diff changeset
1927 memset(&Dst, 0, 0x7Cu);
Ritor1
parents:
diff changeset
1928 Dst.dwSize = 124;
168
ee11772d0ad2 New sky (turn on -new_sky console command)
Nomad
parents: 144
diff changeset
1929 if ( pRenderer->LockSurface_DDraw4(pRenderer->pBackBuffer4, &Dst, DDLOCK_WAIT) )
0
Ritor1
parents:
diff changeset
1930 {
Ritor1
parents:
diff changeset
1931 //v26 = Dst.lpSurface;
2069
259df09dfb50 32bits almost there
Nomad
parents: 2060
diff changeset
1932 //pRenderer->pCurrentlyLockedSurfaceDataPtr = (unsigned __int16 *)Dst.lpSurface;
0
Ritor1
parents:
diff changeset
1933 v24 = pRenderer->uTargetGMask | pRenderer->uTargetBMask |
Ritor1
parents:
diff changeset
1934 ((pRenderer->uTargetGMask | pRenderer->uTargetBMask) << 16);
2069
259df09dfb50 32bits almost there
Nomad
parents: 2060
diff changeset
1935 //pRenderer->pCurrentlyLockedSoftSurface = pRenderer->pTargetSurface;
259df09dfb50 32bits almost there
Nomad
parents: 2060
diff changeset
1936 //pRenderer->uCurrentlyLockedSurfacePitch = Dst.lPitch;
259df09dfb50 32bits almost there
Nomad
parents: 2060
diff changeset
1937 //v1 = pRenderer->pTargetSurface;
0
Ritor1
parents:
diff changeset
1938 v2 = Dst.lpSurface;
Ritor1
parents:
diff changeset
1939
Ritor1
parents:
diff changeset
1940
Ritor1
parents:
diff changeset
1941 /*for (uint y = 0; y < 480; ++y)
Ritor1
parents:
diff changeset
1942 {
Ritor1
parents:
diff changeset
1943 auto pDst = (unsigned short *)((char *)Dst.lpSurface + y * Dst.lPitch);
Ritor1
parents:
diff changeset
1944 for (uint x = 0; x < 640; ++x)
Ritor1
parents:
diff changeset
1945 pDst[x] = pRenderer->uTargetRMask | pRenderer->uTargetBMask;
Ritor1
parents:
diff changeset
1946 }*/
2069
259df09dfb50 32bits almost there
Nomad
parents: 2060
diff changeset
1947
259df09dfb50 32bits almost there
Nomad
parents: 2060
diff changeset
1948 if (!FORCE_16_BITS)
259df09dfb50 32bits almost there
Nomad
parents: 2060
diff changeset
1949 Present32((unsigned __int32 *)pRenderer->pTargetSurface, pRenderer->uTargetSurfacePitch, (unsigned __int32 *)Dst.lpSurface, Dst.lPitch / 4);
259df09dfb50 32bits almost there
Nomad
parents: 2060
diff changeset
1950 else
259df09dfb50 32bits almost there
Nomad
parents: 2060
diff changeset
1951 {
259df09dfb50 32bits almost there
Nomad
parents: 2060
diff changeset
1952 ushort* pSrc = (unsigned short *)pRenderer->pTargetSurface;
1980
c1c74df0a33e changing most of auto types to their actual types
Grumpy7
parents: 1914
diff changeset
1953 short* pDst = (__int16 *)Dst.lpSurface;
0
Ritor1
parents:
diff changeset
1954
Ritor1
parents:
diff changeset
1955 for (uint y = 0; y < 8; ++y)
Ritor1
parents:
diff changeset
1956 memcpy(pDst + y * Dst.lPitch / 2,
Ritor1
parents:
diff changeset
1957
Ritor1
parents:
diff changeset
1958 pSrc + y * 640, 640 * sizeof(__int16));
Ritor1
parents:
diff changeset
1959
Ritor1
parents:
diff changeset
1960 for (uint y = 8; y < 352; ++y)
Ritor1
parents:
diff changeset
1961 {
Ritor1
parents:
diff changeset
1962 memcpy(pDst + y * Dst.lPitch / 2,
Ritor1
parents:
diff changeset
1963 pSrc + y * 640, 8 * sizeof(__int16));
819
9359c114f98c More on screenshot
Nomad
parents: 816
diff changeset
1964 memcpy(pDst + 8 + game_viewport_width/*462*/ + y * Dst.lPitch / 2,
9359c114f98c More on screenshot
Nomad
parents: 816
diff changeset
1965 pSrc + 8 + game_viewport_width/*462*/ + y * 640, 174/*172*/ * sizeof(__int16));
0
Ritor1
parents:
diff changeset
1966 }
Ritor1
parents:
diff changeset
1967
121
3471df3713e2 Teal line at game's viewport bottom fix
Nomad
parents: 112
diff changeset
1968 for (uint y = 352; y < 480; ++y)
0
Ritor1
parents:
diff changeset
1969 memcpy(pDst + y * Dst.lPitch / 2,
Ritor1
parents:
diff changeset
1970 pSrc + y * 640, 640 * sizeof(__int16));
Ritor1
parents:
diff changeset
1971
Ritor1
parents:
diff changeset
1972
1980
c1c74df0a33e changing most of auto types to their actual types
Grumpy7
parents: 1914
diff changeset
1973 ushort* pSrc_x1y1 = pSrc + 640 * pViewport->uViewportTL_Y + pViewport->uViewportTL_X;
0
Ritor1
parents:
diff changeset
1974 //_this = (unsigned int)&pSrc[2 * (((signed int)pViewport->uViewportX >> 1) + 320 * pViewport->uViewportY)];
1980
c1c74df0a33e changing most of auto types to their actual types
Grumpy7
parents: 1914
diff changeset
1975 short* pDst_x1y1 = pDst + Dst.lPitch * pViewport->uViewportTL_Y + pViewport->uViewportTL_X;
0
Ritor1
parents:
diff changeset
1976 //v23 = (unsigned __int32)((char *)v26 + 4 * (((signed int)pViewport->uViewportX >> 1) + (Dst.lPitch >> 2) * pViewport->uViewportY));
693
e0a1fccc89b1 map render fixes
Gloval
parents: 690
diff changeset
1977 v9 = ((signed int)pViewport->uViewportTL_X >> 1) - ((signed int)pViewport->uViewportBR_X >> 1);
0
Ritor1
parents:
diff changeset
1978 //v20 = ((signed int)pViewport->uViewportZ >> 1) - ((signed int)pViewport->uViewportX >> 1);
Ritor1
parents:
diff changeset
1979 v22 = 4 * ((Dst.lPitch / 4) + v9);
Ritor1
parents:
diff changeset
1980 v21 = 4 * v9 + 1280;
Ritor1
parents:
diff changeset
1981
121
3471df3713e2 Teal line at game's viewport bottom fix
Nomad
parents: 112
diff changeset
1982 //auto uNumLines = pViewport->uViewportW - pViewport->uViewportY + 1;
0
Ritor1
parents:
diff changeset
1983 //v26 = (LPVOID)(pViewport->uViewportW - pViewport->uViewportY + 1);
Ritor1
parents:
diff changeset
1984 v10 = (int)pSrc_x1y1;
Ritor1
parents:
diff changeset
1985 v11 = (int)pDst_x1y1;
2069
259df09dfb50 32bits almost there
Nomad
parents: 2060
diff changeset
1986 int uHalfWidth = (pViewport->uViewportBR_X - pViewport->uViewportTL_X) / 2;
0
Ritor1
parents:
diff changeset
1987 v13 = v24;
Ritor1
parents:
diff changeset
1988
693
e0a1fccc89b1 map render fixes
Gloval
parents: 690
diff changeset
1989 for (uint y = pViewport->uViewportTL_Y; y < pViewport->uViewportBR_Y + 1; ++y)
0
Ritor1
parents:
diff changeset
1990 {
Ritor1
parents:
diff changeset
1991 //memcpy(pDst + pViewport->uViewportX + y * Dst.lPitch / 2,
Ritor1
parents:
diff changeset
1992 // pSrc + pViewport->uViewportX + y * 640, (pViewport->uViewportZ - pViewport->uViewportX) * sizeof(__int16));
693
e0a1fccc89b1 map render fixes
Gloval
parents: 690
diff changeset
1993 for (uint x = pViewport->uViewportTL_X; x < pViewport->uViewportBR_X; ++x)
0
Ritor1
parents:
diff changeset
1994 {
Ritor1
parents:
diff changeset
1995 if (pSrc[y * 640 + x] != (pRenderer->uTargetGMask | pRenderer->uTargetBMask))
Ritor1
parents:
diff changeset
1996 pDst[y * Dst.lPitch / 2 + x] = pSrc[y * 640 + x];
Ritor1
parents:
diff changeset
1997 }
Ritor1
parents:
diff changeset
1998 }
2069
259df09dfb50 32bits almost there
Nomad
parents: 2060
diff changeset
1999 }
0
Ritor1
parents:
diff changeset
2000
Ritor1
parents:
diff changeset
2001 ErrD3D(pRenderer->pBackBuffer4->Unlock(0));
Ritor1
parents:
diff changeset
2002
Ritor1
parents:
diff changeset
2003 /* while ( 1 )
Ritor1
parents:
diff changeset
2004 {
Ritor1
parents:
diff changeset
2005 while ( 1 )
Ritor1
parents:
diff changeset
2006 {
Ritor1
parents:
diff changeset
2007 v14 = *(int *)v10;
Ritor1
parents:
diff changeset
2008 v10 += 4;
Ritor1
parents:
diff changeset
2009 if ( v14 == v13 )
Ritor1
parents:
diff changeset
2010 break;
Ritor1
parents:
diff changeset
2011 if ( (short)v14 == (short)v13 )
Ritor1
parents:
diff changeset
2012 {
Ritor1
parents:
diff changeset
2013 *(int *)v11 = *(int *)v11 & 0xFFFF | v14 & 0xFFFF0000;
Ritor1
parents:
diff changeset
2014 v11 += 4;
Ritor1
parents:
diff changeset
2015 --uHalfWidth;
Ritor1
parents:
diff changeset
2016 if ( !uHalfWidth )
Ritor1
parents:
diff changeset
2017 goto LABEL_21;
Ritor1
parents:
diff changeset
2018 }
Ritor1
parents:
diff changeset
2019 else
Ritor1
parents:
diff changeset
2020 {
Ritor1
parents:
diff changeset
2021 v15 = __ROL__(v14, 16);
Ritor1
parents:
diff changeset
2022 if ( (short)v15 == (short)v13 )
Ritor1
parents:
diff changeset
2023 {
Ritor1
parents:
diff changeset
2024 v17 = __ROR__(v15, 16);
Ritor1
parents:
diff changeset
2025 *(int *)v11 = *(int *)v11 & 0xFFFF0000 | (unsigned __int16)v17;
Ritor1
parents:
diff changeset
2026 v11 += 4;
Ritor1
parents:
diff changeset
2027 --uHalfWidth;
Ritor1
parents:
diff changeset
2028 if ( !uHalfWidth )
Ritor1
parents:
diff changeset
2029 goto LABEL_21;
Ritor1
parents:
diff changeset
2030 }
Ritor1
parents:
diff changeset
2031 else
Ritor1
parents:
diff changeset
2032 {
Ritor1
parents:
diff changeset
2033 v16 = __ROR__(v15, 16);
Ritor1
parents:
diff changeset
2034 *(int *)v11 = v16;
Ritor1
parents:
diff changeset
2035 v11 += 4;
Ritor1
parents:
diff changeset
2036 --uHalfWidth;
Ritor1
parents:
diff changeset
2037 if ( !uHalfWidth )
Ritor1
parents:
diff changeset
2038 goto LABEL_21;
Ritor1
parents:
diff changeset
2039 }
Ritor1
parents:
diff changeset
2040 }
Ritor1
parents:
diff changeset
2041 }
Ritor1
parents:
diff changeset
2042 v11 += 4;
Ritor1
parents:
diff changeset
2043 --uHalfWidth;
Ritor1
parents:
diff changeset
2044 if ( !uHalfWidth )
Ritor1
parents:
diff changeset
2045 {
Ritor1
parents:
diff changeset
2046 LABEL_21:
Ritor1
parents:
diff changeset
2047 v10 += v21;
Ritor1
parents:
diff changeset
2048 v11 += v22;
Ritor1
parents:
diff changeset
2049 uHalfWidth = v20;
Ritor1
parents:
diff changeset
2050 if ( !--uNumLines )
Ritor1
parents:
diff changeset
2051 {
Ritor1
parents:
diff changeset
2052 ErrD3D(pRenderer->pBackBuffer4->Unlock(0));
Ritor1
parents:
diff changeset
2053 return;
Ritor1
parents:
diff changeset
2054 }
Ritor1
parents:
diff changeset
2055 }
Ritor1
parents:
diff changeset
2056 }*/
Ritor1
parents:
diff changeset
2057 }
Ritor1
parents:
diff changeset
2058 }
Ritor1
parents:
diff changeset
2059 }
Ritor1
parents:
diff changeset
2060 }
Ritor1
parents:
diff changeset
2061
Ritor1
parents:
diff changeset
2062 //----- (004A7063) --------------------------------------------------------
1390
613c77e51e38 Messed with spell effects drawing a bit.
Nomad
parents: 1384
diff changeset
2063 unsigned int ModulateColor(unsigned int diffuse, float multiplier)
0
Ritor1
parents:
diff changeset
2064 {
1390
613c77e51e38 Messed with spell effects drawing a bit.
Nomad
parents: 1384
diff changeset
2065 float alpha = multiplier * ((diffuse >> 24) & 0xFF);
613c77e51e38 Messed with spell effects drawing a bit.
Nomad
parents: 1384
diff changeset
2066 int a = (int)floorf(alpha + 0.5f);
613c77e51e38 Messed with spell effects drawing a bit.
Nomad
parents: 1384
diff changeset
2067 a = max(0, min(255, a));
613c77e51e38 Messed with spell effects drawing a bit.
Nomad
parents: 1384
diff changeset
2068
613c77e51e38 Messed with spell effects drawing a bit.
Nomad
parents: 1384
diff changeset
2069 float red = multiplier * ((diffuse >> 16) & 0xFF);
613c77e51e38 Messed with spell effects drawing a bit.
Nomad
parents: 1384
diff changeset
2070 int r = (int)floorf(red + 0.5f);
613c77e51e38 Messed with spell effects drawing a bit.
Nomad
parents: 1384
diff changeset
2071 r = max(0, min(255, r));
613c77e51e38 Messed with spell effects drawing a bit.
Nomad
parents: 1384
diff changeset
2072
613c77e51e38 Messed with spell effects drawing a bit.
Nomad
parents: 1384
diff changeset
2073 float green = multiplier * ((diffuse >> 8) & 0xFF);
613c77e51e38 Messed with spell effects drawing a bit.
Nomad
parents: 1384
diff changeset
2074 int g = (int)floorf(green + 0.5f);
613c77e51e38 Messed with spell effects drawing a bit.
Nomad
parents: 1384
diff changeset
2075 g = max(0, min(255, g));
613c77e51e38 Messed with spell effects drawing a bit.
Nomad
parents: 1384
diff changeset
2076
613c77e51e38 Messed with spell effects drawing a bit.
Nomad
parents: 1384
diff changeset
2077 float blue = multiplier * ((diffuse >> 0) & 0xFF);
613c77e51e38 Messed with spell effects drawing a bit.
Nomad
parents: 1384
diff changeset
2078 int b = (int)floorf(blue + 0.5f);
613c77e51e38 Messed with spell effects drawing a bit.
Nomad
parents: 1384
diff changeset
2079 b = max(0, min(255, b));
613c77e51e38 Messed with spell effects drawing a bit.
Nomad
parents: 1384
diff changeset
2080
613c77e51e38 Messed with spell effects drawing a bit.
Nomad
parents: 1384
diff changeset
2081 return (a << 24) | (r << 16) | (g << 8) | b;
0
Ritor1
parents:
diff changeset
2082 }
Ritor1
parents:
diff changeset
2083
Ritor1
parents:
diff changeset
2084
Ritor1
parents:
diff changeset
2085
Ritor1
parents:
diff changeset
2086 //----- (004B1447) --------------------------------------------------------
1754
421c29d4ab3e UITransition.cpp cleaning(continue)
Ritor1
parents: 1747
diff changeset
2087 void sub_4B1447_party_fine(int a1, int a2, int a3)
0
Ritor1
parents:
diff changeset
2088 {
Ritor1
parents:
diff changeset
2089 signed int v3; // esi@1
Ritor1
parents:
diff changeset
2090 char v4; // sf@8
Ritor1
parents:
diff changeset
2091 int v5; // eax@8
Ritor1
parents:
diff changeset
2092 unsigned __int64 v6; // qax@12
Ritor1
parents:
diff changeset
2093 DDM_DLV_Header *v7; // eax@14
Ritor1
parents:
diff changeset
2094
Ritor1
parents:
diff changeset
2095 v3 = 0;
Ritor1
parents:
diff changeset
2096 if ( a2 )
Ritor1
parents:
diff changeset
2097 {
1754
421c29d4ab3e UITransition.cpp cleaning(continue)
Ritor1
parents: 1747
diff changeset
2098 if ( a2 == 1 )
421c29d4ab3e UITransition.cpp cleaning(continue)
Ritor1
parents: 1747
diff changeset
2099 v3 = 2;
421c29d4ab3e UITransition.cpp cleaning(continue)
Ritor1
parents: 1747
diff changeset
2100 if ( a2 == 2 )
421c29d4ab3e UITransition.cpp cleaning(continue)
Ritor1
parents: 1747
diff changeset
2101 v3 = 2;
0
Ritor1
parents:
diff changeset
2102 goto LABEL_13;
Ritor1
parents:
diff changeset
2103 }
Ritor1
parents:
diff changeset
2104 else
Ritor1
parents:
diff changeset
2105 {
Ritor1
parents:
diff changeset
2106 v3 = 1;
Ritor1
parents:
diff changeset
2107 }
Ritor1
parents:
diff changeset
2108 if ( pParty->uFine < 4000000 )
Ritor1
parents:
diff changeset
2109 {
Ritor1
parents:
diff changeset
2110 v4 = a3 + pParty->uFine < 0;
Ritor1
parents:
diff changeset
2111 v5 = a3 + pParty->uFine;
Ritor1
parents:
diff changeset
2112 pParty->uFine += a3;
Ritor1
parents:
diff changeset
2113 if ( v4 )
Ritor1
parents:
diff changeset
2114 {
Ritor1
parents:
diff changeset
2115 v5 = 0;
Ritor1
parents:
diff changeset
2116 pParty->uFine = 0;
Ritor1
parents:
diff changeset
2117 }
Ritor1
parents:
diff changeset
2118 if ( v5 > 4000000 )
Ritor1
parents:
diff changeset
2119 pParty->uFine = 4000000;
Ritor1
parents:
diff changeset
2120 }
487
d5da524ec901 shop entering fixed
Gloval
parents: 484
diff changeset
2121
1747
cecb080929c4 Party_stru0 renamed to PartyTimeStruct, fixed its members, renamed Party::field_3C to Party::PartyTimes, started Player::SetVariable refactoring start
Grumpy7
parents: 1709
diff changeset
2122 pParty->PartyTimes._shop_ban_times[a1] = pParty->uTimePlayed + 368640;
487
d5da524ec901 shop entering fixed
Gloval
parents: 484
diff changeset
2123
0
Ritor1
parents:
diff changeset
2124 LABEL_13:
463
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 462
diff changeset
2125 pParty->InTheShopFlags[a1] = 1;
0
Ritor1
parents:
diff changeset
2126 if ( v3 )
Ritor1
parents:
diff changeset
2127 {
Ritor1
parents:
diff changeset
2128 v7 = &pOutdoor->ddm;
Ritor1
parents:
diff changeset
2129 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor )
Ritor1
parents:
diff changeset
2130 v7 = &pIndoor->dlv;
Ritor1
parents:
diff changeset
2131 v7->uReputation += v3;
Ritor1
parents:
diff changeset
2132 if ( v7->uReputation > 10000 )
Ritor1
parents:
diff changeset
2133 v7->uReputation = 10000;
Ritor1
parents:
diff changeset
2134 }
1754
421c29d4ab3e UITransition.cpp cleaning(continue)
Ritor1
parents: 1747
diff changeset
2135 for ( uint i = 1; i <= 4; ++i )
0
Ritor1
parents:
diff changeset
2136 {
Ritor1
parents:
diff changeset
2137 if ( pParty->uFine )
Ritor1
parents:
diff changeset
2138 {
1754
421c29d4ab3e UITransition.cpp cleaning(continue)
Ritor1
parents: 1747
diff changeset
2139 if ( !_449B57_test_bit(pPlayers[i]->_achieved_awards_bits, 1) )
421c29d4ab3e UITransition.cpp cleaning(continue)
Ritor1
parents: 1747
diff changeset
2140 _449B7E_toggle_bit(pPlayers[i]->_achieved_awards_bits, 1, 1);
0
Ritor1
parents:
diff changeset
2141 }
Ritor1
parents:
diff changeset
2142 }
Ritor1
parents:
diff changeset
2143 }
Ritor1
parents:
diff changeset
2144
Ritor1
parents:
diff changeset
2145 //----- (004B1523) --------------------------------------------------------
1458
934074e7fcc1 ModalWindow
Nomad
parents: 1453
diff changeset
2146 void sub_4B1523(int *_this)
0
Ritor1
parents:
diff changeset
2147 {
Ritor1
parents:
diff changeset
2148 int v1; // esi@1
Ritor1
parents:
diff changeset
2149 int v2; // edx@1
Ritor1
parents:
diff changeset
2150 unsigned int v3; // eax@2
Ritor1
parents:
diff changeset
2151 int v4; // eax@4
Ritor1
parents:
diff changeset
2152 LONG v5; // ecx@4
Ritor1
parents:
diff changeset
2153 int v6; // eax@10
Ritor1
parents:
diff changeset
2154 char *v7; // ST44_4@12
Ritor1
parents:
diff changeset
2155 unsigned __int16 v8; // ax@12
Ritor1
parents:
diff changeset
2156 GUIWindow a1; // [sp+Ch] [bp-68h]@4
Ritor1
parents:
diff changeset
2157 unsigned int v11; // [sp+60h] [bp-14h]@1
Ritor1
parents:
diff changeset
2158 POINT a2; // [sp+64h] [bp-10h]@1
Ritor1
parents:
diff changeset
2159 int v13; // [sp+6Ch] [bp-8h]@4
Ritor1
parents:
diff changeset
2160 int v14; // [sp+70h] [bp-4h]@4
Ritor1
parents:
diff changeset
2161
Ritor1
parents:
diff changeset
2162 v1 = *_this - 399;
Ritor1
parents:
diff changeset
2163 v2 = (*_this - 400) % 11 + 1;
Ritor1
parents:
diff changeset
2164 v11 = 4 * (*_this - 400) / 11;
1312
ae435824ac4d books code splitted to separate files
Gloval
parents: 1299
diff changeset
2165 // sprintf(pTmpBuf.data(), "%s%03d", spellbook_texture_filename_suffices[v11 / 4], v2); not used
0
Ritor1
parents:
diff changeset
2166 if ( pMouse->GetCursorPos(&a2)->y <= 320 )
Ritor1
parents:
diff changeset
2167 v3 = pMouse->GetCursorPos(&a2)->y + 30;
Ritor1
parents:
diff changeset
2168 else
Ritor1
parents:
diff changeset
2169 v3 = 30;
Ritor1
parents:
diff changeset
2170 a1.Hint = 0;
Ritor1
parents:
diff changeset
2171 a1.uFrameY = v3;
Ritor1
parents:
diff changeset
2172 a1.uFrameWidth = 328;
Ritor1
parents:
diff changeset
2173 a1.uFrameHeight = 68;
Ritor1
parents:
diff changeset
2174 a1.uFrameX = 90;
Ritor1
parents:
diff changeset
2175 a1.uFrameZ = 417;
Ritor1
parents:
diff changeset
2176 a1.uFrameW = v3 + 67;
Ritor1
parents:
diff changeset
2177 a2.y = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[431]);
Ritor1
parents:
diff changeset
2178 v14 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[433]);
Ritor1
parents:
diff changeset
2179 v13 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[432]);
Ritor1
parents:
diff changeset
2180 v4 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[96]);
Ritor1
parents:
diff changeset
2181 v5 = a2.y;
Ritor1
parents:
diff changeset
2182 if ( v14 > a2.y )
Ritor1
parents:
diff changeset
2183 v5 = v14;
Ritor1
parents:
diff changeset
2184 if ( v13 > v5 )
Ritor1
parents:
diff changeset
2185 v5 = v13;
Ritor1
parents:
diff changeset
2186 if ( v4 > v5 )
Ritor1
parents:
diff changeset
2187 v5 = v4;
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
2188 sprintf(pTmpBuf2.data(), "%s\n\n%s\t%03d:\t%03d%s\t000\n%s\t%03d:\t%03d%s\t000\n%s\t%03d:\t%03d%s\t000\n%s\t%03d:\t%03d%s",
262
Ritor1
parents: 250
diff changeset
2189 pSpellStats->pInfos[v1].pDescription, pGlobalTXT_LocalizationStrings[431], // "Normal"
Ritor1
parents: 250
diff changeset
2190 v5 + 3, v5 + 10, pSpellStats->pInfos[v1].pBasicSkillDesc, pGlobalTXT_LocalizationStrings[433], // "Expert"
Ritor1
parents: 250
diff changeset
2191 v5 + 3, v5 + 10, pSpellStats->pInfos[v1].pExpertSkillDesc, pGlobalTXT_LocalizationStrings[432], // "Master"
Ritor1
parents: 250
diff changeset
2192 v5 + 3, v5 + 10, pSpellStats->pInfos[v1].pMasterSkillDesc, pGlobalTXT_LocalizationStrings[96], // "Grand"
Ritor1
parents: 250
diff changeset
2193 v5 + 3, v5 + 10, pSpellStats->pInfos[v1].pGrandmasterSkillDesc);
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
2194 v6 = pFontSmallnum->CalcTextHeight(pTmpBuf2.data(), &a1, 0, 0);
0
Ritor1
parents:
diff changeset
2195 a1.uFrameHeight += v6;
Ritor1
parents:
diff changeset
2196 if ( (signed int)a1.uFrameHeight < 150 )
Ritor1
parents:
diff changeset
2197 a1.uFrameHeight = 150;
819
9359c114f98c More on screenshot
Nomad
parents: 816
diff changeset
2198 a1.uFrameWidth = game_viewport_width;
0
Ritor1
parents:
diff changeset
2199 a1.DrawMessageBox(0);
Ritor1
parents:
diff changeset
2200 a1.uFrameWidth -= 12;
Ritor1
parents:
diff changeset
2201 a1.uFrameHeight -= 12;
Ritor1
parents:
diff changeset
2202 v7 = pSpellStats->pInfos[v1].pName;
Ritor1
parents:
diff changeset
2203 a1.uFrameZ = a1.uFrameX + a1.uFrameWidth - 1;
Ritor1
parents:
diff changeset
2204 a1.uFrameW = a1.uFrameHeight + a1.uFrameY - 1;
2069
259df09dfb50 32bits almost there
Nomad
parents: 2060
diff changeset
2205 v8 = Color16(0xFFu, 0xFFu, 0x9Bu);
0
Ritor1
parents:
diff changeset
2206 a1.DrawTitleText(pFontArrus, 0x78u, 0xCu, v8, v7, 3u);
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
2207 a1.DrawText(pFontSmallnum, 120, 44, 0, pTmpBuf2.data(), 0, 0, 0);
0
Ritor1
parents:
diff changeset
2208 a1.uFrameZ = a1.uFrameX + 107;
Ritor1
parents:
diff changeset
2209 a1.uFrameWidth = 108;
Ritor1
parents:
diff changeset
2210 a1.DrawTitleText(pFontComic, 0xCu, 0x4Bu, 0, pSkillNames[v11 / 4 + 12], 3u);
1393
28f87f5234a1 More hardcoded UI colors moved to varibables.
Nomad
parents: 1391
diff changeset
2211 sprintfex(pTmpBuf.data(), "%s\n%d", pGlobalTXT_LocalizationStrings[522], *(&pSpellDatas[0].uNormalLevelMana + 10 * v1));
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
2212 a1.DrawTitleText(pFontComic, 0xCu, a1.uFrameHeight - LOBYTE(pFontComic->uFontHeight) - 16, 0, pTmpBuf.data(), 3);
0
Ritor1
parents:
diff changeset
2213 }
Ritor1
parents:
diff changeset
2214
Ritor1
parents:
diff changeset
2215 //----- (004B1ECE) --------------------------------------------------------
1459
2ca62c9e7b3c Function names
Nomad
parents: 1458
diff changeset
2216 void OracleDialogue()
0
Ritor1
parents:
diff changeset
2217 {
Ritor1
parents:
diff changeset
2218 __int16 *v0; // edi@1
Ritor1
parents:
diff changeset
2219 int v1; // ebx@3
Ritor1
parents:
diff changeset
2220 Player *v2; // esi@3
Ritor1
parents:
diff changeset
2221 int v3; // eax@4
Ritor1
parents:
diff changeset
2222 signed int v4; // eax@9
Ritor1
parents:
diff changeset
2223 int v5; // ebx@11
89
98cd93e14777 pointer fixes
zipi
parents: 87
diff changeset
2224 Player *v6; // esi@13
98cd93e14777 pointer fixes
zipi
parents: 87
diff changeset
2225 ItemGen *v7; // eax@14
0
Ritor1
parents:
diff changeset
2226 signed int v8; // edi@14
89
98cd93e14777 pointer fixes
zipi
parents: 87
diff changeset
2227 ItemGen *v9; // [sp+Ch] [bp-Ch]@11
0
Ritor1
parents:
diff changeset
2228 signed int v10; // [sp+10h] [bp-8h]@13
Ritor1
parents:
diff changeset
2229 int v11; // [sp+14h] [bp-4h]@1
89
98cd93e14777 pointer fixes
zipi
parents: 87
diff changeset
2230 Player *v12; // [sp+14h] [bp-4h]@11
0
Ritor1
parents:
diff changeset
2231
484
4bd56919f075 avard quest guild bits
Gloval
parents: 481
diff changeset
2232 contract_approved = 0;
0
Ritor1
parents:
diff changeset
2233 v11 = 0;
Ritor1
parents:
diff changeset
2234 uDialogueType = 84;
827
085eb19b7ffd mr.Malvik
Ritor1
parents: 823
diff changeset
2235 current_npc_text = (char *)pNPCTopics[667].pText;
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
2236 v0 = _4F0882_evt_VAR_PlayerItemInHands_vals.data();
2102
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2237 //while ( 1 )
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2238 for ( uint i = 0; i <= 53; i++ )
0
Ritor1
parents:
diff changeset
2239 {
484
4bd56919f075 avard quest guild bits
Gloval
parents: 481
diff changeset
2240 if ( (unsigned __int16)_449B57_test_bit(pParty->_quest_bits, *v0) )
0
Ritor1
parents:
diff changeset
2241 {
2102
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2242 //v1 = 0;
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2243 //v2 = pParty->pPlayers.data();
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2244 for ( uint pl = 0; pl < 4; pl++ )
0
Ritor1
parents:
diff changeset
2245 {
2102
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2246 //LOBYTE(v3) = pParty->pPlayers[pl].CompareVariable(VAR_PlayerItemInHands, *(v0+1));
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2247 if ( pParty->pPlayers[pl].CompareVariable(VAR_PlayerItemInHands, *(v0+1)) )
0
Ritor1
parents:
diff changeset
2248 break;
2102
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2249 //++v2;
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2250 //++v1;
0
Ritor1
parents:
diff changeset
2251 }
2102
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2252 //while ( (signed int)v2 < (signed int)pParty->pHirelings.data() );
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2253 //if ( v1 == 4 )
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2254 //break;
0
Ritor1
parents:
diff changeset
2255 }
Ritor1
parents:
diff changeset
2256 ++v11;
2102
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2257 //v0 += 2;
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2258 //if ( v0 > &_4F0882_evt_VAR_PlayerItemInHands_vals[53] )
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2259 //break;
89
98cd93e14777 pointer fixes
zipi
parents: 87
diff changeset
2260 }
98cd93e14777 pointer fixes
zipi
parents: 87
diff changeset
2261 if ( v0 <= &_4F0882_evt_VAR_PlayerItemInHands_vals[53] )
98cd93e14777 pointer fixes
zipi
parents: 87
diff changeset
2262 {
827
085eb19b7ffd mr.Malvik
Ritor1
parents: 823
diff changeset
2263 current_npc_text = (char *)pNPCTopics[666].pText; // Here's %s that you lost. Be careful
89
98cd93e14777 pointer fixes
zipi
parents: 87
diff changeset
2264 v4 = _4F0882_evt_VAR_PlayerItemInHands_vals[2 * v11];
484
4bd56919f075 avard quest guild bits
Gloval
parents: 481
diff changeset
2265 contract_approved = _4F0882_evt_VAR_PlayerItemInHands_vals[2 * v11];
89
98cd93e14777 pointer fixes
zipi
parents: 87
diff changeset
2266 pParty->pPlayers[0].AddVariable(VAR_PlayerItemInHands, v4);
98cd93e14777 pointer fixes
zipi
parents: 87
diff changeset
2267 }
484
4bd56919f075 avard quest guild bits
Gloval
parents: 481
diff changeset
2268 if ( contract_approved == 601 )
0
Ritor1
parents:
diff changeset
2269 {
Ritor1
parents:
diff changeset
2270 v5 = 0;
2102
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2271 //v12 = pParty->pPlayers.data();//[0].uClass;
0
Ritor1
parents:
diff changeset
2272 v9 = 0;
2102
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2273 //while ( 1 )
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2274 for ( uint i = 0; i < 4; i++ )
0
Ritor1
parents:
diff changeset
2275 {
2102
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2276 if ( pParty->pPlayers[i].classType == PLAYER_CLASS_LICH )
0
Ritor1
parents:
diff changeset
2277 {
Ritor1
parents:
diff changeset
2278 v10 = 0;
2102
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2279 //v6 = pParty->pPlayers.data();//[0].pInventoryItems[0].field_1A;
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2280 for ( uint pl = 0; pl < 4; pl++ )
0
Ritor1
parents:
diff changeset
2281 {
2102
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2282 for ( v8 = 0; v8 < 126; v8++ )//138
0
Ritor1
parents:
diff changeset
2283 {
2102
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2284 if ( pParty->pPlayers[pl].pInventoryItemList[v8].uItemID == ITEM_LICH_JAR_FULL )
0
Ritor1
parents:
diff changeset
2285 {
2102
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2286 if ( !pParty->pPlayers[pl].pInventoryItemList[v8].uHolderPlayer )
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2287 v9 = &pParty->pPlayers[pl].pInventoryItemList[v8];
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2288 if ( pParty->pPlayers[pl].pInventoryItemList[v8].uHolderPlayer == v5 )
0
Ritor1
parents:
diff changeset
2289 v10 = 1;
Ritor1
parents:
diff changeset
2290 }
Ritor1
parents:
diff changeset
2291 }
89
98cd93e14777 pointer fixes
zipi
parents: 87
diff changeset
2292 }
0
Ritor1
parents:
diff changeset
2293 if ( !v10 )
Ritor1
parents:
diff changeset
2294 break;
Ritor1
parents:
diff changeset
2295 }
2102
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2296 // ++v12;
0
Ritor1
parents:
diff changeset
2297 ++v5;
2102
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2298 // if ( v12 > &pParty->pPlayers[3] )
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2299 // return;
0
Ritor1
parents:
diff changeset
2300 }
Ritor1
parents:
diff changeset
2301 if ( v9 )
377
243418228760 GetIdentifiedName
Gloval
parents: 373
diff changeset
2302 v9->uHolderPlayer = v5;
0
Ritor1
parents:
diff changeset
2303 }
Ritor1
parents:
diff changeset
2304 }
Ritor1
parents:
diff changeset
2305
Ritor1
parents:
diff changeset
2306 //----- (004B254D) --------------------------------------------------------
1458
934074e7fcc1 ModalWindow
Nomad
parents: 1453
diff changeset
2307 char * _4B254D_SkillMasteryTeacher(int _this)
0
Ritor1
parents:
diff changeset
2308 {
955
Ritor1
parents: 917
diff changeset
2309 //Player *v1; // esi@1
0
Ritor1
parents:
diff changeset
2310 int v2; // edx@1
Ritor1
parents:
diff changeset
2311 int v3; // ecx@1
Ritor1
parents:
diff changeset
2312 int v4; // edi@1
955
Ritor1
parents: 917
diff changeset
2313 int pClassType; // eax@7
0
Ritor1
parents:
diff changeset
2314 int v6; // eax@7
Ritor1
parents:
diff changeset
2315 int v7; // ebx@7
955
Ritor1
parents: 917
diff changeset
2316 //int v8; // ebx@8
0
Ritor1
parents:
diff changeset
2317 signed int v9; // esi@8
Ritor1
parents:
diff changeset
2318 int v10; // eax@8
Ritor1
parents:
diff changeset
2319 char *v11; // ecx@8
2102
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2320 //int v12; // edi@9
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2321 //char *v13; // edx@9
0
Ritor1
parents:
diff changeset
2322 signed int v14; // edi@10
Ritor1
parents:
diff changeset
2323 unsigned int v16; // eax@29
955
Ritor1
parents: 917
diff changeset
2324 //int v17; // eax@36
0
Ritor1
parents:
diff changeset
2325 char v18; // cl@46
Ritor1
parents:
diff changeset
2326 __int16 v19; // dx@56
Ritor1
parents:
diff changeset
2327 int v20; // eax@60
955
Ritor1
parents: 917
diff changeset
2328 //char *v21; // [sp-Ch] [bp-38h]@82
Ritor1
parents: 917
diff changeset
2329 //const char *v22; // [sp-8h] [bp-34h]@21
Ritor1
parents: 917
diff changeset
2330 //unsigned int v23; // [sp-8h] [bp-34h]@38
Ritor1
parents: 917
diff changeset
2331 //char *v24; // [sp-8h] [bp-34h]@82
1838
211dfe2d8db1 changing global char* vars to const char* vars
Grumpy7
parents: 1828
diff changeset
2332 const char *v25; // [sp-4h] [bp-30h]@14
955
Ritor1
parents: 917
diff changeset
2333 //int v26; // [sp-4h] [bp-30h]@38
Ritor1
parents: 917
diff changeset
2334 //int v27; // [sp-4h] [bp-30h]@82
0
Ritor1
parents:
diff changeset
2335 char v28[4]; // [sp+Ch] [bp-20h]@9
Ritor1
parents:
diff changeset
2336 int v29; // [sp+10h] [bp-1Ch]@13
Ritor1
parents:
diff changeset
2337 int v30; // [sp+14h] [bp-18h]@15
Ritor1
parents:
diff changeset
2338 int v31; // [sp+18h] [bp-14h]@16
Ritor1
parents:
diff changeset
2339 unsigned __int16 a1[2]; // [sp+1Ch] [bp-10h]@7
955
Ritor1
parents: 917
diff changeset
2340 //int v33; // [sp+20h] [bp-Ch]@7
0
Ritor1
parents:
diff changeset
2341 int v34; // [sp+24h] [bp-8h]@7
Ritor1
parents:
diff changeset
2342 char *v35; // [sp+28h] [bp-4h]@1
Ritor1
parents:
diff changeset
2343
484
4bd56919f075 avard quest guild bits
Gloval
parents: 481
diff changeset
2344 contract_approved = 0;
0
Ritor1
parents:
diff changeset
2345 v2 = (_this - 200) % 3;
Ritor1
parents:
diff changeset
2346 v3 = (_this - 200) / 3;
Ritor1
parents:
diff changeset
2347 v4 = v2;
Ritor1
parents:
diff changeset
2348 v35 = (char *)pNPCTopics[127].pText;
492
Gloval
parents: 487
diff changeset
2349 dword_F8B1AC_award_bit_number = v3;
0
Ritor1
parents:
diff changeset
2350 if ( v2 )
Ritor1
parents:
diff changeset
2351 {
Ritor1
parents:
diff changeset
2352 if ( v2 == 1 )
Ritor1
parents:
diff changeset
2353 {
267
ac44e716d051 DrawDialogueUI logic restored
Nomad
parents: 264
diff changeset
2354 gold_transaction_amount = 5000;
0
Ritor1
parents:
diff changeset
2355 dword_F8B1B0 = 3;
Ritor1
parents:
diff changeset
2356 }
Ritor1
parents:
diff changeset
2357 else
Ritor1
parents:
diff changeset
2358 {
Ritor1
parents:
diff changeset
2359 if ( v2 == 2 )
Ritor1
parents:
diff changeset
2360 {
267
ac44e716d051 DrawDialogueUI logic restored
Nomad
parents: 264
diff changeset
2361 gold_transaction_amount = 8000;
0
Ritor1
parents:
diff changeset
2362 dword_F8B1B0 = 4;
Ritor1
parents:
diff changeset
2363 }
Ritor1
parents:
diff changeset
2364 }
Ritor1
parents:
diff changeset
2365 }
Ritor1
parents:
diff changeset
2366 else
Ritor1
parents:
diff changeset
2367 {
267
ac44e716d051 DrawDialogueUI logic restored
Nomad
parents: 264
diff changeset
2368 gold_transaction_amount = 2000;
0
Ritor1
parents:
diff changeset
2369 dword_F8B1B0 = 2;
Ritor1
parents:
diff changeset
2370 }
955
Ritor1
parents: 917
diff changeset
2371 pClassType = pPlayers[uActiveCharacter]->classType;
Ritor1
parents: 917
diff changeset
2372 //v33 = pClassType;
Ritor1
parents: 917
diff changeset
2373 v6 = byte_4ED970_skill_learn_ability_by_class_table[pClassType][v3];
Ritor1
parents: 917
diff changeset
2374 *(int *)a1 = pPlayers[uActiveCharacter]->pActiveSkills[v3];
0
Ritor1
parents:
diff changeset
2375 v7 = a1[0] & 0x3F;
Ritor1
parents:
diff changeset
2376 v34 = v2 + 2;
Ritor1
parents:
diff changeset
2377 if ( v6 < v2 + 2 )
Ritor1
parents:
diff changeset
2378 {
955
Ritor1
parents: 917
diff changeset
2379 //v8 = v33;
2102
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2380
955
Ritor1
parents: 917
diff changeset
2381 v10 = pClassType - pClassType % 4;
Ritor1
parents: 917
diff changeset
2382 v11 = &byte_4ED970_skill_learn_ability_by_class_table[pClassType - pClassType % 4][v3];
2102
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2383 for ( v9 = 0; v9 < 4; ++v9 )
0
Ritor1
parents:
diff changeset
2384 {
2102
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2385 v28[4 * v9] = 0;
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2386 if ( (unsigned __int8)*v11 < v34 )
0
Ritor1
parents:
diff changeset
2387 {
Ritor1
parents:
diff changeset
2388 v14 = 1;
Ritor1
parents:
diff changeset
2389 }
Ritor1
parents:
diff changeset
2390 else
Ritor1
parents:
diff changeset
2391 {
Ritor1
parents:
diff changeset
2392 v14 = 1;
2102
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2393 v28[4 * v9] = 1;
0
Ritor1
parents:
diff changeset
2394 }
Ritor1
parents:
diff changeset
2395 v11 += 37;
Ritor1
parents:
diff changeset
2396 }
1409
c9e3b93ec570 Highlighted locations with "using uninitialized variable" warning.
Nomad
parents: 1393
diff changeset
2397 __debugbreak(); // warning C4700: uninitialized local variable 'v29' used
0
Ritor1
parents:
diff changeset
2398 if ( v29 == v14 )
Ritor1
parents:
diff changeset
2399 {
Ritor1
parents:
diff changeset
2400 v25 = pClassNames[v10 + 1];
Ritor1
parents:
diff changeset
2401 }
Ritor1
parents:
diff changeset
2402 else
Ritor1
parents:
diff changeset
2403 {
1409
c9e3b93ec570 Highlighted locations with "using uninitialized variable" warning.
Nomad
parents: 1393
diff changeset
2404 __debugbreak(); // warning C4700: uninitialized local variable 'v30' used
955
Ritor1
parents: 917
diff changeset
2405 if ( v30 == v14 )//crash
0
Ritor1
parents:
diff changeset
2406 {
1409
c9e3b93ec570 Highlighted locations with "using uninitialized variable" warning.
Nomad
parents: 1393
diff changeset
2407 __debugbreak(); // warning C4700: uninitialized local variable 'v31' used
0
Ritor1
parents:
diff changeset
2408 if ( v31 == v14 )
Ritor1
parents:
diff changeset
2409 {
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
2410 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[634], pClassNames[v10 + 2], pClassNames[v10 + 3]);//Âû äîëæíû äîñòè÷ü çâàíèÿ %s èëè %s äëÿ îáó÷åíèÿ ýòîìó óðîâíþ íàâûêà.
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
2411 return pTmpBuf.data();
0
Ritor1
parents:
diff changeset
2412 }
Ritor1
parents:
diff changeset
2413 v25 = pClassNames[v10 + 2];
Ritor1
parents:
diff changeset
2414 }
Ritor1
parents:
diff changeset
2415 else
Ritor1
parents:
diff changeset
2416 {
Ritor1
parents:
diff changeset
2417 if ( v31 != v14 )
Ritor1
parents:
diff changeset
2418 {
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
2419 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[632], pClassNames[pClassType]);//Ýòîò óðîâåíü íàâûêà íå ìîæåò áûòü ïîñòèãíóò êëàññîì %s.
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
2420 return pTmpBuf.data();
0
Ritor1
parents:
diff changeset
2421 }
Ritor1
parents:
diff changeset
2422 v25 = pClassNames[v10 + 3];
Ritor1
parents:
diff changeset
2423 }
Ritor1
parents:
diff changeset
2424 }
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
2425 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[633], v25);//Âû äîëæíû äîñòè÷ü çâàíèÿ %s äëÿ îáó÷åíèÿ ýòîìó óðîâíþ íàâûêà.
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
2426 return pTmpBuf.data();
0
Ritor1
parents:
diff changeset
2427 }
955
Ritor1
parents: 917
diff changeset
2428 if ( !pPlayers[uActiveCharacter]->CanAct() )
0
Ritor1
parents:
diff changeset
2429 return (char *)pNPCTopics[122].pText;
Ritor1
parents:
diff changeset
2430 if ( !v7 )
Ritor1
parents:
diff changeset
2431 return (char *)pNPCTopics[131].pText;
Ritor1
parents:
diff changeset
2432 v16 = SkillToMastery(a1[0]);
Ritor1
parents:
diff changeset
2433 if ( (signed int)v16 > v4 + 1 )
Ritor1
parents:
diff changeset
2434 return (char *)pNPCTopics[v4 + 128].pText;
Ritor1
parents:
diff changeset
2435 if ( v34 != 2 )
Ritor1
parents:
diff changeset
2436 {
Ritor1
parents:
diff changeset
2437 if ( v34 == 3 )
Ritor1
parents:
diff changeset
2438 {
Ritor1
parents:
diff changeset
2439 if ( (signed int)v16 >= 2 && v7 >= 7 )
Ritor1
parents:
diff changeset
2440 {
492
Gloval
parents: 487
diff changeset
2441 switch ( dword_F8B1AC_award_bit_number )
0
Ritor1
parents:
diff changeset
2442 {
Ritor1
parents:
diff changeset
2443 case 12:
Ritor1
parents:
diff changeset
2444 case 13:
Ritor1
parents:
diff changeset
2445 case 14:
Ritor1
parents:
diff changeset
2446 case 15:
Ritor1
parents:
diff changeset
2447 case 16:
Ritor1
parents:
diff changeset
2448 case 17:
Ritor1
parents:
diff changeset
2449 case 18:
267
ac44e716d051 DrawDialogueUI logic restored
Nomad
parents: 264
diff changeset
2450 gold_transaction_amount = 4000;
0
Ritor1
parents:
diff changeset
2451 goto LABEL_42;
Ritor1
parents:
diff changeset
2452 case 19:
Ritor1
parents:
diff changeset
2453 v19 = 114;
955
Ritor1
parents: 917
diff changeset
2454 if ( !(unsigned __int16)_449B57_test_bit(pParty->_quest_bits, v19) )
Ritor1
parents: 917
diff changeset
2455 return v35;
Ritor1
parents: 917
diff changeset
2456 if ( !gold_transaction_amount )
Ritor1
parents: 917
diff changeset
2457 goto LABEL_79;
Ritor1
parents: 917
diff changeset
2458 goto LABEL_42;
0
Ritor1
parents:
diff changeset
2459 case 20:
Ritor1
parents:
diff changeset
2460 v19 = 110;
484
4bd56919f075 avard quest guild bits
Gloval
parents: 481
diff changeset
2461 if ( !(unsigned __int16)_449B57_test_bit(pParty->_quest_bits, v19) )
0
Ritor1
parents:
diff changeset
2462 return v35;
955
Ritor1
parents: 917
diff changeset
2463 if ( !gold_transaction_amount )
Ritor1
parents: 917
diff changeset
2464 goto LABEL_79;
Ritor1
parents: 917
diff changeset
2465 goto LABEL_42;
0
Ritor1
parents:
diff changeset
2466 case 22:
955
Ritor1
parents: 917
diff changeset
2467 v20 = pPlayers[uActiveCharacter]->GetBaseWillpower();
Ritor1
parents: 917
diff changeset
2468 if ( v20 < 50 )
Ritor1
parents: 917
diff changeset
2469 return v35;
Ritor1
parents: 917
diff changeset
2470 if ( !gold_transaction_amount )
Ritor1
parents: 917
diff changeset
2471 goto LABEL_79;
Ritor1
parents: 917
diff changeset
2472 goto LABEL_42;
0
Ritor1
parents:
diff changeset
2473 case 24:
267
ac44e716d051 DrawDialogueUI logic restored
Nomad
parents: 264
diff changeset
2474 gold_transaction_amount = 2500;
955
Ritor1
parents: 917
diff changeset
2475 v20 = pPlayers[uActiveCharacter]->GetBaseEndurance();
0
Ritor1
parents:
diff changeset
2476 if ( v20 < 50 )
Ritor1
parents:
diff changeset
2477 return v35;
955
Ritor1
parents: 917
diff changeset
2478 if ( !gold_transaction_amount )
Ritor1
parents: 917
diff changeset
2479 goto LABEL_79;
Ritor1
parents: 917
diff changeset
2480 goto LABEL_42;
Ritor1
parents: 917
diff changeset
2481 case 36:
Ritor1
parents: 917
diff changeset
2482 v20 = pPlayers[uActiveCharacter]->GetBaseIntelligence();
Ritor1
parents: 917
diff changeset
2483 if ( v20 < 50 )
Ritor1
parents: 917
diff changeset
2484 return v35;
Ritor1
parents: 917
diff changeset
2485 if ( !gold_transaction_amount )
Ritor1
parents: 917
diff changeset
2486 goto LABEL_79;
Ritor1
parents: 917
diff changeset
2487 goto LABEL_42;
0
Ritor1
parents:
diff changeset
2488 case 21:
Ritor1
parents:
diff changeset
2489 case 23:
Ritor1
parents:
diff changeset
2490 case 25:
Ritor1
parents:
diff changeset
2491 case 26:
Ritor1
parents:
diff changeset
2492 case 29:
Ritor1
parents:
diff changeset
2493 case 32:
Ritor1
parents:
diff changeset
2494 case 34:
Ritor1
parents:
diff changeset
2495 case 35:
267
ac44e716d051 DrawDialogueUI logic restored
Nomad
parents: 264
diff changeset
2496 gold_transaction_amount = 2500;
0
Ritor1
parents:
diff changeset
2497 goto LABEL_42;
Ritor1
parents:
diff changeset
2498 case 8:
Ritor1
parents:
diff changeset
2499 case 9:
Ritor1
parents:
diff changeset
2500 case 10:
Ritor1
parents:
diff changeset
2501 case 11:
267
ac44e716d051 DrawDialogueUI logic restored
Nomad
parents: 264
diff changeset
2502 gold_transaction_amount = 3000;
0
Ritor1
parents:
diff changeset
2503 goto LABEL_42;
Ritor1
parents:
diff changeset
2504 case 7:
955
Ritor1
parents: 917
diff changeset
2505 gold_transaction_amount = 0;
Ritor1
parents: 917
diff changeset
2506 if ( !gold_transaction_amount )
Ritor1
parents: 917
diff changeset
2507 goto LABEL_79;
Ritor1
parents: 917
diff changeset
2508 goto LABEL_42;
Ritor1
parents: 917
diff changeset
2509 default:
Ritor1
parents: 917
diff changeset
2510 if ( !gold_transaction_amount )
Ritor1
parents: 917
diff changeset
2511 goto LABEL_79;
Ritor1
parents: 917
diff changeset
2512 goto LABEL_42;
0
Ritor1
parents:
diff changeset
2513 }
955
Ritor1
parents: 917
diff changeset
2514 gold_transaction_amount = 0;
Ritor1
parents: 917
diff changeset
2515 if ( !gold_transaction_amount )
Ritor1
parents: 917
diff changeset
2516 goto LABEL_79;
Ritor1
parents: 917
diff changeset
2517 goto LABEL_42;
0
Ritor1
parents:
diff changeset
2518 }
Ritor1
parents:
diff changeset
2519 }
Ritor1
parents:
diff changeset
2520 else
Ritor1
parents:
diff changeset
2521 {
Ritor1
parents:
diff changeset
2522 if ( v34 != 4 )
Ritor1
parents:
diff changeset
2523 {
955
Ritor1
parents: 917
diff changeset
2524 if ( !gold_transaction_amount )
Ritor1
parents: 917
diff changeset
2525 goto LABEL_79;
Ritor1
parents: 917
diff changeset
2526 goto LABEL_42;
0
Ritor1
parents:
diff changeset
2527 }
Ritor1
parents:
diff changeset
2528 if ( (signed int)v16 >= 3 && v7 >= 10 )
Ritor1
parents:
diff changeset
2529 {
492
Gloval
parents: 487
diff changeset
2530 switch ( dword_F8B1AC_award_bit_number )
0
Ritor1
parents:
diff changeset
2531 {
Ritor1
parents:
diff changeset
2532 case 19:
1355
af2fc30d765f Player::CanAct, Player::CanSteal shortened a bit
Grumpy7
parents: 1354
diff changeset
2533 if ( pPlayers[uActiveCharacter]->ProfessionOrGuildFlagsCorrect(0x22u, 1) == 1 )
955
Ritor1
parents: 917
diff changeset
2534 {
Ritor1
parents: 917
diff changeset
2535 if ( !gold_transaction_amount )
Ritor1
parents: 917
diff changeset
2536 goto LABEL_79;
Ritor1
parents: 917
diff changeset
2537 goto LABEL_42;
Ritor1
parents: 917
diff changeset
2538 }
1355
af2fc30d765f Player::CanAct, Player::CanSteal shortened a bit
Grumpy7
parents: 1354
diff changeset
2539 if ( pPlayers[uActiveCharacter]->ProfessionOrGuildFlagsCorrect(0x1Au, 1) == 1 )
955
Ritor1
parents: 917
diff changeset
2540 {
Ritor1
parents: 917
diff changeset
2541 if ( !gold_transaction_amount )
Ritor1
parents: 917
diff changeset
2542 goto LABEL_79;
Ritor1
parents: 917
diff changeset
2543 goto LABEL_42;
Ritor1
parents: 917
diff changeset
2544 }
Ritor1
parents: 917
diff changeset
2545 return v35;
0
Ritor1
parents:
diff changeset
2546 case 20:
1355
af2fc30d765f Player::CanAct, Player::CanSteal shortened a bit
Grumpy7
parents: 1354
diff changeset
2547 if ( pPlayers[uActiveCharacter]->ProfessionOrGuildFlagsCorrect(0x23u, 1) == 1 )
955
Ritor1
parents: 917
diff changeset
2548 {
Ritor1
parents: 917
diff changeset
2549 if ( !gold_transaction_amount )
Ritor1
parents: 917
diff changeset
2550 goto LABEL_79;
Ritor1
parents: 917
diff changeset
2551 goto LABEL_42;
Ritor1
parents: 917
diff changeset
2552 }
1355
af2fc30d765f Player::CanAct, Player::CanSteal shortened a bit
Grumpy7
parents: 1354
diff changeset
2553 if ( pPlayers[uActiveCharacter]->ProfessionOrGuildFlagsCorrect(0x1Bu, 1) == 1 )
955
Ritor1
parents: 917
diff changeset
2554 {
Ritor1
parents: 917
diff changeset
2555 if ( !gold_transaction_amount )
Ritor1
parents: 917
diff changeset
2556 goto LABEL_79;
Ritor1
parents: 917
diff changeset
2557 goto LABEL_42;
Ritor1
parents: 917
diff changeset
2558 }
0
Ritor1
parents:
diff changeset
2559 return v35;
Ritor1
parents:
diff changeset
2560 case 30:
955
Ritor1
parents: 917
diff changeset
2561 v18 = LOBYTE(pPlayers[uActiveCharacter]->pActiveSkills[31]);
0
Ritor1
parents:
diff changeset
2562 if ( (v18 & 0x3Fu) < 0xA )
Ritor1
parents:
diff changeset
2563 return v35;
955
Ritor1
parents: 917
diff changeset
2564 if ( !gold_transaction_amount )
Ritor1
parents: 917
diff changeset
2565 goto LABEL_79;
Ritor1
parents: 917
diff changeset
2566 goto LABEL_42;
Ritor1
parents: 917
diff changeset
2567 case 31:
Ritor1
parents: 917
diff changeset
2568 v18 = LOBYTE(pPlayers[uActiveCharacter]->pActiveSkills[30]);
Ritor1
parents: 917
diff changeset
2569 if ( (v18 & 0x3Fu) < 0xA )
Ritor1
parents: 917
diff changeset
2570 return v35;
Ritor1
parents: 917
diff changeset
2571 if ( !gold_transaction_amount )
Ritor1
parents: 917
diff changeset
2572 goto LABEL_79;
Ritor1
parents: 917
diff changeset
2573 goto LABEL_42;
0
Ritor1
parents:
diff changeset
2574 case 21:
Ritor1
parents:
diff changeset
2575 case 23:
Ritor1
parents:
diff changeset
2576 case 24:
Ritor1
parents:
diff changeset
2577 case 25:
Ritor1
parents:
diff changeset
2578 case 26:
Ritor1
parents:
diff changeset
2579 case 29:
Ritor1
parents:
diff changeset
2580 case 32:
Ritor1
parents:
diff changeset
2581 case 34:
Ritor1
parents:
diff changeset
2582 case 35:
267
ac44e716d051 DrawDialogueUI logic restored
Nomad
parents: 264
diff changeset
2583 gold_transaction_amount = 6000;
0
Ritor1
parents:
diff changeset
2584 goto LABEL_42;
Ritor1
parents:
diff changeset
2585 case 8:
Ritor1
parents:
diff changeset
2586 case 9:
Ritor1
parents:
diff changeset
2587 case 10:
Ritor1
parents:
diff changeset
2588 case 11:
267
ac44e716d051 DrawDialogueUI logic restored
Nomad
parents: 264
diff changeset
2589 gold_transaction_amount = 7000;
0
Ritor1
parents:
diff changeset
2590 goto LABEL_42;
Ritor1
parents:
diff changeset
2591 case 7:
Ritor1
parents:
diff changeset
2592 break;
955
Ritor1
parents: 917
diff changeset
2593 default:
Ritor1
parents: 917
diff changeset
2594 if ( !gold_transaction_amount )
Ritor1
parents: 917
diff changeset
2595 goto LABEL_79;
Ritor1
parents: 917
diff changeset
2596 goto LABEL_42;
0
Ritor1
parents:
diff changeset
2597 }
267
ac44e716d051 DrawDialogueUI logic restored
Nomad
parents: 264
diff changeset
2598 gold_transaction_amount = 0;
955
Ritor1
parents: 917
diff changeset
2599 if ( !gold_transaction_amount )
Ritor1
parents: 917
diff changeset
2600 goto LABEL_79;
Ritor1
parents: 917
diff changeset
2601 goto LABEL_42;
0
Ritor1
parents:
diff changeset
2602 }
Ritor1
parents:
diff changeset
2603 }
Ritor1
parents:
diff changeset
2604 return v35;
Ritor1
parents:
diff changeset
2605 }
Ritor1
parents:
diff changeset
2606 if ( v7 < 4 )
Ritor1
parents:
diff changeset
2607 return v35;
492
Gloval
parents: 487
diff changeset
2608 if ( dword_F8B1AC_award_bit_number > 27 )
Gloval
parents: 487
diff changeset
2609 {
Gloval
parents: 487
diff changeset
2610 if ( dword_F8B1AC_award_bit_number != 29
Gloval
parents: 487
diff changeset
2611 && dword_F8B1AC_award_bit_number != 32
Gloval
parents: 487
diff changeset
2612 && (dword_F8B1AC_award_bit_number <= 33 || dword_F8B1AC_award_bit_number > 35) )
0
Ritor1
parents:
diff changeset
2613 {
267
ac44e716d051 DrawDialogueUI logic restored
Nomad
parents: 264
diff changeset
2614 if ( !gold_transaction_amount )
0
Ritor1
parents:
diff changeset
2615 goto LABEL_79;
Ritor1
parents:
diff changeset
2616 goto LABEL_42;
Ritor1
parents:
diff changeset
2617 }
267
ac44e716d051 DrawDialogueUI logic restored
Nomad
parents: 264
diff changeset
2618 gold_transaction_amount = 500;
955
Ritor1
parents: 917
diff changeset
2619 if ( !gold_transaction_amount )
Ritor1
parents: 917
diff changeset
2620 goto LABEL_79;
Ritor1
parents: 917
diff changeset
2621 goto LABEL_42;
0
Ritor1
parents:
diff changeset
2622 }
492
Gloval
parents: 487
diff changeset
2623 if ( dword_F8B1AC_award_bit_number >= 23 )
955
Ritor1
parents: 917
diff changeset
2624 {
Ritor1
parents: 917
diff changeset
2625 gold_transaction_amount = 500;
Ritor1
parents: 917
diff changeset
2626 if ( !gold_transaction_amount )
Ritor1
parents: 917
diff changeset
2627 goto LABEL_79;
Ritor1
parents: 917
diff changeset
2628 goto LABEL_42;
Ritor1
parents: 917
diff changeset
2629 }
492
Gloval
parents: 487
diff changeset
2630 if ( dword_F8B1AC_award_bit_number == 7 )
0
Ritor1
parents:
diff changeset
2631 {
267
ac44e716d051 DrawDialogueUI logic restored
Nomad
parents: 264
diff changeset
2632 gold_transaction_amount = 0;
0
Ritor1
parents:
diff changeset
2633 goto LABEL_79;
Ritor1
parents:
diff changeset
2634 }
492
Gloval
parents: 487
diff changeset
2635 if ( dword_F8B1AC_award_bit_number <= 7 )
955
Ritor1
parents: 917
diff changeset
2636 {
Ritor1
parents: 917
diff changeset
2637 if ( !gold_transaction_amount )
Ritor1
parents: 917
diff changeset
2638 goto LABEL_79;
Ritor1
parents: 917
diff changeset
2639 goto LABEL_42;
Ritor1
parents: 917
diff changeset
2640 }
492
Gloval
parents: 487
diff changeset
2641 if ( dword_F8B1AC_award_bit_number > 18 )
Gloval
parents: 487
diff changeset
2642 {
Gloval
parents: 487
diff changeset
2643 if ( dword_F8B1AC_award_bit_number != 21 )
955
Ritor1
parents: 917
diff changeset
2644 {
Ritor1
parents: 917
diff changeset
2645 if ( !gold_transaction_amount )
Ritor1
parents: 917
diff changeset
2646 goto LABEL_79;
Ritor1
parents: 917
diff changeset
2647 goto LABEL_42;
Ritor1
parents: 917
diff changeset
2648 }
Ritor1
parents: 917
diff changeset
2649 gold_transaction_amount = 500;
Ritor1
parents: 917
diff changeset
2650 if ( !gold_transaction_amount )
Ritor1
parents: 917
diff changeset
2651 goto LABEL_79;
Ritor1
parents: 917
diff changeset
2652 goto LABEL_42;
0
Ritor1
parents:
diff changeset
2653 }
267
ac44e716d051 DrawDialogueUI logic restored
Nomad
parents: 264
diff changeset
2654 gold_transaction_amount = 1000;
0
Ritor1
parents:
diff changeset
2655 LABEL_42:
267
ac44e716d051 DrawDialogueUI logic restored
Nomad
parents: 264
diff changeset
2656 if ( gold_transaction_amount > pParty->uNumGold )
0
Ritor1
parents:
diff changeset
2657 return (char *)pNPCTopics[124].pText;
Ritor1
parents:
diff changeset
2658 LABEL_79:
484
4bd56919f075 avard quest guild bits
Gloval
parents: 481
diff changeset
2659 contract_approved = 1;
0
Ritor1
parents:
diff changeset
2660 if ( v34 == 2 )
Ritor1
parents:
diff changeset
2661 {
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
2662 sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[534],//Ïîëó÷èòü ñòåïåíü ^Pr[%s] â íàâûêå ^Pr[%s] çà ^I[%lu] çîëîò^L[îé;ûõ;ûõ]
955
Ritor1
parents: 917
diff changeset
2663 pGlobalTXT_LocalizationStrings[433], pSkillNames[dword_F8B1AC_award_bit_number], gold_transaction_amount);//Ýêñïåðò
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
2664 return pTmpBuf2.data();
0
Ritor1
parents:
diff changeset
2665 }
Ritor1
parents:
diff changeset
2666 if ( v34 == 3 )
Ritor1
parents:
diff changeset
2667 {
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
2668 sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[534],
955
Ritor1
parents: 917
diff changeset
2669 pGlobalTXT_LocalizationStrings[432], pSkillNames[dword_F8B1AC_award_bit_number], gold_transaction_amount);//Ìàñòåð
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
2670 return pTmpBuf2.data();
0
Ritor1
parents:
diff changeset
2671 }
Ritor1
parents:
diff changeset
2672 if ( v34 == 4 )
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
2673 sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[534],
955
Ritor1
parents: 917
diff changeset
2674 pGlobalTXT_LocalizationStrings[225], pSkillNames[dword_F8B1AC_award_bit_number], gold_transaction_amount);//Âåëèêèé Ìàãèñòð
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
2675 return pTmpBuf2.data();
0
Ritor1
parents:
diff changeset
2676 }
Ritor1
parents:
diff changeset
2677
Ritor1
parents:
diff changeset
2678 //----- (004B3E1E) --------------------------------------------------------
1458
934074e7fcc1 ModalWindow
Nomad
parents: 1453
diff changeset
2679 void sub_4B3E1E()
0
Ritor1
parents:
diff changeset
2680 {
Ritor1
parents:
diff changeset
2681 NPCData *v0; // ST40_4@1
Ritor1
parents:
diff changeset
2682 signed int v1; // edi@1
165
Ritor1
parents: 152
diff changeset
2683 //GUIWindow *v2; // ecx@1
0
Ritor1
parents:
diff changeset
2684
167
90521fb9766c NPCDialogue fix
Ritor1
parents: 165
diff changeset
2685 __debugbreak();
602
628694cd5744 Margaret working
zipi
parents: 569
diff changeset
2686 v0 = GetNPCData(sDialogue_SpeakingActorNPC_ID);
0
Ritor1
parents:
diff changeset
2687 v1 = 0;
Ritor1
parents:
diff changeset
2688 pDialogueWindow->eWindowType = WINDOW_MainMenu;
Ritor1
parents:
diff changeset
2689 pDialogueWindow->Release();
165
Ritor1
parents: 152
diff changeset
2690 pDialogueWindow = GUIWindow::Create(0, 0, 640, 480, WINDOW_Dialogue, 1, 0);
291
0ea5fbd16edb NPC mostly done
Gloval
parents: 290
diff changeset
2691 if ( pNPCStats->pProfessions[v0->uProfession].pBenefits)//*(&pNPCStats->field_13A5C + 5 * v0->uProfession) )
0
Ritor1
parents:
diff changeset
2692 {
832
dfd683c4f538 Hotkeys fixed
Nomad
parents: 830
diff changeset
2693 pDialogueWindow->CreateButton(480, 160, 140, 28, 1, 0, UIMSG_SelectNPCDialogueOption, 77, 0, pGlobalTXT_LocalizationStrings[407], 0);
0
Ritor1
parents:
diff changeset
2694 v1 = 1;
Ritor1
parents:
diff changeset
2695 }
832
dfd683c4f538 Hotkeys fixed
Nomad
parents: 830
diff changeset
2696 pDialogueWindow->CreateButton(480, 30 * v1 + 160, 140, 30, 1, 0, UIMSG_SelectNPCDialogueOption, 76, 0, pGlobalTXT_LocalizationStrings[406], 0);//Íàíÿòü
972
c8a0f6d89c70 Some inqury on selecting Knight bug.
Nomad
parents: 964
diff changeset
2697 pDialogueWindow->_41D08F_set_keyboard_control_group(v1 + 1, 1, 0, 1);
0
Ritor1
parents:
diff changeset
2698 }
Ritor1
parents:
diff changeset
2699
Ritor1
parents:
diff changeset
2700
Ritor1
parents:
diff changeset
2701 //----- (004B3FE5) --------------------------------------------------------
1582
d3d539924e5e _4B3FE5_training_dialogue
Ritor1
parents: 1567
diff changeset
2702 void __fastcall _4B3FE5_training_dialogue(int a4)
0
Ritor1
parents:
diff changeset
2703 {
1838
211dfe2d8db1 changing global char* vars to const char* vars
Grumpy7
parents: 1828
diff changeset
2704 const char *v2; // edi@1
2102
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2705
1411
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1410
diff changeset
2706 __debugbreak();
0
Ritor1
parents:
diff changeset
2707 uDialogueType = 78;
827
085eb19b7ffd mr.Malvik
Ritor1
parents: 823
diff changeset
2708 current_npc_text = (char *)pNPCTopics[a4 + 168].pText;
0
Ritor1
parents:
diff changeset
2709 _4B254D_SkillMasteryTeacher(a4);
Ritor1
parents:
diff changeset
2710 pDialogueWindow->Release();
2102
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2711 pDialogueWindow = GUIWindow::Create(0, 0, 640, 350, WINDOW_MainMenu, a4, 0);
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2712 pBtn_ExitCancel = pDialogueWindow->CreateButton( 471, 445, 169, 35, 1, 0, UIMSG_Escape, 0, 0,
948
5a2dbb00c399 Code cleaning.
Nomad
parents: 940
diff changeset
2713 pGlobalTXT_LocalizationStrings[34], pIcons_LOD->GetTexture(uExitCancelTextureId), 0);
832
dfd683c4f538 Hotkeys fixed
Nomad
parents: 830
diff changeset
2714 pDialogueWindow->CreateButton(0, 0, 0, 0, 1, 0, UIMSG_BuyInShop_Identify_Repair, 0, 0, "", 0);
2102
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2715 v2 = "";
484
4bd56919f075 avard quest guild bits
Gloval
parents: 481
diff changeset
2716 if ( contract_approved )
0
Ritor1
parents:
diff changeset
2717 v2 = pGlobalTXT_LocalizationStrings[535];
832
dfd683c4f538 Hotkeys fixed
Nomad
parents: 830
diff changeset
2718 pDialogueWindow->CreateButton(0x1E0u, 0xA0u, 0x8Cu, 0x1Eu, 1, 0, UIMSG_ClickNPCTopic, 0x4Fu, 0, v2, 0);
972
c8a0f6d89c70 Some inqury on selecting Knight bug.
Nomad
parents: 964
diff changeset
2719 pDialogueWindow->_41D08F_set_keyboard_control_group(1, 1, 0, 2);
747
585490c29945 House dialogue ids appended
Nomad
parents: 746
diff changeset
2720 dialog_menu_id = HOUSE_DIALOGUE_OTHER;
0
Ritor1
parents:
diff changeset
2721 }
Ritor1
parents:
diff changeset
2722 // F8B19C: using guessed type int dword_F8B19C;
Ritor1
parents:
diff changeset
2723 // F8B1A8: using guessed type int dword_F8B1A8;
Ritor1
parents:
diff changeset
2724
Ritor1
parents:
diff changeset
2725 //----- (004B46A5) --------------------------------------------------------
1006
e865f349aa41 ui cleanup
Gloval
parents: 990
diff changeset
2726 void __fastcall DrawTextAtStatusBar( const char *Str, int a5 )
1411
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1410
diff changeset
2727 {
471
c43f156a95c9 ArmorShopDialog crash fixed. All shops show its items
Gloval
parents: 470
diff changeset
2728 pRenderer->DrawTextureRGB(0, 352, pTexture_StatusBar);
2102
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2729 pPrimaryWindow->DrawText(pFontLucida, pFontLucida->AlignText_Center(450, Str) + 11, 357, a5, Str, 0, 0, 0);
0
Ritor1
parents:
diff changeset
2730 }
Ritor1
parents:
diff changeset
2731
Ritor1
parents:
diff changeset
2732 //----- (004B46F8) --------------------------------------------------------
1459
2ca62c9e7b3c Function names
Nomad
parents: 1458
diff changeset
2733 __int64 GetExperienceRequiredForLevel(int level)
0
Ritor1
parents:
diff changeset
2734 {
1459
2ca62c9e7b3c Function names
Nomad
parents: 1458
diff changeset
2735 __int64 v1; // eax@1
0
Ritor1
parents:
diff changeset
2736 int i; // edx@1
Ritor1
parents:
diff changeset
2737
Ritor1
parents:
diff changeset
2738 v1 = 0;
1459
2ca62c9e7b3c Function names
Nomad
parents: 1458
diff changeset
2739 for ( i = 0; i < level; ++i )
0
Ritor1
parents:
diff changeset
2740 v1 += i + 1;
Ritor1
parents:
diff changeset
2741 return 1000 * v1;
Ritor1
parents:
diff changeset
2742 }
Ritor1
parents:
diff changeset
2743
Ritor1
parents:
diff changeset
2744 //----- (004BC49B) --------------------------------------------------------
651
2bf48d11d742 Training hall UI fixed
Nomad
parents: 648
diff changeset
2745 void OnSelectNPCDialogueOption(DIALOGUE_TYPE newDialogueType)
652
1ff57450f090 * Some fixes to TravelByTransport
Nomad
parents: 651
diff changeset
2746 {
2102
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2747 NPCData *speakingNPC; // ebp@1
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2748 int npc_event_id; // ecx@10
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2749 char *v13; // [sp-8h] [bp-18h]@60
656
6abf5b610585 OnSelectNPCDialogueOption clean
zipi
parents: 655
diff changeset
2750
2102
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2751 speakingNPC = GetNPCData(sDialogue_SpeakingActorNPC_ID);
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2752 uDialogueType = newDialogueType;
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2753 if (!speakingNPC->uFlags)
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2754 speakingNPC->uFlags = 1;
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2755 if(newDialogueType == DIALOGUE_PROFESSION_DETAILS)
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2756 dialogue_show_profession_details = ~dialogue_show_profession_details;
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2757 else if(newDialogueType == DIALOGUE_76)
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2758 {
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2759 if (speakingNPC->Hired())
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2760 {
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2761 if ( (signed int)pNPCStats->uNumNewNPCs > 0 )
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2762 {
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2763 for ( uint i = 0; i < (unsigned int)pNPCStats->uNumNewNPCs; ++i )
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2764 {
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2765 if ( pNPCStats->pNewNPCData[i].uFlags & 0x80 && !strcmp(speakingNPC->pName, pNPCStats->pNewNPCData[i].pName) )
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2766 pNPCStats->pNewNPCData[i].uFlags &= 0x7Fu;
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2767 }
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2768 }
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2769 if ( pParty->pHirelings[0].pName && !_stricmp(pParty->pHirelings[0].pName, speakingNPC->pName) )
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2770 memset(&pParty->pHirelings[0], 0, sizeof(NPCData));
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2771 else if ( pParty->pHirelings[1].pName && !_stricmp(pParty->pHirelings[1].pName, speakingNPC->pName) )
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2772 memset(&pParty->pHirelings[1], 0, sizeof(NPCData));
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2773 pParty->hirelingScrollPosition = 0;
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2774 pParty->CountHirelings();
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2775 dword_591084 = 0;
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2776 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2777 dword_7241C8 = 0;
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2778 return;
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2779 }
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2780 if ( pParty->pHirelings[0].pName && pParty->pHirelings[1].pName )
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2781 ShowStatusBarString(pGlobalTXT_LocalizationStrings[533], 2);// ""I cannot join you, you're party is full""
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2782 else
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2783 {
2115
90cc547a7927 Fixing hireling prices
Grumpy7
parents: 2103
diff changeset
2784 if ( speakingNPC->uProfession != 51 ) //burglars have no hiring price
2102
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2785 {
2115
90cc547a7927 Fixing hireling prices
Grumpy7
parents: 2103
diff changeset
2786 if ( pParty->uNumGold < pNPCStats->pProfessions[speakingNPC->uProfession].uHirePrice )
2102
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2787 {
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2788 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2);// "You don't have enough gold"
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2789 dialogue_show_profession_details = false;
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2790 uDialogueType = 13;
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2791 if ( uActiveCharacter )
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2792 pPlayers[uActiveCharacter]->PlaySound(SPEECH_NotEnoughGold, 0);
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2793 if ( !dword_7241C8 )
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2794 pGame->Draw();
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2795 dword_7241C8 = 0;
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2796 return;
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2797 }
2115
90cc547a7927 Fixing hireling prices
Grumpy7
parents: 2103
diff changeset
2798 Party::TakeGold(pNPCStats->pProfessions[speakingNPC->uProfession].uHirePrice);
2102
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2799 }
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2800 LOBYTE(speakingNPC->uFlags) |= 0x80u;
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2801 if ( pParty->pHirelings[0].pName )
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2802 {
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2803 memcpy(&pParty->pHirelings[1], speakingNPC, sizeof(pParty->pHirelings[1]));
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2804 v13 = pParty->pHireling2Name;
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2805 }
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2806 else
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2807 {
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2808 memcpy(&pParty->pHirelings[0], speakingNPC, sizeof(pParty->pHirelings[0]));
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2809 v13 = pParty->pHireling1Name;
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2810 }
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2811 strcpy(v13, speakingNPC->pName);
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2812 pParty->hirelingScrollPosition = 0;
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2813 pParty->CountHirelings();
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2814 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2815 if ( sDialogue_SpeakingActorNPC_ID >= 0 )
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2816 pDialogue_SpeakingActor->uAIState = Removed;
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2817 if ( uActiveCharacter )
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2818 pPlayers[uActiveCharacter]->PlaySound(SPEECH_61, 0);
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2819 }
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2820 }
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2821 else if ( (signed int)newDialogueType > DIALOGUE_84 && (signed int)newDialogueType <= DIALOGUE_ARENA_SELECT_CHAMPION ) //âûáîð óðîâíÿ ñëîæíîñòè áîÿ
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2822 {
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2823 ArenaFight();
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2824 return;
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2825 }
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2826 else if(newDialogueType == DIALOGUE_USE_NPC_ABILITY)
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2827 {
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2828 if (UseNPCSkill((NPCProf)speakingNPC->uProfession) == 0)
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2829 {
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2830 if ( speakingNPC->uProfession != GateMaster )
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2831 speakingNPC->bHasUsedTheAbility = 1;
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2832 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2833 }
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2834 else
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2835 ShowStatusBarString(pGlobalTXT_LocalizationStrings[140], 2); //"Your packs are already full!"
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2836 }
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2837 else if(newDialogueType == DIALOGUE_13)
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2838 {
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2839 if (!speakingNPC->Hired())
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2840 {
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2841 sub_4B3E1E();
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2842 dialogue_show_profession_details = false;
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2843 }
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2844 else
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2845 {
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2846 for ( uint i = 0; i < (signed int)pNPCStats->uNumNewNPCs; ++i )
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2847 {
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2848 if ( pNPCStats->pNewNPCData[i].uFlags & 0x80 && !strcmp(speakingNPC->pName, pNPCStats->pNewNPCData[i].pName) )
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2849 pNPCStats->pNewNPCData[i].uFlags &= 0x7Fu;
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2850 }
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2851 if ( pParty->pHirelings[0].pName && !_stricmp(pParty->pHirelings[0].pName, speakingNPC->pName) )
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2852 memset(&pParty->pHirelings[0], 0, sizeof(NPCData));
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2853 else if ( pParty->pHirelings[1].pName && !_stricmp(pParty->pHirelings[1].pName, speakingNPC->pName) )
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2854 memset(&pParty->pHirelings[1], 0, sizeof(NPCData));
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2855 pParty->hirelingScrollPosition = 0;
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2856 pParty->CountHirelings();
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2857 dword_591084 = 0;
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2858 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2859 dword_7241C8 = 0;
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2860 return;
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2861 }
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2862 }
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2863 else if(newDialogueType >= DIALOGUE_EVT_A && newDialogueType <= DIALOGUE_EVT_F)
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2864 {
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2865 switch(newDialogueType)
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2866 {
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2867 case DIALOGUE_EVT_A: npc_event_id = speakingNPC->evt_A; break;
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2868 case DIALOGUE_EVT_B: npc_event_id = speakingNPC->evt_B; break;
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2869 case DIALOGUE_EVT_C: npc_event_id = speakingNPC->evt_C; break;
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2870 case DIALOGUE_EVT_D: npc_event_id = speakingNPC->evt_D; break;
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2871 case DIALOGUE_EVT_E: npc_event_id = speakingNPC->evt_E; break;
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2872 case DIALOGUE_EVT_F: npc_event_id = speakingNPC->evt_F; break;
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2873 }
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2874 if ( (npc_event_id >= 200) && (npc_event_id <= 310) )
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2875 _4B3FE5_training_dialogue(npc_event_id); //200-310
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2876 else if (( npc_event_id >= 400) && (npc_event_id <= 410) )
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2877 { //400-410
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2878 dword_F8B1D8 = newDialogueType;
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2879 DrawJoinGuildWindow(npc_event_id - 400);
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2880 }
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2881 else
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2882 {
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2883 switch ( npc_event_id )
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2884 {
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2885 case 139:
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2886 OracleDialogue();
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2887 break;
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2888 case 311:
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2889 CheckBountyRespawnAndAward();
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2890 break;
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2891 case 399:
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2892 Arena_SelectionFightLevel();
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2893 break;
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2894 default:
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2895 activeLevelDecoration = (LevelDecoration*)1;
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2896 current_npc_text = 0;
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2897 EventProcessor(npc_event_id, 0, 1);
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2898 activeLevelDecoration = NULL;
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2899 break;
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2900 }
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2901 }
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2902 }
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2903 if ( !dword_7241C8 )
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2904 pGame->Draw();
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2086
diff changeset
2905 dword_7241C8 = 0;
656
6abf5b610585 OnSelectNPCDialogueOption clean
zipi
parents: 655
diff changeset
2906 }
0
Ritor1
parents:
diff changeset
2907
Ritor1
parents:
diff changeset
2908 //----- (004BDAAF) --------------------------------------------------------
2059
f9698295c0bd AttackerInfo, MerchandiseTest
Ritor1
parents: 2044
diff changeset
2909 bool MerchandiseTest(ItemGen *item, int _2da_idx)
0
Ritor1
parents:
diff changeset
2910 {
702
efde64b3e147 sub_4BDAAF clean
zipi
parents: 701
diff changeset
2911 bool test;
0
Ritor1
parents:
diff changeset
2912
907
f3ccfc765502 RentRoom
Ritor1
parents: 898
diff changeset
2913 if ( (p2DEvents[_2da_idx - 1].uType != 4 || (signed int)item->uItemID < 740 || (signed int)item->uItemID > 771)
1567
9f8b3e904e14 Player::ReceiveDamage, very small edits; prepended "Is" to item functions returning bool values (broken, indetified, stolen)
Grumpy7
parents: 1546
diff changeset
2914 && ((signed int)item->uItemID >= 600 || (signed int)item->uItemID >= 529 && (signed int)item->uItemID <= 599) || item->IsStolen())
2059
f9698295c0bd AttackerInfo, MerchandiseTest
Ritor1
parents: 2044
diff changeset
2915 return false;
907
f3ccfc765502 RentRoom
Ritor1
parents: 898
diff changeset
2916 switch( p2DEvents[_2da_idx - 1].uType )
f3ccfc765502 RentRoom
Ritor1
parents: 898
diff changeset
2917 {
1411
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1410
diff changeset
2918 case BuildingType_WeaponShop:
907
f3ccfc765502 RentRoom
Ritor1
parents: 898
diff changeset
2919 {
2059
f9698295c0bd AttackerInfo, MerchandiseTest
Ritor1
parents: 2044
diff changeset
2920 test = item->GetItemEquipType() <= EQUIP_BOW;
907
f3ccfc765502 RentRoom
Ritor1
parents: 898
diff changeset
2921 break;
f3ccfc765502 RentRoom
Ritor1
parents: 898
diff changeset
2922 }
1411
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1410
diff changeset
2923 case BuildingType_ArmorShop:
907
f3ccfc765502 RentRoom
Ritor1
parents: 898
diff changeset
2924 {
2059
f9698295c0bd AttackerInfo, MerchandiseTest
Ritor1
parents: 2044
diff changeset
2925 test = item->GetItemEquipType() >= EQUIP_ARMOUR && item->GetItemEquipType() <= EQUIP_BOOTS;
907
f3ccfc765502 RentRoom
Ritor1
parents: 898
diff changeset
2926 break;
f3ccfc765502 RentRoom
Ritor1
parents: 898
diff changeset
2927 }
1411
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1410
diff changeset
2928 case BuildingType_MagicShop:
907
f3ccfc765502 RentRoom
Ritor1
parents: 898
diff changeset
2929 {
2059
f9698295c0bd AttackerInfo, MerchandiseTest
Ritor1
parents: 2044
diff changeset
2930 test = item->GetPlayerSkillType() == PLAYER_SKILL_MISC || item->GetItemEquipType() == EQIUP_ANY;
907
f3ccfc765502 RentRoom
Ritor1
parents: 898
diff changeset
2931 break;
f3ccfc765502 RentRoom
Ritor1
parents: 898
diff changeset
2932 }
1411
2423bc2af692 +InitializaDialogueOptions
Nomad
parents: 1410
diff changeset
2933 case BuildingType_AlchemistShop:
907
f3ccfc765502 RentRoom
Ritor1
parents: 898
diff changeset
2934 {
2059
f9698295c0bd AttackerInfo, MerchandiseTest
Ritor1
parents: 2044
diff changeset
2935 test = item->GetItemEquipType() == EQUIP_REAGENT || item->GetItemEquipType() == EQUIP_POTION
f9698295c0bd AttackerInfo, MerchandiseTest
Ritor1
parents: 2044
diff changeset
2936 || (item->GetItemEquipType() > EQUIP_POTION && !(item->GetItemEquipType() != EQUIP_MESSAGE_SCROLL
907
f3ccfc765502 RentRoom
Ritor1
parents: 898
diff changeset
2937 || (signed int)item->uItemID < 740) && item->uItemID != 771);
f3ccfc765502 RentRoom
Ritor1
parents: 898
diff changeset
2938 break;
f3ccfc765502 RentRoom
Ritor1
parents: 898
diff changeset
2939 }
f3ccfc765502 RentRoom
Ritor1
parents: 898
diff changeset
2940 default:
f3ccfc765502 RentRoom
Ritor1
parents: 898
diff changeset
2941 {
f3ccfc765502 RentRoom
Ritor1
parents: 898
diff changeset
2942 test = false;
f3ccfc765502 RentRoom
Ritor1
parents: 898
diff changeset
2943 break;
f3ccfc765502 RentRoom
Ritor1
parents: 898
diff changeset
2944 }
f3ccfc765502 RentRoom
Ritor1
parents: 898
diff changeset
2945 }
702
efde64b3e147 sub_4BDAAF clean
zipi
parents: 701
diff changeset
2946 return test;
2059
f9698295c0bd AttackerInfo, MerchandiseTest
Ritor1
parents: 2044
diff changeset
2947 }