changeset 1167:15ad868d972f

pPartyBuffs - change plain numbers to enums
author Grumpy7
date Tue, 04 Jun 2013 18:29:35 +0200
parents 11cda4934da3
children 8b3e7d5ba069 e8f3f8612cb0
files Indoor.cpp Party.cpp Player.cpp UIPopup.cpp UiGame.cpp mm7_2.cpp mm7_3.cpp mm7_4.cpp mm7_6.cpp
diffstat 9 files changed, 87 insertions(+), 87 deletions(-) [+]
line wrap: on
line diff
--- a/Indoor.cpp	Tue Jun 04 08:28:20 2013 +0400
+++ b/Indoor.cpp	Tue Jun 04 18:29:35 2013 +0200
@@ -4194,14 +4194,14 @@
               }
               if ( v0->GetActorsRelation(0) )
               {
-                v51 = __OFSUB__(HIDWORD(pParty->pPartyBuffs[11].uExpireTime), v22);
-                v49 = HIDWORD(pParty->pPartyBuffs[11].uExpireTime) == v22;
-                v50 = HIDWORD(pParty->pPartyBuffs[11].uExpireTime) - v22 < 0;
+                v51 = __OFSUB__(HIDWORD(pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].uExpireTime), v22);
+                v49 = HIDWORD(pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].uExpireTime) == v22;
+                v50 = HIDWORD(pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].uExpireTime) - v22 < 0;
                 v0->vVelocity.y = v22;
                 v0->vVelocity.x = v22;
                 if ( !(v50 ^ v51)
-                  && (!((unsigned __int8)(v50 ^ v51) | v49) || LODWORD(pParty->pPartyBuffs[11].uExpireTime) > v22) )
-                  pParty->pPartyBuffs[11].Reset();
+                  && (!((unsigned __int8)(v50 ^ v51) | v49) || LODWORD(pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].uExpireTime) > v22) )
+                  pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].Reset();
                 viewparams->bRedrawGameUI = 1;
                 goto LABEL_119;
               }
--- a/Party.cpp	Tue Jun 04 08:28:20 2013 +0400
+++ b/Party.cpp	Tue Jun 04 18:29:35 2013 +0200
@@ -842,8 +842,8 @@
   int v3; // eax@9
   unsigned int v4; // [sp+8h] [bp-4h]@4
 
