Mercurial > mm7
changeset 2495:7b076fe64f23
GetItemTextureFilename fix
author | Ritor1 |
---|---|
date | Wed, 17 Sep 2014 17:35:13 +0600 |
parents | de8c5c223e9c |
children | 5abd8fc8f1c6 |
files | Actor.cpp Actor.h Game.cpp Indoor.cpp Indoor.h Items.cpp Items.h Outdoor.cpp Player.cpp SpriteObject.cpp Texture.cpp Texture.h TurnEngine.cpp UI/Books/UIMapBook.cpp UI/UICharacter.cpp UI/UIShops.cpp UI/UiGame.cpp mm7_data.cpp mm7_data.h |
diffstat | 19 files changed, 384 insertions(+), 471 deletions(-) [+] |
line wrap: on
line diff
--- a/Actor.cpp Tue Sep 16 17:48:58 2014 +0600 +++ b/Actor.cpp Wed Sep 17 17:35:13 2014 +0600 @@ -2820,7 +2820,7 @@ signed int sDmg; // eax@14 Player *pPlayer; // ecx@21 Actor *pActor; // esi@34 - unsigned __int16 v22; // ax@86 + //unsigned __int16 v22; // ax@86 unsigned int v27; // ecx@123 unsigned int v28; // eax@123 int v33; // eax@144 @@ -2919,7 +2919,7 @@ ai_near_actors_targets_pid[i] = OBJECT_Player; //Skip actor if: Dead / Removed / Disabled / uAttributes & 0x0400 - if (pActor->uAIState == Dead || pActor->uAIState == Removed || pActor->uAIState == Disabled || pActor->uAttributes & 0x0400) + if (pActor->uAIState == Dead || pActor->uAIState == Removed || pActor->uAIState == Disabled || pActor->uAttributes & ACTOR_ALIVE) continue; //Kill actor if HP == 0 @@ -2994,14 +2994,15 @@ else radiusMultiplier = 1.0; - v22 = pActor->uAIState; - if ( v22 == Dying || v22 == Dead || v22 == Removed || v22 == Disabled || v22 == Summoned) + //v22 = pActor->uAIState; + if ( pActor->uAIState == Dying || pActor->uAIState == Dead || pActor->uAIState == Removed + || pActor->uAIState == Disabled || pActor->uAIState == Summoned) continue; if ( !pActor->sCurrentHP ) Actor::Die(actor_id); - for(int i=0;i<22;i++) + for( int i = 0;i < 22; i++ ) { if ( i != 10 ) pActor->pActorBuffs[i].IsBuffExpiredToTime(pParty->uTimePlayed); @@ -3124,7 +3125,7 @@ } } - if ( !(pActor->uAttributes & 0x020000) ) + if ( !(pActor->uAttributes & ACTOR_FLEEING) ) { if ( pActor->pMonsterInfo.uAIType == 2 || pActor->pMonsterInfo.uAIType == 3) { @@ -3147,7 +3148,7 @@ if ( v81 < 0 ) v81 = 0; rand(); - pActor->uAttributes &= 0xFFFBFFFF;//~0x40000 - ACTOR_UNKNOW5 + pActor->uAttributes &= ~ACTOR_UNKNOW5;//~0x40000 if ( v81 < 5120 ) { v45 = pActor->special_ability_use_check(actor_id); @@ -3791,7 +3792,7 @@ pActors[uNumActors].uMovementSpeed = pMonsterList->pMonsters[monster_id - 1].uMovementSpeed; pActors[uNumActors].vInitialPosition.x = x; pActors[uNumActors].vPosition.x = x; - pActors[uNumActors].uAttributes |= 80000; + pActors[uNumActors].uAttributes |= ACTOR_AGGRESSOR; pActors[uNumActors].pMonsterInfo.uTreasureType = 0; pActors[uNumActors].pMonsterInfo.uTreasureLevel = 0; pActors[uNumActors].pMonsterInfo.uTreasureDiceSides = 0; @@ -5458,7 +5459,7 @@ if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor ) { if ( a5 ) - pMonster->uAttributes |= 0x080000; + pMonster->uAttributes |= ACTOR_AGGRESSOR; ++uNumActors; continue; } @@ -5473,7 +5474,7 @@ { a3 = v39; if ( a5 ) - pMonster->uAttributes |= 0x080000; + pMonster->uAttributes |= ACTOR_AGGRESSOR; ++uNumActors; continue; }
--- a/Actor.h Tue Sep 16 17:48:58 2014 +0600 +++ b/Actor.h Wed Sep 17 17:35:13 2014 +0600 @@ -121,20 +121,20 @@ }; #pragma pack(pop) -#define ACTOR_UNKNOW2 0x8 -#define ACTOR_STAND_IN_QUEUE 0x80 -#define ACTOR_ALIVE 0x400 -#define ACTOR_ACTIVE 0x4000 -#define ACTOR_NEARBY 0x8000 -#define ACTOR_UNKNOW11 0x10000 -#define ACTOR_FLEEING 0x20000 -#define ACTOR_UNKNOW5 0x40000 -#define ACTOR_AGGRESSOR 0x80000 -#define ACTOR_UNKNOW7 0x100000 -#define ACTOR_ANIMATION 0x200000 -#define ACTOR_UNKNOW9 0x400000 -#define ACTOR_HAS_ITEM 0x800000 -#define ACTOR_HOSTILE 0x1000000 +#define ACTOR_UNKNOW2 0x00000008 +#define ACTOR_STAND_IN_QUEUE 0x00000080 +#define ACTOR_ALIVE 0x00000400 +#define ACTOR_ACTIVE 0x00004000 +#define ACTOR_NEARBY 0x00008000 +#define ACTOR_UNKNOW11 0x00010000 +#define ACTOR_FLEEING 0x00020000 +#define ACTOR_UNKNOW5 0x00040000 +#define ACTOR_AGGRESSOR 0x00080000 +#define ACTOR_UNKNOW7 0x00100000 +#define ACTOR_ANIMATION 0x00200000 +#define ACTOR_UNKNOW9 0x00400000 +#define ACTOR_HAS_ITEM 0x00800000 +#define ACTOR_HOSTILE 0x01000000 #pragma pack(push, 1)
--- a/Game.cpp Tue Sep 16 17:48:58 2014 +0600 +++ b/Game.cpp Wed Sep 17 17:35:13 2014 +0600 @@ -6316,7 +6316,7 @@ else { pIndoor->pFaces[pIndoor->pFaceExtras[i].field_C].uBitmapID = texture; - pIndoor->pFaces[pIndoor->pFaceExtras[i].field_C].uAttributes &= 0xBF00; + pIndoor->pFaces[pIndoor->pFaceExtras[i].field_C].uAttributes &= 0xFFFFBFFF; } } else @@ -6344,7 +6344,7 @@ else { pOutdoor->pBModels[j].pFaces[i].uTextureID = texture; - pOutdoor->pBModels[j].pFaces[i].uAttributes &= 0xBF00; + pOutdoor->pBModels[j].pFaces[i].uAttributes &= 0xFFFFBFFF; } } else
--- a/Indoor.cpp Tue Sep 16 17:48:58 2014 +0600 +++ b/Indoor.cpp Wed Sep 17 17:35:13 2014 +0600 @@ -1598,9 +1598,9 @@ if (pFaceExtra->uEventID) { if (pFaceExtra->HasEventint()) - pFace->uAttributes |= FACE_UNKNOW; + pFace->uAttributes |= FACE_HAS_EVENT; else - pFace->uAttributes &= ~FACE_UNKNOW; + pFace->uAttributes &= ~FACE_HAS_EVENT; } } @@ -1896,9 +1896,9 @@ if (pFaceExtra->uEventID) { if (pFaceExtra->HasEventint()) - pFace->uAttributes |= FACE_UNKNOW; + pFace->uAttributes |= FACE_HAS_EVENT; else - pFace->uAttributes &= ~FACE_UNKNOW; + pFace->uAttributes &= ~FACE_HAS_EVENT; } } @@ -2505,7 +2505,7 @@ face->pVertexUIDs[j] = v76; face->pVertexVIDs[j] = v77; } - if ( face->uAttributes & FACE_HAS_EVENT ) + if ( face->uAttributes & 0x00001000 ) v28->sTextureDeltaU -= v39; else { @@ -4522,7 +4522,7 @@ face_id = v17 & 0x3F; if (bmodel_id >= pOutdoor->uNumBModels) return 1; - if (pOutdoor->pBModels[bmodel_id].pFaces[face_id].uAttributes & FACE_UNKNOW + if (pOutdoor->pBModels[bmodel_id].pFaces[face_id].uAttributes & FACE_HAS_EVENT || pOutdoor->pBModels[bmodel_id].pFaces[face_id].sCogTriggeredID == 0 ) return 1; EventProcessor((signed __int16)pOutdoor->pBModels[bmodel_id].pFaces[face_id].sCogTriggeredID, a1, 1); @@ -4534,7 +4534,7 @@ ShowNothingHereStatus(); return 1; } - if ( pIndoor->pFaces[v17].uAttributes & FACE_UNKNOW || !pIndoor->pFaceExtras[pIndoor->pFaces[v17].uFaceExtraID].uEventID ) + if ( pIndoor->pFaces[v17].uAttributes & FACE_HAS_EVENT || !pIndoor->pFaceExtras[pIndoor->pFaces[v17].uFaceExtraID].uEventID ) return 1; if ( pCurrentScreen != SCREEN_BRANCHLESS_NPC_DIALOG ) EventProcessor((signed __int16)pIndoor->pFaceExtras[pIndoor->pFaces[v17].uFaceExtraID].uEventID, a1, 1);
--- a/Indoor.h Tue Sep 16 17:48:58 2014 +0600 +++ b/Indoor.h Wed Sep 17 17:35:13 2014 +0600 @@ -474,13 +474,13 @@ #define FACE_XZ_PLANE 0x00000200 #define FACE_YZ_PLANE 0x00000400 #define FACE_FLOW_HORIZONTAL 0x00000800 // Horizontal flow of the lava or water -#define FACE_HAS_EVENT 0x00001000 +#define FACE_HAS_EVENT_HINT 0x00001000 #define FACE_INVISIBLE 0x00002000 #define FACE_TEXTURE_FRAME 0x00004000 // Texture ID is a frameset from TextureFrameTable, otherwise BitmapID #define FACE_OUTLINED 0x00010000 // outline face edges #define FACE_INDOOR_DOOR 0x00020000 #define FACE_TEXTURE_FLOW 0x00040000 // The texture moves slowly. For horizontal facets only. -#define FACE_UNKNOW 0x00100000 +#define FACE_HAS_EVENT 0x00100000 #define FACE_INDOOR_CARPET 0x00200000 #define FACE_INDOOR_SKY 0x00400000 #define FACE_UNKNOW3 0x00800000
--- a/Items.cpp Tue Sep 16 17:48:58 2014 +0600 +++ b/Items.cpp Wed Sep 17 17:35:13 2014 +0600 @@ -2108,8 +2108,10 @@ int GetItemTextureFilename(char *pOut, signed int item_id, int index, int shoulder) { int result; // eax@2 + ITEM_EQUIP_TYPE pEquipType; result = 0; //BUG fn is void + pEquipType = pItemsTable->pItems[item_id].uEquipType; if ( item_id > 500 ) { switch ( item_id ) @@ -2187,7 +2189,7 @@ } } - switch (pItemsTable->pItems[item_id].uEquipType) + switch (pEquipType) { case EQUIP_ARMOUR: if ( !shoulder )
--- a/Items.h Tue Sep 16 17:48:58 2014 +0600 +++ b/Items.h Wed Sep 17 17:35:13 2014 +0600 @@ -26,11 +26,11 @@ ITEM_IDENTIFIED = 0x1, ITEM_BROKEN = 0x2, ITEM_TEMP_BONUS = 0x8, - ITEM_AURA_EFFECT_RED = 0x10,//16 - ITEM_AURA_EFFECT_BLUE = 0x20,//32 - ITEM_AURA_EFFECT_GREEN = 0x40,//64 - ITEM_AURA_EFFECT_PURPLE = 0x80,//128 - ITEM_ENCHANT_ANIMATION = 0xF0,//240 + ITEM_AURA_EFFECT_RED = 0x10, + ITEM_AURA_EFFECT_BLUE = 0x20, + ITEM_AURA_EFFECT_GREEN = 0x40, + ITEM_AURA_EFFECT_PURPLE = 0x80, + ITEM_ENCHANT_ANIMATION = 0xF0, ITEM_STOLEN = 0x100, ITEM_HARDENED = 0x200, }; @@ -227,6 +227,13 @@ static void PopulateArtifactBonusMap(); static void ClearItemBonusMaps(); + inline void ResetEnchantAnimation(){uAttributes &= 0xFFFFFF0F;} + inline bool ItemEnchanted()const {return(uAttributes & ITEM_ENCHANT_ANIMATION) != 0;} + inline bool AuraEffectRed()const {return(uAttributes & ITEM_ENCHANT_ANIMATION) == ITEM_AURA_EFFECT_RED;} + inline bool AuraEffectBlue()const {return(uAttributes & ITEM_ENCHANT_ANIMATION) == ITEM_AURA_EFFECT_BLUE;} + inline bool AuraEffectGreen()const {return(uAttributes & ITEM_ENCHANT_ANIMATION) == ITEM_AURA_EFFECT_GREEN;} + inline bool AuraEffectPurple()const {return(uAttributes & ITEM_ENCHANT_ANIMATION) == ITEM_AURA_EFFECT_PURPLE;} + void GetItemBonusSpecialEnchantment(Player* owner, CHARACTER_ATTRIBUTE_TYPE attrToGet, int* additiveBonus, int* halfSkillBonus); void GetItemBonusArtifact(Player* owner, CHARACTER_ATTRIBUTE_TYPE attrToGet, int* bonusSum); bool IsRegularEnchanmentForAttribute(CHARACTER_ATTRIBUTE_TYPE attrToGet);
--- a/Outdoor.cpp Tue Sep 16 17:48:58 2014 +0600 +++ b/Outdoor.cpp Wed Sep 17 17:35:13 2014 +0600 @@ -1767,9 +1767,9 @@ if (pBModels[i].pFaces[j].sCogTriggeredID) { if (pBModels[i].pFaces[j].HasEventHint()) - pBModels[i].pFaces[j].uAttributes |= FACE_UNKNOW; + pBModels[i].pFaces[j].uAttributes |= FACE_HAS_EVENT; else - pBModels[i].pFaces[j].uAttributes &= ~FACE_UNKNOW; + pBModels[i].pFaces[j].uAttributes &= ~FACE_HAS_EVENT; } //++v144; //v60 = pBModels; @@ -2019,9 +2019,9 @@ if (face.sCogTriggeredID) { if (face.HasEventHint()) - face.uAttributes |= FACE_HAS_EVENT; + face.uAttributes |= FACE_HAS_EVENT_HINT; else - face.uAttributes &= 0xFFFFEFFFu; + face.uAttributes &= ~FACE_HAS_EVENT_HINT;//~0x00001000 } } } @@ -2467,19 +2467,19 @@ else { pActors[i].uAIState = AIState::Disabled; - pActors[i].uAttributes = pActors[i].uAttributes | 0x10000; + pActors[i].uAttributes |= ACTOR_UNKNOW11; } } else if ( a1 == 0 ) { pActors[i].uAIState = AIState::Disabled; - pActors[i].uAttributes = pActors[i].uAttributes | 0x10000; + pActors[i].uAttributes |= ACTOR_UNKNOW11; } else if ( alert_status != 0 ) { pActors[i].uCurrentActionTime = 0; pActors[i].uCurrentActionLength = 0; - if ( pActors[i].uAttributes & 0x10000 ) + if ( pActors[i].uAttributes & ACTOR_UNKNOW11 ) pActors[i].uAIState = AIState::Disabled; if ( pActors[i].uAIState != AIState::Removed && pActors[i].uAIState != AIState::Disabled && (pActors[i].sCurrentHP == 0 || pActors[i].pMonsterInfo.uHP == 0) ) @@ -2494,7 +2494,7 @@ else { pActors[i].uAIState = AIState::Disabled; - pActors[i].uAttributes = pActors[i].uAttributes | 0x10000; + pActors[i].uAttributes |= ACTOR_UNKNOW11; alert_status = GetAlertStatus(); } } @@ -2532,13 +2532,9 @@ float v4; // ST48_4@8 unsigned int v8; // eax@11 int v9; // edx@11 - //__int16 v10; // dx@11 - //unsigned int v11; // eax@13 signed int v12; // eax@16 - //__int16 v13; // cx@21 SpriteFrame *v14; // eax@24 SpriteFrame *v15; // ebx@25 - //int *v16; // eax@25 int v17; // eax@35 int v18; // ST78_4@36 int v19; // eax@36 @@ -2550,19 +2546,7 @@ signed __int64 v25; // qtt@45 int v26; // ST54_4@45 int v27; // ecx@45 - //RenderBillboard *v28; // esi@45 - //__int16 v29; // ax@46 -// unsigned __int8 v30; // zf@46 -// unsigned __int8 v31; // sf@46 -// signed __int16 v32; // ax@49 -// signed int v33; // ecx@50 int v34; // ecx@54 - //MonsterDesc *v35; // edx@54 - //int v36; // ecx@54 - //unsigned __int8 v37; // zf@54 - //unsigned __int8 v38; // sf@54 - //unsigned int v39; // [sp-8h] [bp-68h]@23 - //unsigned int v40; // [sp-4h] [bp-64h]@23 int v41; // [sp+24h] [bp-3Ch]@11 int v42; // [sp+28h] [bp-38h]@38 int v43; // [sp+28h] [bp-38h]@45 @@ -2574,16 +2558,12 @@ signed int v49; // [sp+34h] [bp-2Ch]@5 int v50; // [sp+34h] [bp-2Ch]@36 int v51; // [sp+34h] [bp-2Ch]@41 -// int v52; // [sp+34h] [bp-2Ch]@50 int v53; // [sp+38h] [bp-28h]@36 - //int v54; // [sp+3Ch] [bp-24h]@2 int y; // [sp+40h] [bp-20h]@5 int x; // [sp+44h] [bp-1Ch]@5 int v57; // [sp+48h] [bp-18h]@45 int v58; // [sp+4Ch] [bp-14h]@45 - //signed int v59; // [sp+50h] [bp-10h]@1 int X; // [sp+54h] [bp-Ch]@36 - //__int16 v61; // [sp+58h] [bp-8h]@5 signed __int16 v62; // [sp+5Ch] [bp-4h]@25 //result = 0;
--- a/Player.cpp Tue Sep 16 17:48:58 2014 +0600 +++ b/Player.cpp Wed Sep 17 17:35:13 2014 +0600 @@ -7218,6 +7218,7 @@ } return false; } + //----- (0043ED6F) -------------------------------------------------------- bool IsDwarfPresentInParty(bool a1) {
--- a/SpriteObject.cpp Tue Sep 16 17:48:58 2014 +0600 +++ b/SpriteObject.cpp Wed Sep 17 17:35:13 2014 +0600 @@ -834,7 +834,7 @@ { if (pSpriteObjects[uLayingItemID].uAttributes & 4 ) { - pSpriteObjects[uLayingItemID].uAttributes &= 0xFFFB; + pSpriteObjects[uLayingItemID].uAttributes &= 0xFFFB;//~0x00000004 --pTurnEngine->pending_actions; } } @@ -1180,7 +1180,7 @@ if (pSpriteObjects[uLayingItemID].uAttributes & 4) { --pTurnEngine->pending_actions; - pSpriteObjects[uLayingItemID].uAttributes &= 0xFFFB; + pSpriteObjects[uLayingItemID].uAttributes &= 0xFFFB;//~0x00000004 } } if (PID_TYPE(a2) == OBJECT_BModel && PID_TYPE(pSpriteObjects[uLayingItemID].spell_caster_pid) != OBJECT_Player)
--- a/Texture.cpp Tue Sep 16 17:48:58 2014 +0600 +++ b/Texture.cpp Wed Sep 17 17:35:13 2014 +0600 @@ -309,33 +309,16 @@ } //----- (0044E163) -------------------------------------------------------- -unsigned int TextureFrameTable::FindTextureByName(const char *Str2) +signed int TextureFrameTable::FindTextureByName(const char *Str2) { - TextureFrameTable *v2; // esi@1 - int v3; // ebx@1 - unsigned int uID; // edi@1 - unsigned int result; // eax@4 - - v2 = this; - v3 = 0; - uID = 0; if ( (signed int)this->sNumTextures <= 0 ) + return -1; + for ( int i = 0; (signed int)i < (signed int)this->sNumTextures; ++i ) { -LABEL_4: - result = -1; + if ( !_stricmp(this->pTextures[i].pTextureName, Str2) ) + return i; } - else - { - while ( _stricmp(v2->pTextures[v3].pTextureName, Str2) ) - { - ++uID; - ++v3; - if ( (signed int)uID >= (signed int)v2->sNumTextures ) - goto LABEL_4; - } - result = uID; - } - return result; + return -1; } //----- (0044E19A) --------------------------------------------------------
--- a/Texture.h Tue Sep 16 17:48:58 2014 +0600 +++ b/Texture.h Wed Sep 17 17:35:13 2014 +0600 @@ -112,7 +112,7 @@ void FromFile(void *data_mm6, void *data_mm7, void *data_mm8); void LoadAnimationSequenceAndPalettes(signed int uIconID); int GetFrameTexture(int uFrameID, int time); - unsigned int FindTextureByName(const char *Str2); + signed int FindTextureByName(const char *Str2); signed int sNumTextures;
--- a/TurnEngine.cpp Tue Sep 16 17:48:58 2014 +0600 +++ b/TurnEngine.cpp Wed Sep 17 17:35:13 2014 +0600 @@ -979,7 +979,7 @@ } if ( pActors[uActorID].pMonsterInfo.uHostilityType == MonsterInfo::Hostility_Long ) { - if ( !(pActors[uActorID].uAttributes & 0x020000) || pActors[uActorID].pMonsterInfo.uAIType == 1 ) + if ( !(pActors[uActorID].uAttributes & ACTOR_FLEEING) || pActors[uActorID].pMonsterInfo.uAIType == 1 ) { if ( pActors[uActorID].pMonsterInfo.uAIType == 1 ) {
--- a/UI/Books/UIMapBook.cpp Tue Sep 16 17:48:58 2014 +0600 +++ b/UI/Books/UIMapBook.cpp Wed Sep 17 17:35:13 2014 +0600 @@ -692,7 +692,7 @@ { if ( pOutdoor->pBModels[i].pFaces[j].sCogTriggeredID ) { - if ( !(pOutdoor->pBModels[i].pFaces[j].uAttributes & FACE_UNKNOW) ) + if ( !(pOutdoor->pBModels[i].pFaces[j].uAttributes & FACE_HAS_EVENT) ) { if ( GetEventHintString(pOutdoor->pBModels[i].pFaces[j].sCogTriggeredID) ) {
--- a/UI/UICharacter.cpp Tue Sep 16 17:48:58 2014 +0600 +++ b/UI/UICharacter.cpp Wed Sep 17 17:35:13 2014 +0600 @@ -738,7 +738,6 @@ int index; // eax@65 int v59; // ebx@129 unsigned int v75; // ebx@170 -// int pArmorShoulderNum; // eax@197 int v94; // ebx@214 unsigned int v127; // ebx@314 unsigned int v153; // eax@370 @@ -794,38 +793,34 @@ v166 = "item64v1"; else v166 = item->GetIconName(); - if ( !( item->uAttributes & ITEM_ENCHANT_ANIMATION ) ) + + if ( item->ItemEnchanted() ) { - if ( item->uAttributes & ITEM_BROKEN ) - pRenderer->DrawTransparentRedShade(item_X, item_Y, pIcons_LOD->GetTexture(pIcons_LOD->LoadTexture(v166, TEXTURE_16BIT_PALETTE))); - else - { - if ( item->uAttributes & ITEM_IDENTIFIED ) - pRenderer->DrawTextureTransparent(item_X, item_Y, pIcons_LOD->GetTexture(pIcons_LOD->LoadTexture(v166, TEXTURE_16BIT_PALETTE))); - else - pRenderer->DrawTransparentGreenShade(item_X, item_Y, pIcons_LOD->GetTexture(pIcons_LOD->LoadTexture(v166, TEXTURE_16BIT_PALETTE))); - } - } - if ( item->uAttributes & ITEM_ENCHANT_ANIMATION ) - { - if ( ( item->uAttributes & ITEM_ENCHANT_ANIMATION) == ITEM_AURA_EFFECT_RED ) + if ( item->AuraEffectRed() ) container = "sptext01"; - if ( ( item->uAttributes & ITEM_ENCHANT_ANIMATION) == ITEM_AURA_EFFECT_BLUE ) + else if ( item->AuraEffectBlue() ) container = "sp28a"; - if ( (item->uAttributes & ITEM_ENCHANT_ANIMATION) == ITEM_AURA_EFFECT_GREEN ) + else if ( item->AuraEffectGreen() ) container = "sp30a"; - if ( (item->uAttributes & ITEM_ENCHANT_ANIMATION) == ITEM_AURA_EFFECT_PURPLE ) + else if ( item->AuraEffectPurple() ) container = "sp91a"; _50C9A8_item_enchantment_timer -= pEventTimer->uTimeElapsed; if ( _50C9A8_item_enchantment_timer <= 0 ) { _50C9A8_item_enchantment_timer = 0; - item->uAttributes &= 0xFFFFFF0Fu; + item->ResetEnchantAnimation(); ptr_50C9A4_ItemToEnchant = nullptr; } pRenderer->DrawAura(item_X, item_Y, pIcons_LOD->GetTexture(pIcons_LOD->LoadTexture(v166, TEXTURE_16BIT_PALETTE)), pIcons_LOD->LoadTexturePtr(container, TEXTURE_16BIT_PALETTE), GetTickCount() * 0.1, 0, 255); } + else if ( item->uAttributes & ITEM_BROKEN ) + pRenderer->DrawTransparentRedShade(item_X, item_Y, pIcons_LOD->GetTexture(pIcons_LOD->LoadTexture(v166, TEXTURE_16BIT_PALETTE))); + else if ( item->uAttributes & ITEM_IDENTIFIED ) + pRenderer->DrawTextureTransparent(item_X, item_Y, pIcons_LOD->GetTexture(pIcons_LOD->LoadTexture(v166, TEXTURE_16BIT_PALETTE))); + else + pRenderer->DrawTransparentGreenShade(item_X, item_Y, pIcons_LOD->GetTexture(pIcons_LOD->LoadTexture(v166, TEXTURE_16BIT_PALETTE))); + if ( !bRingsShownInCharScreen ) pRenderer->DrawMaskToZBuffer(item_X, item_Y, pIcons_LOD->GetTexture(pIcons_LOD->LoadTexture(v166, TEXTURE_16BIT_PALETTE)), player->pEquipment.uMainHand); } @@ -838,39 +833,34 @@ item = player->GetBowItem(); item_X = pPaperdoll_BodyX + paperdoll_Weapon[pBodyComplection][2][0] - pItemsTable->pItems[item->uItemID].uEquipX; item_Y = pPaperdoll_BodyY + paperdoll_Weapon[pBodyComplection][2][1] - pItemsTable->pItems[item->uItemID].uEquipY; - if ( !(item->uAttributes & ITEM_ENCHANT_ANIMATION) )// если не применён закл + + if ( item->ItemEnchanted() )// применён закл { - if ( item->uAttributes & ITEM_BROKEN ) - pRenderer->DrawTransparentRedShade(item_X, item_Y, pIcons_LOD->GetTexture(pIcons_LOD->LoadTexture(item->GetIconName(), TEXTURE_16BIT_PALETTE))); - else - { - if ( !(item->uAttributes & ITEM_IDENTIFIED) )//не опознанный лук зелёный - pRenderer->DrawTransparentGreenShade(item_X, item_Y, pIcons_LOD->GetTexture(pIcons_LOD->LoadTexture(item->GetIconName(), TEXTURE_16BIT_PALETTE))); - else // опознанный лук - pRenderer->DrawTextureTransparent(item_X, item_Y, pIcons_LOD->GetTexture(pIcons_LOD->LoadTexture(item->GetIconName(), TEXTURE_16BIT_PALETTE))); - } - } - else - { - if ( (item->uAttributes & ITEM_ENCHANT_ANIMATION) == ITEM_AURA_EFFECT_RED ) + if ( item->AuraEffectRed() ) container = "sptext01"; - if ( (item->uAttributes & ITEM_ENCHANT_ANIMATION) == ITEM_AURA_EFFECT_BLUE ) + else if ( item->AuraEffectBlue() ) container = "sp28a"; - if ( (item->uAttributes & ITEM_ENCHANT_ANIMATION) == ITEM_AURA_EFFECT_GREEN ) + else if ( item->AuraEffectGreen() ) container = "sp30a"; - if ( (item->uAttributes & ITEM_ENCHANT_ANIMATION) == ITEM_AURA_EFFECT_PURPLE ) + else if ( item->AuraEffectPurple() ) container = "sp91a"; _50C9A8_item_enchantment_timer -= pEventTimer->uTimeElapsed; if ( _50C9A8_item_enchantment_timer <= 0 ) { _50C9A8_item_enchantment_timer = 0; - item->uAttributes &= 0xFFFFFF0Fu; + item->ResetEnchantAnimation(); ptr_50C9A4_ItemToEnchant = nullptr; } pRenderer->DrawAura(item_X, item_Y, pIcons_LOD->GetTexture(pIcons_LOD->LoadTexture(item->GetIconName(), TEXTURE_16BIT_PALETTE)), - pIcons_LOD->LoadTexturePtr(container, TEXTURE_16BIT_PALETTE), - GetTickCount() * 0.1, 0, 255); + pIcons_LOD->LoadTexturePtr(container, TEXTURE_16BIT_PALETTE),GetTickCount() * 0.1, 0, 255); } + else if ( item->uAttributes & ITEM_BROKEN ) + pRenderer->DrawTransparentRedShade(item_X, item_Y, pIcons_LOD->GetTexture(pIcons_LOD->LoadTexture(item->GetIconName(), TEXTURE_16BIT_PALETTE))); + else if ( !(item->uAttributes & ITEM_IDENTIFIED) )//не опознанный лук зелёный + pRenderer->DrawTransparentGreenShade(item_X, item_Y, pIcons_LOD->GetTexture(pIcons_LOD->LoadTexture(item->GetIconName(), TEXTURE_16BIT_PALETTE))); + else // опознанный лук + pRenderer->DrawTextureTransparent(item_X, item_Y, pIcons_LOD->GetTexture(pIcons_LOD->LoadTexture(item->GetIconName(), TEXTURE_16BIT_PALETTE))); + if ( !bRingsShownInCharScreen ) pRenderer->DrawMaskToZBuffer(item_X, item_Y, pIcons_LOD->GetTexture(pIcons_LOD->LoadTexture(item->GetIconName(), TEXTURE_16BIT_PALETTE)), player->pEquipment.uBow); @@ -904,33 +894,32 @@ { item_X = pPaperdoll_BodyX + paperdoll_Cloak[pBodyComplection][index][0]; item_Y = pPaperdoll_BodyY + paperdoll_Cloak[pBodyComplection][index][1]; - if ( !(item->uAttributes & ITEM_ENCHANT_ANIMATION) ) + + if ( item->ItemEnchanted() ) { - if ( item->uAttributes & ITEM_BROKEN ) - pRenderer->DrawTransparentRedShade(item_X, item_Y, pIcons_LOD->GetTexture(paperdoll_cloak_texture[pBodyComplection][index])); - else - pRenderer->DrawTextureTransparent(item_X, item_Y, pIcons_LOD->GetTexture(paperdoll_cloak_texture[pBodyComplection][index])); - } - else - { - if ( (item->uAttributes & ITEM_ENCHANT_ANIMATION) == ITEM_AURA_EFFECT_RED ) + if ( item->AuraEffectRed() ) container = "sptext01"; - if ( (item->uAttributes & ITEM_ENCHANT_ANIMATION) == ITEM_AURA_EFFECT_BLUE ) + else if ( item->AuraEffectBlue() ) container = "sp28a"; - if ( (item->uAttributes & ITEM_ENCHANT_ANIMATION) == ITEM_AURA_EFFECT_GREEN ) + else if ( item->AuraEffectGreen() ) container = "sp30a"; - if ( (item->uAttributes & ITEM_ENCHANT_ANIMATION) == ITEM_AURA_EFFECT_PURPLE ) + else if ( item->AuraEffectPurple() ) container = "sp91a"; _50C9A8_item_enchantment_timer -= pEventTimer->uTimeElapsed; if ( _50C9A8_item_enchantment_timer <= 0 ) { _50C9A8_item_enchantment_timer = 0; - item->uAttributes &= 0xFFFFFF0Fu; + item->ResetEnchantAnimation();//~0x000000F0 ptr_50C9A4_ItemToEnchant = nullptr; } pRenderer->DrawAura(item_X, item_Y, pIcons_LOD->GetTexture(paperdoll_cloak_texture[pBodyComplection][index]), pIcons_LOD->LoadTexturePtr(container, TEXTURE_16BIT_PALETTE), GetTickCount() * 0.1, 0, 255); } + else if ( item->uAttributes & ITEM_BROKEN ) + pRenderer->DrawTransparentRedShade(item_X, item_Y, pIcons_LOD->GetTexture(paperdoll_cloak_texture[pBodyComplection][index])); + else + pRenderer->DrawTextureTransparent(item_X, item_Y, pIcons_LOD->GetTexture(paperdoll_cloak_texture[pBodyComplection][index])); + if ( !bRingsShownInCharScreen ) pRenderer->DrawMaskToZBuffer(item_X, item_Y, pIcons_LOD->GetTexture(paperdoll_cloak_texture[pBodyComplection][index]), player->pEquipment.uCloak); @@ -964,45 +953,39 @@ { item_X = pPaperdoll_BodyX + paperdoll_Armor_Coord[pBodyComplection][index][0]; item_Y = pPaperdoll_BodyY + paperdoll_Armor_Coord[pBodyComplection][index][1]; - if ( !(item->uAttributes & ITEM_ENCHANT_ANIMATION) ) + + if ( item->ItemEnchanted() ) { - if ( item->uAttributes & ITEM_BROKEN ) - pRenderer->DrawTransparentRedShade(item_X, item_Y, pIcons_LOD->GetTexture(paperdoll_armor_texture[pBodyComplection][index][0])); - else - { - if ( !(item->uAttributes & ITEM_IDENTIFIED) ) - pRenderer->DrawTransparentGreenShade(item_X, item_Y, &pIcons_LOD->pTextures[paperdoll_armor_texture[pBodyComplection][index][0]]); - else - pRenderer->DrawTextureTransparent(item_X, item_Y, &pIcons_LOD->pTextures[paperdoll_armor_texture[pBodyComplection][index][0]]); - } - } - else - { - if ( (item->uAttributes & ITEM_ENCHANT_ANIMATION) == ITEM_AURA_EFFECT_RED ) + if ( item->AuraEffectRed() ) container = "sptext01"; - if ( (item->uAttributes & ITEM_ENCHANT_ANIMATION) == ITEM_AURA_EFFECT_BLUE ) + else if ( item->AuraEffectBlue() ) container = "sp28a"; - if ( (item->uAttributes & ITEM_ENCHANT_ANIMATION) == ITEM_AURA_EFFECT_GREEN ) + else if ( item->AuraEffectGreen() ) container = "sp30a"; - if ( (item->uAttributes & ITEM_ENCHANT_ANIMATION) == ITEM_AURA_EFFECT_PURPLE ) + else if ( item->AuraEffectPurple() ) container = "sp91a"; _50C9A8_item_enchantment_timer -= pEventTimer->uTimeElapsed; if ( _50C9A8_item_enchantment_timer <= 0 ) { _50C9A8_item_enchantment_timer = 0; - item->uAttributes &= 0xFFFFFF0Fu; + item->ResetEnchantAnimation();//~0x000000F0 ptr_50C9A4_ItemToEnchant = nullptr; } pRenderer->DrawAura(item_X, item_Y, pIcons_LOD->GetTexture(paperdoll_armor_texture[pBodyComplection][index][0]), pIcons_LOD->LoadTexturePtr(container, TEXTURE_16BIT_PALETTE), GetTickCount() * 0.1, 0, 255); } + else if ( item->uAttributes & ITEM_BROKEN ) + pRenderer->DrawTransparentRedShade(item_X, item_Y, pIcons_LOD->GetTexture(paperdoll_armor_texture[pBodyComplection][index][0])); + else if ( !(item->uAttributes & ITEM_IDENTIFIED) ) + pRenderer->DrawTransparentGreenShade(item_X, item_Y, &pIcons_LOD->pTextures[paperdoll_armor_texture[pBodyComplection][index][0]]); + else + pRenderer->DrawTextureTransparent(item_X, item_Y, &pIcons_LOD->pTextures[paperdoll_armor_texture[pBodyComplection][index][0]]); if ( !bRingsShownInCharScreen ) pRenderer->DrawMaskToZBuffer(item_X, item_Y, &pIcons_LOD->pTextures[paperdoll_armor_texture[pBodyComplection][index][0]], player->pEquipment.uArmor); } } - //----------------------------------(End of Armor/Конец Брони)------------------------------------------ //----------------------------------(Boot/Обувь)-------------------------------------------------------- if ( player->GetItem(&PlayerEquipment::uBoot) ) { @@ -1026,38 +1009,34 @@ { item_X = pPaperdoll_BodyX + paperdoll_Boot[pBodyComplection][index][0]; item_Y = pPaperdoll_BodyY + paperdoll_Boot[pBodyComplection][index][1]; - if ( !(item->uAttributes & ITEM_ENCHANT_ANIMATION) ) + + if ( item->ItemEnchanted() ) { - if ( item->uAttributes & ITEM_BROKEN ) - pRenderer->DrawTransparentRedShade(item_X, item_Y, pIcons_LOD->GetTexture(v59)); - else - { - if ( item->uAttributes & ITEM_IDENTIFIED ) - pRenderer->DrawTextureTransparent(item_X, item_Y, pIcons_LOD->GetTexture(v59)); - else - pRenderer->DrawTransparentGreenShade(item_X, item_Y, pIcons_LOD->GetTexture(v59)); - } - } - else - { - if ( (item->uAttributes & ITEM_ENCHANT_ANIMATION) == ITEM_AURA_EFFECT_RED ) + if ( item->AuraEffectRed() ) container = "sptext01"; - if ( (item->uAttributes & ITEM_ENCHANT_ANIMATION) == ITEM_AURA_EFFECT_BLUE ) + else if ( item->AuraEffectBlue() ) container = "sp28a"; - if ( (item->uAttributes & ITEM_ENCHANT_ANIMATION) == ITEM_AURA_EFFECT_GREEN ) + else if ( item->AuraEffectGreen() ) container = "sp30a"; - if ( (item->uAttributes & ITEM_ENCHANT_ANIMATION) == ITEM_AURA_EFFECT_PURPLE ) + else if ( item->AuraEffectPurple() ) container = "sp91a"; _50C9A8_item_enchantment_timer -= pEventTimer->uTimeElapsed; if ( _50C9A8_item_enchantment_timer <= 0 ) { _50C9A8_item_enchantment_timer = 0; - item->uAttributes &= 0xFFFFFF0Fu; + item->ResetEnchantAnimation();//~0x000000F0 ptr_50C9A4_ItemToEnchant = nullptr; } pRenderer->DrawAura(item_X, item_Y, pIcons_LOD->GetTexture(v59), pIcons_LOD->LoadTexturePtr(container, TEXTURE_16BIT_PALETTE), GetTickCount() * 0.1, 0, 255); } + else if ( item->uAttributes & ITEM_BROKEN ) + pRenderer->DrawTransparentRedShade(item_X, item_Y, pIcons_LOD->GetTexture(v59)); + else if ( item->uAttributes & ITEM_IDENTIFIED ) + pRenderer->DrawTextureTransparent(item_X, item_Y, pIcons_LOD->GetTexture(v59)); + else + pRenderer->DrawTransparentGreenShade(item_X, item_Y, pIcons_LOD->GetTexture(v59)); + if ( !bRingsShownInCharScreen ) pRenderer->DrawMaskToZBuffer(item_X, item_Y, pIcons_LOD->GetTexture(v59), player->pEquipment.uBoot); } @@ -1070,194 +1049,176 @@ pRenderer->DrawTextureTransparent(pPaperdoll_BodyX + pPaperdoll_LeftHand[pBodyComplection][0], pPaperdoll_BodyY + pPaperdoll_LeftHand[pBodyComplection][1], pIcons_LOD->GetTexture(papredoll_dlads[uPlayerID - 1])); //--------------------------------------------(Belt/Пояс)------------------------------------------------------- - if ( player->GetItem(&PlayerEquipment::uBelt)) + if ( player->GetItem(&PlayerEquipment::uBelt)) + { + item = player->GetBeltItem(); + switch ( item->uItemID ) { - item = player->GetBeltItem(); - switch ( item->uItemID ) - { - case ITEM_RILIC_TITANS_BELT: - index = 5; - break; - case ITEM_ARTIFACT_HEROS_BELT: - index = 6; - break; - default: - index = item->uItemID - 100; - break; - } - if ( index >= 0 && index < 7 ) + case ITEM_RILIC_TITANS_BELT: + index = 5; + break; + case ITEM_ARTIFACT_HEROS_BELT: + index = 6; + break; + default: + index = item->uItemID - 100; + break; + } + if ( index >= 0 && index < 7 ) + { + item_X = pPaperdoll_BodyX + paperdoll_Belt[pBodyComplection][index][0]; + item_Y = pPaperdoll_BodyY + paperdoll_Belt[pBodyComplection][index][1]; + if ( IsDwarf != 1 || index == 5 ) + v75 = paperdoll_belt_texture[pBodyComplection][index]; + else + v75 = paperdoll_belt_texture[pBodyComplection - 2][index]; + + if ( item->ItemEnchanted() ) { - item_X = pPaperdoll_BodyX + paperdoll_Belt[pBodyComplection][index][0]; - item_Y = pPaperdoll_BodyY + paperdoll_Belt[pBodyComplection][index][1]; - if ( IsDwarf != 1 || index == 5 ) - v75 = paperdoll_belt_texture[pBodyComplection][index]; - else - v75 = paperdoll_belt_texture[pBodyComplection - 2][index]; - if ( !(item->uAttributes & ITEM_ENCHANT_ANIMATION) ) + if ( item->AuraEffectRed() ) + container = "sptext01"; + else if ( item->AuraEffectBlue() ) + container = "sp28a"; + else if ( item->AuraEffectGreen() ) + container = "sp30a"; + else if ( item->AuraEffectPurple() ) + container = "sp91a"; + _50C9A8_item_enchantment_timer -= pEventTimer->uTimeElapsed; + if ( _50C9A8_item_enchantment_timer <= 0 ) { - if ( item->uAttributes & ITEM_BROKEN ) - pRenderer->DrawTransparentRedShade(item_X, item_Y, pIcons_LOD->GetTexture(v75)); - else - { - if ( item->uAttributes & ITEM_IDENTIFIED ) - pRenderer->DrawTextureTransparent(item_X, item_Y, pIcons_LOD->GetTexture(v75)); - else - pRenderer->DrawTransparentGreenShade(item_X, item_Y, pIcons_LOD->GetTexture(v75)); - } - if ( !bRingsShownInCharScreen ) - pRenderer->DrawMaskToZBuffer(item_X, item_Y, pIcons_LOD->GetTexture(v75), player->pEquipment.uBelt); + _50C9A8_item_enchantment_timer = 0; + item->ResetEnchantAnimation();//~0x000000F0 + ptr_50C9A4_ItemToEnchant = nullptr; + } + pRenderer->DrawAura(item_X, item_Y, pIcons_LOD->GetTexture(v75), pIcons_LOD->LoadTexturePtr(container, TEXTURE_16BIT_PALETTE), + GetTickCount() * 0.1, 0, 255); + } + else if ( item->uAttributes & ITEM_BROKEN ) + pRenderer->DrawTransparentRedShade(item_X, item_Y, pIcons_LOD->GetTexture(v75)); + else if ( item->uAttributes & ITEM_IDENTIFIED ) + pRenderer->DrawTextureTransparent(item_X, item_Y, pIcons_LOD->GetTexture(v75)); + else + pRenderer->DrawTransparentGreenShade(item_X, item_Y, pIcons_LOD->GetTexture(v75)); + + if ( !bRingsShownInCharScreen ) + pRenderer->DrawMaskToZBuffer(item_X, item_Y, pIcons_LOD->GetTexture(v75), player->pEquipment.uBelt); + } + } + //--------------------------------(Shoulder/Плечи)--------------------------------------------- + if (player->GetItem(&PlayerEquipment::uArmor)) + { + item = player->GetArmorItem(); + switch ( item->uItemID ) + { + case ITEM_ARTIFACT_GOVERNORS_ARMOR: + index = 15; + break; + case ITEM_ARTIFACT_YORUBA: + index = 14; + break; + case ITEM_RELIC_HARECS_LEATHER: + index = 13; + break; + case ITEM_ELVEN_CHAINMAIL: + index = 16; + break; + default: + index = item->uItemID - 66; + break; + } + if ( index >= 0 && index < 17 ) + { + if ( player->GetItem(&PlayerEquipment::uMainHand) && (player->GetMainHandItem()->GetItemEquipType() == EQUIP_TWO_HANDED + || player->GetMainHandItem()->GetPlayerSkillType() == PLAYER_SKILL_SPEAR + && !player->GetItem(&PlayerEquipment::uShield) ))//без щита + { + v94 = paperdoll_armor_texture[pBodyComplection][index][2]; + if ( paperdoll_armor_texture[pBodyComplection][index][2] == pIcons_LOD->FindTextureByName("pending") ) + { + v94 = paperdoll_armor_texture[pBodyComplection][index][1]; + item_X = pPaperdoll_BodyX + paperdoll_shoulder_coord[pBodyComplection][index][0]; + item_Y = pPaperdoll_BodyY + paperdoll_shoulder_coord[pBodyComplection][index][1]; } else { - if ( (item->uAttributes & ITEM_ENCHANT_ANIMATION) == ITEM_AURA_EFFECT_RED ) - container = "sptext01"; - if ( (item->uAttributes & ITEM_ENCHANT_ANIMATION) == ITEM_AURA_EFFECT_BLUE ) - container = "sp28a"; - if ( (item->uAttributes & ITEM_ENCHANT_ANIMATION) == ITEM_AURA_EFFECT_GREEN ) - container = "sp30a"; - if ( (item->uAttributes & ITEM_ENCHANT_ANIMATION) == ITEM_AURA_EFFECT_PURPLE ) - container = "sp91a"; - _50C9A8_item_enchantment_timer -= pEventTimer->uTimeElapsed; - if ( _50C9A8_item_enchantment_timer <= 0 ) - { - _50C9A8_item_enchantment_timer = 0; - item->uAttributes &= 0xFFFFFF0Fu; - ptr_50C9A4_ItemToEnchant = nullptr; - } - pRenderer->DrawAura(item_X, item_Y, pIcons_LOD->GetTexture(v75), pIcons_LOD->LoadTexturePtr(container, TEXTURE_16BIT_PALETTE), - GetTickCount() * 0.1, 0, 255); + item_X = pPaperdoll_BodyX + paperdoll_shoulder_second_coord[pBodyComplection][index][0]; + item_Y = pPaperdoll_BodyY + paperdoll_shoulder_second_coord[pBodyComplection][index][1]; } - } - } - - //--------------------------------(Shoulder/Плечи)--------------------------------------------- - if (player->GetItem(&PlayerEquipment::uArmor)) - { - item = player->GetArmorItem(); - switch ( item->uItemID ) - { - case ITEM_ARTIFACT_GOVERNORS_ARMOR: - index = 15; - break; - case ITEM_ARTIFACT_YORUBA: - index = 14; - break; - case ITEM_RELIC_HARECS_LEATHER: - index = 13; - break; - case ITEM_ELVEN_CHAINMAIL: - index = 16; - break; - default: - index = item->uItemID - 66; - break; - } - if ( index >= 0 && index < 17 ) - { - if ( player->GetItem(&PlayerEquipment::uMainHand) - && (player->GetMainHandItem()->GetItemEquipType() == EQUIP_TWO_HANDED - || player->GetMainHandItem()->GetPlayerSkillType() == PLAYER_SKILL_SPEAR - && !player->GetItem(&PlayerEquipment::uShield) ))//без щита + if ( v94 != pIcons_LOD->FindTextureByName("pending") ) { - v94 = paperdoll_armor_texture[pBodyComplection][index][2]; - if ( paperdoll_armor_texture[pBodyComplection][index][2] == pIcons_LOD->FindTextureByName("pending") ) + if ( item->ItemEnchanted() ) { - v94 = paperdoll_armor_texture[pBodyComplection][index][1]; - item_X = pPaperdoll_BodyX + paperdoll_shoulder_coord[pBodyComplection][index][0]; - item_Y = pPaperdoll_BodyY + paperdoll_shoulder_coord[pBodyComplection][index][1]; - } - else - { - item_X = pPaperdoll_BodyX + paperdoll_shoulder_second_coord[pBodyComplection][index][0]; - item_Y = pPaperdoll_BodyY + paperdoll_shoulder_second_coord[pBodyComplection][index][1]; - } - if ( v94 != pIcons_LOD->FindTextureByName("pending") ) - { - if ( !(item->uAttributes & ITEM_ENCHANT_ANIMATION) ) + if ( paperdoll_armor_texture[pBodyComplection][index][2] != pIcons_LOD->FindTextureByName("pending") ) { - if ( item->uAttributes & ITEM_BROKEN ) - pRenderer->DrawTransparentRedShade(item_X, item_Y, pIcons_LOD->GetTexture(v94)); - else - { - if ( item->uAttributes & ITEM_IDENTIFIED ) - pRenderer->DrawTextureTransparent(item_X, item_Y, pIcons_LOD->GetTexture(v94)); - else - pRenderer->DrawTransparentGreenShade(item_X, item_Y, pIcons_LOD->GetTexture(v94)); - } - } - else - { - if ( paperdoll_armor_texture[pBodyComplection][index][2] != pIcons_LOD->FindTextureByName("pending") ) - { - if ( item->uAttributes & ITEM_ENCHANT_ANIMATION ) - { - if ( (item->uAttributes & ITEM_ENCHANT_ANIMATION) == ITEM_AURA_EFFECT_RED ) - container = "sptext01"; - if ( (item->uAttributes & ITEM_ENCHANT_ANIMATION) == ITEM_AURA_EFFECT_BLUE ) - container = "sp28a"; - if ( ( item->uAttributes & ITEM_ENCHANT_ANIMATION) == ITEM_AURA_EFFECT_GREEN ) - container = "sp30a"; - if ( (item->uAttributes & ITEM_ENCHANT_ANIMATION) == ITEM_AURA_EFFECT_PURPLE ) - container = "sp91a"; - _50C9A8_item_enchantment_timer -= pEventTimer->uTimeElapsed; - if ( _50C9A8_item_enchantment_timer <= 0 ) - { - _50C9A8_item_enchantment_timer = 0; - item->uAttributes &= 0xFFFFFF0Fu; - ptr_50C9A4_ItemToEnchant = nullptr; - } - pRenderer->DrawAura(item_X, item_Y, pIcons_LOD->GetTexture(v94), pIcons_LOD->LoadTexturePtr(container, TEXTURE_16BIT_PALETTE), - GetTickCount() * 0.1, 0, 255); - } - } - } - } - } - else//без ничего или с щитом - { - //v94 = paperdoll_armor_texture[pBodyComplection][index][1]; - if ( paperdoll_armor_texture[pBodyComplection][index][1] != pIcons_LOD->FindTextureByName("pending") ) - { - item_X = pPaperdoll_BodyX + paperdoll_shoulder_coord[pBodyComplection][index][0]; - item_Y = pPaperdoll_BodyY + paperdoll_shoulder_coord[pBodyComplection][index][1]; - if ( !(item->uAttributes & ITEM_ENCHANT_ANIMATION) ) - { - if ( item->uAttributes & ITEM_BROKEN ) - pRenderer->DrawTransparentRedShade(item_X, item_Y, pIcons_LOD->GetTexture(paperdoll_armor_texture[pBodyComplection][index][1])); - else - { - if ( item->uAttributes & ITEM_IDENTIFIED ) - pRenderer->DrawTextureTransparent(item_X, item_Y, pIcons_LOD->GetTexture(paperdoll_armor_texture[pBodyComplection][index][1])); - else - pRenderer->DrawTransparentGreenShade(item_X, item_Y, pIcons_LOD->GetTexture(paperdoll_armor_texture[pBodyComplection][index][1])); - } - } - else - { - if ( (item->uAttributes & ITEM_ENCHANT_ANIMATION) == ITEM_AURA_EFFECT_RED ) + if ( item->AuraEffectRed() ) container = "sptext01"; - if ( (item->uAttributes & ITEM_ENCHANT_ANIMATION) == ITEM_AURA_EFFECT_BLUE ) + else if ( item->AuraEffectBlue() ) container = "sp28a"; - if ( (item->uAttributes & ITEM_ENCHANT_ANIMATION) == ITEM_AURA_EFFECT_GREEN ) + else if ( item->AuraEffectGreen() ) container = "sp30a"; - if ( (item->uAttributes & ITEM_ENCHANT_ANIMATION) == ITEM_AURA_EFFECT_PURPLE ) + else if ( item->AuraEffectPurple() ) container = "sp91a"; _50C9A8_item_enchantment_timer -= pEventTimer->uTimeElapsed; if ( _50C9A8_item_enchantment_timer <= 0 ) { _50C9A8_item_enchantment_timer = 0; - item->uAttributes &= 0xFFFFFF0Fu; + item->ResetEnchantAnimation();//~0x000000F0 ptr_50C9A4_ItemToEnchant = nullptr; } - pRenderer->DrawAura(item_X, item_Y, pIcons_LOD->GetTexture(paperdoll_armor_texture[pBodyComplection][index][1]), - pIcons_LOD->LoadTexturePtr(container, TEXTURE_16BIT_PALETTE), GetTickCount() * 0.1, 0, 255); + pRenderer->DrawAura(item_X, item_Y, pIcons_LOD->GetTexture(v94), pIcons_LOD->LoadTexturePtr(container, TEXTURE_16BIT_PALETTE), + GetTickCount() * 0.1, 0, 255); } } + else if ( item->uAttributes & ITEM_BROKEN ) + pRenderer->DrawTransparentRedShade(item_X, item_Y, pIcons_LOD->GetTexture(v94)); + else if ( item->uAttributes & ITEM_IDENTIFIED ) + pRenderer->DrawTextureTransparent(item_X, item_Y, pIcons_LOD->GetTexture(v94)); + else + pRenderer->DrawTransparentGreenShade(item_X, item_Y, pIcons_LOD->GetTexture(v94)); + + } + } + else//без ничего или с щитом + { + //v94 = paperdoll_armor_texture[pBodyComplection][index][1]; + if ( paperdoll_armor_texture[pBodyComplection][index][1] != pIcons_LOD->FindTextureByName("pending") ) + { + item_X = pPaperdoll_BodyX + paperdoll_shoulder_coord[pBodyComplection][index][0]; + item_Y = pPaperdoll_BodyY + paperdoll_shoulder_coord[pBodyComplection][index][1]; + + if ( item->ItemEnchanted() ) + { + if ( item->AuraEffectRed() ) + container = "sptext01"; + else if ( item->AuraEffectBlue() ) + container = "sp28a"; + else if ( item->AuraEffectGreen() ) + container = "sp30a"; + else if ( item->AuraEffectPurple() ) + container = "sp91a"; + _50C9A8_item_enchantment_timer -= pEventTimer->uTimeElapsed; + if ( _50C9A8_item_enchantment_timer <= 0 ) + { + _50C9A8_item_enchantment_timer = 0; + item->ResetEnchantAnimation();//~0x000000F0 + ptr_50C9A4_ItemToEnchant = nullptr; + } + pRenderer->DrawAura(item_X, item_Y, pIcons_LOD->GetTexture(paperdoll_armor_texture[pBodyComplection][index][1]), + pIcons_LOD->LoadTexturePtr(container, TEXTURE_16BIT_PALETTE), GetTickCount() * 0.1, 0, 255); + } + else if ( item->uAttributes & ITEM_BROKEN ) + pRenderer->DrawTransparentRedShade(item_X, item_Y, pIcons_LOD->GetTexture(paperdoll_armor_texture[pBodyComplection][index][1])); + else if ( item->uAttributes & ITEM_IDENTIFIED ) + pRenderer->DrawTextureTransparent(item_X, item_Y, pIcons_LOD->GetTexture(paperdoll_armor_texture[pBodyComplection][index][1])); + else + pRenderer->DrawTransparentGreenShade(item_X, item_Y, pIcons_LOD->GetTexture(paperdoll_armor_texture[pBodyComplection][index][1])); + } } } - //----------------------------------------------(Cloak collar/воротник плаща)------------------------------------- - if ( player->GetItem(&PlayerEquipment::uCloak) ) + } + //----------------------------------------------(Cloak collar/воротник плаща)------------------------------------- + if ( player->GetItem(&PlayerEquipment::uCloak) ) { item = player->GetCloakItem(); switch ( item->uItemID ) @@ -1284,38 +1245,38 @@ { item_X = pPaperdoll_BodyX + paperdoll_CloakCollar[pBodyComplection][index][0]; item_Y = pPaperdoll_BodyY + paperdoll_CloakCollar[pBodyComplection][index][1]; + signed int r = pIcons_LOD->FindTextureByName("item325v2a1"); + if ( paperdoll_cloak_collar_texture[pBodyComplection][index] != pIcons_LOD->FindTextureByName("pending") ) { - if ( !(item->uAttributes & ITEM_ENCHANT_ANIMATION) ) + if ( item->ItemEnchanted() ) { - if ( item->uAttributes & ITEM_BROKEN ) - pRenderer->DrawTransparentRedShade(item_X, item_Y, pIcons_LOD->GetTexture(paperdoll_cloak_collar_texture[pBodyComplection][index])); - else - pRenderer->DrawTextureTransparent(item_X, item_Y, pIcons_LOD->GetTexture(paperdoll_cloak_collar_texture[pBodyComplection][index])); - if ( !bRingsShownInCharScreen ) - pRenderer->DrawMaskToZBuffer(item_X, item_Y, pIcons_LOD->GetTexture(paperdoll_cloak_collar_texture[pBodyComplection][index]), - player->pEquipment.uCloak); - } - else - { - if ( (item->uAttributes & ITEM_ENCHANT_ANIMATION) == ITEM_AURA_EFFECT_RED ) + if ( item->AuraEffectRed() ) container = "sptext01"; - if ( (item->uAttributes & ITEM_ENCHANT_ANIMATION) == ITEM_AURA_EFFECT_BLUE ) + else if ( item->AuraEffectBlue() ) container = "sp28a"; - if ( (item->uAttributes & ITEM_ENCHANT_ANIMATION) == ITEM_AURA_EFFECT_GREEN ) + else if ( item->AuraEffectGreen() ) container = "sp30a"; - if ( (item->uAttributes & ITEM_ENCHANT_ANIMATION) == ITEM_AURA_EFFECT_PURPLE ) + else if ( item->AuraEffectPurple() ) container = "sp91a"; _50C9A8_item_enchantment_timer -= pEventTimer->uTimeElapsed; if ( _50C9A8_item_enchantment_timer <= 0 ) { _50C9A8_item_enchantment_timer = 0; - item->uAttributes &= 0xFFFFFF0Fu; + item->ResetEnchantAnimation();//~0x000000F0 ptr_50C9A4_ItemToEnchant = nullptr; } pRenderer->DrawAura(item_X, item_Y, pIcons_LOD->GetTexture(paperdoll_cloak_collar_texture[pBodyComplection][index]), pIcons_LOD->LoadTexturePtr(container, TEXTURE_16BIT_PALETTE), GetTickCount() * 0.1, 0, 255); } + else if ( item->uAttributes & ITEM_BROKEN ) + pRenderer->DrawTransparentRedShade(item_X, item_Y, pIcons_LOD->GetTexture(paperdoll_cloak_collar_texture[pBodyComplection][index])); + else + pRenderer->DrawTextureTransparent(item_X, item_Y, pIcons_LOD->GetTexture(paperdoll_cloak_collar_texture[pBodyComplection][index])); + + if ( !bRingsShownInCharScreen ) + pRenderer->DrawMaskToZBuffer(item_X, item_Y, pIcons_LOD->GetTexture(paperdoll_cloak_collar_texture[pBodyComplection][index]), + player->pEquipment.uCloak); } } } @@ -1359,38 +1320,34 @@ v127 = paperdoll_helm_texture[player->GetSexByVoice()][index]; else v127 = papredoll_dbrds[11]; - if ( item->uAttributes & ITEM_ENCHANT_ANIMATION ) + + if ( item->ItemEnchanted() ) { - if ( (item->uAttributes & ITEM_ENCHANT_ANIMATION) == ITEM_AURA_EFFECT_RED ) + if ( item->AuraEffectRed() ) container = "sptext01"; - if ( (item->uAttributes & ITEM_ENCHANT_ANIMATION) == ITEM_AURA_EFFECT_BLUE ) + else if ( item->AuraEffectBlue() ) container = "sp28a"; - if ( (item->uAttributes & ITEM_ENCHANT_ANIMATION) == ITEM_AURA_EFFECT_GREEN ) + else if ( item->AuraEffectGreen() ) container = "sp30a"; - if ( (item->uAttributes & ITEM_ENCHANT_ANIMATION) == ITEM_AURA_EFFECT_PURPLE ) + else if ( item->AuraEffectPurple() ) container = "sp91a"; _50C9A8_item_enchantment_timer -= pEventTimer->uTimeElapsed; if ( _50C9A8_item_enchantment_timer <= 0 ) { _50C9A8_item_enchantment_timer = 0; - item->uAttributes &= 0xFFFFFF0Fu; + item->ResetEnchantAnimation(); ptr_50C9A4_ItemToEnchant = nullptr; } pRenderer->DrawAura(item_X, item_Y, pIcons_LOD->GetTexture(v127), pIcons_LOD->LoadTexturePtr(container, TEXTURE_16BIT_PALETTE), GetTickCount() * 0.1, 0, 255); } + else if ( item->uAttributes & ITEM_BROKEN ) + pRenderer->DrawTransparentRedShade(item_X, item_Y, pIcons_LOD->GetTexture(v127)); + else if ( item->uAttributes & ITEM_IDENTIFIED ) + pRenderer->DrawTextureTransparent(item_X, item_Y, pIcons_LOD->GetTexture(v127)); else - { - if ( item->uAttributes & ITEM_BROKEN ) - pRenderer->DrawTransparentRedShade(item_X, item_Y, pIcons_LOD->GetTexture(v127)); - else - { - if ( item->uAttributes & ITEM_IDENTIFIED ) - pRenderer->DrawTextureTransparent(item_X, item_Y, pIcons_LOD->GetTexture(v127)); - else - pRenderer->DrawTransparentGreenShade(item_X, item_Y, pIcons_LOD->GetTexture(v127)); - } - } + pRenderer->DrawTransparentGreenShade(item_X, item_Y, pIcons_LOD->GetTexture(v127)); + if ( !bRingsShownInCharScreen ) pRenderer->DrawMaskToZBuffer(item_X, item_Y, pIcons_LOD->GetTexture(v127), player->pEquipment.uHelm); } @@ -1405,38 +1362,34 @@ v181 = "item64v1"; else v181 = item->GetIconName(); - if ( !(item->uAttributes & ITEM_ENCHANT_ANIMATION) ) + + if ( item->ItemEnchanted() ) { - if ( item->uAttributes & ITEM_BROKEN ) - pRenderer->DrawTransparentRedShade(item_X, item_Y, pIcons_LOD->GetTexture(pIcons_LOD->LoadTexture(v181, TEXTURE_16BIT_PALETTE))); - else - { - if ( item->uAttributes & ITEM_IDENTIFIED ) - pRenderer->DrawTextureTransparent(item_X, item_Y, pIcons_LOD->GetTexture(pIcons_LOD->LoadTexture(v181, TEXTURE_16BIT_PALETTE))); - else - pRenderer->DrawTransparentGreenShade(item_X, item_Y, pIcons_LOD->GetTexture(pIcons_LOD->LoadTexture(v181, TEXTURE_16BIT_PALETTE))); - } - } - else - { - if ( (item->uAttributes & ITEM_ENCHANT_ANIMATION) == ITEM_AURA_EFFECT_RED ) + if ( item->AuraEffectRed() ) container = "sptext01"; - if ( (item->uAttributes & ITEM_ENCHANT_ANIMATION) == ITEM_AURA_EFFECT_BLUE ) + else if ( item->AuraEffectBlue() ) container = "sp28a"; - if ( (item->uAttributes & ITEM_ENCHANT_ANIMATION) == ITEM_AURA_EFFECT_GREEN ) - container = "sp30a"; - if ( (item->uAttributes & ITEM_ENCHANT_ANIMATION) == ITEM_AURA_EFFECT_PURPLE ) + else if ( item->AuraEffectGreen() ) + container = "sp30a"; + else if ( item->AuraEffectPurple() ) container = "sp91a"; _50C9A8_item_enchantment_timer -= pEventTimer->uTimeElapsed; if ( _50C9A8_item_enchantment_timer <= 0 ) { _50C9A8_item_enchantment_timer = 0; - item->uAttributes &= 0xFFFFFF0Fu; + item->ResetEnchantAnimation(); ptr_50C9A4_ItemToEnchant = nullptr; } pRenderer->DrawAura(item_X, item_Y, pIcons_LOD->GetTexture(pIcons_LOD->LoadTexture(v181, TEXTURE_16BIT_PALETTE)), pIcons_LOD->LoadTexturePtr(container, TEXTURE_16BIT_PALETTE), GetTickCount() * 0.1, 0, 255); } + else if ( item->uAttributes & ITEM_BROKEN ) + pRenderer->DrawTransparentRedShade(item_X, item_Y, pIcons_LOD->GetTexture(pIcons_LOD->LoadTexture(v181, TEXTURE_16BIT_PALETTE))); + else if ( item->uAttributes & ITEM_IDENTIFIED ) + pRenderer->DrawTextureTransparent(item_X, item_Y, pIcons_LOD->GetTexture(pIcons_LOD->LoadTexture(v181, TEXTURE_16BIT_PALETTE))); + else + pRenderer->DrawTransparentGreenShade(item_X, item_Y, pIcons_LOD->GetTexture(pIcons_LOD->LoadTexture(v181, TEXTURE_16BIT_PALETTE))); + if ( !bRingsShownInCharScreen ) pRenderer->DrawMaskToZBuffer(item_X, item_Y, pIcons_LOD->GetTexture(pIcons_LOD->LoadTexture(v181, TEXTURE_16BIT_PALETTE)), player->pEquipment.uMainHand); @@ -1476,39 +1429,34 @@ item_Y = pPaperdoll_BodyY + paperdoll_Weapon[pBodyComplection][0][1] - pItemsTable->pItems[item->uItemID].uEquipY; } v153 = pIcons_LOD->LoadTexture(item->GetIconName(), TEXTURE_16BIT_PALETTE); - if ( !(item->uAttributes & ITEM_ENCHANT_ANIMATION) ) + + if ( item->ItemEnchanted() ) { - if ( item->uAttributes & ITEM_BROKEN ) - pRenderer->DrawTransparentRedShade(item_X, item_Y, pIcons_LOD->GetTexture(v153)); - else - { - //v160 = (char *)pIcons_LOD->GetTexture(v153); - if ( !(item->uAttributes & ITEM_IDENTIFIED) ) - pRenderer->DrawTransparentGreenShade(item_X, item_Y, pIcons_LOD->GetTexture(v153)); - else - pRenderer->DrawTextureTransparent(item_X, item_Y, pIcons_LOD->GetTexture(v153)); - } - } - else - { - if ( (item->uAttributes & ITEM_ENCHANT_ANIMATION) == ITEM_AURA_EFFECT_RED ) + if ( item->AuraEffectRed() ) container = "sptext01"; - if ( (item->uAttributes & ITEM_ENCHANT_ANIMATION) == ITEM_AURA_EFFECT_BLUE ) + else if ( item->AuraEffectBlue() ) container = "sp28a"; - if ( (item->uAttributes & ITEM_ENCHANT_ANIMATION) == ITEM_AURA_EFFECT_GREEN ) + else if ( item->AuraEffectGreen() ) container = "sp30a"; - if ( (item->uAttributes & ITEM_ENCHANT_ANIMATION) == ITEM_AURA_EFFECT_PURPLE ) + else if ( item->AuraEffectPurple() ) container = "sp91a"; _50C9A8_item_enchantment_timer -= pEventTimer->uTimeElapsed; if ( _50C9A8_item_enchantment_timer <= 0 ) { _50C9A8_item_enchantment_timer = 0; - item->uAttributes &= 0xFFFFFF0Fu; + item->ResetEnchantAnimation(); ptr_50C9A4_ItemToEnchant = nullptr; } pRenderer->DrawAura(item_X, item_Y, pIcons_LOD->GetTexture(v153), pIcons_LOD->LoadTexturePtr(container, TEXTURE_16BIT_PALETTE), GetTickCount() * 0.1, 0, 255); } + else if ( item->uAttributes & ITEM_BROKEN ) + pRenderer->DrawTransparentRedShade(item_X, item_Y, pIcons_LOD->GetTexture(v153)); + else if ( !(item->uAttributes & ITEM_IDENTIFIED) ) + pRenderer->DrawTransparentGreenShade(item_X, item_Y, pIcons_LOD->GetTexture(v153)); + else + pRenderer->DrawTextureTransparent(item_X, item_Y, pIcons_LOD->GetTexture(v153)); + if ( two_handed_left_fist )//two-handed - left fist/двуручие - левая кисть pRenderer->DrawTextureTransparent(pPaperdoll_BodyX + pPaperdollLeftEmptyHand[pBodyComplection][0], pPaperdoll_BodyY + pPaperdollLeftEmptyHand[pBodyComplection][1], pIcons_LOD->GetTexture(papredoll_dlhs[uPlayerID - 1])); @@ -1547,8 +1495,6 @@ void CharacterUI_InventoryTab_Draw(Player *player, bool a2) { Texture *pTexture; // esi@6 -// int v13; // eax@13 - //int v15; // eax@13 unsigned int v17; // edi@15 unsigned int uCellX; // [sp+30h] [bp-8h]@5 unsigned int uCellY; // [sp+34h] [bp-4h]@5 @@ -1680,21 +1626,9 @@ { int v3; // ebx@10 Player *pPlayer; // edi@12 -// int v6; // edi@16 -// unsigned int v7; // eax@16 -// Player *pPlayer2; // ebx@16 -// char *v9; // ebx@16 -// unsigned int v22; // eax@76 -// int v23; // ecx@76 -// unsigned int v24; // eax@78 -// int v25; // ecx@78 -// unsigned int v27; // eax@80 -// int v28; // ecx@80 signed int v32; // [sp+10h] [bp-28h]@75 signed int v33; // [sp+10h] [bp-28h]@77 -// int v34; // [sp+10h] [bp-28h]@79 int pItemTXTNum; // [sp+14h] [bp-24h]@75 -// int v37; // [sp+14h] [bp-24h]@77 signed int v38; // [sp+14h] [bp-24h]@79 char pContainer[128]; // [sp+24h] [bp-14h]@12 @@ -2002,7 +1936,7 @@ { int pY; // ST34_4@4 const char *pText; // eax@9 - const char *a2; // [sp+14h] [bp-Ch]@4 + const char *text_format; // [sp+14h] [bp-Ch]@4 pRenderer->DrawTextureIndexed(8, 8, pIcons_LOD->LoadTexturePtr("fr_stats", TEXTURE_16BIT_PALETTE)); sprintf(pTmpBuf.data(), "\f%05d", ui_character_header_text_color); @@ -2058,20 +1992,20 @@ player->GetActualLuck(), player->GetBaseLuck()); pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, pY, 0, pTmpBuf.data(), 0, 0, 0); - a2 = "%s\f%05u\r424%d\f00000 /\t185%d\n"; + text_format = "%s\f%05u\r424%d\f00000 /\t185%d\n"; if ( player->GetMaxHealth() >= 1000 ) - a2 = "%s\f%05u\r388%d\f00000 / %d\n"; + text_format = "%s\f%05u\r388%d\f00000 / %d\n"; pY += 2 * LOBYTE(pFontArrus->uFontHeight) + 5; - sprintf(pTmpBuf.data(), a2, pGlobalTXT_LocalizationStrings[108], + sprintf(pTmpBuf.data(), text_format, pGlobalTXT_LocalizationStrings[108], UI_GetHealthManaAndOtherQualitiesStringColor(player->sHealth, player->GetMaxHealth()), player->sHealth, player->GetMaxHealth()); pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, pY, 0, pTmpBuf.data(), 0, 0, 0); - a2 = "%s\f%05u\r424%d\f00000 /\t185%d\n"; + text_format = "%s\f%05u\r424%d\f00000 /\t185%d\n"; if ( player->GetMaxMana() >= 1000 ) - a2 = "%s\f%05u\r388%d\f00000 / %d\n"; + text_format = "%s\f%05u\r388%d\f00000 / %d\n"; pY += LOBYTE(pFontArrus->uFontHeight) - 2; - sprintf(pTmpBuf.data(), a2, pGlobalTXT_LocalizationStrings[212], + sprintf(pTmpBuf.data(), text_format, pGlobalTXT_LocalizationStrings[212], UI_GetHealthManaAndOtherQualitiesStringColor(player->sMana, player->GetMaxMana()), player->sMana, player->GetMaxMana()); pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, pY, 0, pTmpBuf.data(), 0, 0, 0); @@ -2096,16 +2030,19 @@ //Second column (Вторая колонка) pY = 50; - sprintf(pTmpBuf.data(), "%s\f%05u\t100%d\f00000 / %d\n", pGlobalTXT_LocalizationStrings[5], + text_format = Stat_string_format_2_column_less_100; + if ( player->GetActualAge() > 99 ) + text_format = Stat_string_format_2_column_over_100; + sprintf(pTmpBuf.data(), text_format, pGlobalTXT_LocalizationStrings[5], UI_GetHealthManaAndOtherQualitiesStringColor(player->GetActualAge(), player->GetBaseAge()), player->GetActualAge(), player->GetBaseAge()); pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, pY, 0, pTmpBuf.data(), 0, 0, 0); - a2 = "%s\f%05u\t100%d\f00000 / %d\n"; + text_format = Stat_string_format_2_column_less_100; if ( player->GetBaseLevel() > 99 ) - a2 = "%s\f%05u\t180%d\f00000 / %d\n"; + text_format = Stat_string_format_2_column_over_100; pY += LOBYTE(pFontArrus->uFontHeight) - 2; - sprintf(pTmpBuf.data(), a2, pGlobalTXT_LocalizationStrings[131],//Уров. + sprintf(pTmpBuf.data(), text_format, pGlobalTXT_LocalizationStrings[131],//Уров. UI_GetHealthManaAndOtherQualitiesStringColor(player->GetActualLevel(), player->GetBaseLevel()), player->GetActualLevel(), player->GetBaseLevel()); pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, pY, 0, pTmpBuf.data(), 0, 0, 0); @@ -2133,64 +2070,64 @@ sprintf(pTmpBuf.data(), "%s\t100 %s\n\n", pGlobalTXT_LocalizationStrings[53], player->GetRangedDamageString()); pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, pY, 0, pTmpBuf.data(), 0, 0, 0); - a2 = format_4E2E10; + text_format = Stat_string_format_2_column_less_100; if ( player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_FIRE) > 99 || player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_FIRE) > 99 ) - a2 = "%s\f%05u\t180%d\f00000 / %d\n"; + text_format = Stat_string_format_2_column_over_100; pY += 2 * LOBYTE(pFontArrus->uFontHeight) - 4; - sprintf(pTmpBuf.data(), a2, pGlobalTXT_LocalizationStrings[87], + sprintf(pTmpBuf.data(), text_format, pGlobalTXT_LocalizationStrings[87], UI_GetHealthManaAndOtherQualitiesStringColor(player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_FIRE), player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_FIRE)), player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_FIRE), player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_FIRE)); pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, pY, 0, pTmpBuf.data(), 0, 0, 0); - a2 = format_4E2E10; + text_format = Stat_string_format_2_column_less_100; if ( player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_AIR) > 99 || player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_AIR) > 99 ) - a2 = "%s\f%05u\t180%d\f00000 / %d\n"; + text_format = Stat_string_format_2_column_over_100; pY += LOBYTE(pFontArrus->uFontHeight) - 2; - sprintf(pTmpBuf.data(), a2, pGlobalTXT_LocalizationStrings[6], + sprintf(pTmpBuf.data(), text_format, pGlobalTXT_LocalizationStrings[6], UI_GetHealthManaAndOtherQualitiesStringColor(player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_AIR), player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_AIR)), player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_AIR), player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_AIR)); pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, pY, 0, pTmpBuf.data(), 0, 0, 0); - a2 = format_4E2E10; + text_format = Stat_string_format_2_column_less_100; if ( player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_WATER) > 99 || player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_WATER) > 99 ) - a2 = "%s\f%05u\t180%d\f00000 / %d\n"; + text_format = Stat_string_format_2_column_over_100; pY += LOBYTE(pFontArrus->uFontHeight) - 2; - sprintf(pTmpBuf.data(), a2, pGlobalTXT_LocalizationStrings[240], + sprintf(pTmpBuf.data(), text_format, pGlobalTXT_LocalizationStrings[240], UI_GetHealthManaAndOtherQualitiesStringColor(player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_WATER), player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_WATER)), player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_WATER), player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_WATER)); pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, pY, 0, pTmpBuf.data(), 0, 0, 0); - a2 = format_4E2E10; + text_format = Stat_string_format_2_column_less_100; if ( player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_EARTH) > 99 ) - a2 = "%s\f%05u\t180%d\f00000 / %d\n"; + text_format = Stat_string_format_2_column_over_100; pY += LOBYTE(pFontArrus->uFontHeight) - 2; - sprintf(pTmpBuf.data(), a2, pGlobalTXT_LocalizationStrings[70], + sprintf(pTmpBuf.data(), text_format, pGlobalTXT_LocalizationStrings[70], UI_GetHealthManaAndOtherQualitiesStringColor(player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_EARTH), player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_EARTH)), player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_EARTH), player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_EARTH)); pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, pY, 0, pTmpBuf.data(), 0, 0, 0); - a2 = format_4E2E10; + text_format = Stat_string_format_2_column_less_100; if ( player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_MIND) > 99 || player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_MIND) > 99 ) - a2 = "%s\f%05u\t180%d\f00000 / %d\n"; + text_format = Stat_string_format_2_column_over_100; pY += LOBYTE(pFontArrus->uFontHeight) - 2; - sprintf(pTmpBuf.data(), a2, pGlobalTXT_LocalizationStrings[142], + sprintf(pTmpBuf.data(), text_format, pGlobalTXT_LocalizationStrings[142], UI_GetHealthManaAndOtherQualitiesStringColor(player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_MIND), player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_MIND)), player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_MIND), player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_MIND)); if ( player->classType == PLAYER_CLASS_LICH && player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_MIND) == 200 ) - sprintf(pTmpBuf.data(), format_4E2E00, pGlobalTXT_LocalizationStrings[142], + sprintf(pTmpBuf.data(), Stat_string_format_2_column_text, pGlobalTXT_LocalizationStrings[142], UI_GetHealthManaAndOtherQualitiesStringColor(player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_MIND), 200), pGlobalTXT_LocalizationStrings[625]); pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, pY, 0, pTmpBuf.data(), 0, 0, 0); - a2 = format_4E2E10; + text_format = Stat_string_format_2_column_less_100; if ( player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_BODY) > 99 || player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_BODY) > 99 ) - a2 = "%s\f%05u\t180%d\f00000 / %d\n"; + text_format = Stat_string_format_2_column_over_100; pY += LOBYTE(pFontArrus->uFontHeight) - 2; int it = player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_BODY); - sprintf(pTmpBuf.data(), a2, pGlobalTXT_LocalizationStrings[29], + sprintf(pTmpBuf.data(), text_format, pGlobalTXT_LocalizationStrings[29], UI_GetHealthManaAndOtherQualitiesStringColor(player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_BODY), player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_BODY)), player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_BODY), player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_BODY)); if ( player->classType == PLAYER_CLASS_LICH && player->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_BODY) == 200 ) - sprintf(pTmpBuf.data(), format_4E2E00, pGlobalTXT_LocalizationStrings[29], + sprintf(pTmpBuf.data(), Stat_string_format_2_column_text, pGlobalTXT_LocalizationStrings[29], UI_GetHealthManaAndOtherQualitiesStringColor(player->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_BODY), 200), pGlobalTXT_LocalizationStrings[625]); pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, pY, 0, pTmpBuf.data(), 0, 0, 0); }
--- a/UI/UIShops.cpp Tue Sep 16 17:48:58 2014 +0600 +++ b/UI/UIShops.cpp Wed Sep 17 17:35:13 2014 +0600 @@ -1623,7 +1623,7 @@ dword_F8B1E4 = 1; Party::TakeGold(uPriceItemService); v8 = item->uAttributes; - LOBYTE(v8) = v8 & 0xFD; + LOBYTE(v8) = item->uAttributes & 0xFD; item->uAttributes = v8 | 1; pPlayers[uActiveCharacter]->PlaySound(SPEECH_74, 0); ShowStatusBarString(pGlobalTXT_LocalizationStrings[570], 2);
--- a/UI/UiGame.cpp Tue Sep 16 17:48:58 2014 +0600 +++ b/UI/UiGame.cpp Wed Sep 17 17:35:13 2014 +0600 @@ -734,7 +734,7 @@ { if ( pOutdoor->pBModels[j].pFaces[i].sCogTriggeredID ) { - if ( !(pOutdoor->pBModels[j].pFaces[i].uAttributes & FACE_UNKNOW) ) + if ( !(pOutdoor->pBModels[j].pFaces[i].uAttributes & FACE_HAS_EVENT) ) { v14 = GetEventHintString(pOutdoor->pBModels[j].pFaces[i].sCogTriggeredID); if ( v14 )
--- a/mm7_data.cpp Tue Sep 16 17:48:58 2014 +0600 +++ b/mm7_data.cpp Wed Sep 17 17:35:13 2014 +0600 @@ -364,8 +364,9 @@ const char *format_4E2D80 = "\f%05d%s\f00000\n"; //const char *format_4E2DC8 = "\f%05d"; const char *format_4E2DE8 = "\f%05d%s\f00000 - "; -const char *format_4E2E00 = "%s\f%05u\xD\r180%s\n"; // idb -const char *format_4E2E10 = "%s\f%05u\t110%d\f00000 / %d\n"; +const char *Stat_string_format_2_column_text = "%s\f%05u\t100%s\n"; +const char *Stat_string_format_2_column_less_100 = "%s\f%05u\t110%d\f00000 / %d\n"; +const char *Stat_string_format_2_column_over_100 = "%s\f%05u\t100%d\f00000 / %d\n"; int dword_4E455C; // weak std::array<int, 6> dword_4E4560; std::array<int, 6> dword_4E4578;
--- a/mm7_data.h Tue Sep 16 17:48:58 2014 +0600 +++ b/mm7_data.h Wed Sep 17 17:35:13 2014 +0600 @@ -327,8 +327,9 @@ extern const char *format_4E2D80; extern char format_4E2D90[8]; extern const char *format_4E2DE8; // idb -extern const char *format_4E2E00; // idb -extern const char *format_4E2E10; // format text of resistance in Stats screen +extern const char *Stat_string_format_2_column_text; +extern const char *Stat_string_format_2_column_less_100; // format text of resistance in Stats screen +extern const char *Stat_string_format_2_column_over_100; extern int dword_4E455C; // weak extern std::array<int, 6> dword_4E4560; extern std::array<int, 6> dword_4E4578;