Mercurial > mm7
diff mm7_6.cpp @ 1966:7840fe323f67
stru319::LootActor(struct Actor *pActor) to Actor::LootActor
author | Grumpy7 |
---|---|
date | Fri, 25 Oct 2013 13:03:08 -0700 |
parents | 182d49f28170 |
children | 7d2c5fa98584 |
line wrap: on
line diff
--- a/mm7_6.cpp Fri Oct 25 11:23:34 2013 -0700 +++ b/mm7_6.cpp Fri Oct 25 13:03:08 2013 -0700 @@ -42,167 +42,6 @@ -//----- (00426A5A) -------------------------------------------------------- -void stru319::LootActor(Actor *pActor) -{ - signed int v2; // edi@1 - char v3; // zf@1 - unsigned int v4; // eax@13 - unsigned int v5; // esi@13 - int v6; // eax@14 - unsigned __int8 v7; // al@30 - Party *v8; // esi@34 - char *v9; // [sp-4h] [bp-3Ch]@10 - char *v10; // [sp-4h] [bp-3Ch]@31 - char *v11; // [sp-4h] [bp-3Ch]@38 - ItemGen Dst; // [sp+Ch] [bp-2Ch]@1 - int v13; // [sp+30h] [bp-8h]@1 - int v14; // [sp+34h] [bp-4h]@1 - - pParty->sub_421B2C_PlaceInInventory_or_DropPickedItem(); - Dst.Reset(); - v2 = 0; - v3 = ((unsigned int)&array_77EC08[1975].pEdgeList1[1] & pActor->uAttributes) == 0; - v13 = 0; - v14 = 0; - if ( v3 ) - { - if ( pActor->pMonsterInfo.uTreasureDiceRolls ) - { - do - { - ++v2; - v14 += rand() % pActor->pMonsterInfo.uTreasureDiceSides + 1; - } - while ( v2 < pActor->pMonsterInfo.uTreasureDiceRolls ); - if ( v14 ) - { - pParty->PartyFindsGold(v14, 0); - viewparams->bRedrawGameUI = 1; - } - } - } - else - { - if ( pActor->array_000234[3].uItemID != 0 && pActor->array_000234[3].GetItemEquipType() == 18 ) - { - v14 = pActor->array_000234[3].uSpecEnchantmentType; - pActor->array_000234[3].Reset(); - if ( v14 ) - { - pParty->PartyFindsGold(v14, 0); - viewparams->bRedrawGameUI = 1; - } - } - } - if ( pActor->uCarriedItemID ) - { - Dst.Reset(); - Dst.uItemID = pActor->uCarriedItemID; - v9 = pItemsTable->pItems[Dst.uItemID].pUnidentifiedName; - if ( v14 ) - sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[490], v14, v9); - else - sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[471], v9); - ShowStatusBarString(pTmpBuf2.data(), 2u); - v4 = Dst.uItemID; - v5 = Dst.uItemID; - if ( Dst.GetItemEquipType() == 12 ) - { - v5 = Dst.uItemID; - v6 = rand() % 6 + Dst.GetDamageMod() + 1; - Dst.uNumCharges = v6; - Dst.uMaxCharges = v6; - v4 = Dst.uItemID; - } - if ( pItemsTable->pItems[v5].uEquipType == 14 && v4 != 220 ) - Dst.uEnchantmentType = 2 * rand() % 4 + 2; - pItemsTable->SetSpecialBonus(&Dst); - if ( !pParty->AddItemToParty(&Dst) ) - pParty->SetHoldingItem(&Dst); - pActor->uCarriedItemID = 0; - if ( pActor->array_000234[0].uItemID ) - { - if ( !pParty->AddItemToParty(pActor->array_000234) ) - { - pParty->sub_421B2C_PlaceInInventory_or_DropPickedItem(); - pParty->SetHoldingItem(pActor->array_000234); - } - pActor->array_000234[0].Reset(); - } - if ( pActor->array_000234[1].uItemID ) - { - if ( !pParty->AddItemToParty(&pActor->array_000234[1]) ) - { - pParty->sub_421B2C_PlaceInInventory_or_DropPickedItem(); - pParty->SetHoldingItem(&pActor->array_000234[1]); - } - pActor->array_000234[1].Reset(); - } - pActor->Remove(); - return; - } - if ( (unsigned int)&array_77EC08[1975].pEdgeList1[1] & pActor->uAttributes ) - { - if ( pActor->array_000234[3].uItemID ) - { - memcpy(&Dst, &pActor->array_000234[3], sizeof(Dst)); - pActor->array_000234[3].Reset(); - v11 = pItemsTable->pItems[Dst.uItemID].pUnidentifiedName; - if ( v14 ) - sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[490], v14, v11); - else - sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[471], v11); - ShowStatusBarString(pTmpBuf2.data(), 2u); - if ( !pParty->AddItemToParty(&Dst) ) - pParty->SetHoldingItem(&Dst); - v13 = 1; - } - v8 = pParty; - goto LABEL_45; - } - if ( rand() % 100 >= pActor->pMonsterInfo.uTreasureDropChance || (v7 = pActor->pMonsterInfo.uTreasureLevel) == 0 ) - { - v8 = pParty; - goto LABEL_45; - } - pItemsTable->GenerateItem(v7, pActor->pMonsterInfo.uTreasureType, &Dst); - v10 = pItemsTable->pItems[Dst.uItemID].pUnidentifiedName; - if ( v14 ) - sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[490], v14, v10);//Вы нашли ^I[%d] золот^L[ой;ых;ых] и предмет (%s)! - else - sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[471], v10);//Вы нашли ^Pv[%s]! - ShowStatusBarString(pTmpBuf2.data(), 2); - v8 = pParty; - if ( !pParty->AddItemToParty(&Dst) ) - pParty->SetHoldingItem(&Dst); - v13 = 1; -LABEL_45: - if ( pActor->array_000234[0].uItemID ) - { - if ( !v8->AddItemToParty(pActor->array_000234) ) - { - pParty->sub_421B2C_PlaceInInventory_or_DropPickedItem(); - v8->SetHoldingItem(pActor->array_000234); - v13 = 1; - } - pActor->array_000234[0].Reset(); - } - if ( pActor->array_000234[1].uItemID ) - { - if ( !v8->AddItemToParty(&pActor->array_000234[1]) ) - { - pParty->sub_421B2C_PlaceInInventory_or_DropPickedItem(); - v8->SetHoldingItem(&pActor->array_000234[1]); - v13 = 1; - } - pActor->array_000234[1].Reset(); - } - if ( !v13 || rand() % 100 < 90 ) - { - pActor->Remove(); - } -} //----- (0042704B) -------------------------------------------------------- int stru319::special_ability_use_check( struct Actor *pActor, int a2 ) {