-  if ( (signed __int64)pParty->pPartyBuffs[11].uExpireTime > 0 )
-    pParty->pPartyBuffs[11].Reset();
+  if ( (signed __int64)pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].uExpireTime > 0 )
+    pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].Reset();
   if ( pParty->bTurnBasedModeOn != 1 )
   {
     v4 = 0;
--- a/Player.cpp	Tue Jun 04 08:28:20 2013 +0400
+++ b/Player.cpp	Tue Jun 04 18:29:35 2013 +0200
@@ -1079,10 +1079,10 @@
         PlaySound((PlayerSpeech)30, 0);
         break;
     case Condition_Weak:
-        if ( a3 == 1 && (signed __int64)pParty->pPartyBuffs[13].uExpireTime > 0 )
-            {--pParty->pPartyBuffs[13].uPower;
-        if ( pParty->pPartyBuffs[13].uPower < 1u )
-            pParty->pPartyBuffs[13].Reset();
+        if ( a3 == 1 && (signed __int64)pParty->pPartyBuffs[PARTY_BUFF_PROTECTION_FROM_MAGIC].uExpireTime > 0 )
+            {--pParty->pPartyBuffs[PARTY_BUFF_PROTECTION_FROM_MAGIC].uPower;
+        if ( pParty->pPartyBuffs[PARTY_BUFF_PROTECTION_FROM_MAGIC].uPower < 1u )
+            pParty->pPartyBuffs[PARTY_BUFF_PROTECTION_FROM_MAGIC].Reset();
         return 0;
             }
 
@@ -1115,11 +1115,11 @@
     case Condition_Poison3:
         if ( a3 == 1 )
             {
-            if ( (signed __int64)pParty->pPartyBuffs[13].uExpireTime > 0i64 )
+            if ( (signed __int64)pParty->pPartyBuffs[PARTY_BUFF_PROTECTION_FROM_MAGIC].uExpireTime > 0i64 )
                 {
-                --pParty->pPartyBuffs[13].uPower;
-                if ( pParty->pPartyBuffs[13].uPower < 1u )
-                    pParty->pPartyBuffs[13].Reset();
+                --pParty->pPartyBuffs[PARTY_BUFF_PROTECTION_FROM_MAGIC].uPower;
+                if ( pParty->pPartyBuffs[PARTY_BUFF_PROTECTION_FROM_MAGIC].uPower < 1u )
+                    pParty->pPartyBuffs[PARTY_BUFF_PROTECTION_FROM_MAGIC].Reset();
                 }
             if ( HasEnchantedItemEquipped(21)
                 || WearsItem(ITEM_ARTIFACT_YORUBA, EQUIP_ARMOUR)
@@ -1137,11 +1137,11 @@
     case Condition_Disease3:
         if ( a3 == 1 )
             {            
-            if ( pParty->pPartyBuffs[13].uExpireTime > 0i64 )
+            if ( pParty->pPartyBuffs[PARTY_BUFF_PROTECTION_FROM_MAGIC].uExpireTime > 0i64 )
                 {
-                --pParty->pPartyBuffs[13].uPower;
-                if ( pParty->pPartyBuffs[13].uPower < 1u )
-                    pParty->pPartyBuffs[13].Reset();
+                --pParty->pPartyBuffs[PARTY_BUFF_PROTECTION_FROM_MAGIC].uPower;
+                if ( pParty->pPartyBuffs[PARTY_BUFF_PROTECTION_FROM_MAGIC].uPower < 1u )
+                    pParty->pPartyBuffs[PARTY_BUFF_PROTECTION_FROM_MAGIC].Reset();
                 return 0;
                 }
 
@@ -1155,11 +1155,11 @@
     case Condition_Paralyzed:
         if ( a3 == 1 )
             {
-            if ( pParty->pPartyBuffs[13].uExpireTime > 0i64 )
+            if ( pParty->pPartyBuffs[PARTY_BUFF_PROTECTION_FROM_MAGIC].uExpireTime > 0i64 )
                 {
-                --pParty->pPartyBuffs[13].uPower;
-                if ( pParty->pPartyBuffs[13].uPower < 1u )
-                    pParty->pPartyBuffs[13].Reset();
+                --pParty->pPartyBuffs[PARTY_BUFF_PROTECTION_FROM_MAGIC].uPower;
+                if ( pParty->pPartyBuffs[PARTY_BUFF_PROTECTION_FROM_MAGIC].uPower < 1u )
+                    pParty->pPartyBuffs[PARTY_BUFF_PROTECTION_FROM_MAGIC].Reset();
                 return 0;
                 }
 
@@ -1176,11 +1176,11 @@
             sHealth = 0;
         break;
     case Condition_Dead:
-        if ( a3 == 1 && (signed __int64)pParty->pPartyBuffs[13].uExpireTime > 0i64 && pParty->pPartyBuffs[13].uSkill >= 4u )
+        if ( a3 == 1 && (signed __int64)pParty->pPartyBuffs[PARTY_BUFF_PROTECTION_FROM_MAGIC].uExpireTime > 0i64 && pParty->pPartyBuffs[PARTY_BUFF_PROTECTION_FROM_MAGIC].uSkill >= 4u )
             {
-            --pParty->pPartyBuffs[13].uPower;
-            if ( pParty->pPartyBuffs[13].uPower < 1u )
-                pParty->pPartyBuffs[13].Reset();
+            --pParty->pPartyBuffs[PARTY_BUFF_PROTECTION_FROM_MAGIC].uPower;
+            if ( pParty->pPartyBuffs[PARTY_BUFF_PROTECTION_FROM_MAGIC].uPower < 1u )
+                pParty->pPartyBuffs[PARTY_BUFF_PROTECTION_FROM_MAGIC].Reset();
             }
 
         PlaySound((PlayerSpeech)33, 0);
@@ -1191,7 +1191,7 @@
         break;
     case Condition_Pertified:
         if ( a3 == 1
-            &&((pParty->pPartyBuffs[13].uExpireTime > 0i64)
+            &&((pParty->pPartyBuffs[PARTY_BUFF_PROTECTION_FROM_MAGIC].uExpireTime > 0i64)
             || HasEnchantedItemEquipped(23)|| 
             WearsItem(ITEM_RELIC_KELEBRIM, EQIUP_ANY) || 
             WearsItem(ITEM_ARTIFACT_YORUBA, EQUIP_ARMOUR) || 
@@ -1201,11 +1201,11 @@
         PlaySound((PlayerSpeech)34, 0);
         break;
     case Condition_Eradicated:
-        if ( a3 == 1 && ((signed __int64)pParty->pPartyBuffs[13].uExpireTime > 0 )&&( pParty->pPartyBuffs[13].uSkill >= 4u ))
+        if ( a3 == 1 && ((signed __int64)pParty->pPartyBuffs[PARTY_BUFF_PROTECTION_FROM_MAGIC].uExpireTime > 0 )&&( pParty->pPartyBuffs[PARTY_BUFF_PROTECTION_FROM_MAGIC].uSkill >= 4u ))
             {
-            --pParty->pPartyBuffs[13].uPower;
-            if ( pParty->pPartyBuffs[13].uPower < 1u )
-                pParty->pPartyBuffs[13].Reset();
+            --pParty->pPartyBuffs[PARTY_BUFF_PROTECTION_FROM_MAGIC].uPower;
+            if ( pParty->pPartyBuffs[PARTY_BUFF_PROTECTION_FROM_MAGIC].uPower < 1u )
+                pParty->pPartyBuffs[PARTY_BUFF_PROTECTION_FROM_MAGIC].Reset();
             return 0;
             }
         PlaySound(SPEECH_35, 0);
@@ -5337,25 +5337,25 @@
       {
         case CHARACTER_ATTRIBUTE_RESIST_BODY:
           v3 = this->pPlayerBuffs[2].uPower;
-          v4 = pParty->pPartyBuffs[1].uPower;
+          v4 = pParty->pPartyBuffs[PARTY_BUFF_RESIST_BODY].uPower;
           break;
         case CHARACTER_ATTRIBUTE_RESIST_AIR:
           v3 = this->pPlayerBuffs[0].uPower;
-          v4 = pParty->pPartyBuffs[0].uPower;
+          v4 = pParty->pPartyBuffs[PARTY_BUFF_RESIST_AIR].uPower;
           break;
         case CHARACTER_ATTRIBUTE_RESIST_WATER:
           v3 = this->pPlayerBuffs[22].uPower;
-          v4 = pParty->pPartyBuffs[17].uPower;
+          v4 = pParty->pPartyBuffs[PARTY_BUFF_RESIST_WATER].uPower;
           break;
         case CHARACTER_ATTRIBUTE_RESIST_EARTH:
           v3 = this->pPlayerBuffs[3].uPower;
-          v4 = pParty->pPartyBuffs[4].uPower;
+          v4 = pParty->pPartyBuffs[PARTY_BUFF_RESIST_EARTH].uPower;
           break;
         default:
           if ( a2 != 14 )
             return result;
           v3 = this->pPlayerBuffs[9].uPower;
-          v4 = pParty->pPartyBuffs[12].uPower;
+          v4 = pParty->pPartyBuffs[PARTY_BUFF_RESIST_MIND].uPower;
           break;
       }
       return v4 + v3;
@@ -5365,7 +5365,7 @@
       if ( a2 == CHARACTER_ATTRIBUTE_MELEE_DMG_BONUS )
       {
         v3 = this->pPlayerBuffs[8].uPower;
-        v4 = pParty->pPartyBuffs[9].uPower;
+        v4 = pParty->pPartyBuffs[PARTY_BUFF_HEROISM].uPower;
         return v4 + v3;
       }
       if ( a2 != CHARACTER_ATTRIBUTE_RANGED_ATTACK )
@@ -5376,7 +5376,7 @@
   if ( a2 == 10 )
   {
     v3 = this->pPlayerBuffs[5].uPower;
-    v4 = pParty->pPartyBuffs[6].uPower;
+    v4 = pParty->pPartyBuffs[PARTY_BUFF_RESIST_FIRE].uPower;
     return v4 + v3;
   }
   switch ( a2 )
@@ -5402,11 +5402,11 @@
     case CHARACTER_ATTRIBUTE_LUCK:
       v3 = pPlayerBuffs[18].uPower;
 LABEL_5:
-      v4 = pParty->pPartyBuffs[2].uPower;
+      v4 = pParty->pPartyBuffs[PARTY_BUFF_DAY_OF_GODS].uPower;
       return v4 + v3;
     case CHARACTER_ATTRIBUTE_AC_BONUS:
       v3 = this->pPlayerBuffs[14].uPower;
-      v4 = pParty->pPartyBuffs[15].uPower;
+      v4 = pParty->pPartyBuffs[PARTY_BUFF_STONE_SKIN].uPower;
       return v4 + v3;
     default:
       return result;
@@ -7406,7 +7406,7 @@
     switch ( VarNum )
     {
       case VAR_Invisible:
-        if ( pParty->pPartyBuffs[11].uExpireTime >0 )
+        if ( pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].uExpireTime >0 )
           return true;
         return false;
       case VAR_NumDeaths:
@@ -7495,7 +7495,7 @@
         return v6;
       case VAR_IsFlying:
         if ( pParty->bFlying
-          && (pParty->pPartyBuffs[7].uExpireTime> 0) )
+          && (pParty->pPartyBuffs[PARTY_BUFF_FLY].uExpireTime> 0) )
           return true;
         return false;
       case VAR_HiredNPCHasSpeciality:
--- a/UIPopup.cpp	Tue Jun 04 08:28:20 2013 +0400
+++ b/UIPopup.cpp	Tue Jun 04 18:29:35 2013 +0200
@@ -1393,7 +1393,7 @@
     }
     while ( i < 10 );
   }
-  if ( (signed __int64)pParty->pPartyBuffs[3].uExpireTime > 0 )
+  if ( (signed __int64)pParty->pPartyBuffs[PARTY_BUFF_DETECT_LIFE].uExpireTime > 0 )
   {
     sprintf(pTmpBuf, "%s: %d", pGlobalTXT_LocalizationStrings[650], v121->sCurrentHP);
     pFontSmallnum->GetLineWidth(pTmpBuf);
--- a/UiGame.cpp	Tue Jun 04 08:28:20 2013 +0400
+++ b/UiGame.cpp	Tue Jun 04 18:29:35 2013 +0200
@@ -2247,7 +2247,7 @@
             pFace = pTexture_PlayerFaceEradicated;
             pPortrait = pFace;
             v9 = pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i];
-            if ( pParty->pPartyBuffs[11].uExpireTime )
+            if ( pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].uExpireTime )
                 pRenderer->_4A6E7E(v9, 0x183u, pPortrait);
             else
                 pRenderer->DrawTextureTransparent(v9 + 1, 0x184u, pPortrait);
@@ -2267,7 +2267,7 @@
             pFace = pTexture_PlayerFaceDead;
             pPortrait = pFace;
             v9 = pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i];
-            if ( pParty->pPartyBuffs[11].uExpireTime )
+            if ( pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].uExpireTime )
                 pRenderer->_4A6E7E(v9, 0x183u, pPortrait);
             else
                 pRenderer->DrawTextureTransparent(v9 + 1, 0x184u, pPortrait);
@@ -2301,7 +2301,7 @@
                 pFace = (Texture *)pTextures_PlayerFaces[i][pPlayer->field_1AA2];//pFace = (Texture *)pTextures_PlayerFaces[i][pFrame->uTextureID];
                 pPortrait = pFace;
                 v9 = pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i];
-                if ( pParty->pPartyBuffs[11].uExpireTime )
+                if ( pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].uExpireTime )
                     pRenderer->_4A6E7E(v9, 0x183u, pPortrait);
                 else
                     pRenderer->DrawTextureTransparent(v9 + 1, 0x184u, pPortrait);
--- a/mm7_2.cpp	Tue Jun 04 08:28:20 2013 +0400
+++ b/mm7_2.cpp	Tue Jun 04 18:29:35 2013 +0200
@@ -149,8 +149,8 @@
       return 0;
     }
     v20 = pOtherOverlayList->_4418B1(10005, 201, 0, 65536);
