diff mm7_2.cpp @ 1438:bc99e1a48bea

m
author Ritor1
date Mon, 22 Jul 2013 18:00:34 +0600
parents 82431a85b28e
children 468f434a8d8a
line wrap: on
line diff
--- a/mm7_2.cpp	Sat Jul 06 09:07:04 2013 +0600
+++ b/mm7_2.cpp	Mon Jul 22 18:00:34 2013 +0600
@@ -7132,8 +7132,8 @@
   char *v11; // edx@20
   unsigned __int16 v12; // ax@23
   int v13; // eax@27
-  unsigned int v14; // ebx@33
-  unsigned __int16 v15; // ax@35
+  //unsigned int v14; // ebx@33
+  //unsigned __int16 v15; // ax@35
   int v16; // eax@36
   unsigned int v17; // eax@37
   __int16 v18; // di@37
@@ -7243,15 +7243,15 @@
   unsigned int v122; // eax@260
   char *v123; // edx@261
   int v124; // eax@267
-  int v125; // [sp-20h] [bp-4Ch]@28
-  signed int v126; // [sp-1Ch] [bp-48h]@27
-  unsigned int v127; // [sp-18h] [bp-44h]@27
-  signed int v128; // [sp-14h] [bp-40h]@27
-  signed int v129; // [sp-10h] [bp-3Ch]@27
-  int v130; // [sp-Ch] [bp-38h]@27
-  unsigned int v131; // [sp-8h] [bp-34h]@27
+  //int v125; // [sp-20h] [bp-4Ch]@28
+  //signed int v126; // [sp-1Ch] [bp-48h]@27
+  //unsigned int v127; // [sp-18h] [bp-44h]@27
+  //signed int v128; // [sp-14h] [bp-40h]@27
+  //signed int v129; // [sp-10h] [bp-3Ch]@27
+  //int v130; // [sp-Ch] [bp-38h]@27
+  //unsigned int v131; // [sp-8h] [bp-34h]@27
   char v132; // [sp-8h] [bp-34h]@131
-  int v133; // [sp-4h] [bp-30h]@27
+  //int v133; // [sp-4h] [bp-30h]@27
   char v134; // [sp-4h] [bp-30h]@131
   signed int v135; // [sp-4h] [bp-30h]@217
   int v136; // [sp+Ch] [bp-20h]@208
@@ -7305,13 +7305,13 @@
 
   v6 = v2->uType;
   v7 = v2->uType;
