comparison UI/UIPopup.cpp @ 1729:f44b6e02e81c

pop-up window in character(paperdill) window, alchemy
author Ritor1
date Wed, 25 Sep 2013 17:29:14 +0600
parents 8de9b24ace86
children 79b9306f573a
comparison
equal deleted inserted replaced
1728:7b6b4ce8da76 1729:f44b6e02e81c
22 #include "..\PaletteManager.h" 22 #include "..\PaletteManager.h"
23 #include "..\Time.h" 23 #include "..\Time.h"
24 #include "..\texts.h" 24 #include "..\texts.h"
25 25
26 #include "..\mm7_data.h" 26 #include "..\mm7_data.h"
27 #include "..\Events.h"
27 28
28 static char static_sub_417BB5_out_string[1200]; // static to a file, not sub actually 29 static char static_sub_417BB5_out_string[1200]; // static to a file, not sub actually
29 30
30 31
31 //----- (004179BC) -------------------------------------------------------- 32 //----- (004179BC) --------------------------------------------------------
1283 // 507B00: using guessed type int dword_507B00_spell_info_to_draw_in_popup; 1284 // 507B00: using guessed type int dword_507B00_spell_info_to_draw_in_popup;
1284 1285
1285 //----- (00416D62) -------------------------------------------------------- 1286 //----- (00416D62) --------------------------------------------------------
1286 void sub_416D62_ShowPopupWindow_MonsterRecord_ItemInfo_etcsub_416D62(Vec2_int_ *_this) 1287 void sub_416D62_ShowPopupWindow_MonsterRecord_ItemInfo_etcsub_416D62(Vec2_int_ *_this)
1287 { 1288 {
1288 signed int pPlayerNum; // eax@12 1289 int v5; // esi@62
1289 //char *v2; // eax@32 1290 GUIButton *pButton; // esi@84
1290 //void *v3; // ecx@52 1291 char *pStr; // edi@85
1291 unsigned int v4; // eax@59 1292 char *pHint; // edx@113
1292 int v5; // esi@62 1293 GUIWindow popup_window; // [sp+4h] [bp-74h]@32
1293 //signed int v6; // esi@64 1294 struct tagPOINT Point; // [sp+60h] [bp-18h]@6
1294 //signed int v7; // esi@69 1295 unsigned int pX; // [sp+70h] [bp-8h]@3
1295 unsigned int v10; // eax@76 1296 unsigned int pY; // [sp+74h] [bp-4h]@3
1296 //char v11; // zf@83
1297 GUIButton *pButton; // esi@84
1298 unsigned int v13; // ecx@85
1299 char *pStr; // edi@85
1300 //signed int pControlID; // eax@92
1301 int v16; // eax@95
1302 int v17; // eax@96
1303 PLAYER_SKILL_TYPE v18; // eax@98
1304 char *pStr2; // eax@99
1305 unsigned int v20; // eax@108
1306 unsigned int pSkillId; // eax@109
1307 const char *pSkillInfo; // eax@111
1308 //char *v23; // ebx@112
1309 char *pHint; // edx@113
1310 unsigned int pColor; // eax@113
1311 GUIWindow pWindow; // [sp+4h] [bp-74h]@32
1312 //double v27; // [sp+58h] [bp-20h]@33
1313 struct tagPOINT Point; // [sp+60h] [bp-18h]@6
1314 //char *v29; // [sp+68h] [bp-10h]@33
1315 //float v30; // [sp+6Ch] [bp-Ch]@33
1316 unsigned int pX; // [sp+70h] [bp-8h]@3
1317 unsigned int pY; // [sp+74h] [bp-4h]@3
1318 1297
1319 if ( pCurrentScreen == SCREEN_VIDEO ) 1298 if ( pCurrentScreen == SCREEN_VIDEO )
1320 return; 1299 return;
1321 if ( _this ) 1300 if ( _this )
1322 { 1301 {
1353 pEventTimer->Pause(); 1332 pEventTimer->Pause();
1354 switch(pCurrentScreen) 1333 switch(pCurrentScreen)
1355 { 1334 {
1356 case SCREEN_CASTING: 1335 case SCREEN_CASTING:
1357 { 1336 {
1358 OnInventoryItemRightClick(); 1337 Inventory_ItemPopupAndAlchemy();
1359 break; 1338 break;
1360 } 1339 }
1361 case SCREEN_CHEST: 1340 case SCREEN_CHEST:
1362 { 1341 {
1363 if ( !pPlayers[uActiveCharacter]->CanAct() ) 1342 if ( !pPlayers[uActiveCharacter]->CanAct() )
1364 { 1343 {
1365 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[427], pPlayers[uActiveCharacter]->pName, pGlobalTXT_LocalizationStrings[541]);//%s не в состоянии %s Опознать предметы 1344 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[427], pPlayers[uActiveCharacter]->pName, pGlobalTXT_LocalizationStrings[541]);//%s не в состоянии %s Опознать предметы
1366 pWindow.Hint = pTmpBuf.data(); 1345 popup_window.Hint = pTmpBuf.data();
1367 pWindow.uFrameWidth = 384; 1346 popup_window.uFrameWidth = 384;
1368 pWindow.uFrameHeight = 180; 1347 popup_window.uFrameHeight = 180;
1369 pWindow.uFrameY = 40; 1348 popup_window.uFrameY = 40;
1370 if ( (signed int)pX <= 320 ) 1349 if ( (signed int)pX <= 320 )
1371 v10 = pX + 30; 1350 popup_window.uFrameX = pX + 30;
1372 else 1351 else
1373 v10 = pX - 414; 1352 popup_window.uFrameX = pX - 414;
1374 pWindow.uFrameX = v10; 1353 popup_window.DrawMessageBox(0);
1375 pWindow.DrawMessageBox(0);
1376 } 1354 }
1377 else 1355 else
1378 { 1356 {
1379 if ( pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]] & 0xFFFF ) 1357 if ( pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]] & 0xFFFF )
1380 { 1358 GameUI_DrawItemInfo(&pChests[pChestWindow->par1C].igChestItems[pChests[pChestWindow->par1C].pInventoryIndices[(pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]] & 0xFFFF) - 1] - 1]);
1381 v10 = pChests[pChestWindow->par1C].pInventoryIndices[(pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]] & 0xFFFF)-1];
1382 GameUI_DrawItemInfo(&pChests[pChestWindow->par1C].igChestItems[v10 - 1]);
1383 }
1384 } 1359 }
1385 break; 1360 break;
1386 } 1361 }
1387 case SCREEN_GAME: 1362 case SCREEN_GAME:
1388 { 1363 {
1389 if (GetCurrentMenuID() > 0) 1364 if (GetCurrentMenuID() > 0)
1390 break; 1365 break;
1391 if ( (signed int)pY > (signed int)pViewport->uViewportBR_Y ) 1366 if ( (signed int)pY > (signed int)pViewport->uViewportBR_Y )
1392 { 1367 {
1393 pWindow.ptr_1C = (void *)((signed int)pX / 118); 1368 popup_window.ptr_1C = (void *)((signed int)pX / 118);
1394 if ( (signed int)pX / 118 < 4 )//portaits zone 1369 if ( (signed int)pX / 118 < 4 )//portaits zone
1395 { 1370 {
1396 pWindow.Hint = 0; 1371 popup_window.Hint = 0;
1397 pWindow.uFrameWidth = 400; 1372 popup_window.uFrameWidth = 400;
1398 pWindow.uFrameHeight = 200; 1373 popup_window.uFrameHeight = 200;
1399 pWindow.uFrameX = 38; 1374 popup_window.uFrameX = 38;
1400 pWindow.uFrameY = 60; 1375 popup_window.uFrameY = 60;
1401 pAudioPlayer->StopChannels(-1, -1); 1376 pAudioPlayer->StopChannels(-1, -1);
1402 GameUI_CharacterQuickRecord_Draw(&pWindow, pPlayers[(int)pWindow.ptr_1C + 1]); 1377 GameUI_CharacterQuickRecord_Draw(&popup_window, pPlayers[(int)popup_window.ptr_1C + 1]);
1403 } 1378 }
1404 } 1379 }
1405 else if ( (signed int)pX > (signed int)pViewport->uViewportBR_X ) 1380 else if ( (signed int)pX > (signed int)pViewport->uViewportBR_X )
1406 { 1381 {
1407 if ( (signed int)pY >= 130 ) 1382 if ( (signed int)pY >= 130 )
1408 { 1383 {
1409 if ( (signed int)pX >= 476 && (signed int)pX <= 636 && (signed int)pY >= 240 && (signed int)pY <= 300 )//buff_tooltip zone 1384 if ( (signed int)pX >= 476 && (signed int)pX <= 636 && (signed int)pY >= 240 && (signed int)pY <= 300 )//buff_tooltip zone
1410 { 1385 {
1411 pWindow.Hint = 0; 1386 popup_window.Hint = 0;
1412 pWindow.uFrameWidth = 400; 1387 popup_window.uFrameWidth = 400;
1413 pWindow.uFrameHeight = 200; 1388 popup_window.uFrameHeight = 200;
1414 pWindow.uFrameX = 38; 1389 popup_window.uFrameX = 38;
1415 pWindow.uFrameY = 60; 1390 popup_window.uFrameY = 60;
1416 pAudioPlayer->StopChannels(-1, -1); 1391 pAudioPlayer->StopChannels(-1, -1);
1417 pWindow._41D73D_draw_buff_tooltip(); 1392 popup_window._41D73D_draw_buff_tooltip();
1418 } 1393 }
1419 else if ( (signed int)pX < 485 || (signed int)pX > 548 || (signed int)pY < 156 || (signed int)pY > 229 )//NPC zone 1394 else if ( (signed int)pX < 485 || (signed int)pX > 548 || (signed int)pY < 156 || (signed int)pY > 229 )//NPC zone
1420 { 1395 {
1421 if (!( (signed int)pX < 566 || (signed int)pX > 629 || (signed int)pY < 156 || (signed int)pY > 229 )) 1396 if (!( (signed int)pX < 566 || (signed int)pX > 629 || (signed int)pY < 156 || (signed int)pY > 229 ))
1422 { 1397 {
1430 GameUI_DrawNPCPopup(0);//NPC 1 1405 GameUI_DrawNPCPopup(0);//NPC 1
1431 } 1406 }
1432 } 1407 }
1433 else//minimap zone 1408 else//minimap zone
1434 { 1409 {
1435 pWindow.Hint = (char *)GameUI_GetMinimapHintText(); 1410 popup_window.Hint = (char *)GameUI_GetMinimapHintText();
1436 pWindow.uFrameWidth = 256; 1411 popup_window.uFrameWidth = 256;
1437 pWindow.uFrameX = 130; 1412 popup_window.uFrameX = 130;
1438 pWindow.uFrameY = 140; 1413 popup_window.uFrameY = 140;
1439 pWindow.uFrameHeight = 64; 1414 popup_window.uFrameHeight = 64;
1440 pAudioPlayer->StopChannels(-1, -1); 1415 pAudioPlayer->StopChannels(-1, -1);
1441 pWindow.DrawMessageBox(0); 1416 popup_window.DrawMessageBox(0);
1442 } 1417 }
1443 } 1418 }
1444 else//game zone 1419 else//game zone
1445 { 1420 {
1446 pWindow.Hint = 0; 1421 popup_window.Hint = 0;
1447 pWindow.uFrameWidth = 320; 1422 popup_window.uFrameWidth = 320;
1448 pWindow.uFrameHeight = 320; 1423 popup_window.uFrameHeight = 320;
1449 v4 = pX - 350; 1424 popup_window.uFrameX = pX - 350;
1450 if ( (signed int)pX <= 320 ) 1425 if ( (signed int)pX <= 320 )
1451 v4 = pX + 30; 1426 popup_window.uFrameX = pX + 30;
1452 pWindow.uFrameX = v4; 1427 popup_window.uFrameY = 40;
1453 pWindow.uFrameY = 40;
1454 if ( pRenderer->pRenderD3D ) 1428 if ( pRenderer->pRenderD3D )
1455 LOWORD(v5) = pGame->pVisInstance->get_picked_object_zbuf_val(); 1429 LOWORD(v5) = pGame->pVisInstance->get_picked_object_zbuf_val();
1456 else 1430 else
1457 v5 = pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]]; 1431 v5 = pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]];
1458 if (PID_TYPE((unsigned __int16)v5) == OBJECT_Actor) 1432 if (PID_TYPE((unsigned __int16)v5) == OBJECT_Actor)
1459 { 1433 {
1460 if ( pRenderer->uNumSceneBegins ) 1434 if ( pRenderer->uNumSceneBegins )
1461 { 1435 {
1462 pWindow.DrawMessageBox(1); 1436 popup_window.DrawMessageBox(1);
1463 MonsterPopup_Draw(PID_ID((unsigned __int16)v5), &pWindow); 1437 MonsterPopup_Draw(PID_ID((unsigned __int16)v5), &popup_window);
1464 } 1438 }
1465 else 1439 else
1466 { 1440 {
1467 pRenderer->BeginScene(); 1441 pRenderer->BeginScene();
1468 pWindow.DrawMessageBox(1); 1442 popup_window.DrawMessageBox(1);
1469 MonsterPopup_Draw(PID_ID((unsigned __int16)v5), &pWindow); 1443 MonsterPopup_Draw(PID_ID((unsigned __int16)v5), &popup_window);
1470 pRenderer->EndScene(); 1444 pRenderer->EndScene();
1471 } 1445 }
1472 } 1446 }
1473 if (PID_TYPE((unsigned __int16)v5) == OBJECT_Item) 1447 if (PID_TYPE((unsigned __int16)v5) == OBJECT_Item)
1474 { 1448 {
1483 case SCREEN_BOOKS: 1457 case SCREEN_BOOKS:
1484 { 1458 {
1485 if ( !dword_506364 1459 if ( !dword_506364
1486 || (signed int)pX < (signed int)pViewport->uViewportTL_X || (signed int)pX > (signed int)pViewport->uViewportBR_X 1460 || (signed int)pX < (signed int)pViewport->uViewportTL_X || (signed int)pX > (signed int)pViewport->uViewportBR_X
1487 || (signed int)pY < (signed int)pViewport->uViewportTL_Y || (signed int)pY > (signed int)pViewport->uViewportBR_Y 1461 || (signed int)pY < (signed int)pViewport->uViewportTL_Y || (signed int)pY > (signed int)pViewport->uViewportBR_Y
1488 || ((pWindow.Hint = (char *)GetMapBookHintText()) == 0) ) 1462 || ((popup_window.Hint = (char *)GetMapBookHintText()) == 0) )
1489 break; 1463 break;
1490 pWindow.uFrameWidth = (pFontArrus->GetLineWidth(pWindow.Hint) + 32) + 0.5f; 1464 popup_window.uFrameWidth = (pFontArrus->GetLineWidth(popup_window.Hint) + 32) + 0.5f;
1491 pWindow.uFrameX = pX + 5; 1465 popup_window.uFrameX = pX + 5;
1492 pWindow.uFrameY = pY + 5; 1466 popup_window.uFrameY = pY + 5;
1493 pWindow.uFrameHeight = 64; 1467 popup_window.uFrameHeight = 64;
1494 pAudioPlayer->StopChannels(-1, -1); 1468 pAudioPlayer->StopChannels(-1, -1);
1495 pWindow.DrawMessageBox(0); 1469 popup_window.DrawMessageBox(0);
1496 break; 1470 break;
1497 } 1471 }
1498 case SCREEN_CHARACTERS: 1472 case SCREEN_CHARACTERS:
1499 case SCREEN_E: 1473 case SCREEN_E:
1500 case SCREEN_CHEST_INVENTORY: 1474 case SCREEN_CHEST_INVENTORY:
1501 { 1475 {
1502 if ( (signed int)pX > 467 && pCurrentScreen != SCREEN_E ) 1476 if ( (signed int)pX > 467 && pCurrentScreen != SCREEN_E )
1503 OnInventoryItemRightClick(); 1477 Inventory_ItemPopupAndAlchemy();
1504 else if ( (signed int)pY >= 345 ) 1478 else if ( (signed int)pY >= 345 )
1505 break; 1479 break;
1506 else if ( pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] == 100 )//2DEvent - CharacerScreenStats 1480 else if ( pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] == 100 )//2DEvent - CharacerScreenStats
1507 CharacterUI_StatsTab_ShowHint(); 1481 CharacterUI_StatsTab_ShowHint();
1508 else if ( pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] == 101 )//2DEvent - CharacerScreenSkills 1482 else if ( pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] == 101 )//2DEvent - CharacerScreenSkills
1509 CharacterUI_SkillsTab_ShowHint(); 1483 CharacterUI_SkillsTab_ShowHint();
1510 else if ( pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] == 103 )//2DEvent - CharacerScreenInventory 1484 else if ( pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] == 103 )//2DEvent - CharacerScreenInventory
1511 OnInventoryItemRightClick(); 1485 Inventory_ItemPopupAndAlchemy();
1512 break; 1486 break;
1513 } 1487 }
1514 case SCREEN_SPELL_BOOK: 1488 case SCREEN_SPELL_BOOK:
1489 {
1490 if ( dword_507B00_spell_info_to_draw_in_popup )
1491 DrawSpellDescriptionPopup(dword_507B00_spell_info_to_draw_in_popup - 1);
1492 break;
1493 }
1494 case SCREEN_HOUSE:
1495 {
1496 if ( (signed int)pY < 345 && (signed int)pX < 469 )
1497 ShowPopupShopItem();
1498 break;
1499 }
1500 case SCREEN_PARTY_CREATION:
1501 {
1502 popup_window.Hint = 0;
1503 pStr = 0;
1504 for ( pButton = pGUIWindow_CurrentMenu->pControlsHead; pButton; pButton = pButton->pNext)
1505 {
1506 if ( pButton->uButtonType == 1 && pButton->uButtonType != 3 && (signed int)pX > (signed int)pButton->uX && (signed int)pX < (signed int)pButton->uZ
1507 && (signed int)pY > (signed int)pButton->uY && (signed int)pY < (signed int)pButton->uW )
1508 {
1509 switch ( pButton->msg )
1510 {
1511 case UIMSG_0: //stats info
1512 popup_window.Hint = pAttributeDescriptions[(signed int)pButton->msg_param % 7];
1513 pStr = aAttributeNames[(signed int)pButton->msg_param % 7];
1514 break;
1515 case UIMSG_PlayerCreationClickPlus: //Plus button info
1516 pStr = pGlobalTXT_LocalizationStrings[670];//Добавить
1517 popup_window.Hint = pGlobalTXT_LocalizationStrings[671];//"Добавляет очко к выделенному навыку, забирая его из накопителя очков"
1518 break;
1519 case UIMSG_PlayerCreationClickMinus: //Minus button info
1520 pStr = pGlobalTXT_LocalizationStrings[668];//Вычесть
1521 popup_window.Hint = pGlobalTXT_LocalizationStrings[669];//"Вычитает очко из выделенного навыка, возвращая его в накопитель очков"
1522 break;
1523 case UIMSG_PlayerCreationSelectActiveSkill: //Available skill button info
1524 pStr = pSkillNames[pParty->pPlayers[uPlayerCreationUI_SelectedCharacter].GetSkillIdxByOrder(pButton->msg_param + 4)];
1525 popup_window.Hint = pSkillDesc[pParty->pPlayers[uPlayerCreationUI_SelectedCharacter].GetSkillIdxByOrder(pButton->msg_param + 4)];
1526 break;
1527 case UIMSG_PlayerCreationSelectClass: //Available Class Info
1528 popup_window.Hint = pClassDescriptions[pButton->msg_param];
1529 pStr = pClassNames[pButton->msg_param];
1530 break;
1531 case UIMSG_PlayerCreationClickOK: //OK Info
1532 popup_window.Hint = pGlobalTXT_LocalizationStrings[664];//Щелкните здесь для утверждения состава отряда и продолжения игры.
1533 pStr = pGlobalTXT_LocalizationStrings[665];//Кнопка ОК
1534 break;
1535 case UIMSG_PlayerCreationClickReset: //Clear info
1536 popup_window.Hint = pGlobalTXT_LocalizationStrings[666];//Сбрасывает все параметры и навыки отряда.
1537 pStr = pGlobalTXT_LocalizationStrings[667];//Кнопка Очистить
1538 break;
1539 case UIMSG_PlayerCreation_SelectAttribute: // Character info
1540 pStr = pParty->pPlayers[pButton->msg_param].pName;
1541 popup_window.Hint = pClassDescriptions[pParty->pPlayers[pButton->msg_param].classType];
1542 break;
1543 }
1544 if ( pButton->msg > UIMSG_44 && pButton->msg <= UIMSG_PlayerCreationRemoveDownSkill ) //Sellected skills info
1545 {
1546 pY = 0;
1547 if ( (signed int)pParty->pPlayers[pButton->msg_param].GetSkillIdxByOrder(pButton->msg - UIMSG_48) < 37 )
1515 { 1548 {
1516 if ( dword_507B00_spell_info_to_draw_in_popup ) 1549 strcpy(pTmpBuf2.data(), CharacterUI_GetSkillDescText(pButton->msg_param, (PLAYER_SKILL_TYPE)pParty->pPlayers[pButton->msg_param].GetSkillIdxByOrder(pButton->msg - UIMSG_48)));
1517 DrawSpellDescriptionPopup(dword_507B00_spell_info_to_draw_in_popup - 1); 1550 popup_window.Hint = pTmpBuf2.data();
1518 break; 1551 pStr = pSkillNames[pParty->pPlayers[pButton->msg_param].GetSkillIdxByOrder(pButton->msg - UIMSG_48)];
1519 } 1552 }
1520 case SCREEN_HOUSE: 1553 }
1554 }
1555 }
1556 if ( popup_window.Hint )
1557 {
1558 pHint = (char*)popup_window.Hint;
1559 popup_window.Hint = 0;
1560 popup_window.uFrameWidth = 384;
1561 popup_window.uFrameHeight = 256;
1562 popup_window.uFrameX = 128;
1563 popup_window.uFrameY = 40;
1564 popup_window.uFrameHeight = pFontSmallnum->CalcTextHeight(pHint, &popup_window, 24, 0) + 2 * LOBYTE(pFontLucida->uFontHeight) + 24;
1565 popup_window.uFrameZ = popup_window.uFrameX + popup_window.uFrameWidth - 1;
1566 popup_window.uFrameW = popup_window.uFrameY + popup_window.uFrameHeight - 1;
1567 popup_window.DrawMessageBox(0);
1568 popup_window.uFrameX += 12;
1569 popup_window.uFrameWidth -= 24;
1570 popup_window.uFrameY += 12;
1571 popup_window.uFrameHeight -= 12;
1572 popup_window.uFrameZ = popup_window.uFrameX + popup_window.uFrameWidth - 1;
1573 popup_window.uFrameW = popup_window.uFrameY + popup_window.uFrameHeight - 1;
1574 sprintf(pTmpBuf.data(), "\f%05d%s\f00000\n", TargetColor(0xFF, 0xFF, 0x9B), pStr);
1575 popup_window.DrawTitleText(pFontCreate, 0, 0, 0, pTmpBuf.data(), 3);
1576 popup_window.DrawText(pFontSmallnum, 1, pFontLucida->uFontHeight, 0, pHint, 0, 0, 0);
1577 }
1578 break;
1579 }
1580 default:
1581 break;
1582 }
1583 dword_507BF0_is_there_popup_onscreen = 1;
1584 viewparams->bRedrawGameUI = 1;
1585 }
1586 int no_rightlick_in_inventory = false; // 0050CDCC
1587 //----- (00416196) --------------------------------------------------------
1588 void Inventory_ItemPopupAndAlchemy()
1589 {
1590 int v14; // edx@25
1591 unsigned int v15; // edi@25
1592 signed int v16; // edx@27
1593 int v17; // eax@54
1594 unsigned int v18; // edx@57
1595 int v19; // eax@65
1596 int v20; // edi@67
1597 int v21; // eax@72
1598 int v22; // ecx@74
1599 int v23; // edx@78
1600 int v24; // eax@79
1601 int v25; // eax@80
1602 int v26; // eax@84
1603 ItemGen *v27; // esi@98
1604 double v31; // st7@112
1605 double v36; // st7@132
1606 signed __int64 v37; // qax@135
1607 Vec3_int_ v39; // [sp-18h] [bp-A8h]@83
1608 GUIWindow message_window; // [sp+Ch] [bp-84h]@137
1609 int v45; // [sp+64h] [bp-2Ch]@10
1610 POINT a2; // [sp+78h] [bp-18h]@2
1611 unsigned int damage_level; // [sp+8Ch] [bp-4h]@23
1612
1613 if (no_rightlick_in_inventory)
1614 return;
1615
1616 pMouse->GetCursorPos(&a2);
1617 int item_pid = (pRenderer->pActiveZBuffer[a2.x + pSRZBufferLineOffsets[a2.y]] & 0xFFFF) - 1;
1618 auto item = &pPlayers[uActiveCharacter]->pInventoryItemList[item_pid];
1619
1620 if (a2.x <= 13 || a2.x >= 462)
1621 {
1622 GameUI_DrawItemInfo(item);
1623 return;
1624 }
1625
1626 if (!item_pid)
1627 {
1628 int inventory_mouse_x = a2.x - 14;
1629 int inventory_mouse_y = a2.y - 17;
1630
1631 int mouse_cell_x = inventory_mouse_x / 32;
1632 int mouse_cell_y = inventory_mouse_y / 32;
1633
1634 if (mouse_cell_x + mouse_cell_y < 0)
1635 return;
1636
1637 int inventory_idx = mouse_cell_x + 14 * mouse_cell_y;
1638 if (inventory_idx > 126)
1639 return;
1640
1641 if (pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex(&inventory_idx) == 0)
1642 return;
1643
1644 item_pid = pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex(&inventory_idx);
1645 }
1646 //check character condition(проверка состояния персонажа)
1647 if (!pPlayers[uActiveCharacter]->CanAct())
1648 {
1649 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[427], pPlayers[uActiveCharacter]->pName, pGlobalTXT_LocalizationStrings[541]);//%s не в состоянии %s Опознать предметы
1650 message_window.Hint = pTmpBuf.data();
1651 message_window.uFrameWidth = 384;
1652 message_window.uFrameHeight = 180;
1653 if (a2.x <= 320 )
1654 message_window.uFrameX = a2.x + 30;
1655 else
1656 message_window.uFrameX = a2.x - 414;
1657 message_window.uFrameY = 40;
1658 message_window.DrawMessageBox(0);
1659 return;
1660 }
1661
1662 int alchemy_skill_points = (int8_t)pPlayers[uActiveCharacter]->GetActualSkillLevel(PLAYER_SKILL_ALCHEMY) & 0x3F;
1663 int alchemy_skill_level = SkillToMastery(pPlayers[uActiveCharacter]->GetActualSkillLevel(PLAYER_SKILL_ALCHEMY)) - 1;
1664
1665 // for potion bottle(простая бутылка)
1666 if (pParty->pPickedItem.uItemID == ITEM_POTION_BOTTLE)
1667 {
1668 GameUI_DrawItemInfo(item);
1669 return;
1670 }
1671 //for recharge potion(зелье перезарядка)
1672 if (pParty->pPickedItem.uItemID == ITEM_POTION_RECHARGE_ITEM)
1673 {
1674 if (item->uItemID != ITEM_POTION_BOTTLE && // cant recharge bottle
1675 item->uItemID < ITEM_POTION_CATALYST && // cant recharge
1676 item->uItemID > ITEM_POTION_REJUVENATION) // all potions
1677 {
1678 if (item->GetItemEquipType() != EQUIP_WAND) // can recharge only wands
1679 {
1680 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0);
1681 return;
1682 }
1683
1684 v36 = (70.0 - (double)pParty->pPickedItem.uEnchantmentType) * 0.01;
1685 if ( v36 < 0.0 )
1686 v36 = 0.0;
1687 v37 = (signed __int64)((double)item->uMaxCharges - v36 * (double)item->uMaxCharges);
1688 item->uMaxCharges = v37;
1689 item->uNumCharges = v37;
1690
1691 pMouse->RemoveHoldingItem();
1692 no_rightlick_in_inventory = 1;
1693 return;
1694 }
1695 GameUI_DrawItemInfo(item);
1696 return;
1697 }
1698 // for harden potion(зелье закалка)
1699 else if (pParty->pPickedItem.uItemID == ITEM_POTION_HARDEN_ITEM)
1700 {
1701 if (item->uItemID != ITEM_POTION_BOTTLE && // cant harden bottle
1702 item->uItemID < ITEM_POTION_CATALYST && // cant harden
1703 item->uItemID > ITEM_POTION_REJUVENATION) // all potions
1704 {
1705 if (item->IsBroken() || // cant harden broken items
1706 item->uItemID >= ITEM_ARTIFACT_PUCK || // cant harden artifacts
1707 item->GetItemEquipType() < EQUIP_OFF_HAND ||
1708 item->GetItemEquipType() > EQUIP_WAND)
1709 {
1710 pMouse->RemoveHoldingItem();
1711 no_rightlick_in_inventory = true;
1712 return;
1713 }
1714
1715 item->uAttributes |= ITEM_AURA_EFFECT_RED | ITEM_HARDENED;
1716
1717 _50C9A8_item_enchantment_timer = 256;
1718 pMouse->RemoveHoldingItem();
1719 no_rightlick_in_inventory = true;
1720 return;
1721 }
1722 GameUI_DrawItemInfo(item);
1723 return;
1724 }
1725 // several potions(несколько зелий)
1726 else if (pParty->pPickedItem.uItemID >= ITEM_POTION_FLAMING_POTION &&
1727 pParty->pPickedItem.uItemID <= ITEM_POTION_SWIFT_POTION ||
1728 pParty->pPickedItem.uItemID == ITEM_POTION_SLAYING_POTION)
1729 {
1730 if (item->uItemID != ITEM_POTION_BOTTLE && // cant enchant bottle
1731 item->uItemID < ITEM_POTION_CATALYST && // cant enchant
1732 item->uItemID > ITEM_POTION_REJUVENATION) // all potions
1733 {
1734 if (item->uItemID >= ITEM_BLASTER && item->uItemID <= ITEM_LASER_RIFLE ||
1735 item->uItemID >= ITEM_ARTIFACT_PUCK ||
1736 item->IsBroken() ||
1737 item->uSpecEnchantmentType ||
1738 item->uEnchantmentType ||
1739 item->GetItemEquipType() >= EQUIP_ARMOUR) // only melee weapons and bows
1740 {
1741 pMouse->RemoveHoldingItem();
1742 no_rightlick_in_inventory = true;
1743 return;
1744 }
1745
1746 item->UpdateTempBonus(pParty->uTimePlayed);
1747 if (pParty->pPickedItem.uItemID == ITEM_POTION_SLAYING_POTION)
1748 {
1749 item->uSpecEnchantmentType = 40; // of Slaying
1750 v31 = (double)(1800 * pParty->pPickedItem.uEnchantmentType * 128);
1751 }
1752 else
1753 {
1754 static int _4E2904_enchantment_by_potion_lut[] =
1521 { 1755 {
1522 if ( (signed int)pY < 345 && (signed int)pX < 469 ) 1756 164, 93, 22,
1523 ShowPopupShopItem(); 1757 164, 93, 22,
1524 break; 1758 11, 5, 13, 7, 59
1759 };
1760 item->uSpecEnchantmentType = _4E2904_enchantment_by_potion_lut[pParty->pPickedItem.uItemID - 240];
1761 v31 = (double)(1800 * pParty->pPickedItem.uEnchantmentType * 128);
1762 }
1763
1764 v27->uExpireTime = pParty->uTimePlayed + v31 * 0.033333335;
1765 v27->uAttributes = alchemy_skill_level | 0x18;
1766
1767 _50C9A8_item_enchantment_timer = 256;
1768 pMouse->RemoveHoldingItem();
1769 no_rightlick_in_inventory = true;
1770 return;
1771 }
1772 GameUI_DrawItemInfo(item);
1773 return;
1774 }
1775 // use reagents(применение реагентов)
1776 if (pParty->pPickedItem.uItemID >= ITEM_REAGENT_WIDOWSWEEP_BERRIES && pParty->pPickedItem.uItemID <= ITEM_REAGENT_PHILOSOPHERS_STONE &&
1777 pPlayers[uActiveCharacter]->pInventoryItemList[item_pid].uItemID == ITEM_POTION_BOTTLE)
1778 {
1779 pPlayers[uActiveCharacter]->pInventoryItemList[item_pid].uEnchantmentType = alchemy_skill_points + pParty->pPickedItem.GetDamageDice();
1780 switch ( pParty->pPickedItem.uItemID )
1781 {
1782 case 200:
1783 case 201:
1784 case 202:
1785 case 203:
1786 case 204:
1787 pPlayers[uActiveCharacter]->pInventoryItemList[item_pid].uItemID = 222;
1788 break;
1789 case 205:
1790 case 206:
1791 case 207:
1792 case 208:
1793 case 209:
1794 pPlayers[uActiveCharacter]->pInventoryItemList[item_pid].uItemID = 223;
1795 break;
1796 case 210:
1797 case 211:
1798 case 212:
1799 case 213:
1800 case 214:
1801 pPlayers[uActiveCharacter]->pInventoryItemList[item_pid].uItemID = 224;
1802 break;
1803 case 215:
1804 case 216:
1805 case 217:
1806 case 218:
1807 case 219:
1808 pPlayers[uActiveCharacter]->pInventoryItemList[item_pid].uItemID = 221;
1809 break;
1810 default:
1811 break;
1812 }
1813 pMouse->RemoveHoldingItem();
1814 no_rightlick_in_inventory = 1;
1815 if ( dword_4E455C )
1816 {
1817 pPlayers[uActiveCharacter]->PlaySound(SPEECH_DO_POTION_FINE, 0);
1818 dword_4E455C = 0;
1819 }
1820 return;
1821 }
1822
1823 //potions mixing(смешивание двух зелий)
1824 if (pParty->pPickedItem.uItemID < ITEM_REAGENT_WIDOWSWEEP_BERRIES ||
1825 pParty->pPickedItem.uItemID > ITEM_REAGENT_PHILOSOPHERS_STONE ||
1826 pPlayers[uActiveCharacter]->pInventoryItemList[item_pid].uItemID != ITEM_POTION_BOTTLE)
1827 {
1828 if (pParty->pPickedItem.uItemID < ITEM_POTION_CATALYST ||
1829 pParty->pPickedItem.uItemID > ITEM_POTION_REJUVENATION ||
1830 pPlayers[uActiveCharacter]->pInventoryItemList[item_pid].uItemID < ITEM_POTION_CATALYST ||
1831 pPlayers[uActiveCharacter]->pInventoryItemList[item_pid].uItemID > ITEM_POTION_REJUVENATION)
1832 {
1833 if (pParty->pPickedItem.uItemID != ITEM_POTION_HARDEN_ITEM &&
1834 (pParty->pPickedItem.uItemID < ITEM_POTION_FLAMING_POTION || pParty->pPickedItem.uItemID > ITEM_POTION_SWIFT_POTION) &&
1835 pParty->pPickedItem.uItemID != ITEM_POTION_SLAYING_POTION &&
1836 pParty->pPickedItem.uItemID != ITEM_POTION_RECHARGE_ITEM)
1837 GameUI_DrawItemInfo(item);
1838 return;
1839 }
1840
1841 // src not reagent, dst not bottle
1842 // src potion, dst potion
1843
1844 v14 = item->uItemID - ITEM_POTION_CURE_WOUNDS;
1845 v15 = pParty->pPickedItem.uItemID - ITEM_POTION_CURE_WOUNDS;
1846
1847 if ( pParty->pPickedItem.uItemID == ITEM_POTION_CATALYST || item->uItemID == ITEM_POTION_CATALYST )
1848 v16 = 5;
1849 else
1850 v16 = pItemsTable->potion_data[v15][v14 + 2];
1851 damage_level = v16;
1852 if ( alchemy_skill_points )
1853 {
1854 if ( v16 < ITEM_POTION_CURE_DISEASE || v16 > ITEM_POTION_AWAKEN )//< 225 >227
1855 {
1856 if ( v16 >= ITEM_POTION_HASTE && v16 <= ITEM_POTION_CURE_INSANITY )//228 >= v16 <= 239
1857 {
1858 if ( alchemy_skill_points == 1 )
1859 damage_level = 2;
1525 } 1860 }
1526 case SCREEN_PARTY_CREATION: 1861 if ( v16 >= ITEM_POTION_MIGHT_BOOST && v16 <= ITEM_POTION_BODY_RESISTANE )//240 >= v16 <= 261
1862 {
1863 if ( alchemy_skill_points <= 2 )
1864 damage_level = 3;
1865 }
1866 if ( v16 >= ITEM_POTION_STONE_TO_FLESH && alchemy_skill_points != 4 )//>= 262
1867 damage_level = 4;
1868 }
1869 }
1870 else
1871 {
1872 if ( v16 >= ITEM_POTION_CURE_DISEASE && v16 <= ITEM_POTION_AWAKEN )//225 <= v16 <= 227
1873 damage_level = 1;
1874 if ( v16 >= ITEM_POTION_HASTE && v16 <= ITEM_POTION_CURE_INSANITY )//228 <= v16 <= 239
1875 damage_level = 2;
1876 if ( v16 >= ITEM_POTION_MIGHT_BOOST && v16 <= ITEM_POTION_BODY_RESISTANE )//240 <= v16 <= 261
1877 damage_level = 3;
1878 if ( v16 >= ITEM_POTION_STONE_TO_FLESH )//262 <= v16
1879 damage_level = 4;
1880 }
1881 int pOut_y = 0;
1882 int pOut_x = item_pid + 1;
1883 v17 = (int)pPlayers[uActiveCharacter]->pInventoryMatrix;
1884 while ( *(int *)v17 != pOut_x )
1885 {
1886 ++pOut_y;
1887 v17 += 4;
1888 if ( pOut_y >= 126 )
1889 {
1890 v18 = pOut_y;
1891 goto LABEL_59;
1892 }
1893 }
1894 v18 = pOut_y;
1895 LABEL_59:
1896 if ( !damage_level )
1897 {
1898 GameUI_DrawItemInfo(item);
1899 return;
1900 }
1901 if ( damage_level == 1 )
1902 {
1903 pPlayers[uActiveCharacter]->RemoveItemAtInventoryIndex(v18);
1904 v26 = rand();
1905 pPlayers[uActiveCharacter]->ReceiveDamage(v26 % 11 + 10, DMGT_FIRE);
1906 pAudioPlayer->PlaySound(SOUND_8, 0, 0, -1, 0, 0, 0, 0);
1907
1908 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0);
1909
1910 v39.z = pParty->vPosition.z + pParty->sEyelevel;
1911 }
1912 else
1913 {
1914 if ( damage_level == 2 )
1915 {
1916 pPlayers[uActiveCharacter]->RemoveItemAtInventoryIndex(v18);
1917 v25 = rand();
1918 pPlayers[uActiveCharacter]->ReceiveDamage(v25 % 71 + 30, DMGT_FIRE);
1919 v23 = 1;
1920 }
1921 else
1922 {
1923 if ( damage_level == 3 )
1924 {
1925 pPlayers[uActiveCharacter]->RemoveItemAtInventoryIndex(v18);
1926 v24 = rand();
1927 pPlayers[uActiveCharacter]->ReceiveDamage(v24 % 201 + 50, DMGT_FIRE);
1928 v23 = 5;
1929 }
1930 else
1931 {
1932 if ( damage_level != 4 )
1933 {
1934 if ( damage_level != 5 )
1527 { 1935 {
1528 pWindow.Hint = 0; 1936 v19 = pPlayers[uActiveCharacter]->AddItem(-1, 0xDCu);
1529 pStr = 0; 1937 if ( v19 )
1530 for ( pButton = pGUIWindow_CurrentMenu->pControlsHead; pButton; pButton = pButton->pNext) 1938 pPlayers[uActiveCharacter]->pOwnItems[v19-1].uAttributes = ITEM_IDENTIFIED;
1531 { 1939 v20 = v14 + 50 * v15;
1532 if ( pButton->uButtonType == 1 && pButton->uButtonType != 3 && (signed int)pX > (signed int)pButton->uX && (signed int)pX < (signed int)pButton->uZ 1940 pPlayers[uActiveCharacter]->pInventoryItemList[item_pid].uItemID = damage_level;
1533 && (signed int)pY > (signed int)pButton->uY && (signed int)pY < (signed int)pButton->uW ) 1941 pPlayers[uActiveCharacter]->pInventoryItemList[item_pid].uEnchantmentType = (pParty->pPickedItem.uEnchantmentType
1534 { 1942 + pPlayers[uActiveCharacter]->pInventoryItemList[item_pid].uEnchantmentType)
1535 switch ( pButton->msg ) 1943 / 2;
1536 { 1944 pPlayers[uActiveCharacter]->SetVariable(VAR_AutoNotes, *(short *)&pItemsTable->potion_note[2 * v20 ]);//field_10168 + 388
1537 case UIMSG_0: //stats info 1945 v22 = (int)((char *)pPlayers[uActiveCharacter] + 36 * item_pid);
1538 pWindow.Hint = pAttributeDescriptions[(signed int)pButton->msg_param % 7]; 1946 if ( !(pItemsTable->pItems[*(int *)(v22 + 532) ].uItemID_Rep_St) )
1539 pStr = aAttributeNames[(signed int)pButton->msg_param % 7]; 1947 *(int *)(v22 + 552) |= 1u;
1540 break; 1948 if ( !dword_4E455C )
1541 case UIMSG_PlayerCreationClickPlus: //Plus button info 1949 {
1542 pStr = pGlobalTXT_LocalizationStrings[670];//Добавить 1950 pMouse->RemoveHoldingItem();
1543 pWindow.Hint = pGlobalTXT_LocalizationStrings[671];//"Добавляет очко к выделенному навыку, забирая его из накопителя очков" 1951 no_rightlick_in_inventory = 1;
1544 break; 1952 return;
1545 case UIMSG_PlayerCreationClickMinus: //Minus button info 1953 }
1546 pStr = pGlobalTXT_LocalizationStrings[668];//Вычесть 1954 pPlayers[uActiveCharacter]->PlaySound(SPEECH_DO_POTION_FINE, 0);
1547 pWindow.Hint = pGlobalTXT_LocalizationStrings[669];//"Вычитает очко из выделенного навыка, возвращая его в накопитель очков" 1955 dword_4E455C = 0;
1548 break; 1956 pMouse->RemoveHoldingItem();
1549 case UIMSG_PlayerCreationSelectActiveSkill: //Available skill button info 1957 no_rightlick_in_inventory = 1;
1550 v18 = pParty->pPlayers[uPlayerCreationUI_SelectedCharacter].GetSkillIdxByOrder(pButton->msg_param + 4); 1958 return;
1551 pStr = pSkillNames[v18];
1552 pWindow.Hint = pSkillDesc[v18];
1553 break;
1554 case UIMSG_PlayerCreationSelectClass: //Available Class Info
1555 pWindow.Hint = pClassDescriptions[pButton->msg_param];
1556 pStr = pClassNames[pButton->msg_param];
1557 break;
1558 case UIMSG_PlayerCreationClickOK: //OK Info
1559 pWindow.Hint = pGlobalTXT_LocalizationStrings[664];//Щелкните здесь для утверждения состава отряда и продолжения игры.
1560 pStr = pGlobalTXT_LocalizationStrings[665];//Кнопка ОК
1561 break;
1562 case UIMSG_PlayerCreationClickReset: //Clear info
1563 pWindow.Hint = pGlobalTXT_LocalizationStrings[666];//Сбрасывает все параметры и навыки отряда.
1564 pStr = pGlobalTXT_LocalizationStrings[667];//Кнопка Очистить
1565 break;
1566 case UIMSG_PlayerCreation_SelectAttribute: // Character info
1567 pStr = pParty->pPlayers[pButton->msg_param].pName;
1568 pWindow.Hint = pClassDescriptions[pParty->pPlayers[pButton->msg_param].classType];
1569 break;
1570 }
1571 if ( pButton->msg > UIMSG_44 && pButton->msg <= UIMSG_PlayerCreationRemoveDownSkill ) //Sellected skills info
1572 {
1573 pSkillId = pParty->pPlayers[pButton->msg_param].GetSkillIdxByOrder(pButton->msg - UIMSG_48);
1574 pY = 0;
1575 if ( (signed int)pSkillId < 37 )
1576 {
1577 pSkillInfo = CharacterUI_GetSkillDescText(pButton->msg_param, (PLAYER_SKILL_TYPE)pSkillId);
1578 strcpy(pTmpBuf2.data(), pSkillInfo);
1579 pWindow.Hint = pTmpBuf2.data();
1580 pStr = pSkillNames[pSkillId];
1581 }
1582 }
1583 }
1584 }
1585 if ( pWindow.Hint )
1586 {
1587 pHint = (char*)pWindow.Hint;
1588 pWindow.Hint = 0;
1589 pWindow.uFrameWidth = 384;
1590 pWindow.uFrameHeight = 256;
1591 pWindow.uFrameX = 128;
1592 pWindow.uFrameY = 40;
1593 pWindow.uFrameHeight = pFontSmallnum->CalcTextHeight(pHint, &pWindow, 24, 0) + 2 * LOBYTE(pFontLucida->uFontHeight) + 24;
1594 pWindow.uFrameZ = pWindow.uFrameX + pWindow.uFrameWidth - 1;
1595 pWindow.uFrameW = pWindow.uFrameY + pWindow.uFrameHeight - 1;
1596 pWindow.DrawMessageBox(0);
1597 pWindow.uFrameX += 12;
1598 pWindow.uFrameWidth -= 24;
1599 pWindow.uFrameY += 12;
1600 pWindow.uFrameHeight -= 12;
1601 pWindow.uFrameZ = pWindow.uFrameX + pWindow.uFrameWidth - 1;
1602 pWindow.uFrameW = pWindow.uFrameY + pWindow.uFrameHeight - 1;
1603 pColor = TargetColor(0xFF, 0xFF, 0x9B);
1604 sprintf(pTmpBuf.data(), format_4E2D80, pColor, pStr);//"\f%05d%s\f00000\n"
1605 pWindow.DrawTitleText(pFontCreate, 0, 0, 0, pTmpBuf.data(), 3);
1606 pWindow.DrawText(pFontSmallnum, 1, pFontLucida->uFontHeight, 0, pHint, 0, 0, 0);
1607 }
1608 break;
1609 } 1959 }
1610 default: 1960 if ( alchemy_skill_points )
1611 { 1961 {
1612 break; 1962 if ( *(int *)(pPlayers[uActiveCharacter] + 36 * item_pid + 532) == 221 )
1963 *(int *)(pPlayers[uActiveCharacter] + 36 * item_pid + 532) = pParty->pPickedItem.uItemID;
1964 else
1965 *(int *)(pPlayers[uActiveCharacter] + 36 * item_pid + 536) = pParty->pPickedItem.uEnchantmentType;
1966 v21 = pPlayers[uActiveCharacter]->AddItem(-1, 0xDCu);
1967 if ( v21 )
1968 //*(int *)&v0->field_1F5[36 * v21 + 15] = 1;
1969 pPlayers[uActiveCharacter]->pOwnItems[v21-1].uAttributes=ITEM_IDENTIFIED;
1970 v22 = (int)((char *)pPlayers[uActiveCharacter] + 36 * item_pid);
1971 if ( !(pItemsTable->pItems[*(int *)(v22 + 532) ].uItemID_Rep_St) )
1972 *(int *)(v22 + 552) |= 1u;
1973 if ( !dword_4E455C )
1974 {
1975 pMouse->RemoveHoldingItem();
1976 no_rightlick_in_inventory = 1;
1977 return;
1978 }
1979 pPlayers[uActiveCharacter]->PlaySound(SPEECH_DO_POTION_FINE, 0);
1980 dword_4E455C = 0;
1981 pMouse->RemoveHoldingItem();
1982 no_rightlick_in_inventory = 1;
1983 return;
1613 } 1984 }
1614 } 1985 GameUI_DrawItemInfo(item);
1615 dword_507BF0_is_there_popup_onscreen = 1; 1986 return;
1616 viewparams->bRedrawGameUI = 1; 1987 }
1988 pPlayers[uActiveCharacter]->RemoveItemAtInventoryIndex(v18);
1989 pPlayers[uActiveCharacter]->SetCondition(0x10u, 0);
1990 v23 = 0;
1617 } 1991 }
1992 }
1993 pPlayers[uActiveCharacter]->ItemsEnchant(v23);
1994 pAudioPlayer->PlaySound(SOUND_8, 0, 0, -1, 0, 0, 0, 0);
1995
1996 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0);
1997
1998 v39.z = pParty->vPosition.z + pParty->sEyelevel;
1999 }
2000 v39.x = pParty->vPosition.x;
2001 v39.y = pParty->vPosition.y;
2002
2003 int rot_x, rot_y, rot_z;
2004 Vec3_int_::Rotate(64, pParty->sRotationY, pParty->sRotationX, v39, &rot_x, &rot_y, &rot_z);
2005 sub_42F7EB_DropItemAt(0x41Bu, rot_x, rot_y, rot_z, 0, 1, 0, 0, 0);
2006 if ( dword_4E455C )
2007 {
2008 if ( pPlayers[uActiveCharacter]->CanAct() )
2009 pPlayers[uActiveCharacter]->PlaySound(SPEECH_17, 0);
2010 ShowStatusBarString(pGlobalTXT_LocalizationStrings[444], 2u);
2011 dword_4E455C = 0;
2012 }
2013 pMouse->RemoveHoldingItem();
2014 no_rightlick_in_inventory = 1;
2015 return;
2016 }
2017 pMouse->RemoveHoldingItem();
2018 no_rightlick_in_inventory = true;
2019 return;
2020 }