-    pParty->pPartyBuffs[18].Apply(pParty->uTimePlayed + 46080, 3u, 0, v20, 0);
-    pParty->pPartyBuffs[18].uFlags |= 1u;
+    pParty->pPartyBuffs[PARTY_BUFF_WATER_WALK].Apply(pParty->uTimePlayed + 46080, 3u, 0, v20, 0);
+    pParty->pPartyBuffs[PARTY_BUFF_WATER_WALK].uFlags |= 1u;
     v31 = 0;
     v29 = 0;
     v27 = 0;
@@ -180,8 +180,8 @@
     else
     {
       v19 = pOtherOverlayList->_4418B1(10008, 203, 0, 65536);
-      pParty->pPartyBuffs[7].Apply(pParty->uTimePlayed + 30720, 3u, 1u, v19, 0);
-      pParty->pPartyBuffs[7].uFlags |= 1u;
+      pParty->pPartyBuffs[PARTY_BUFF_FLY].Apply(pParty->uTimePlayed + 30720, 3u, 1u, v19, 0);
+      pParty->pPartyBuffs[PARTY_BUFF_FLY].uFlags |= 1u;
       v31 = 0;
       v29 = 0;
       v27 = 0;
--- a/mm7_3.cpp	Tue Jun 04 08:28:20 2013 +0400
+++ b/mm7_3.cpp	Tue Jun 04 18:29:35 2013 +0200
@@ -1210,13 +1210,13 @@
             Actor::AI_FaceObject(v75, v38, 0, (AIDirection *)0);
             break;
           }