-  if ( v7 > 3060 )
-  {
-    if ( v7 > 6090 )
-    {
-      if ( v7 > 8090 )
+  if ( v2->uType > 3060 )
+  {
+    if ( v2->uType > 6090 )
+    {
+      if ( v2->uType > 8090 )
       {
-        if ( v7 == 9010 )
+        if ( v2->uType == 9010 )
           goto LABEL_247;
         if ( v7 != 9030 )
         {
@@ -7333,13 +7333,88 @@
                 ++v146;
                 v144 += 56;
                 if ( v146 >= (signed int)v99 )
-                  goto LABEL_195;
+                {
+                  v46 = 0;
+                  v2->uObjectDescID = v46;
+                  if ( v46 == (short)v32 )
+                    SpriteObject::OnInteraction(v153);
+                  v100 = v2->field_61;
+                  v101 = v2->vPosition.z;
+                  v2->uSpriteFrameID = v32;
+                  v102 = 8 * v153;
+                  v103 = v2->vPosition.y;
+                  LOBYTE(v102) = PID(OBJECT_Item,v153);
+                  v2->vVelocity.x = v32;
+                  v2->vVelocity.y = v32;
+                  v104 = v2->vPosition.x;
+                  v2->vVelocity.z = v32;
+                  v149 = v102;
+                  stru_50FE08.Add(v102, 512, v104, v103, v101, v100, v32);
+                  if ( HIBYTE(v3->uFlags) & 1 )
+                    array_5118E8._440E91(v2->vPosition.x, v2->vPosition.y, v2->vPosition.z, v32, v3->uParticleTrailColor);
+                  v105 = v2->uSoundID;
+                  if ( v105 == (short)v32 )
+                    v47 = 0;
+                  else
+                    v47 = (signed __int16)v105 + 4;
+                  v116 = word_4EE088_sound_ids[v2->spell_id] + 1;
+                  pAudioPlayer->PlaySound((SoundID)v116, v149, v32, -1, v32, v47, v32, v32);
+                  return 0;
+                }
               }
-              goto LABEL_80;
+              v46 = v146;
+              v2->uObjectDescID = v46;
+              if ( v46 == (short)v32 )
+                SpriteObject::OnInteraction(v153);
+              v100 = v2->field_61;
+              v101 = v2->vPosition.z;
+              v2->uSpriteFrameID = v32;
+              v102 = 8 * v153;
+              v103 = v2->vPosition.y;
+              LOBYTE(v102) = PID(OBJECT_Item,v153);
+              v2->vVelocity.x = v32;
+              v2->vVelocity.y = v32;
+              v104 = v2->vPosition.x;
+              v2->vVelocity.z = v32;
+              v149 = v102;
+              stru_50FE08.Add(v102, 512, v104, v103, v101, v100, v32);
+              if ( HIBYTE(v3->uFlags) & 1 )
+                array_5118E8._440E91(v2->vPosition.x, v2->vPosition.y, v2->vPosition.z, v32, v3->uParticleTrailColor);
+              v105 = v2->uSoundID;
+              if ( v105 == (short)v32 )
+                v47 = 0;
+              else
+                v47 = (signed __int16)v105 + 4;
+              v116 = word_4EE088_sound_ids[v2->spell_id] + 1;
+              pAudioPlayer->PlaySound((SoundID)v116, v149, v32, -1, v32, v47, v32, v32);
+              return 0;
             }
-LABEL_195:
             v46 = 0;
-            goto LABEL_196;
+            v2->uObjectDescID = v46;
+            if ( v46 == (short)v32 )
+              SpriteObject::OnInteraction(v153);
+            v100 = v2->field_61;
+            v101 = v2->vPosition.z;
+            v2->uSpriteFrameID = v32;
+            v102 = 8 * v153;
+            v103 = v2->vPosition.y;
+            LOBYTE(v102) = PID(OBJECT_Item,v153);
+            v2->vVelocity.x = v32;
+            v2->vVelocity.y = v32;
+            v104 = v2->vPosition.x;
+            v2->vVelocity.z = v32;
+            v149 = v102;
+            stru_50FE08.Add(v102, 512, v104, v103, v101, v100, v32);
+            if ( HIBYTE(v3->uFlags) & 1 )
+            array_5118E8._440E91(v2->vPosition.x, v2->vPosition.y, v2->vPosition.z, v32, v3->uParticleTrailColor);
+            v105 = v2->uSoundID;
+            if ( v105 == (short)v32 )
+              v47 = 0;
+            else
+              v47 = (signed __int16)v105 + 4;
+            v116 = word_4EE088_sound_ids[v2->spell_id] + 1;
+            pAudioPlayer->PlaySound((SoundID)v116, v149, v32, -1, v32, v47, v32, v32);
+            return 0;
           }
           goto LABEL_93;
         }
@@ -7361,7 +7436,10 @@
         if ( v151 != OBJECT_Actor)
         {
           if ( v6 != 9030 || v2->spell_skill != 4 )
-            goto LABEL_246;
+          {
+            SpriteObject::OnInteraction(v153);
+            return 0;
+          }
           v2->_46BEF1_apply_spells_aoe();
 LABEL_233:
           if ( !v138 )
@@ -7398,19 +7476,12 @@
               v114 = (signed __int16)v113 + 4;
             else
               v114 = 0;
-            v133 = 0;
-            v131 = 0;
-            v130 = v114;
             v115 = 8 * v153;
-            v129 = 0;
-            v128 = -1;
             LOBYTE(v115) = PID(OBJECT_Item,v153);
-            v127 = 0;
-            v126 = v115;
-            v116 = v143;
-            goto LABEL_269;
+            v116 = v143 + 1;
+            pAudioPlayer->PlaySound((SoundID)v116, v115, 0, -1, 0, 0, 0, 0);
+            return 0;
           }
-LABEL_246:
           SpriteObject::OnInteraction(v153);
           return 0;
         }
@@ -7461,12 +7532,8 @@
                     pActors[v108].uAIState = Standing;
                     pActors[v108].UpdateAnimation();
                   }
