comparison UI/UICharacter.cpp @ 1709:8251e59fd7c1

ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
author Grumpy7
date Tue, 24 Sep 2013 07:29:55 +0200
parents 5cbd88f8a2eb
children bc0fa6153fe1
comparison
equal deleted inserted replaced
1708:f8414042db1f 1709:8251e59fd7c1
775 pRenderer->DrawTextureTransparent(pPaperdoll_BodyX, pPaperdoll_BodyY, pIcons_LOD->GetTexture(papredoll_dbods[uPlayerID - 1])); 775 pRenderer->DrawTextureTransparent(pPaperdoll_BodyX, pPaperdoll_BodyY, pIcons_LOD->GetTexture(papredoll_dbods[uPlayerID - 1]));
776 if ( !bRingsShownInCharScreen ) 776 if ( !bRingsShownInCharScreen )
777 pRenderer->DrawMaskToZBuffer(pPaperdoll_BodyX, pPaperdoll_BodyY, pIcons_LOD->GetTexture(papredoll_dbods[uPlayerID - 1]), player->pEquipment.uArmor); 777 pRenderer->DrawMaskToZBuffer(pPaperdoll_BodyX, pPaperdoll_BodyY, pIcons_LOD->GetTexture(papredoll_dbods[uPlayerID - 1]), player->pEquipment.uArmor);
778 //Рука не занята или ... 778 //Рука не занята или ...
779 if ( !player->pEquipment.uMainHand 779 if ( !player->pEquipment.uMainHand
780 || ( pItemsTable->pItems[pPlayers[uPlayerID]->pInventoryItemList[player->pEquipment.uMainHand - 1].uItemID].uEquipType != EQUIP_MAIN_HAND) 780 || ( pPlayers[uPlayerID]->pInventoryItemList[player->pEquipment.uMainHand - 1].GetItemEquipType() != EQUIP_MAIN_HAND)
781 && (pItemsTable->pItems[pPlayers[uPlayerID]->pInventoryItemList[player->pEquipment.uMainHand - 1].uItemID].uSkillType != PLAYER_SKILL_SPEAR 781 && (pPlayers[uPlayerID]->pInventoryItemList[player->pEquipment.uMainHand - 1].GetItemEquipType() != PLAYER_SKILL_SPEAR
782 || pPlayers[uPlayerID]->pEquipment.uShield) ) 782 || pPlayers[uPlayerID]->pEquipment.uShield) )
783 pRenderer->DrawTextureTransparent(pPaperdoll_BodyX + pPaperdoll_LeftHand[pBodyComplection][0], pPaperdoll_BodyY + pPaperdoll_LeftHand[pBodyComplection][1], 783 pRenderer->DrawTextureTransparent(pPaperdoll_BodyX + pPaperdoll_LeftHand[pBodyComplection][0], pPaperdoll_BodyY + pPaperdoll_LeftHand[pBodyComplection][1],
784 pIcons_LOD->GetTexture(papredoll_dlads[uPlayerID - 1])); 784 pIcons_LOD->GetTexture(papredoll_dlads[uPlayerID - 1]));
785 //-----------------------------------------------------(Hand/Рука)--------------------------------------------------------------- 785 //-----------------------------------------------------(Hand/Рука)---------------------------------------------------------------
786 if ( pPlayers[uPlayerID]->pEquipment.uMainHand ) 786 if ( pPlayers[uPlayerID]->pEquipment.uMainHand )
789 item_X = pPaperdoll_BodyX + paperdoll_Weapon[pBodyComplection][1][0] - pItemsTable->pItems[item->uItemID].uEquipX; 789 item_X = pPaperdoll_BodyX + paperdoll_Weapon[pBodyComplection][1][0] - pItemsTable->pItems[item->uItemID].uEquipX;
790 item_Y = pPaperdoll_BodyY + paperdoll_Weapon[pBodyComplection][1][1] - pItemsTable->pItems[item->uItemID].uEquipY; 790 item_Y = pPaperdoll_BodyY + paperdoll_Weapon[pBodyComplection][1][1] - pItemsTable->pItems[item->uItemID].uEquipY;
791 if ( item->uItemID == 64 ) //blaster 791 if ( item->uItemID == 64 ) //blaster
792 v166 = "item64v1"; 792 v166 = "item64v1";
793 else 793 else
794 v166 = pItemsTable->pItems[item->uItemID].pIconName; 794 v166 = item->GetIconName();
795 if ( !( item->uAttributes & 0xF0 ) ) 795 if ( !( item->uAttributes & 0xF0 ) )
796 { 796 {
797 if ( item->uAttributes & 2 ) 797 if ( item->uAttributes & 2 )
798 pRenderer->DrawTransparentRedShade(item_X, item_Y, pIcons_LOD->GetTexture(pIcons_LOD->LoadTexture(v166, TEXTURE_16BIT_PALETTE))); 798 pRenderer->DrawTransparentRedShade(item_X, item_Y, pIcons_LOD->GetTexture(pIcons_LOD->LoadTexture(v166, TEXTURE_16BIT_PALETTE)));
799 else 799 else
837 item_X = pPaperdoll_BodyX + paperdoll_Weapon[pBodyComplection][2][0] - pItemsTable->pItems[item->uItemID].uEquipX; 837 item_X = pPaperdoll_BodyX + paperdoll_Weapon[pBodyComplection][2][0] - pItemsTable->pItems[item->uItemID].uEquipX;
838 item_Y = pPaperdoll_BodyY + paperdoll_Weapon[pBodyComplection][2][1] - pItemsTable->pItems[item->uItemID].uEquipY; 838 item_Y = pPaperdoll_BodyY + paperdoll_Weapon[pBodyComplection][2][1] - pItemsTable->pItems[item->uItemID].uEquipY;
839 if ( !(item->uAttributes & 0xF0) )// если не применён закл 839 if ( !(item->uAttributes & 0xF0) )// если не применён закл
840 { 840 {
841 if ( item->uAttributes & 2 ) 841 if ( item->uAttributes & 2 )
842 pRenderer->DrawTransparentRedShade(item_X, item_Y, pIcons_LOD->GetTexture(pIcons_LOD->LoadTexture(pItemsTable->pItems[item->uItemID].pIconName, TEXTURE_16BIT_PALETTE))); 842 pRenderer->DrawTransparentRedShade(item_X, item_Y, pIcons_LOD->GetTexture(pIcons_LOD->LoadTexture(item->GetIconName(), TEXTURE_16BIT_PALETTE)));
843 else 843 else
844 { 844 {
845 if ( !(item->uAttributes & 1) )//не опознанный лук зелёный 845 if ( !(item->uAttributes & 1) )//не опознанный лук зелёный
846 pRenderer->DrawTransparentGreenShade(item_X, item_Y, pIcons_LOD->GetTexture(pIcons_LOD->LoadTexture(pItemsTable->pItems[item->uItemID].pIconName, TEXTURE_16BIT_PALETTE))); 846 pRenderer->DrawTransparentGreenShade(item_X, item_Y, pIcons_LOD->GetTexture(pIcons_LOD->LoadTexture(item->GetIconName(), TEXTURE_16BIT_PALETTE)));
847 else // опознанный лук 847 else // опознанный лук
848 pRenderer->DrawTextureTransparent(item_X, item_Y, pIcons_LOD->GetTexture(pIcons_LOD->LoadTexture(pItemsTable->pItems[item->uItemID].pIconName, TEXTURE_16BIT_PALETTE))); 848 pRenderer->DrawTextureTransparent(item_X, item_Y, pIcons_LOD->GetTexture(pIcons_LOD->LoadTexture(item->GetIconName(), TEXTURE_16BIT_PALETTE)));
849 } 849 }
850 } 850 }
851 else 851 else
852 { 852 {
853 if ( (item->uAttributes & 0xF0) == ITEM_AURA_EFFECT_RED ) 853 if ( (item->uAttributes & 0xF0) == ITEM_AURA_EFFECT_RED )
863 { 863 {
864 _50C9A8_item_enchantment_timer = 0; 864 _50C9A8_item_enchantment_timer = 0;
865 item->uAttributes &= 0xFFFFFF0Fu; 865 item->uAttributes &= 0xFFFFFF0Fu;
866 ptr_50C9A4_ItemToEnchant = 0; 866 ptr_50C9A4_ItemToEnchant = 0;
867 } 867 }
868 pRenderer->DrawAura(item_X, item_Y, pIcons_LOD->GetTexture(pIcons_LOD->LoadTexture(pItemsTable->pItems[item->uItemID].pIconName, TEXTURE_16BIT_PALETTE)), 868 pRenderer->DrawAura(item_X, item_Y, pIcons_LOD->GetTexture(pIcons_LOD->LoadTexture(item->GetIconName(), TEXTURE_16BIT_PALETTE)),
869 pIcons_LOD->LoadTexturePtr(container, TEXTURE_16BIT_PALETTE), 869 pIcons_LOD->LoadTexturePtr(container, TEXTURE_16BIT_PALETTE),
870 GetTickCount() * 0.1, 0, 255); 870 GetTickCount() * 0.1, 0, 255);
871 } 871 }
872 if ( !bRingsShownInCharScreen ) 872 if ( !bRingsShownInCharScreen )
873 pRenderer->DrawMaskToZBuffer(item_X, item_Y, pIcons_LOD->GetTexture(pIcons_LOD->LoadTexture(pItemsTable->pItems[item->uItemID].pIconName, TEXTURE_16BIT_PALETTE)), 873 pRenderer->DrawMaskToZBuffer(item_X, item_Y, pIcons_LOD->GetTexture(pIcons_LOD->LoadTexture(item->GetIconName(), TEXTURE_16BIT_PALETTE)),
874 pPlayers[uPlayerID]->pEquipment.uBow); 874 pPlayers[uPlayerID]->pEquipment.uBow);
875 } 875 }
876 //-----------------------------(Cloak/Плащ)--------------------------------------------------------- 876 //-----------------------------(Cloak/Плащ)---------------------------------------------------------
877 if ( pPlayers[uPlayerID]->pEquipment.uCloak ) 877 if ( pPlayers[uPlayerID]->pEquipment.uCloak )
878 { 878 {
1060 pRenderer->DrawMaskToZBuffer(item_X, item_Y, pIcons_LOD->GetTexture(v59), pPlayers[uPlayerID]->pEquipment.uBoot); 1060 pRenderer->DrawMaskToZBuffer(item_X, item_Y, pIcons_LOD->GetTexture(v59), pPlayers[uPlayerID]->pEquipment.uBoot);
1061 } 1061 }
1062 } 1062 }
1063 //--------------------------------------------(Hand/Рука)------------------------------------------------------ 1063 //--------------------------------------------(Hand/Рука)------------------------------------------------------
1064 if ( !pPlayers[uPlayerID]->pEquipment.uMainHand 1064 if ( !pPlayers[uPlayerID]->pEquipment.uMainHand
1065 || ( pItemsTable->pItems[pPlayers[uPlayerID]->pInventoryItemList[pPlayers[uPlayerID]->pEquipment.uMainHand -1].uItemID].uEquipType != EQUIP_MAIN_HAND) 1065 || ( pPlayers[uPlayerID]->pInventoryItemList[pPlayers[uPlayerID]->pEquipment.uMainHand -1].GetItemEquipType() != EQUIP_MAIN_HAND)
1066 && (pItemsTable->pItems[pPlayers[uPlayerID]->pInventoryItemList[pPlayers[uPlayerID]->pEquipment.uMainHand -1].uItemID].uSkillType != PLAYER_SKILL_SPEAR 1066 && (pPlayers[uPlayerID]->pInventoryItemList[pPlayers[uPlayerID]->pEquipment.uMainHand -1].GetItemEquipType() != PLAYER_SKILL_SPEAR
1067 || pPlayers[uPlayerID]->pEquipment.uShield) ) 1067 || pPlayers[uPlayerID]->pEquipment.uShield) )
1068 pRenderer->DrawTextureTransparent(pPaperdoll_BodyX + pPaperdoll_LeftHand[pBodyComplection][0], 1068 pRenderer->DrawTextureTransparent(pPaperdoll_BodyX + pPaperdoll_LeftHand[pBodyComplection][0],
1069 pPaperdoll_BodyY + pPaperdoll_LeftHand[pBodyComplection][1], pIcons_LOD->GetTexture(papredoll_dlads[uPlayerID - 1])); 1069 pPaperdoll_BodyY + pPaperdoll_LeftHand[pBodyComplection][1], pIcons_LOD->GetTexture(papredoll_dlads[uPlayerID - 1]));
1070 //--------------------------------------------(Belt/Пояс)------------------------------------------------------- 1070 //--------------------------------------------(Belt/Пояс)-------------------------------------------------------
1071 if ( pPlayers[uPlayerID]->pEquipment.uBelt ) 1071 if ( pPlayers[uPlayerID]->pEquipment.uBelt )
1128 } 1128 }
1129 } 1129 }
1130 //---------------------------------------------(Hand2/Рука2)-------------------------------------------------- 1130 //---------------------------------------------(Hand2/Рука2)--------------------------------------------------
1131 if ( pPlayers[uPlayerID]->pEquipment.uMainHand ) 1131 if ( pPlayers[uPlayerID]->pEquipment.uMainHand )
1132 { 1132 {
1133 if ( pItemsTable->pItems[pPlayers[uPlayerID]->pInventoryItemList[pPlayers[uPlayerID]->pEquipment.uMainHand - 1].uItemID].uEquipType == EQUIP_MAIN_HAND 1133 if ( pPlayers[uPlayerID]->pInventoryItemList[pPlayers[uPlayerID]->pEquipment.uMainHand - 1].GetItemEquipType() == EQUIP_MAIN_HAND
1134 || pItemsTable->pItems[pPlayers[uPlayerID]->pInventoryItemList[pPlayers[uPlayerID]->pEquipment.uMainHand - 1].uItemID].uSkillType == PLAYER_SKILL_SPEAR 1134 || pPlayers[uPlayerID]->pInventoryItemList[pPlayers[uPlayerID]->pEquipment.uMainHand - 1].GetItemEquipType() == PLAYER_SKILL_SPEAR
1135 && !pPlayers[uPlayerID]->pEquipment.uShield ) 1135 && !pPlayers[uPlayerID]->pEquipment.uShield )
1136 pRenderer->DrawTextureTransparent(pPaperdoll_BodyX + pPaperdoll_SecondLeftHand[pBodyComplection][0], 1136 pRenderer->DrawTextureTransparent(pPaperdoll_BodyX + pPaperdoll_SecondLeftHand[pBodyComplection][0],
1137 pPaperdoll_BodyY + pPaperdoll_SecondLeftHand[pBodyComplection][1], pIcons_LOD->GetTexture(papredoll_dlaus[uPlayerID - 1])); 1137 pPaperdoll_BodyY + pPaperdoll_SecondLeftHand[pBodyComplection][1], pIcons_LOD->GetTexture(papredoll_dlaus[uPlayerID - 1]));
1138 } 1138 }
1139 //--------------------------------(Shoulder/Плечи)--------------------------------------------- 1139 //--------------------------------(Shoulder/Плечи)---------------------------------------------
1405 item_X = pPaperdoll_BodyX + paperdoll_Weapon[pBodyComplection][1][0] - pItemsTable->pItems[item->uItemID].uEquipX; 1405 item_X = pPaperdoll_BodyX + paperdoll_Weapon[pBodyComplection][1][0] - pItemsTable->pItems[item->uItemID].uEquipX;
1406 item_Y = pPaperdoll_BodyY + paperdoll_Weapon[pBodyComplection][1][1] - pItemsTable->pItems[item->uItemID].uEquipY; 1406 item_Y = pPaperdoll_BodyY + paperdoll_Weapon[pBodyComplection][1][1] - pItemsTable->pItems[item->uItemID].uEquipY;
1407 if ( item->uItemID == 64 ) 1407 if ( item->uItemID == 64 )
1408 v181 = "item64v1"; 1408 v181 = "item64v1";
1409 else 1409 else
1410 v181 = pItemsTable->pItems[item->uItemID].pIconName; 1410 v181 = item->GetIconName();
1411 if ( !(item->uAttributes & 0xF0) ) 1411 if ( !(item->uAttributes & 0xF0) )
1412 { 1412 {
1413 if ( item->uAttributes & 2 ) 1413 if ( item->uAttributes & 2 )
1414 pRenderer->DrawTransparentRedShade(item_X, item_Y, pIcons_LOD->GetTexture(pIcons_LOD->LoadTexture(v181, TEXTURE_16BIT_PALETTE))); 1414 pRenderer->DrawTransparentRedShade(item_X, item_Y, pIcons_LOD->GetTexture(pIcons_LOD->LoadTexture(v181, TEXTURE_16BIT_PALETTE)));
1415 else 1415 else
1446 } 1446 }
1447 //--------------------------------------------------(Shield/Щит)--------------------------------------------- 1447 //--------------------------------------------------(Shield/Щит)---------------------------------------------
1448 if ( pPlayers[uPlayerID]->pEquipment.uShield ) 1448 if ( pPlayers[uPlayerID]->pEquipment.uShield )
1449 { 1449 {
1450 item = &pPlayers[uPlayerID]->pInventoryItemList[pPlayers[uPlayerID]->pEquipment.uShield - 1]; 1450 item = &pPlayers[uPlayerID]->pInventoryItemList[pPlayers[uPlayerID]->pEquipment.uShield - 1];
1451 if ( pItemsTable->pItems[item->uItemID].uSkillType == PLAYER_SKILL_DAGGER 1451 if ( item->GetPlayerSkillType() == PLAYER_SKILL_DAGGER
1452 || pItemsTable->pItems[item->uItemID].uSkillType == PLAYER_SKILL_SWORD ) 1452 || item->GetPlayerSkillType() == PLAYER_SKILL_SWORD )
1453 { 1453 {
1454 //v151 = item->uItemID - 400; 1454 //v151 = item->uItemID - 400;
1455 item_X = 596; 1455 item_X = 596;
1456 v245 = 1; 1456 v245 = 1;
1457 switch ( item->uItemID ) 1457 switch ( item->uItemID )
1476 { 1476 {
1477 v245 = 0; 1477 v245 = 0;
1478 item_X = pPaperdoll_BodyX + paperdoll_Weapon[pBodyComplection][0][0] - pItemsTable->pItems[item->uItemID].uEquipX; 1478 item_X = pPaperdoll_BodyX + paperdoll_Weapon[pBodyComplection][0][0] - pItemsTable->pItems[item->uItemID].uEquipX;
1479 item_Y = pPaperdoll_BodyY + paperdoll_Weapon[pBodyComplection][0][1] - pItemsTable->pItems[item->uItemID].uEquipY; 1479 item_Y = pPaperdoll_BodyY + paperdoll_Weapon[pBodyComplection][0][1] - pItemsTable->pItems[item->uItemID].uEquipY;
1480 } 1480 }
1481 v153 = pIcons_LOD->LoadTexture(pItemsTable->pItems[item->uItemID].pIconName, TEXTURE_16BIT_PALETTE); 1481 v153 = pIcons_LOD->LoadTexture(item->GetIconName(), TEXTURE_16BIT_PALETTE);
1482 if ( !(item->uAttributes & 0xF0) ) 1482 if ( !(item->uAttributes & 0xF0) )
1483 { 1483 {
1484 if ( item->uAttributes & 2 ) 1484 if ( item->uAttributes & 2 )
1485 pRenderer->DrawTransparentRedShade(item_X, item_Y, pIcons_LOD->GetTexture(v153)); 1485 pRenderer->DrawTransparentRedShade(item_X, item_Y, pIcons_LOD->GetTexture(v153));
1486 else 1486 else
1523 pRenderer->DrawTextureTransparent(pPaperdoll_BodyX + pPaperdoll_RightHand[pBodyComplection][0], pPaperdoll_BodyY + pPaperdoll_RightHand[pBodyComplection][1], pIcons_LOD->GetTexture(papredoll_drhs[uPlayerID - 1])); 1523 pRenderer->DrawTextureTransparent(pPaperdoll_BodyX + pPaperdoll_RightHand[pBodyComplection][0], pPaperdoll_BodyY + pPaperdoll_RightHand[pBodyComplection][1], pIcons_LOD->GetTexture(papredoll_drhs[uPlayerID - 1]));
1524 //--------------------------------------------------------(LeftHand/Левая рука)---------------------------------------------------- 1524 //--------------------------------------------------------(LeftHand/Левая рука)----------------------------------------------------
1525 if ( pPlayers[uPlayerID]->pEquipment.uMainHand ) 1525 if ( pPlayers[uPlayerID]->pEquipment.uMainHand )
1526 { 1526 {
1527 item = &pPlayers[uPlayerID]->pInventoryItemList[pPlayers[uPlayerID]->pEquipment.uMainHand - 1]; 1527 item = &pPlayers[uPlayerID]->pInventoryItemList[pPlayers[uPlayerID]->pEquipment.uMainHand - 1];
1528 if ( pItemsTable->pItems[item->uItemID].uEquipType == EQUIP_MAIN_HAND 1528 if ( item->GetItemEquipType() == EQUIP_MAIN_HAND
1529 || pItemsTable->pItems[item->uItemID].uSkillType == PLAYER_SKILL_SPEAR 1529 || item->GetItemEquipType() == PLAYER_SKILL_SPEAR
1530 && !pPlayers[uPlayerID]->pEquipment.uShield ) 1530 && !pPlayers[uPlayerID]->pEquipment.uShield )
1531 pRenderer->DrawTextureTransparent(pPaperdoll_BodyX + pPaperdoll_SecondLeftHand[pBodyComplection][0], 1531 pRenderer->DrawTextureTransparent(pPaperdoll_BodyX + pPaperdoll_SecondLeftHand[pBodyComplection][0],
1532 pPaperdoll_BodyY + pPaperdoll_SecondLeftHand[pBodyComplection][1], 1532 pPaperdoll_BodyY + pPaperdoll_SecondLeftHand[pBodyComplection][1],
1533 pIcons_LOD->GetTexture(papredoll_dlhus[uPlayerID - 1])); 1533 pIcons_LOD->GetTexture(papredoll_dlhus[uPlayerID - 1]));
1534 } 1534 }
1556 continue; 1556 continue;
1557 if ( !player->pInventoryItemList[player->pInventoryMatrix[i] - 1].uItemID ) 1557 if ( !player->pInventoryItemList[player->pInventoryMatrix[i] - 1].uItemID )
1558 continue; 1558 continue;
1559 uCellY = 32 * (i / 14) + 17; 1559 uCellY = 32 * (i / 14) + 17;
1560 uCellX = 32 * (i % 14) + 14; 1560 uCellX = 32 * (i % 14) + 14;
1561 uint item_texture_id = pIcons_LOD->LoadTexture(pItemsTable->pItems[player->pInventoryItemList[player->pInventoryMatrix[i] - 1].uItemID].pIconName, TEXTURE_16BIT_PALETTE); 1561 uint item_texture_id = pIcons_LOD->LoadTexture(player->pInventoryItemList[player->pInventoryMatrix[i] - 1].GetIconName(), TEXTURE_16BIT_PALETTE);
1562 pTexture = pIcons_LOD->GetTexture(item_texture_id); 1562 pTexture = pIcons_LOD->GetTexture(item_texture_id);
1563 if (pTexture->uTextureWidth < 14) 1563 if (pTexture->uTextureWidth < 14)
1564 pTexture->uTextureWidth = 14; 1564 pTexture->uTextureWidth = 14;
1565 if ( (pTexture->uTextureWidth - 14) / 32 == 0 && pTexture->uTextureWidth < 32) 1565 if ( (pTexture->uTextureWidth - 14) / 32 == 0 && pTexture->uTextureWidth < 32)
1566 uCellX += (32 - pTexture->uTextureWidth) / 2; 1566 uCellX += (32 - pTexture->uTextureWidth) / 2;
1606 } 1606 }
1607 } 1607 }
1608 1608
1609 static void CharacterUI_DrawItem(int x, int y, ItemGen *item, int id) 1609 static void CharacterUI_DrawItem(int x, int y, ItemGen *item, int id)
1610 { 1610 {
1611 auto item_texture = pIcons_LOD->LoadTexturePtr(pItemsTable->pItems[item->uItemID].pIconName, TEXTURE_16BIT_PALETTE); 1611 auto item_texture = pIcons_LOD->LoadTexturePtr(item->GetIconName(), TEXTURE_16BIT_PALETTE);
1612 1612
1613 if (item->uAttributes & 0xF0) // enchant animation 1613 if (item->uAttributes & 0xF0) // enchant animation
1614 { 1614 {
1615 Texture *enchantment_texture = nullptr; 1615 Texture *enchantment_texture = nullptr;
1616 switch (item->uAttributes & 0xF0) 1616 switch (item->uAttributes & 0xF0)
2340 2340
2341 v51 = 0; 2341 v51 = 0;
2342 _this.Reset(); 2342 _this.Reset();
2343 v1 = pPlayers[uActiveCharacter]->pEquipment.uMainHand; 2343 v1 = pPlayers[uActiveCharacter]->pEquipment.uMainHand;
2344 v2 = pPlayers[uActiveCharacter]->pEquipment.uShield; 2344 v2 = pPlayers[uActiveCharacter]->pEquipment.uShield;
2345 if ( v1 && pItemsTable->pItems[*(int *)&pPlayers[uActiveCharacter]->pInventoryItemList[v1 - 1]].uEquipType == EQUIP_MAIN_HAND ) 2345 if ( v1 && pPlayers[uActiveCharacter]->pInventoryItemList[v1 - 1].GetItemEquipType() == EQUIP_MAIN_HAND )
2346 v51 = v1; 2346 v51 = v1;
2347 v3 = pParty->pPickedItem.uItemID; 2347 v3 = pParty->pPickedItem.uItemID;
2348 if ( pParty->pPickedItem.uItemID ) 2348 if ( pParty->pPickedItem.uItemID )
2349 { 2349 {
2350 pEquipType = pItemsTable->pItems[pParty->pPickedItem.uItemID].uEquipType; 2350 pEquipType = pParty->pPickedItem.GetItemEquipType();
2351 pSkillType = pItemsTable->pItems[pParty->pPickedItem.uItemID].uSkillType; 2351 pSkillType = pParty->pPickedItem.GetItemEquipType();
2352 if ( pSkillType == 4 ) 2352 if ( pSkillType == 4 )
2353 { 2353 {
2354 if ( v2 ) 2354 if ( v2 )
2355 { 2355 {
2356 LOBYTE(v5) = pPlayers[uActiveCharacter]->GetActualSkillLevel(PLAYER_SKILL_SPEAR); 2356 LOBYTE(v5) = pPlayers[uActiveCharacter]->GetActualSkillLevel(PLAYER_SKILL_SPEAR);
2364 } 2364 }
2365 else 2365 else
2366 { 2366 {
2367 if ( (pSkillType == 8 || pSkillType == 1 || pSkillType == 2) 2367 if ( (pSkillType == 8 || pSkillType == 1 || pSkillType == 2)
2368 && v1 2368 && v1
2369 && pItemsTable->pItems[*(int *)&pPlayers[uActiveCharacter]->pInventoryItemList[v1 - 1]].uSkillType == 4 ) 2369 && pPlayers[uActiveCharacter]->pInventoryItemList[v1 - 1].GetPlayerSkillType() == 4 )
2370 { 2370 {
2371 LOBYTE(v5) = pPlayers[uActiveCharacter]->GetActualSkillLevel(PLAYER_SKILL_SPEAR); 2371 LOBYTE(v5) = pPlayers[uActiveCharacter]->GetActualSkillLevel(PLAYER_SKILL_SPEAR);
2372 if ( (signed int)SkillToMastery(v5) < 3 ) 2372 if ( (signed int)SkillToMastery(v5) < 3 )
2373 { 2373 {
2374 pPlayers[uActiveCharacter]->PlaySound(SPEECH_39, 0); 2374 pPlayers[uActiveCharacter]->PlaySound(SPEECH_39, 0);
2670 v34 = pRenderer->pActiveZBuffer[pMouse->uMouseClickX + pSRZBufferLineOffsets[pMouse->uMouseClickY]] & 0xFFFF; 2670 v34 = pRenderer->pActiveZBuffer[pMouse->uMouseClickX + pSRZBufferLineOffsets[pMouse->uMouseClickY]] & 0xFFFF;
2671 if ( v34 ) 2671 if ( v34 )
2672 { 2672 {
2673 v36 = v34 - 1; 2673 v36 = v34 - 1;
2674 v38 = &pPlayers[uActiveCharacter]->pInventoryItemList[v36]; 2674 v38 = &pPlayers[uActiveCharacter]->pInventoryItemList[v36];
2675 pEquipType = pItemsTable->pItems[v38->uItemID].uEquipType; 2675 pEquipType = v38->GetItemEquipType();
2676 if ( v38->uItemID == ITEM_WETSUIT ) 2676 if ( v38->uItemID == ITEM_WETSUIT )
2677 { 2677 {
2678 if ( bUnderwater ) 2678 if ( bUnderwater )
2679 { 2679 {
2680 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0); 2680 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0);