-          //v52 = HIDWORD(pParty->pPartyBuffs[11].uExpireTime) == 0;
-          //v53 = SHIDWORD(pParty->pPartyBuffs[11].uExpireTime) < 0;
+          //v52 = HIDWORD(pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].uExpireTime) == 0;
+          //v53 = SHIDWORD(pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].uExpireTime) < 0;
           v0->vVelocity.y = 0;
           v0->vVelocity.x = 0;
-          //if ( !v53 && (!(v53 | v52) || LODWORD(pParty->pPartyBuffs[11].uExpireTime) > 0) )
-		  if ( (signed __int64)pParty->pPartyBuffs[11].uExpireTime < 0)
-            pParty->pPartyBuffs[11].Reset();
+          //if ( !v53 && (!(v53 | v52) || LODWORD(pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].uExpireTime) > 0) )
+		  if ( (signed __int64)pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].uExpireTime < 0)
+            pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].Reset();
           viewparams->bRedrawGameUI = 1;
           break;
         case OBJECT_Decoration:
@@ -1918,9 +1918,9 @@
     auto v87 = ((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.z) >> 16) + new_party_z;
     if ( PID_TYPE(stru_721530.uFaceID) == OBJECT_Actor)
     {
-      if ( SHIDWORD(pParty->pPartyBuffs[11].uExpireTime) >= 0
-        && (SHIDWORD(pParty->pPartyBuffs[11].uExpireTime) > 0 || LODWORD(pParty->pPartyBuffs[11].uExpireTime)) )
-        pParty->pPartyBuffs[11].Reset();
+      if ( SHIDWORD(pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].uExpireTime) >= 0
+        && (SHIDWORD(pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].uExpireTime) > 0 || LODWORD(pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].uExpireTime)) )
+        pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].Reset();
       viewparams->bRedrawGameUI = 1;
       goto LABEL_152;
     }
