Mercurial > mm7
annotate mm7_4.cpp @ 2248:8c5855b842dc
changing shopt stealing condition a bit
author | Grumpy7 |
---|---|
date | Wed, 26 Feb 2014 01:18:42 +0100 |
parents | 529bf95fb0d7 |
children | 708aa31cad56 |
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) -------------------------------------------------------- | |
2246 | 1677 void sub_4B1447_party_fine(int shopId, int stealingResult, int fineToAdd) |
0 | 1678 { |
1679 signed int v3; // esi@1 | |
1680 DDM_DLV_Header *v7; // eax@14 | |
1681 | |
2246 | 1682 if ( stealingResult == 0 || stealingResult == 1) |
0 | 1683 { |
2246 | 1684 if ( pParty->uFine < 4000000 ) |
1685 { | |
1686 if ( fineToAdd + pParty->uFine < 0 ) | |
1687 pParty->uFine = 0; | |
1688 else if ( fineToAdd + pParty->uFine > 4000000 ) | |
1689 pParty->uFine = 4000000; | |
1690 else | |
1691 pParty->uFine += fineToAdd; | |
1692 } | |
1693 if ( pParty->uFine ) | |
1694 { | |
1695 for ( uint i = 1; i <= 4; ++i ) | |
1696 { | |
1697 if ( !_449B57_test_bit(pPlayers[i]->_achieved_awards_bits, 1) ) | |
1698 _449B7E_toggle_bit(pPlayers[i]->_achieved_awards_bits, 1, 1); | |
1699 } | |
1700 } | |
1701 if (stealingResult == 1) | |
1754 | 1702 v3 = 2; |
2246 | 1703 else |
1704 v3 = 1; | |
0 | 1705 } |
1706 else | |
2246 | 1707 v3 = 2; |
1708 pParty->PartyTimes._shop_ban_times[shopId] = pParty->uTimePlayed + 368640; | |
1709 pParty->InTheShopFlags[shopId] = 1; | |
1710 v7 = &pOutdoor->ddm; | |
1711 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor ) | |
1712 v7 = &pIndoor->dlv; | |
1713 v7->uReputation += v3; | |
1714 if ( v7->uReputation > 10000 ) | |
1715 v7->uReputation = 10000; | |
0 | 1716 } |
1717 | |
1718 | |
1719 //----- (004B1ECE) -------------------------------------------------------- | |
1459 | 1720 void OracleDialogue() |
0 | 1721 { |
1722 __int16 *v0; // edi@1 | |
1723 int v1; // ebx@3 | |
1724 Player *v2; // esi@3 | |
1725 int v3; // eax@4 | |
1726 signed int v4; // eax@9 | |
1727 int v5; // ebx@11 | |
89 | 1728 Player *v6; // esi@13 |
1729 ItemGen *v7; // eax@14 | |
0 | 1730 signed int v8; // edi@14 |
89 | 1731 ItemGen *v9; // [sp+Ch] [bp-Ch]@11 |
0 | 1732 signed int v10; // [sp+10h] [bp-8h]@13 |
1733 int v11; // [sp+14h] [bp-4h]@1 | |
89 | 1734 Player *v12; // [sp+14h] [bp-4h]@11 |
0 | 1735 |
484 | 1736 contract_approved = 0; |
0 | 1737 v11 = 0; |
1738 uDialogueType = 84; | |
827 | 1739 current_npc_text = (char *)pNPCTopics[667].pText; |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
1740 v0 = _4F0882_evt_VAR_PlayerItemInHands_vals.data(); |
2102 | 1741 //while ( 1 ) |
1742 for ( uint i = 0; i <= 53; i++ ) | |
0 | 1743 { |
484 | 1744 if ( (unsigned __int16)_449B57_test_bit(pParty->_quest_bits, *v0) ) |
0 | 1745 { |
2102 | 1746 //v1 = 0; |
1747 //v2 = pParty->pPlayers.data(); | |
1748 for ( uint pl = 0; pl < 4; pl++ ) | |
0 | 1749 { |
2102 | 1750 //LOBYTE(v3) = pParty->pPlayers[pl].CompareVariable(VAR_PlayerItemInHands, *(v0+1)); |
1751 if ( pParty->pPlayers[pl].CompareVariable(VAR_PlayerItemInHands, *(v0+1)) ) | |
0 | 1752 break; |
2102 | 1753 //++v2; |
1754 //++v1; | |
0 | 1755 } |
2102 | 1756 //while ( (signed int)v2 < (signed int)pParty->pHirelings.data() ); |
1757 //if ( v1 == 4 ) | |
1758 //break; | |
0 | 1759 } |
1760 ++v11; | |
2102 | 1761 //v0 += 2; |
1762 //if ( v0 > &_4F0882_evt_VAR_PlayerItemInHands_vals[53] ) | |
1763 //break; | |
89 | 1764 } |
1765 if ( v0 <= &_4F0882_evt_VAR_PlayerItemInHands_vals[53] ) | |
1766 { | |
827 | 1767 current_npc_text = (char *)pNPCTopics[666].pText; // Here's %s that you lost. Be careful |
89 | 1768 v4 = _4F0882_evt_VAR_PlayerItemInHands_vals[2 * v11]; |
484 | 1769 contract_approved = _4F0882_evt_VAR_PlayerItemInHands_vals[2 * v11]; |
89 | 1770 pParty->pPlayers[0].AddVariable(VAR_PlayerItemInHands, v4); |
1771 } | |
484 | 1772 if ( contract_approved == 601 ) |
0 | 1773 { |
1774 v5 = 0; | |
2102 | 1775 //v12 = pParty->pPlayers.data();//[0].uClass; |
0 | 1776 v9 = 0; |
2102 | 1777 //while ( 1 ) |
1778 for ( uint i = 0; i < 4; i++ ) | |
0 | 1779 { |
2102 | 1780 if ( pParty->pPlayers[i].classType == PLAYER_CLASS_LICH ) |
0 | 1781 { |
1782 v10 = 0; | |
2102 | 1783 //v6 = pParty->pPlayers.data();//[0].pInventoryItems[0].field_1A; |
1784 for ( uint pl = 0; pl < 4; pl++ ) | |
0 | 1785 { |
2102 | 1786 for ( v8 = 0; v8 < 126; v8++ )//138 |
0 | 1787 { |
2102 | 1788 if ( pParty->pPlayers[pl].pInventoryItemList[v8].uItemID == ITEM_LICH_JAR_FULL ) |
0 | 1789 { |
2102 | 1790 if ( !pParty->pPlayers[pl].pInventoryItemList[v8].uHolderPlayer ) |
1791 v9 = &pParty->pPlayers[pl].pInventoryItemList[v8]; | |
1792 if ( pParty->pPlayers[pl].pInventoryItemList[v8].uHolderPlayer == v5 ) | |
0 | 1793 v10 = 1; |
1794 } | |
1795 } | |
89 | 1796 } |
0 | 1797 if ( !v10 ) |
1798 break; | |
1799 } | |
2102 | 1800 // ++v12; |
0 | 1801 ++v5; |
2102 | 1802 // if ( v12 > &pParty->pPlayers[3] ) |
1803 // return; | |
0 | 1804 } |
1805 if ( v9 ) | |
377 | 1806 v9->uHolderPlayer = v5; |
0 | 1807 } |
1808 } | |
1809 | |
1810 //----- (004B254D) -------------------------------------------------------- | |
2239
699bd6ee5ad0
dword_F8B1B0 to dword_F8B1B0_MasteryBeingTaught, some final touches to _4B254D_SkillMasteryTeacher
Grumpy7
parents:
2238
diff
changeset
|
1811 const char * _4B254D_SkillMasteryTeacher(int trainerInfo) |
0 | 1812 { |
2238 | 1813 int teacherLevel; // edx@1 |
1814 int skillBeingTaught; // ecx@1 | |
955 | 1815 int pClassType; // eax@7 |
2238 | 1816 int currClassMaxMastery; // eax@7 |
2237
d903816e972e
_4B254D_SkillMasteryTeacher adding case, removing nested ifs, adding some comments
Grumpy7
parents:
2236
diff
changeset
|
1817 int pointsInSkillWOutMastery; // ebx@7 |
d903816e972e
_4B254D_SkillMasteryTeacher adding case, removing nested ifs, adding some comments
Grumpy7
parents:
2236
diff
changeset
|
1818 int classBaseId; // eax@8 |
d903816e972e
_4B254D_SkillMasteryTeacher adding case, removing nested ifs, adding some comments
Grumpy7
parents:
2236
diff
changeset
|
1819 unsigned int skillMastery; // eax@29 |
d903816e972e
_4B254D_SkillMasteryTeacher adding case, removing nested ifs, adding some comments
Grumpy7
parents:
2236
diff
changeset
|
1820 unsigned __int16 pointsInSkill; // [sp+1Ch] [bp-10h]@7 |
2238 | 1821 int masteryLevelBeingTaught; // [sp+24h] [bp-8h]@7 |
0 | 1822 |
484 | 1823 contract_approved = 0; |
2239
699bd6ee5ad0
dword_F8B1B0 to dword_F8B1B0_MasteryBeingTaught, some final touches to _4B254D_SkillMasteryTeacher
Grumpy7
parents:
2238
diff
changeset
|
1824 teacherLevel = (trainerInfo - 200) % 3; |
699bd6ee5ad0
dword_F8B1B0 to dword_F8B1B0_MasteryBeingTaught, some final touches to _4B254D_SkillMasteryTeacher
Grumpy7
parents:
2238
diff
changeset
|
1825 skillBeingTaught = (trainerInfo - 200) / 3; |
699bd6ee5ad0
dword_F8B1B0 to dword_F8B1B0_MasteryBeingTaught, some final touches to _4B254D_SkillMasteryTeacher
Grumpy7
parents:
2238
diff
changeset
|
1826 Player* activePlayer = pPlayers[uActiveCharacter]; |
699bd6ee5ad0
dword_F8B1B0 to dword_F8B1B0_MasteryBeingTaught, some final touches to _4B254D_SkillMasteryTeacher
Grumpy7
parents:
2238
diff
changeset
|
1827 pClassType = activePlayer->classType; |
2238 | 1828 currClassMaxMastery = byte_4ED970_skill_learn_ability_by_class_table[pClassType][skillBeingTaught]; |
1829 masteryLevelBeingTaught = teacherLevel + 2; | |
2239
699bd6ee5ad0
dword_F8B1B0 to dword_F8B1B0_MasteryBeingTaught, some final touches to _4B254D_SkillMasteryTeacher
Grumpy7
parents:
2238
diff
changeset
|
1830 dword_F8B1B0_MasteryBeingTaught = masteryLevelBeingTaught; |
2238 | 1831 if ( currClassMaxMastery < masteryLevelBeingTaught ) |
0 | 1832 { |
2237
d903816e972e
_4B254D_SkillMasteryTeacher adding case, removing nested ifs, adding some comments
Grumpy7
parents:
2236
diff
changeset
|
1833 classBaseId = pClassType - pClassType % 4; |
2238 | 1834 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
|
1835 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[633], pClassNames[classBaseId + 1]);//Âû äîëæíû äîñòè÷ü çâàíèÿ %s äëÿ îáó÷åíèÿ ýòîìó óðîâíþ íàâûêà. You have to be promoted to %s to learn this skill level. |
2238 | 1836 else if (byte_4ED970_skill_learn_ability_by_class_table[classBaseId + 2][skillBeingTaught] >= masteryLevelBeingTaught |
1837 && 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
|
1838 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 | 1839 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
|
1840 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[633], pClassNames[classBaseId + 2]);//Âû äîëæíû äîñòè÷ü çâàíèÿ %s äëÿ îáó÷åíèÿ ýòîìó óðîâíþ íàâûêà. You have to be promoted to %s to learn this skill level. |
2238 | 1841 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
|
1842 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[633], pClassNames[classBaseId + 3]);//Âû äîëæíû äîñòè÷ü çâàíèÿ %s äëÿ îáó÷åíèÿ ýòîìó óðîâíþ íàâûêà. You have to be promoted to %s to learn this skill level. |
0 | 1843 else |
2237
d903816e972e
_4B254D_SkillMasteryTeacher adding case, removing nested ifs, adding some comments
Grumpy7
parents:
2236
diff
changeset
|
1844 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
|
1845 return pTmpBuf.data(); |
0 | 1846 } |
2239
699bd6ee5ad0
dword_F8B1B0 to dword_F8B1B0_MasteryBeingTaught, some final touches to _4B254D_SkillMasteryTeacher
Grumpy7
parents:
2238
diff
changeset
|
1847 if ( !activePlayer->CanAct() ) |
2237
d903816e972e
_4B254D_SkillMasteryTeacher adding case, removing nested ifs, adding some comments
Grumpy7
parents:
2236
diff
changeset
|
1848 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
|
1849 pointsInSkill = activePlayer->pActiveSkills[skillBeingTaught]; |
2237
d903816e972e
_4B254D_SkillMasteryTeacher adding case, removing nested ifs, adding some comments
Grumpy7
parents:
2236
diff
changeset
|
1850 pointsInSkillWOutMastery = pointsInSkill & 0x3F; |
d903816e972e
_4B254D_SkillMasteryTeacher adding case, removing nested ifs, adding some comments
Grumpy7
parents:
2236
diff
changeset
|
1851 if ( !pointsInSkillWOutMastery ) |
d903816e972e
_4B254D_SkillMasteryTeacher adding case, removing nested ifs, adding some comments
Grumpy7
parents:
2236
diff
changeset
|
1852 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
|
1853 skillMastery = SkillToMastery(pointsInSkill); |
2238 | 1854 if ( (signed int)skillMastery > teacherLevel + 1 ) |
1855 return pNPCTopics[teacherLevel + 128].pText; // You are already an SKILLLEVEL in this skill. | |
1856 dword_F8B1AC_award_bit_number = skillBeingTaught; | |
1857 if ( masteryLevelBeingTaught == 2 && pointsInSkillWOutMastery < 4 | |
1858 || masteryLevelBeingTaught == 3 && pointsInSkillWOutMastery < 7 | |
1859 || masteryLevelBeingTaught == 4 && pointsInSkillWOutMastery < 10 | |
1860 ) | |
1861 return pNPCTopics[127].pText; //"You don't meet the requirements, and cannot be taught until you do." | |
1862 switch (dword_F8B1AC_award_bit_number) | |
0 | 1863 { |
2238 | 1864 case PLAYER_SKILL_STAFF: |
1865 case PLAYER_SKILL_SWORD: | |
1866 case PLAYER_SKILL_DAGGER: | |
1867 case PLAYER_SKILL_AXE: | |
1868 case PLAYER_SKILL_SPEAR: | |
1869 case PLAYER_SKILL_BOW: | |
1870 case PLAYER_SKILL_MACE: | |
2240
1fc4223bddf6
dword_F8B1B0_MasteryBeingTaught removing redundant case bodies
Grumpy7
parents:
2239
diff
changeset
|
1871 case PLAYER_SKILL_ARMSMASTER: |
2238 | 1872 switch (masteryLevelBeingTaught) |
1873 { | |
1874 case 2: | |
1875 gold_transaction_amount = 2000; | |
1876 break; | |
1877 case 3: | |
1878 gold_transaction_amount = 5000; | |
1879 break; | |
1880 case 4: | |
1881 gold_transaction_amount = 8000; | |
1882 break; | |
1883 } | |
1884 break; | |
1885 case PLAYER_SKILL_BLASTER: | |
1886 switch (masteryLevelBeingTaught) | |
1887 { | |
1888 case 2: | |
1889 gold_transaction_amount = 0; | |
1890 break; | |
1891 case 3: | |
1892 gold_transaction_amount = 0; | |
1893 break; | |
1894 case 4: | |
1895 gold_transaction_amount = 0; | |
1896 break; | |
1897 } | |
1898 break; | |
1899 case PLAYER_SKILL_SHIELD: | |
1900 case PLAYER_SKILL_LEATHER: | |
1901 case PLAYER_SKILL_CHAIN: | |
1902 case PLAYER_SKILL_PLATE: | |
1903 switch (masteryLevelBeingTaught) | |
1904 { | |
1905 case 2: | |
1906 gold_transaction_amount = 1000; | |
1907 break; | |
1908 case 3: | |
1909 gold_transaction_amount = 3000; | |
1910 break; | |
1911 case 4: | |
1912 gold_transaction_amount = 7000; | |
1913 break; | |
1914 } | |
1915 break; | |
1916 case PLAYER_SKILL_FIRE: | |
1917 case PLAYER_SKILL_AIR: | |
1918 case PLAYER_SKILL_WATER: | |
1919 case PLAYER_SKILL_EARTH: | |
1920 case PLAYER_SKILL_SPIRIT: | |
1921 case PLAYER_SKILL_MIND: | |
1922 case PLAYER_SKILL_BODY: | |
1923 switch (masteryLevelBeingTaught) | |
0 | 1924 { |
2238 | 1925 case 2: |
1926 gold_transaction_amount = 1000; | |
1927 break; | |
1928 case 3: | |
1929 gold_transaction_amount = 4000; | |
1930 break; | |
1931 case 4: | |
1932 gold_transaction_amount = 8000; | |
1933 break; | |
1934 } | |
1935 break; | |
1936 case PLAYER_SKILL_LIGHT: | |
1937 switch (masteryLevelBeingTaught) | |
1938 { | |
1939 case 2: | |
1940 gold_transaction_amount = 2000; | |
1941 break; | |
1942 case 3: | |
1943 if ( !(unsigned __int16)_449B57_test_bit(pParty->_quest_bits, 114) ) | |
1944 return pNPCTopics[127].pText; | |
1945 gold_transaction_amount = 5000; | |
1946 break; | |
1947 case 4: | |
2239
699bd6ee5ad0
dword_F8B1B0 to dword_F8B1B0_MasteryBeingTaught, some final touches to _4B254D_SkillMasteryTeacher
Grumpy7
parents:
2238
diff
changeset
|
1948 if ( !activePlayer->ProfessionOrGuildFlagsCorrect(0x22u, 1) || |
699bd6ee5ad0
dword_F8B1B0 to dword_F8B1B0_MasteryBeingTaught, some final touches to _4B254D_SkillMasteryTeacher
Grumpy7
parents:
2238
diff
changeset
|
1949 !activePlayer->ProfessionOrGuildFlagsCorrect(0x1Au, 1)) |
2238 | 1950 return pNPCTopics[127].pText; |
1951 gold_transaction_amount = 8000; | |
1952 break; | |
1953 } | |
1954 break; | |
1955 case PLAYER_SKILL_DARK: | |
1956 switch (masteryLevelBeingTaught) | |
1957 { | |
1958 case 2: | |
1959 gold_transaction_amount = 2000; | |
1960 break; | |
1961 case 3: | |
1962 if ( !(unsigned __int16)_449B57_test_bit(pParty->_quest_bits, 110) ) | |
1963 return pNPCTopics[127].pText; | |
1964 gold_transaction_amount = 5000; | |
1965 break; | |
1966 case 4: | |
2239
699bd6ee5ad0
dword_F8B1B0 to dword_F8B1B0_MasteryBeingTaught, some final touches to _4B254D_SkillMasteryTeacher
Grumpy7
parents:
2238
diff
changeset
|
1967 if ( !activePlayer->ProfessionOrGuildFlagsCorrect(0x23u, 1) |
699bd6ee5ad0
dword_F8B1B0 to dword_F8B1B0_MasteryBeingTaught, some final touches to _4B254D_SkillMasteryTeacher
Grumpy7
parents:
2238
diff
changeset
|
1968 || !activePlayer->ProfessionOrGuildFlagsCorrect(0x1Bu, 1)) |
2238 | 1969 return pNPCTopics[127].pText; |
1970 gold_transaction_amount = 8000; | |
1971 break; | |
1972 } | |
1973 break; | |
1974 case PLAYER_SKILL_ITEM_ID: | |
2240
1fc4223bddf6
dword_F8B1B0_MasteryBeingTaught removing redundant case bodies
Grumpy7
parents:
2239
diff
changeset
|
1975 case PLAYER_SKILL_REPAIR: |
1fc4223bddf6
dword_F8B1B0_MasteryBeingTaught removing redundant case bodies
Grumpy7
parents:
2239
diff
changeset
|
1976 case PLAYER_SKILL_MEDITATION: |
1fc4223bddf6
dword_F8B1B0_MasteryBeingTaught removing redundant case bodies
Grumpy7
parents:
2239
diff
changeset
|
1977 case PLAYER_SKILL_PERCEPTION: |
1fc4223bddf6
dword_F8B1B0_MasteryBeingTaught removing redundant case bodies
Grumpy7
parents:
2239
diff
changeset
|
1978 case PLAYER_SKILL_TRAP_DISARM: |
1fc4223bddf6
dword_F8B1B0_MasteryBeingTaught removing redundant case bodies
Grumpy7
parents:
2239
diff
changeset
|
1979 case PLAYER_SKILL_MONSTER_ID: |
1fc4223bddf6
dword_F8B1B0_MasteryBeingTaught removing redundant case bodies
Grumpy7
parents:
2239
diff
changeset
|
1980 case PLAYER_SKILL_STEALING: |
1fc4223bddf6
dword_F8B1B0_MasteryBeingTaught removing redundant case bodies
Grumpy7
parents:
2239
diff
changeset
|
1981 case PLAYER_SKILL_ALCHEMY: |
2238 | 1982 switch (masteryLevelBeingTaught) |
1983 { | |
1984 case 2: | |
1985 gold_transaction_amount = 500; | |
1986 break; | |
1987 case 3: | |
1988 gold_transaction_amount = 2500; | |
1989 break; | |
1990 case 4: | |
1991 gold_transaction_amount = 6000; | |
1992 break; | |
1993 } | |
1994 break; | |
1995 case PLAYER_SKILL_MERCHANT: | |
1996 switch (masteryLevelBeingTaught) | |
1997 { | |
1998 case 2: | |
1999 gold_transaction_amount = 2000; | |
2000 break; | |
2001 case 3: | |
2239
699bd6ee5ad0
dword_F8B1B0 to dword_F8B1B0_MasteryBeingTaught, some final touches to _4B254D_SkillMasteryTeacher
Grumpy7
parents:
2238
diff
changeset
|
2002 if ( activePlayer->GetBaseWillpower() < 50 ) |
2238 | 2003 return pNPCTopics[127].pText; |
2004 gold_transaction_amount = 5000; | |
2005 break; | |
2006 case 4: | |
2007 gold_transaction_amount = 8000; | |
2008 break; | |
2009 } | |
2010 break; | |
2011 case PLAYER_SKILL_BODYBUILDING: | |
2012 switch (masteryLevelBeingTaught) | |
2013 { | |
2014 case 2: | |
2015 gold_transaction_amount = 500; | |
2016 break; | |
2017 case 3: | |
2239
699bd6ee5ad0
dword_F8B1B0 to dword_F8B1B0_MasteryBeingTaught, some final touches to _4B254D_SkillMasteryTeacher
Grumpy7
parents:
2238
diff
changeset
|
2018 if ( activePlayer->GetBaseEndurance() < 50 ) |
2238 | 2019 return pNPCTopics[127].pText; |
2020 gold_transaction_amount = 2500; | |
2021 break; | |
2022 case 4: | |
2023 gold_transaction_amount = 6000; | |
2024 break; | |
2025 } | |
2026 break; | |
2027 case PLAYER_SKILL_DIPLOMACY: | |
2028 Error("Diplomacy not used"); | |
2029 break; | |
2030 case PLAYER_SKILL_TIEVERY: | |
2031 Error("Thievery not used"); | |
2032 break; | |
2033 case PLAYER_SKILL_DODGE: | |
2034 switch (masteryLevelBeingTaught) | |
2035 { | |
2036 case 2: | |
2037 gold_transaction_amount = 2000; | |
2038 break; | |
2039 case 3: | |
2040 gold_transaction_amount = 5000; | |
2041 break; | |
2042 case 4: | |
2239
699bd6ee5ad0
dword_F8B1B0 to dword_F8B1B0_MasteryBeingTaught, some final touches to _4B254D_SkillMasteryTeacher
Grumpy7
parents:
2238
diff
changeset
|
2043 if ( (activePlayer->pActiveSkills[PLAYER_SKILL_UNARMED] & 63) < 0xA ) |
2238 | 2044 return pNPCTopics[127].pText; |
2045 gold_transaction_amount = 8000; | |
2046 break; | |
2047 } | |
2048 break; | |
2049 case PLAYER_SKILL_UNARMED: | |
2050 switch (masteryLevelBeingTaught) | |
2051 { | |
2052 case 2: | |
2053 gold_transaction_amount = 2000; | |
2054 break; | |
2055 case 3: | |
2056 gold_transaction_amount = 5000; | |
2057 break; | |
2058 case 4: | |
2239
699bd6ee5ad0
dword_F8B1B0 to dword_F8B1B0_MasteryBeingTaught, some final touches to _4B254D_SkillMasteryTeacher
Grumpy7
parents:
2238
diff
changeset
|
2059 if ( (activePlayer->pActiveSkills[PLAYER_SKILL_DODGE] & 63) < 0xA ) |
2238 | 2060 return pNPCTopics[127].pText; |
2061 gold_transaction_amount = 8000; | |
2062 break; | |
2063 } | |
2064 break; | |
2065 case PLAYER_SKILL_LEARNING: | |
2066 switch (masteryLevelBeingTaught) | |
2067 { | |
2068 case 2: | |
2069 gold_transaction_amount = 2000; | |
2070 break; | |
2071 case 3: | |
2239
699bd6ee5ad0
dword_F8B1B0 to dword_F8B1B0_MasteryBeingTaught, some final touches to _4B254D_SkillMasteryTeacher
Grumpy7
parents:
2238
diff
changeset
|
2072 if ( activePlayer->GetBaseIntelligence() < 50 ) |
2238 | 2073 return pNPCTopics[127].pText; |
2074 gold_transaction_amount = 5000; | |
2075 break; | |
2076 case 4: | |
2077 gold_transaction_amount = 8000; | |
2078 break; | |
2079 } | |
2080 break; | |
2081 default: | |
2082 Error("Unknown skill"); | |
955 | 2083 } |
267 | 2084 if ( gold_transaction_amount > pParty->uNumGold ) |
2238 | 2085 return pNPCTopics[124].pText; //You don't have enough gold! |
484 | 2086 contract_approved = 1; |
2238 | 2087 if ( masteryLevelBeingTaught == 2 ) |
0 | 2088 { |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
2089 sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[534],//Ïîëó÷èòü ñòåïåíü ^Pr[%s] â íàâûêå ^Pr[%s] çà ^I[%lu] çîëîò^L[îé;ûõ;ûõ] |
955 | 2090 pGlobalTXT_LocalizationStrings[433], pSkillNames[dword_F8B1AC_award_bit_number], gold_transaction_amount);//Ýêñïåðò |
0 | 2091 } |
2238 | 2092 if ( masteryLevelBeingTaught == 3 ) |
0 | 2093 { |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
2094 sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[534], |
955 | 2095 pGlobalTXT_LocalizationStrings[432], pSkillNames[dword_F8B1AC_award_bit_number], gold_transaction_amount);//Ìàñòåð |
0 | 2096 } |
2238 | 2097 if ( masteryLevelBeingTaught == 4 ) |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
2098 sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[534], |
955 | 2099 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
|
2100 return pTmpBuf2.data(); |
0 | 2101 } |
2102 | |
2103 //----- (004B3E1E) -------------------------------------------------------- | |
1458 | 2104 void sub_4B3E1E() |
0 | 2105 { |
2106 NPCData *v0; // ST40_4@1 | |
2107 signed int v1; // edi@1 | |
165 | 2108 //GUIWindow *v2; // ecx@1 |
0 | 2109 |
167 | 2110 __debugbreak(); |
602 | 2111 v0 = GetNPCData(sDialogue_SpeakingActorNPC_ID); |
0 | 2112 v1 = 0; |
2113 pDialogueWindow->eWindowType = WINDOW_MainMenu; | |
2114 pDialogueWindow->Release(); | |
2215
e9625ad08541
fog fix and change 640,480 - window->GetWidth(), window->GetHeight()
Ritor1
parents:
2197
diff
changeset
|
2115 pDialogueWindow = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_Dialogue, 1, 0); |
291 | 2116 if ( pNPCStats->pProfessions[v0->uProfession].pBenefits)//*(&pNPCStats->field_13A5C + 5 * v0->uProfession) ) |
0 | 2117 { |
832 | 2118 pDialogueWindow->CreateButton(480, 160, 140, 28, 1, 0, UIMSG_SelectNPCDialogueOption, 77, 0, pGlobalTXT_LocalizationStrings[407], 0); |
0 | 2119 v1 = 1; |
2120 } | |
832 | 2121 pDialogueWindow->CreateButton(480, 30 * v1 + 160, 140, 30, 1, 0, UIMSG_SelectNPCDialogueOption, 76, 0, pGlobalTXT_LocalizationStrings[406], 0);//Íàíÿòü |
972 | 2122 pDialogueWindow->_41D08F_set_keyboard_control_group(v1 + 1, 1, 0, 1); |
0 | 2123 } |
2124 | |
2125 | |
2126 //----- (004B3FE5) -------------------------------------------------------- | |
2246 | 2127 //Originally called _4B254D_SkillMasteryTeacher to have contract_approved assigned, to be able to set some button name. |
2128 //But it the name gets immediately overwritten | |
2240
1fc4223bddf6
dword_F8B1B0_MasteryBeingTaught removing redundant case bodies
Grumpy7
parents:
2239
diff
changeset
|
2129 void _4B3FE5_training_dialogue(int a4) |
0 | 2130 { |
1838 | 2131 const char *v2; // edi@1 |
2102 | 2132 |
2245 | 2133 //__debugbreak(); |
2240
1fc4223bddf6
dword_F8B1B0_MasteryBeingTaught removing redundant case bodies
Grumpy7
parents:
2239
diff
changeset
|
2134 uDialogueType = DIALOGUE_SKILL_TRAINER; |
827 | 2135 current_npc_text = (char *)pNPCTopics[a4 + 168].pText; |
2241 | 2136 _4B254D_SkillMasteryTeacher(a4); //might be needed because of contract_approved ? |
0 | 2137 pDialogueWindow->Release(); |
2215
e9625ad08541
fog fix and change 640,480 - window->GetWidth(), window->GetHeight()
Ritor1
parents:
2197
diff
changeset
|
2138 pDialogueWindow = GUIWindow::Create(0, 0, window->GetWidth(), 350, WINDOW_MainMenu, a4, 0); |
2102 | 2139 pBtn_ExitCancel = pDialogueWindow->CreateButton( 471, 445, 169, 35, 1, 0, UIMSG_Escape, 0, 0, |
948 | 2140 pGlobalTXT_LocalizationStrings[34], pIcons_LOD->GetTexture(uExitCancelTextureId), 0); |
832 | 2141 pDialogueWindow->CreateButton(0, 0, 0, 0, 1, 0, UIMSG_BuyInShop_Identify_Repair, 0, 0, "", 0); |
2102 | 2142 v2 = ""; |
484 | 2143 if ( contract_approved ) |
0 | 2144 v2 = pGlobalTXT_LocalizationStrings[535]; |
2245 | 2145 pDialogueWindow->CreateButton(480, 160, 0x8Cu, 0x1Eu, 1, 0, UIMSG_ClickNPCTopic, 0x4Fu, 0, v2, 0); |
972 | 2146 pDialogueWindow->_41D08F_set_keyboard_control_group(1, 1, 0, 2); |
747 | 2147 dialog_menu_id = HOUSE_DIALOGUE_OTHER; |
0 | 2148 } |
2149 // F8B19C: using guessed type int dword_F8B19C; | |
2150 // F8B1A8: using guessed type int dword_F8B1A8; | |
2151 | |
2152 //----- (004B46A5) -------------------------------------------------------- | |
1006 | 2153 void __fastcall DrawTextAtStatusBar( const char *Str, int a5 ) |
1411 | 2154 { |
471
c43f156a95c9
ArmorShopDialog crash fixed. All shops show its items
Gloval
parents:
470
diff
changeset
|
2155 pRenderer->DrawTextureRGB(0, 352, pTexture_StatusBar); |
2102 | 2156 pPrimaryWindow->DrawText(pFontLucida, pFontLucida->AlignText_Center(450, Str) + 11, 357, a5, Str, 0, 0, 0); |
0 | 2157 } |
2158 | |
2159 //----- (004B46F8) -------------------------------------------------------- | |
1459 | 2160 __int64 GetExperienceRequiredForLevel(int level) |
0 | 2161 { |
1459 | 2162 __int64 v1; // eax@1 |
0 | 2163 int i; // edx@1 |
2164 | |
2165 v1 = 0; | |
1459 | 2166 for ( i = 0; i < level; ++i ) |
0 | 2167 v1 += i + 1; |
2168 return 1000 * v1; | |
2169 } | |
2170 | |
2171 //----- (004BC49B) -------------------------------------------------------- | |
651 | 2172 void OnSelectNPCDialogueOption(DIALOGUE_TYPE newDialogueType) |
652 | 2173 { |
2102 | 2174 NPCData *speakingNPC; // ebp@1 |
2175 int npc_event_id; // ecx@10 | |
2176 char *v13; // [sp-8h] [bp-18h]@60 | |
656 | 2177 |
2102 | 2178 speakingNPC = GetNPCData(sDialogue_SpeakingActorNPC_ID); |
2179 uDialogueType = newDialogueType; | |
2180 if (!speakingNPC->uFlags) | |
2181 speakingNPC->uFlags = 1; | |
2182 if(newDialogueType == DIALOGUE_PROFESSION_DETAILS) | |
2183 dialogue_show_profession_details = ~dialogue_show_profession_details; | |
2184 else if(newDialogueType == DIALOGUE_76) | |
2185 { | |
2186 if (speakingNPC->Hired()) | |
2187 { | |
2188 if ( (signed int)pNPCStats->uNumNewNPCs > 0 ) | |
2189 { | |
2190 for ( uint i = 0; i < (unsigned int)pNPCStats->uNumNewNPCs; ++i ) | |
2191 { | |
2192 if ( pNPCStats->pNewNPCData[i].uFlags & 0x80 && !strcmp(speakingNPC->pName, pNPCStats->pNewNPCData[i].pName) ) | |
2193 pNPCStats->pNewNPCData[i].uFlags &= 0x7Fu; | |
2194 } | |
2195 } | |
2196 if ( pParty->pHirelings[0].pName && !_stricmp(pParty->pHirelings[0].pName, speakingNPC->pName) ) | |
2197 memset(&pParty->pHirelings[0], 0, sizeof(NPCData)); | |
2198 else if ( pParty->pHirelings[1].pName && !_stricmp(pParty->pHirelings[1].pName, speakingNPC->pName) ) | |
2199 memset(&pParty->pHirelings[1], 0, sizeof(NPCData)); | |
2200 pParty->hirelingScrollPosition = 0; | |
2201 pParty->CountHirelings(); | |
2202 dword_591084 = 0; | |
2203 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0); | |
2204 dword_7241C8 = 0; | |
2205 return; | |
2206 } | |
2207 if ( pParty->pHirelings[0].pName && pParty->pHirelings[1].pName ) | |
2208 ShowStatusBarString(pGlobalTXT_LocalizationStrings[533], 2);// ""I cannot join you, you're party is full"" | |
2209 else | |
2210 { | |
2115 | 2211 if ( speakingNPC->uProfession != 51 ) //burglars have no hiring price |
2102 | 2212 { |
2115 | 2213 if ( pParty->uNumGold < pNPCStats->pProfessions[speakingNPC->uProfession].uHirePrice ) |
2102 | 2214 { |
2215 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2);// "You don't have enough gold" | |
2216 dialogue_show_profession_details = false; | |
2217 uDialogueType = 13; | |
2218 if ( uActiveCharacter ) | |
2219 pPlayers[uActiveCharacter]->PlaySound(SPEECH_NotEnoughGold, 0); | |
2220 if ( !dword_7241C8 ) | |
2221 pGame->Draw(); | |
2222 dword_7241C8 = 0; | |
2223 return; | |
2224 } | |
2115 | 2225 Party::TakeGold(pNPCStats->pProfessions[speakingNPC->uProfession].uHirePrice); |
2102 | 2226 } |
2227 LOBYTE(speakingNPC->uFlags) |= 0x80u; | |
2228 if ( pParty->pHirelings[0].pName ) | |
2229 { | |
2230 memcpy(&pParty->pHirelings[1], speakingNPC, sizeof(pParty->pHirelings[1])); | |
2231 v13 = pParty->pHireling2Name; | |
2232 } | |
2233 else | |
2234 { | |
2235 memcpy(&pParty->pHirelings[0], speakingNPC, sizeof(pParty->pHirelings[0])); | |
2236 v13 = pParty->pHireling1Name; | |
2237 } | |
2238 strcpy(v13, speakingNPC->pName); | |
2239 pParty->hirelingScrollPosition = 0; | |
2240 pParty->CountHirelings(); | |
2241 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0); | |
2242 if ( sDialogue_SpeakingActorNPC_ID >= 0 ) | |
2243 pDialogue_SpeakingActor->uAIState = Removed; | |
2244 if ( uActiveCharacter ) | |
2245 pPlayers[uActiveCharacter]->PlaySound(SPEECH_61, 0); | |
2246 } | |
2247 } | |
2248 else if ( (signed int)newDialogueType > DIALOGUE_84 && (signed int)newDialogueType <= DIALOGUE_ARENA_SELECT_CHAMPION ) //âûáîð óðîâíÿ ñëîæíîñòè áîÿ | |
2249 { | |
2250 ArenaFight(); | |
2251 return; | |
2252 } | |
2253 else if(newDialogueType == DIALOGUE_USE_NPC_ABILITY) | |
2254 { | |
2255 if (UseNPCSkill((NPCProf)speakingNPC->uProfession) == 0) | |
2256 { | |
2257 if ( speakingNPC->uProfession != GateMaster ) | |
2258 speakingNPC->bHasUsedTheAbility = 1; | |
2259 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0); | |
2260 } | |
2261 else | |
2262 ShowStatusBarString(pGlobalTXT_LocalizationStrings[140], 2); //"Your packs are already full!" | |
2263 } | |
2264 else if(newDialogueType == DIALOGUE_13) | |
2265 { | |
2266 if (!speakingNPC->Hired()) | |
2267 { | |
2268 sub_4B3E1E(); | |
2269 dialogue_show_profession_details = false; | |
2270 } | |
2271 else | |
2272 { | |
2273 for ( uint i = 0; i < (signed int)pNPCStats->uNumNewNPCs; ++i ) | |
2274 { | |
2275 if ( pNPCStats->pNewNPCData[i].uFlags & 0x80 && !strcmp(speakingNPC->pName, pNPCStats->pNewNPCData[i].pName) ) | |
2276 pNPCStats->pNewNPCData[i].uFlags &= 0x7Fu; | |
2277 } | |
2278 if ( pParty->pHirelings[0].pName && !_stricmp(pParty->pHirelings[0].pName, speakingNPC->pName) ) | |
2279 memset(&pParty->pHirelings[0], 0, sizeof(NPCData)); | |
2280 else if ( pParty->pHirelings[1].pName && !_stricmp(pParty->pHirelings[1].pName, speakingNPC->pName) ) | |
2281 memset(&pParty->pHirelings[1], 0, sizeof(NPCData)); | |
2282 pParty->hirelingScrollPosition = 0; | |
2283 pParty->CountHirelings(); | |
2284 dword_591084 = 0; | |
2285 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0); | |
2286 dword_7241C8 = 0; | |
2287 return; | |
2288 } | |
2289 } | |
2290 else if(newDialogueType >= DIALOGUE_EVT_A && newDialogueType <= DIALOGUE_EVT_F) | |
2291 { | |
2292 switch(newDialogueType) | |
2293 { | |
2294 case DIALOGUE_EVT_A: npc_event_id = speakingNPC->evt_A; break; | |
2295 case DIALOGUE_EVT_B: npc_event_id = speakingNPC->evt_B; break; | |
2296 case DIALOGUE_EVT_C: npc_event_id = speakingNPC->evt_C; break; | |
2297 case DIALOGUE_EVT_D: npc_event_id = speakingNPC->evt_D; break; | |
2298 case DIALOGUE_EVT_E: npc_event_id = speakingNPC->evt_E; break; | |
2299 case DIALOGUE_EVT_F: npc_event_id = speakingNPC->evt_F; break; | |
2300 } | |
2301 if ( (npc_event_id >= 200) && (npc_event_id <= 310) ) | |
2302 _4B3FE5_training_dialogue(npc_event_id); //200-310 | |
2303 else if (( npc_event_id >= 400) && (npc_event_id <= 410) ) | |
2304 { //400-410 | |
2305 dword_F8B1D8 = newDialogueType; | |
2306 DrawJoinGuildWindow(npc_event_id - 400); | |
2307 } | |
2308 else | |
2309 { | |
2310 switch ( npc_event_id ) | |
2311 { | |
2312 case 139: | |
2313 OracleDialogue(); | |
2314 break; | |
2315 case 311: | |
2316 CheckBountyRespawnAndAward(); | |
2317 break; | |
2318 case 399: | |
2319 Arena_SelectionFightLevel(); | |
2320 break; | |
2321 default: | |
2322 activeLevelDecoration = (LevelDecoration*)1; | |
2323 current_npc_text = 0; | |
2324 EventProcessor(npc_event_id, 0, 1); | |
2325 activeLevelDecoration = NULL; | |
2326 break; | |
2327 } | |
2328 } | |
2329 } | |
2330 if ( !dword_7241C8 ) | |
2331 pGame->Draw(); | |
2332 dword_7241C8 = 0; | |
656 | 2333 } |
0 | 2334 |
2335 //----- (004BDAAF) -------------------------------------------------------- | |
2059 | 2336 bool MerchandiseTest(ItemGen *item, int _2da_idx) |
0 | 2337 { |
702 | 2338 bool test; |
0 | 2339 |
907 | 2340 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
|
2341 && ((signed int)item->uItemID >= 600 || (signed int)item->uItemID >= 529 && (signed int)item->uItemID <= 599) || item->IsStolen()) |
2059 | 2342 return false; |
907 | 2343 switch( p2DEvents[_2da_idx - 1].uType ) |
2344 { | |
1411 | 2345 case BuildingType_WeaponShop: |
907 | 2346 { |
2059 | 2347 test = item->GetItemEquipType() <= EQUIP_BOW; |
907 | 2348 break; |
2349 } | |
1411 | 2350 case BuildingType_ArmorShop: |
907 | 2351 { |
2059 | 2352 test = item->GetItemEquipType() >= EQUIP_ARMOUR && item->GetItemEquipType() <= EQUIP_BOOTS; |
907 | 2353 break; |
2354 } | |
1411 | 2355 case BuildingType_MagicShop: |
907 | 2356 { |
2059 | 2357 test = item->GetPlayerSkillType() == PLAYER_SKILL_MISC || item->GetItemEquipType() == EQIUP_ANY; |
907 | 2358 break; |
2359 } | |
1411 | 2360 case BuildingType_AlchemistShop: |
907 | 2361 { |
2059 | 2362 test = item->GetItemEquipType() == EQUIP_REAGENT || item->GetItemEquipType() == EQUIP_POTION |
2363 || (item->GetItemEquipType() > EQUIP_POTION && !(item->GetItemEquipType() != EQUIP_MESSAGE_SCROLL | |
907 | 2364 || (signed int)item->uItemID < 740) && item->uItemID != 771); |
2365 break; | |
2366 } | |
2367 default: | |
2368 { | |
2369 test = false; | |
2370 break; | |
2371 } | |
2372 } | |
702 | 2373 return test; |
2235
6ab7d7c112bb
adding int_get_vector_length calls where the calls were inlined
Grumpy7
parents:
2233
diff
changeset
|
2374 } |