-                  pActors[v108].pActorBuffs[v136].Apply(
-                    pParty->uTimePlayed + (signed int)(signed __int64)((double)(v137 << 7) * 0.033333335),
-                    v152,
-                    v150,
-                    0,
-                    0);
+                  pActors[v108].pActorBuffs[v136].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(v137 << 7) * 0.033333335),
+                    v152, v150, 0, 0);
                 }
               }
               else
@@ -7503,11 +7570,67 @@
             ++v52;
             v94 += 56;
             if ( v52 >= (signed int)v93 )
-              goto LABEL_181;
+            {
+              v95 = 0;
+              v2->uObjectDescID = v95;
+              if ( v95 == (short)v9 )
+                SpriteObject::OnInteraction(v153);
+              v96 = v2->uSoundID;
+              v2->vVelocity.z = v9;
+              v2->vVelocity.y = v9;
+              v2->vVelocity.x = v9;
+              v2->uSpriteFrameID = v9;
+              if ( v96 == (short)v9 )
+                v97 = 0;
+              else
+                v97 = (signed __int16)v96 + 4;
+              v92 = v153;
+              v124 = 8 * v92;
+              LOBYTE(v124) = v124 | 2;
+              v116 = word_4EE088_sound_ids[v2->spell_id] + 1;
+              pAudioPlayer->PlaySound((SoundID)v116, v124, v9, -1, v9, v97, v9, v9);
+              return 0;
+            }
           }
-          goto LABEL_202;
+          v95 = v52;
+          v2->uObjectDescID = v95;
+          if ( v95 == (short)v9 )
+            SpriteObject::OnInteraction(v153);
+          v96 = v2->uSoundID;
+          v2->vVelocity.z = v9;
+          v2->vVelocity.y = v9;
+          v2->vVelocity.x = v9;
+          v2->uSpriteFrameID = v9;
+          if ( v96 == (short)v9 )
+            v97 = 0;
+          else
+            v97 = (signed __int16)v96 + 4;
+          v92 = v153;
+          v124 = 8 * v92;
+          LOBYTE(v124) = v124 | 2;
+          v116 = word_4EE088_sound_ids[v2->spell_id] + 1;
+          pAudioPlayer->PlaySound((SoundID)v116, v124, v9, -1, v9, v97, v9, v9);
+          return 0;
         }
-        goto LABEL_181;
+        v95 = 0;
+        v2->uObjectDescID = v95;
+        if ( v95 == (short)v9 )
+          SpriteObject::OnInteraction(v153);
+        v96 = v2->uSoundID;
+        v2->vVelocity.z = v9;
+        v2->vVelocity.y = v9;
+        v2->vVelocity.x = v9;
+        v2->uSpriteFrameID = v9;
+        if ( v96 == (short)v9 )
+          v97 = 0;
+        else
+          v97 = (signed __int16)v96 + 4;
+        v92 = v153;
+        v124 = 8 * v92;
+        LOBYTE(v124) = v124 | 2;
+        v116 = word_4EE088_sound_ids[v2->spell_id] + 1;
+        pAudioPlayer->PlaySound((SoundID)v116, v124, v9, -1, v9, v97, v9, v9);
+        return 0;
       }
       v79 = v7 == 8030;
     }
@@ -7559,34 +7682,22 @@
             v2->uObjectDescID = v58;
             if ( !v58 )
               SpriteObject::OnInteraction(v153);
-            v14 = v153;
             v2->vVelocity.z = 0;
             v2->vVelocity.y = 0;
             v2->vVelocity.x = 0;
             v2->uSpriteFrameID = 0;
             sub_43A97E(v153, v145);
-LABEL_35:
-            v15 = v2->uSoundID;
-            if ( v15 == (short)v9 )
+            //v15 = v2->uSoundID;
+            if ( v2->uSoundID == (short)v9 )
               v16 = 0;
             else
-              v16 = (signed __int16)v15 + 4;
-            v133 = v9;
-            v131 = v9;
-            v130 = v16;
-            v92 = v14;
-LABEL_267:
+              v16 = (signed __int16)v2->uSoundID + 4;
+            v92 = v153;
             v124 = 8 * v92;