@@ -2279,10 +2279,10 @@
   {
     //LOBYTE(pParty->uFlags) &= 0x7Fu;
     bWaterWalk = 1;
-    *(short *)&stru_5E4C90._decor_events[20 * pParty->pPartyBuffs[18].uOverlayID + 119] |= 1u;
+    *(short *)&stru_5E4C90._decor_events[20 * pParty->pPartyBuffs[PARTY_BUFF_WATER_WALK].uOverlayID + 119] |= 1u;
     if (!(pParty->pPartyBuffs[PARTY_BUFF_WATER_WALK].uFlags & 1) &&
 		pParty->pPlayers[pParty->pPartyBuffs[PARTY_BUFF_WATER_WALK].uCaster-1].sMana <= 0 )
-		//*(int *)&pParty->pArtifactsFound[6972 * pParty->pPartyBuffs[18].uCaster + 10] <= 0 )
+		//*(int *)&pParty->pArtifactsFound[6972 * pParty->pPartyBuffs[PARTY_BUFF_WATER_WALK].uCaster + 10] <= 0 )
       bWaterWalk = 0;
   }
   v3 = ODM_GetFloorLevel(pX, pY, pZ, pParty->uPartyHeight, &v130, &v108, bWaterWalk);
@@ -2335,8 +2335,8 @@
     else pParty->walk_sound_timer = 0;
   }
   if (!bUnderwater
-    && SHIDWORD(pParty->pPartyBuffs[7].uExpireTime) <= 0
-    && (SHIDWORD(pParty->pPartyBuffs[7].uExpireTime) < 0 || LODWORD(pParty->pPartyBuffs[7].uExpireTime) <= 0) )
+    && SHIDWORD(pParty->pPartyBuffs[PARTY_BUFF_FLY].uExpireTime) <= 0
+    && (SHIDWORD(pParty->pPartyBuffs[PARTY_BUFF_FLY].uExpireTime) < 0 || LODWORD(pParty->pPartyBuffs[PARTY_BUFF_FLY].uExpireTime) <= 0) )
     pParty->bFlying = false;
   if (!bJumping)
   {
@@ -2424,8 +2424,8 @@
         {
           pParty->bFlying = 0;
           if ( bUnderwater
-            || pParty->pPartyBuffs[7].uFlags & 1
-            || pParty->pPlayers[pParty->pPartyBuffs[7].uCaster - 1].sMana > 0 )//*(int *)&pParty->pArtifactsFound[6972 * pParty->pPartyBuffs[7].uCaster + 10] > 0 )
+            || pParty->pPartyBuffs[PARTY_BUFF_FLY].uFlags & 1
+            || pParty->pPlayers[pParty->pPartyBuffs[PARTY_BUFF_FLY].uCaster - 1].sMana > 0 )//*(int *)&pParty->pArtifactsFound[6972 * pParty->pPartyBuffs[PARTY_BUFF_FLY].uCaster + 10] > 0 )
           {
             pZ -= 30;
             v113 -= 30;
@@ -2671,7 +2671,7 @@
       if ( v127 )
         pZ = v113;
       if (pParty->FlyActive())
-        stru_5E4C90._decor_events[20 * pParty->pPartyBuffs[7].uOverlayID + 119] &= 0xFEu;
+        stru_5E4C90._decor_events[20 * pParty->pPartyBuffs[PARTY_BUFF_FLY].uOverlayID + 119] &= 0xFEu;
       pParty->uFallStartY = pZ;
       //goto LABEL_141;
     }
@@ -2684,7 +2684,7 @@
 		pParty->uFallStartY = v111;
 	    v113 = pZ;
 	    if (pParty->FlyActive())
-		  stru_5E4C90._decor_events[20 * pParty->pPartyBuffs[7].uOverlayID + 119] |= 1u;
+		  stru_5E4C90._decor_events[20 * pParty->pPartyBuffs[PARTY_BUFF_FLY].uOverlayID + 119] |= 1u;
 
 	}
   }
