comparison UI/UICharacter.cpp @ 1488:f62e6d06acac

UICharacter.cpp cleaning(continue) OnPaperdollLeftClick(4)
author Ritor1
date Fri, 30 Aug 2013 01:49:29 +0600
parents 58d43397b827
children ab6bf38b2940
comparison
equal deleted inserted replaced
1487:cb396f55671e 1488:f62e6d06acac
2323 unsigned int v3; // edx@4 2323 unsigned int v3; // edx@4
2324 unsigned int pSkillType; // esi@5 2324 unsigned int pSkillType; // esi@5
2325 unsigned __int16 v5; // ax@7 2325 unsigned __int16 v5; // ax@7
2326 int v7; // esi@27 2326 int v7; // esi@27
2327 int v8; // eax@29 2327 int v8; // eax@29
2328 int v10; // esi@34 2328 //int v10; // esi@34
2329 int v12; // esi@38 2329 //int v12; // esi@38
2330 char v14; // zf@38 2330 //char v14; // zf@38
2331 int v15; // esi@42 2331 //int v15; // esi@42
2332 int v17; // eax@44 2332 int v17; // eax@44
2333 unsigned int v18; // ecx@55 2333 unsigned int v18; // ecx@55
2334 unsigned int v19; // eax@55 2334 unsigned int v19; // eax@55
2335 int v20; // esi@60 2335 //int v20; // esi@60
2336 unsigned int v22; // eax@61 2336 unsigned int v22; // eax@61
2337 int v23; // eax@62 2337 int v23; // eax@62
2338 int v24; // esi@65 2338 //int v24; // esi@65
2339 int v25; // eax@65 2339 //int v25; // eax@65
2340 int v26; // eax@69 2340 int v26; // eax@69
2341 int v27; // esi@81 2341 //int v27; // esi@81
2342 int v28; // eax@81 2342 //int v28; // eax@81
2343 int v29; // esi@84 2343 //int v29; // esi@84
2344 int v30; // eax@84 2344 //int v30; // eax@84
2345 int v31; // eax@85 2345 //int v31; // eax@85
2346 unsigned int v32; // ecx@88 2346 unsigned int v32; // ecx@88
2347 unsigned int v33; // eax@88 2347 unsigned int v33; // eax@88
2348 int v34; // esi@90 2348 int v34; // esi@90
2349 unsigned int v35; // eax@91 2349 //unsigned int v35; // eax@91
2350 int v36; // esi@93 2350 int v36; // esi@93
2351 int v37; // edi@93 2351 int v37; // edi@93
2352 ItemGen *v38; // edi@93 2352 ItemGen *v38; // edi@93
2353 __int16 v39; // dx@99 2353 //__int16 v39; // dx@99
2354 ItemGen _this; // [sp+Ch] [bp-40h]@1 2354 ItemGen _this; // [sp+Ch] [bp-40h]@1
2355 unsigned int v48; // [sp+30h] [bp-1Ch]@88 2355 unsigned int v48; // [sp+30h] [bp-1Ch]@88
2356 unsigned int v49; // [sp+34h] [bp-18h]@57 2356 //unsigned int v49; // [sp+34h] [bp-18h]@57
2357 unsigned int v50; // [sp+38h] [bp-14h]@50 2357 unsigned int v50; // [sp+38h] [bp-14h]@50
2358 int v51; // [sp+3Ch] [bp-10h]@1 2358 int v51; // [sp+3Ch] [bp-10h]@1
2359 int v52; // [sp+40h] [bp-Ch]@5 2359 int v52; // [sp+40h] [bp-Ch]@5
2360 ITEM_EQUIP_TYPE pEquipType; 2360 ITEM_EQUIP_TYPE pEquipType;
2361 2361
2363 _this.Reset(); 2363 _this.Reset();
2364 v1 = pPlayers[uActiveCharacter]->pEquipment.uMainHand; 2364 v1 = pPlayers[uActiveCharacter]->pEquipment.uMainHand;
2365 v2 = pPlayers[uActiveCharacter]->pEquipment.uShield; 2365 v2 = pPlayers[uActiveCharacter]->pEquipment.uShield;
2366 //v54 = pPlayers[uActiveCharacter]->pEquipment.uShield; 2366 //v54 = pPlayers[uActiveCharacter]->pEquipment.uShield;
2367 //v53 = v1; 2367 //v53 = v1;
2368 if ( v1 && pItemsTable->pItems[*(int *)&pPlayers[uActiveCharacter]->pInventoryItemList[v1 - 1]].uEquipType == 1 ) 2368 if ( v1 && pItemsTable->pItems[*(int *)&pPlayers[uActiveCharacter]->pInventoryItemList[v1 - 1]].uEquipType == EQUIP_MAIN_HAND )
2369 v51 = v1; 2369 v51 = v1;
2370 v3 = pParty->pPickedItem.uItemID; 2370 v3 = pParty->pPickedItem.uItemID;
2371 if ( pParty->pPickedItem.uItemID ) 2371 if ( pParty->pPickedItem.uItemID )
2372 { 2372 {
2373 pEquipType = pItemsTable->pItems[pParty->pPickedItem.uItemID].uEquipType; 2373 pEquipType = pItemsTable->pItems[pParty->pPickedItem.uItemID].uEquipType;
2387 } 2387 }
2388 else 2388 else
2389 { 2389 {
2390 if ( (pSkillType == 8 || pSkillType == 1 || pSkillType == 2) 2390 if ( (pSkillType == 8 || pSkillType == 1 || pSkillType == 2)
2391 && v1 2391 && v1
2392 && pItemsTable->pItems[*(int *)&pPlayers[uActiveCharacter]->pInventoryItemList[v1-1]].uSkillType == 4 ) 2392 && pItemsTable->pItems[*(int *)&pPlayers[uActiveCharacter]->pInventoryItemList[v1 - 1]].uSkillType == 4 )
2393 { 2393 {
2394 LOBYTE(v5) = pPlayers[uActiveCharacter]->GetActualSkillLevel(PLAYER_SKILL_SPEAR); 2394 LOBYTE(v5) = pPlayers[uActiveCharacter]->GetActualSkillLevel(PLAYER_SKILL_SPEAR);
2395 if ( (signed int)SkillToMastery(v5) < 3 ) 2395 if ( (signed int)SkillToMastery(v5) < 3 )
2396 { 2396 {
2397 pPlayers[uActiveCharacter]->PlaySound(SPEECH_39, 0); 2397 pPlayers[uActiveCharacter]->PlaySound(SPEECH_39, 0);
2420 case EQUIP_BELT: 2420 case EQUIP_BELT:
2421 case EQUIP_CLOAK: 2421 case EQUIP_CLOAK:
2422 case EQUIP_GAUNTLETS: 2422 case EQUIP_GAUNTLETS:
2423 case EQUIP_BOOTS: 2423 case EQUIP_BOOTS:
2424 case EQUIP_AMULET: 2424 case EQUIP_AMULET:
2425 if ( !pPlayers[uActiveCharacter]->HasSkill(pSkillType) ) 2425 if ( !pPlayers[uActiveCharacter]->HasSkill(pSkillType) )//нет навыка
2426 { 2426 {
2427 pPlayers[uActiveCharacter]->PlaySound(SPEECH_39, 0); 2427 pPlayers[uActiveCharacter]->PlaySound(SPEECH_39, 0);
2428 return; 2428 return;
2429 } 2429 }
2430 if ( sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped(uActiveCharacter) && (pEquipType != EQUIP_ARMOUR || bUnderwater) ) 2430 if ( sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped(uActiveCharacter) && (pEquipType != EQUIP_ARMOUR || bUnderwater) )
2434 } 2434 }
2435 pPlayers[uActiveCharacter]->EquipBody(pEquipType); 2435 pPlayers[uActiveCharacter]->EquipBody(pEquipType);
2436 if ( pParty->pPickedItem.uItemID == ITEM_WETSUIT ) 2436 if ( pParty->pPickedItem.uItemID == ITEM_WETSUIT )
2437 WetsuitOff(uActiveCharacter); 2437 WetsuitOff(uActiveCharacter);
2438 return; 2438 return;
2439 2439 //------------------------dress rings(одевание колец)----------------------------------
2440 case EQUIP_RING://Кольца 2440 case EQUIP_RING:
2441 if ( sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped(uActiveCharacter) ) 2441 if ( sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped(uActiveCharacter) )
2442 { 2442 {
2443 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0); 2443 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0);
2444 return; 2444 return;
2445 } 2445 }
2463 } 2463 }
2464 if ( v52 == 16 )//замещение последнего кольца 2464 if ( v52 == 16 )//замещение последнего кольца
2465 { 2465 {
2466 v52 = pPlayers[uActiveCharacter]->pEquipment.uRings[5] - 1; 2466 v52 = pPlayers[uActiveCharacter]->pEquipment.uRings[5] - 1;
2467 memcpy(&_this, &pParty->pPickedItem, sizeof(_this)); 2467 memcpy(&_this, &pParty->pPickedItem, sizeof(_this));
2468 v10 = (int)((char *)pPlayers[uActiveCharacter] + 36 * v52); 2468 pPlayers[uActiveCharacter]->pInventoryItemList[v52].uBodyAnchor = 0;
2469 *(char *)(v10 + 556) = 0;
2470 pParty->pPickedItem.Reset(); 2469 pParty->pPickedItem.Reset();
2471 pParty->SetHoldingItem(&pPlayers[uActiveCharacter]->pInventoryItemList[v52]);//(ItemGen *)(v10 + 532) 2470 pParty->SetHoldingItem(&pPlayers[uActiveCharacter]->pInventoryItemList[v52]);
2472 _this.uBodyAnchor = 16; 2471 _this.uBodyAnchor = 16;
2473 memcpy(&pPlayers[uActiveCharacter]->pInventoryItemList[v52], &_this, 0x24u); 2472 memcpy(&pPlayers[uActiveCharacter]->pInventoryItemList[v52], &_this, 0x24u);
2474 pPlayers[uActiveCharacter]->pEquipment.uRings[6] = v52 + 1; 2473 pPlayers[uActiveCharacter]->pEquipment.uRings[5] = v52 + 1;
2475 } 2474 }
2476 return; 2475 return;
2477 2476 //------------------dress shield(одеть щит)------------------------------------------------------
2478 case EQUIP_SHIELD://Щит 2477 case EQUIP_SHIELD://Щит
2479 if ( sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped(uActiveCharacter) ) 2478 if ( sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped(uActiveCharacter) )//в акваланге
2480 { 2479 {
2481 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0); 2480 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0);
2482 return; 2481 return;
2483 } 2482 }
2484 if ( !pPlayers[uActiveCharacter]->HasSkill(pSkillType) ) 2483 if ( !pPlayers[uActiveCharacter]->HasSkill(pSkillType) )//нет навыка
2485 { 2484 {
2486 pPlayers[uActiveCharacter]->PlaySound(SPEECH_39, 0); 2485 pPlayers[uActiveCharacter]->PlaySound(SPEECH_39, 0);
2487 return; 2486 return;
2488 } 2487 }
2489 if ( v2 ) 2488 if ( v2 )//смена щита щитом
2490 { 2489 {
2491 --v2; 2490 --v2;
2492 memcpy(&_this, &pParty->pPickedItem, sizeof(_this)); 2491 memcpy(&_this, &pParty->pPickedItem, sizeof(_this));
2493 v12 = (int)((char *)pPlayers[uActiveCharacter] + 36 * v2); 2492 pPlayers[uActiveCharacter]->pInventoryItemList[v2].uBodyAnchor = 0;
2494 *(char *)(v12 + 556) = 0;
2495 pParty->pPickedItem.Reset(); 2493 pParty->pPickedItem.Reset();
2496 pParty->SetHoldingItem((ItemGen *)(v12 + 532)); 2494 pParty->SetHoldingItem(&pPlayers[uActiveCharacter]->pInventoryItemList[v2]);
2497 _this.uBodyAnchor = 1; 2495 _this.uBodyAnchor = 1;
2498 v14 = v51 == 0; 2496 memcpy(&pPlayers[uActiveCharacter]->pInventoryItemList[v2], &_this, 0x24u);
2499 memcpy((void *)(v12 + 532), &_this, 0x24u);
2500 pPlayers[uActiveCharacter]->pEquipment.uShield = v2 + 1; 2497 pPlayers[uActiveCharacter]->pEquipment.uShield = v2 + 1;
2501 if ( v14 ) 2498 if ( v51 == EQUIP_OFF_HAND )
2502 return; 2499 return;
2503 } 2500 }
2504 else 2501 else
2505 { 2502 {
2506 v52 = pPlayers[uActiveCharacter]->FindFreeInventoryListSlot(); 2503 v52 = pPlayers[uActiveCharacter]->FindFreeInventoryListSlot();
2507 if ( v52 < 0 ) 2504 if ( v52 < 0 )
2508 return; 2505 return;
2509 if ( !v51 ) 2506 if ( !v51 )// обычная установка щита на пустую руку
2510 { 2507 {
2511 pParty->pPickedItem.uBodyAnchor = 1; 2508 pParty->pPickedItem.uBodyAnchor = 1;
2512 v17 = v52 + 1; 2509 v17 = v52 + 1;
2513 memcpy(&pPlayers[uActiveCharacter]->pInventoryItemList[v52], &pParty->pPickedItem, sizeof(pPlayers[uActiveCharacter]->pInventoryItemList[v52])); 2510 memcpy(&pPlayers[uActiveCharacter]->pInventoryItemList[v52], &pParty->pPickedItem, sizeof(pPlayers[uActiveCharacter]->pInventoryItemList[v52]));
2514 pPlayers[uActiveCharacter]->pEquipment.uShield = v17; 2511 pPlayers[uActiveCharacter]->pEquipment.uShield = v17;
2515 pMouse->RemoveHoldingItem(); 2512 pMouse->RemoveHoldingItem();
2516 return; 2513 return;
2517 } 2514 }//ставим щит когда держит двуручный меч
2515 v1--;
2518 memcpy(&_this, &pParty->pPickedItem, sizeof(_this)); 2516 memcpy(&_this, &pParty->pPickedItem, sizeof(_this));
2519 v15 = (int)((char *)pPlayers[uActiveCharacter] + 36 * (v1 - 1)); 2517 pPlayers[uActiveCharacter]->pInventoryItemList[v1].uBodyAnchor = 0;
2520 *(char *)(v15 + 556) = 0;
2521 pParty->pPickedItem.Reset(); 2518 pParty->pPickedItem.Reset();
2522 pParty->SetHoldingItem((ItemGen *)(v15 + 532)); 2519 pParty->SetHoldingItem(&pPlayers[uActiveCharacter]->pInventoryItemList[v1]);
2523 _this.uBodyAnchor = 1; 2520 _this.uBodyAnchor = 1;
2524 memcpy(&pPlayers[uActiveCharacter]->pInventoryItemList[v52], &_this, sizeof(pPlayers[uActiveCharacter]->pInventoryItemList[v52])); 2521 memcpy(&pPlayers[uActiveCharacter]->pInventoryItemList[v52], &_this, sizeof(pPlayers[uActiveCharacter]->pInventoryItemList[v52]));
2525 pPlayers[uActiveCharacter]->pEquipment.uShield = v52 + 1; 2522 pPlayers[uActiveCharacter]->pEquipment.uShield = v52 + 1;
2526 } 2523 }
2527 pPlayers[uActiveCharacter]->pEquipment.uMainHand = 0; 2524 pPlayers[uActiveCharacter]->pEquipment.uMainHand = 0;
2528 return; 2525 return;
2526 //-------------------------taken in hand(взять в руку)-------------------------------------------
2529 case EQUIP_OFF_HAND: 2527 case EQUIP_OFF_HAND:
2530 case EQUIP_WAND: 2528 case EQUIP_WAND:
2531 if ( sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped(uActiveCharacter) 2529 if ( sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped(uActiveCharacter)
2532 && pParty->pPickedItem.uItemID != 64 2530 && pParty->pPickedItem.uItemID != 64
2533 && pParty->pPickedItem.uItemID != 65 ) 2531 && pParty->pPickedItem.uItemID != 65 )
2544 if ( pSkillType == 2 && (unsigned __int16)(pPlayers[uActiveCharacter]->pActiveSkills[2] & 0xFFC0) 2542 if ( pSkillType == 2 && (unsigned __int16)(pPlayers[uActiveCharacter]->pActiveSkills[2] & 0xFFC0)
2545 || pSkillType == 1 && (signed int)SkillToMastery(pPlayers[uActiveCharacter]->pActiveSkills[1]) >= 3 ) 2543 || pSkillType == 1 && (signed int)SkillToMastery(pPlayers[uActiveCharacter]->pActiveSkills[1]) >= 3 )
2546 { 2544 {
2547 v18 = pMouse->uMouseClickX; 2545 v18 = pMouse->uMouseClickX;
2548 v19 = pMouse->uMouseClickY; 2546 v19 = pMouse->uMouseClickY;
2549 v49 = v19;
2550 if ( (signed int)v18 >= 560 ) 2547 if ( (signed int)v18 >= 560 )
2551 { 2548 {
2552 if ( !v51 ) 2549 if ( !v51 )
2553 { 2550 {
2554 if ( v2 ) 2551 if ( v2 )
2555 { 2552 {
2556 --v2; 2553 --v2;
2557 memcpy(&_this, &pParty->pPickedItem, sizeof(_this)); 2554 memcpy(&_this, &pParty->pPickedItem, sizeof(_this));
2558 v20 = (int)((char *)pPlayers[uActiveCharacter] + 36 * v2); 2555 pPlayers[uActiveCharacter]->pInventoryItemList[v2].uBodyAnchor = 0;
2559 *(char *)(v20 + 556) = 0;
2560 pParty->pPickedItem.Reset(); 2556 pParty->pPickedItem.Reset();
2561 pParty->SetHoldingItem((ItemGen *)(v20 + 532)); 2557 pParty->SetHoldingItem(&pPlayers[uActiveCharacter]->pInventoryItemList[v2]);
2562 _this.uBodyAnchor = 1; 2558 _this.uBodyAnchor = 1;
2563 v14 = pEquipType == EQUIP_WAND; 2559 memcpy(&pPlayers[uActiveCharacter]->pInventoryItemList[v2], &_this, 0x24u);
2564 memcpy((void *)(v20 + 532), &_this, 0x24u);
2565 pPlayers[uActiveCharacter]->pEquipment.uShield = v2 + 1; 2560 pPlayers[uActiveCharacter]->pEquipment.uShield = v2 + 1;
2566 if ( !v14 ) 2561 if ( pEquipType != EQUIP_WAND )
2567 return; 2562 return;
2568 v22 = _this.uItemID; 2563 v50 = _this.uItemID;
2569 v50 = v22; 2564 if ( _this.uItemID )
2570 if ( v50 )
2571 { 2565 {
2572 __debugbreak(); // looks like offset in player's inventory and wand_lut much like case in 0042ECB5 2566 __debugbreak(); // looks like offset in player's inventory and wand_lut much like case in 0042ECB5
2573 stru_A750F8[uActiveCharacter - 1]._494836(*((int *)&pSpellDatas[66].uNormalLevelRecovery + v50), uActiveCharacter - 1 + 9); 2567 stru_A750F8[uActiveCharacter - 1]._494836(*((int *)&pSpellDatas[66].uNormalLevelRecovery + v50), uActiveCharacter - 1 + 9);
2574 } 2568 }
2575 break; 2569 break;
2580 pParty->pPickedItem.uBodyAnchor = 1; 2574 pParty->pPickedItem.uBodyAnchor = 1;
2581 v50 = (unsigned int)&pPlayers[uActiveCharacter]->pInventoryItemList[v23]; 2575 v50 = (unsigned int)&pPlayers[uActiveCharacter]->pInventoryItemList[v23];
2582 memcpy(&pPlayers[uActiveCharacter]->pInventoryItemList[v23], &pParty->pPickedItem, sizeof(pPlayers[uActiveCharacter]->pInventoryItemList[v23])); 2576 memcpy(&pPlayers[uActiveCharacter]->pInventoryItemList[v23], &pParty->pPickedItem, sizeof(pPlayers[uActiveCharacter]->pInventoryItemList[v23]));
2583 pPlayers[uActiveCharacter]->pEquipment.uShield = v23 + 1; 2577 pPlayers[uActiveCharacter]->pEquipment.uShield = v23 + 1;
2584 pMouse->RemoveHoldingItem(); 2578 pMouse->RemoveHoldingItem();
2585 if ( pEquipType != 12 ) 2579 if ( pEquipType != EQUIP_WAND )
2586 return; 2580 return;
2587 v22 = *(int *)v50; 2581 v22 = *(int *)v50;
2588 v50 = v22; 2582 v50 = v22;
2589 if ( v50 ) 2583 if ( v50 )
2590 { 2584 {
2603 pParty->pPickedItem.uBodyAnchor = 2; 2597 pParty->pPickedItem.uBodyAnchor = 2;
2604 v50 = (unsigned int)&pPlayers[uActiveCharacter]->pInventoryItemList[v26]; 2598 v50 = (unsigned int)&pPlayers[uActiveCharacter]->pInventoryItemList[v26];
2605 memcpy(&pPlayers[uActiveCharacter]->pInventoryItemList[v26], &pParty->pPickedItem, sizeof(pPlayers[uActiveCharacter]->pInventoryItemList[v26])); 2599 memcpy(&pPlayers[uActiveCharacter]->pInventoryItemList[v26], &pParty->pPickedItem, sizeof(pPlayers[uActiveCharacter]->pInventoryItemList[v26]));
2606 pPlayers[uActiveCharacter]->pEquipment.uMainHand = v26 + 1; 2600 pPlayers[uActiveCharacter]->pEquipment.uMainHand = v26 + 1;
2607 pMouse->RemoveHoldingItem(); 2601 pMouse->RemoveHoldingItem();
2608 if ( pEquipType != 12 ) 2602 if ( pEquipType != EQUIP_WAND )
2609 return; 2603 return;
2610 v22 = *(int *)v50; 2604 v22 = *(int *)v50;
2611 v50 = v22; 2605 v50 = v22;
2612 if ( v50 ) 2606 if ( v50 )
2613 { 2607 {
2616 } 2610 }
2617 break; 2611 break;
2618 } 2612 }
2619 --v1; 2613 --v1;
2620 memcpy(&_this, &pParty->pPickedItem, sizeof(_this)); 2614 memcpy(&_this, &pParty->pPickedItem, sizeof(_this));
2621 v24 = (int)((char *)pPlayers[uActiveCharacter] + 36 * v1); 2615 pPlayers[uActiveCharacter]->pInventoryItemList[v1].uBodyAnchor = 0;
2622 *(char *)(v24 + 556) = 0;
2623 pParty->pPickedItem.Reset(); 2616 pParty->pPickedItem.Reset();
2624 pParty->SetHoldingItem((ItemGen *)(v24 + 532)); 2617 pParty->SetHoldingItem(&pPlayers[uActiveCharacter]->pInventoryItemList[v1]);
2625 _this.uBodyAnchor = 2; 2618 _this.uBodyAnchor = 2;
2626 v25 = v1 + 1; 2619 memcpy(&pPlayers[uActiveCharacter]->pInventoryItemList[v1], &_this, 0x24u);
2627 v14 = pEquipType == 12; 2620 pPlayers[uActiveCharacter]->pEquipment.uMainHand = v1 + 1;
2628 memcpy((void *)(v24 + 532), &_this, 0x24u); 2621 if ( pEquipType == EQUIP_WAND )
2629 pPlayers[uActiveCharacter]->pEquipment.uMainHand = v25;
2630 if ( v14 )
2631 v50 = _this.uItemID; 2622 v50 = _this.uItemID;
2632 if ( v51 ) 2623 if ( v51 )
2633 pPlayers[uActiveCharacter]->pEquipment.uShield = 0; 2624 pPlayers[uActiveCharacter]->pEquipment.uShield = 0;
2634 if ( v50 ) 2625 if ( v50 )//взять жезл
2635 { 2626 {
2636 __debugbreak(); // looks like offset in player's inventory and wand_lut much like case in 0042ECB5 2627 __debugbreak(); // looks like offset in player's inventory and wand_lut much like case in 0042ECB5
2637 stru_A750F8[uActiveCharacter - 1]._494836( *((int *)&pSpellDatas[66].uNormalLevelRecovery + v50), uActiveCharacter - 1 + 9); 2628 stru_A750F8[uActiveCharacter - 1]._494836( *((int *)&pSpellDatas[66].uNormalLevelRecovery + v50), uActiveCharacter - 1 + 9);
2638 } 2629 }
2639 break; 2630 break;
2631 //---------------------------take two hands(взять двумя руками)---------------------------------
2640 case EQUIP_MAIN_HAND: 2632 case EQUIP_MAIN_HAND:
2641 if ( sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped(uActiveCharacter) ) 2633 if ( sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped(uActiveCharacter) )
2642 { 2634 {
2643 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0); 2635 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0);
2644 return; 2636 return;
2645 } 2637 }
2646 if ( !pPlayers[uActiveCharacter]->HasSkill(pSkillType) ) 2638 if ( !pPlayers[uActiveCharacter]->HasSkill(pSkillType) )
2647 { 2639 {
2648 pPlayers[uActiveCharacter]->PlaySound(SPEECH_39, 0); 2640 pPlayers[uActiveCharacter]->PlaySound(SPEECH_39, 0);
2649 return; 2641 return;
2650 } 2642 }
2651 if ( v1 ) 2643 if ( v1 )//взять двуручный меч кода нет щита(замещение оружия)
2652 { 2644 {
2653 if ( v2 ) 2645 if ( v2 )
2654 { 2646 {
2655 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0); 2647 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0);
2656 return; 2648 return;
2657 } 2649 }
2658 --v1; 2650 --v1;
2659 memcpy(&_this, &pParty->pPickedItem, sizeof(_this)); 2651 memcpy(&_this, &pParty->pPickedItem, sizeof(_this));
2660 v27 = (int)((char *)pPlayers[uActiveCharacter] + 36 * v1); 2652 pPlayers[uActiveCharacter]->pInventoryItemList[v1].uBodyAnchor = 0;
2661 *(char *)(v27 + 556) = 0;
2662 pParty->pPickedItem.Reset(); 2653 pParty->pPickedItem.Reset();
2663 pParty->SetHoldingItem((ItemGen *)(v27 + 532)); 2654 pParty->SetHoldingItem(&pPlayers[uActiveCharacter]->pInventoryItemList[v1]);
2664 _this.uBodyAnchor = 2; 2655 _this.uBodyAnchor = 2;
2665 v28 = v1 + 1; 2656 memcpy(&pPlayers[uActiveCharacter]->pInventoryItemList[v1], &_this, 0x24u);
2666 memcpy((void *)(v27 + 532), &_this, 0x24u); 2657 pPlayers[uActiveCharacter]->pEquipment.uMainHand = v1 + 1;
2667 pPlayers[uActiveCharacter]->pEquipment.uMainHand = v28;
2668 } 2658 }
2669 else 2659 else
2670 { 2660 {
2671 v52 = pPlayers[uActiveCharacter]->FindFreeInventoryListSlot(); 2661 v52 = pPlayers[uActiveCharacter]->FindFreeInventoryListSlot();
2672 if ( v52 >= 0 ) 2662 if ( v52 >= 0 )
2673 { 2663 {
2674 if ( v2 ) 2664 if ( v2 )//взять двуручный меч кода есть щит(замещение щитом)
2675 { 2665 {
2666 v2--;
2676 memcpy(&_this, &pParty->pPickedItem, sizeof(_this)); 2667 memcpy(&_this, &pParty->pPickedItem, sizeof(_this));
2677 v29 = (int)((char *)pPlayers[uActiveCharacter] + 36 * (v2 - 1)); 2668 pPlayers[uActiveCharacter]->pInventoryItemList[v2].uBodyAnchor = 0;
2678 *(char *)(v29 + 556) = 0;
2679 pParty->pPickedItem.Reset(); 2669 pParty->pPickedItem.Reset();
2680 pParty->SetHoldingItem((ItemGen *)(v29 + 532)); 2670 pParty->SetHoldingItem(&pPlayers[uActiveCharacter]->pInventoryItemList[v2]);
2681 _this.uBodyAnchor = 2; 2671 _this.uBodyAnchor = 2;
2682 v30 = v52 + 1;
2683 memcpy(&pPlayers[uActiveCharacter]->pInventoryItemList[v52], &_this, sizeof(pPlayers[uActiveCharacter]->pInventoryItemList[v52])); 2672 memcpy(&pPlayers[uActiveCharacter]->pInventoryItemList[v52], &_this, sizeof(pPlayers[uActiveCharacter]->pInventoryItemList[v52]));
2684 pPlayers[uActiveCharacter]->pEquipment.uShield = 0; 2673 pPlayers[uActiveCharacter]->pEquipment.uShield = 0;
2685 pPlayers[uActiveCharacter]->pEquipment.uMainHand = v30; 2674 pPlayers[uActiveCharacter]->pEquipment.uMainHand = v52 + 1;
2686 } 2675 }
2687 else 2676 else
2688 { 2677 {
2689 pParty->pPickedItem.uBodyAnchor = 2; 2678 pParty->pPickedItem.uBodyAnchor = 2;
2690 v31 = v52 + 1;
2691 memcpy(&pPlayers[uActiveCharacter]->pInventoryItemList[v52], &pParty->pPickedItem, sizeof(pPlayers[uActiveCharacter]->pInventoryItemList[v52])); 2679 memcpy(&pPlayers[uActiveCharacter]->pInventoryItemList[v52], &pParty->pPickedItem, sizeof(pPlayers[uActiveCharacter]->pInventoryItemList[v52]));
2692 pPlayers[uActiveCharacter]->pEquipment.uMainHand = v31; 2680 pPlayers[uActiveCharacter]->pEquipment.uMainHand = v52 + 1;
2693 pMouse->RemoveHoldingItem(); 2681 pMouse->RemoveHoldingItem();
2694 } 2682 }
2695 } 2683 }
2696 } 2684 }
2697 return; 2685 return;
2686 //-------------------------------------------------------------------------------
2698 default: 2687 default:
2699 pPlayers[uActiveCharacter]->UseItem_DrinkPotion_etc(uActiveCharacter, 0); 2688 pPlayers[uActiveCharacter]->UseItem_DrinkPotion_etc(uActiveCharacter, 0);
2700 return; 2689 return;
2701 } 2690 }
2702 return; 2691 return;
2703 } 2692 }
2704 2693
2705 v32 = pMouse->uMouseClickX; 2694 v32 = pMouse->uMouseClickX;
2706 v33 = pMouse->uMouseClickY; 2695 v33 = pMouse->uMouseClickY;
2707
2708 v34 = pRenderer->pActiveZBuffer[v32 + pSRZBufferLineOffsets[v33]] & 0xFFFF; 2696 v34 = pRenderer->pActiveZBuffer[v32 + pSRZBufferLineOffsets[v33]] & 0xFFFF;
2709 if ( v34 ) 2697 if ( v34 )
2710 { 2698 {
2711 v36 = v34 - 1; 2699 v36 = v34 - 1;
2712 v37 = (int)((char *)pPlayers[uActiveCharacter] + 36 * v36); 2700 v37 = (int)((char *)pPlayers[uActiveCharacter] + 36 * v36);
2713 v50 = v37; 2701 v38 = &pPlayers[uActiveCharacter]->pInventoryItemList[v36];
2714 v38 = (ItemGen *)(v37 + 532);
2715 v14 = v38->uItemID == ITEM_WETSUIT;
2716 pEquipType = pItemsTable->pItems[v38->uItemID].uEquipType; 2702 pEquipType = pItemsTable->pItems[v38->uItemID].uEquipType;
2717 if ( v14 ) 2703 if ( v38->uItemID == ITEM_WETSUIT )
2718 { 2704 {
2719 if ( bUnderwater ) 2705 if ( bUnderwater )
2720 { 2706 {
2721 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0); 2707 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0);
2722 return; 2708 return;
2723 } 2709 }
2724 WetsuitOff(uActiveCharacter); 2710 WetsuitOff(uActiveCharacter);
2725 } 2711 }
2726 if ( unk_50C9A0 ) 2712 if ( unk_50C9A0 )//наложить закл на экипировку
2727 { 2713 {
2728 *((char *)pGUIWindow_Settings->ptr_1C + 8) &= 0x7Fu; 2714 *((char *)pGUIWindow_Settings->ptr_1C + 8) &= 0x7Fu;//CastSpellInfo
2729 *((short *)pGUIWindow_Settings->ptr_1C + 2) = uActiveCharacter - 1; 2715 *((short *)pGUIWindow_Settings->ptr_1C + 2) = uActiveCharacter - 1;
2730 v39 = pEquipType;
2731 *((int *)pGUIWindow_Settings->ptr_1C + 3) = v36; 2716 *((int *)pGUIWindow_Settings->ptr_1C + 3) = v36;
2732 *((short *)pGUIWindow_Settings->ptr_1C + 3) = v39; 2717 *((short *)pGUIWindow_Settings->ptr_1C + 3) = pEquipType;
2733 ptr_50C9A4 = v38; 2718 ptr_50C9A4 = v38;
2734 unk_50C9A0 = 0; 2719 unk_50C9A0 = 0;
2735 if ( pMessageQueue_50CBD0->uNumMessages ) 2720 if ( pMessageQueue_50CBD0->uNumMessages )
2736 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; 2721 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
2737 pMouse->SetCursorBitmap("MICON1"); 2722 pMouse->SetCursorBitmap("MICON1");
2739 dword_50C9D0 = 113; 2724 dword_50C9D0 = 113;
2740 dword_50C9D8 = 256; 2725 dword_50C9D8 = 256;
2741 } 2726 }
2742 else 2727 else
2743 { 2728 {
2744 if ( !ptr_50C9A4 ) 2729 if ( !ptr_50C9A4 )//снять вещь
2745 { 2730 {
2746 pParty->SetHoldingItem(v38); 2731 pParty->SetHoldingItem(v38);
2747 *(&pPlayers[uActiveCharacter]->uBirthYear + *(char *)(v50 + 556)) = 0; 2732 *(&pPlayers[uActiveCharacter]->uBirthYear + pPlayers[uActiveCharacter]->pInventoryItemList[v36].uBodyAnchor) = 0;// это pPlayers[uActiveCharacter]->pEquipment[pPlayers[uActiveCharacter]->pInventoryItemList[v36].uBodyAnchor]
2748 v38->Reset(); 2733 v38->Reset();
2749 } 2734 }
2750 } 2735 }
2751 } 2736 }
2752 else 2737 else//снять лук
2753 { 2738 {
2754 v35 = pPlayers[uActiveCharacter]->pEquipment.uBow; 2739 if ( pPlayers[uActiveCharacter]->pEquipment.uBow )
2755 if ( v35 ) 2740 {
2756 { 2741 _this = pPlayers[uActiveCharacter]->pInventoryItemList[pPlayers[uActiveCharacter]->pEquipment.uBow - 1];
2757 auto _a = (ItemGen *)&pPlayers[uActiveCharacter]->pInventoryItemList[v35 - 1]; 2742 pParty->SetHoldingItem(&_this);
2758 pParty->SetHoldingItem(_a); 2743 _this.Reset();
2759 _a->Reset();
2760 pPlayers[uActiveCharacter]->pEquipment.uBow = 0; 2744 pPlayers[uActiveCharacter]->pEquipment.uBow = 0;
2761 } 2745 }
2762 } 2746 }
2763 } 2747 }
2764 2748