-            v129 = v9;
-            v128 = -1;
             LOBYTE(v124) = v124 | 2;
-            v127 = v9;
-            v126 = v124;
-LABEL_268:
-            v116 = word_4EE088_sound_ids[v2->spell_id - 1];
-LABEL_269:
-            v125 = v116 + 1;
-            goto LABEL_29;
+            v116 = word_4EE088_sound_ids[v2->spell_id] + 1;
+            pAudioPlayer->PlaySound((SoundID)v116, v124, v9, -1, v9, v16, v9, v9);
+            return 0;
           }
           v59 = v6 + 2;
           v60 = pObjectList->uNumObjects;
@@ -7635,10 +7746,17 @@
             while ( v141 );
           }
 LABEL_160:
-          v14 = v153;
-LABEL_34:
-          SpriteObject::OnInteraction(v14);
-          goto LABEL_35;
+          SpriteObject::OnInteraction(v153);
+          if ( v2->uSoundID == (short)v9 )
+            v16 = 0;
+          else
+            v16 = (signed __int16)v2->uSoundID + 4;
+          v92 = v153;
+          v124 = 8 * v92;
+          LOBYTE(v124) = v124 | 2;
+          v116 = word_4EE088_sound_ids[v2->spell_id] + 1;
+          pAudioPlayer->PlaySound((SoundID)v116, v124, v9, -1, v9, v16, v9, v9);
+          return 0;
         }
         if ( v151 == 6 || v151 == 5 || (v66 = 0, !v151) )
           return 1;
@@ -7671,7 +7789,6 @@
         v134 = 0;
         v72 = v153;
         v132 = 0;
-LABEL_132:
         v73 = v2->vPosition.z;
         v74 = v2->vPosition.y;
         v75 = PID(OBJECT_Item,v72);
@@ -7686,14 +7803,9 @@
           v78 = 0;
         else
           v78 = (signed __int16)v77 + 4;
-        v133 = v66;
-        v131 = v66;
-        v130 = v78;
-        v129 = v66;
-        v128 = -1;
-        v127 = v66;
-        v126 = v75;
-        goto LABEL_268;
+        v116 = word_4EE088_sound_ids[v2->spell_id] + 1;
+        pAudioPlayer->PlaySound((SoundID)v116, v75, v66, -1, v66, v78, v66, v66);
+        return 0;
       }
       if ( v7 == 4090 )
       {
@@ -7774,7 +7886,23 @@
         v134 = 0;
         v72 = v153;
         v132 = v2->field_61;
-        goto LABEL_132;
+        v73 = v2->vPosition.z;
+        v74 = v2->vPosition.y;
+        v75 = PID(OBJECT_Item,v72);
+        v2->vVelocity.z = v66;
+        v2->vVelocity.y = v66;
+        v76 = v2->vPosition.x;
+        v2->vVelocity.x = v66;
+        v2->uSpriteFrameID = v66;
+        stru_50FE08.Add(v75, 512, v76, v74, v73, v132, v134);
+        v77 = v2->uSoundID;
+        if ( v77 == (short)v66 )
+          v78 = 0;
+        else
+          v78 = (signed __int16)v77 + 4;
+        v116 = word_4EE088_sound_ids[v2->spell_id] + 1;
+        pAudioPlayer->PlaySound((SoundID)v116, v75, v66, -1, v66, v78, v66, v66);
+        return 0;
       }
       if ( v7 == 4100 || v7 == 6010 )
         goto LABEL_93;
@@ -7840,21 +7968,33 @@
           v9 = 0;
           v10 = 0;
           if ( (signed int)v8 <= 0 )
-            goto LABEL_23;
+          {
+            v12 = 0;
+            goto LABEL_24;
+          }
           v11 = (char *)&pObjectList->pObjects->uObjectID;
           break;
         case 545:
         case 550:
           if ( v2->stru_24.uItemID != 405 && v2->stru_24.uSpecEnchantmentType != 3 )
           {
-            v14 = v153;
             v9 = 0;
             v2->vVelocity.z = 0;
             v2->vVelocity.y = 0;
             v2->vVelocity.x = 0;
             v2->uSpriteFrameID = 0;
             sub_43A97E(v153, v145);
-            goto LABEL_34;
+            SpriteObject::OnInteraction(v153);
+            if ( v2->uSoundID == (short)v9 )
+              v16 = 0;
+            else
+              v16 = (signed __int16)v2->uSoundID + 4;
+            v92 = v153;
+            v124 = 8 * v92;
+            LOBYTE(v124) = v124 | 2;
+            v116 = word_4EE088_sound_ids[v2->spell_id] + 1;
+            pAudioPlayer->PlaySound((SoundID)v116, v124, v9, -1, v9, v16, v9, v9);
+            return 0;
           }
           v17 = pObjectList->uNumObjects;
           v18 = 0;