@@ -2692,7 +2692,7 @@
   {
 	  v113 = pZ;
 	  if (pParty->FlyActive())
-		stru_5E4C90._decor_events[20 * pParty->pPartyBuffs[7].uOverlayID + 119] |= 1u;
+		stru_5E4C90._decor_events[20 * pParty->pPartyBuffs[PARTY_BUFF_FLY].uOverlayID + 119] |= 1u;
   }
 //LABEL_141:
   if (bJumping && !pParty->bFlying)
@@ -3211,9 +3211,9 @@
     if ( bWaterWalk )
     {
       pParty->uFlags &= ~PARTY_FLAGS_1_STANDING_ON_WATER;
-      //v79 = 20 * pParty->pPartyBuffs[18].uOverlayID + 6180178;
-      //*(short *)&stru_5E4C90._decor_events[20 * pParty->pPartyBuffs[18].uOverlayID + 119] |= 1u;
-      v79 = (int)&stru_5E4C90._decor_events[20 * pParty->pPartyBuffs[18].uOverlayID + 119];
+      //v79 = 20 * pParty->pPartyBuffs[PARTY_BUFF_WATER_WALK].uOverlayID + 6180178;
+      //*(short *)&stru_5E4C90._decor_events[20 * pParty->pPartyBuffs[PARTY_BUFF_WATER_WALK].uOverlayID + 119] |= 1u;
+      v79 = (int)&stru_5E4C90._decor_events[20 * pParty->pPartyBuffs[PARTY_BUFF_WATER_WALK].uOverlayID + 119];
       *(short *)v79 |= 1u;
       if ( !v122 || !v69 )
       {
@@ -6816,8 +6816,8 @@
   if (pWeather->bNight)
   {
     v8 = 67108864;
-    if ( (signed __int64)pParty->pPartyBuffs[16].uExpireTime > 0 )
-      v8 = pParty->pPartyBuffs[16].uPower << 26;
+    if ( (signed __int64)pParty->pPartyBuffs[PARTY_BUFF_TORCHLIGHT].uExpireTime > 0 )
+      v8 = pParty->pPartyBuffs[PARTY_BUFF_TORCHLIGHT].uPower << 26;
     if ( a3 <= v8 )
     {
       if ( a3 > 0 )
@@ -6985,12 +6985,12 @@
     }
     else
     {
-      if ( (signed __int64)pParty->pPartyBuffs[16].uExpireTime > 0 )
-      {
-        if ( (signed __int64)pParty->pPartyBuffs[16].uExpireTime <= 0 )
+      if ( (signed __int64)pParty->pPartyBuffs[PARTY_BUFF_TORCHLIGHT].uExpireTime > 0 )
+      {
+        if ( (signed __int64)pParty->pPartyBuffs[PARTY_BUFF_TORCHLIGHT].uExpireTime <= 0 )
           v11 = 0;
         else
-          v11 = pParty->pPartyBuffs[16].uPower;
+          v11 = pParty->pPartyBuffs[PARTY_BUFF_TORCHLIGHT].uPower;
       }
       v12 = v11 << 26;
     }
@@ -13089,7 +13089,7 @@
         pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 2u);
         pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 3u);
         v39 = (signed __int64)((double)(v42 << 7) * 0.033333335);
-        v37 = &pParty->pPartyBuffs[2];
+        v37 = &pParty->pPartyBuffs[PARTY_BUFF_DAY_OF_GODS];
         v36 = pParty->uTimePlayed + v39;
         v37->Apply(v36, a7b, v43, 0, 0);
         goto LABEL_139;
@@ -13103,7 +13103,7 @@
        pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 2u);
        pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 3u);
        v39 = (signed __int64)((double)(v42 << 7) * 0.033333335);
