Mercurial > mm7
annotate mm7_4.cpp @ 2251:47bcb700b74b
for StackLight_TerrainFace
author | Ritor1 |
---|---|
date | Wed, 26 Feb 2014 20:10:43 +0600 |
parents | 8817c398b792 |
children | 529bf95fb0d7 |
rev | line source |
---|---|
2152 | 1 #include "mm7_data.h" |
2 #include "mm7_unsorted_subs.h" | |
1262 | 3 #include "Texture.h" |
1016 | 4 #include "VideoPlayer.h" |
5 #include "Sprites.h" | |
6 #include "BSPModel.h" | |
7 #include "Mouse.h" | |
8 #include "stru6.h" | |
9 | |
10 #include "LightmapBuilder.h" | |
341 | 11 #include "MM7.h" |
0 | 12 #include "MapInfo.h" |
13 #include "Game.h" | |
14 #include "GUIWindow.h" | |
15 #include "GUIFont.h" | |
16 #include "Party.h" | |
17 #include "AudioPlayer.h" | |
18 #include "Outdoor.h" | |
1277 | 19 #include "Outdoor_stuff.h" |
0 | 20 #include "LOD.h" |
21 #include "Actor.h" | |
22 #include "Events.h" | |
23 #include "Viewport.h" | |
24 #include "FrameTableInc.h" | |
2037
7a9477135943
Renamed Math.h -> OurMath.h (file resolution was sometimes ambiguous)
Nomad
parents:
2030
diff
changeset
|
25 #include "OurMath.h" |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
510
diff
changeset
|
26 #include "SpriteObject.h" |
0 | 27 #include "ObjectList.h" |
28 #include "DecorationList.h" | |
2044 | 29 #include "Timer.h" |
0 | 30 #include "IconFrameTable.h" |
31 #include "PlayerFrameTable.h" | |
32 #include "Awards.h" | |
33 #include "TurnEngine.h" | |
34 #include "Events2D.h" | |
35 #include "stru159.h" | |
189 | 36 #include "texts.h" |
0 | 37 #include "Log.h" |
1299 | 38 #include "UI\UIHouses.h" |
1262 | 39 #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
|
40 #include "Level/Decoration.h" |
0 | 41 |
42 //----- (0046CC4B) -------------------------------------------------------- | |
1459 | 43 void check_event_triggers() |
0 | 44 { |
1513 | 45 for (size_t i = 0; i < num_event_triggers; i++) |
0 | 46 { |
2117 | 47 if (pLevelDecorations[event_triggers[i]].uFlags & LEVEL_DECORATION_TRIGGERED_BY_TOUCH |
48 && pLevelDecorations[event_triggers[i]].vPosition.GetDistanceTo(pParty->vPosition) < pLevelDecorations[event_triggers[i]].uTriggerRange) | |
0 | 49 { |
2117 | 50 EventProcessor(pLevelDecorations[event_triggers[i]].uEventID, PID(OBJECT_Decoration,i), 1); |
0 | 51 } |
2117 | 52 else if (pLevelDecorations[event_triggers[i]].uFlags & LEVEL_DECORATION_TRIGGERED_BY_MONSTER) |
0 | 53 { |
1513 | 54 for (size_t j = 0; j < uNumActors; j++) |
0 | 55 { |
2117 | 56 if (pLevelDecorations[event_triggers[i]].vPosition.GetDistanceTo(pActors[j].vPosition) < pLevelDecorations[event_triggers[i]].uTriggerRange) |
57 EventProcessor(pLevelDecorations[event_triggers[i]].uEventID, 0, 1); | |
0 | 58 } |
59 } | |
2117 | 60 else if (pLevelDecorations[event_triggers[i]].uFlags & LEVEL_DECORATION_TRIGGERED_BY_OBJECT) |
0 | 61 { |
1513 | 62 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
|
63 { |
2117 | 64 if (pLevelDecorations[event_triggers[i]].vPosition.GetDistanceTo(pSpriteObjects[j].vPosition) < pLevelDecorations[event_triggers[i]].uTriggerRange) |
65 EventProcessor(pLevelDecorations[event_triggers[i]].uEventID, 0, 1); | |
0 | 66 } |
67 } | |
68 } | |
69 } | |
70 // 6836C8: using guessed type int 6836C8_num_decorations_6807E8; | |
71 | |
72 //----- (0046DEF2) -------------------------------------------------------- | |
73 unsigned int __fastcall sub_46DEF2(signed int a2, unsigned int uLayingItemID) | |
74 { | |
75 unsigned int result; // eax@1 | |
76 | |
77 result = uLayingItemID; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
510
diff
changeset
|
78 if ( pObjectList->pObjects[pSpriteObjects[uLayingItemID].uObjectDescID].uFlags & 0x10 ) |
0 | 79 result = _46BFFA_check_object_intercept(uLayingItemID, a2); |
80 return result; | |
81 } | |
82 | |
83 //----- (0046E0B2) -------------------------------------------------------- | |
1458 | 84 void _46E0B2_collide_against_decorations() |
0 | 85 { |
2117 | 86 BLVSector *sector; // ebp@1 |
87 LevelDecoration *decor; // edi@2 | |
88 DecorationDesc *decor_desc; // esi@3 | |
0 | 89 int v8; // ebx@10 |
90 int v9; // esi@11 | |
91 int v11; // eax@12 | |
92 int v12; // esi@14 | |
93 unsigned int v13; // eax@17 | |
94 signed int i; // [sp+4h] [bp-14h]@1 | |
95 int v15; // [sp+8h] [bp-10h]@10 | |
96 int v16; // [sp+Ch] [bp-Ch]@10 | |
97 int v17; // [sp+10h] [bp-8h]@10 | |
98 | |
2117 | 99 sector = &pIndoor->pSectors[stru_721530.uSectorID]; |
100 for ( i = 0; i < sector->uNumDecorations; ++i ) | |
0 | 101 { |
2117 | 102 decor = &pLevelDecorations[sector->pDecorationIDs[i]]; |
103 if (!(decor->uFlags & LEVEL_DECORATION_INVISIBLE)) | |
0 | 104 { |
2117 | 105 decor_desc = &pDecorationList->pDecorations[decor->uDecorationDescID]; |
106 if (!decor_desc->CanMoveThrough()) | |
0 | 107 { |
2117 | 108 if ( stru_721530.sMaxX <= decor->vPosition.x + decor_desc->uRadius && stru_721530.sMinX >= decor->vPosition.x - decor_desc->uRadius |
109 && stru_721530.sMaxY <= decor->vPosition.y + decor_desc->uRadius && stru_721530.sMinY >= decor->vPosition.y - decor_desc->uRadius | |
110 && stru_721530.sMaxZ <= decor->vPosition.z + decor_desc->uDecorationHeight && stru_721530.sMinZ >= decor->vPosition.z ) | |
0 | 111 { |
2117 | 112 v16 = decor->vPosition.x - stru_721530.normal.x; |
113 v15 = decor->vPosition.y - stru_721530.normal.y; | |
114 v8 = stru_721530.prolly_normal_d + decor_desc->uRadius; | |
115 v17 = ((decor->vPosition.x - stru_721530.normal.x) * stru_721530.direction.y | |
116 - (decor->vPosition.y - stru_721530.normal.y) * stru_721530.direction.x) >> 16; | |
117 if ( abs(v17) <= stru_721530.prolly_normal_d + decor_desc->uRadius ) | |
0 | 118 { |
2117 | 119 v9 = (v16 * stru_721530.direction.x + v15 * stru_721530.direction.y) >> 16; |
120 if ( v9 > 0 ) | |
0 | 121 { |
2117 | 122 v11 = stru_721530.normal.z + fixpoint_mul(stru_721530.direction.z, v9); |
123 if ( v11 >= decor->vPosition.z ) | |
0 | 124 { |
2117 | 125 if ( v11 <= decor_desc->uDecorationHeight + decor->vPosition.z ) |
0 | 126 { |
2117 | 127 v12 = v9 - integer_sqrt(v8 * v8 - v17 * v17); |
128 if ( v12 < 0 ) | |
129 v12 = 0; | |
130 if ( v12 < stru_721530.field_7C ) | |
0 | 131 { |
2117 | 132 stru_721530.field_7C = v12; |
133 v13 = 8 * sector->pDecorationIDs[i]; | |
134 LOBYTE(v13) = v13 | 5; | |
135 stru_721530.uFaceID = v13; | |
0 | 136 } |
137 } | |
138 } | |
139 } | |
140 } | |
141 } | |
142 } | |
143 } | |
144 } | |
145 } | |
146 | |
147 //----- (00487DA9) -------------------------------------------------------- | |
1583 | 148 void sub_487DA9() |
0 | 149 { |
1413 | 150 for (int i = 0; i < 20000; ++i) |
151 array_77EC08[i].field_108 = 0; | |
0 | 152 } |
153 | |
154 //----- (0048A959) -------------------------------------------------------- | |
2006 | 155 signed int ReplaceHSV(unsigned int uColor, float h_replace, float s_replace, float v_replace) |
0 | 156 { |
157 float r = ((uColor & 0x00FF0000) >> 16) / 255.0f, | |
158 g = ((uColor & 0x0000FF00) >> 8) / 255.0f, | |
159 b = (uColor & 0x000000FF) / 255.0f; | |
160 | |
161 float h, s, v; | |
162 RGB2HSV(&h, &s, r, g, b, &v); | |
163 | |
164 if ( h_replace != -1.0 ) | |
165 h = h_replace; | |
166 if ( s_replace != -1.0 ) | |
167 s = s_replace; | |
168 if ( v_replace != -1.0 ) | |
169 v = v_replace; | |
170 HSV2RGB(&r, &g, &b, h, s, v); | |
171 | |
2125 | 172 return (((uint)round_to_int(r * 255.0f) & 0xFF) << 16) | |
173 (((uint)round_to_int(g * 255.0f) & 0xFF) << 8) | | |
174 (((uint)round_to_int(b * 255.0f) & 0xFF)); | |
0 | 175 } |
176 | |
177 //----- (0048B561) -------------------------------------------------------- | |
1029 | 178 int fixpoint_from_float(float val) |
0 | 179 { |
1029 | 180 // float X.Yf -> int XXXX YYYY |
181 int left = floorf((val - 0.5f) + 0.5f); | |
182 int right = floorf((val - left) * 65536.0f); | |
183 return (left << 16) | right; | |
0 | 184 } |
185 | |
1640
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
186 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
|
187 { |
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
188 return (lhv << 16) | rhv; |
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
189 } |
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
190 |
0 | 191 //----- (00491E3A) -------------------------------------------------------- |
1459 | 192 void sub_491E3A() |
0 | 193 { |
194 signed int v1; // esi@3 | |
195 unsigned int v3; // eax@7 | |
196 unsigned int v4; // edx@8 | |
197 int v6; // edi@17 | |
198 int v12; // eax@26 | |
199 | |
2163 | 200 //__debugbreak();//Ritor1 |
2117 | 201 for ( uint pl = 0; pl < 4; pl++ ) |
0 | 202 { |
203 | 203 if (SoundSetAction[24][0]) |
0 | 204 { |
2117 | 205 v3 = 0; |
206 for ( v1 = 0; v1 < (signed int)pSoundList->sNumSounds; ++v1 ) | |
0 | 207 { |
2163 | 208 int ps = 2 * (SoundSetAction[24][0] + 50 * pParty->pPlayers[pl].uVoiceID) + 4998;//6728 |
2117 | 209 if ( pSoundList->pSL_Sounds[v1].uSoundID == 2 * (SoundSetAction[24][0] + 50 * pParty->pPlayers[pl].uVoiceID) + 4998 ) |
210 v3 = v1; | |
0 | 211 } |
764 | 212 pSoundList->UnloadSound(v3, 1); |
2117 | 213 for ( v4 = 0; (signed int)v4 < (signed int)pSoundList->sNumSounds; ++v4 ) |
0 | 214 { |
2117 | 215 if ( pSoundList->pSL_Sounds[v4].uSoundID == 2 * (SoundSetAction[24][0] + 50 * pParty->pPlayers[pl].uVoiceID) + 4999 ) |
216 pSoundList->UnloadSound(v4, 1); | |
0 | 217 } |
218 } | |
219 } | |
220 v6 = pIcons_LOD->uNumLoadedFiles - 1; | |
33 | 221 if ( v6 >= pIcons_LOD->pFacesLock ) |
0 | 222 { |
223 do | |
224 { | |
2117 | 225 pIcons_LOD->pTextures[v6].Release(); |
226 if ( pIcons_LOD->pHardwareTextures ) | |
0 | 227 { |
2117 | 228 if ( pIcons_LOD->pHardwareTextures[v6] ) |
0 | 229 { |
2117 | 230 pIcons_LOD->pHardwareTextures[v6]->Release(); |
0 | 231 pIcons_LOD->pHardwareTextures[v6] = 0; |
232 } | |
233 } | |
2117 | 234 if ( pIcons_LOD->pHardwareSurfaces ) |
0 | 235 { |
2117 | 236 if ( pIcons_LOD->pHardwareSurfaces[v6] ) |
0 | 237 { |
2117 | 238 pIcons_LOD->pHardwareSurfaces[v6]->Release(); |
0 | 239 pIcons_LOD->pHardwareSurfaces[v6] = 0; |
240 } | |
241 } | |
242 --v6; | |
243 } | |
33 | 244 while ( v6 >= pIcons_LOD->pFacesLock ); |
245 } | |
246 v12 = pIcons_LOD->pFacesLock; | |
247 pIcons_LOD->pFacesLock = 0; | |
0 | 248 pIcons_LOD->uNumLoadedFiles = v12; |
249 } | |
250 // 4ED498: using guessed type char byte_4ED498; | |
251 | |
252 //----- (00493938) -------------------------------------------------------- | |
2155 | 253 void _493938_regenerate() |
0 | 254 { |
2060 | 255 int current_time; // edi@1 |
256 int last_reg_time; // qax@1 | |
0 | 257 int v4; // eax@2 |
258 int v5; // edi@5 | |
2030 | 259 bool cursed_flag; // ecx@5 |
0 | 260 char v7; // sf@5 |
112 | 261 int *v8; // ecx@10 |
0 | 262 int v9; // edi@15 |
263 signed int v10; // eax@15 | |
264 __int16 *v11; // edx@16 | |
265 int v12; // eax@20 | |
266 int v13; // ebx@20 | |
267 unsigned int *v14; // esi@21 | |
268 unsigned int v15; // ecx@21 | |
269 unsigned int v16; // eax@21 | |
270 int v18; // eax@21 | |
271 signed int v19; // eax@21 | |
2060 | 272 bool recovery_HP; // ebx@25 |
0 | 273 ITEM_EQUIP_TYPE v22; // edi@30 |
274 signed int v25; // eax@33 | |
275 int v26; // eax@35 | |
276 int v27; // eax@36 | |
277 int v28; // eax@37 | |
278 signed int v31; // ecx@53 | |
2155 | 279 int v41[100]; // [sp+4h] [bp-22Ch]@20 |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
510
diff
changeset
|
280 SpriteObject a1; // [sp+194h] [bp-9Ch]@15 |
0 | 281 Vec3_int_ a3; // [sp+204h] [bp-2Ch]@15 |
2060 | 282 bool has_dragon_flag; // [sp+210h] [bp-20h]@22 |
283 bool lich_jar_flag; // [sp+214h] [bp-1Ch]@25 | |
284 bool zombie_flag; // [sp+218h] [bp-18h]@25 | |
285 bool decrease_HP; // [sp+21Ch] [bp-14h]@25 | |
286 bool lich_flag; // [sp+220h] [bp-10h]@25 | |
0 | 287 int v49; // [sp+224h] [bp-Ch]@24 |
2060 | 288 bool recovery_SP; // [sp+228h] [bp-8h]@25 |
289 bool redraw_flag; // [sp+22Ch] [bp-4h]@2 | |
0 | 290 |
2060 | 291 current_time = (signed int)(signed __int64)((double)(signed __int64)pParty->uTimePlayed * 0.234375) / 60; |
292 last_reg_time = (signed int)(signed __int64)((double)pParty->uLastRegenerationTime * 0.234375) / 60; | |
293 if ( current_time >= (signed int)last_reg_time + 5 ) | |
0 | 294 { |
2060 | 295 redraw_flag = false; |
296 v4 = (current_time - last_reg_time) / 5; | |
0 | 297 if (pParty->FlyActive()) |
298 { | |
299 if ( pParty->bFlying ) | |
300 { | |
569 | 301 if ( !(pParty->pPartyBuffs[PARTY_BUFF_FLY].uFlags & 1) ) |
2030 | 302 { |
569 | 303 v5 = v4 * pParty->pPartyBuffs[PARTY_BUFF_FLY].uPower; |
2060 | 304 cursed_flag = pParty->pPlayers[pParty->pPartyBuffs[PARTY_BUFF_FLY].uCaster - 1].pConditions[Condition_Cursed];//cursed |
2030 | 305 v7 = cursed_flag < v5; |
306 //cursed_flag -= v5; | |
307 if ( !v7 ) | |
0 | 308 { |
309 pParty->uFlags &= 0xFFFFFFBFu; | |
2030 | 310 pParty->bFlying = false; |
2060 | 311 redraw_flag = true; |
0 | 312 } |
313 } | |
314 } | |
315 } | |
569 | 316 |
0 | 317 if (pParty->WaterWalkActive()) |
318 { | |
569 | 319 if (pParty->uFlags & PARTY_FLAGS_1_STANDING_ON_WATER ) |
320 { | |
321 if ( !(pParty->pPartyBuffs[PARTY_BUFF_WATER_WALK].uFlags & 1) ) | |
322 { // taking on water | |
2184 | 323 v8 = (int *)&pParty->pPlayers[pParty->pPartyBuffs[PARTY_BUFF_WATER_WALK].uCaster - 1].pConditions[Condition_Cursed];//&AA1058_PartyQuickSpellSound[4].pSounds[6972 * pParty->pPartyBuffs[PARTY_BUFF_WATER_WALK].uCaster + 2000]; |
112 | 324 v7 = *v8 < v4; |
325 *v8 -= v4; | |
0 | 326 if ( v7 ) |
327 { | |
112 | 328 *v8 = 0; |
569 | 329 pParty->uFlags &= ~PARTY_FLAGS_1_STANDING_ON_WATER; |
2060 | 330 redraw_flag = true; |
0 | 331 } |
332 } | |
333 } | |
334 } | |
569 | 335 |
2060 | 336 if (pParty->ImmolationActive())//Æåðòâà |
0 | 337 { |
338 a3.z = 0; | |
339 a3.y = 0; | |
340 a3.x = 0; | |
341 a1.stru_24.Reset(); | |
822 | 342 a1.spell_level = pParty->pPartyBuffs[PARTY_BUFF_IMMOLATION].uPower; |
343 a1.spell_skill = pParty->ImmolationSkillLevel(); | |
0 | 344 v10 = 0; |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
510
diff
changeset
|
345 a1.uType = 1070; |
822 | 346 a1.spell_id = SPELL_FIRE_IMMOLATION; |
0 | 347 if ( (signed int)pObjectList->uNumObjects <= 0 ) |
348 { | |
349 LABEL_19: | |
350 LOWORD(v10) = 0; | |
351 } | |
352 else | |
353 { | |
354 v11 = &pObjectList->pObjects->uObjectID; | |
924 | 355 while ( stru_4E3ACC[8].uType != *v11 ) |
0 | 356 { |
357 ++v10; | |
358 v11 += 28; | |
359 if ( v10 >= (signed int)pObjectList->uNumObjects ) | |
360 goto LABEL_19; | |
361 } | |
362 } | |
363 a1.uObjectDescID = v10; | |
364 a1.field_60_distance_related_prolly_lod = 0; | |
1167 | 365 v12 = 8 * pParty->pPartyBuffs[PARTY_BUFF_IMMOLATION].uCaster; |
303 | 366 LOBYTE(v12) = v12 | OBJECT_Player; |
0 | 367 a1.uAttributes = 0; |
368 a1.uSectorID = 0; | |
369 a1.uSpriteFrameID = 0; | |
822 | 370 a1.spell_caster_pid = v12; |
0 | 371 a1.uFacing = 0; |
372 a1.uSoundID = 0; | |
1459 | 373 v13 = _46A89E_immolation_effect((int)v41, 100, 307); |
2060 | 374 for ( v9 = 0; v9 < v13; ++v9 ) |
0 | 375 { |
2155 | 376 v14 = (unsigned int *)&v41[v9]; |
2060 | 377 v15 = *v14; |
378 v16 = *v14; | |
379 a1.vPosition.x = pActors[v16].vPosition.x; | |
380 a1.vPosition.y = pActors[v16].vPosition.y; | |
381 a1.vPosition.z = pActors[v16].vPosition.z; | |
382 v18 = 8 * v15; | |
383 LOBYTE(v18) = PID(OBJECT_Actor,v15); | |
384 a1.spell_target_pid = v18; | |
385 v19 = a1.Create(0, 0, 0, 0); | |
386 DamageMonsterFromParty(PID(OBJECT_Item,v19), *v14, &a3); | |
0 | 387 } |
388 } | |
2060 | 389 |
390 has_dragon_flag = false; | |
248 | 391 if (PartyHasDragon()) |
2060 | 392 has_dragon_flag = true; |
393 | |
394 for ( v49 = 0; v49 < 4; v49++ ) | |
0 | 395 { |
2060 | 396 recovery_HP = false; |
397 recovery_SP = false; | |
398 decrease_HP = false; | |
399 lich_flag = false; | |
400 lich_jar_flag = false; | |
401 zombie_flag = false; | |
402 | |
403 for ( int v22 = 0; (signed int)v22 < 16; v22++ ) | |
0 | 404 { |
2060 | 405 if ( pParty->pPlayers[v49].HasItemEquipped((ITEM_EQUIP_TYPE)v22) ) |
0 | 406 { |
2060 | 407 uint _idx = pParty->pPlayers[v49].pEquipment.pIndices[v22]; |
408 if ( pParty->pPlayers[v49].pInventoryItemList[_idx - 1].uItemID > 134 ) | |
2030 | 409 { |
2060 | 410 if ( pParty->pPlayers[v49].pInventoryItemList[_idx - 1].uItemID == ITEM_RELIC_ETHRICS_STAFF ) |
411 decrease_HP = true; | |
412 if ( pParty->pPlayers[v49].pInventoryItemList[_idx - 1].uItemID == ITEM_ARTIFACT_HERMES_SANDALS ) | |
413 { | |
414 recovery_HP = true; | |
415 recovery_SP = true; | |
416 } | |
417 if ( pParty->pPlayers[v49].pInventoryItemList[_idx - 1].uItemID == ITEM_ARTIFACT_MINDS_EYE ) | |
418 recovery_SP = true; | |
419 if ( pParty->pPlayers[v49].pInventoryItemList[_idx - 1].uItemID == ITEM_ARTIFACT_HEROS_BELT ) | |
420 recovery_HP = true; | |
0 | 421 } |
422 else | |
423 { | |
2060 | 424 v25 = pParty->pPlayers[v49].pInventoryItemList[_idx - 1].uSpecEnchantmentType; |
425 if ( v25 == 37 //of Regeneration("Regenerate 1hp/x while walking, etc") | |
2155 | 426 || v25 == 44 //of Life("HP (+10), Regen hpts") |
427 || v25 == 50 //of The Phoenix("Fire Res (+30), Regen hpts") && | |
428 || v25 == 54 )// of The Troll("End (+15), Regen hpts") | |
2060 | 429 recovery_HP = true; |
430 if ( v25 == 38 //of Mana("Regenerate 1sp/x while walking, etc") | |
2155 | 431 || v25 == 47 //of The Eclipse("SP (+10), Regen spts") |
432 || v25 == 55 )//of The Unicorn("Luck (+15), Regen spts") | |
2060 | 433 recovery_SP = true; |
434 if ( v25 == 66 )// of Plenty("Regenerate 1 hp/x and 1 sp/x while walking, etc.") | |
2030 | 435 { |
2060 | 436 recovery_HP = true; |
437 recovery_SP = true; | |
2030 | 438 } |
0 | 439 } |
2060 | 440 |
2155 | 441 if (recovery_HP && |
442 !pParty->pPlayers[v49].pConditions[Condition_Dead] && | |
443 !pParty->pPlayers[v49].pConditions[Condition_Eradicated]) | |
2060 | 444 { |
2155 | 445 if ( pParty->pPlayers[v49].sHealth < pParty->pPlayers[v49].GetMaxHealth() ) |
446 ++pParty->pPlayers[v49].sHealth; | |
2060 | 447 if ( pParty->pPlayers[v49].pConditions[Condition_Unconcious] && pParty->pPlayers[v49].sHealth > 0 ) |
448 pParty->pPlayers[v49].pConditions[Condition_Unconcious] = 0; | |
449 redraw_flag = true; | |
450 } | |
451 | |
2155 | 452 if (recovery_SP && |
453 !pParty->pPlayers[v49].pConditions[Condition_Dead] && | |
454 !pParty->pPlayers[v49].pConditions[Condition_Eradicated]) | |
0 | 455 { |
2155 | 456 if ( pParty->pPlayers[v49].sMana < pParty->pPlayers[v49].GetMaxMana() ) |
457 ++pParty->pPlayers[v49].sMana; | |
2060 | 458 redraw_flag = true; |
459 } | |
460 | |
2155 | 461 if (decrease_HP && |
462 !pParty->pPlayers[v49].pConditions[Condition_Dead] && | |
463 !pParty->pPlayers[v49].pConditions[Condition_Eradicated] ) | |
2060 | 464 { |
465 --pParty->pPlayers[v49].sHealth; | |
466 if ( !(pParty->pPlayers[v49].pConditions[Condition_Unconcious]) && pParty->pPlayers[v49].sHealth < 0 ) | |
467 pParty->pPlayers[v49].pConditions[Condition_Unconcious] = pParty->uTimePlayed; | |
468 if ( pParty->pPlayers[v49].sHealth < 1 ) | |
0 | 469 { |
2060 | 470 if ( pParty->pPlayers[v49].sHealth + pParty->pPlayers[v49].uEndurance + pParty->pPlayers[v49].GetItemsBonus(CHARACTER_ATTRIBUTE_ENDURANCE) >= 1 |
471 || (signed __int64)pParty->pPlayers[v49].pPlayerBuffs[PLAYER_BUFF_PRESERVATION].uExpireTime > 0 ) | |
472 pParty->pPlayers[v49].pConditions[Condition_Unconcious] = pParty->uTimePlayed; | |
473 else | |
0 | 474 { |
2060 | 475 if ( !pParty->pPlayers[v49].pConditions[Condition_Dead] ) |
476 pParty->pPlayers[v49].pConditions[Condition_Dead] = pParty->uTimePlayed; | |
0 | 477 } |
478 } | |
2060 | 479 redraw_flag = true; |
0 | 480 } |
481 } | |
482 } | |
2060 | 483 |
484 //regeneration | |
485 if ( pParty->pPlayers[v49].pPlayerBuffs[PLAYER_BUFF_REGENERATION].uExpireTime > 0 | |
486 && !pParty->pPlayers[v49].pConditions[Condition_Dead] | |
487 && !pParty->pPlayers[v49].pConditions[Condition_Eradicated] ) | |
0 | 488 { |
2060 | 489 pParty->pPlayers[v49].sHealth += 5 * pParty->pPlayers[v49].pPlayerBuffs[PLAYER_BUFF_REGENERATION].uPower; |
490 if ( pParty->pPlayers[v49].sHealth > pParty->pPlayers[v49].GetMaxHealth() ) | |
491 pParty->pPlayers[v49].sHealth = pParty->pPlayers[v49].GetMaxHealth(); | |
492 if ( pParty->pPlayers[v49].pConditions[Condition_Unconcious] && pParty->pPlayers[v49].sHealth > 0 ) | |
493 pParty->pPlayers[v49].pConditions[Condition_Unconcious] = 0; | |
494 redraw_flag = true; | |
495 } | |
496 | |
497 //for warlock | |
498 if ( has_dragon_flag && pParty->pPlayers[v49].classType == PLAYER_CLASS_WARLOCK ) | |
499 { | |
2155 | 500 if ( pParty->pPlayers[v49].sMana < pParty->pPlayers[v49].GetMaxMana() ) |
501 ++pParty->pPlayers[v49].sMana; | |
2060 | 502 redraw_flag = true; |
503 } | |
504 | |
505 //for lich | |
506 if ( pParty->pPlayers[v49].classType == PLAYER_CLASS_LICH ) | |
507 { | |
2085 | 508 for ( v31 = 0; v31 < 126; ++v31 ) |
0 | 509 { |
2060 | 510 if ( pParty->pPlayers[v49].pInventoryItemList[v31].uItemID == ITEM_LICH_JAR_FULL ) |
511 lich_jar_flag = true; | |
0 | 512 } |
2060 | 513 lich_flag = true; |
514 } | |
515 if ( lich_flag && !pParty->pPlayers[v49].pConditions[Condition_Dead] | |
516 && !pParty->pPlayers[v49].pConditions[Condition_Eradicated] ) | |
517 { | |
518 if ( pParty->pPlayers[v49].sHealth > pParty->pPlayers[v49].GetMaxHealth() / 2 ) | |
519 pParty->pPlayers[v49].sHealth = pParty->pPlayers[v49].sHealth - 2; | |
520 if ( pParty->pPlayers[v49].sMana > pParty->pPlayers[v49].GetMaxMana() / 2 ) | |
521 pParty->pPlayers[v49].sMana = pParty->pPlayers[v49].sMana - 2; | |
522 } | |
523 if ( lich_jar_flag ) | |
524 { | |
2155 | 525 if ( pParty->pPlayers[v49].sMana < pParty->pPlayers[v49].GetMaxMana() ) |
526 ++pParty->pPlayers[v49].sMana; | |
2060 | 527 } |
528 | |
529 //for zombie | |
530 if ( pParty->pPlayers[v49].pConditions[Condition_Zombie] ) | |
531 zombie_flag = true; | |
532 if ( zombie_flag && !pParty->pPlayers[v49].pConditions[Condition_Dead] | |
533 && !pParty->pPlayers[v49].pConditions[Condition_Eradicated] ) | |
534 { | |
535 if ( pParty->pPlayers[v49].sHealth > pParty->pPlayers[v49].GetMaxHealth() / 2 ) | |
536 pParty->pPlayers[v49].sHealth = pParty->pPlayers[v49].sHealth - 1; | |
537 if ( pParty->pPlayers[v49].sMana > 0 ) | |
538 pParty->pPlayers[v49].sMana = pParty->pPlayers[v49].sMana - 1; | |
0 | 539 } |
540 } | |
2060 | 541 pParty->uLastRegenerationTime = pParty->uTimePlayed; |
542 if ( !viewparams->bRedrawGameUI ) | |
543 viewparams->bRedrawGameUI = redraw_flag; | |
0 | 544 } |
545 } | |
546 | |
547 //----- (00493F79) -------------------------------------------------------- | |
1459 | 548 void init_summoned_item(stru351_summoned_item *_this, __int64 duration) |
0 | 549 { |
550 signed __int64 v2; // ST2C_8@1 | |
551 signed __int64 v3; // qax@1 | |
351 | 552 //signed __int64 v4; // ST1C_8@1 |
0 | 553 unsigned __int64 v5; // qax@1 |
554 unsigned int v6; // ebx@1 | |
555 | |
1459 | 556 v2 = (signed __int64)((double)duration * 0.234375); |
0 | 557 v3 = v2 / 60 / 60; |
351 | 558 //v4 = v3; |
0 | 559 v5 = (unsigned int)v3 / 0x18; |
560 v6 = (unsigned int)(v5 / 7) >> 2; | |
351 | 561 _this->field_0_expire_second = v2 % 60; |
562 _this->field_4_expire_minute = v2 / 60 % 60; | |
563 _this->field_8_expire_hour = v3 % 24; | |
564 _this->field_10_expire_week = v5 / 7 & 3; | |
565 _this->field_C_expire_day = (unsigned int)v5 % 0x1C; | |
566 _this->field_14_exprie_month = v6 % 0xC; | |
352 | 567 _this->field_18_expire_year = v6 / 0xC + game_starting_year; |
0 | 568 } |
569 | |
570 //----- (00494035) -------------------------------------------------------- | |
1031 | 571 void _494035_timed_effects__water_walking_damage__etc() |
0 | 572 { |
573 signed __int64 v0; // qax@1 | |
574 unsigned int v4; // edi@1 | |
575 signed int v12; // edi@29 | |
576 int v24; // ecx@60 | |
577 int v26; // ecx@64 | |
578 int v28; // ecx@68 | |
579 int v30; // ecx@72 | |
580 int v32; // ecx@76 | |
581 int v34; // ecx@80 | |
582 int v36; // ecx@84 | |
583 int v38; // ecx@88 | |
584 int v40; // ecx@92 | |
585 int v42; // ecx@96 | |
586 bool v43; // ebx@102 | |
587 bool v46; // edi@111 | |
588 unsigned int v56; // [sp-8h] [bp-38h]@55 | |
589 int v59; // [sp-4h] [bp-34h]@55 | |
590 unsigned int v61; // [sp+14h] [bp-1Ch]@1 | |
591 signed int a2a; // [sp+18h] [bp-18h]@47 | |
2062 | 592 signed int old_day; // [sp+1Ch] [bp-14h]@47 |
593 signed int old_hour; | |
0 | 594 |
2062 | 595 old_day = pParty->uDaysPlayed; |
596 old_hour = pParty->uCurrentHour; | |
816 | 597 //auto prev_time = pEventTimer->uTimeElapsed; |
766 | 598 pParty->uTimePlayed += pEventTimer->uTimeElapsed; |
2062 | 599 v0 = ((signed __int64)(pParty->uTimePlayed * 0.234375) / 60)/60i64; |
600 v4 = (unsigned int)(((unsigned int)v0 / 24) / 7) >> 2; | |
0 | 601 pParty->uCurrentTimeSecond = (signed __int64)((double)(signed __int64)pParty->uTimePlayed * 0.234375) % 60; |
2062 | 602 pParty->uCurrentMinute = ((signed __int64)(pParty->uTimePlayed * 0.234375) / 60) % 60; |
603 pParty->uCurrentHour = v0 % 24; | |
604 pParty->uCurrentMonthWeek = ((unsigned int)v0 / 24) / 7 & 3; | |
605 pParty->uDaysPlayed = (unsigned int)((unsigned int)v0 / 24) % 28; | |
0 | 606 pParty->uCurrentMonth = v4 % 12; |
352 | 607 pParty->uCurrentYear = v4 / 0xC + game_starting_year; |
2062 | 608 if ( pParty->uCurrentHour >= 3 && (old_hour < 3 || pParty->uDaysPlayed > old_day) ) // new day dawns |
0 | 609 { |
610 pParty->pHirelings[0].bHasUsedTheAbility = false; | |
611 pParty->pHirelings[1].bHasUsedTheAbility = false; | |
612 | |
613 for (uint i = 0; i < pNPCStats->uNumNewNPCs; ++i) | |
614 pNPCStats->pNewNPCData[i].bHasUsedTheAbility = false; | |
615 | |
766 | 616 ++pParty->days_played_without_rest; |
617 if (pParty->days_played_without_rest > 1) | |
0 | 618 { |
619 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
|
620 pParty->pPlayers[i].SetCondWeakWithBlockCheck(0); |
766 | 621 |
622 if (pParty->uNumFoodRations) | |
623 Party::TakeFood(1); | |
0 | 624 else |
625 for (uint i = 0; i < 4; ++i) | |
766 | 626 pParty->pPlayers[i].sHealth = pParty->pPlayers[i].sHealth / (pParty->days_played_without_rest + 1) + 1; |
627 | |
628 if (pParty->days_played_without_rest > 3) | |
2062 | 629 for ( uint i = 0; i < 4; ++i ) |
630 { | |
631 pParty->pPlayers[i].Zero(); | |
632 if (!pParty->pPlayers[i].IsPertified() && !pParty->pPlayers[i].IsEradicated() | |
633 && !pParty->pPlayers[i].IsDead()) | |
0 | 634 { |
2062 | 635 if (rand() % 100 < 5 * pParty->days_played_without_rest) |
636 pParty->pPlayers[i].SetCondDeadWithBlockCheck(0); | |
637 if (rand() % 100 < 10 * pParty->days_played_without_rest) | |
638 pParty->pPlayers[i].SetCondInsaneWithBlockCheck(0); | |
0 | 639 } |
2062 | 640 } |
766 | 641 } |
642 if (uCurrentlyLoadedLevelType == LEVEL_Outdoor) | |
0 | 643 pOutdoor->SetFog(); |
644 | |
645 for (uint i = 0; i < 4; ++i) | |
646 pParty->pPlayers[i].uNumDivineInterventionCastsThisDay = 0; | |
647 } | |
766 | 648 |
2062 | 649 if ( pParty->uFlags & 4 && pParty->field_6FC < (signed __int64)pParty->uTimePlayed )//water damage |
0 | 650 { |
2062 | 651 pParty->field_6FC = (signed __int64)pParty->uTimePlayed + 128; |
652 viewparams->bRedrawGameUI = true; | |
653 for ( uint pl = 1; pl <= 4; ++pl ) | |
0 | 654 { |
2062 | 655 if ( pPlayers[pl]->WearsItem(ITEM_RELIC_HARECS_LEATHER, EQUIP_ARMOUR) |
656 || pPlayers[pl]->HasEnchantedItemEquipped(71) | |
657 || pPlayers[pl]->pPlayerBuffs[PLAYER_BUFF_WATER_WALK].uExpireTime > 0 ) | |
658 pPlayers[pl]->PlayEmotion(CHARACTER_EXPRESSION_37, 0); | |
0 | 659 else |
660 { | |
2062 | 661 if ( !pPlayers[pl]->HasUnderwaterSuitEquipped() ) |
0 | 662 { |
2062 | 663 pPlayers[pl]->ReceiveDamage((signed __int64)pPlayers[pl]->GetMaxHealth() * 0.1, DMGT_FIRE); |
0 | 664 if ( pParty->uFlags & 4 ) |
665 { | |
2062 | 666 strcpy(GameUI_Footer_TimedString.data(), pGlobalTXT_LocalizationStrings[660]);// Âû òîíåòå! |
783 | 667 GameUI_Footer_TimeLeft = 128; |
0 | 668 } |
669 } | |
2062 | 670 else |
671 pPlayers[pl]->PlayEmotion(CHARACTER_EXPRESSION_37, 0); | |
0 | 672 } |
2062 | 673 } |
0 | 674 } |
2062 | 675 if ( pParty->uFlags & 0x200 && pParty->field_6FC < (signed __int64)pParty->uTimePlayed ) //lava damage |
0 | 676 { |
2062 | 677 viewparams->bRedrawGameUI = true; |
678 pParty->field_6FC = (signed __int64)pParty->uTimePlayed + 128; | |
679 | |
680 for ( uint pl = 1; pl <= 4; pl++ ) | |
0 | 681 { |
2062 | 682 pPlayers[pl]->ReceiveDamage((signed __int64)pPlayers[pl]->GetMaxHealth() * 0.1, DMGT_FIRE); |
0 | 683 if ( pParty->uFlags & 0x200 ) |
684 { | |
2062 | 685 strcpy(GameUI_Footer_TimedString.data(), pGlobalTXT_LocalizationStrings[661]); //Âû ãîðèòå! |
783 | 686 GameUI_Footer_TimeLeft = 128; |
0 | 687 } |
688 } | |
689 } | |
690 _493938_regenerate(); | |
2062 | 691 uint party_condition_flag = 4; |
816 | 692 a2a = pEventTimer->uTimeElapsed; |
2063 | 693 if ( pParty->uFlags2 & PARTY_FLAGS_2_RUNNING )//çàìåäëåíèå âîññòàíîâëåíèÿ ïðè áåãå |
816 | 694 { |
695 a2a *= 0.5f; | |
696 if (a2a < 1) | |
0 | 697 a2a = 1; |
698 } | |
2062 | 699 |
700 for ( uint pl = 1; pl <= 4; pl++ ) | |
0 | 701 { |
2062 | 702 if ( pPlayers[pl]->uTimeToRecovery ) |
2063 | 703 pPlayers[pl]->Recover(a2a);//âîññòàíîâëåíèå àêòèâíîñòè |
2062 | 704 if ( pPlayers[pl]->GetItemsBonus(CHARACTER_ATTRIBUTE_ENDURANCE) + pPlayers[pl]->sHealth + pPlayers[pl]->uEndurance >= 1 |
705 || (signed __int64)pPlayers[pl]->pPlayerBuffs[PLAYER_BUFF_PRESERVATION].uExpireTime > 0 ) | |
0 | 706 { |
2062 | 707 if ( pPlayers[pl]->sHealth < 1 ) |
708 pPlayers[pl]->SetCondition(Condition_Unconcious, 0); | |
0 | 709 } |
710 else | |
2062 | 711 pPlayers[pl]->SetCondition(Condition_Dead, 0); |
712 if ( pPlayers[pl]->field_E0 ) | |
0 | 713 { |
2062 | 714 v24 = pPlayers[pl]->field_E0 - pEventTimer->uTimeElapsed; |
0 | 715 if ( v24 > 0 ) |
2062 | 716 pPlayers[pl]->field_E0 = v24; |
0 | 717 else |
718 { | |
2062 | 719 pPlayers[pl]->field_E0 = 0; |
720 viewparams->bRedrawGameUI = true; | |
0 | 721 } |
722 } | |
2062 | 723 if ( pPlayers[pl]->field_E4 ) |
0 | 724 { |
2062 | 725 v26 = pPlayers[pl]->field_E4 - pEventTimer->uTimeElapsed; |
0 | 726 if ( v26 > 0 ) |
2062 | 727 pPlayers[pl]->field_E4 = v26; |
0 | 728 else |
729 { | |
2062 | 730 pPlayers[pl]->field_E4 = 0; |
731 viewparams->bRedrawGameUI = true; | |
0 | 732 } |
733 } | |
2062 | 734 if ( pPlayers[pl]->field_E8 ) |
0 | 735 { |
2062 | 736 v28 = pPlayers[pl]->field_E8 - pEventTimer->uTimeElapsed; |
0 | 737 if ( v28 > 0 ) |
2062 | 738 pPlayers[pl]->field_E8 = v28; |
0 | 739 else |
740 { | |
2062 | 741 pPlayers[pl]->field_E8 = 0; |
742 viewparams->bRedrawGameUI = true; | |
0 | 743 } |
744 } | |
2062 | 745 if ( pPlayers[pl]->field_EC ) |
0 | 746 { |
2062 | 747 v30 = pPlayers[pl]->field_EC - pEventTimer->uTimeElapsed; |
0 | 748 if ( v30 > 0 ) |
2062 | 749 pPlayers[pl]->field_EC = v30; |
0 | 750 else |
751 { | |
2062 | 752 pPlayers[pl]->field_EC = 0; |
753 viewparams->bRedrawGameUI = true; | |
754 } | |
755 } | |
756 if ( pPlayers[pl]->field_F0 ) | |
757 { | |
758 v32 = pPlayers[pl]->field_F0 - pEventTimer->uTimeElapsed; | |
759 if ( v32 > 0 ) | |
760 pPlayers[pl]->field_F0 = v32; | |
761 else | |
762 { | |
763 pPlayers[pl]->field_F0 = 0; | |
764 viewparams->bRedrawGameUI = true; | |
0 | 765 } |
766 } | |
2062 | 767 if ( pPlayers[pl]->field_F4 ) |
0 | 768 { |
2062 | 769 v34 = pPlayers[pl]->field_F4 - pEventTimer->uTimeElapsed; |
770 if ( v34 > 0 ) | |
771 pPlayers[pl]->field_F4 = v34; | |
0 | 772 else |
773 { | |
2062 | 774 pPlayers[pl]->field_F4 = 0; |
775 viewparams->bRedrawGameUI = true; | |
0 | 776 } |
777 } | |
2062 | 778 if ( pPlayers[pl]->field_F8 ) |
0 | 779 { |
2062 | 780 v36 = pPlayers[pl]->field_F8 - pEventTimer->uTimeElapsed; |
781 if ( v36 > 0 ) | |
782 pPlayers[pl]->field_F8 = v36; | |
0 | 783 else |
784 { | |
2062 | 785 pPlayers[pl]->field_F8 = 0; |
786 viewparams->bRedrawGameUI = true; | |
0 | 787 } |
788 } | |
2062 | 789 if ( pPlayers[pl]->field_FC ) |
0 | 790 { |
2062 | 791 v38 = pPlayers[pl]->field_FC - pEventTimer->uTimeElapsed; |
792 if ( v38 > 0 ) | |
793 pPlayers[pl]->field_FC = v38; | |
0 | 794 else |
795 { | |
2062 | 796 pPlayers[pl]->field_FC = 0; |
797 viewparams->bRedrawGameUI = true; | |
0 | 798 } |
799 } | |
2062 | 800 if ( pPlayers[pl]->field_100 ) |
0 | 801 { |
2062 | 802 v40 = pPlayers[pl]->field_100 - pEventTimer->uTimeElapsed; |
803 if ( v40 > 0 ) | |
804 pPlayers[pl]->field_100 = v40; | |
0 | 805 else |
806 { | |
2062 | 807 pPlayers[pl]->field_100 = 0; |
808 viewparams->bRedrawGameUI = true; | |
0 | 809 } |
810 } | |
2062 | 811 if ( pPlayers[pl]->field_104 ) |
0 | 812 { |
2062 | 813 v42 = pPlayers[pl]->field_104 - pEventTimer->uTimeElapsed; |
814 if ( v42 > 0 ) | |
815 pPlayers[pl]->field_104 = v42; | |
0 | 816 else |
817 { | |
2062 | 818 pPlayers[pl]->field_104 = 0; |
819 viewparams->bRedrawGameUI = true; | |
0 | 820 } |
821 } | |
2062 | 822 if ( pPlayers[pl]->pConditions[Condition_Sleep] | pPlayers[pl]->pConditions[Condition_Paralyzed] |
823 | pPlayers[pl]->pConditions[Condition_Unconcious] | pPlayers[pl]->pConditions[Condition_Dead] | |
824 | pPlayers[pl]->pConditions[Condition_Pertified] | pPlayers[pl]->pConditions[Condition_Eradicated] ) | |
825 --party_condition_flag; | |
826 v43 = (signed __int64)pPlayers[pl]->pPlayerBuffs[PLAYER_BUFF_HASTE].uExpireTime > 0; //ñïåøêà | |
0 | 827 |
2062 | 828 for ( uint k = 0; k < 24; ++k ) |
829 pPlayers[pl]->pPlayerBuffs[k].IsBuffExpiredToTime(pParty->uTimePlayed); | |
0 | 830 |
2062 | 831 if ( v43 && (signed __int64)pPlayers[pl]->pPlayerBuffs[7].uExpireTime <= 0 ) |
832 pPlayers[pl]->SetCondition(Condition_Weak, 0); | |
0 | 833 } |
2062 | 834 |
1167 | 835 v46 = (signed __int64)pParty->pPartyBuffs[PARTY_BUFF_HASTE].uExpireTime > 0; |
0 | 836 |
837 for (uint i = 0; i < 20; ++i) | |
838 { | |
1340 | 839 if (pParty->pPartyBuffs[i].IsBuffExpiredToTime(pParty->uTimePlayed) == 1) |
2062 | 840 viewparams->bRedrawGameUI = true; |
0 | 841 } |
842 | |
1167 | 843 if ( v46 && (signed __int64)pParty->pPartyBuffs[PARTY_BUFF_HASTE].uExpireTime <= 0 ) |
0 | 844 { |
845 for (uint i = 0; i < 4; ++i) | |
846 pParty->pPlayers[i].SetCondition(1, 0); | |
847 } | |
848 | |
2182 | 849 for (uint i = 0; i < 2; ++i)//Ïðîâåðêà â ñîçíàíèè ëè ïåðñ ñäåëàâøèé çàêë íà ïîë¸ò è õîæäåíèå ïî âîäå |
0 | 850 { |
2182 | 851 SpellBuff* pBuf = &pParty->pPartyBuffs[Party_Spec_Motion_status_ids[i]]; |
0 | 852 if (pBuf->uExpireTime == 0) |
853 continue; | |
854 | |
855 if ( !(pBuf->uFlags & 1) ) | |
856 { | |
857 if (!pPlayers[pBuf->uCaster]->CanAct()) | |
858 { | |
859 pBuf->Reset(); | |
2182 | 860 if (Party_Spec_Motion_status_ids[i] == PARTY_BUFF_FLY ) |
0 | 861 pParty->bFlying = false; |
862 } | |
863 } | |
864 } | |
865 | |
2062 | 866 if ( !party_condition_flag ) |
0 | 867 { |
151 | 868 if ( pCurrentScreen != SCREEN_REST ) |
0 | 869 { |
2062 | 870 for ( uint pl = 1; pl <= 4; pl++ ) |
0 | 871 { |
2062 | 872 if ( pPlayers[pl]->pConditions[Condition_Sleep] ) |
873 { | |
874 pPlayers[pl]->pConditions[Condition_Sleep] = 0; | |
875 party_condition_flag = 1; | |
876 break; | |
877 } | |
878 } | |
2154 | 879 if ( !party_condition_flag || _5C35C0_force_party_death ) |
2062 | 880 uGameState = GAME_STATE_PARTY_DIED; |
881 } | |
882 } | |
883 | |
884 if ( uActiveCharacter )//âûáîð ñëåäóþùåãî ïîñëå ïðîïóñêàþùåãî õîä | |
885 { | |
886 if ( pCurrentScreen != SCREEN_REST ) | |
887 { | |
888 if ( pPlayers[uActiveCharacter]->pConditions[Condition_Sleep] | |
889 || pPlayers[uActiveCharacter]->pConditions[Condition_Paralyzed] | |
890 || pPlayers[uActiveCharacter]->pConditions[Condition_Unconcious] | |
891 || pPlayers[uActiveCharacter]->pConditions[Condition_Dead] | |
892 || pPlayers[uActiveCharacter]->pConditions[Condition_Pertified] | |
893 || pPlayers[uActiveCharacter]->pConditions[Condition_Eradicated] ) | |
894 { | |
895 viewparams->bRedrawGameUI = true; | |
0 | 896 uActiveCharacter = pParty->GetNextActiveCharacter(); |
897 } | |
898 } | |
899 } | |
900 } | |
901 | |
902 //----- (00494820) -------------------------------------------------------- | |
758 | 903 unsigned int __fastcall _494820_training_time(unsigned int a1) |
0 | 904 { |
905 signed int v1; // eax@1 | |
906 | |
907 v1 = 5; | |
758 | 908 if ( a1 % 24 >= 5 ) |
0 | 909 v1 = 29; |
758 | 910 return v1 - a1 % 24; |
0 | 911 } |
912 | |
913 //----- (00494836) -------------------------------------------------------- | |
2184 | 914 int stru339_spell_sound::AddPartySpellSound(int uSoundID, int a6) |
0 | 915 { |
916 int v3; // esi@1 | |
917 int result; // eax@1 | |
2103 | 918 //stru339_spell_sound *v5; // ebx@1 |
2117 | 919 //int *v6; // edi@2 |
0 | 920 unsigned int v7; // eax@3 |
921 int v8; // [sp+Ch] [bp-8h]@3 | |
922 int v9; // [sp+10h] [bp-4h]@2 | |
923 int a2a; // [sp+1Ch] [bp+8h]@1 | |
2103 | 924 //return 0; |
0 | 925 v3 = 0; |
926 result = word_4EE088_sound_ids[uSoundID]; | |
2103 | 927 //v5 = this; |
0 | 928 a2a = word_4EE088_sound_ids[uSoundID]; |
2103 | 929 if ( word_4EE088_sound_ids[uSoundID] ) |
0 | 930 { |
2117 | 931 //v6 = this->pSoundsOffsets; |
2103 | 932 for ( v9 = 0; v9 < 2; ++v9 ) |
0 | 933 { |
934 v7 = a2a++; | |
2103 | 935 result = pSoundList->LoadSound(v7, (char *)this + v3, 44744 - v3, &v8, a6); |
0 | 936 if ( !result ) |
937 break; | |
938 a6 += 4; | |
939 result = v8 + 256; | |
2103 | 940 this->pSoundsOffsets[v9] = v3; |
0 | 941 v3 += result; |
2103 | 942 this->pSoundsSizes[v9] = v8 + 256; |
2117 | 943 //++v6; |
0 | 944 } |
945 } | |
946 return result; | |
947 } | |
948 // 4EE088: using guessed type __int16 word_4EE088_sound_ids[]; | |
949 | |
950 //----- (00494AED) -------------------------------------------------------- | |
130 | 951 unsigned int PlayerFrameTable::GetFrameIdByExpression(CHARACTER_EXPRESSION_ID expression) |
0 | 952 { |
2103 | 953 for ( uint i = 0; i < this->uNumFrames; i++ ) |
0 | 954 { |
2103 | 955 if ( this->pFrames[i].expression == expression ) |
956 return i; | |
0 | 957 } |
2103 | 958 return 0; |
0 | 959 } |
960 | |
961 //----- (00494B10) -------------------------------------------------------- | |
962 PlayerFrame *PlayerFrameTable::GetFrameBy_x(unsigned int uFramesetID, unsigned int uFrameID) | |
963 { | |
964 unsigned int v3; // esi@1 | |
965 __int16 v6; // dx@2 | |
966 int v7; // edx@3 | |
967 char *i; // eax@3 | |
968 int v9; // ecx@5 | |
969 PlayerFrame *result; // eax@6 | |
970 | |
971 v3 = uFramesetID; | |
2117 | 972 if ( this->pFrames[uFramesetID].uFlags & 1 && (v6 = this->pFrames[uFramesetID].uAnimLength) != 0 ) |
0 | 973 { |
974 v7 = ((signed int)uFrameID >> 3) % (unsigned __int16)v6; | |
2117 | 975 for ( i = (char *)&this->pFrames[uFramesetID].uAnimTime; ; i += 10 ) |
0 | 976 { |
977 v9 = *(short *)i; | |
978 if ( v7 <= v9 ) | |
979 break; | |
980 v7 -= v9; | |
981 ++v3; | |
982 } | |
2117 | 983 result = &this->pFrames[v3]; |
0 | 984 } |
985 else | |
2117 | 986 result = &this->pFrames[uFramesetID]; |
0 | 987 return result; |
988 } | |
989 | |
990 //----- (00494B5E) -------------------------------------------------------- | |
554
9caf59edb1ee
Cave and Temple load and even doesn't crash (for a while).
Nomad
parents:
526
diff
changeset
|
991 PlayerFrame *PlayerFrameTable::GetFrameBy_y(int *pFramesetID, int *pAnimTime, int a4) |
0 | 992 { |
993 int v5; // esi@1 | |
994 int v6; // eax@2 | |
995 | |
554
9caf59edb1ee
Cave and Temple load and even doesn't crash (for a while).
Nomad
parents:
526
diff
changeset
|
996 v5 = a4 + *pAnimTime; |
9caf59edb1ee
Cave and Temple load and even doesn't crash (for a while).
Nomad
parents:
526
diff
changeset
|
997 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
|
998 *pAnimTime = v5; |
0 | 999 else |
1000 { | |
1001 v6 = rand() % 4 + 21; | |
554
9caf59edb1ee
Cave and Temple load and even doesn't crash (for a while).
Nomad
parents:
526
diff
changeset
|
1002 *pFramesetID = v6; |
2117 | 1003 *pAnimTime = 8 * v5 % this->pFrames[v6].uAnimTime; |
554
9caf59edb1ee
Cave and Temple load and even doesn't crash (for a while).
Nomad
parents:
526
diff
changeset
|
1004 } |
2117 | 1005 return &this->pFrames[*pFramesetID]; |
0 | 1006 } |
1007 | |
1008 //----- (00494BC3) -------------------------------------------------------- | |
1009 void PlayerFrameTable::ToFile() | |
1010 { | |
1011 PlayerFrameTable *v1; // esi@1 | |
1012 FILE *v2; // eax@1 | |
1013 FILE *v3; // edi@1 | |
1014 | |
1980 | 1015 PlayerFrameTable* Str = this; |
0 | 1016 |
1017 v1 = Str; | |
1018 v2 = fopen("data\\dpft.bin", "wb"); | |
1019 v3 = v2; | |
1020 if ( !v2 ) | |
1545 | 1021 Error("Unable to save dpft.bin"); |
2117 | 1022 fwrite(v1, 4, 1, v2); |
0 | 1023 fwrite(v1->pFrames, 0xAu, v1->uNumFrames, v3); |
1024 fclose(v3); | |
1025 } | |
1026 | |
1027 //----- (00494C0F) -------------------------------------------------------- | |
1477
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1461
diff
changeset
|
1028 void PlayerFrameTable::FromFile(void *data_mm6, void *data_mm7, void *data_mm8) |
0 | 1029 { |
1477
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1461
diff
changeset
|
1030 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
|
1031 num_mm7_frames = data_mm7 ? *(int *)data_mm7 : 0, |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1461
diff
changeset
|
1032 num_mm8_frames = data_mm8 ? *(int *)data_mm8 : 0; |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1461
diff
changeset
|
1033 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
|
1034 assert(uNumFrames); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1461
diff
changeset
|
1035 assert(!num_mm8_frames); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1461
diff
changeset
|
1036 |
1583 | 1037 pFrames = (PlayerFrame *)malloc(uNumFrames * sizeof(PlayerFrame)); |
1477
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1461
diff
changeset
|
1038 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
|
1039 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
|
1040 memcpy(pFrames + num_mm6_frames + num_mm7_frames, (char *)data_mm8 + 4, num_mm8_frames * sizeof(PlayerFrame)); |
0 | 1041 } |
1042 | |
1043 //----- (00494C5A) -------------------------------------------------------- | |
1044 int PlayerFrameTable::FromFileTxt(const char *Args) | |
1045 { | |
2117 | 1046 //PlayerFrameTable *v2; // ebx@1 |
0 | 1047 FILE *v3; // eax@1 |
1048 int v4; // esi@3 | |
1049 void *v5; // eax@10 | |
1050 FILE *v6; // ST0C_4@12 | |
1051 char *i; // eax@12 | |
1052 __int16 v8; // ax@15 | |
1053 const char *v9; // ST10_4@15 | |
1054 unsigned __int16 v10; // ax@15 | |
1055 const char *v11; // ST0C_4@15 | |
1056 int j; // esi@15 | |
1057 int v13; // eax@17 | |
1058 int v14; // edx@22 | |
1059 int v15; // ecx@23 | |
1060 int v16; // eax@24 | |
1061 signed int k; // eax@27 | |
2117 | 1062 //PlayerFrame *v18; // edx@28 |
0 | 1063 int v19; // esi@28 |
1064 int l; // ecx@29 | |
1065 char Buf; // [sp+Ch] [bp-2F8h]@3 | |
1066 FrameTableTxtLine v23; // [sp+200h] [bp-104h]@4 | |
1067 FrameTableTxtLine v24; // [sp+27Ch] [bp-88h]@4 | |
1068 int v25; // [sp+2F8h] [bp-Ch]@3 | |
1069 int v26; // [sp+2FCh] [bp-8h]@3 | |
1070 FILE *File; // [sp+300h] [bp-4h]@1 | |
1071 int Argsa; // [sp+30Ch] [bp+8h]@28 | |
1072 | |
2117 | 1073 __debugbreak();//Ritor1; |
0 | 1074 //TileTable::dtor((TileTable *)this); |
1075 v3 = fopen(Args, "r"); | |
1076 File = v3; | |
1077 if ( !v3 ) | |
1545 | 1078 Error("PlayerFrameTable::load - Unable to open file: %s.", Args); |
0 | 1079 v4 = 0; |
1080 v25 = 0; | |
1081 v26 = 1; | |
1082 if ( fgets(&Buf, 490, v3) ) | |
1083 { | |
1084 do | |
1085 { | |
1086 *strchr(&Buf, 10) = 0; | |
703 | 1087 memcpy(&v24, txt_file_frametable_parser(&Buf, &v23), sizeof(v24)); |
701 | 1088 if ( v24.uPropCount && *v24.pProperties[0] != 47 ) |
1089 { | |
1090 if ( v24.uPropCount < 3 ) | |
1545 | 1091 Error("PlayerFrameTable::load, too few arguments, %s line %i.", Args, v26); |
0 | 1092 ++v25; |
1093 } | |
1094 ++v26; | |
1095 } | |
1096 while ( fgets(&Buf, 490, File) ); | |
1097 v4 = v25; | |
1098 } | |
2117 | 1099 this->uNumFrames = v4; |
1583 | 1100 v5 = malloc(10 * v4); |
2117 | 1101 this->pFrames = (PlayerFrame *)v5; |
0 | 1102 if ( !v5 ) |
1545 | 1103 Error("PlayerFrameTable::load - Out of Memory!"); |
0 | 1104 v6 = File; |
2117 | 1105 this->uNumFrames = 0; |
0 | 1106 fseek(v6, 0, 0); |
1107 for ( i = fgets(&Buf, 490, File); i; i = fgets(&Buf, 490, File) ) | |
1108 { | |
1109 *strchr(&Buf, 10) = 0; | |
703 | 1110 memcpy(&v24, txt_file_frametable_parser(&Buf, &v23), sizeof(v24)); |
701 | 1111 if ( v24.uPropCount && *v24.pProperties[0] != 47 ) |
0 | 1112 { |
2117 | 1113 //v8 = atoi(v24.pProperties[0]); |
1114 //v9 = v24.pProperties[1]; | |
1115 this->pFrames[this->uNumFrames].expression = (CHARACTER_EXPRESSION_ID)atoi(v24.pProperties[0]); | |
1116 //v10 = atoi(v9); | |
1117 //v11 = v24.pProperties[2]; | |
1118 this->pFrames[this->uNumFrames].uTextureID = atoi(v24.pProperties[1]); | |
1119 this->pFrames[this->uNumFrames].uAnimTime = atoi(v24.pProperties[2]); | |
1120 this->pFrames[this->uNumFrames].uAnimLength = 0; | |
1121 this->pFrames[this->uNumFrames].uFlags = 0; | |
701 | 1122 for ( j = 3; j < v24.uPropCount; ++j ) |
0 | 1123 { |
1104 | 1124 if ( !_stricmp(v24.pProperties[j], "New") ) |
2117 | 1125 this->pFrames[this->uNumFrames].uFlags |= 4; |
0 | 1126 } |
2117 | 1127 ++this->uNumFrames; |
0 | 1128 } |
1129 } | |
1130 fclose(File); | |
2117 | 1131 |
1132 if ( (signed int)(this->uNumFrames - 1) > 0 ) | |
0 | 1133 { |
1134 v15 = 0; | |
2117 | 1135 for ( v14 = 0; v14 < this->uNumFrames - 1; ++v14 ) |
0 | 1136 { |
2117 | 1137 v16 = (int)&this->pFrames[v15]; |
0 | 1138 if ( !(*(char *)(v16 + 18) & 4) ) |
2117 | 1139 this->pFrames[v14].uFlags |= 1; |
0 | 1140 ++v15; |
1141 } | |
1142 } | |
2117 | 1143 for ( k = 0; k < (signed int)this->uNumFrames; *(short *)(Argsa + 6) = v19 ) |
0 | 1144 { |
2117 | 1145 //v18 = this->pFrames; |
1146 Argsa = (int)&this->pFrames[k]; | |
0 | 1147 v19 = *(short *)(Argsa + 4); |
2117 | 1148 if ( this->pFrames[k].uFlags & 1 ) |
0 | 1149 { |
1150 ++k; | |
2117 | 1151 for ( l = (int)&this->pFrames[k]; this->pFrames[k].uFlags & 1; l += 10 ) |
0 | 1152 { |
1153 v19 += *(short *)(l + 4); | |
1154 ++k; | |
1155 } | |
2117 | 1156 LOWORD(v19) = this->pFrames[k].uAnimTime + v19; |
0 | 1157 } |
1158 ++k; | |
1159 } | |
1160 return 1; | |
1161 } | |
1162 | |
1459 | 1163 |
0 | 1164 |
1165 //----- (00495430) -------------------------------------------------------- | |
1838 | 1166 const char * GetReputationString( signed int a1 ) |
607 | 1167 { |
566 | 1168 if (a1 >= 25) |
1169 return pGlobalTXT_LocalizationStrings[379]; // Hated | |
1170 else if (a1 >= 6) | |
1171 return pGlobalTXT_LocalizationStrings[392]; // Unfriendly | |
1172 else if (a1 >= -5) | |
1173 return pGlobalTXT_LocalizationStrings[399]; // Neutral; | |
1174 else if (a1 >= -24) | |
1175 return pGlobalTXT_LocalizationStrings[402]; // Friendly | |
0 | 1176 else |
566 | 1177 return pGlobalTXT_LocalizationStrings[434]; // Respected; |
0 | 1178 } |
1179 | |
1180 //----- (00495461) -------------------------------------------------------- | |
1838 | 1181 char *BuildDialogueString(const char *lpsz, unsigned __int8 uPlayerID, ItemGen *a3, char *a4, int a5, __int64 *a6) |
0 | 1182 { |
1183 Player *pPlayer; // ebx@3 | |
1838 | 1184 const char *pText; // esi@7 |
0 | 1185 int v17; // eax@10 |
1186 signed __int64 v18; // qax@18 | |
1187 unsigned __int8 *v20; // ebx@32 | |
1188 int v21; // ecx@34 | |
1453 | 1189 int pReputation; // eax@45 |
0 | 1190 int v29; // eax@68 |
1191 __int16 v55[56]; // [sp+10h] [bp-128h]@34 | |
351 | 1192 stru351_summoned_item v56; // [sp+80h] [bp-B8h]@107 |
0 | 1193 char a1[100]; // [sp+B8h] [bp-80h]@3 |
1194 int v63; // [sp+12Ch] [bp-Ch]@32 | |
254
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
1195 |
1453 | 1196 if ( IsBadStringPtrA(lpsz, 1) ) |
0 | 1197 return "Invalid String Passed"; |
254
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
1198 |
0 | 1199 a1[0] = 0; |
1453 | 1200 pPlayer = &pParty->pPlayers[uPlayerID]; |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
1201 memset(pTmpBuf2.data(), 0, sizeof(pTmpBuf2)); |
254
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
1202 |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
1203 NPCData *npc = nullptr; |
0 | 1204 if ( dword_5C35D4 ) |
1211 | 1205 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
|
1206 else |
602 | 1207 npc = GetNPCData(sDialogue_SpeakingActorNPC_ID); |
254
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
1208 |
1453 | 1209 //pText = a4; |
1980 | 1210 uint len = strlen(lpsz); |
254
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
1211 for (int i = 0, dst = 0; i < len; ++i) |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
1212 { |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
1213 char c = lpsz[i]; |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
1214 if (c != '%') |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
1215 pTmpBuf2[dst++] = c; |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
1216 else |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
1217 { |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
1218 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
|
1219 |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
1220 switch ( v17 ) |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
1221 { |
1453 | 1222 case 1://Ïîäðîáíåå |
1223 strcat(pTmpBuf2.data(), npc->pName); | |
1224 dst = strlen(pTmpBuf2.data()); | |
1225 i += 2; | |
1226 break; | |
1227 case 2: | |
1228 strcat(pTmpBuf2.data(), pPlayer->pName); | |
1229 dst = strlen(pTmpBuf2.data()); | |
1230 i += 2; | |
1231 break; | |
1232 case 3: | |
1233 case 4: | |
1234 strcat(pTmpBuf2.data(), a1); | |
1235 dst = strlen(pTmpBuf2.data()); | |
1236 i += 2; | |
1237 break; | |
1238 case 5: | |
1239 v18 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed * 0.234375) / 60 / 60 % 24; | |
1240 pText = pGlobalTXT_LocalizationStrings[397];// "evening" | |
1241 if ( SHIDWORD(v18) <= 0 && SHIDWORD(v18) >= 0 && (unsigned int)v18 >= 5 && SHIDWORD(v18) <= 0 ) | |
1242 { | |
1243 if ( SHIDWORD(v18) >= 0 && (unsigned int)v18 >= 11 ) | |
0 | 1244 { |
1453 | 1245 if ( v18 < 20 ) |
1246 pText = pGlobalTXT_LocalizationStrings[396];// "day" | |
0 | 1247 } |
1248 else | |
1249 { | |
1453 | 1250 pText = pGlobalTXT_LocalizationStrings[395];// "morning" |
1251 } | |
1252 } | |
1253 strcat(pTmpBuf2.data(), pText); | |
1254 dst = strlen(pTmpBuf2.data()); | |
1255 i += 2; | |
1256 break; | |
1257 case 6: | |
1258 if ( pPlayer->uSex ) | |
1259 pText = pGlobalTXT_LocalizationStrings[387];// "lady" | |
1260 else | |
1261 pText = pGlobalTXT_LocalizationStrings[385];// "sir" | |
1262 strcat(pTmpBuf2.data(), pText); | |
1263 dst = strlen(pTmpBuf2.data()); | |
1264 i += 2; | |
1265 break; | |
1266 case 7: | |
1267 if ( pPlayer->uSex ) | |
1268 pText = pGlobalTXT_LocalizationStrings[389];// "Lady" | |
1269 else | |
1270 pText = pGlobalTXT_LocalizationStrings[386];// "Sir" | |
1271 strcat(pTmpBuf2.data(), pText); | |
1272 dst = strlen(pTmpBuf2.data()); | |
1273 i += 2; | |
1274 break; | |
1275 case 8: | |
1276 v63 = 0; | |
1460
ff2118028c71
renaming _guilds_member_bits to _achieved_awards_bits
Gloval
parents:
1453
diff
changeset
|
1277 v20 = (unsigned __int8 *)pPlayer->_achieved_awards_bits; |
1477
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1461
diff
changeset
|
1278 for ( uint _i = 0; _i < 28; ++_i ) |
1453 | 1279 { |
1280 if ( (unsigned __int16)_449B57_test_bit(v20, word_4EE150[i]) ) | |
1281 { | |
1282 v21 = v63; | |
1283 ++v63; | |
1284 v55[v63] = word_4EE150[i]; | |
1285 } | |
1286 } | |
1287 if ( v63 ) | |
1288 { | |
1289 if ( dword_A74CDC == -1 ) | |
1290 dword_A74CDC = rand() % v63; | |
1291 pText = (char *)pAwards[v55[dword_A74CDC]].pText;//(char *)dword_723E80_award_related[2 * v55[v24]]; | |
1292 } | |
1293 else | |
1294 pText = (char *)pNPCTopics[55].pText; | |
1295 strcat(pTmpBuf2.data(), pText); | |
1296 dst = strlen(pTmpBuf2.data()); | |
1297 i += 2; | |
1298 break; | |
1299 case 9: | |
1300 if ( npc->uSex ) | |
1301 pText = pGlobalTXT_LocalizationStrings[384];// "her" | |
1302 else | |
1303 pText = pGlobalTXT_LocalizationStrings[383];// "his" | |
1304 strcat(pTmpBuf2.data(), pText); | |
1305 dst = strlen(pTmpBuf2.data()); | |
1306 i += 2; | |
1307 break; | |
1308 case 10: | |
1309 if ( pPlayer->uSex ) | |
1310 pText = pGlobalTXT_LocalizationStrings[389];// "Lady" | |
1311 else | |
1312 pText = pGlobalTXT_LocalizationStrings[388];// "Lord" | |
1313 strcat(pTmpBuf2.data(), pText); | |
1314 dst = strlen(pTmpBuf2.data()); | |
1315 i += 2; | |
1316 break; | |
1317 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
|
1318 pReputation = pParty->GetPartyReputation(); |
1453 | 1319 if ( pReputation >= 25 ) |
1320 pText = pGlobalTXT_LocalizationStrings[379]; | |
1321 else//v25 < 25 | |
1322 { | |
1323 if ( pReputation < 6 ) | |
1324 { | |
1325 if ( pReputation >= -5 )//6 >= v25 >= -5 | |
1326 pText = pGlobalTXT_LocalizationStrings[399]; | |
1327 else// v25 < -5 | |
0 | 1328 { |
1453 | 1329 if ( pReputation < -24 )//-24 > v25 |
1330 pText = pGlobalTXT_LocalizationStrings[434]; | |
1331 else// -5 > v25 > -24 | |
1332 pText = pGlobalTXT_LocalizationStrings[402]; | |
0 | 1333 } |
1453 | 1334 } |
1335 else//25 > v25 > 6 | |
1336 pText = pGlobalTXT_LocalizationStrings[392]; | |
1337 } | |
1338 strcat(pTmpBuf2.data(), pText); | |
1339 dst = strlen(pTmpBuf2.data()); | |
1340 i += 2; | |
1341 break; | |
1342 case 12: | |
1343 pReputation = npc->rep; | |
1344 if ( pReputation >= 25 ) | |
1345 pText = pGlobalTXT_LocalizationStrings[379]; | |
1346 else | |
1347 { | |
1348 if ( pReputation < 6 ) | |
1349 { | |
1350 if ( pReputation >= -5 ) | |
1351 pText = pGlobalTXT_LocalizationStrings[399]; | |
0 | 1352 else |
1353 { | |
1453 | 1354 if ( pReputation < -24 ) |
1355 pText = pGlobalTXT_LocalizationStrings[434]; | |
1356 else | |
1357 pText = pGlobalTXT_LocalizationStrings[402]; | |
0 | 1358 } |
1359 } | |
254
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
1360 else |
1453 | 1361 pText = pGlobalTXT_LocalizationStrings[392]; |
254
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
1362 } |
1453 | 1363 strcat(pTmpBuf2.data(), pText); |
1364 dst = strlen(pTmpBuf2.data()); | |
1365 i += 2; | |
1366 break; | |
1367 case 13: | |
2229
10c909eb6766
dword_AE336C to NPCStats::dword_AE336C_LastMispronouncedNameFirstLetter,
Grumpy7
parents:
2215
diff
changeset
|
1368 strcat(pTmpBuf2.data(), pNPCStats->sub_495366_MispronounceName(pPlayer->pName[0], pPlayer->uSex)); |
1453 | 1369 dst = strlen(pTmpBuf2.data()); |
1370 i += 2; | |
1371 break; | |
1372 case 14: | |
1373 if ( npc->uSex ) | |
1374 pText = pGlobalTXT_LocalizationStrings[391];// "sister" | |
1375 else | |
1376 pText = pGlobalTXT_LocalizationStrings[390];// "brother" | |
1377 strcat(pTmpBuf2.data(), pText); | |
1378 dst = strlen(pTmpBuf2.data()); | |
1379 i += 2; | |
1380 break; | |
1381 case 15: | |
1382 strcat(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[393]);// "daughter" | |
1383 dst = strlen(pTmpBuf2.data()); | |
1384 i += 2; | |
1385 break; | |
1386 case 16: | |
1387 if ( npc->uSex ) | |
1388 pText = pGlobalTXT_LocalizationStrings[391];// "sister" | |
1389 else | |
1390 pText = pGlobalTXT_LocalizationStrings[390];// "brother" | |
1391 strcat(pTmpBuf2.data(), pText); | |
1392 dst = strlen(pTmpBuf2.data()); | |
1393 i += 2; | |
1394 break; | |
1395 case 17://òåêñò íà¸ìíîãî ÍÏÑ | |
1396 { | |
2115 | 1397 uint pay_percentage = pNPCStats->pProfessions[npc->uProfession].uHirePrice / 100; |
1453 | 1398 if ( !pay_percentage ) |
1399 pay_percentage = 1; | |
1400 sprintf(a1, "%lu", pay_percentage); | |
1401 strcat(pTmpBuf2.data(), a1); | |
1402 dst = strlen(pTmpBuf2.data()); | |
1403 i += 2; | |
1404 break; | |
1405 } | |
1406 case 18: | |
1407 case 19: | |
1408 case 20: | |
1409 case 21: | |
1410 case 22: | |
1411 case 26: | |
1412 strncpy(a1, lpsz + i + 1, 2); | |
1413 sprintf(a1, "%lu", atoi(a1)); | |
1414 strcat(pTmpBuf2.data(), a1); | |
1415 dst = strlen(pTmpBuf2.data()); | |
1416 i += 2; | |
1417 break; | |
1418 case 23: | |
1477
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1461
diff
changeset
|
1419 if ( pMapStats->GetMapInfo(pCurrentMapName) ) |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1461
diff
changeset
|
1420 pText = pMapStats->pInfos[pMapStats->GetMapInfo(pCurrentMapName)].pName; |
1453 | 1421 else |
1422 pText = pGlobalTXT_LocalizationStrings[394];// "Unknown" | |
1423 strcat(pTmpBuf2.data(), pText); | |
1424 dst = strlen(pTmpBuf2.data()); | |
1425 i += 2; | |
1426 break; | |
1427 case 24://íàçâàíèå òîâàðà â ïðîäàæå | |
2069 | 1428 sprintfex(a1, format_4E2D80, Color16(255, 255, 155), a3->GetDisplayName()); |
1453 | 1429 strcat(pTmpBuf2.data(), a1); |
1430 dst = strlen(pTmpBuf2.data()); | |
1431 i += 2; | |
1432 break; | |
1433 case 25: | |
1434 v29 = pPlayer->GetBaseBuyingPrice(a3->GetValue(), p2DEvents[(signed int)a4 - 1].fPriceMultiplier); | |
0 | 1435 switch ( a5 ) |
1453 | 1436 { |
1437 case 3: | |
1438 v29 = pPlayer->GetBaseSellingPrice(a3->GetValue(), p2DEvents[(signed int)a4 - 1].fPriceMultiplier); | |
1439 break; | |
1440 case 4: | |
1441 v29 = pPlayer->GetBaseIdentifyPrice(p2DEvents[(signed int)a4 - 1].fPriceMultiplier); | |
1442 break; | |
1443 case 5: | |
1444 v29 = pPlayer->GetBaseRepairPrice(a3->GetValue(), p2DEvents[(signed int)a4 - 1].fPriceMultiplier); | |
1445 break; | |
1446 case 6: | |
1447 v29 = pPlayer->GetBaseSellingPrice(a3->GetValue(), p2DEvents[(signed int)a4 - 1].fPriceMultiplier) / 2; | |
1448 break; | |
1449 } | |
1450 sprintfex(a1, "%lu", v29); | |
1451 strcat(pTmpBuf2.data(), a1); | |
1452 dst = strlen(pTmpBuf2.data()); | |
1453 i += 2; | |
1454 break; | |
1455 case 27://òåêñò ïðîäàæè | |
1456 v29 = pPlayer->GetBuyingPrice(a3->GetValue(), p2DEvents[(signed int)a4 - 1].fPriceMultiplier); | |
1457 if ( a5 == 3 ) | |
1458 { | |
1459 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
|
1460 if (a3->IsBroken()) |
1453 | 1461 v29 = 1; |
1462 sprintfex(a1, "%lu", v29); | |
1463 strcat(pTmpBuf2.data(), a1); | |
1464 dst = strlen(pTmpBuf2.data()); | |
1465 i += 2; | |
0 | 1466 break; |
254
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
1467 } |
1453 | 1468 if ( a5 != 4 ) |
0 | 1469 { |
1453 | 1470 if ( a5 == 5 ) |
1471 v29 = pPlayer->GetPriceRepair(a3->GetValue(), p2DEvents[(signed int)a4 - 1].fPriceMultiplier); | |
1472 else | |
1473 { | |
1474 if ( a5 == 6 ) | |
1475 { | |
1476 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
|
1477 if (a3->IsBroken()) |
1453 | 1478 v29 = 1; |
1479 if (!v29) | |
1480 v29 = 1; | |
1481 sprintfex(a1, "%lu", v29); | |
1482 strcat(pTmpBuf2.data(), a1); | |
1483 dst = strlen(pTmpBuf2.data()); | |
1484 i += 2; | |
1485 break; | |
1486 } | |
1487 } | |
1488 sprintfex(a1, "%lu", v29); | |
1489 strcat(pTmpBuf2.data(), a1); | |
1490 dst = strlen(pTmpBuf2.data()); | |
1491 i += 2; | |
1492 break; | |
0 | 1493 } |
1453 | 1494 sprintfex(a1, "%lu", pPlayer->GetPriceIdentification(p2DEvents[(signed int)a4 - 1].fPriceMultiplier)); |
1495 strcat(pTmpBuf2.data(), a1); | |
1496 dst = strlen(pTmpBuf2.data()); | |
1497 i += 2; | |
1498 break; | |
1499 case 28://ïðîôåññèÿ | |
1500 strcat(pTmpBuf2.data(), (char *)p2DEvents[(signed int)a4 - 1].pProprieterTitle); | |
1501 dst = strlen(pTmpBuf2.data()); | |
1502 i += 2; | |
1503 break; | |
254
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
1504 case 29: |
1453 | 1505 sprintfex(a1, "%lu", pPlayer->GetPriceIdentification(p2DEvents[(signed int)a4 - 1].fPriceMultiplier)); |
1506 strcat(pTmpBuf2.data(), a1); | |
1507 dst = strlen(pTmpBuf2.data()); | |
1508 i += 2; | |
1509 break; | |
254
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
1510 case 30: |
1453 | 1511 if ( !a6 ) |
1512 { | |
1513 strcat(pTmpBuf2.data(), a4); | |
1514 dst = strlen(pTmpBuf2.data()); | |
1515 i += 2; | |
1516 break; | |
1517 } | |
1459 | 1518 init_summoned_item(&v56, *a6); |
1453 | 1519 sprintfex(a1, pGlobalTXT_LocalizationStrings[378], aMonthNames[v56.field_14_exprie_month], v56.field_C_expire_day + 1, v56.field_18_expire_year); |
1520 strcat(pTmpBuf2.data(), a1); | |
1521 dst = strlen(pTmpBuf2.data()); | |
1522 i += 2; | |
1523 break; | |
254
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
1524 case 31: |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
1525 case 32: |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
1526 case 33: |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
1527 case 34: |
1453 | 1528 strcat(pTmpBuf2.data(), pParty->pPlayers[v17 - 31].pName); |
1529 dst = strlen(pTmpBuf2.data()); | |
1530 i += 2; | |
1531 break; | |
254
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
1532 default: |
0 | 1533 if ( v17 <= 50 || v17 > 70 ) |
1453 | 1534 { |
1535 strncpy(a1, lpsz + i + 1, 2); | |
1536 sprintf(a1, "%lu", atoi(a1)); | |
1537 strcat(pTmpBuf2.data(), a1); | |
1538 dst = strlen(pTmpBuf2.data()); | |
1539 i += 2; | |
1540 break; | |
1541 } | |
254
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
1542 if ( v17 - 51 >= 20 ) |
1453 | 1543 { |
1544 strcat(pTmpBuf2.data(), a4); | |
1545 dst = strlen(pTmpBuf2.data()); | |
1546 i += 2; | |
1547 break; | |
1548 } | |
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
|
1549 init_summoned_item(&v56, pParty->PartyTimes._s_times[v17-51]); |
1453 | 1550 sprintfex(a1, pGlobalTXT_LocalizationStrings[378], aMonthNames[v56.field_14_exprie_month], v56.field_C_expire_day + 1, v56.field_18_expire_year); |
1551 strcat(pTmpBuf2.data(), a1); | |
1552 dst = strlen(pTmpBuf2.data()); | |
1553 i += 2; | |
1554 break; | |
254
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
1555 } |
d1af3319bc44
BuilDialogueString: replaces %xx in dialogue strings by appropriate values
Nomad
parents:
250
diff
changeset
|
1556 } |
0 | 1557 } |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
1558 return pTmpBuf2.data(); |
0 | 1559 } |
1560 | |
1561 //----- (0049B04D) -------------------------------------------------------- | |
734 | 1562 void stru154::GetFacePlaneAndClassify(ODMFace *a2, BSPVertexBuffer *a3) |
0 | 1563 { |
734 | 1564 //stru154 *v3; // edi@1 |
1565 //signed int v4; // eax@1 | |
1566 //signed int result; // eax@9 | |
1567 //signed int v6; // [sp-8h] [bp-18h]@8 | |
0 | 1568 Vec3_float_ v; // [sp+4h] [bp-Ch]@1 |
734 | 1569 float v7; |
0 | 1570 |
1571 v.x = 0.0; | |
1572 v.y = 0.0; | |
1573 v.z = 0.0; | |
734 | 1574 GetFacePlane(a2, a3, &v, &v7); |
1575 | |
1576 if (fabsf(a2->pFacePlane.vNormal.z) < 1e-6f) | |
1577 polygonType = POLYGON_VerticalWall; | |
1578 else if (fabsf(a2->pFacePlane.vNormal.x) < 1e-6f && | |
1579 fabsf(a2->pFacePlane.vNormal.y) < 1e-6f) | |
1580 polygonType = POLYGON_Floor; | |
0 | 1581 else |
734 | 1582 polygonType = POLYGON_InBetweenFloorAndWall; |
1583 | |
1584 face_plane.vNormal.x = v.x; | |
1585 face_plane.vNormal.y = v.y; | |
1586 face_plane.vNormal.z = v.z; | |
1587 face_plane.dist = v7; | |
0 | 1588 } |
1589 | |
1590 //----- (0049B0C9) -------------------------------------------------------- | |
734 | 1591 void stru154::ClassifyPolygon(Vec3_float_ *pNormal, float dist) |
0 | 1592 { |
734 | 1593 if (fabsf(pNormal->z) < 1e-6f) |
1594 polygonType = POLYGON_VerticalWall; | |
1595 else if (fabsf(pNormal->x) < 1e-6f && | |
1596 fabsf(pNormal->y) < 1e-6f) | |
1597 polygonType = POLYGON_Floor; | |
0 | 1598 else |
734 | 1599 polygonType = POLYGON_InBetweenFloorAndWall; |
1600 | |
1601 face_plane.vNormal.x = pNormal->x; | |
1602 face_plane.dist = dist; | |
1603 face_plane.vNormal.y = pNormal->y; | |
1604 face_plane.vNormal.z = pNormal->z; | |
0 | 1605 } |
1606 | |
1607 //----- (0049B13D) -------------------------------------------------------- | |
734 | 1608 void stru154::GetFacePlane(ODMFace *pFace, BSPVertexBuffer *pVertices, Vec3_float_ *pOutNormal, float *pOutDist) |
0 | 1609 { |
1610 Vec3_float_ *v19; // eax@3 | |
1611 Vec3_float_ v2; // [sp+4h] [bp-64h]@3 | |
1612 float v26; // [sp+1Ch] [bp-4Ch]@3 | |
1613 float v27; // [sp+20h] [bp-48h]@3 | |
1614 float v28; // [sp+24h] [bp-44h]@3 | |
1615 Vec3_float_ v1; // [sp+40h] [bp-28h]@1 | |
1616 Vec3_float_ v38; // [sp+58h] [bp-10h]@3 | |
734 | 1617 |
0 | 1618 v1.x = 0.0; |
1619 v1.y = 0.0; | |
1620 v1.z = 0.0; | |
734 | 1621 |
1622 if (pFace->uNumVertices >= 2) | |
1623 { | |
2103 | 1624 for ( int i = 0; i < pFace->uNumVertices - 2; i++ ) |
734 | 1625 { |
2103 | 1626 v1.x = pVertices->pVertices[pFace->pVertexIDs[i + 1]].x - pVertices->pVertices[pFace->pVertexIDs[i]].x; |
1627 v1.y = pVertices->pVertices[pFace->pVertexIDs[i + 1]].y - pVertices->pVertices[pFace->pVertexIDs[i]].y; | |
1628 v1.z = pVertices->pVertices[pFace->pVertexIDs[i + 1]].z - pVertices->pVertices[pFace->pVertexIDs[i]].z; | |
1629 | |
1630 v26 = pVertices->pVertices[pFace->pVertexIDs[i + 2]].x - pVertices->pVertices[pFace->pVertexIDs[i + 1]].x; | |
1631 v27 = pVertices->pVertices[pFace->pVertexIDs[i + 2]].y - pVertices->pVertices[pFace->pVertexIDs[i + 1]].y; | |
1632 v28 = pVertices->pVertices[pFace->pVertexIDs[i + 2]].z - pVertices->pVertices[pFace->pVertexIDs[i + 1]].z; | |
1633 | |
0 | 1634 v19 = Vec3_float_::Cross(&v1, &v2, v26, v27, v28); |
1635 v38.x = v19->x; | |
1636 v38.y = v19->y; | |
1637 v38.z = v19->z; | |
734 | 1638 if ( v38.x != 0.0 || v38.y != 0.0 || v38.z != 0.0) |
1639 { | |
1640 v38.Normalize(); | |
1641 | |
1642 pOutNormal->x = v38.x; | |
1643 pOutNormal->y = v38.y; | |
1644 pOutNormal->z = v38.z; | |
1645 | |
2103 | 1646 *pOutDist = -(pVertices->pVertices[pFace->pVertexIDs[i]].x * v38.x |
1647 + pVertices->pVertices[pFace->pVertexIDs[i]].y * v38.y | |
1648 + pVertices->pVertices[pFace->pVertexIDs[i]].z * v38.z); | |
734 | 1649 return; |
1650 } | |
1651 } | |
1652 } | |
1653 | |
2103 | 1654 pOutNormal->x = (double)(pFace->pFacePlane.vNormal.x & 0xFFFF) / 65535.0f + (double)(pFace->pFacePlane.vNormal.x >> 16); |
1655 pOutNormal->y = (double)(pFace->pFacePlane.vNormal.y & 0xFFFF) / 65535.0f + (double)(pFace->pFacePlane.vNormal.y >> 16); | |
1656 pOutNormal->z = (double)(pFace->pFacePlane.vNormal.z & 0xFFFF) / 65535.0f + (double)(pFace->pFacePlane.vNormal.z >> 16); | |
1657 *pOutDist = (double)(pFace->pFacePlane.dist & 0xFFFF) / 65535.0f + (double)(pFace->pFacePlane.dist >> 16); | |
0 | 1658 } |
1659 | |
1660 //----- (0049D700) -------------------------------------------------------- | |
1661 unsigned int __fastcall GetMaxMipLevels(unsigned int uDim) | |
1662 { | |
1663 int v2; // ecx@1 | |
1664 unsigned int v3; // eax@1 | |
1665 | |
1666 v2 = 0; | |
2103 | 1667 v3 = uDim - 1; |
0 | 1668 while ( v3 & 1 ) |
1669 { | |
1670 v3 >>= 1; | |
1671 ++v2; | |
1672 } | |
1673 return v3 == 0 ? v2 : 0; | |
1674 } | |
1675 | |
1676 //----- (004B1447) -------------------------------------------------------- | |
1754 | 1677 void sub_4B1447_party_fine(int a1, int a2, int a3) |
0 | 1678 { |
1679 signed int v3; // esi@1 | |
1680 char v4; // sf@8 | |
1681 int v5; // eax@8 | |
1682 unsigned __int64 v6; // qax@12 | |
1683 DDM_DLV_Header *v7; // eax@14 | |
1684 | |
1685 v3 = 0; | |
1686 if ( a2 ) | |
1687 { | |
1754 | 1688 if ( a2 == 1 ) |
1689 v3 = 2; | |
1690 if ( a2 == 2 ) | |
1691 v3 = 2; | |
2117 | 1692 goto LABEL_13; |
0 | 1693 } |
1694 else | |
1695 v3 = 1; | |
1696 if ( pParty->uFine < 4000000 ) | |
1697 { | |
1698 v4 = a3 + pParty->uFine < 0; | |
1699 v5 = a3 + pParty->uFine; | |
1700 pParty->uFine += a3; | |
1701 if ( v4 ) | |
1702 { | |
1703 v5 = 0; | |
1704 pParty->uFine = 0; | |
1705 } | |
1706 if ( v5 > 4000000 ) | |
1707 pParty->uFine = 4000000; | |
1708 } | |
487 | 1709 |
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
|
1710 pParty->PartyTimes._shop_ban_times[a1] = pParty->uTimePlayed + 368640; |
487 | 1711 |
0 | 1712 LABEL_13: |
463 | 1713 pParty->InTheShopFlags[a1] = 1; |
0 | 1714 if ( v3 ) |
1715 { | |
1716 v7 = &pOutdoor->ddm; | |
1717 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor ) | |
1718 v7 = &pIndoor->dlv; | |
1719 v7->uReputation += v3; | |
1720 if ( v7->uReputation > 10000 ) | |
1721 v7->uReputation = 10000; | |
1722 } | |
1754 | 1723 for ( uint i = 1; i <= 4; ++i ) |
0 | 1724 { |
1725 if ( pParty->uFine ) | |
1726 { | |
1754 | 1727 if ( !_449B57_test_bit(pPlayers[i]->_achieved_awards_bits, 1) ) |
1728 _449B7E_toggle_bit(pPlayers[i]->_achieved_awards_bits, 1, 1); | |
0 | 1729 } |
1730 } | |
1731 } | |
1732 | |
1733 | |
1734 //----- (004B1ECE) -------------------------------------------------------- | |
1459 | 1735 void OracleDialogue() |
0 | 1736 { |
1737 __int16 *v0; // edi@1 | |
1738 int v1; // ebx@3 | |
1739 Player *v2; // esi@3 | |
1740 int v3; // eax@4 | |
1741 signed int v4; // eax@9 | |
1742 int v5; // ebx@11 | |
89 | 1743 Player *v6; // esi@13 |
1744 ItemGen *v7; // eax@14 | |
0 | 1745 signed int v8; // edi@14 |
89 | 1746 ItemGen *v9; // [sp+Ch] [bp-Ch]@11 |
0 | 1747 signed int v10; // [sp+10h] [bp-8h]@13 |
1748 int v11; // [sp+14h] [bp-4h]@1 | |
89 | 1749 Player *v12; // [sp+14h] [bp-4h]@11 |
0 | 1750 |
484 | 1751 contract_approved = 0; |
0 | 1752 v11 = 0; |
1753 uDialogueType = 84; | |
827 | 1754 current_npc_text = (char *)pNPCTopics[667].pText; |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
1755 v0 = _4F0882_evt_VAR_PlayerItemInHands_vals.data(); |
2102 | 1756 //while ( 1 ) |
1757 for ( uint i = 0; i <= 53; i++ ) | |
0 | 1758 { |
484 | 1759 if ( (unsigned __int16)_449B57_test_bit(pParty->_quest_bits, *v0) ) |
0 | 1760 { |
2102 | 1761 //v1 = 0; |
1762 //v2 = pParty->pPlayers.data(); | |
1763 for ( uint pl = 0; pl < 4; pl++ ) | |
0 | 1764 { |
2102 | 1765 //LOBYTE(v3) = pParty->pPlayers[pl].CompareVariable(VAR_PlayerItemInHands, *(v0+1)); |
1766 if ( pParty->pPlayers[pl].CompareVariable(VAR_PlayerItemInHands, *(v0+1)) ) | |
0 | 1767 break; |
2102 | 1768 //++v2; |
1769 //++v1; | |
0 | 1770 } |
2102 | 1771 //while ( (signed int)v2 < (signed int)pParty->pHirelings.data() ); |
1772 //if ( v1 == 4 ) | |
1773 //break; | |
0 | 1774 } |
1775 ++v11; | |
2102 | 1776 //v0 += 2; |
1777 //if ( v0 > &_4F0882_evt_VAR_PlayerItemInHands_vals[53] ) | |
1778 //break; | |
89 | 1779 } |
1780 if ( v0 <= &_4F0882_evt_VAR_PlayerItemInHands_vals[53] ) | |
1781 { | |
827 | 1782 current_npc_text = (char *)pNPCTopics[666].pText; // Here's %s that you lost. Be careful |
89 | 1783 v4 = _4F0882_evt_VAR_PlayerItemInHands_vals[2 * v11]; |
484 | 1784 contract_approved = _4F0882_evt_VAR_PlayerItemInHands_vals[2 * v11]; |
89 | 1785 pParty->pPlayers[0].AddVariable(VAR_PlayerItemInHands, v4); |
1786 } | |
484 | 1787 if ( contract_approved == 601 ) |
0 | 1788 { |
1789 v5 = 0; | |
2102 | 1790 //v12 = pParty->pPlayers.data();//[0].uClass; |
0 | 1791 v9 = 0; |
2102 | 1792 //while ( 1 ) |
1793 for ( uint i = 0; i < 4; i++ ) | |
0 | 1794 { |
2102 | 1795 if ( pParty->pPlayers[i].classType == PLAYER_CLASS_LICH ) |
0 | 1796 { |
1797 v10 = 0; | |
2102 | 1798 //v6 = pParty->pPlayers.data();//[0].pInventoryItems[0].field_1A; |
1799 for ( uint pl = 0; pl < 4; pl++ ) | |
0 | 1800 { |
2102 | 1801 for ( v8 = 0; v8 < 126; v8++ )//138 |
0 | 1802 { |
2102 | 1803 if ( pParty->pPlayers[pl].pInventoryItemList[v8].uItemID == ITEM_LICH_JAR_FULL ) |
0 | 1804 { |
2102 | 1805 if ( !pParty->pPlayers[pl].pInventoryItemList[v8].uHolderPlayer ) |
1806 v9 = &pParty->pPlayers[pl].pInventoryItemList[v8]; | |
1807 if ( pParty->pPlayers[pl].pInventoryItemList[v8].uHolderPlayer == v5 ) | |
0 | 1808 v10 = 1; |
1809 } | |
1810 } | |
89 | 1811 } |
0 | 1812 if ( !v10 ) |
1813 break; | |
1814 } | |
2102 | 1815 // ++v12; |
0 | 1816 ++v5; |
2102 | 1817 // if ( v12 > &pParty->pPlayers[3] ) |
1818 // return; | |
0 | 1819 } |
1820 if ( v9 ) | |
377 | 1821 v9->uHolderPlayer = v5; |
0 | 1822 } |
1823 } | |
1824 | |
1825 //----- (004B254D) -------------------------------------------------------- | |
2239
699bd6ee5ad0
dword_F8B1B0 to dword_F8B1B0_MasteryBeingTaught, some final touches to _4B254D_SkillMasteryTeacher
Grumpy7
parents:
2238
diff
changeset
|
1826 const char * _4B254D_SkillMasteryTeacher(int trainerInfo) |
0 | 1827 { |
2238 | 1828 int teacherLevel; // edx@1 |
1829 int skillBeingTaught; // ecx@1 | |
955 | 1830 int pClassType; // eax@7 |
2238 | 1831 int currClassMaxMastery; // eax@7 |
2237
d903816e972e
_4B254D_SkillMasteryTeacher adding case, removing nested ifs, adding some comments
Grumpy7
parents:
2236
diff
changeset
|
1832 int pointsInSkillWOutMastery; // ebx@7 |
d903816e972e
_4B254D_SkillMasteryTeacher adding case, removing nested ifs, adding some comments
Grumpy7
parents:
2236
diff
changeset
|
1833 int classBaseId; // eax@8 |
d903816e972e
_4B254D_SkillMasteryTeacher adding case, removing nested ifs, adding some comments
Grumpy7
parents:
2236
diff
changeset
|
1834 unsigned int skillMastery; // eax@29 |
d903816e972e
_4B254D_SkillMasteryTeacher adding case, removing nested ifs, adding some comments
Grumpy7
parents:
2236
diff
changeset
|
1835 unsigned __int16 pointsInSkill; // [sp+1Ch] [bp-10h]@7 |
2238 | 1836 int masteryLevelBeingTaught; // [sp+24h] [bp-8h]@7 |
0 | 1837 |
484 | 1838 contract_approved = 0; |
2239
699bd6ee5ad0
dword_F8B1B0 to dword_F8B1B0_MasteryBeingTaught, some final touches to _4B254D_SkillMasteryTeacher
Grumpy7
parents:
2238
diff
changeset
|
1839 teacherLevel = (trainerInfo - 200) % 3; |
699bd6ee5ad0
dword_F8B1B0 to dword_F8B1B0_MasteryBeingTaught, some final touches to _4B254D_SkillMasteryTeacher
Grumpy7
parents:
2238
diff
changeset
|
1840 skillBeingTaught = (trainerInfo - 200) / 3; |
699bd6ee5ad0
dword_F8B1B0 to dword_F8B1B0_MasteryBeingTaught, some final touches to _4B254D_SkillMasteryTeacher
Grumpy7
parents:
2238
diff
changeset
|
1841 Player* activePlayer = pPlayers[uActiveCharacter]; |
699bd6ee5ad0
dword_F8B1B0 to dword_F8B1B0_MasteryBeingTaught, some final touches to _4B254D_SkillMasteryTeacher
Grumpy7
parents:
2238
diff
changeset
|
1842 pClassType = activePlayer->classType; |
2238 | 1843 currClassMaxMastery = byte_4ED970_skill_learn_ability_by_class_table[pClassType][skillBeingTaught]; |
1844 masteryLevelBeingTaught = teacherLevel + 2; | |
2239
699bd6ee5ad0
dword_F8B1B0 to dword_F8B1B0_MasteryBeingTaught, some final touches to _4B254D_SkillMasteryTeacher
Grumpy7
parents:
2238
diff
changeset
|
1845 dword_F8B1B0_MasteryBeingTaught = masteryLevelBeingTaught; |
2238 | 1846 if ( currClassMaxMastery < masteryLevelBeingTaught ) |
0 | 1847 { |
2237
d903816e972e
_4B254D_SkillMasteryTeacher adding case, removing nested ifs, adding some comments
Grumpy7
parents:
2236
diff
changeset
|
1848 classBaseId = pClassType - pClassType % 4; |
2238 | 1849 if (byte_4ED970_skill_learn_ability_by_class_table[classBaseId + 1][skillBeingTaught] >= masteryLevelBeingTaught) |
2237
d903816e972e
_4B254D_SkillMasteryTeacher adding case, removing nested ifs, adding some comments
Grumpy7
parents:
2236
diff
changeset
|
1850 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[633], pClassNames[classBaseId + 1]);//Âû äîëæíû äîñòè÷ü çâàíèÿ %s äëÿ îáó÷åíèÿ ýòîìó óðîâíþ íàâûêà. You have to be promoted to %s to learn this skill level. |
2238 | 1851 else if (byte_4ED970_skill_learn_ability_by_class_table[classBaseId + 2][skillBeingTaught] >= masteryLevelBeingTaught |
1852 && byte_4ED970_skill_learn_ability_by_class_table[classBaseId + 3][skillBeingTaught] >= masteryLevelBeingTaught) | |
2237
d903816e972e
_4B254D_SkillMasteryTeacher adding case, removing nested ifs, adding some comments
Grumpy7
parents:
2236
diff
changeset
|
1853 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[634], pClassNames[classBaseId + 2], pClassNames[classBaseId + 3]);//Âû äîëæíû äîñòè÷ü çâàíèÿ %s èëè %s äëÿ îáó÷åíèÿ ýòîìó óðîâíþ íàâûêà. You have to be promoted to %s or %s to learn this skill level. |
2238 | 1854 else if (byte_4ED970_skill_learn_ability_by_class_table[classBaseId + 2][skillBeingTaught] >= masteryLevelBeingTaught) |
2237
d903816e972e
_4B254D_SkillMasteryTeacher adding case, removing nested ifs, adding some comments
Grumpy7
parents:
2236
diff
changeset
|
1855 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[633], pClassNames[classBaseId + 2]);//Âû äîëæíû äîñòè÷ü çâàíèÿ %s äëÿ îáó÷åíèÿ ýòîìó óðîâíþ íàâûêà. You have to be promoted to %s to learn this skill level. |
2238 | 1856 else if (byte_4ED970_skill_learn_ability_by_class_table[classBaseId + 3][skillBeingTaught] >= masteryLevelBeingTaught) |
2237
d903816e972e
_4B254D_SkillMasteryTeacher adding case, removing nested ifs, adding some comments
Grumpy7
parents:
2236
diff
changeset
|
1857 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[633], pClassNames[classBaseId + 3]);//Âû äîëæíû äîñòè÷ü çâàíèÿ %s äëÿ îáó÷åíèÿ ýòîìó óðîâíþ íàâûêà. You have to be promoted to %s to learn this skill level. |
0 | 1858 else |
2237
d903816e972e
_4B254D_SkillMasteryTeacher adding case, removing nested ifs, adding some comments
Grumpy7
parents:
2236
diff
changeset
|
1859 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[632], pClassNames[pClassType]);//Ýòîò óðîâåíü íàâûêà íå ìîæåò áûòü ïîñòèãíóò êëàññîì %s. This skill level can not be learned by the %s class. |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
1860 return pTmpBuf.data(); |
0 | 1861 } |
2239
699bd6ee5ad0
dword_F8B1B0 to dword_F8B1B0_MasteryBeingTaught, some final touches to _4B254D_SkillMasteryTeacher
Grumpy7
parents:
2238
diff
changeset
|
1862 if ( !activePlayer->CanAct() ) |
2237
d903816e972e
_4B254D_SkillMasteryTeacher adding case, removing nested ifs, adding some comments
Grumpy7
parents:
2236
diff
changeset
|
1863 return pNPCTopics[122].pText; //Not in your condition! |
2239
699bd6ee5ad0
dword_F8B1B0 to dword_F8B1B0_MasteryBeingTaught, some final touches to _4B254D_SkillMasteryTeacher
Grumpy7
parents:
2238
diff
changeset
|
1864 pointsInSkill = activePlayer->pActiveSkills[skillBeingTaught]; |
2237
d903816e972e
_4B254D_SkillMasteryTeacher adding case, removing nested ifs, adding some comments
Grumpy7
parents:
2236
diff
changeset
|
1865 pointsInSkillWOutMastery = pointsInSkill & 0x3F; |
d903816e972e
_4B254D_SkillMasteryTeacher adding case, removing nested ifs, adding some comments
Grumpy7
parents:
2236
diff
changeset
|
1866 if ( !pointsInSkillWOutMastery ) |
d903816e972e
_4B254D_SkillMasteryTeacher adding case, removing nested ifs, adding some comments
Grumpy7
parents:
2236
diff
changeset
|
1867 return pNPCTopics[131].pText; //You must know the skill before you can become an expert in it! |
d903816e972e
_4B254D_SkillMasteryTeacher adding case, removing nested ifs, adding some comments
Grumpy7
parents:
2236
diff
changeset
|
1868 skillMastery = SkillToMastery(pointsInSkill); |
2238 | 1869 if ( (signed int)skillMastery > teacherLevel + 1 ) |
1870 return pNPCTopics[teacherLevel + 128].pText; // You are already an SKILLLEVEL in this skill. | |
1871 dword_F8B1AC_award_bit_number = skillBeingTaught; | |
1872 if ( masteryLevelBeingTaught == 2 && pointsInSkillWOutMastery < 4 | |
1873 || masteryLevelBeingTaught == 3 && pointsInSkillWOutMastery < 7 | |
1874 || masteryLevelBeingTaught == 4 && pointsInSkillWOutMastery < 10 | |
1875 ) | |
1876 return pNPCTopics[127].pText; //"You don't meet the requirements, and cannot be taught until you do." | |
1877 switch (dword_F8B1AC_award_bit_number) | |
0 | 1878 { |
2238 | 1879 case PLAYER_SKILL_STAFF: |
1880 case PLAYER_SKILL_SWORD: | |
1881 case PLAYER_SKILL_DAGGER: | |
1882 case PLAYER_SKILL_AXE: | |
1883 case PLAYER_SKILL_SPEAR: | |
1884 case PLAYER_SKILL_BOW: | |
1885 case PLAYER_SKILL_MACE: | |
2240
1fc4223bddf6
dword_F8B1B0_MasteryBeingTaught removing redundant case bodies
Grumpy7
parents:
2239
diff
changeset
|
1886 case PLAYER_SKILL_ARMSMASTER: |
2238 | 1887 switch (masteryLevelBeingTaught) |
1888 { | |
1889 case 2: | |
1890 gold_transaction_amount = 2000; | |
1891 break; | |
1892 case 3: | |
1893 gold_transaction_amount = 5000; | |
1894 break; | |
1895 case 4: | |
1896 gold_transaction_amount = 8000; | |
1897 break; | |
1898 } | |
1899 break; | |
1900 case PLAYER_SKILL_BLASTER: | |
1901 switch (masteryLevelBeingTaught) | |
1902 { | |
1903 case 2: | |
1904 gold_transaction_amount = 0; | |
1905 break; | |
1906 case 3: | |
1907 gold_transaction_amount = 0; | |
1908 break; | |
1909 case 4: | |
1910 gold_transaction_amount = 0; | |
1911 break; | |
1912 } | |
1913 break; | |
1914 case PLAYER_SKILL_SHIELD: | |
1915 case PLAYER_SKILL_LEATHER: | |
1916 case PLAYER_SKILL_CHAIN: | |
1917 case PLAYER_SKILL_PLATE: | |
1918 switch (masteryLevelBeingTaught) | |
1919 { | |
1920 case 2: | |
1921 gold_transaction_amount = 1000; | |
1922 break; | |
1923 case 3: | |
1924 gold_transaction_amount = 3000; | |
1925 break; | |
1926 case 4: | |
1927 gold_transaction_amount = 7000; | |
1928 break; | |
1929 } | |
1930 break; | |
1931 case PLAYER_SKILL_FIRE: | |
1932 case PLAYER_SKILL_AIR: | |
1933 case PLAYER_SKILL_WATER: | |
1934 case PLAYER_SKILL_EARTH: | |
1935 case PLAYER_SKILL_SPIRIT: | |
1936 case PLAYER_SKILL_MIND: | |
1937 case PLAYER_SKILL_BODY: | |
1938 switch (masteryLevelBeingTaught) | |
0 | 1939 { |
2238 | 1940 case 2: |
1941 gold_transaction_amount = 1000; | |
1942 break; | |
1943 case 3: | |
1944 gold_transaction_amount = 4000; | |
1945 break; | |
1946 case 4: | |
1947 gold_transaction_amount = 8000; | |
1948 break; | |
1949 } | |
1950 break; | |
1951 case PLAYER_SKILL_LIGHT: | |
1952 switch (masteryLevelBeingTaught) | |
1953 { | |
1954 case 2: | |
1955 gold_transaction_amount = 2000; | |
1956 break; | |
1957 case 3: | |
1958 if ( !(unsigned __int16)_449B57_test_bit(pParty->_quest_bits, 114) ) | |
1959 return pNPCTopics[127].pText; | |
1960 gold_transaction_amount = 5000; | |
1961 break; | |
1962 case 4: | |
2239
699bd6ee5ad0
dword_F8B1B0 to dword_F8B1B0_MasteryBeingTaught, some final touches to _4B254D_SkillMasteryTeacher
Grumpy7
parents:
2238
diff
changeset
|
1963 if ( !activePlayer->ProfessionOrGuildFlagsCorrect(0x22u, 1) || |
699bd6ee5ad0
dword_F8B1B0 to dword_F8B1B0_MasteryBeingTaught, some final touches to _4B254D_SkillMasteryTeacher
Grumpy7
parents:
2238
diff
changeset
|
1964 !activePlayer->ProfessionOrGuildFlagsCorrect(0x1Au, 1)) |
2238 | 1965 return pNPCTopics[127].pText; |
1966 gold_transaction_amount = 8000; | |
1967 break; | |
1968 } | |
1969 break; | |
1970 case PLAYER_SKILL_DARK: | |
1971 switch (masteryLevelBeingTaught) | |
1972 { | |
1973 case 2: | |
1974 gold_transaction_amount = 2000; | |
1975 break; | |
1976 case 3: | |
1977 if ( !(unsigned __int16)_449B57_test_bit(pParty->_quest_bits, 110) ) | |
1978 return pNPCTopics[127].pText; | |
1979 gold_transaction_amount = 5000; | |
1980 break; | |
1981 case 4: | |
2239
699bd6ee5ad0
dword_F8B1B0 to dword_F8B1B0_MasteryBeingTaught, some final touches to _4B254D_SkillMasteryTeacher
Grumpy7
parents:
2238
diff
changeset
|
1982 if ( !activePlayer->ProfessionOrGuildFlagsCorrect(0x23u, 1) |
699bd6ee5ad0
dword_F8B1B0 to dword_F8B1B0_MasteryBeingTaught, some final touches to _4B254D_SkillMasteryTeacher
Grumpy7
parents:
2238
diff
changeset
|
1983 || !activePlayer->ProfessionOrGuildFlagsCorrect(0x1Bu, 1)) |
2238 | 1984 return pNPCTopics[127].pText; |
1985 gold_transaction_amount = 8000; | |
1986 break; | |
1987 } | |
1988 break; | |
1989 case PLAYER_SKILL_ITEM_ID: | |
2240
1fc4223bddf6
dword_F8B1B0_MasteryBeingTaught removing redundant case bodies
Grumpy7
parents:
2239
diff
changeset
|
1990 case PLAYER_SKILL_REPAIR: |
1fc4223bddf6
dword_F8B1B0_MasteryBeingTaught removing redundant case bodies
Grumpy7
parents:
2239
diff
changeset
|
1991 case PLAYER_SKILL_MEDITATION: |
1fc4223bddf6
dword_F8B1B0_MasteryBeingTaught removing redundant case bodies
Grumpy7
parents:
2239
diff
changeset
|
1992 case PLAYER_SKILL_PERCEPTION: |
1fc4223bddf6
dword_F8B1B0_MasteryBeingTaught removing redundant case bodies
Grumpy7
parents:
2239
diff
changeset
|
1993 case PLAYER_SKILL_TRAP_DISARM: |
1fc4223bddf6
dword_F8B1B0_MasteryBeingTaught removing redundant case bodies
Grumpy7
parents:
2239
diff
changeset
|
1994 case PLAYER_SKILL_MONSTER_ID: |
1fc4223bddf6
dword_F8B1B0_MasteryBeingTaught removing redundant case bodies
Grumpy7
parents:
2239
diff
changeset
|
1995 case PLAYER_SKILL_STEALING: |
1fc4223bddf6
dword_F8B1B0_MasteryBeingTaught removing redundant case bodies
Grumpy7
parents:
2239
diff
changeset
|
1996 case PLAYER_SKILL_ALCHEMY: |
2238 | 1997 switch (masteryLevelBeingTaught) |
1998 { | |
1999 case 2: | |
2000 gold_transaction_amount = 500; | |
2001 break; | |
2002 case 3: | |
2003 gold_transaction_amount = 2500; | |
2004 break; | |
2005 case 4: | |
2006 gold_transaction_amount = 6000; | |
2007 break; | |
2008 } | |
2009 break; | |
2010 case PLAYER_SKILL_MERCHANT: | |
2011 switch (masteryLevelBeingTaught) | |
2012 { | |
2013 case 2: | |
2014 gold_transaction_amount = 2000; | |
2015 break; | |
2016 case 3: | |
2239
699bd6ee5ad0
dword_F8B1B0 to dword_F8B1B0_MasteryBeingTaught, some final touches to _4B254D_SkillMasteryTeacher
Grumpy7
parents:
2238
diff
changeset
|
2017 if ( activePlayer->GetBaseWillpower() < 50 ) |
2238 | 2018 return pNPCTopics[127].pText; |
2019 gold_transaction_amount = 5000; | |
2020 break; | |
2021 case 4: | |
2022 gold_transaction_amount = 8000; | |
2023 break; | |
2024 } | |
2025 break; | |
2026 case PLAYER_SKILL_BODYBUILDING: | |
2027 switch (masteryLevelBeingTaught) | |
2028 { | |
2029 case 2: | |
2030 gold_transaction_amount = 500; | |
2031 break; | |
2032 case 3: | |
2239
699bd6ee5ad0
dword_F8B1B0 to dword_F8B1B0_MasteryBeingTaught, some final touches to _4B254D_SkillMasteryTeacher
Grumpy7
parents:
2238
diff
changeset
|
2033 if ( activePlayer->GetBaseEndurance() < 50 ) |
2238 | 2034 return pNPCTopics[127].pText; |
2035 gold_transaction_amount = 2500; | |
2036 break; | |
2037 case 4: | |
2038 gold_transaction_amount = 6000; | |
2039 break; | |
2040 } | |
2041 break; | |
2042 case PLAYER_SKILL_DIPLOMACY: | |
2043 Error("Diplomacy not used"); | |
2044 break; | |
2045 case PLAYER_SKILL_TIEVERY: | |
2046 Error("Thievery not used"); | |
2047 break; | |
2048 case PLAYER_SKILL_DODGE: | |
2049 switch (masteryLevelBeingTaught) | |
2050 { | |
2051 case 2: | |
2052 gold_transaction_amount = 2000; | |
2053 break; | |
2054 case 3: | |
2055 gold_transaction_amount = 5000; | |
2056 break; | |
2057 case 4: | |
2239
699bd6ee5ad0
dword_F8B1B0 to dword_F8B1B0_MasteryBeingTaught, some final touches to _4B254D_SkillMasteryTeacher
Grumpy7
parents:
2238
diff
changeset
|
2058 if ( (activePlayer->pActiveSkills[PLAYER_SKILL_UNARMED] & 63) < 0xA ) |
2238 | 2059 return pNPCTopics[127].pText; |
2060 gold_transaction_amount = 8000; | |
2061 break; | |
2062 } | |
2063 break; | |
2064 case PLAYER_SKILL_UNARMED: | |
2065 switch (masteryLevelBeingTaught) | |
2066 { | |
2067 case 2: | |
2068 gold_transaction_amount = 2000; | |
2069 break; | |
2070 case 3: | |
2071 gold_transaction_amount = 5000; | |
2072 break; | |
2073 case 4: | |
2239
699bd6ee5ad0
dword_F8B1B0 to dword_F8B1B0_MasteryBeingTaught, some final touches to _4B254D_SkillMasteryTeacher
Grumpy7
parents:
2238
diff
changeset
|
2074 if ( (activePlayer->pActiveSkills[PLAYER_SKILL_DODGE] & 63) < 0xA ) |
2238 | 2075 return pNPCTopics[127].pText; |
2076 gold_transaction_amount = 8000; | |
2077 break; | |
2078 } | |
2079 break; | |
2080 case PLAYER_SKILL_LEARNING: | |
2081 switch (masteryLevelBeingTaught) | |
2082 { | |
2083 case 2: | |
2084 gold_transaction_amount = 2000; | |
2085 break; | |
2086 case 3: | |
2239
699bd6ee5ad0
dword_F8B1B0 to dword_F8B1B0_MasteryBeingTaught, some final touches to _4B254D_SkillMasteryTeacher
Grumpy7
parents:
2238
diff
changeset
|
2087 if ( activePlayer->GetBaseIntelligence() < 50 ) |
2238 | 2088 return pNPCTopics[127].pText; |
2089 gold_transaction_amount = 5000; | |
2090 break; | |
2091 case 4: | |
2092 gold_transaction_amount = 8000; | |
2093 break; | |
2094 } | |
2095 break; | |
2096 default: | |
2097 Error("Unknown skill"); | |
955 | 2098 } |
267 | 2099 if ( gold_transaction_amount > pParty->uNumGold ) |
2238 | 2100 return pNPCTopics[124].pText; //You don't have enough gold! |
484 | 2101 contract_approved = 1; |
2238 | 2102 if ( masteryLevelBeingTaught == 2 ) |
0 | 2103 { |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
2104 sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[534],//Ïîëó÷èòü ñòåïåíü ^Pr[%s] â íàâûêå ^Pr[%s] çà ^I[%lu] çîëîò^L[îé;ûõ;ûõ] |
955 | 2105 pGlobalTXT_LocalizationStrings[433], pSkillNames[dword_F8B1AC_award_bit_number], gold_transaction_amount);//Ýêñïåðò |
0 | 2106 } |
2238 | 2107 if ( masteryLevelBeingTaught == 3 ) |
0 | 2108 { |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
2109 sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[534], |
955 | 2110 pGlobalTXT_LocalizationStrings[432], pSkillNames[dword_F8B1AC_award_bit_number], gold_transaction_amount);//Ìàñòåð |
0 | 2111 } |
2238 | 2112 if ( masteryLevelBeingTaught == 4 ) |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
2113 sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[534], |
955 | 2114 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
|
2115 return pTmpBuf2.data(); |
0 | 2116 } |
2117 | |
2118 //----- (004B3E1E) -------------------------------------------------------- | |
1458 | 2119 void sub_4B3E1E() |
0 | 2120 { |
2121 NPCData *v0; // ST40_4@1 | |
2122 signed int v1; // edi@1 | |
165 | 2123 //GUIWindow *v2; // ecx@1 |
0 | 2124 |
167 | 2125 __debugbreak(); |
602 | 2126 v0 = GetNPCData(sDialogue_SpeakingActorNPC_ID); |
0 | 2127 v1 = 0; |
2128 pDialogueWindow->eWindowType = WINDOW_MainMenu; | |
2129 pDialogueWindow->Release(); | |
2215
e9625ad08541
fog fix and change 640,480 - window->GetWidth(), window->GetHeight()
Ritor1
parents:
2197
diff
changeset
|
2130 pDialogueWindow = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_Dialogue, 1, 0); |
291 | 2131 if ( pNPCStats->pProfessions[v0->uProfession].pBenefits)//*(&pNPCStats->field_13A5C + 5 * v0->uProfession) ) |
0 | 2132 { |
832 | 2133 pDialogueWindow->CreateButton(480, 160, 140, 28, 1, 0, UIMSG_SelectNPCDialogueOption, 77, 0, pGlobalTXT_LocalizationStrings[407], 0); |
0 | 2134 v1 = 1; |
2135 } | |
832 | 2136 pDialogueWindow->CreateButton(480, 30 * v1 + 160, 140, 30, 1, 0, UIMSG_SelectNPCDialogueOption, 76, 0, pGlobalTXT_LocalizationStrings[406], 0);//Íàíÿòü |
972 | 2137 pDialogueWindow->_41D08F_set_keyboard_control_group(v1 + 1, 1, 0, 1); |
0 | 2138 } |
2139 | |
2140 | |
2141 //----- (004B3FE5) -------------------------------------------------------- | |
2240
1fc4223bddf6
dword_F8B1B0_MasteryBeingTaught removing redundant case bodies
Grumpy7
parents:
2239
diff
changeset
|
2142 void _4B3FE5_training_dialogue(int a4) |
0 | 2143 { |
1838 | 2144 const char *v2; // edi@1 |
2102 | 2145 |
2245 | 2146 //__debugbreak(); |
2240
1fc4223bddf6
dword_F8B1B0_MasteryBeingTaught removing redundant case bodies
Grumpy7
parents:
2239
diff
changeset
|
2147 uDialogueType = DIALOGUE_SKILL_TRAINER; |
827 | 2148 current_npc_text = (char *)pNPCTopics[a4 + 168].pText; |
2241 | 2149 _4B254D_SkillMasteryTeacher(a4); //might be needed because of contract_approved ? |
0 | 2150 pDialogueWindow->Release(); |
2215
e9625ad08541
fog fix and change 640,480 - window->GetWidth(), window->GetHeight()
Ritor1
parents:
2197
diff
changeset
|
2151 pDialogueWindow = GUIWindow::Create(0, 0, window->GetWidth(), 350, WINDOW_MainMenu, a4, 0); |
2102 | 2152 pBtn_ExitCancel = pDialogueWindow->CreateButton( 471, 445, 169, 35, 1, 0, UIMSG_Escape, 0, 0, |
948 | 2153 pGlobalTXT_LocalizationStrings[34], pIcons_LOD->GetTexture(uExitCancelTextureId), 0); |
832 | 2154 pDialogueWindow->CreateButton(0, 0, 0, 0, 1, 0, UIMSG_BuyInShop_Identify_Repair, 0, 0, "", 0); |
2102 | 2155 v2 = ""; |
484 | 2156 if ( contract_approved ) |
0 | 2157 v2 = pGlobalTXT_LocalizationStrings[535]; |
2245 | 2158 pDialogueWindow->CreateButton(480, 160, 0x8Cu, 0x1Eu, 1, 0, UIMSG_ClickNPCTopic, 0x4Fu, 0, v2, 0); |
972 | 2159 pDialogueWindow->_41D08F_set_keyboard_control_group(1, 1, 0, 2); |
747 | 2160 dialog_menu_id = HOUSE_DIALOGUE_OTHER; |
0 | 2161 } |
2162 // F8B19C: using guessed type int dword_F8B19C; | |
2163 // F8B1A8: using guessed type int dword_F8B1A8; | |
2164 | |
2165 //----- (004B46A5) -------------------------------------------------------- | |
1006 | 2166 void __fastcall DrawTextAtStatusBar( const char *Str, int a5 ) |
1411 | 2167 { |
471
c43f156a95c9
ArmorShopDialog crash fixed. All shops show its items
Gloval
parents:
470
diff
changeset
|
2168 pRenderer->DrawTextureRGB(0, 352, pTexture_StatusBar); |
2102 | 2169 pPrimaryWindow->DrawText(pFontLucida, pFontLucida->AlignText_Center(450, Str) + 11, 357, a5, Str, 0, 0, 0); |
0 | 2170 } |
2171 | |
2172 //----- (004B46F8) -------------------------------------------------------- | |
1459 | 2173 __int64 GetExperienceRequiredForLevel(int level) |
0 | 2174 { |
1459 | 2175 __int64 v1; // eax@1 |
0 | 2176 int i; // edx@1 |
2177 | |
2178 v1 = 0; | |
1459 | 2179 for ( i = 0; i < level; ++i ) |
0 | 2180 v1 += i + 1; |
2181 return 1000 * v1; | |
2182 } | |
2183 | |
2184 //----- (004BC49B) -------------------------------------------------------- | |
651 | 2185 void OnSelectNPCDialogueOption(DIALOGUE_TYPE newDialogueType) |
652 | 2186 { |
2102 | 2187 NPCData *speakingNPC; // ebp@1 |
2188 int npc_event_id; // ecx@10 | |
2189 char *v13; // [sp-8h] [bp-18h]@60 | |
656 | 2190 |
2102 | 2191 speakingNPC = GetNPCData(sDialogue_SpeakingActorNPC_ID); |
2192 uDialogueType = newDialogueType; | |
2193 if (!speakingNPC->uFlags) | |
2194 speakingNPC->uFlags = 1; | |
2195 if(newDialogueType == DIALOGUE_PROFESSION_DETAILS) | |
2196 dialogue_show_profession_details = ~dialogue_show_profession_details; | |
2197 else if(newDialogueType == DIALOGUE_76) | |
2198 { | |
2199 if (speakingNPC->Hired()) | |
2200 { | |
2201 if ( (signed int)pNPCStats->uNumNewNPCs > 0 ) | |
2202 { | |
2203 for ( uint i = 0; i < (unsigned int)pNPCStats->uNumNewNPCs; ++i ) | |
2204 { | |
2205 if ( pNPCStats->pNewNPCData[i].uFlags & 0x80 && !strcmp(speakingNPC->pName, pNPCStats->pNewNPCData[i].pName) ) | |
2206 pNPCStats->pNewNPCData[i].uFlags &= 0x7Fu; | |
2207 } | |
2208 } | |
2209 if ( pParty->pHirelings[0].pName && !_stricmp(pParty->pHirelings[0].pName, speakingNPC->pName) ) | |
2210 memset(&pParty->pHirelings[0], 0, sizeof(NPCData)); | |
2211 else if ( pParty->pHirelings[1].pName && !_stricmp(pParty->pHirelings[1].pName, speakingNPC->pName) ) | |
2212 memset(&pParty->pHirelings[1], 0, sizeof(NPCData)); | |
2213 pParty->hirelingScrollPosition = 0; | |
2214 pParty->CountHirelings(); | |
2215 dword_591084 = 0; | |
2216 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0); | |
2217 dword_7241C8 = 0; | |
2218 return; | |
2219 } | |
2220 if ( pParty->pHirelings[0].pName && pParty->pHirelings[1].pName ) | |
2221 ShowStatusBarString(pGlobalTXT_LocalizationStrings[533], 2);// ""I cannot join you, you're party is full"" | |
2222 else | |
2223 { | |
2115 | 2224 if ( speakingNPC->uProfession != 51 ) //burglars have no hiring price |
2102 | 2225 { |
2115 | 2226 if ( pParty->uNumGold < pNPCStats->pProfessions[speakingNPC->uProfession].uHirePrice ) |
2102 | 2227 { |
2228 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2);// "You don't have enough gold" | |
2229 dialogue_show_profession_details = false; | |
2230 uDialogueType = 13; | |
2231 if ( uActiveCharacter ) | |
2232 pPlayers[uActiveCharacter]->PlaySound(SPEECH_NotEnoughGold, 0); | |
2233 if ( !dword_7241C8 ) | |
2234 pGame->Draw(); | |
2235 dword_7241C8 = 0; | |
2236 return; | |
2237 } | |
2115 | 2238 Party::TakeGold(pNPCStats->pProfessions[speakingNPC->uProfession].uHirePrice); |
2102 | 2239 } |
2240 LOBYTE(speakingNPC->uFlags) |= 0x80u; | |
2241 if ( pParty->pHirelings[0].pName ) | |
2242 { | |
2243 memcpy(&pParty->pHirelings[1], speakingNPC, sizeof(pParty->pHirelings[1])); | |
2244 v13 = pParty->pHireling2Name; | |
2245 } | |
2246 else | |
2247 { | |
2248 memcpy(&pParty->pHirelings[0], speakingNPC, sizeof(pParty->pHirelings[0])); | |
2249 v13 = pParty->pHireling1Name; | |
2250 } | |
2251 strcpy(v13, speakingNPC->pName); | |
2252 pParty->hirelingScrollPosition = 0; | |
2253 pParty->CountHirelings(); | |
2254 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0); | |
2255 if ( sDialogue_SpeakingActorNPC_ID >= 0 ) | |
2256 pDialogue_SpeakingActor->uAIState = Removed; | |
2257 if ( uActiveCharacter ) | |
2258 pPlayers[uActiveCharacter]->PlaySound(SPEECH_61, 0); | |
2259 } | |
2260 } | |
2261 else if ( (signed int)newDialogueType > DIALOGUE_84 && (signed int)newDialogueType <= DIALOGUE_ARENA_SELECT_CHAMPION ) //âûáîð óðîâíÿ ñëîæíîñòè áîÿ | |
2262 { | |
2263 ArenaFight(); | |
2264 return; | |
2265 } | |
2266 else if(newDialogueType == DIALOGUE_USE_NPC_ABILITY) | |
2267 { | |
2268 if (UseNPCSkill((NPCProf)speakingNPC->uProfession) == 0) | |
2269 { | |
2270 if ( speakingNPC->uProfession != GateMaster ) | |
2271 speakingNPC->bHasUsedTheAbility = 1; | |
2272 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0); | |
2273 } | |
2274 else | |
2275 ShowStatusBarString(pGlobalTXT_LocalizationStrings[140], 2); //"Your packs are already full!" | |
2276 } | |
2277 else if(newDialogueType == DIALOGUE_13) | |
2278 { | |
2279 if (!speakingNPC->Hired()) | |
2280 { | |
2281 sub_4B3E1E(); | |
2282 dialogue_show_profession_details = false; | |
2283 } | |
2284 else | |
2285 { | |
2286 for ( uint i = 0; i < (signed int)pNPCStats->uNumNewNPCs; ++i ) | |
2287 { | |
2288 if ( pNPCStats->pNewNPCData[i].uFlags & 0x80 && !strcmp(speakingNPC->pName, pNPCStats->pNewNPCData[i].pName) ) | |
2289 pNPCStats->pNewNPCData[i].uFlags &= 0x7Fu; | |
2290 } | |
2291 if ( pParty->pHirelings[0].pName && !_stricmp(pParty->pHirelings[0].pName, speakingNPC->pName) ) | |
2292 memset(&pParty->pHirelings[0], 0, sizeof(NPCData)); | |
2293 else if ( pParty->pHirelings[1].pName && !_stricmp(pParty->pHirelings[1].pName, speakingNPC->pName) ) | |
2294 memset(&pParty->pHirelings[1], 0, sizeof(NPCData)); | |
2295 pParty->hirelingScrollPosition = 0; | |
2296 pParty->CountHirelings(); | |
2297 dword_591084 = 0; | |
2298 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0); | |
2299 dword_7241C8 = 0; | |
2300 return; | |
2301 } | |
2302 } | |
2303 else if(newDialogueType >= DIALOGUE_EVT_A && newDialogueType <= DIALOGUE_EVT_F) | |
2304 { | |
2305 switch(newDialogueType) | |
2306 { | |
2307 case DIALOGUE_EVT_A: npc_event_id = speakingNPC->evt_A; break; | |
2308 case DIALOGUE_EVT_B: npc_event_id = speakingNPC->evt_B; break; | |
2309 case DIALOGUE_EVT_C: npc_event_id = speakingNPC->evt_C; break; | |
2310 case DIALOGUE_EVT_D: npc_event_id = speakingNPC->evt_D; break; | |
2311 case DIALOGUE_EVT_E: npc_event_id = speakingNPC->evt_E; break; | |
2312 case DIALOGUE_EVT_F: npc_event_id = speakingNPC->evt_F; break; | |
2313 } | |
2314 if ( (npc_event_id >= 200) && (npc_event_id <= 310) ) | |
2315 _4B3FE5_training_dialogue(npc_event_id); //200-310 | |
2316 else if (( npc_event_id >= 400) && (npc_event_id <= 410) ) | |
2317 { //400-410 | |
2318 dword_F8B1D8 = newDialogueType; | |
2319 DrawJoinGuildWindow(npc_event_id - 400); | |
2320 } | |
2321 else | |
2322 { | |
2323 switch ( npc_event_id ) | |
2324 { | |
2325 case 139: | |
2326 OracleDialogue(); | |
2327 break; | |
2328 case 311: | |
2329 CheckBountyRespawnAndAward(); | |
2330 break; | |
2331 case 399: | |
2332 Arena_SelectionFightLevel(); | |
2333 break; | |
2334 default: | |
2335 activeLevelDecoration = (LevelDecoration*)1; | |
2336 current_npc_text = 0; | |
2337 EventProcessor(npc_event_id, 0, 1); | |
2338 activeLevelDecoration = NULL; | |
2339 break; | |
2340 } | |
2341 } | |
2342 } | |
2343 if ( !dword_7241C8 ) | |
2344 pGame->Draw(); | |
2345 dword_7241C8 = 0; | |
656 | 2346 } |
0 | 2347 |
2348 //----- (004BDAAF) -------------------------------------------------------- | |
2059 | 2349 bool MerchandiseTest(ItemGen *item, int _2da_idx) |
0 | 2350 { |
702 | 2351 bool test; |
0 | 2352 |
907 | 2353 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
|
2354 && ((signed int)item->uItemID >= 600 || (signed int)item->uItemID >= 529 && (signed int)item->uItemID <= 599) || item->IsStolen()) |
2059 | 2355 return false; |
907 | 2356 switch( p2DEvents[_2da_idx - 1].uType ) |
2357 { | |
1411 | 2358 case BuildingType_WeaponShop: |
907 | 2359 { |
2059 | 2360 test = item->GetItemEquipType() <= EQUIP_BOW; |
907 | 2361 break; |
2362 } | |
1411 | 2363 case BuildingType_ArmorShop: |
907 | 2364 { |
2059 | 2365 test = item->GetItemEquipType() >= EQUIP_ARMOUR && item->GetItemEquipType() <= EQUIP_BOOTS; |
907 | 2366 break; |
2367 } | |
1411 | 2368 case BuildingType_MagicShop: |
907 | 2369 { |
2059 | 2370 test = item->GetPlayerSkillType() == PLAYER_SKILL_MISC || item->GetItemEquipType() == EQIUP_ANY; |
907 | 2371 break; |
2372 } | |
1411 | 2373 case BuildingType_AlchemistShop: |
907 | 2374 { |
2059 | 2375 test = item->GetItemEquipType() == EQUIP_REAGENT || item->GetItemEquipType() == EQUIP_POTION |
2376 || (item->GetItemEquipType() > EQUIP_POTION && !(item->GetItemEquipType() != EQUIP_MESSAGE_SCROLL | |
907 | 2377 || (signed int)item->uItemID < 740) && item->uItemID != 771); |
2378 break; | |
2379 } | |
2380 default: | |
2381 { | |
2382 test = false; | |
2383 break; | |
2384 } | |
2385 } | |
702 | 2386 return test; |
2235
6ab7d7c112bb
adding int_get_vector_length calls where the calls were inlined
Grumpy7
parents:
2233
diff
changeset
|
2387 } |