Mercurial > mm7
comparison mm7_3.cpp @ 252:e22e2357c8b3
Merge
author | Gloval |
---|---|
date | Mon, 18 Feb 2013 08:59:34 +0400 |
parents | 48f21f569328 37dcbe8f3cca |
children | f1218b9d67f1 |
comparison
equal
deleted
inserted
replaced
251:48f21f569328 | 252:e22e2357c8b3 |
---|---|
4701 --uNumActions; | 4701 --uNumActions; |
4702 | 4702 |
4703 return result; | 4703 return result; |
4704 } | 4704 } |
4705 | 4705 |
4706 //----- (00476387) -------------------------------------------------------- | |
4707 bool PartyHasDragon() | |
4708 { | |
4709 return pNPCStats->pNewNPCData[57].Hired(); | |
4710 } | |
4706 | 4711 |
4707 | 4712 |
4708 // 47730C: using guessed type int __stdcall const_1(int); | 4713 // 47730C: using guessed type int __stdcall const_1(int); |
4709 | 4714 |
4710 //----- (0047752B) -------------------------------------------------------- | 4715 //----- (0047752B) -------------------------------------------------------- |
15039 NPCData *pNPC; // ebx@2 | 15044 NPCData *pNPC; // ebx@2 |
15040 int v1; // eax@2 | 15045 int v1; // eax@2 |
15041 unsigned __int16 v2; // di@2 | 15046 unsigned __int16 v2; // di@2 |
15042 //unsigned int v3; // eax@2 | 15047 //unsigned int v3; // eax@2 |
15043 char *v4; // esi@3 | 15048 char *v4; // esi@3 |
15044 int v5; // eax@11 | 15049 //int v5; // eax@11 |
15045 char *v6; // ecx@13 | 15050 char *v6; // ecx@13 |
15046 char *v7; // eax@16 | 15051 char *v7; // eax@16 |
15047 unsigned int v8; // edi@19 | 15052 unsigned int v8; // edi@19 |
15048 char *v9; // ecx@27 | 15053 char *v9; // ecx@27 |
15049 char *v10; // eax@29 | 15054 char *v10; // eax@29 |
15097 v2 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0x15u, 0x99u, 0xE9u); | 15102 v2 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0x15u, 0x99u, 0xE9u); |
15098 pRenderer->DrawTextureIndexed(477, 0, pTexture_Dialogue_Background); | 15103 pRenderer->DrawTextureIndexed(477, 0, pTexture_Dialogue_Background); |
15099 pRenderer->DrawTextureTransparent(468, 0, (Texture *)(uTextureID_507B04 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_507B04] : 0)); | 15104 pRenderer->DrawTextureTransparent(468, 0, (Texture *)(uTextureID_507B04 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_507B04] : 0)); |
15100 pRenderer->DrawTextureIndexed(pNPCPortraits_x - 4, pNPCPortraits_y - 4, (Texture *)(uTextureID_50795C != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_50795C] : 0)); | 15105 pRenderer->DrawTextureIndexed(pNPCPortraits_x - 4, pNPCPortraits_y - 4, (Texture *)(uTextureID_50795C != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_50795C] : 0)); |
15101 pRenderer->DrawTextureIndexed(pNPCPortraits_x, pNPCPortraits_y, pDialogueNPCPortraits[0]); | 15106 pRenderer->DrawTextureIndexed(pNPCPortraits_x, pNPCPortraits_y, pDialogueNPCPortraits[0]); |
15102 if ( pNPC->uProfession ) | 15107 |
15103 { | 15108 if (pNPC->uProfession) |
15104 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[429], pNPC->pName, aNPCProfessionNames[pNPC->uProfession]);//^Pi[%s] %s | 15109 { |
15110 assert(pNPC->uProfession < sizeof(aNPCProfessionNames) / sizeof(*aNPCProfessionNames)); // sometimes buffer overflows; errors emerge both here and in dialogue text | |
15111 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[429], pNPC->pName, aNPCProfessionNames[pNPC->uProfession]);//^Pi[%s] %s | |
15105 } | 15112 } |
15106 else | 15113 else |
15107 { | |
15108 strcpy(pTmpBuf, pNPC->pName); | 15114 strcpy(pTmpBuf, pNPC->pName); |
15109 } | 15115 |
15110 v51.DrawTitleText(pFontArrus, 483, 112, v2, pTmpBuf, 3); | 15116 v51.DrawTitleText(pFontArrus, 483, 112, v2, pTmpBuf, 3); |
15111 pParty->GetPartyFame(); | 15117 pParty->GetPartyFame(); |
15112 if ( (signed int)uDialogueType > DIALOGUE_ARENA_WELCOME ) | 15118 |
15113 { | 15119 switch (uDialogueType) |
15114 if ( uDialogueType == DIALOGUE_ARENA_FIGHT_NOT_OVER_YET ) | 15120 { |
15115 { | 15121 case DIALOGUE_PROFESSION_DETAILS: |
15116 pWindow.uFrameWidth = 460; | 15122 { |
15117 pWindow.uFrameZ = 452; | 15123 if (dialogue_show_profession_details) |
15118 pOutString = pFontArrus; | |
15119 v12 = pFontArrus->CalcTextHeight(pGlobalTXT_LocalizationStrings[577], &pWindow, 13, 0) + 7;//"Get back in there you wimps:" | |
15120 if ( 352 - v12 < 8 ) | |
15121 { | |
15122 pOutString = pFontCreate; | |
15123 v12 = pFontCreate->CalcTextHeight(pGlobalTXT_LocalizationStrings[577], &pWindow, 13, 0) + 7; | |
15124 } | |
15125 pRenderer->_4A6A68(8, 352 - v12, (Texture *)(uTextureID_Leather != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Leather] : 0), | |
15126 (uTextureID_Leather != -1 ? pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight : 26) - v12); | |
15127 pRenderer->DrawTextureIndexed(8, 347 - v12, pTexture_591428); | |
15128 v13 = FitTextInAWindow(pGlobalTXT_LocalizationStrings[577], pFontArrus, &pWindow, 0xDu, 0); | |
15129 pDialogueWindow->DrawText(pFontArrus, 13, 354 - v12, 0, v13, 0, 0, 0); | |
15130 } | |
15131 else if ( uDialogueType == DIALOGUE_ARENA_REWARD ) | |
15132 { | |
15133 sprintf(v4, pGlobalTXT_LocalizationStrings[576], dword_F8B1B4);// "Congratulations on your win: here's your stuff: %u gold." | |
15134 pInString = v4; | |
15135 pWindow.uFrameWidth = 460; | |
15136 pWindow.uFrameZ = 452; | |
15137 pOutString = pFontArrus; | |
15138 v12 = pFontArrus->CalcTextHeight(pInString, &pWindow, 13, 0) + 7; | |
15139 if ( 352 - v12 < 8 ) | |
15140 { | |
15141 pOutString = pFontCreate; | |
15142 v12 = pFontCreate->CalcTextHeight(pInString, &pWindow, 13, 0) + 7; | |
15143 } | |
15144 pRenderer->_4A6A68(8, 352 - v12, (Texture *)(uTextureID_Leather != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Leather] : 0), | |
15145 (uTextureID_Leather != -1 ? pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight : 26) - v12); | |
15146 pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428); | |
15147 v13 = FitTextInAWindow(pInString, pOutString, &pWindow, 0xDu, 0); | |
15148 pDialogueWindow->DrawText(pOutString, 13, 354 - v12, 0, v13, 0, 0, 0); | |
15149 } | |
15150 else if ( uDialogueType == DIALOGUE_ARENA_ALREADY_WON ) | |
15151 { | |
15152 pInString = pGlobalTXT_LocalizationStrings[582]; // "You already won this trip to the Arena:" | |
15153 pWindow.uFrameWidth = 460; | |
15154 pWindow.uFrameZ = 452; | |
15155 pOutString = pFontArrus; | |
15156 v12 = pFontArrus->CalcTextHeight(pInString, &pWindow, 13, 0) + 7; | |
15157 if ( 352 - v12 < 8 ) | |
15158 { | |
15159 pOutString = pFontCreate; | |
15160 v12 = pFontCreate->CalcTextHeight(pInString, &pWindow, 13, 0) + 7; | |
15161 } | |
15162 pRenderer->_4A6A68(8, 352 - v12, (Texture *)(uTextureID_Leather != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Leather] : 0), | |
15163 (uTextureID_Leather != -1 ? pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight : 26) - v12); | |
15164 pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428); | |
15165 v13 = FitTextInAWindow(pInString, pOutString, &pWindow, 0xDu, 0); | |
15166 pDialogueWindow->DrawText(pOutString, 13, 354 - v12, 0, v13, 0, 0, 0); | |
15167 } | |
15168 } | |
15169 else | |
15170 { | |
15171 if ( uDialogueType == DIALOGUE_ARENA_WELCOME ) | |
15172 { | |
15173 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:" | |
15174 pInString = v7; | |
15175 pWindow.uFrameWidth = 460; | |
15176 pWindow.uFrameZ = 452; | |
15177 pOutString = pFontArrus; | |
15178 v12 = pFontArrus->CalcTextHeight(pInString, &pWindow, 13, 0) + 7; | |
15179 if ( 352 - v12 < 8 ) | |
15180 { | |
15181 pOutString = pFontCreate; | |
15182 v12 = pFontCreate->CalcTextHeight(pInString, &pWindow, 13, 0) + 7; | |
15183 } | |
15184 pRenderer->_4A6A68(8, 352 - v12, (Texture *)(uTextureID_Leather != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Leather] : 0), | |
15185 (uTextureID_Leather != -1 ? pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight : 26) - v12); | |
15186 pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428); | |
15187 v13 = FitTextInAWindow(pInString, pOutString, &pWindow, 0xDu, 0); | |
15188 pDialogueWindow->DrawText(pOutString, 13, 354 - v12, 0, v13, 0, 0, 0); | |
15189 } | |
15190 else if ( uDialogueType == DIALOGUE_13 ) | |
15191 { | |
15192 v5 = 5 * pNPC->uProfession; | |
15193 v6 = (char *)*(&pNPCStats->field_13A64 + v5); | |
15194 v7 = sub_495461(v6, uActiveCharacter - 1, 0, 0, 0, 0); | |
15195 pInString = v7; | |
15196 pWindow.uFrameWidth = 460; | |
15197 pWindow.uFrameZ = 452; | |
15198 pOutString = pFontArrus; | |
15199 v12 = pFontArrus->CalcTextHeight(pInString, &pWindow, 13, 0) + 7; | |
15200 if ( 352 - v12 < 8 ) | |
15201 { | |
15202 pOutString = pFontCreate; | |
15203 v12 = pFontCreate->CalcTextHeight(pInString, &pWindow, 13, 0) + 7; | |
15204 } | |
15205 pRenderer->_4A6A68(8, 352 - v12, (Texture *)(uTextureID_Leather != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Leather] : 0), | |
15206 (uTextureID_Leather != -1 ? pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight : 26) - v12); | |
15207 pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428); | |
15208 v13 = FitTextInAWindow(pInString, pOutString, &pWindow, 0xDu, 0); | |
15209 pDialogueWindow->DrawText(pOutString, 13, 354 - v12, 0, v13, 0, 0, 0); | |
15210 } | |
15211 else if ( (signed int)uDialogueType > DIALOGUE_18 && !((signed int)uDialogueType > DIALOGUE_24 && uDialogueType != DIALOGUE_77 || byte_5B0938[0]) ) | |
15212 { | |
15213 if ( (signed int)uDialogueType > DIALOGUE_24 && uDialogueType == DIALOGUE_77 ) | |
15214 { | |
15215 v5 = 5 * pNPC->uProfession; | |
15216 if ( byte_F8B1EC ) | |
15217 { | 15124 { |
15218 v6 = (char *)*(&pNPCStats->field_13A5C + 5 * pNPC->uProfession); | 15125 v6 = pNPCStats->pProfessions[pNPC->uProfession - 1].pBenefits; |
15219 v7 = sub_495461(v6, uActiveCharacter - 1, 0, 0, 0, 0); | 15126 v7 = sub_495461(v6, uActiveCharacter - 1, 0, 0, 0, 0); |
15220 pInString = v7; | 15127 pInString = v7; |
15221 pWindow.uFrameWidth = 460; | 15128 pWindow.uFrameWidth = 460; |
15222 pWindow.uFrameZ = 452; | 15129 pWindow.uFrameZ = 452; |
15223 pOutString = pFontArrus; | 15130 pOutString = pFontArrus; |
15225 if ( 352 - v12 < 8 ) | 15132 if ( 352 - v12 < 8 ) |
15226 { | 15133 { |
15227 pOutString = pFontCreate; | 15134 pOutString = pFontCreate; |
15228 v12 = pFontCreate->CalcTextHeight(pInString, &pWindow, 13, 0) + 7; | 15135 v12 = pFontCreate->CalcTextHeight(pInString, &pWindow, 13, 0) + 7; |
15229 } | 15136 } |
15230 pRenderer->_4A6A68(8, 352 - v12, (Texture *)(uTextureID_Leather != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Leather] : 0), | 15137 if (uTextureID_Leather != -1) |
15231 (uTextureID_Leather != -1 ? pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight : 26) - v12); | 15138 pRenderer->_4A6A68(8, 352 - v12, &pIcons_LOD->pTextures[uTextureID_Leather], pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight - v12); |
15232 pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428); | 15139 pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428); |
15233 v13 = FitTextInAWindow(pInString, pOutString, &pWindow, 0xDu, 0); | 15140 v13 = FitTextInAWindow(pInString, pOutString, &pWindow, 0xDu, 0); |
15234 pDialogueWindow->DrawText(pOutString, 13, 354 - v12, 0, v13, 0, 0, 0); | 15141 pDialogueWindow->DrawText(pOutString, 13, 354 - v12, 0, v13, 0, 0, 0); |
15235 } | 15142 } |
15236 else if ( pNPC->uFlags & 0x80 ) | 15143 else if (pNPC->Hired()) |
15237 { | 15144 { |
15238 v6 = (char *)*(&pNPCStats->field_13A68 + 5 * pNPC->uProfession); | 15145 v6 = pNPCStats->pProfessions[pNPC->uProfession - 1].pDismissText; |
15239 v7 = sub_495461(v6, uActiveCharacter - 1, 0, 0, 0, 0); | 15146 v7 = sub_495461(v6, uActiveCharacter - 1, 0, 0, 0, 0); |
15240 pInString = v7; | 15147 pInString = v7; |
15241 pWindow.uFrameWidth = 460; | 15148 pWindow.uFrameWidth = 460; |
15242 pWindow.uFrameZ = 452; | 15149 pWindow.uFrameZ = 452; |
15243 pOutString = pFontArrus; | 15150 pOutString = pFontArrus; |
15245 if ( 352 - v12 < 8 ) | 15152 if ( 352 - v12 < 8 ) |
15246 { | 15153 { |
15247 pOutString = pFontCreate; | 15154 pOutString = pFontCreate; |
15248 v12 = pFontCreate->CalcTextHeight(pInString, &pWindow, 13, 0) + 7; | 15155 v12 = pFontCreate->CalcTextHeight(pInString, &pWindow, 13, 0) + 7; |
15249 } | 15156 } |
15250 pRenderer->_4A6A68(8, 352 - v12, (Texture *)(uTextureID_Leather != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Leather] : 0), | 15157 if (uTextureID_Leather != -1) |
15251 (uTextureID_Leather != -1 ? pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight : 26) - v12); | 15158 pRenderer->_4A6A68(8, 352 - v12, &pIcons_LOD->pTextures[uTextureID_Leather], pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight - v12); |
15252 pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428); | 15159 pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428); |
15253 v13 = FitTextInAWindow(pInString, pOutString, &pWindow, 0xDu, 0); | 15160 v13 = FitTextInAWindow(pInString, pOutString, &pWindow, 0xDu, 0); |
15254 pDialogueWindow->DrawText(pOutString, 13, 354 - v12, 0, v13, 0, 0, 0); | 15161 pDialogueWindow->DrawText(pOutString, 13, 354 - v12, 0, v13, 0, 0, 0); |
15255 } | 15162 } |
15256 else | 15163 else |
15257 { | 15164 { |
15258 v6 = (char *)*(&pNPCStats->field_13A64 + v5); | 15165 v6 = pNPCStats->pProfessions[pNPC->uProfession - 1].pJoinText; |
15259 v7 = sub_495461(v6, uActiveCharacter - 1, 0, 0, 0, 0); | 15166 v7 = sub_495461(v6, uActiveCharacter - 1, 0, 0, 0, 0); |
15260 pInString = v7; | 15167 pInString = v7; |
15261 pWindow.uFrameWidth = 460; | 15168 pWindow.uFrameWidth = 460; |
15262 pWindow.uFrameZ = 452; | 15169 pWindow.uFrameZ = 452; |
15263 pOutString = pFontArrus; | 15170 pOutString = pFontArrus; |
15265 if ( 352 - v12 < 8 ) | 15172 if ( 352 - v12 < 8 ) |
15266 { | 15173 { |
15267 pOutString = pFontCreate; | 15174 pOutString = pFontCreate; |
15268 v12 = pFontCreate->CalcTextHeight(pInString, &pWindow, 13, 0) + 7; | 15175 v12 = pFontCreate->CalcTextHeight(pInString, &pWindow, 13, 0) + 7; |
15269 } | 15176 } |
15270 pRenderer->_4A6A68(8, 352 - v12, (Texture *)(uTextureID_Leather != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Leather] : 0), | 15177 if (uTextureID_Leather != -1) |
15271 (uTextureID_Leather != -1 ? pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight : 26) - v12); | 15178 pRenderer->_4A6A68(8, 352 - v12, &pIcons_LOD->pTextures[uTextureID_Leather], pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight - v12); |
15272 pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428); | 15179 pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428); |
15273 v13 = FitTextInAWindow(pInString, pOutString, &pWindow, 0xDu, 0); | 15180 v13 = FitTextInAWindow(pInString, pOutString, &pWindow, 0xDu, 0); |
15274 pDialogueWindow->DrawText(pOutString, 13, 354 - v12, 0, v13, 0, 0, 0); | 15181 pDialogueWindow->DrawText(pOutString, 13, 354 - v12, 0, v13, 0, 0, 0); |
15275 } | 15182 } |
15276 } | 15183 } |
15277 else | 15184 break; |
15185 } | |
15186 | |
15187 if ( (signed int)uDialogueType > DIALOGUE_ARENA_WELCOME ) | |
15188 { | |
15189 if ( uDialogueType == DIALOGUE_ARENA_FIGHT_NOT_OVER_YET ) | |
15190 { | |
15191 pWindow.uFrameWidth = 460; | |
15192 pWindow.uFrameZ = 452; | |
15193 pOutString = pFontArrus; | |
15194 v12 = pFontArrus->CalcTextHeight(pGlobalTXT_LocalizationStrings[577], &pWindow, 13, 0) + 7;//"Get back in there you wimps:" | |
15195 if ( 352 - v12 < 8 ) | |
15196 { | |
15197 pOutString = pFontCreate; | |
15198 v12 = pFontCreate->CalcTextHeight(pGlobalTXT_LocalizationStrings[577], &pWindow, 13, 0) + 7; | |
15199 } | |
15200 pRenderer->_4A6A68(8, 352 - v12, (Texture *)(uTextureID_Leather != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Leather] : 0), | |
15201 (uTextureID_Leather != -1 ? pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight : 26) - v12); | |
15202 pRenderer->DrawTextureIndexed(8, 347 - v12, pTexture_591428); | |
15203 v13 = FitTextInAWindow(pGlobalTXT_LocalizationStrings[577], pFontArrus, &pWindow, 0xDu, 0); | |
15204 pDialogueWindow->DrawText(pFontArrus, 13, 354 - v12, 0, v13, 0, 0, 0); | |
15205 } | |
15206 else if ( uDialogueType == DIALOGUE_ARENA_REWARD ) | |
15207 { | |
15208 sprintf(v4, pGlobalTXT_LocalizationStrings[576], dword_F8B1B4);// "Congratulations on your win: here's your stuff: %u gold." | |
15209 pInString = v4; | |
15210 pWindow.uFrameWidth = 460; | |
15211 pWindow.uFrameZ = 452; | |
15212 pOutString = pFontArrus; | |
15213 v12 = pFontArrus->CalcTextHeight(pInString, &pWindow, 13, 0) + 7; | |
15214 if ( 352 - v12 < 8 ) | |
15215 { | |
15216 pOutString = pFontCreate; | |
15217 v12 = pFontCreate->CalcTextHeight(pInString, &pWindow, 13, 0) + 7; | |
15218 } | |
15219 pRenderer->_4A6A68(8, 352 - v12, (Texture *)(uTextureID_Leather != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Leather] : 0), | |
15220 (uTextureID_Leather != -1 ? pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight : 26) - v12); | |
15221 pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428); | |
15222 v13 = FitTextInAWindow(pInString, pOutString, &pWindow, 0xDu, 0); | |
15223 pDialogueWindow->DrawText(pOutString, 13, 354 - v12, 0, v13, 0, 0, 0); | |
15224 } | |
15225 else if ( uDialogueType == DIALOGUE_ARENA_ALREADY_WON ) | |
15226 { | |
15227 pInString = pGlobalTXT_LocalizationStrings[582]; // "You already won this trip to the Arena:" | |
15228 pWindow.uFrameWidth = 460; | |
15229 pWindow.uFrameZ = 452; | |
15230 pOutString = pFontArrus; | |
15231 v12 = pFontArrus->CalcTextHeight(pInString, &pWindow, 13, 0) + 7; | |
15232 if ( 352 - v12 < 8 ) | |
15233 { | |
15234 pOutString = pFontCreate; | |
15235 v12 = pFontCreate->CalcTextHeight(pInString, &pWindow, 13, 0) + 7; | |
15236 } | |
15237 pRenderer->_4A6A68(8, 352 - v12, (Texture *)(uTextureID_Leather != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Leather] : 0), | |
15238 (uTextureID_Leather != -1 ? pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight : 26) - v12); | |
15239 pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428); | |
15240 v13 = FitTextInAWindow(pInString, pOutString, &pWindow, 0xDu, 0); | |
15241 pDialogueWindow->DrawText(pOutString, 13, 354 - v12, 0, v13, 0, 0, 0); | |
15242 } | |
15243 } | |
15244 else | |
15245 { | |
15246 if ( uDialogueType == DIALOGUE_ARENA_WELCOME ) | |
15247 { | |
15248 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:" | |
15249 pInString = v7; | |
15250 pWindow.uFrameWidth = 460; | |
15251 pWindow.uFrameZ = 452; | |
15252 pOutString = pFontArrus; | |
15253 v12 = pFontArrus->CalcTextHeight(pInString, &pWindow, 13, 0) + 7; | |
15254 if ( 352 - v12 < 8 ) | |
15255 { | |
15256 pOutString = pFontCreate; | |
15257 v12 = pFontCreate->CalcTextHeight(pInString, &pWindow, 13, 0) + 7; | |
15258 } | |
15259 pRenderer->_4A6A68(8, 352 - v12, (Texture *)(uTextureID_Leather != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Leather] : 0), | |
15260 (uTextureID_Leather != -1 ? pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight : 26) - v12); | |
15261 pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428); | |
15262 v13 = FitTextInAWindow(pInString, pOutString, &pWindow, 0xDu, 0); | |
15263 pDialogueWindow->DrawText(pOutString, 13, 354 - v12, 0, v13, 0, 0, 0); | |
15264 } | |
15265 else if ( uDialogueType == DIALOGUE_13 ) | |
15266 { | |
15267 v6 = pNPCStats->pProfessions[pNPC->uProfession - 1].pJoinText; | |
15268 v7 = sub_495461(v6, uActiveCharacter - 1, 0, 0, 0, 0); | |
15269 pInString = v7; | |
15270 pWindow.uFrameWidth = 460; | |
15271 pWindow.uFrameZ = 452; | |
15272 pOutString = pFontArrus; | |
15273 v12 = pFontArrus->CalcTextHeight(pInString, &pWindow, 13, 0) + 7; | |
15274 if ( 352 - v12 < 8 ) | |
15275 { | |
15276 pOutString = pFontCreate; | |
15277 v12 = pFontCreate->CalcTextHeight(pInString, &pWindow, 13, 0) + 7; | |
15278 } | |
15279 pRenderer->_4A6A68(8, 352 - v12, (Texture *)(uTextureID_Leather != -1 ? &pIcons_LOD->pTextures[uTextureID_Leather] : 0), | |
15280 (uTextureID_Leather != -1 ? pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight : 26) - v12); | |
15281 pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428); | |
15282 v13 = FitTextInAWindow(pInString, pOutString, &pWindow, 0xDu, 0); | |
15283 pDialogueWindow->DrawText(pOutString, 13, 354 - v12, 0, v13, 0, 0, 0); | |
15284 } | |
15285 else if ( (signed int)uDialogueType > DIALOGUE_18 && !((signed int)uDialogueType > DIALOGUE_24 && uDialogueType != DIALOGUE_PROFESSION_DETAILS || byte_5B0938[0]) ) | |
15286 { | |
15287 if ((signed int)uDialogueType <= DIALOGUE_23) | |
15278 { | 15288 { |
15279 v7 = (char *)ptr_F8B1E8; | 15289 v7 = (char *)ptr_F8B1E8; |
15280 pInString = v7; | 15290 pInString = v7; |
15281 pWindow.uFrameWidth = 460; | 15291 pWindow.uFrameWidth = 460; |
15282 pWindow.uFrameZ = 452; | 15292 pWindow.uFrameZ = 452; |
15285 if ( 352 - v12 < 8 ) | 15295 if ( 352 - v12 < 8 ) |
15286 { | 15296 { |
15287 pOutString = pFontCreate; | 15297 pOutString = pFontCreate; |
15288 v12 = pFontCreate->CalcTextHeight(pInString, &pWindow, 13, 0) + 7; | 15298 v12 = pFontCreate->CalcTextHeight(pInString, &pWindow, 13, 0) + 7; |
15289 } | 15299 } |
15290 pRenderer->_4A6A68(8, 352 - v12, (Texture *)(uTextureID_Leather != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Leather] : 0), | 15300 pRenderer->_4A6A68(8, 352 - v12, (Texture *)(uTextureID_Leather != -1 ? &pIcons_LOD->pTextures[uTextureID_Leather] : 0), |
15291 (uTextureID_Leather != -1 ? pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight : 26) - v12); | 15301 (uTextureID_Leather != -1 ? pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight : 26) - v12); |
15292 pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428); | 15302 pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428); |
15293 v13 = FitTextInAWindow(pInString, pOutString, &pWindow, 0xDu, 0); | 15303 v13 = FitTextInAWindow(pInString, pOutString, &pWindow, 0xDu, 0); |
15294 pDialogueWindow->DrawText(pOutString, 13, 354 - v12, 0, v13, 0, 0, 0); | 15304 pDialogueWindow->DrawText(pOutString, 13, 354 - v12, 0, v13, 0, 0, 0); |
15295 } | 15305 } |
15324 } | 15334 } |
15325 else | 15335 else |
15326 { | 15336 { |
15327 if ( *(int *)v54 == 2 ) | 15337 if ( *(int *)v54 == 2 ) |
15328 { | 15338 { |
15329 if ( pNPC->uFlags & 0x80 ) | 15339 if (pNPC->Hired()) |
15330 v9 = (char *)pNPCStats->pProfessions[pNPC->uProfession].pDismissText; | 15340 v9 = pNPCStats->pProfessions[pNPC->uProfession].pDismissText; |
15331 else | 15341 else |
15332 v9 = (char *)pNPCStats->pProfessions[pNPC->uProfession].pJoinText; //"Invalid String Passed" | 15342 v9 = pNPCStats->pProfessions[pNPC->uProfession].pJoinText; //"Invalid String Passed" |
15333 pInString = sub_495461(v9, uActiveCharacter - 1, 0, 0, 0, 0); | 15343 pInString = sub_495461(v9, uActiveCharacter - 1, 0, 0, 0, 0); |
15334 if ( pInString != NULL ) | 15344 if ( pInString != NULL ) |
15335 { | 15345 { |
15336 pWindow.uFrameWidth = 460; | 15346 pWindow.uFrameWidth = 460; |
15337 pWindow.uFrameZ = 452; | 15347 pWindow.uFrameZ = 452; |
15340 if ( 352 - v12 < 8 ) | 15350 if ( 352 - v12 < 8 ) |
15341 { | 15351 { |
15342 pOutString = pFontCreate; | 15352 pOutString = pFontCreate; |
15343 v12 = pFontCreate->CalcTextHeight(pInString, &pWindow, 13, 0) + 7; | 15353 v12 = pFontCreate->CalcTextHeight(pInString, &pWindow, 13, 0) + 7; |
15344 } | 15354 } |
15345 pRenderer->_4A6A68(8, 352 - v12, (Texture *)(uTextureID_Leather != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Leather] : 0), | 15355 if (uTextureID_Leather != -1) |
15346 (uTextureID_Leather != -1 ? pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight : 26) - v12); | 15356 pRenderer->_4A6A68(8, 352 - v12, &pIcons_LOD->pTextures[uTextureID_Leather], pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight - v12); |
15347 pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428); | 15357 pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428); |
15348 v13 = FitTextInAWindow(pInString, pOutString, &pWindow, 0xDu, 0); | 15358 v13 = FitTextInAWindow(pInString, pOutString, &pWindow, 0xDu, 0); |
15349 pDialogueWindow->DrawText(pOutString, 13, 354 - v12, 0, v13, 0, 0, 0); | 15359 pDialogueWindow->DrawText(pOutString, 13, 354 - v12, 0, v13, 0, 0, 0); |
15350 } | 15360 } |
15351 } | 15361 } |
15369 if ( v16 > 88 ) | 15379 if ( v16 > 88 ) |
15370 { | 15380 { |
15371 v24 = ""; | 15381 v24 = ""; |
15372 } | 15382 } |
15373 else if ( v16 == 88 ) | 15383 else if ( v16 == 88 ) |
15374 v24 = pGlobalTXT_LocalizationStrings[581]; | 15384 v24 = pGlobalTXT_LocalizationStrings[581]; // Lord |
15375 else if ( v16 == 87 ) | 15385 else if ( v16 == 87 ) |
15376 v24 = pGlobalTXT_LocalizationStrings[580]; | 15386 v24 = pGlobalTXT_LocalizationStrings[580]; // Knight |
15377 else if ( v16 == 86 ) | 15387 else if ( v16 == 86 ) |
15378 v24 = pGlobalTXT_LocalizationStrings[579]; | 15388 v24 = pGlobalTXT_LocalizationStrings[579]; // Squire |
15379 else if ( v16 == 85 ) | 15389 else if ( v16 == 85 ) |
15380 v24 = pGlobalTXT_LocalizationStrings[578]; | 15390 v24 = pGlobalTXT_LocalizationStrings[578]; // Page |
15381 else if ( v16 == 77 ) | 15391 else if ( v16 == 77 ) |
15382 v24 = pGlobalTXT_LocalizationStrings[407]; | 15392 v24 = pGlobalTXT_LocalizationStrings[407]; // Details |
15383 else if ( v16 == 76 ) | 15393 else if ( v16 == 76 ) |
15384 { | 15394 { |
15385 if ( pNPC->uFlags & 0x80 ) | 15395 if (pNPC->Hired()) |
15386 { | 15396 { |
15387 sprintf(pTmpBuf, (const char*)pGlobalTXT_LocalizationStrings[408], pNPC->pName); | 15397 sprintf(pTmpBuf, (const char*)pGlobalTXT_LocalizationStrings[408], pNPC->pName); // Release %s |
15388 v24 = pTmpBuf; | 15398 v24 = pTmpBuf; |
15389 } | 15399 } |
15390 else | 15400 else |
15391 v24 = pGlobalTXT_LocalizationStrings[406]; | 15401 v24 = pGlobalTXT_LocalizationStrings[406]; // Hire |
15392 } | 15402 } |
15393 else if ( v16 == 24 ) | 15403 else if ( v16 == 24 ) |
15394 { | 15404 { |
15395 v23 = pNPC->evtf; | 15405 v23 = pNPC->evtf; |
15396 v24 = pNPCTopics[v23-1].pTopic;//(&dword_721660)[8 * v23]; | 15406 v24 = pNPCTopics[v23-1].pTopic;//(&dword_721660)[8 * v23]; |
15452 v15->uControlParam = 0; | 15462 v15->uControlParam = 0; |
15453 } | 15463 } |
15454 } | 15464 } |
15455 else if ( v16 == 13 ) | 15465 else if ( v16 == 13 ) |
15456 { | 15466 { |
15457 if ( pNPC->uFlags & 0x80 ) | 15467 if (pNPC->Hired()) |
15458 { | 15468 { |
15459 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[408], pNPC->pName); | 15469 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[408], pNPC->pName); // Release %s |
15460 v24 = pTmpBuf; | 15470 v24 = pTmpBuf; |
15461 } | 15471 } |
15462 else | 15472 else |
15463 v24 = pGlobalTXT_LocalizationStrings[122]; | 15473 v24 = pGlobalTXT_LocalizationStrings[122]; // Join |
15464 } | 15474 } |
15465 else | 15475 else |
15466 v24 = ""; | 15476 v24 = ""; |
15467 | 15477 |
15468 | 15478 |
15659 | 15669 |
15660 if (pNPCStats->uNumNewNPCs > 0) | 15670 if (pNPCStats->uNumNewNPCs > 0) |
15661 { | 15671 { |
15662 for (i = 0; i < pNPCStats->uNumNewNPCs; ++i) | 15672 for (i = 0; i < pNPCStats->uNumNewNPCs; ++i) |
15663 { | 15673 { |
15664 if (pNPCStats->pNewNPCData[i].uFlags & 0x80) | 15674 if (pNPCStats->pNewNPCData[i].Hired()) |
15665 { | 15675 { |
15666 if (!pParty->pHirelings[0].pName || strcmp((char *)pNPCStats->pNewNPCData[i].pName, (char *)pParty->pHirelings[0].pName)) | 15676 if (!pParty->pHirelings[0].pName || strcmp((char *)pNPCStats->pNewNPCData[i].pName, (char *)pParty->pHirelings[0].pName)) |
15667 { | 15677 { |
15668 if (!pParty->pHirelings[1].pName || strcmp((char *)pNPCStats->pNewNPCData[i].pName, (char *)pParty->pHirelings[1].pName)) | 15678 if (!pParty->pHirelings[1].pName || strcmp((char *)pNPCStats->pNewNPCData[i].pName, (char *)pParty->pHirelings[1].pName)) |
15669 pTmpBuf[v4++] = i + 2; | 15679 pTmpBuf[v4++] = i + 2; |
15745 { | 15755 { |
15746 v9 = pNPCStats->pNewNPCData; | 15756 v9 = pNPCStats->pNewNPCData; |
15747 v16 = &pTmpBuf[v6]; | 15757 v16 = &pTmpBuf[v6]; |
15748 do | 15758 do |
15749 { | 15759 { |
15750 if ( v9->uFlags & 0x80 | 15760 if ( v9->Hired() |
15751 && (!pParty->pHirelings[0].pName || strcmp(v9->pName, pParty->pHirelings[0].pName)) | 15761 && (!pParty->pHirelings[0].pName || strcmp(v9->pName, pParty->pHirelings[0].pName)) |
15752 && (!pParty->pHirelings[1].pName || strcmp(v9->pName, pParty->pHirelings[1].pName)) ) | 15762 && (!pParty->pHirelings[1].pName || strcmp(v9->pName, pParty->pHirelings[1].pName)) ) |
15753 { | 15763 { |
15754 v10 = (int)v16++; | 15764 v10 = (int)v16++; |
15755 *(char *)v10 = v17 + 2; | 15765 *(char *)v10 = v17 + 2; |
15811 { | 15821 { |
15812 v7 = &pTmpBuf[v4]; | 15822 v7 = &pTmpBuf[v4]; |
15813 v8 = pNPCStats->pNewNPCData; | 15823 v8 = pNPCStats->pNewNPCData; |
15814 do | 15824 do |
15815 { | 15825 { |
15816 if ( v8->uFlags & 0x80 && (!pParty->pHirelings[0].pName || strcmp(v8->pName, pParty->pHirelings[0].pName)) ) | 15826 if (v8->Hired() && (!pParty->pHirelings[0].pName || strcmp(v8->pName, pParty->pHirelings[0].pName)) ) |
15817 { | 15827 { |
15818 if ( !pParty->pHirelings[1].pName || strcmp(v8->pName, pParty->pHirelings[1].pName) ) | 15828 if ( !pParty->pHirelings[1].pName || strcmp(v8->pName, pParty->pHirelings[1].pName) ) |
15819 *v7++ = v1 + 2; | 15829 *v7++ = v1 + 2; |
15820 } | 15830 } |
15821 ++v1; | 15831 ++v1; |
18929 pParty->field_70A = 0; | 18939 pParty->field_70A = 0; |
18930 | 18940 |
18931 for (int i = 0; i < pNPCStats->uNumNewNPCs; ++i) | 18941 for (int i = 0; i < pNPCStats->uNumNewNPCs; ++i) |
18932 { | 18942 { |
18933 auto npc = pNPCStats->pNewNPCData + i; | 18943 auto npc = pNPCStats->pNewNPCData + i; |
18934 if (npc->uFlags & 0x80 && | 18944 if (npc->Hired() && |
18935 (!pParty->pHirelings[0].pName || strcmp(npc->pName, pParty->pHirelings[0].pName))) | 18945 (!pParty->pHirelings[0].pName || strcmp(npc->pName, pParty->pHirelings[0].pName))) |
18936 { | 18946 { |
18937 if (!pParty->pHirelings[1].pName || strcmp(npc->pName, pParty->pHirelings[1].pName)) | 18947 if (!pParty->pHirelings[1].pName || strcmp(npc->pName, pParty->pHirelings[1].pName)) |
18938 ++pParty->field_70A; | 18948 ++pParty->field_70A; |
18939 } | 18949 } |