-       v37 = &pParty->pPartyBuffs[2];
+       v37 = &pParty->pPartyBuffs[PARTY_BUFF_DAY_OF_GODS];
        v36 = pParty->uTimePlayed + v39;
        v37->Apply(v36, a7b, v43, 0, 0);
        goto LABEL_139;
@@ -13116,7 +13116,7 @@
     pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 2u);
     pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 3u);
     v39 = (signed __int64)((double)(v42 << 7) * 0.033333335);
-    v37 = &pParty->pPartyBuffs[2];
+    v37 = &pParty->pPartyBuffs[PARTY_BUFF_DAY_OF_GODS];
     v36 = pParty->uTimePlayed + v39;
     v37->Apply(v36, a7b, v43, 0, 0);
     goto LABEL_139;
@@ -13566,7 +13566,7 @@
         v48 = uSkill;
         v46 = v15;
         v39 = (signed __int64)((double)(v38 << 7) * 0.033333335);
-        v37 = &pParty->pPartyBuffs[10];
+        v37 = &pParty->pPartyBuffs[PARTY_BUFF_IMMOLATION];
         v36 = pParty->uTimePlayed + v39;
         v37->Apply(v36, v46, v48, v50, v52);
         goto LABEL_139;
--- a/mm7_4.cpp	Tue Jun 04 08:28:20 2013 +0400
+++ b/mm7_4.cpp	Tue Jun 04 18:29:35 2013 +0200
@@ -1925,7 +1925,7 @@
         { // colliding with something in the air - fall down
           v5 = v4 * pParty->pPartyBuffs[PARTY_BUFF_FLY].uPower;
           //__debugbreak();
-		  v6 = (int *)&pParty->pPlayers[pParty->pPartyBuffs[PARTY_BUFF_FLY].uCaster].pConditions[0];//&stru_AA1058[4].pSounds[6972 * pParty->pPartyBuffs[7].uCaster + 2000];
+		  v6 = (int *)&pParty->pPlayers[pParty->pPartyBuffs[PARTY_BUFF_FLY].uCaster].pConditions[0];//&stru_AA1058[4].pSounds[6972 * pParty->pPartyBuffs[PARTY_BUFF_FLY].uCaster + 2000];
           v7 = *v6 < v5;
           *v6 -= v5;
           if ( v7 )
@@ -1946,7 +1946,7 @@
         if ( !(pParty->pPartyBuffs[PARTY_BUFF_WATER_WALK].uFlags & 1) )
         { // taking on water
           //__debugbreak();
-          v8 = (int *)&pParty->pPlayers[pParty->pPartyBuffs[PARTY_BUFF_WATER_WALK].uCaster].pConditions[0];//&stru_AA1058[4].pSounds[6972 * pParty->pPartyBuffs[18].uCaster + 2000];
+          v8 = (int *)&pParty->pPlayers[pParty->pPartyBuffs[PARTY_BUFF_WATER_WALK].uCaster].pConditions[0];//&stru_AA1058[4].pSounds[6972 * pParty->pPartyBuffs[PARTY_BUFF_WATER_WALK].uCaster + 2000];
           v7 = *v8 < v4;
           *v8 -= v4;
           if ( v7 )
@@ -1990,7 +1990,7 @@
       }
       a1.uObjectDescID = v10;
       a1.field_60_distance_related_prolly_lod = 0;
-      v12 = 8 * pParty->pPartyBuffs[10].uCaster;
+      v12 = 8 * pParty->pPartyBuffs[PARTY_BUFF_IMMOLATION].uCaster;
       LOBYTE(v12) = v12 | OBJECT_Player;
       a1.uAttributes = 0;
       a1.uSectorID = 0;
@@ -2623,7 +2623,7 @@
     ++v62;
   }
   while ( (signed int)v62 <= (signed int)&pPlayers[4] );
