comparison UI/UICharacter.cpp @ 1476:92b63e3dca90

UICharacter.cpp cleaning(continue) OnPaperdollLeftClick(2)
author Ritor1
date Wed, 28 Aug 2013 19:11:02 +0600
parents 3cda66022a77
children 223605b325b3
comparison
equal deleted inserted replaced
1475:d7720c1f1d3b 1476:92b63e3dca90
2328 int v8; // eax@29 2328 int v8; // eax@29
2329 //int v9; // edx@32 2329 //int v9; // edx@32
2330 int v10; // esi@34 2330 int v10; // esi@34
2331 //int v11; // eax@34 2331 //int v11; // eax@34
2332 int v12; // esi@38 2332 int v12; // esi@38
2333 int v13; // eax@38 2333 //int v13; // eax@38
2334 char v14; // zf@38 2334 char v14; // zf@38
2335 int v15; // esi@42 2335 int v15; // esi@42
2336 int v16; // eax@42 2336 //int v16; // eax@42
2337 int v17; // eax@44 2337 int v17; // eax@44
2338 unsigned int v18; // ecx@55 2338 unsigned int v18; // ecx@55
2339 unsigned int v19; // eax@55 2339 unsigned int v19; // eax@55
2340 int v20; // esi@60 2340 int v20; // esi@60
2341 int v21; // eax@60 2341 //int v21; // eax@60
2342 unsigned int v22; // eax@61 2342 unsigned int v22; // eax@61
2343 int v23; // eax@62 2343 int v23; // eax@62
2344 int v24; // esi@65 2344 int v24; // esi@65
2345 int v25; // eax@65 2345 int v25; // eax@65
2346 int v26; // eax@69 2346 int v26; // eax@69
2500 v12 = (int)((char *)pPlayers[uActiveCharacter] + 36 * v2); 2500 v12 = (int)((char *)pPlayers[uActiveCharacter] + 36 * v2);
2501 *(char *)(v12 + 556) = 0; 2501 *(char *)(v12 + 556) = 0;
2502 pParty->pPickedItem.Reset(); 2502 pParty->pPickedItem.Reset();
2503 pParty->SetHoldingItem((ItemGen *)(v12 + 532)); 2503 pParty->SetHoldingItem((ItemGen *)(v12 + 532));
2504 _this.uBodyAnchor = 1; 2504 _this.uBodyAnchor = 1;
2505 v13 = v2 + 1;
2506 v14 = v51 == 0; 2505 v14 = v51 == 0;
2507 memcpy((void *)(v12 + 532), &_this, 0x24u); 2506 memcpy((void *)(v12 + 532), &_this, 0x24u);
2508 pPlayers[uActiveCharacter]->pEquipment.uShield = v13; 2507 pPlayers[uActiveCharacter]->pEquipment.uShield = v2 + 1;
2509 if ( v14 ) 2508 if ( v14 )
2510 return; 2509 return;
2511 } 2510 }
2512 else 2511 else
2513 { 2512 {
2527 v15 = (int)((char *)pPlayers[uActiveCharacter] + 36 * (v1 - 1)); 2526 v15 = (int)((char *)pPlayers[uActiveCharacter] + 36 * (v1 - 1));
2528 *(char *)(v15 + 556) = 0; 2527 *(char *)(v15 + 556) = 0;
2529 pParty->pPickedItem.Reset(); 2528 pParty->pPickedItem.Reset();
2530 pParty->SetHoldingItem((ItemGen *)(v15 + 532)); 2529 pParty->SetHoldingItem((ItemGen *)(v15 + 532));
2531 _this.uBodyAnchor = 1; 2530 _this.uBodyAnchor = 1;
2532 v16 = v52 + 1;
2533 memcpy(&pPlayers[uActiveCharacter]->pInventoryItemList[v52], &_this, sizeof(pPlayers[uActiveCharacter]->pInventoryItemList[v52])); 2531 memcpy(&pPlayers[uActiveCharacter]->pInventoryItemList[v52], &_this, sizeof(pPlayers[uActiveCharacter]->pInventoryItemList[v52]));
2534 pPlayers[uActiveCharacter]->pEquipment.uShield = v16; 2532 pPlayers[uActiveCharacter]->pEquipment.uShield = v52 + 1;
2535 } 2533 }
2536 pPlayers[uActiveCharacter]->pEquipment.uMainHand = 0; 2534 pPlayers[uActiveCharacter]->pEquipment.uMainHand = 0;
2537 return; 2535 return;
2538 case EQUIP_OFF_HAND: 2536 case EQUIP_OFF_HAND:
2539 case EQUIP_WAND: 2537 case EQUIP_WAND:
2540 if ( sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped(uActiveCharacter) 2538 if ( sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped(uActiveCharacter)
2541 && pParty->pPickedItem.uItemID != 64 2539 && pParty->pPickedItem.uItemID != 64
2542 && pParty->pPickedItem.uItemID != 65 ) 2540 && pParty->pPickedItem.uItemID != 65 )
2543 { 2541 {
2544 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0); 2542 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0);
2545 return; 2543 return;
2546 } 2544 }
2547 if ( !pPlayers[uActiveCharacter]->HasSkill(pSkillType) ) 2545 if ( !pPlayers[uActiveCharacter]->HasSkill(pSkillType) )
2548 { 2546 {
2549 pPlayers[uActiveCharacter]->PlaySound(SPEECH_39, 0); 2547 pPlayers[uActiveCharacter]->PlaySound(SPEECH_39, 0);
2550 return; 2548 return;
2551 } 2549 }
2552 v50 = 0; 2550 v50 = 0;
2553 if ( pSkillType == 2 && (unsigned __int16)(pPlayers[uActiveCharacter]->pActiveSkills[2] & 0xFFC0) 2551 if ( pSkillType == 2 && (unsigned __int16)(pPlayers[uActiveCharacter]->pActiveSkills[2] & 0xFFC0)
2554 || pSkillType == 1 && (signed int)SkillToMastery(pPlayers[uActiveCharacter]->pActiveSkills[1]) >= 3 ) 2552 || pSkillType == 1 && (signed int)SkillToMastery(pPlayers[uActiveCharacter]->pActiveSkills[1]) >= 3 )
2555 { 2553 {
2556 2554 v18 = pMouse->uMouseClickX;
2557 v18 = pMouse->uMouseClickX; 2555 v19 = pMouse->uMouseClickY;
2558 v19 = pMouse->uMouseClickY;
2559
2560 v49 = v19; 2556 v49 = v19;
2561 if ( (signed int)v18 >= 560 ) 2557 if ( (signed int)v18 >= 560 )
2562 { 2558 {
2563 if ( !v51 ) 2559 if ( !v51 )
2564 { 2560 {
2569 v20 = (int)((char *)pPlayers[uActiveCharacter] + 36 * v2); 2565 v20 = (int)((char *)pPlayers[uActiveCharacter] + 36 * v2);
2570 *(char *)(v20 + 556) = 0; 2566 *(char *)(v20 + 556) = 0;
2571 pParty->pPickedItem.Reset(); 2567 pParty->pPickedItem.Reset();
2572 pParty->SetHoldingItem((ItemGen *)(v20 + 532)); 2568 pParty->SetHoldingItem((ItemGen *)(v20 + 532));
2573 _this.uBodyAnchor = 1; 2569 _this.uBodyAnchor = 1;
2574 v21 = v2 + 1; 2570 v14 = pEquipType == EQUIP_WAND;
2575 v14 = pEquipType == 12;
2576 memcpy((void *)(v20 + 532), &_this, 0x24u); 2571 memcpy((void *)(v20 + 532), &_this, 0x24u);
2577 pPlayers[uActiveCharacter]->pEquipment.uShield = v21; 2572 pPlayers[uActiveCharacter]->pEquipment.uShield = v2 + 1;
2578 if ( !v14 ) 2573 if ( !v14 )
2579 return; 2574 return;
2580 v22 = _this.uItemID; 2575 v22 = _this.uItemID;
2581 v50 = v22; 2576 v50 = v22;
2582 if ( v50 ) 2577 if ( v50 )
2583 { 2578 {
2584 __debugbreak(); // looks like offset in player's inventory and wand_lut much like case in 0042ECB5 2579 __debugbreak(); // looks like offset in player's inventory and wand_lut much like case in 0042ECB5
2585 stru_A750F8[uActiveCharacter - 1]._494836(*((int *)&pSpellDatas[66].uNormalLevelRecovery + v50), uActiveCharacter - 1 + 9); 2580 stru_A750F8[uActiveCharacter - 1]._494836(*((int *)&pSpellDatas[66].uNormalLevelRecovery + v50), uActiveCharacter - 1 + 9);
2586 } 2581 }
2587 break; 2582 break;
2588 } 2583 }
2589 v23 = pPlayers[uActiveCharacter]->FindFreeInventoryListSlot(); 2584 v23 = pPlayers[uActiveCharacter]->FindFreeInventoryListSlot();
2590 if ( v23 < 0 ) 2585 if ( v23 < 0 )
2591 return; 2586 return;
2592 pParty->pPickedItem.uBodyAnchor = 1; 2587 pParty->pPickedItem.uBodyAnchor = 1;
2595 pPlayers[uActiveCharacter]->pEquipment.uShield = v23 + 1; 2590 pPlayers[uActiveCharacter]->pEquipment.uShield = v23 + 1;
2596 pMouse->RemoveHoldingItem(); 2591 pMouse->RemoveHoldingItem();
2597 if ( pEquipType != 12 ) 2592 if ( pEquipType != 12 )
2598 return; 2593 return;
2599 v22 = *(int *)v50; 2594 v22 = *(int *)v50;
2600 v50 = v22; 2595 v50 = v22;
2601 if ( v50 ) 2596 if ( v50 )
2602 { 2597 {
2603 __debugbreak(); // looks like offset in player's inventory and wand_lut much like case in 0042ECB5 2598 __debugbreak(); // looks like offset in player's inventory and wand_lut much like case in 0042ECB5
2604 stru_A750F8[uActiveCharacter - 1]._494836(*((int *)&pSpellDatas[66].uNormalLevelRecovery + v50), uActiveCharacter - 1 + 9); 2599 stru_A750F8[uActiveCharacter - 1]._494836(*((int *)&pSpellDatas[66].uNormalLevelRecovery + v50), uActiveCharacter - 1 + 9);
2605 } 2600 }
2606 break; 2601 break;
2607 } 2602 }
2608 } 2603 }
2609 } 2604 }
2610 if ( !v1 ) 2605 if ( !v1 )
2611 { 2606 {
2614 return; 2609 return;
2615 pParty->pPickedItem.uBodyAnchor = 2; 2610 pParty->pPickedItem.uBodyAnchor = 2;
2616 v50 = (unsigned int)&pPlayers[uActiveCharacter]->pInventoryItemList[v26]; 2611 v50 = (unsigned int)&pPlayers[uActiveCharacter]->pInventoryItemList[v26];
2617 memcpy(&pPlayers[uActiveCharacter]->pInventoryItemList[v26], &pParty->pPickedItem, sizeof(pPlayers[uActiveCharacter]->pInventoryItemList[v26])); 2612 memcpy(&pPlayers[uActiveCharacter]->pInventoryItemList[v26], &pParty->pPickedItem, sizeof(pPlayers[uActiveCharacter]->pInventoryItemList[v26]));
2618 pPlayers[uActiveCharacter]->pEquipment.uMainHand = v26 + 1; 2613 pPlayers[uActiveCharacter]->pEquipment.uMainHand = v26 + 1;
2619 pMouse->RemoveHoldingItem(); 2614 pMouse->RemoveHoldingItem();
2620 if ( pEquipType != 12 ) 2615 if ( pEquipType != 12 )
2621 return; 2616 return;
2622 v22 = *(int *)v50; 2617 v22 = *(int *)v50;
2623 v50 = v22; 2618 v50 = v22;
2624 if ( v50 ) 2619 if ( v50 )
2625 { 2620 {
2626 __debugbreak(); // looks like offset in player's inventory and wand_lut much like case in 0042ECB5 2621 __debugbreak(); // looks like offset in player's inventory and wand_lut much like case in 0042ECB5
2627 stru_A750F8[uActiveCharacter - 1]._494836(*((int *)&pSpellDatas[66].uNormalLevelRecovery + v50), uActiveCharacter - 1 + 9); 2622 stru_A750F8[uActiveCharacter - 1]._494836(*((int *)&pSpellDatas[66].uNormalLevelRecovery + v50), uActiveCharacter - 1 + 9);
2628 } 2623 }
2629 break; 2624 break;
2630 } 2625 }
2631 --v1; 2626 --v1;
2632 memcpy(&_this, &pParty->pPickedItem, sizeof(_this)); 2627 memcpy(&_this, &pParty->pPickedItem, sizeof(_this));
2633 v24 = (int)((char *)pPlayers[uActiveCharacter] + 36 * v1); 2628 v24 = (int)((char *)pPlayers[uActiveCharacter] + 36 * v1);
2634 *(char *)(v24 + 556) = 0; 2629 *(char *)(v24 + 556) = 0;