@@ -7883,7 +8023,6 @@
         v11 += 56;
         if ( v10 >= (signed int)v8 )
         {
-LABEL_23:
           v12 = 0;
           goto LABEL_24;
         }
@@ -7899,7 +8038,12 @@
       v2->vVelocity.x = 0;
       v2->uSpriteFrameID = 0;
       if ( !v44 )
-        goto LABEL_27;
+      {
+        v13 = 8 * v153;
+        LOBYTE(v13) = PID(OBJECT_Item,v153);
+        pAudioPlayer->PlaySound((SoundID)8, v13, v9, -1, v9, v9, v9, v9);
+        return 0;
+      }
     }
     return 0;
   }
@@ -7934,13 +8078,49 @@
         ++v52;
         v53 += 56;
         if ( v52 >= (signed int)v51 )
-          goto LABEL_181;
+        {
+          v95 = 0;
+          v2->uObjectDescID = v95;
+          if ( v95 == (short)v9 )
+            SpriteObject::OnInteraction(v153);
+          v96 = v2->uSoundID;
+          v2->vVelocity.z = v9;
+          v2->vVelocity.y = v9;
+          v2->vVelocity.x = v9;
+          v2->uSpriteFrameID = v9;
+          if ( v96 == (short)v9 )
+            v97 = 0;
+          else
+            v97 = (signed __int16)v96 + 4;
+          v92 = v153;
+          v124 = 8 * v92;
+          LOBYTE(v124) = v124 | 2;
+          v116 = word_4EE088_sound_ids[v2->spell_id] + 1;
+          pAudioPlayer->PlaySound((SoundID)v116, v124, v9, -1, v9, v97, v9, v9);
+          return 0;
+        }
       }
-      goto LABEL_202;
-    }
-LABEL_181:
+      v95 = v52;
+      v2->uObjectDescID = v95;
+      if ( v95 == (short)v9 )
+        SpriteObject::OnInteraction(v153);
+      v96 = v2->uSoundID;
+      v2->vVelocity.z = v9;
+      v2->vVelocity.y = v9;
+      v2->vVelocity.x = v9;
+      v2->uSpriteFrameID = v9;
+      if ( v96 == (short)v9 )
+        v97 = 0;
+      else
+        v97 = (signed __int16)v96 + 4;
+      v92 = v153;
+      v124 = 8 * v92;
+      LOBYTE(v124) = v124 | 2;
+      v116 = word_4EE088_sound_ids[v2->spell_id] + 1;
+      pAudioPlayer->PlaySound((SoundID)v116, v124, v9, -1, v9, v97, v9, v9);
+      return 0;
+    }
     v95 = 0;
-LABEL_182:
     v2->uObjectDescID = v95;
     if ( v95 == (short)v9 )
       SpriteObject::OnInteraction(v153);
@@ -7953,11 +8133,12 @@
       v97 = 0;
     else
       v97 = (signed __int16)v96 + 4;
-    v133 = v9;
-    v131 = v9;
-    v130 = v97;
     v92 = v153;
-    goto LABEL_267;
+    v124 = 8 * v92;
+    LOBYTE(v124) = v124 | 2;
+    v116 = word_4EE088_sound_ids[v2->spell_id] + 1;
+    pAudioPlayer->PlaySound((SoundID)v116, v124, v9, -1, v9, v97, v9, v9);
+   return 0;
   }
   if ( v7 == 1100 )
     goto LABEL_93;
@@ -8002,14 +8183,8 @@
     stru_50FE08.Add(v38, 512, v40, v39, v37, 0, 0);
     if ( HIBYTE(v3->uFlags) & 1 )
       array_5118E8._440E91(v2->vPosition.x, v2->vPosition.y, v2->vPosition.z, 0, v3->uParticleTrailColor);
