comparison mm7_4.cpp @ 1209:decc0dd6e4ba

more on arcomage
author Gloval
date Sun, 09 Jun 2013 13:20:34 +0400
parents ab6560001f5b
children fd3bea473c0c be76a797780e
comparison
equal deleted inserted replaced
1208:4d90f0591add 1209:decc0dd6e4ba
8238 } 8238 }
8239 return 0; 8239 return 0;
8240 */ 8240 */
8241 } 8241 }
8242 8242
8243 //----- (004B6478) -------------------------------------------------------- 8243
8244 void sub_4B6478()
8245 {
8246 GUIWindow *v0; // ebx@1
8247 Player *v1; // edi@1
8248 unsigned int v2; // eax@1
8249 signed int v3; // esi@1
8250 int v4; // ebx@1
8251 unsigned int v5; // esi@5
8252 int v6; // edi@6
8253 int result; // eax@13
8254 GUIWindow *v8; // ebx@17
8255 int v9; // eax@17
8256 int v10; // ecx@17
8257 unsigned int v11; // ecx@18
8258 int v12; // eax@20
8259 int v13; // eax@21
8260 GUIButton *v14; // esi@27
8261 int v15; // ecx@27
8262 unsigned int v16; // eax@28
8263 const char *v17; // ebx@29
8264 int v18; // eax@29
8265 unsigned int v19; // ecx@29
8266 int v20; // eax@29
8267 unsigned __int16 v21; // ax@29
8268 unsigned __int16 v22; // ST14_2@36
8269 int v23; // eax@36
8270 const char *v24; // ST18_4@37
8271 unsigned __int16 v25; // ST14_2@37
8272 int v26; // eax@37
8273 int v27; // [sp-4h] [bp-80h]@8
8274 GUIWindow v28; // [sp+Ch] [bp-70h]@1
8275 GUIWindow *v29; // [sp+60h] [bp-1Ch]@17
8276 unsigned int v30; // [sp+64h] [bp-18h]@1
8277 int v31; // [sp+68h] [bp-14h]@1
8278 int v32; // [sp+6Ch] [bp-10h]@1
8279 int v33; // [sp+70h] [bp-Ch]@17
8280 int v34; // [sp+74h] [bp-8h]@17
8281 int v35; // [sp+78h] [bp-4h]@17
8282
8283 v0 = window_SpeakInHouse;
8284 memcpy(&v28, window_SpeakInHouse, sizeof(v28));
8285 v1 = pPlayers[uActiveCharacter];
8286 v28.uFrameX = 483;
8287 v28.uFrameWidth = 148;
8288 v28.uFrameZ = 334;
8289 v30 = TargetColor(0xFFu, 0xFFu, 0xFFu);
8290 v31 = TargetColor(0xFFu, 0xFFu, 0x9Bu);
8291 v2 = 52 * (unsigned int)v0->ptr_1C;
8292 //v32 = (unsigned __int8)(((p2DEvents_minus1___00[v2 / 2] != 18) - 1) & 0x96) + 100;
8293 v32 = (unsigned __int8)(((p2DEvents[(unsigned int)v0->ptr_1C - 1].uType != 18) - 1) & 0x96) + 100;
8294 //v3 = (signed __int64)((double)v32 * p2DEvents_minus1__20[v2 / 4]);
8295 v3 = (signed __int64)((double)v32 * p2DEvents[(unsigned int)v0->ptr_1C - 1].fPriceMultiplier);
8296 v4 = v3 * (100 - v1->GetMerchant()) / 100;
8297 v32 = v4;
8298 if ( v4 < v3 / 3 )
8299 {
8300 v4 = v3 / 3;
8301 v32 = v3 / 3;
8302 }
8303 if ( dialog_menu_id != HOUSE_DIALOGUE_MAIN)
8304 {
8305 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
8306 {
8307 v5 = 0;
8308
8309 __debugbreak();
8310 //pSkillAvailabilityPerClass[8 + v58->uClass][4 + v23]
8311 // or
8312 //byte_4ED970_skill_learn_ability_by_class_table[v58->uClass][v23 - 36]
8313 // or
8314 //byte_4ED970_skill_learn_ability_by_class_table[v58->uClass - 1][v23 + 1]
8315 __debugbreak(); // whacky condition - fix
8316 if (false
8317 //if ( !*(&byte_4ED94C[37 * v1->uClass / 3] + dword_F8B19C)
8318 || (v6 = (int)(&v1->uIntelligence + dialog_menu_id), *(short *)v6) )
8319 {
8320 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0);
8321 }
8322 else
8323 {
8324 if ( pParty->uNumGold < v4 )
8325 {
8326 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u);
8327 v27 = 4;
8328 }
8329 else
8330 {
8331 Party::TakeGold(v4);
8332 *(short *)v6 = 1;
8333 v27 = 2;
8334 }
8335 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, (HouseSoundID)v27);
8336 }
8337 }
8338 else
8339 {
8340 v5 = 0;
8341 }
8342 /*result = pMessageQueue_50CBD0->uNumMessages;
8343 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
8344 {
8345 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape;
8346 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 1;
8347 result = 3 * pMessageQueue_50CBD0->uNumMessages + 3;
8348 *(&pMessageQueue_50CBD0->uNumMessages + result) = v5;
8349 ++pMessageQueue_50CBD0->uNumMessages;
8350 }*/
8351 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, v5);
8352 return; // void func
8353 }
8354 if ( !(unsigned __int16)_449B57_test_bit((unsigned __int8 *)v1->_guilds_member_bits, word_4F0754[2 * (unsigned int)window_SpeakInHouse->ptr_1C]) )
8355 {
8356 v24 = pNPCTopics[171].pText;
8357 v25 = v31;
8358 v26 = pFontArrus->CalcTextHeight(pNPCTopics[171].pText, &v28, 0, 0);
8359 v28.DrawTitleText(pFontArrus, 0, (212 - v26) / 2 + 101, v25, v24, 3u);
8360 pDialogueWindow->pNumPresenceButton = 0;
8361 return ;
8362 }
8363
8364 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
8365 return;
8366 v8 = pDialogueWindow;
8367 v33 = 0;
8368 v34 = 0;
8369 v29 = pDialogueWindow;
8370 v9 = pDialogueWindow->pStartingPosActiveItem;
8371 v10 = v9 + pDialogueWindow->pNumPresenceButton;
8372 v35 = pDialogueWindow->pStartingPosActiveItem;
8373 if ( v9 >= v10 )
8374 goto LABEL_40;
8375 do
8376 {
8377 v11 = v8->GetControl(v35)->msg_param - 36;
8378 if ( byte_4ED970_skill_learn_ability_by_class_table[v1->classType / 3][v11] && !v1->pActiveSkills[v11] )
8379 {
8380 v12 = pFontArrus->CalcTextHeight(pSkillNames[v11], &v28, 0, 0);
8381 v33 += v12;
8382 ++v34;
8383 }
8384 v13 = v8->pStartingPosActiveItem;
8385 ++v35;
8386 }
8387 while ( v35 < v8->pNumPresenceButton + v13 );
8388 if ( !v34 )
8389 {
8390 LABEL_40:
8391 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[544], v1->pName, pClassNames[v1->classType]);
8392 strcat(pTmpBuf.data(), "\n \n");
8393 strcat(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[528]);
8394 v22 = v31;
8395 v23 = pFontArrus->CalcTextHeight(pTmpBuf.data(), &v28, 0, 0);
8396 v28.DrawTitleText(pFontArrus, 0, (174 - v23) / 2 + 138, v22, pTmpBuf.data(), 3u);
8397 return;
8398 }
8399 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[401], v32);
8400 v28.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf.data(), 3u);
8401 v32 = (149 - v33) / v34;
8402 if ( (149 - v33) / v34 > 32 )
8403 v32 = 32;
8404
8405 v35 = v8->pStartingPosActiveItem;
8406 v34 = (149 - v34 * v32 - v33) / 2 - v32 / 2 + 162;
8407 if ( v8->pStartingPosActiveItem < v8->pStartingPosActiveItem+ v8->pNumPresenceButton )
8408 {
8409 v33 = 2;
8410 do
8411 {
8412 v14 = v8->GetControl(v35);
8413 v15 = v14->msg_param - 36;
8414 if ( byte_4ED970_skill_learn_ability_by_class_table[v1->classType / 3][v15] )
8415 {
8416 v16 = 0;
8417 if ( !v1->pActiveSkills[v15] )
8418 {
8419 v17 = pSkillNames[v15];
8420 v14->uY = v32 + v34;
8421 v18 = pFontArrus->CalcTextHeight(v17, &v28, 0, 0);
8422 v19 = v14->uY;
8423 v14->uHeight = v18;
8424 v20 = v19 + v18 - 1;
8425 v14->uW = v20;
8426 v34 = v20;
8427 v21 = v31;
8428 if ( pDialogueWindow->pCurrentPosActiveItem != v33 )
8429 v21 = v30;
8430 v28.DrawTitleText(pFontArrus, 0, v19, v21, v17, 3u);
8431 goto LABEL_34;
8432 }
8433 }
8434 else
8435 {
8436 v16 = 0;
8437 }
8438 v14->uW = v16;
8439 v14->uHeight = v16;
8440 v14->uY = v16;
8441 LABEL_34:
8442 v8 = v29;
8443 ++v35;
8444 ++v33;
8445 }
8446 while ( v35 <v29->pNumPresenceButton + v29->pStartingPosActiveItem );
8447 }
8448 return;
8449 }
8450 8244
8451 //----- (00405CFF) -------------------------------------------------------- 8245 //----- (00405CFF) --------------------------------------------------------
8452 void stru262_TurnBased::End(bool bPlaySound) 8246 void stru262_TurnBased::End(bool bPlaySound)
8453 { 8247 {
8454 stru262_TurnBased *v2; // edi@1 8248 stru262_TurnBased *v2; // edi@1