comparison mm7_3.cpp @ 261:c3bfe1eb3de7

Слияние
author Ritor1
date Mon, 18 Feb 2013 10:30:14 +0600
parents 92a551e4dbeb 37dcbe8f3cca
children 8cf4fe6b4941
comparison
equal deleted inserted replaced
260:b89ee5d926dd 261:c3bfe1eb3de7
4702 4702
4703 return result; 4703 return result;
4704 } 4704 }
4705 4705
4706 //----- (00476387) -------------------------------------------------------- 4706 //----- (00476387) --------------------------------------------------------
4707 bool __cdecl sub_476387() 4707 bool PartyHasDragon()
4708 { 4708 {
4709 return (pNPCStats->pNewNPCData[57].uFlags & 0x80) != 0; 4709 return pNPCStats->pNewNPCData[57].Hired();
4710 } 4710 }
4711 4711
4712 //----- (00476395) -------------------------------------------------------- 4712 //----- (00476395) --------------------------------------------------------
4713 //0x26 Wizard eye at skill level 2 4713 //0x26 Wizard eye at skill level 2
4714 bool __thiscall CheckHiredNPCSpeciality(unsigned int uProfession) 4714 bool __thiscall CheckHiredNPCSpeciality(unsigned int uProfession)
16218 NPCData *pNPC; // ebx@2 16218 NPCData *pNPC; // ebx@2
16219 int v1; // eax@2 16219 int v1; // eax@2
16220 unsigned __int16 v2; // di@2 16220 unsigned __int16 v2; // di@2
16221 //unsigned int v3; // eax@2 16221 //unsigned int v3; // eax@2
16222 char *v4; // esi@3 16222 char *v4; // esi@3
16223 int v5; // eax@11 16223 //int v5; // eax@11
16224 char *v6; // ecx@13 16224 char *v6; // ecx@13
16225 char *v7; // eax@16 16225 char *v7; // eax@16
16226 unsigned int v8; // edi@19 16226 unsigned int v8; // edi@19
16227 char *v9; // ecx@27 16227 char *v9; // ecx@27
16228 char *v10; // eax@29 16228 char *v10; // eax@29
16276 v2 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0x15u, 0x99u, 0xE9u); 16276 v2 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0x15u, 0x99u, 0xE9u);
16277 pRenderer->DrawTextureIndexed(477, 0, pTexture_Dialogue_Background); 16277 pRenderer->DrawTextureIndexed(477, 0, pTexture_Dialogue_Background);
16278 pRenderer->DrawTextureTransparent(468, 0, (Texture *)(uTextureID_507B04 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_507B04] : 0)); 16278 pRenderer->DrawTextureTransparent(468, 0, (Texture *)(uTextureID_507B04 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_507B04] : 0));
16279 pRenderer->DrawTextureIndexed(pNPCPortraits_x - 4, pNPCPortraits_y - 4, (Texture *)(uTextureID_50795C != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_50795C] : 0)); 16279 pRenderer->DrawTextureIndexed(pNPCPortraits_x - 4, pNPCPortraits_y - 4, (Texture *)(uTextureID_50795C != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_50795C] : 0));
16280 pRenderer->DrawTextureIndexed(pNPCPortraits_x, pNPCPortraits_y, pDialogueNPCPortraits[0]); 16280 pRenderer->DrawTextureIndexed(pNPCPortraits_x, pNPCPortraits_y, pDialogueNPCPortraits[0]);
16281 if ( pNPC->uProfession ) 16281
16282 { 16282 if (pNPC->uProfession)
16283 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[429], pNPC->pName, aNPCProfessionNames[pNPC->uProfession]);//^Pi[%s] %s 16283 {
16284 assert(pNPC->uProfession < sizeof(aNPCProfessionNames) / sizeof(*aNPCProfessionNames)); // sometimes buffer overflows; errors emerge both here and in dialogue text
16285 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[429], pNPC->pName, aNPCProfessionNames[pNPC->uProfession]);//^Pi[%s] %s
16284 } 16286 }
16285 else 16287 else
16286 {
16287 strcpy(pTmpBuf, pNPC->pName); 16288 strcpy(pTmpBuf, pNPC->pName);
16288 } 16289
16289 v51.DrawTitleText(pFontArrus, 483, 112, v2, pTmpBuf, 3); 16290 v51.DrawTitleText(pFontArrus, 483, 112, v2, pTmpBuf, 3);
16290 pParty->GetPartyFame(); 16291 pParty->GetPartyFame();
16291 if ( (signed int)uDialogueType > DIALOGUE_ARENA_WELCOME ) 16292
16292 { 16293 switch (uDialogueType)
16293 if ( uDialogueType == DIALOGUE_ARENA_FIGHT_NOT_OVER_YET ) 16294 {
16294 { 16295 case DIALOGUE_PROFESSION_DETAILS:
16295 pWindow.uFrameWidth = 460; 16296 {
16296 pWindow.uFrameZ = 452; 16297 if (dialogue_show_profession_details)
16297 pOutString = pFontArrus;
16298 v12 = pFontArrus->CalcTextHeight(pGlobalTXT_LocalizationStrings[577], &pWindow, 13, 0) + 7;//"Get back in there you wimps:"
16299 if ( 352 - v12 < 8 )
16300 {
16301 pOutString = pFontCreate;
16302 v12 = pFontCreate->CalcTextHeight(pGlobalTXT_LocalizationStrings[577], &pWindow, 13, 0) + 7;
16303 }
16304 pRenderer->_4A6A68(8, 352 - v12, (Texture *)(uTextureID_Leather != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Leather] : 0),
16305 (uTextureID_Leather != -1 ? pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight : 26) - v12);
16306 pRenderer->DrawTextureIndexed(8, 347 - v12, pTexture_591428);
16307 v13 = FitTextInAWindow(pGlobalTXT_LocalizationStrings[577], pFontArrus, &pWindow, 0xDu, 0);
16308 pDialogueWindow->DrawText(pFontArrus, 13, 354 - v12, 0, v13, 0, 0, 0);
16309 }
16310 else if ( uDialogueType == DIALOGUE_ARENA_REWARD )
16311 {
16312 sprintf(v4, pGlobalTXT_LocalizationStrings[576], dword_F8B1B4);// "Congratulations on your win: here's your stuff: %u gold."
16313 pInString = v4;
16314 pWindow.uFrameWidth = 460;
16315 pWindow.uFrameZ = 452;
16316 pOutString = pFontArrus;
16317 v12 = pFontArrus->CalcTextHeight(pInString, &pWindow, 13, 0) + 7;
16318 if ( 352 - v12 < 8 )
16319 {
16320 pOutString = pFontCreate;
16321 v12 = pFontCreate->CalcTextHeight(pInString, &pWindow, 13, 0) + 7;
16322 }
16323 pRenderer->_4A6A68(8, 352 - v12, (Texture *)(uTextureID_Leather != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Leather] : 0),
16324 (uTextureID_Leather != -1 ? pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight : 26) - v12);
16325 pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428);
16326 v13 = FitTextInAWindow(pInString, pOutString, &pWindow, 0xDu, 0);
16327 pDialogueWindow->DrawText(pOutString, 13, 354 - v12, 0, v13, 0, 0, 0);
16328 }
16329 else if ( uDialogueType == DIALOGUE_ARENA_ALREADY_WON )
16330 {
16331 pInString = pGlobalTXT_LocalizationStrings[582]; // "You already won this trip to the Arena:"
16332 pWindow.uFrameWidth = 460;
16333 pWindow.uFrameZ = 452;
16334 pOutString = pFontArrus;
16335 v12 = pFontArrus->CalcTextHeight(pInString, &pWindow, 13, 0) + 7;
16336 if ( 352 - v12 < 8 )
16337 {
16338 pOutString = pFontCreate;
16339 v12 = pFontCreate->CalcTextHeight(pInString, &pWindow, 13, 0) + 7;
16340 }
16341 pRenderer->_4A6A68(8, 352 - v12, (Texture *)(uTextureID_Leather != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Leather] : 0),
16342 (uTextureID_Leather != -1 ? pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight : 26) - v12);
16343 pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428);
16344 v13 = FitTextInAWindow(pInString, pOutString, &pWindow, 0xDu, 0);
16345 pDialogueWindow->DrawText(pOutString, 13, 354 - v12, 0, v13, 0, 0, 0);
16346 }
16347 }
16348 else
16349 {
16350 if ( uDialogueType == DIALOGUE_ARENA_WELCOME )
16351 {
16352 v7 = pGlobalTXT_LocalizationStrings[574]; // "Welcome to the Arena of Life and Death. Remember, you are only allowed one arena combat per visit. To fight an arena battle, select the option that best describes your abilities and return to me- if you survive:"
16353 pInString = v7;
16354 pWindow.uFrameWidth = 460;
16355 pWindow.uFrameZ = 452;
16356 pOutString = pFontArrus;
16357 v12 = pFontArrus->CalcTextHeight(pInString, &pWindow, 13, 0) + 7;
16358 if ( 352 - v12 < 8 )
16359 {
16360 pOutString = pFontCreate;
16361 v12 = pFontCreate->CalcTextHeight(pInString, &pWindow, 13, 0) + 7;
16362 }
16363 pRenderer->_4A6A68(8, 352 - v12, (Texture *)(uTextureID_Leather != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Leather] : 0),
16364 (uTextureID_Leather != -1 ? pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight : 26) - v12);
16365 pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428);
16366 v13 = FitTextInAWindow(pInString, pOutString, &pWindow, 0xDu, 0);
16367 pDialogueWindow->DrawText(pOutString, 13, 354 - v12, 0, v13, 0, 0, 0);
16368 }
16369 else if ( uDialogueType == DIALOGUE_13 )
16370 {
16371 v5 = 5 * pNPC->uProfession;
16372 v6 = (char *)*(&pNPCStats->field_13A64 + v5);
16373 v7 = sub_495461(v6, uActiveCharacter - 1, 0, 0, 0, 0);
16374 pInString = v7;
16375 pWindow.uFrameWidth = 460;
16376 pWindow.uFrameZ = 452;
16377 pOutString = pFontArrus;
16378 v12 = pFontArrus->CalcTextHeight(pInString, &pWindow, 13, 0) + 7;
16379 if ( 352 - v12 < 8 )
16380 {
16381 pOutString = pFontCreate;
16382 v12 = pFontCreate->CalcTextHeight(pInString, &pWindow, 13, 0) + 7;
16383 }
16384 pRenderer->_4A6A68(8, 352 - v12, (Texture *)(uTextureID_Leather != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Leather] : 0),
16385 (uTextureID_Leather != -1 ? pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight : 26) - v12);
16386 pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428);
16387 v13 = FitTextInAWindow(pInString, pOutString, &pWindow, 0xDu, 0);
16388 pDialogueWindow->DrawText(pOutString, 13, 354 - v12, 0, v13, 0, 0, 0);
16389 }
16390 else if ( (signed int)uDialogueType > DIALOGUE_18 && !((signed int)uDialogueType > DIALOGUE_24 && uDialogueType != DIALOGUE_77 || byte_5B0938[0]) )
16391 {
16392 if ( (signed int)uDialogueType > DIALOGUE_24 && uDialogueType == DIALOGUE_77 )
16393 {
16394 v5 = 5 * pNPC->uProfession;
16395 if ( byte_F8B1EC )
16396 { 16298 {
16397 v6 = (char *)*(&pNPCStats->field_13A5C + 5 * pNPC->uProfession); 16299 v6 = pNPCStats->pProfessions[pNPC->uProfession - 1].pBenefits;
16398 v7 = sub_495461(v6, uActiveCharacter - 1, 0, 0, 0, 0); 16300 v7 = sub_495461(v6, uActiveCharacter - 1, 0, 0, 0, 0);
16399 pInString = v7; 16301 pInString = v7;
16400 pWindow.uFrameWidth = 460; 16302 pWindow.uFrameWidth = 460;
16401 pWindow.uFrameZ = 452; 16303 pWindow.uFrameZ = 452;
16402 pOutString = pFontArrus; 16304 pOutString = pFontArrus;
16404 if ( 352 - v12 < 8 ) 16306 if ( 352 - v12 < 8 )
16405 { 16307 {
16406 pOutString = pFontCreate; 16308 pOutString = pFontCreate;
16407 v12 = pFontCreate->CalcTextHeight(pInString, &pWindow, 13, 0) + 7; 16309 v12 = pFontCreate->CalcTextHeight(pInString, &pWindow, 13, 0) + 7;
16408 } 16310 }
16409 pRenderer->_4A6A68(8, 352 - v12, (Texture *)(uTextureID_Leather != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Leather] : 0), 16311 if (uTextureID_Leather != -1)
16410 (uTextureID_Leather != -1 ? pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight : 26) - v12); 16312 pRenderer->_4A6A68(8, 352 - v12, &pIcons_LOD->pTextures[uTextureID_Leather], pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight - v12);
16411 pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428); 16313 pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428);
16412 v13 = FitTextInAWindow(pInString, pOutString, &pWindow, 0xDu, 0); 16314 v13 = FitTextInAWindow(pInString, pOutString, &pWindow, 0xDu, 0);
16413 pDialogueWindow->DrawText(pOutString, 13, 354 - v12, 0, v13, 0, 0, 0); 16315 pDialogueWindow->DrawText(pOutString, 13, 354 - v12, 0, v13, 0, 0, 0);
16414 } 16316 }
16415 else if ( pNPC->uFlags & 0x80 ) 16317 else if (pNPC->Hired())
16416 { 16318 {
16417 v6 = (char *)*(&pNPCStats->field_13A68 + 5 * pNPC->uProfession); 16319 v6 = pNPCStats->pProfessions[pNPC->uProfession - 1].pDismissText;
16418 v7 = sub_495461(v6, uActiveCharacter - 1, 0, 0, 0, 0); 16320 v7 = sub_495461(v6, uActiveCharacter - 1, 0, 0, 0, 0);
16419 pInString = v7; 16321 pInString = v7;
16420 pWindow.uFrameWidth = 460; 16322 pWindow.uFrameWidth = 460;
16421 pWindow.uFrameZ = 452; 16323 pWindow.uFrameZ = 452;
16422 pOutString = pFontArrus; 16324 pOutString = pFontArrus;
16424 if ( 352 - v12 < 8 ) 16326 if ( 352 - v12 < 8 )
16425 { 16327 {
16426 pOutString = pFontCreate; 16328 pOutString = pFontCreate;
16427 v12 = pFontCreate->CalcTextHeight(pInString, &pWindow, 13, 0) + 7; 16329 v12 = pFontCreate->CalcTextHeight(pInString, &pWindow, 13, 0) + 7;
16428 } 16330 }
16429 pRenderer->_4A6A68(8, 352 - v12, (Texture *)(uTextureID_Leather != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Leather] : 0), 16331 if (uTextureID_Leather != -1)
16430 (uTextureID_Leather != -1 ? pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight : 26) - v12); 16332 pRenderer->_4A6A68(8, 352 - v12, &pIcons_LOD->pTextures[uTextureID_Leather], pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight - v12);
16431 pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428); 16333 pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428);
16432 v13 = FitTextInAWindow(pInString, pOutString, &pWindow, 0xDu, 0); 16334 v13 = FitTextInAWindow(pInString, pOutString, &pWindow, 0xDu, 0);
16433 pDialogueWindow->DrawText(pOutString, 13, 354 - v12, 0, v13, 0, 0, 0); 16335 pDialogueWindow->DrawText(pOutString, 13, 354 - v12, 0, v13, 0, 0, 0);
16434 } 16336 }
16435 else 16337 else
16436 { 16338 {
16437 v6 = (char *)*(&pNPCStats->field_13A64 + v5); 16339 v6 = pNPCStats->pProfessions[pNPC->uProfession - 1].pJoinText;
16438 v7 = sub_495461(v6, uActiveCharacter - 1, 0, 0, 0, 0); 16340 v7 = sub_495461(v6, uActiveCharacter - 1, 0, 0, 0, 0);
16439 pInString = v7; 16341 pInString = v7;
16440 pWindow.uFrameWidth = 460; 16342 pWindow.uFrameWidth = 460;
16441 pWindow.uFrameZ = 452; 16343 pWindow.uFrameZ = 452;
16442 pOutString = pFontArrus; 16344 pOutString = pFontArrus;
16444 if ( 352 - v12 < 8 ) 16346 if ( 352 - v12 < 8 )
16445 { 16347 {
16446 pOutString = pFontCreate; 16348 pOutString = pFontCreate;
16447 v12 = pFontCreate->CalcTextHeight(pInString, &pWindow, 13, 0) + 7; 16349 v12 = pFontCreate->CalcTextHeight(pInString, &pWindow, 13, 0) + 7;
16448 } 16350 }
16449 pRenderer->_4A6A68(8, 352 - v12, (Texture *)(uTextureID_Leather != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Leather] : 0), 16351 if (uTextureID_Leather != -1)
16450 (uTextureID_Leather != -1 ? pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight : 26) - v12); 16352 pRenderer->_4A6A68(8, 352 - v12, &pIcons_LOD->pTextures[uTextureID_Leather], pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight - v12);
16451 pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428); 16353 pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428);
16452 v13 = FitTextInAWindow(pInString, pOutString, &pWindow, 0xDu, 0); 16354 v13 = FitTextInAWindow(pInString, pOutString, &pWindow, 0xDu, 0);
16453 pDialogueWindow->DrawText(pOutString, 13, 354 - v12, 0, v13, 0, 0, 0); 16355 pDialogueWindow->DrawText(pOutString, 13, 354 - v12, 0, v13, 0, 0, 0);
16454 } 16356 }
16455 } 16357 }
16456 else 16358 break;
16359 }
16360
16361 if ( (signed int)uDialogueType > DIALOGUE_ARENA_WELCOME )
16362 {
16363 if ( uDialogueType == DIALOGUE_ARENA_FIGHT_NOT_OVER_YET )
16364 {
16365 pWindow.uFrameWidth = 460;
16366 pWindow.uFrameZ = 452;
16367 pOutString = pFontArrus;
16368 v12 = pFontArrus->CalcTextHeight(pGlobalTXT_LocalizationStrings[577], &pWindow, 13, 0) + 7;//"Get back in there you wimps:"
16369 if ( 352 - v12 < 8 )
16370 {
16371 pOutString = pFontCreate;
16372 v12 = pFontCreate->CalcTextHeight(pGlobalTXT_LocalizationStrings[577], &pWindow, 13, 0) + 7;
16373 }
16374 pRenderer->_4A6A68(8, 352 - v12, (Texture *)(uTextureID_Leather != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Leather] : 0),
16375 (uTextureID_Leather != -1 ? pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight : 26) - v12);
16376 pRenderer->DrawTextureIndexed(8, 347 - v12, pTexture_591428);
16377 v13 = FitTextInAWindow(pGlobalTXT_LocalizationStrings[577], pFontArrus, &pWindow, 0xDu, 0);
16378 pDialogueWindow->DrawText(pFontArrus, 13, 354 - v12, 0, v13, 0, 0, 0);
16379 }
16380 else if ( uDialogueType == DIALOGUE_ARENA_REWARD )
16381 {
16382 sprintf(v4, pGlobalTXT_LocalizationStrings[576], dword_F8B1B4);// "Congratulations on your win: here's your stuff: %u gold."
16383 pInString = v4;
16384 pWindow.uFrameWidth = 460;
16385 pWindow.uFrameZ = 452;
16386 pOutString = pFontArrus;
16387 v12 = pFontArrus->CalcTextHeight(pInString, &pWindow, 13, 0) + 7;
16388 if ( 352 - v12 < 8 )
16389 {
16390 pOutString = pFontCreate;
16391 v12 = pFontCreate->CalcTextHeight(pInString, &pWindow, 13, 0) + 7;
16392 }
16393 pRenderer->_4A6A68(8, 352 - v12, (Texture *)(uTextureID_Leather != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Leather] : 0),
16394 (uTextureID_Leather != -1 ? pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight : 26) - v12);
16395 pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428);
16396 v13 = FitTextInAWindow(pInString, pOutString, &pWindow, 0xDu, 0);
16397 pDialogueWindow->DrawText(pOutString, 13, 354 - v12, 0, v13, 0, 0, 0);
16398 }
16399 else if ( uDialogueType == DIALOGUE_ARENA_ALREADY_WON )
16400 {
16401 pInString = pGlobalTXT_LocalizationStrings[582]; // "You already won this trip to the Arena:"
16402 pWindow.uFrameWidth = 460;
16403 pWindow.uFrameZ = 452;
16404 pOutString = pFontArrus;
16405 v12 = pFontArrus->CalcTextHeight(pInString, &pWindow, 13, 0) + 7;
16406 if ( 352 - v12 < 8 )
16407 {
16408 pOutString = pFontCreate;
16409 v12 = pFontCreate->CalcTextHeight(pInString, &pWindow, 13, 0) + 7;
16410 }
16411 pRenderer->_4A6A68(8, 352 - v12, (Texture *)(uTextureID_Leather != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Leather] : 0),
16412 (uTextureID_Leather != -1 ? pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight : 26) - v12);
16413 pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428);
16414 v13 = FitTextInAWindow(pInString, pOutString, &pWindow, 0xDu, 0);
16415 pDialogueWindow->DrawText(pOutString, 13, 354 - v12, 0, v13, 0, 0, 0);
16416 }
16417 }
16418 else
16419 {
16420 if ( uDialogueType == DIALOGUE_ARENA_WELCOME )
16421 {
16422 v7 = pGlobalTXT_LocalizationStrings[574]; // "Welcome to the Arena of Life and Death. Remember, you are only allowed one arena combat per visit. To fight an arena battle, select the option that best describes your abilities and return to me- if you survive:"
16423 pInString = v7;
16424 pWindow.uFrameWidth = 460;
16425 pWindow.uFrameZ = 452;
16426 pOutString = pFontArrus;
16427 v12 = pFontArrus->CalcTextHeight(pInString, &pWindow, 13, 0) + 7;
16428 if ( 352 - v12 < 8 )
16429 {
16430 pOutString = pFontCreate;
16431 v12 = pFontCreate->CalcTextHeight(pInString, &pWindow, 13, 0) + 7;
16432 }
16433 pRenderer->_4A6A68(8, 352 - v12, (Texture *)(uTextureID_Leather != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Leather] : 0),
16434 (uTextureID_Leather != -1 ? pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight : 26) - v12);
16435 pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428);
16436 v13 = FitTextInAWindow(pInString, pOutString, &pWindow, 0xDu, 0);
16437 pDialogueWindow->DrawText(pOutString, 13, 354 - v12, 0, v13, 0, 0, 0);
16438 }
16439 else if ( uDialogueType == DIALOGUE_13 )
16440 {
16441 v6 = pNPCStats->pProfessions[pNPC->uProfession - 1].pJoinText;
16442 v7 = sub_495461(v6, uActiveCharacter - 1, 0, 0, 0, 0);
16443 pInString = v7;
16444 pWindow.uFrameWidth = 460;
16445 pWindow.uFrameZ = 452;
16446 pOutString = pFontArrus;
16447 v12 = pFontArrus->CalcTextHeight(pInString, &pWindow, 13, 0) + 7;
16448 if ( 352 - v12 < 8 )
16449 {
16450 pOutString = pFontCreate;
16451 v12 = pFontCreate->CalcTextHeight(pInString, &pWindow, 13, 0) + 7;
16452 }
16453 pRenderer->_4A6A68(8, 352 - v12, (Texture *)(uTextureID_Leather != -1 ? &pIcons_LOD->pTextures[uTextureID_Leather] : 0),
16454 (uTextureID_Leather != -1 ? pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight : 26) - v12);
16455 pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428);
16456 v13 = FitTextInAWindow(pInString, pOutString, &pWindow, 0xDu, 0);
16457 pDialogueWindow->DrawText(pOutString, 13, 354 - v12, 0, v13, 0, 0, 0);
16458 }
16459 else if ( (signed int)uDialogueType > DIALOGUE_18 && !((signed int)uDialogueType > DIALOGUE_24 && uDialogueType != DIALOGUE_PROFESSION_DETAILS || byte_5B0938[0]) )
16460 {
16461 if ((signed int)uDialogueType <= DIALOGUE_23)
16457 { 16462 {
16458 v7 = (char *)ptr_F8B1E8; 16463 v7 = (char *)ptr_F8B1E8;
16459 pInString = v7; 16464 pInString = v7;
16460 pWindow.uFrameWidth = 460; 16465 pWindow.uFrameWidth = 460;
16461 pWindow.uFrameZ = 452; 16466 pWindow.uFrameZ = 452;
16464 if ( 352 - v12 < 8 ) 16469 if ( 352 - v12 < 8 )
16465 { 16470 {
16466 pOutString = pFontCreate; 16471 pOutString = pFontCreate;
16467 v12 = pFontCreate->CalcTextHeight(pInString, &pWindow, 13, 0) + 7; 16472 v12 = pFontCreate->CalcTextHeight(pInString, &pWindow, 13, 0) + 7;
16468 } 16473 }
16469 pRenderer->_4A6A68(8, 352 - v12, (Texture *)(uTextureID_Leather != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Leather] : 0), 16474 pRenderer->_4A6A68(8, 352 - v12, (Texture *)(uTextureID_Leather != -1 ? &pIcons_LOD->pTextures[uTextureID_Leather] : 0),
16470 (uTextureID_Leather != -1 ? pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight : 26) - v12); 16475 (uTextureID_Leather != -1 ? pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight : 26) - v12);
16471 pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428); 16476 pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428);
16472 v13 = FitTextInAWindow(pInString, pOutString, &pWindow, 0xDu, 0); 16477 v13 = FitTextInAWindow(pInString, pOutString, &pWindow, 0xDu, 0);
16473 pDialogueWindow->DrawText(pOutString, 13, 354 - v12, 0, v13, 0, 0, 0); 16478 pDialogueWindow->DrawText(pOutString, 13, 354 - v12, 0, v13, 0, 0, 0);
16474 } 16479 }
16503 } 16508 }
16504 else 16509 else
16505 { 16510 {
16506 if ( *(int *)v54 == 2 ) 16511 if ( *(int *)v54 == 2 )
16507 { 16512 {
16508 if ( pNPC->uFlags & 0x80 ) 16513 if (pNPC->Hired())
16509 v9 = (char *)pNPCStats->pProfessions[pNPC->uProfession].pDismissText; 16514 v9 = pNPCStats->pProfessions[pNPC->uProfession].pDismissText;
16510 else 16515 else
16511 v9 = (char *)pNPCStats->pProfessions[pNPC->uProfession].pJoinText; //"Invalid String Passed" 16516 v9 = pNPCStats->pProfessions[pNPC->uProfession].pJoinText; //"Invalid String Passed"
16512 pInString = sub_495461(v9, uActiveCharacter - 1, 0, 0, 0, 0); 16517 pInString = sub_495461(v9, uActiveCharacter - 1, 0, 0, 0, 0);
16513 if ( pInString != NULL ) 16518 if ( pInString != NULL )
16514 { 16519 {
16515 pWindow.uFrameWidth = 460; 16520 pWindow.uFrameWidth = 460;
16516 pWindow.uFrameZ = 452; 16521 pWindow.uFrameZ = 452;
16519 if ( 352 - v12 < 8 ) 16524 if ( 352 - v12 < 8 )
16520 { 16525 {
16521 pOutString = pFontCreate; 16526 pOutString = pFontCreate;
16522 v12 = pFontCreate->CalcTextHeight(pInString, &pWindow, 13, 0) + 7; 16527 v12 = pFontCreate->CalcTextHeight(pInString, &pWindow, 13, 0) + 7;
16523 } 16528 }
16524 pRenderer->_4A6A68(8, 352 - v12, (Texture *)(uTextureID_Leather != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Leather] : 0), 16529 if (uTextureID_Leather != -1)
16525 (uTextureID_Leather != -1 ? pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight : 26) - v12); 16530 pRenderer->_4A6A68(8, 352 - v12, &pIcons_LOD->pTextures[uTextureID_Leather], pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight - v12);
16526 pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428); 16531 pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428);
16527 v13 = FitTextInAWindow(pInString, pOutString, &pWindow, 0xDu, 0); 16532 v13 = FitTextInAWindow(pInString, pOutString, &pWindow, 0xDu, 0);
16528 pDialogueWindow->DrawText(pOutString, 13, 354 - v12, 0, v13, 0, 0, 0); 16533 pDialogueWindow->DrawText(pOutString, 13, 354 - v12, 0, v13, 0, 0, 0);
16529 } 16534 }
16530 } 16535 }
16548 if ( v16 > 88 ) 16553 if ( v16 > 88 )
16549 { 16554 {
16550 v24 = ""; 16555 v24 = "";
16551 } 16556 }
16552 else if ( v16 == 88 ) 16557 else if ( v16 == 88 )
16553 v24 = pGlobalTXT_LocalizationStrings[581]; 16558 v24 = pGlobalTXT_LocalizationStrings[581]; // Lord
16554 else if ( v16 == 87 ) 16559 else if ( v16 == 87 )
16555 v24 = pGlobalTXT_LocalizationStrings[580]; 16560 v24 = pGlobalTXT_LocalizationStrings[580]; // Knight
16556 else if ( v16 == 86 ) 16561 else if ( v16 == 86 )
16557 v24 = pGlobalTXT_LocalizationStrings[579]; 16562 v24 = pGlobalTXT_LocalizationStrings[579]; // Squire
16558 else if ( v16 == 85 ) 16563 else if ( v16 == 85 )
16559 v24 = pGlobalTXT_LocalizationStrings[578]; 16564 v24 = pGlobalTXT_LocalizationStrings[578]; // Page
16560 else if ( v16 == 77 ) 16565 else if ( v16 == 77 )
16561 v24 = pGlobalTXT_LocalizationStrings[407]; 16566 v24 = pGlobalTXT_LocalizationStrings[407]; // Details
16562 else if ( v16 == 76 ) 16567 else if ( v16 == 76 )
16563 { 16568 {
16564 if ( pNPC->uFlags & 0x80 ) 16569 if (pNPC->Hired())
16565 { 16570 {
16566 sprintf(pTmpBuf, (const char*)pGlobalTXT_LocalizationStrings[408], pNPC->pName); 16571 sprintf(pTmpBuf, (const char*)pGlobalTXT_LocalizationStrings[408], pNPC->pName); // Release %s
16567 v24 = pTmpBuf; 16572 v24 = pTmpBuf;
16568 } 16573 }
16569 else 16574 else
16570 v24 = pGlobalTXT_LocalizationStrings[406]; 16575 v24 = pGlobalTXT_LocalizationStrings[406]; // Hire
16571 } 16576 }
16572 else if ( v16 == 24 ) 16577 else if ( v16 == 24 )
16573 { 16578 {
16574 v23 = pNPC->evtf; 16579 v23 = pNPC->evtf;
16575 v24 = pNPCTopics[v23-1].pTopic;//(&dword_721660)[8 * v23]; 16580 v24 = pNPCTopics[v23-1].pTopic;//(&dword_721660)[8 * v23];
16631 v15->uControlParam = 0; 16636 v15->uControlParam = 0;
16632 } 16637 }
16633 } 16638 }
16634 else if ( v16 == 13 ) 16639 else if ( v16 == 13 )
16635 { 16640 {
16636 if ( pNPC->uFlags & 0x80 ) 16641 if (pNPC->Hired())
16637 { 16642 {
16638 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[408], pNPC->pName); 16643 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[408], pNPC->pName); // Release %s
16639 v24 = pTmpBuf; 16644 v24 = pTmpBuf;
16640 } 16645 }
16641 else 16646 else
16642 v24 = pGlobalTXT_LocalizationStrings[122]; 16647 v24 = pGlobalTXT_LocalizationStrings[122]; // Join
16643 } 16648 }
16644 else 16649 else
16645 v24 = ""; 16650 v24 = "";
16646 16651
16647 16652
16838 16843
16839 if (pNPCStats->uNumNewNPCs > 0) 16844 if (pNPCStats->uNumNewNPCs > 0)
16840 { 16845 {
16841 for (i = 0; i < pNPCStats->uNumNewNPCs; ++i) 16846 for (i = 0; i < pNPCStats->uNumNewNPCs; ++i)
16842 { 16847 {
16843 if (pNPCStats->pNewNPCData[i].uFlags & 0x80) 16848 if (pNPCStats->pNewNPCData[i].Hired())
16844 { 16849 {
16845 if (!pParty->pHirelings[0].pName || strcmp((char *)pNPCStats->pNewNPCData[i].pName, (char *)pParty->pHirelings[0].pName)) 16850 if (!pParty->pHirelings[0].pName || strcmp((char *)pNPCStats->pNewNPCData[i].pName, (char *)pParty->pHirelings[0].pName))
16846 { 16851 {
16847 if (!pParty->pHirelings[1].pName || strcmp((char *)pNPCStats->pNewNPCData[i].pName, (char *)pParty->pHirelings[1].pName)) 16852 if (!pParty->pHirelings[1].pName || strcmp((char *)pNPCStats->pNewNPCData[i].pName, (char *)pParty->pHirelings[1].pName))
16848 pTmpBuf[v4++] = i + 2; 16853 pTmpBuf[v4++] = i + 2;
16924 { 16929 {
16925 v9 = pNPCStats->pNewNPCData; 16930 v9 = pNPCStats->pNewNPCData;
16926 v16 = &pTmpBuf[v6]; 16931 v16 = &pTmpBuf[v6];
16927 do 16932 do
16928 { 16933 {
16929 if ( v9->uFlags & 0x80 16934 if ( v9->Hired()
16930 && (!pParty->pHirelings[0].pName || strcmp(v9->pName, pParty->pHirelings[0].pName)) 16935 && (!pParty->pHirelings[0].pName || strcmp(v9->pName, pParty->pHirelings[0].pName))
16931 && (!pParty->pHirelings[1].pName || strcmp(v9->pName, pParty->pHirelings[1].pName)) ) 16936 && (!pParty->pHirelings[1].pName || strcmp(v9->pName, pParty->pHirelings[1].pName)) )
16932 { 16937 {
16933 v10 = (int)v16++; 16938 v10 = (int)v16++;
16934 *(char *)v10 = v17 + 2; 16939 *(char *)v10 = v17 + 2;
16990 { 16995 {
16991 v7 = &pTmpBuf[v4]; 16996 v7 = &pTmpBuf[v4];
16992 v8 = pNPCStats->pNewNPCData; 16997 v8 = pNPCStats->pNewNPCData;
16993 do 16998 do
16994 { 16999 {
16995 if ( v8->uFlags & 0x80 && (!pParty->pHirelings[0].pName || strcmp(v8->pName, pParty->pHirelings[0].pName)) ) 17000 if (v8->Hired() && (!pParty->pHirelings[0].pName || strcmp(v8->pName, pParty->pHirelings[0].pName)) )
16996 { 17001 {
16997 if ( !pParty->pHirelings[1].pName || strcmp(v8->pName, pParty->pHirelings[1].pName) ) 17002 if ( !pParty->pHirelings[1].pName || strcmp(v8->pName, pParty->pHirelings[1].pName) )
16998 *v7++ = v1 + 2; 17003 *v7++ = v1 + 2;
16999 } 17004 }
17000 ++v1; 17005 ++v1;
20108 pParty->field_70A = 0; 20113 pParty->field_70A = 0;
20109 20114
20110 for (int i = 0; i < pNPCStats->uNumNewNPCs; ++i) 20115 for (int i = 0; i < pNPCStats->uNumNewNPCs; ++i)
20111 { 20116 {
20112 auto npc = pNPCStats->pNewNPCData + i; 20117 auto npc = pNPCStats->pNewNPCData + i;
20113 if (npc->uFlags & 0x80 && 20118 if (npc->Hired() &&
20114 (!pParty->pHirelings[0].pName || strcmp(npc->pName, pParty->pHirelings[0].pName))) 20119 (!pParty->pHirelings[0].pName || strcmp(npc->pName, pParty->pHirelings[0].pName)))
20115 { 20120 {
20116 if (!pParty->pHirelings[1].pName || strcmp(npc->pName, pParty->pHirelings[1].pName)) 20121 if (!pParty->pHirelings[1].pName || strcmp(npc->pName, pParty->pHirelings[1].pName))
20117 ++pParty->field_70A; 20122 ++pParty->field_70A;
20118 } 20123 }