-    v133 = 0;
-    v131 = 0;
-    v130 = 0;
-    v129 = 0;
-    v128 = -1;
-    v127 = 0;
-    v126 = v147;
-    goto LABEL_28;
+    pAudioPlayer->PlaySound((SoundID)8, v147, 0, -1, 0, 0, 0, 0);
+    return 0;
   }
   v27 = v26 - 410;
   if ( !v27 )
@@ -8038,11 +8213,36 @@
           ++v146;
           v140 += 56;
           if ( v146 >= (signed int)v31 )
-            goto LABEL_195;
+          {
+            v46 = 0;
+            v2->uObjectDescID = v46;
+            if ( v46 == (short)v32 )
+              SpriteObject::OnInteraction(v153);
+            v100 = v2->field_61;
+            v101 = v2->vPosition.z;
+            v2->uSpriteFrameID = v32;
+            v102 = 8 * v153;
+            v103 = v2->vPosition.y;
+            LOBYTE(v102) = PID(OBJECT_Item,v153);
+            v2->vVelocity.x = v32;
+            v2->vVelocity.y = v32;
+            v104 = v2->vPosition.x;
+            v2->vVelocity.z = v32;
+            v149 = v102;
+            stru_50FE08.Add(v102, 512, v104, v103, v101, v100, v32);
+            if ( HIBYTE(v3->uFlags) & 1 )
+              array_5118E8._440E91(v2->vPosition.x, v2->vPosition.y, v2->vPosition.z, v32, v3->uParticleTrailColor);
+            v105 = v2->uSoundID;
+            if ( v105 == (short)v32 )
+              v47 = 0;
+            else
+              v47 = (signed __int16)v105 + 4;
+            v116 = word_4EE088_sound_ids[v2->spell_id] + 1;
+            pAudioPlayer->PlaySound((SoundID)v116, v149, v32, -1, v32, v47, v32, v32);
+            return 0;
+          }
         }
-LABEL_80:
         v46 = v146;
-LABEL_196:
         v2->uObjectDescID = v46;
         if ( v46 == (short)v32 )
           SpriteObject::OnInteraction(v153);
@@ -8059,27 +8259,42 @@
         v149 = v102;
         stru_50FE08.Add(v102, 512, v104, v103, v101, v100, v32);
         if ( HIBYTE(v3->uFlags) & 1 )
-          array_5118E8._440E91(
-            v2->vPosition.x,
-            v2->vPosition.y,
-            v2->vPosition.z,
-            v32,
-            v3->uParticleTrailColor);
+          array_5118E8._440E91(v2->vPosition.x, v2->vPosition.y, v2->vPosition.z, v32, v3->uParticleTrailColor);
         v105 = v2->uSoundID;
         if ( v105 == (short)v32 )
           v47 = 0;
         else
           v47 = (signed __int16)v105 + 4;
-        v133 = v32;
-        v131 = v32;
-        v130 = v47;
-        v129 = v32;
-        v128 = -1;
-        v127 = v32;
-        v126 = v149;
-        goto LABEL_268;
+        v116 = word_4EE088_sound_ids[v2->spell_id] + 1;
+        pAudioPlayer->PlaySound((SoundID)v116, v149, v32, -1, v32, v47, v32, v32);
+        return 0;
       }
-      goto LABEL_195;
+      v46 = 0;
+      v2->uObjectDescID = v46;
+      if ( v46 == (short)v32 )
+      SpriteObject::OnInteraction(v153);
+      v100 = v2->field_61;
+      v101 = v2->vPosition.z;
+      v2->uSpriteFrameID = v32;
+      v102 = 8 * v153;
+      v103 = v2->vPosition.y;
+      LOBYTE(v102) = PID(OBJECT_Item,v153);
+      v2->vVelocity.x = v32;
+      v2->vVelocity.y = v32;
+      v104 = v2->vPosition.x;
+      v2->vVelocity.z = v32;
+      v149 = v102;
+      stru_50FE08.Add(v102, 512, v104, v103, v101, v100, v32);
+      if ( HIBYTE(v3->uFlags) & 1 )
+        array_5118E8._440E91(v2->vPosition.x, v2->vPosition.y, v2->vPosition.z, v32, v3->uParticleTrailColor);
+      v105 = v2->uSoundID;
+      if ( v105 == (short)v32 )
+        v47 = 0;
+      else
+        v47 = (signed __int16)v105 + 4;
+      v116 = word_4EE088_sound_ids[v2->spell_id] + 1;
+      pAudioPlayer->PlaySound((SoundID)v116, v149, v32, -1, v32, v47, v32, v32);
+      return 0;
     }
     return 1;
   }