-  v46 = (signed __int64)pParty->pPartyBuffs[8].uExpireTime > 0;
+  v46 = (signed __int64)pParty->pPartyBuffs[PARTY_BUFF_HASTE].uExpireTime > 0;
 
   for (uint i = 0; i < 20; ++i)
   {
@@ -2631,7 +2631,7 @@
       viewparams->bRedrawGameUI = 1;
   }
 
-  if ( v46 && (signed __int64)pParty->pPartyBuffs[8].uExpireTime <= 0 )
+  if ( v46 && (signed __int64)pParty->pPartyBuffs[PARTY_BUFF_HASTE].uExpireTime <= 0 )
   {
     for (uint i = 0; i < 4; ++i)
       pParty->pPlayers[i].SetCondition(1, 0);
--- a/mm7_6.cpp	Tue Jun 04 08:28:20 2013 +0400
+++ b/mm7_6.cpp	Tue Jun 04 18:29:35 2013 +0200
@@ -1611,7 +1611,7 @@
 		while ( (signed __int64)v6->uExpireTime <= 0 )
 		{
 			++v6;
-			if ( v6 > &pParty->pPartyBuffs[19] )
+			if ( v6 > &pParty->pPartyBuffs[PARTY_BUFF_WIZARD_EYE] )
 			{
 				v7 = pParty->pPlayers;//[0].pPlayerBuffs;
 				v8 = 0;