@@ -8100,13 +8315,67 @@
         ++v52;
         v123 += 56;
         if ( v52 >= (signed int)v122 )
-          goto LABEL_181;
+        {
+          v95 = 0;
+          v2->uObjectDescID = v95;
+          if ( v95 == (short)v9 )
+            SpriteObject::OnInteraction(v153);
+          v96 = v2->uSoundID;
+          v2->vVelocity.z = v9;
+          v2->vVelocity.y = v9;
+          v2->vVelocity.x = v9;
+          v2->uSpriteFrameID = v9;
+          if ( v96 == (short)v9 )
+            v97 = 0;
+          else
+            v97 = (signed __int16)v96 + 4;
+          v92 = v153;
+          v124 = 8 * v92;
+          LOBYTE(v124) = v124 | 2;
+          v116 = word_4EE088_sound_ids[v2->spell_id] + 1;
+          pAudioPlayer->PlaySound((SoundID)v116, v124, v9, -1, v9, v97, v9, v9);
+          return 0;
+        }
       }
-LABEL_202:
       v95 = v52;
-      goto LABEL_182;
-    }
-    goto LABEL_181;
+      v2->uObjectDescID = v95;
+      if ( v95 == (short)v9 )
+        SpriteObject::OnInteraction(v153);
+      v96 = v2->uSoundID;
+      v2->vVelocity.z = v9;
+      v2->vVelocity.y = v9;
+      v2->vVelocity.x = v9;
+      v2->uSpriteFrameID = v9;
+      if ( v96 == (short)v9 )
+        v97 = 0;
+      else
+        v97 = (signed __int16)v96 + 4;
+      v92 = v153;
+      v124 = 8 * v92;
+      LOBYTE(v124) = v124 | 2;
+      v116 = word_4EE088_sound_ids[v2->spell_id] + 1;
+      pAudioPlayer->PlaySound((SoundID)v116, v124, v9, -1, v9, v97, v9, v9);
+      return 0;
+    }
+    v95 = 0;
+    v2->uObjectDescID = v95;
+    if ( v95 == (short)v9 )
+      SpriteObject::OnInteraction(v153);
+    v96 = v2->uSoundID;
+    v2->vVelocity.z = v9;
+    v2->vVelocity.y = v9;
+    v2->vVelocity.x = v9;
+    v2->uSpriteFrameID = v9;
+    if ( v96 == (short)v9 )
+      v97 = 0;
+    else
+      v97 = (signed __int16)v96 + 4;
+    v92 = v153;
+    v124 = 8 * v92;
+    LOBYTE(v124) = v124 | 2;
+    v116 = word_4EE088_sound_ids[v2->spell_id] + 1;
+    pAudioPlayer->PlaySound((SoundID)v116, v124, v9, -1, v9, v97, v9, v9);
+   return 0;
   }
   v117 = v6 + 1;
   v118 = pObjectList->uNumObjects;
@@ -8138,19 +8407,8 @@
   v2->vVelocity.y = 0;
   v2->vVelocity.x = 0;
   v2->uSpriteFrameID = 0;
-LABEL_27:
-  v133 = v9;
-  v131 = v9;
-  v130 = v9;
   v13 = 8 * v153;
-  v129 = v9;
-  v128 = -1;
   LOBYTE(v13) = PID(OBJECT_Item,v153);
-  v127 = v9;
-  v126 = v13;
-LABEL_28:
-  v125 = 8;
-LABEL_29:
-  pAudioPlayer->PlaySound((SoundID)v125, v126, v127, v128, v129, v130, v131, v133);
+  pAudioPlayer->PlaySound((SoundID)8, v13, v9, -1, v9, v9, v9, v9);
   return 0;
 }