changeset 822:c232f160e6f3

Named SpriteObject spell-related fields.
author Nomad
date Tue, 26 Mar 2013 17:56:24 +0200
parents 522591080ac5
children c1da83d8223f
files Actor.cpp Chest.cpp SpriteObject.cpp SpriteObject.h mm7_1.cpp mm7_2.cpp mm7_3.cpp mm7_4.cpp mm7_5.cpp mm7_6.cpp stru6.cpp
diffstat 11 files changed, 330 insertions(+), 329 deletions(-) [+]
line wrap: on
line diff
--- a/Actor.cpp	Tue Mar 26 14:55:43 2013 +0200
+++ b/Actor.cpp	Tue Mar 26 17:56:24 2013 +0200
@@ -594,15 +594,15 @@
               }
               a1.uObjectDescID = v11;
               a1.stru_24.Reset();
-              a1.field_48 = 15;
+              a1.spell_id = SPELL_AIR_SPARKS;
               v13 = v5->vPosition.x;
               v14 = v5->vPosition.y;
-              a1.field_4C = uSkillLevel;
+              a1.spell_level = uSkillLevel;
               a1.vPosition.x = v13;
               v15 = v5->vPosition.z + ((signed int)v5->uActorHeight >> 1);
               v16 = v117;
               v17 = LOWORD(v117->uYawAngle);
-              a1.field_50 = 0;
+              a1.spell_skill = 0;
               a1.vPosition.y = v14;
               a1.vPosition.z = v15;
               a1.uFacing = v17;
@@ -611,7 +611,7 @@
               a1.uSectorID = pIndoor->GetSector(v13, v14, v15);
               v18 = 8 * LODWORD(v120);
               LOBYTE(v18) = 8 * LOBYTE(v120) | AI_OBJECT_ACTOR;
-              a1.field_58_pid = v18;
+              a1.spell_caster_pid = v18;
               a1.uSpriteFrameID = 0;
               a1.field_5C = 0;
               a1.field_60_distance_related_prolly_lod = 3;
@@ -675,15 +675,15 @@
             }
             a1.uObjectDescID = v82;
             a1.stru_24.Reset();
-            a1.field_48 = spellnum;
+            a1.spell_id = spellnum;
             v83 = v5->vPosition.x;
             v84 = v5->vPosition.y;
-            a1.field_4C = uSkillLevel;
+            a1.spell_level = uSkillLevel;
             a1.vPosition.x = v83;
             v85 = v5->vPosition.z + ((signed int)v5->uActorHeight >> 1);
             v86 = v117;
             v87 = LOWORD(v117->uYawAngle);
-            a1.field_50 = 0;
+            a1.spell_skill = 0;
             a1.vPosition.y = v84;
             a1.vPosition.z = v85;
             a1.uFacing = v87;
@@ -696,7 +696,7 @@
             v90 = 8 * LODWORD(v120);
             LOBYTE(v90) = 8 * LOBYTE(v120) | OBJECT_Actor;
             a1.uSpriteFrameID = 0;
-            a1.field_58_pid = v90;
+            a1.spell_caster_pid = v90;
             a1.field_5C = 0;
             a1.field_60_distance_related_prolly_lod = 3;
             if ( (double)v89 >= 307.2 )
@@ -822,16 +822,16 @@
                 v34 = spellnumd;
               }
               a1.uObjectDescID = v34;
-              a1.field_4C = uSkillLevel;
+              a1.spell_level = uSkillLevel;
               a1.vPosition.x = v111;
               a1.vPosition.y = v113;
               a1.vPosition.z = v30 + v114;
-              a1.field_48 = 9;
-              a1.field_50 = 0;
+              a1.spell_id = SPELL_FIRE_METEOR_SHOWER;
+              a1.spell_skill = 0;
               a1.uAttributes = 0;
               a1.uSectorID = 0;
               a1.uSpriteFrameID = 0;
-              a1.field_58_pid = v116;
+              a1.spell_caster_pid = v116;
               a1.field_5C = 0;
               a1.field_60_distance_related_prolly_lod = stru_50C198._427546(v30 + 2500);
               a1.uFacing = v32;
@@ -1367,15 +1367,15 @@
   }
   a1.uObjectDescID = v71;
   a1.stru_24.Reset();
-  a1.field_48 = 93;
+  a1.spell_id = SPELL_DARK_SHARPMETAL;
   v73 = v5->vPosition.x;
   v74 = v5->vPosition.y;
-  a1.field_4C = uSkillLevel;
+  a1.spell_level = uSkillLevel;
   a1.vPosition.x = v73;
   v75 = v5->vPosition.z + ((signed int)v5->uActorHeight >> 1);
   v76 = v117;
   v77 = LOWORD(v117->uYawAngle);
-  a1.field_50 = 0;
+  a1.spell_skill = 0;
   a1.vPosition.y = v74;
   a1.vPosition.z = v75;
   a1.uFacing = v77;
@@ -1384,7 +1384,7 @@
   a1.uSectorID = pIndoor->GetSector(v73, v74, v75);
   v78 = 8 * LODWORD(v120);
   LOBYTE(v78) = 8 * LOBYTE(v120) | OBJECT_Actor;
-  a1.field_58_pid = v78;
+  a1.spell_caster_pid = v78;
   a1.uSpriteFrameID = 0;
   a1.field_5C = 0;
   a1.field_60_distance_related_prolly_lod = 3;
@@ -1567,11 +1567,11 @@
   a1.uObjectDescID = v8;
   a1.stru_24.Reset();
   a1.vPosition.x = v5->vPosition.x;
-  a1.field_48 = 0;
+  a1.spell_id = 0;
   a1.vPosition.y = v5->vPosition.y;
-  a1.field_4C = 0;
+  a1.spell_level = 0;
   v17 = v5->uActorHeight;
-  a1.field_50 = 0;
+  a1.spell_skill = 0;
   v9 = LOWORD(v4->uYawAngle);
   a1.vPosition.z = v5->vPosition.z - (unsigned int)(signed __int64)((double)v17 * -0.75);
   a1.uFacing = v9;
@@ -1583,7 +1583,7 @@
   v12 = 8 * v15;
   LOBYTE(v12) = 8 * v15 | AI_OBJECT_ACTOR;
   a1.uSpriteFrameID = 0;
-  a1.field_58_pid = v12;
+  a1.spell_caster_pid = v12;
   a1.field_5C = 0;
   if ( (double)v11 >= 307.2 )
   {
@@ -1674,11 +1674,11 @@
   a1.uObjectDescID = v4;
   a1.stru_24.Reset();
   a1.vPosition.y = v1->vPosition.y;
-  a1.field_48 = 0;
+  a1.spell_id = 0;
   v5 = v1->vPosition.x;
   v11 = v1->uActorHeight;
-  a1.field_4C = 0;
-  a1.field_50 = 0;
+  a1.spell_level = 0;
+  a1.spell_skill = 0;
   a1.vPosition.x = v5;
   v6 = v1->vPosition.z - (unsigned int)(signed __int64)((double)v11 * -0.75);
   a1.uFacing = 0;
@@ -1689,7 +1689,7 @@
   v7 = 8 * v10;
   LOBYTE(v7) = 8 * v10 | OBJECT_Actor;
   a1.uSpriteFrameID = 0;
-  a1.field_58_pid = v7;
+  a1.spell_caster_pid = v7;
   a1.field_5C = 0;
   a1.field_60_distance_related_prolly_lod = 3;
   a1.field_61 = 4;
--- a/Chest.cpp	Tue Mar 26 14:55:43 2013 +0200
+++ b/Chest.cpp	Tue Mar 26 17:56:24 2013 +0200
@@ -37,7 +37,7 @@
 
 //----- (0042041E) --------------------------------------------------------
 bool Chest::Open( signed int uChestID )
-    {
+{
   //char *v1; // edi@5
   unsigned int v2; // eax@8
   GUIWindow *v3; // eax@15
@@ -180,9 +180,9 @@
     a1.stru_24.Reset();
     v24 = *(short *)v23;
     v25 = 0;
-    a1.field_50 = 0;
-    a1.field_4C = 0;
-    a1.field_48 = 0;
+    a1.spell_skill = 0;
+    a1.spell_level = 0;
+    a1.spell_id = 0;
     a1.field_54 = 0;
     a1.uType = v24;
     if ( (signed int)pObjectList->uNumObjects <= 0 )
@@ -210,7 +210,7 @@
     a1.uAttributes = 48;
     a1.uSectorID = pIndoor->GetSector(pOut.x, pOut.z, pOut.y);
     a1.uSpriteFrameID = 0;
-    a1.field_58_pid = 0;
+    a1.spell_caster_pid = 0;
     a1.field_5C = 0;
     a1.uFacing = 0;
     a1.Create(0, 0, 0, 0);
--- a/SpriteObject.cpp	Tue Mar 26 14:55:43 2013 +0200
+++ b/SpriteObject.cpp	Tue Mar 26 17:56:24 2013 +0200
@@ -34,9 +34,9 @@
   field_60_distance_related_prolly_lod = 0;
   field_20 = 0;
   uSpriteFrameID = 0;
-  field_50 = 0;
-  field_4C = 0;
-  field_48 = 0;
+  spell_skill = 0;
+  spell_level = 0;
+  spell_id = 0;
   field_54 = 0;
 }
 
@@ -408,11 +408,11 @@
       v58 = v16;
       v18 = WorldPosToGridCellX(v17);
       _46E26D_collide_against_sprites(v18, v58);
-      if ( (v1->field_58_pid & 7) != OBJECT_Player)
+      if ( (v1->spell_caster_pid & 7) != OBJECT_Player)
         _46EF01_collision_chech_player(0);
-      if ( (v1->field_58_pid & 7) == OBJECT_Actor)
+      if ( (v1->spell_caster_pid & 7) == OBJECT_Actor)
       {
-        v19 = v1->field_58_pid >> 3;
+        v19 = v1->spell_caster_pid >> 3;
         if ( v19 >= 0 )
         {
           if ( v19 < (signed int)(uNumActors - 1) )
@@ -698,9 +698,9 @@
       {
         _46E44E_collide_against_faces_and_portals(0);
         _46E0B2_collide_against_decorations();
-        if ( (pSpriteObject->field_58_pid & 7) != OBJECT_Player)
+        if ( (pSpriteObject->spell_caster_pid & 7) != OBJECT_Player)
           _46EF01_collision_chech_player(1);
-        v13 = pSpriteObject->field_58_pid;
+        v13 = pSpriteObject->spell_caster_pid;
         v42 = v8;
         if ( (v13 & 7) == OBJECT_Actor)
         {
@@ -713,7 +713,7 @@
               //v14 = (signed __int64)((double)v41 * 0.3333333333333333);
               //v41 = *(short *)(v39 - 38) - 1;
               //if ( v14 != (unsigned int)(signed __int64)((double)v41 * 0.3333333333333333) )
-				if( pActors[pSpriteObject->field_58_pid >> 3].pMonsterInfo.uID != v39b->pMonsterInfo.uID )
+				if( pActors[pSpriteObject->spell_caster_pid >> 3].pMonsterInfo.uID != v39b->pMonsterInfo.uID )
 					//not sure: pMonsterList->pMonsters[v39b->word_000086_some_monster_id-1].uToHitRadius
 					_46DF1A_collide_against_actor(v42, *((short *)&pMonsterList->pMonsters[v39b->word_000086_some_monster_id] - 73));
               ++v42;
--- a/SpriteObject.h	Tue Mar 26 14:55:43 2013 +0200
+++ b/SpriteObject.h	Tue Mar 26 17:56:24 2013 +0200
@@ -36,11 +36,11 @@
   __int16 field_20;
   __int16 field_22_glow_radius_multiplier;
   struct ItemGen stru_24;
-  int field_48;
-  int field_4C;
-  int field_50;
+  int spell_id;
+  int spell_level;
+  int spell_skill;
   int field_54;
-  int field_58_pid;
+  int spell_caster_pid;
   int field_5C;
   char field_60_distance_related_prolly_lod;
   char field_61;
--- a/mm7_1.cpp	Tue Mar 26 14:55:43 2013 +0200
+++ b/mm7_1.cpp	Tue Mar 26 17:56:24 2013 +0200
@@ -813,7 +813,7 @@
 			}
 		  }
 		}
-		a1.field_58_pid = OBJECT_Player;
+		a1.spell_caster_pid = OBJECT_Player;
 		a1.uObjectDescID = v6;
 		a1.vPosition.y = pParty->vPosition.y;
 		a1.vPosition.x = pParty->vPosition.x;
@@ -1217,7 +1217,7 @@
 			}
 			a1.uObjectDescID = v6;
 			a1.vPosition.y = pParty->vPosition.y;
-			a1.field_58_pid = OBJECT_Player;
+			a1.spell_caster_pid = OBJECT_Player;
 			a1.vPosition.x = pParty->vPosition.x;
 			a1.vPosition.z = pParty->sEyelevel + pParty->vPosition.z;
 			a1.uSoundID = 0;
--- a/mm7_2.cpp	Tue Mar 26 14:55:43 2013 +0200
+++ b/mm7_2.cpp	Tue Mar 26 17:56:24 2013 +0200
@@ -4303,11 +4303,11 @@
   a1a.uFacing = 0;
   a1a.vPosition.z = a2->vPosition.z;
   a1a.vPosition.x = a2->vPosition.x;
-  a1a.field_50 = 0;
-  a1a.field_4C = 0;
-  a1a.field_48 = 0;
+  a1a.spell_skill = 0;
+  a1a.spell_level = 0;
+  a1a.spell_id = 0;
   a1a.field_5C = 0;
-  a1a.field_58_pid = 0;
+  a1a.spell_caster_pid = 0;
   a1a.uSpriteFrameID = 0;
   a1a.uSectorID = pIndoor->GetSector(a2->vPosition.x, a2->vPosition.y, a2->vPosition.z);;
   return a1a.Create(0, 0, 0, 0);
@@ -10991,9 +10991,9 @@
         {
           if ( stru_50C198.GetMagicalResistance(v2, 0xAu) )
           {
-			  v2->pActorBuffs[v1->field_48].Apply(
-              pParty->uTimePlayed + (signed int)(signed __int64)((double)(v1->field_4C << 7) * 0.033333335),
-              v1->field_50,
+			  v2->pActorBuffs[v1->spell_id].Apply(
+              pParty->uTimePlayed + (signed int)(signed __int64)((double)(v1->spell_level << 7) * 0.033333335),
+              v1->spell_skill,
               4u,
               0,
               0);
@@ -11170,12 +11170,12 @@
   v151 = a2 & 7;
   if ( (a2 & 7) == OBJECT_Actor)
   {
-    if ( (v2->field_58_pid & 7) == OBJECT_Actor && !pActors[v2->field_58_pid >> 3].GetActorsRelation(&pActors[a2 >> 3]) )
+    if ( (v2->spell_caster_pid & 7) == OBJECT_Actor && !pActors[v2->spell_caster_pid >> 3].GetActorsRelation(&pActors[a2 >> 3]) )
       return 1;
   }
   else
   {
-    if ( (a2 & 7) == OBJECT_Player && (v2->field_58_pid & 7) == OBJECT_Player)
+    if ( (a2 & 7) == OBJECT_Player && (v2->spell_caster_pid & 7) == OBJECT_Player)
       return 1;
   }
   if ( pParty->bTurnBasedModeOn == 1 )
@@ -11187,8 +11187,8 @@
       v2->uAttributes = v5 & 0xFFFB;
     }
   }
-  if ( v151 == OBJECT_BModel && (v2->field_58_pid & 7) != OBJECT_Player)
-    BYTE2(pActors[v2->field_58_pid >> 3].uAttributes) |= 4u;
+  if ( v151 == OBJECT_BModel && (v2->spell_caster_pid & 7) != OBJECT_Player)
+    BYTE2(pActors[v2->spell_caster_pid >> 3].uAttributes) |= 4u;
   v6 = v2->uType;
   v7 = v2->uType;
   if ( v7 > 3060 )
@@ -11246,7 +11246,7 @@
         v138 = 1;
         if ( v151 != OBJECT_Actor)
         {
-          if ( v6 != 9030 || v2->field_50 != 4 )
+          if ( v6 != 9030 || v2->spell_skill != 4 )
             goto LABEL_246;
           v2->_46BEF1_apply_spells();
 LABEL_233:
@@ -11303,9 +11303,9 @@
         v106 = v145;
         v150 = 0;
         v139 = v106 >> 3;
-        v137 = v2->field_4C;
-        v152 = v2->field_50;
-        v136 = v2->field_48;
+        v137 = v2->spell_level;
+        v152 = v2->spell_skill;
+        v136 = v2->spell_id;
         if ( v6 == 9030 )
         {
           v150 = 2;
@@ -11359,9 +11359,9 @@
               {
                 v2->_46BEF1_apply_spells();
               }
-              v2->field_4C = 0;
-              v2->field_50 = 0;
-              v2->field_48 = 0;
+              v2->spell_level = 0;
+              v2->spell_skill = 0;
+              v2->spell_id = 0;
               goto LABEL_233;
             }
             v135 = 10;
@@ -11469,7 +11469,7 @@
             v127 = v9;
             v126 = v124;
 LABEL_268:
-            v116 = word_4EE088_sound_ids[v2->field_48];
+            v116 = word_4EE088_sound_ids[v2->spell_id];
 LABEL_269:
             v125 = v116 + 1;
             goto LABEL_29;
@@ -11502,7 +11502,7 @@
           if ( !v63 )
             SpriteObject::OnInteraction(v153);
           v64 = v2->uFacing - stru_5C6E00->uIntegerDoublePi;
-          v44 = v2->field_50 == 4;
+          v44 = v2->spell_skill == 4;
           v2->vVelocity.z = 0;
           v2->vVelocity.y = 0;
           v2->vVelocity.x = 0;
--- a/mm7_3.cpp	Tue Mar 26 14:55:43 2013 +0200
+++ b/mm7_3.cpp	Tue Mar 26 17:56:24 2013 +0200
@@ -13787,9 +13787,9 @@
       case 41:
         a1.stru_24.Reset();
         v16 = 0;
-        a1.field_48 = spellnum;
-        a1.field_4C = level;
-        a1.field_50 = v15;
+        a1.spell_id = spellnum;
+        a1.spell_level = level;
+        a1.spell_skill = v15;
         if ( (signed int)pObjectList->uNumObjects <= 0 )
           goto LABEL_34;
         v17 = (char *)&pObjectList->pObjects->uObjectID;
@@ -13825,9 +13825,9 @@
           a8b = a7c / (v60 - 1);
           a1.stru_24.Reset();
           v21 = 0;
-          a1.field_48 = spellnum;
-          a1.field_4C = level;
-          a1.field_50 = v15;
+          a1.spell_id = spellnum;
+          a1.spell_level = level;
+          a1.spell_skill = v15;
           if ( (signed int)pObjectList->uNumObjects <= 0 )
           {
 LABEL_41:
@@ -13852,7 +13852,7 @@
           a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz);
           a1.field_60_distance_related_prolly_lod = v55;
           a1.uSpriteFrameID = 0;
-          a1.field_58_pid = 8000 | OBJECT_Item;
+          a1.spell_caster_pid = 8000 | OBJECT_Item;
           a1.field_5C = 4;
           a1.uSoundID = 0;
           for ( i = a7c / -2; i <= a7c / 2; i += a8b )
@@ -13868,9 +13868,9 @@
         }
         a1.stru_24.Reset();
         v16 = 0;
-        a1.field_48 = spellnum;
-        a1.field_4C = level;
-        a1.field_50 = v15;
+        a1.spell_id = spellnum;
+        a1.spell_level = level;
+        a1.spell_skill = v15;
         if ( (signed int)pObjectList->uNumObjects <= 0 )
           goto LABEL_34;
         v19 = (char *)&pObjectList->pObjects->uObjectID;
@@ -13893,7 +13893,7 @@
         a1.field_60_distance_related_prolly_lod = v55;
         v20 = yaw;
         a1.uSpriteFrameID = 0;
-        a1.field_58_pid = 8000 | OBJECT_Item;
+        a1.spell_caster_pid = 8000 | OBJECT_Item;
         a1.field_5C = 0;
         a1.uFacing = yaw;
         a1.uSoundID = 0;
@@ -13921,9 +13921,9 @@
         a8c = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360 / (v60 - 1);
         a1.stru_24.Reset();
         v25 = 0;
-        a1.field_48 = spellnum;
-        a1.field_4C = level;
-        a1.field_50 = v15;
+        a1.spell_id = spellnum;
+        a1.spell_level = level;
+        a1.spell_skill = v15;
         if ( (signed int)pObjectList->uNumObjects <= 0 )
           goto LABEL_59;
         v26 = (char *)&pObjectList->pObjects->uObjectID;
@@ -13947,7 +13947,7 @@
         a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz);
         a1.field_60_distance_related_prolly_lod = v55;
         a1.uSpriteFrameID = 0;
-        a1.field_58_pid = 8000 | OBJECT_Item;
+        a1.spell_caster_pid = 8000 | OBJECT_Item;
         a1.field_5C = 4;
         a1.uSoundID = 0;
         for ( j = a7d / -2; j <= a7d / 2; j += a8c )
@@ -13965,9 +13965,9 @@
           return;
         a1.stru_24.Reset();
         v29 = 0;
-        a1.field_48 = spellnum;
-        a1.field_4C = level;
-        a1.field_50 = v15;
+        a1.spell_id = spellnum;
+        a1.spell_level = level;
+        a1.spell_skill = v15;
         if ( (signed int)pObjectList->uNumObjects <= 0 )
           goto LABEL_70;
         v30 = (char *)&pObjectList->pObjects->uObjectID;
@@ -14101,7 +14101,7 @@
     a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz);
     a1.field_60_distance_related_prolly_lod = v55;
     a1.uSpriteFrameID = 0;
-    a1.field_58_pid = 8000 | OBJECT_Item;
+    a1.spell_caster_pid = 8000 | OBJECT_Item;
     a1.field_5C = 4;
     a1.uSoundID = 0;
     v51 = 0;
--- a/mm7_4.cpp	Tue Mar 26 14:55:43 2013 +0200
+++ b/mm7_4.cpp	Tue Mar 26 17:56:24 2013 +0200
@@ -2074,11 +2074,11 @@
       a3.y = 0;
       a3.x = 0;
       a1.stru_24.Reset();
-      a1.field_4C = pParty->pPartyBuffs[10].uPower;
-      a1.field_50 = pParty->ImmolationSkillLevel();
+      a1.spell_level = pParty->pPartyBuffs[PARTY_BUFF_IMMOLATION].uPower;
+      a1.spell_skill = pParty->ImmolationSkillLevel();
       v10 = 0;
       a1.uType = 1070;
-      a1.field_48 = 8;
+      a1.spell_id = SPELL_FIRE_IMMOLATION;
       if ( (signed int)pObjectList->uNumObjects <= 0 )
       {
 LABEL_19:
@@ -2102,7 +2102,7 @@
       a1.uAttributes = 0;
       a1.uSectorID = 0;
       a1.uSpriteFrameID = 0;
-      a1.field_58_pid = v12;
+      a1.spell_caster_pid = v12;
       a1.uFacing = 0;
       a1.uSoundID = 0;
       v13 = sub_46A89E((int)v41, 100, 307);
--- a/mm7_5.cpp	Tue Mar 26 14:55:43 2013 +0200
+++ b/mm7_5.cpp	Tue Mar 26 17:56:24 2013 +0200
@@ -4540,7 +4540,7 @@
       {
         v4 = &pSpriteObjects[v3];
         v36 = v4;
-        v5 = v4->field_58_pid;
+        v5 = v4->spell_caster_pid;
         v2 = v5 & 7;
         v3 = v5 >> 3;
       }
@@ -4781,7 +4781,7 @@
     v4 = &pSpriteObjects[a1 >> 3];
     //uDamageAmount = (int)v4;
     v61 = v4->field_60_distance_related_prolly_lod;
-    a1 = v4->field_58_pid;
+    a1 = v4->spell_caster_pid;
     //v54 = v4->field_58_pid;
   }
   //v5 = a1 & 7;
@@ -4850,7 +4850,7 @@
   }
 
 
-  v19 = v4->field_48 == 99;
+  v19 = v4->spell_id == SPELL_DARK_SOULDRINKER;
   v61 = v4->field_60_distance_related_prolly_lod;
   if ( !v19 )
   {
@@ -4897,8 +4897,8 @@
     v4 = (SpriteObject *)uDamageAmount;
   }
 
-  v15 = v4->field_48;
-  if ( v15 == 102 )
+  v15 = v4->spell_id;
+  if ( v15 == SPELL_LASER_PROJECTILE )
   {
     v16 = player->pActiveSkills[7];
     v61 = 1;
@@ -4908,9 +4908,9 @@
     uDamageAmount = player->CalculateMeleeDamageTo(1, 1, 0);
     goto LABEL_67;
   }
-  if ( v15 != 100 )
-  {
-    if ( v15 == 101 )
+  if ( v15 != SPELL_BOW_ARROW )
+  {
+    if ( v15 == SPELL_101 )
     {
       a2 = 0;
       v18 = player->CalculateRangedDamageTo(0);
@@ -4922,14 +4922,14 @@
       v59 = 1;
       goto LABEL_67;
     }
-    if ( v15 == 39 )
-    {
-      a4 = 5 * v4->field_4C;
+    if ( v15 == SPELL_EARTH_BLADES )
+    {
+      a4 = 5 * v4->spell_level;
       a2 = player->GetSpellSchool(0x27u);
-      v21 = v4->field_4C;
+      v21 = v4->spell_level;
       v50 = pMonster->sCurrentHP;
-      pMonsterName = (char *)v4->field_50;
-      v22 = _43AFE3_calc_spell_damage(39, v21, (signed int)pMonsterName, v50);
+      pMonsterName = (char *)v4->spell_skill;
+      v22 = _43AFE3_calc_spell_damage(39, v21, v4->spell_skill, v50);
       v23 = HIDWORD(pMonster->pActorBuffs[15].uExpireTime) == 0;
       v24 = SHIDWORD(pMonster->pActorBuffs[15].uExpireTime) < 0;
       uDamageAmount = v22;
@@ -4945,24 +4945,23 @@
       }
       goto LABEL_69;
     }
-    if ( v15 == 34 )
+    if ( v15 == SPELL_EARTH_STUN )
     {
       uDamageAmount = 0;
       a2 = 4;
       hit_will_stun = 1;
       goto LABEL_67;
     }
-    v50 = v4->field_48;
-    a2 = player->GetSpellSchool(v50);
-    v25 = v4->field_4C;
-    v26 = v4->field_48;
+    a2 = player->GetSpellSchool(v4->spell_id);
+    v25 = v4->spell_level;
+    v26 = v4->spell_id;
     v50 = pMonster->sCurrentHP;
-    pMonsterName = (char *)v4->field_50;
+    pMonsterName = (char *)v4->spell_skill;
     //v27 = _43AFE3_calc_spell_damage(v26, v25, (signed int)pMonsterName, v50);
     v59 = 0;
     //v57 = (PlayerEquipment *)1;
 //LABEL_65:
-    uDamageAmount = _43AFE3_calc_spell_damage(v26, v25, (signed int)pMonsterName, v50);
+    uDamageAmount = _43AFE3_calc_spell_damage(v26, v25, v4->spell_skill, v50);
     //if ( !v57 )
     //  goto LABEL_67;
     goto LABEL_69;
@@ -5450,10 +5449,10 @@
     return;
   }
   v37 = &pSpriteObjects[uActorID];
-  v38 = v37->field_58_pid & 7;
-  v39 = v37->field_58_pid >> 3;
-  v40 = v37->field_58_pid & 7;
-  uActorID = v37->field_58_pid >> 3;
+  v38 = v37->spell_caster_pid & 7;
+  v39 = v37->spell_caster_pid >> 3;
+  v40 = v37->spell_caster_pid & 7;
+  uActorID = v37->spell_caster_pid >> 3;
   v41 = v40 - 2;
   if ( !v41 )
     goto LABEL_80;
@@ -5639,11 +5638,11 @@
     v43 = &pParty->pPlayers[a4];
 LABEL_168:
     a4b = v43;
-    if ( v38 != OBJECT_Player || v37->field_48 != 100 )
+    if ( v38 != OBJECT_Player || v37->spell_id != SPELL_BOW_ARROW)
     {
       v70 = v43->GetMaxHealth();
-      v68 = _43AFE3_calc_spell_damage(v37->field_48, v37->field_4C, v37->field_50, v70);
-      v69 = LOBYTE(pSpellStats->pInfos[v37->field_48].uSchool);
+      v68 = _43AFE3_calc_spell_damage(v37->spell_id, v37->spell_level, v37->spell_skill, v70);
+      v69 = LOBYTE(pSpellStats->pInfos[v37->spell_id].uSchool);
     }
     else
     {
@@ -5690,7 +5689,7 @@
   v6 = uLayingItemID;
   v2 = uLayingItemID;
   v3 = a2 >> 3;
-  v4 = pSpriteObjects[uLayingItemID].field_58_pid & 7;
+  v4 = pSpriteObjects[uLayingItemID].spell_caster_pid & 7;
   v5 = (a2 & 7) - 3;
   if ( v5 )
   {
@@ -5864,10 +5863,10 @@
     if ( (a2 & 7) == OBJECT_Item)
     {
       v4 = &pSpriteObjects[(signed int)a2 >> 3];
-      v5 = v4->field_48;
+      v5 = v4->spell_id;
       if ( v5 )
       {
-        v6 = _43AFE3_calc_spell_damage(v5, v4->field_4C, v4->field_50, pActor->sCurrentHP);
+        v6 = _43AFE3_calc_spell_damage(v5, v4->spell_level, v4->spell_skill, pActor->sCurrentHP);
         v7 = stru_50C198.CalcMagicalDamageToActor(pActor, 0, v6);
         pActor->sCurrentHP -= v7;
         if ( v7 )
@@ -5924,7 +5923,7 @@
   {
     v5 = &pSpriteObjects[a1 >> 3];
     v4 = v5->field_60_distance_related_prolly_lod;
-    v17 = v5->field_58_pid;
+    v17 = v5->spell_caster_pid;
   }
   LOWORD(v6) = v17 & 7;
   if ( v6 == OBJECT_Actor)
--- a/mm7_6.cpp	Tue Mar 26 14:55:43 2013 +0200
+++ b/mm7_6.cpp	Tue Mar 26 17:56:24 2013 +0200
@@ -2466,13 +2466,13 @@
   //char v9; // al@44
   //int v10; // eax@45
   unsigned __int16 v11; // cx@45
-  signed int v12; // ecx@48
+  //signed int v12; // ecx@48
   //int v13; // eax@53
   unsigned __int8 v14; // zf@53
   //unsigned int v15; // edx@53
   //signed int v16; // eax@53
   Player *v17; // esi@70
-  int v18; // eax@72
+  //int v18; // eax@72
   int v19; // eax@74
   char *v20; // eax@74
   signed int i; // esi@76
@@ -2504,7 +2504,7 @@
   unsigned int v47; // edx@133
   int v48; // eax@137
   int v49; // eax@137
-  int v50; // eax@141
+  //int v50; // eax@141
   int v51; // eax@146
   __int16 v52; // ax@153
   int v53; // eax@153
@@ -3299,7 +3299,6 @@
 
     if ( HIBYTE(v11) & 1 )
     {
-      v12 = 4;
       v731 = 4;
     }
     else
@@ -3312,15 +3311,14 @@
       {
         v731 = 3;
       }
-      v12 = v731;
     }
 
     v730 = v3->spellnum;
     if (v3->forced_spell_skill_level)
       uRequiredMana = 0;
     else 
-      uRequiredMana = pSpellDatas[v3->spellnum].mana_per_skill[v12 - 1];
-    sRecoveryTime = pSpellDatas[v3->spellnum].recovery_per_skill[v12 - 1];
+      uRequiredMana = pSpellDatas[v3->spellnum].mana_per_skill[v731 - 1];
+    sRecoveryTime = pSpellDatas[v3->spellnum].recovery_per_skill[v731 - 1];
 
     if (LODWORD(v725) == PLAYER_SKILL_DARK && pParty->uCurrentHour == 0 && pParty->uCurrentMinute == 0 ||
         LODWORD(v725) == PLAYER_SKILL_LIGHT && pParty->uCurrentHour == 12 && pParty->uCurrentMinute == 0)
@@ -3376,10 +3374,9 @@
           _this = (ItemGen *)2;
         sRecoveryTime = v17->GetAttackRecoveryTime(true);
         a1.stru_24.Reset();
-        v18 = v3->spellnum;
-        a1.field_4C = v2;
-        a1.field_48 = v18;
-        a1.field_50 = v731;
+        a1.spell_level = v2;
+        a1.spell_id = v3->spellnum;
+        a1.spell_skill = v731;
         a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType);
         if ( v17->WearsItem(510, 2) )
           a1.uObjectDescID = pObjectList->ObjectIDByItemID(0xBD6u);
@@ -3390,7 +3387,7 @@
         a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3;
         v19 = 8 * v3->uPlayerID;
         LOBYTE(v19) = v19 | OBJECT_Player;
-        a1.field_58_pid = v19;
+        a1.spell_caster_pid = v19;
         a1.field_5C = a2;
         a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance);
         a1.uFacing = LOWORD(v715.uYawAngle);
@@ -3418,9 +3415,9 @@
       case SPELL_LASER_PROJECTILE:
         sRecoveryTime = pPlayer->GetAttackRecoveryTime(0);
         a1.stru_24.Reset();
-        a1.field_48 = v3->spellnum;
-        a1.field_4C = v723;
-        a1.field_50 = v731;
+        a1.spell_id = v3->spellnum;
+        a1.spell_level = v723;
+        a1.spell_skill = v731;
         a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType);
         a1.vPosition.x = pParty->vPosition.x;
         a1.vPosition.y = pParty->vPosition.y;
@@ -3429,7 +3426,7 @@
         a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 2;
         v22 = 8 * v3->uPlayerID;
         LOBYTE(v22) = v22 | OBJECT_Player;
-        a1.field_58_pid = v22;
+        a1.spell_caster_pid = v22;
         a1.field_5C = a2;
         a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance);
         a1.uFacing = LOWORD(v715.uYawAngle);
@@ -3457,7 +3454,7 @@
       case SPELL_FIRE_TORCH_LIGHT:
         LODWORD(v733) = 3600 * v2;
 
-        switch (v12)
+        switch (v731)
         {
           case 1: amount = 2; break;
           case 2: amount = 3; break;
@@ -3474,7 +3471,7 @@
         goto LABEL_1056;
 
       case SPELL_FIRE_FIRE_SPIKE:
-        v29 = v12 - 2;
+        v29 = v731 - 2;
         if ( v29 )
         {
           v30 = v29 - 1;
@@ -3503,7 +3500,7 @@
         for (uint i = 0; i < uNumSpriteObjects; ++i)
         {
           auto object = pSpriteObjects + i;
-          if (object->uType && object->field_48 == 7 && object->field_58_pid == 8 * (int)v3->uPlayerID | OBJECT_Player)
+          if (object->uType && object->spell_id == SPELL_FIRE_FIRE_SPIKE && object->spell_caster_pid == (8 * (int)v3->uPlayerID) | OBJECT_Player)
             ++HIDWORD(v733);
           /*v33 = (char *)&pSpriteObjects[0].field_48;
           v730 = uNumSpriteObjects;
@@ -3526,9 +3523,9 @@
           goto play_sound_and_continue;
 
         a1.stru_24.Reset();
-        a1.field_48 = v3->spellnum;
-        a1.field_4C = v2;
-        a1.field_50 = v731;
+        a1.spell_id = v3->spellnum;
+        a1.spell_level = v2;
+        a1.spell_skill = v731;
         a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType);
         a1.vPosition.y = pParty->vPosition.y;
         a1.vPosition.x = pParty->vPosition.x;
@@ -3541,7 +3538,7 @@
         a1.uSpriteFrameID = 0;
         v34 = 8 * v3->uPlayerID;
         LOBYTE(v34) = v34 | OBJECT_Player;
-        a1.field_58_pid = v34;
+        a1.spell_caster_pid = v34;
         a1.field_5C = a2;
         a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance);
         a1.uFacing = LOWORD(v715.uYawAngle);
@@ -3568,9 +3565,9 @@
         v698 = 0;
         v697 = 0;
         a1.stru_24.Reset();
-        a1.field_48 = v3->spellnum;
-        a1.field_4C = v2;
-        a1.field_50 = v731;
+        a1.spell_id = v3->spellnum;
+        a1.spell_level = v2;
+        a1.spell_skill = v731;
         a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType);
         a1.uAttributes = 0;
         a1.uSectorID = 0;
@@ -3580,7 +3577,7 @@
         v37 *= 8;
         LOBYTE(v37) = v37 | OBJECT_Player;
         a1.uFacing = 0;
-        a1.field_58_pid = v37;
+        a1.spell_caster_pid = v37;
         v38 = a2 >> 3;
         a1.uSoundID = LOWORD(v3->field_10);
         v39 = a2 >> 3;
@@ -3607,9 +3604,9 @@
         v705 = 0;
         v704 = 0;
         a1.stru_24.Reset();
-        a1.field_48 = v3->spellnum;
-        a1.field_4C = v2;
-        a1.field_50 = v731;
+        a1.spell_id = v3->spellnum;
+        a1.spell_level = v2;
+        a1.spell_skill = v731;
         a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType);
         a1.uAttributes = 0;
         a1.uSectorID = 0;
@@ -3620,7 +3617,7 @@
         v44 *= 8;
         LOBYTE(v44) = v44 | OBJECT_Player;
         v38 = (signed int)v726;
-        a1.field_58_pid = v44;
+        a1.spell_caster_pid = v44;
         a1.uSoundID = LOWORD(v3->field_10);
         a1.vPosition.x = *(__int16 *)((char *)&pActors[0].vPosition.x + HIDWORD(v733));
         v45 = *(__int16 *)((char *)&pActors[0].vPosition.y + HIDWORD(v733));
@@ -3644,9 +3641,9 @@
         v692 = 0;
         v691 = 0;
         a1.stru_24.Reset();
-        a1.field_48 = v3->spellnum;
-        a1.field_4C = v2;
-        a1.field_50 = v731;
+        a1.spell_id = v3->spellnum;
+        a1.spell_level = v2;
+        a1.spell_skill = v731;
         a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType);
         a1.vPosition.x = *(short *)(HIDWORD(v733) + 142);
         a1.vPosition.y = *(short *)(HIDWORD(v733) + 144);
@@ -3657,7 +3654,7 @@
         a1.uSpriteFrameID = 0;
         v49 = 8 * v3->uPlayerID;
         LOBYTE(v49) = v49 | OBJECT_Player;
-        a1.field_58_pid = v49;
+        a1.spell_caster_pid = v49;
         a1.field_5C = a2;
         a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance);
         a1.uFacing = LOWORD(v715.uYawAngle);
@@ -3677,38 +3674,40 @@
 LABEL_139:
         DamageMonsterFromParty(8 * v42 | 2, v47, v670);
         goto LABEL_1056;
+
+
       case SPELL_FIRE_FIRE_BOLT:
-      case 6:
-      case 11:
-      case 18:
-      case 26:
-      case 32:
-      case 34:
-      case 37:
-      case 57:
-      case 65:
-      case 70:
-      case 78:
-      case 97:
+      case SPELL_FIRE_FIREBALL:
+      case SPELL_FIRE_INCINERATE:
+      case SPELL_AIR_LIGHNING_BOLT:
+      case SPELL_WATER_ICE_BOLT:
+      case SPELL_WATER_ICE_BLAST:
+      case SPELL_EARTH_STUN:
+      case SPELL_EARTH_DEADLY_SWARM:
+      case SPELL_MIND_MIND_BLAST:
+      case SPELL_MIND_PSYCHIC_SHOCK:
+      case SPELL_BODY_HARM:
+      case SPELL_LIGHT_LIGHT_BOLT:
+      case SPELL_DARK_DRAGON_BREATH:
         if ( !pPlayer->CanCastSpell(uRequiredMana) )
           goto play_sound_and_continue;
         a1.stru_24.Reset();
-        a1.field_48 = v3->spellnum;
-        a1.field_4C = v2;
-        a1.field_50 = v731;
+        a1.spell_id = v3->spellnum;
+        a1.spell_level = v2;
+        a1.spell_skill = v731;
         a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType);
         a1.vPosition.y = pParty->vPosition.y;
         a1.vPosition.x = pParty->vPosition.x;
         a1.uAttributes = 0;
         a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3;
-        a1.uSectorID = pIndoor->GetSector(
-                         pParty->vPosition.x,
-                         pParty->vPosition.y,
-                         pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3);
+        if (uCurrentlyLoadedLevelType == LEVEL_Indoor)
+          a1.uSectorID = pIndoor->GetSector(pParty->vPosition.x,
+                                            pParty->vPosition.y,
+                                            pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3);
+        else a1.uSectorID = 0;
+
         a1.uSpriteFrameID = 0;
-        v50 = 8 * v3->uPlayerID;
-        LOBYTE(v50) = v50 | OBJECT_Player;
-        a1.field_58_pid = v50;
+        a1.spell_caster_pid = (8 * v3->uPlayerID) | OBJECT_Player;
         a1.field_5C = a2;
         a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance);
         a1.uFacing = LOWORD(v715.uYawAngle);
@@ -3718,6 +3717,9 @@
         if ( v3->spellnum == 18 )
           LOBYTE(a1.uAttributes) |= 0x40u;
         goto LABEL_156;
+
+
+
       case 29:
       case 39:
       case 76:
@@ -3725,9 +3727,9 @@
         if ( !pPlayer->CanCastSpell(uRequiredMana) )
           goto play_sound_and_continue;
         a1.stru_24.Reset();
-        a1.field_48 = v3->spellnum;
-        a1.field_4C = v2;
-        a1.field_50 = v731;
+        a1.spell_id = v3->spellnum;
+        a1.spell_level = v2;
+        a1.spell_skill = v731;
         a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType);
         v51 = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 2;
         a1.vPosition.y = pParty->vPosition.y;
@@ -3766,19 +3768,19 @@
         v661 = (Actor *)v55;
         goto LABEL_165;
       case 35:
-        if ( v12 == 2 )
+        if ( v731 == 2 )
         {
           v57 = 300 * v2;
         }
         else
         {
-          if ( v12 == 3 )
+          if ( v731 == 3 )
           {
             amount = 4;
             v57 = 300 * v2;
             goto LABEL_174;
           }
-          if ( v12 == 4 )
+          if ( v731 == 4 )
           {
             v57 = 300 * v2;
             amount = 8;
@@ -3836,9 +3838,9 @@
           pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335),
           v731, 0, 0, 0);
         a1.stru_24.Reset();
-        a1.field_48 = v3->spellnum;
-        a1.field_4C = v2;
-        a1.field_50 = v731;
+        a1.spell_id = v3->spellnum;
+        a1.spell_level = v2;
+        a1.spell_skill = v731;
         v60 = pObjectList->ObjectIDByItemID(a1.uType);
         v61 = a2 >> 3;
         goto LABEL_1086;
@@ -3858,17 +3860,17 @@
         a1.uSpriteFrameID = 0;
         v62 = 8 * v3->uPlayerID;
         LOBYTE(v62) = v62 | OBJECT_Player;
-        a1.field_58_pid = v62;
+        a1.spell_caster_pid = v62;
         a1.field_5C = a2;
         a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance);
         a1.uFacing = LOWORD(v715.uYawAngle);
         a1.uSoundID = LOWORD(v3->field_10);
-        a1.field_50 = v731;
-        a1.field_48 = 3;
-        a1.field_4C = 300 * v2;
+        a1.spell_skill = v731;
+        a1.spell_id = SPELL_FIRE_PROTECTION_FROM_FIRE;
+        a1.spell_level = 300 * v2;
         goto LABEL_154;
       case 4:
-        v63 = v12 - 1;
+        v63 = v731 - 1;
         if ( !v63 )
         {
           amount = 10;
@@ -3987,7 +3989,7 @@
         goto LABEL_203;
 
       case SPELL_BODY_REGENERATION:
-        v70 = v12 - 1;
+        v70 = v731 - 1;
         LODWORD(v733) = 3600 * v2;
         if ( v70 && (v71 = v70 - 1) != 0 )
         {
@@ -4020,7 +4022,7 @@
       case SPELL_EARTH_PROTECTION_FROM_EARTH:
       case SPELL_MIND_PROTECTION_FROM_MIND:
       case SPELL_BODY_PROTECTION_FROM_BODY:
-        v76 = v12 - 1;
+        v76 = v731 - 1;
         LODWORD(v733) = 3600 * v2;
         if ( v76 )
         {
@@ -4090,21 +4092,21 @@
         goto play_sound_and_continue;
 
       case SPELL_FIRE_HASTE:
-        if ( v12 <= 0 )
+        if ( v731 <= 0 )
           goto LABEL_254;
-        if ( v12 <= 2 )
+        if ( v731 <= 2 )
         {
           v91 = 60 * (v2 + 60);
         }
         else
         {
-          if ( v12 == 3 )
+          if ( v731 == 3 )
           {
             v91 = 180 * (v2 + 20);
           }
           else
           {
-            if ( v12 != 4 )
+            if ( v731 != 4 )
               goto LABEL_254;
             v91 = 240 * (v2 + 15);
           }
@@ -4136,7 +4138,7 @@
         goto play_sound_and_continue;
 
       case SPELL_SPIRIT_BLESS:
-        v101 = v12 - 1;
+        v101 = v731 - 1;
         if ( v101 && (v102 = v101 - 1) != 0 )
         {
           v103 = v102 - 1;
@@ -4234,9 +4236,9 @@
             v701 = 0;
             a1.stru_24.Reset();
             v119 = HIDWORD(v733);
-            a1.field_48 = *(int *)HIDWORD(v733);
-            a1.field_4C = v723;
-            a1.field_50 = v731;
+            a1.spell_id = *(int *)HIDWORD(v733);
+            a1.spell_level = v723;
+            a1.spell_skill = v731;
             a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType);
             a1.uAttributes = 0;
             a1.uSectorID = 0;
@@ -4244,7 +4246,7 @@
             v120 = 8 * *(short *)(v119 + 2);
             LOBYTE(v120) = v120 | OBJECT_Player;
             a1.field_60_distance_related_prolly_lod = 0;
-            a1.field_58_pid = v120;
+            a1.spell_caster_pid = v120;
             a1.uFacing = 0;
             a1.uSoundID = *(short *)(v119 + 16);
             a1.vPosition.x = v112->vPosition.x;
@@ -4271,7 +4273,7 @@
       case SPELL_AIR_SHIELD:
       case SPELL_EARTH_STONESKIN:
       case SPELL_SPIRIT_HEROISM:
-        v123 = v12 - 1;
+        v123 = v731 - 1;
         if ( v123 && (v124 = v123 - 1) != 0 )
         {
           v125 = v124 - 1;
@@ -4328,7 +4330,7 @@
         goto play_sound_and_continue;
 
       case SPELL_FIRE_IMMOLATION:
-        v138 = v12 - 2;
+        v138 = v731 - 2;
         if ( v138 && (v139 = v138 - 1) != 0 && v139 == 1 )
           v140 = 600 * v2;
         else
@@ -4348,7 +4350,7 @@
         goto LABEL_1056;
 
       case 9:
-        v149 = v12 - 1;
+        v149 = v731 - 1;
         if ( v149 && (v150 = v149 - 1) != 0 && (v151 = v150 - 1) != 0 )
         {
           if ( v151 == 1 )
@@ -4417,9 +4419,9 @@
                        stru_5C6E00->Atan2((signed __int64)v718, (signed __int64)*(float *)&v721));
             }
             a1.stru_24.Reset();
-            a1.field_48 = v3->spellnum;
-            a1.field_4C = v2;
-            a1.field_50 = v731;
+            a1.spell_id = v3->spellnum;
+            a1.spell_level = v2;
+            a1.spell_skill = v731;
             a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType);
             a1.uAttributes = 0;
             a1.vPosition.x = uRequiredMana;
@@ -4427,7 +4429,7 @@
             a1.uSectorID = 0;
             a1.vPosition.z = a2 + v713;
             a1.uSpriteFrameID = 0;
-            a1.field_58_pid = 8 * v3->uPlayerID | OBJECT_Player;
+            a1.spell_caster_pid = 8 * v3->uPlayerID | OBJECT_Player;
             a1.field_5C = v730;
             a1.field_60_distance_related_prolly_lod = stru_50C198._427546(a2 + 2500);
             a1.uFacing = v687;
@@ -4465,9 +4467,9 @@
         v700.y = 0;
         v700.x = 0;
         a1.stru_24.Reset();
-        a1.field_48 = v3->spellnum;
-        a1.field_4C = v2;
-        a1.field_50 = v731;
+        a1.spell_id = v3->spellnum;
+        a1.spell_level = v2;
+        a1.spell_skill = v731;
         a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType);
         a1.uAttributes = 0;
         a1.uSectorID = 0;
@@ -4477,7 +4479,7 @@
         a1.uFacing = 0;
         v161 *= 8;
         LOBYTE(v161) = v161 | OBJECT_Player;
-        a1.field_58_pid = v161;
+        a1.spell_caster_pid = v161;
         a1.uSoundID = LOWORD(v3->field_10);
         a2 = 0;
         if ( (signed int)v726 > 0 )
@@ -4521,7 +4523,7 @@
         goto LABEL_1056;
 
       case SPELL_AIR_FEATHER_FALL:
-        v170 = v12 - 1;
+        v170 = v731 - 1;
         if ( !v170 )
         {
           v173 = 300 * v2;
@@ -4557,7 +4559,7 @@
         goto play_sound_and_continue;
 
       case SPELL_AIR_SPARKS:
-        v184 = v12 - 1;
+        v184 = v731 - 1;
         if ( v184 )
         {
           v185 = v184 - 1;
@@ -4588,9 +4590,9 @@
         v726 = (Player *)((signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360);
         v732 = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360 / (amount - 1);
         a1.stru_24.Reset();
-        a1.field_48 = v3->spellnum;
-        a1.field_4C = v2;
-        a1.field_50 = v731;
+        a1.spell_id = v3->spellnum;
+        a1.spell_level = v2;
+        a1.spell_skill = v731;
         a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType);
         a1.vPosition.y = pParty->vPosition.y;
         a1.vPosition.x = pParty->vPosition.x;
@@ -4603,7 +4605,7 @@
         a1.uSpriteFrameID = 0;
         v187 = 8 * v3->uPlayerID;
         LOBYTE(v187) = v187 | OBJECT_Player;
-        a1.field_58_pid = v187;
+        a1.spell_caster_pid = v187;
         a1.field_5C = a2;
         a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance);
         a1.uSoundID = LOWORD(v3->field_10);
@@ -4642,7 +4644,7 @@
         goto LABEL_1056;
 
       case SPELL_AIR_INVISIBILITY:
-        v192 = v12 - 1;
+        v192 = v731 - 1;
         if ( !v192 )
         {
           amount = v2;
@@ -4784,9 +4786,9 @@
                      stru_5C6E00->Atan2((signed __int64)v727, (signed __int64)*(float *)&uRequiredMana));
           }
           a1.stru_24.Reset();
-          a1.field_48 = v3->spellnum;
-          a1.field_4C = v2;
-          a1.field_50 = v731;
+          a1.spell_id = v3->spellnum;
+          a1.spell_level = v2;
+          a1.spell_skill = v731;
           a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType);
           a1.uAttributes = 0;
           a1.vPosition.x = LODWORD(v718);
@@ -4794,7 +4796,7 @@
           a1.uSectorID = 0;
           a1.vPosition.z = (int)((char *)_this + LODWORD(v725));
           a1.uSpriteFrameID = 0;
-          a1.field_58_pid = 8 * v3->uPlayerID | OBJECT_Player;
+          a1.spell_caster_pid = 8 * v3->uPlayerID | OBJECT_Player;
           a1.field_5C = v730;
           a1.field_60_distance_related_prolly_lod = stru_50C198._427546((int)&_this[69].uNumCharges);
           a1.uFacing = v685;
@@ -4816,7 +4818,7 @@
         while ( !v14 );
         goto LABEL_1056;
       case 23:
-        v219 = v12 - 2;
+        v219 = v731 - 2;
         if ( v219 )
         {
           v220 = v219 - 1;
@@ -4846,7 +4848,7 @@
         HIDWORD(v733) = (int)(char *)&pParty + 2508;
         break;
       case 24:
-        v224 = v12 - 2;
+        v224 = v731 - 2;
         if ( v224 )
         {
           v225 = v224 - 1;
@@ -4873,9 +4875,9 @@
         {
 LABEL_152:
           a1.stru_24.Reset();
-          a1.field_48 = v3->spellnum;
-          a1.field_50 = v731;
-          a1.field_4C = v2;
+          a1.spell_id = v3->spellnum;
+          a1.spell_skill = v731;
+          a1.spell_level = v2;
           a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType);
           a1.vPosition.y = pParty->vPosition.y;
           v51 = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3;
@@ -4890,7 +4892,7 @@
           a1.uSectorID = v52;
           v53 = 8 * v3->uPlayerID;
           LOBYTE(v53) = v53 | OBJECT_Player;
-          a1.field_58_pid = v53;
+          a1.spell_caster_pid = v53;
           a1.field_5C = a2;
           a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance);
           a1.uFacing = LOWORD(v715.uYawAngle);
@@ -4911,9 +4913,9 @@
         {
           v732 = SHIDWORD(v733) / (amount - 1);
           a1.stru_24.Reset();
-          a1.field_48 = v3->spellnum;
-          a1.field_4C = v2;
-          a1.field_50 = v731;
+          a1.spell_id = v3->spellnum;
+          a1.spell_level = v2;
+          a1.spell_skill = v731;
           a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType);
           a1.vPosition.y = pParty->vPosition.y;
           a1.vPosition.x = pParty->vPosition.x;
@@ -4926,7 +4928,7 @@
           a1.uSpriteFrameID = 0;
           v226 = 8 * v3->uPlayerID;
           LOBYTE(v226) = v226 | OBJECT_Player;
-          a1.field_58_pid = v226;
+          a1.spell_caster_pid = v226;
           a1.field_5C = a2;
           a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance);
           a1.uSoundID = LOWORD(v3->field_10);
@@ -5459,7 +5461,7 @@
         amount = 10 * v2;
         if ( pPlayer->sMana < (signed int)uRequiredMana )
           goto play_sound_and_continue;
-        if ( pParty->uFlags & (PARTY_FLAGS_1_ALERT_RED | PARTY_FLAGS_1_ALERT_YELLOW) && v12 != 4 || rand() % 100 >= amount && v731 != 4 )
+        if ( pParty->uFlags & (PARTY_FLAGS_1_ALERT_RED | PARTY_FLAGS_1_ALERT_YELLOW) && v731 != 4 || rand() % 100 >= amount && v731 != 4 )
         {
           ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed
           pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
@@ -5491,7 +5493,7 @@
         }
         goto play_sound_and_continue;
       case 40:
-        v320 = v12 - 2;
+        v320 = v731 - 2;
         if ( !v320 )
           goto LABEL_632;
         v321 = v320 - 1;
@@ -5524,9 +5526,9 @@
         if ( !pPlayer->CanCastSpell(uRequiredMana) )
           goto play_sound_and_continue;
         a1.stru_24.Reset();
-        a1.field_48 = v3->spellnum;
-        a1.field_4C = v2;
-        a1.field_50 = v731;
+        a1.spell_id = v3->spellnum;
+        a1.spell_level = v2;
+        a1.spell_skill = v731;
         a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType);
         a1.vPosition.y = pParty->vPosition.y;
         a1.vPosition.x = pParty->vPosition.x;
@@ -5539,7 +5541,7 @@
         a1.uSpriteFrameID = 0;
         v326 = 8 * v3->uPlayerID;
         LOBYTE(v326) = v326 | OBJECT_Player;
-        a1.field_58_pid = v326;
+        a1.spell_caster_pid = v326;
         a1.field_5C = a2;
         a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance);
         a1.uFacing = LOWORD(pParty->sRotationY);
@@ -5561,9 +5563,9 @@
           goto play_sound_and_continue;
         a1.uType = 4090;
         a1.stru_24.Reset();
-        a1.field_48 = v3->spellnum;
-        a1.field_4C = v2;
-        a1.field_50 = v731;
+        a1.spell_id = v3->spellnum;
+        a1.spell_level = v2;
+        a1.spell_skill = v731;
         a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType);
         a1.vPosition.x = pParty->vPosition.x;
         a1.vPosition.y = pParty->vPosition.y;
@@ -5574,7 +5576,7 @@
         v327 = 8 * v3->uPlayerID;
         LOBYTE(v327) = v327 | OBJECT_Player;
         a1.field_60_distance_related_prolly_lod = 0;
-        a1.field_58_pid = v327;
+        a1.spell_caster_pid = v327;
         a1.field_5C = a2;
         a1.uFacing = LOWORD(pParty->sRotationY);
         a1.uSoundID = LOWORD(v3->field_10);
@@ -5590,7 +5592,7 @@
         goto LABEL_157;
 
       case SPELL_SPIRIT_DETECT_LIFE:
-        v328 = v12 - 2;
+        v328 = v731 - 2;
         if ( v328 )
         {
           v329 = v328 - 1;
@@ -5621,7 +5623,7 @@
 
       case SPELL_SPIRIT_FATE:
         LODWORD(v733) = 300;
-        v339 = v12 - 2;
+        v339 = v731 - 2;
         if ( v339 )
         {
           v340 = v339 - 1;
@@ -5670,7 +5672,7 @@
         goto LABEL_1056;
 
       case 49:
-        v348 = v12 - 2;
+        v348 = v731 - 2;
         if ( !v348 )
           goto LABEL_677;
         v349 = v348 - 1;
@@ -5710,7 +5712,7 @@
         v674 = v3->uPlayerID_2;
         goto LABEL_685;
       case SPELL_SPIRIT_PRESERVATION:
-        v354 = v12 - 2;
+        v354 = v731 - 2;
         if ( v354 && (v355 = v354 - 1) != 0 && v355 == 1 )
           v356 = 900 * (v2 + 4);
         else
@@ -5741,7 +5743,7 @@
         while ( v357 <= &pParty->pPlayers[3] );
         goto LABEL_1056;
       case 48:
-        v364 = v12 - 2;
+        v364 = v731 - 2;
         if ( !v364 || (v365 = v364 - 1) != 0 && v365 != 1 )
           v366 = 60 * (v2 + 3);
         else
@@ -5753,9 +5755,9 @@
         pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xFFFFFFu, 0xC0u);
         ++a1.uType;
         a1.stru_24.Reset();
-        a1.field_48 = v3->spellnum;
-        a1.field_4C = v2;
-        a1.field_50 = v731;
+        a1.spell_id = v3->spellnum;
+        a1.spell_level = v2;
+        a1.spell_skill = v731;
         a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType);
         a1.uAttributes = 0;
         a1.uSectorID = 0;
@@ -5765,7 +5767,7 @@
         a1.uFacing = 0;
         v368 *= 8;
         LOBYTE(v368) = v368 | OBJECT_Player;
-        a1.field_58_pid = v368;
+        a1.spell_caster_pid = v368;
         a1.uSoundID = LOWORD(v3->field_10);
         for ( a2 = 0; a2 < (signed int)v726; ++a2 )
         {
@@ -5788,7 +5790,7 @@
         }
         goto LABEL_1056;
       case 53:
-        v371 = v12 - 2;
+        v371 = v731 - 2;
         if ( v371 && (v372 = v371 - 1) != 0 && v372 == 1 )
           amount = 0;
         else
@@ -5824,7 +5826,7 @@
         v377 = &pParty->pPlayers[v3->uPlayerID_2];
         goto LABEL_720;
       case 54:
-        v378 = v12 - 2;
+        v378 = v731 - 2;
         if ( v378 && (v379 = v378 - 1) != 0 && v379 == 1 )
           v380 = 4 * v2;
         else
@@ -5880,7 +5882,7 @@
         goto LABEL_1056;
 
       case 55:
-        v392 = v12 - 1;
+        v392 = v731 - 1;
         if ( !v392 )
         {
           v395 = 180 * v2;
@@ -5952,7 +5954,7 @@
         goto play_sound_and_continue;
 
       case 61:
-        v405 = v12 - 2;
+        v405 = v731 - 2;
         if ( !v405 )
           goto LABEL_766;
         v406 = v405 - 1;
@@ -5987,7 +5989,7 @@
         v656 = 12;
         goto LABEL_640;
       case 56:
-        v411 = v12 - 2;
+        v411 = v731 - 2;
         if ( v411 )
         {
           v412 = v411 - 1;
@@ -6088,9 +6090,9 @@
 LABEL_807:
         ShowStatusBarString(pTmpBuf2, 2u);
         a1.stru_24.Reset();
-        a1.field_48 = v3->spellnum;
-        a1.field_4C = v2;
-        a1.field_50 = v731;
+        a1.spell_id = v3->spellnum;
+        a1.spell_level = v2;
+        a1.spell_skill = v731;
         a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType);
         a1.vPosition.x = *(short *)(v730 + 142);
         a1.vPosition.y = *(short *)(v730 + 144);
@@ -6100,7 +6102,7 @@
         v657 = a1.vPosition.x;
         goto LABEL_1087;
       case 62:
-        v423 = v12 - 2;
+        v423 = v731 - 2;
         if ( !v423 )
           goto LABEL_813;
         v424 = v423 - 1;
@@ -6134,9 +6136,9 @@
           pActors[v426].pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Long;
         }
         a1.stru_24.Reset();
-        a1.field_48 = v3->spellnum;
-        a1.field_4C = v2;
-        a1.field_50 = v731;
+        a1.spell_id = v3->spellnum;
+        a1.spell_level = v2;
+        a1.spell_skill = v731;
         v60 = pObjectList->ObjectIDByItemID(a1.uType);
         v61 = v426;
         goto LABEL_1086;
@@ -6160,14 +6162,14 @@
             v731, 0, 0, 0);
         }
         a1.stru_24.Reset();
-        a1.field_48 = v3->spellnum;
-        a1.field_4C = v2;
-        a1.field_50 = v731;
+        a1.spell_id = v3->spellnum;
+        a1.spell_level = v2;
+        a1.spell_skill = v731;
         v60 = pObjectList->ObjectIDByItemID(a1.uType);
         v61 = v427;
         goto LABEL_1086;
       case 63:
-        v428 = v12 - 2;
+        v428 = v731 - 2;
         if ( v428 && (v429 = v428 - 1) != 0 && v429 == 1 )
           v430 = 300 * v2;
         else
@@ -6179,9 +6181,9 @@
         pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xA0A0Au, 0xC0u);
         ++a1.uType;
         a1.stru_24.Reset();
-        a1.field_48 = v3->spellnum;
-        a1.field_4C = v2;
-        a1.field_50 = v731;
+        a1.spell_id = v3->spellnum;
+        a1.spell_level = v2;
+        a1.spell_skill = v731;
         a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType);
         a1.uAttributes = 0;
         a1.uSectorID = 0;
@@ -6191,7 +6193,7 @@
         a1.uFacing = 0;
         v432 *= 8;
         LOBYTE(v432) = v432 | OBJECT_Player;
-        a1.field_58_pid = v432;
+        a1.spell_caster_pid = v432;
         a1.uSoundID = LOWORD(v3->field_10);
         for ( a2 = 0; a2 < (signed int)v726; ++a2 )
         {
@@ -6216,7 +6218,7 @@
         }
         goto LABEL_1056;
       case 64:
-        v435 = v12 - 2;
+        v435 = v731 - 2;
         if ( v435 && (v436 = v435 - 1) != 0 && v436 == 1 )
           amount = 0;
         else
@@ -6249,7 +6251,7 @@
         }
         goto LABEL_1056;
       case 42:
-        v442 = v12 - 2;
+        v442 = v731 - 2;
         if ( !v442 )
           goto LABEL_855;
         v443 = v442 - 1;
@@ -6328,7 +6330,7 @@
         }
         goto LABEL_1056;
       case 67:
-        v451 = v12 - 2;
+        v451 = v731 - 2;
         if ( v451 )
         {
           v452 = v451 - 1;
@@ -6374,7 +6376,7 @@
         v325 = &pParty->pPlayers[v323];
         goto LABEL_641;
       case 68:
-        v457 = v12 - 2;
+        v457 = v731 - 2;
         if ( v457 )
         {
           v458 = v457 - 1;
@@ -6432,7 +6434,7 @@
         }
         goto LABEL_1056;
       case 72:
-        v464 = v12 - 2;
+        v464 = v731 - 2;
         if ( !v464 )
           goto LABEL_910;
         v465 = v464 - 1;
@@ -6530,7 +6532,7 @@
         pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[PLAYER_BUFF_HAMMERHANDS].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, v2, v2, 0);
         goto LABEL_1056;
       case 74:
-        v493 = v12 - 2;
+        v493 = v731 - 2;
         if ( v493 && (v494 = v493 - 1) != 0 && v494 == 1 )
           amount = 0;
         else
@@ -6603,9 +6605,9 @@
         v689 = 0;
         v688 = 0;
         a1.stru_24.Reset();
-        a1.field_48 = v3->spellnum;
-        a1.field_4C = v2;
-        a1.field_50 = v731;
+        a1.spell_id = v3->spellnum;
+        a1.spell_level = v2;
+        a1.spell_skill = v731;
         a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType);
         a1.uAttributes = 0;
         a1.uSectorID = 0;
@@ -6615,7 +6617,7 @@
         a1.uFacing = 0;
         v506 *= 8;
         LOBYTE(v506) = v506 | OBJECT_Player;
-        a1.field_58_pid = v506;
+        a1.spell_caster_pid = v506;
         a1.uSoundID = LOWORD(v3->field_10);
         a2 = 0;
         if ( SHIDWORD(v733) > 0 )
@@ -6660,7 +6662,7 @@
         }
         goto LABEL_1056;
       case 82:
-        v514 = v12 - 2;
+        v514 = v731 - 2;
         if ( !v514 )
           goto LABEL_955;
         v515 = v514 - 1;
@@ -6711,7 +6713,7 @@
         sub_44FA4C_spawn_light_elemental(v3->uPlayerID, v731, v733);
         goto LABEL_1056;
       case 83:
-        v520 = v12 - 2;
+        v520 = v731 - 2;
         if ( !v520 )
           goto LABEL_973;
         v521 = v520 - 1;
@@ -6768,9 +6770,9 @@
         v695 = 0;
         v694 = 0;
         a1.stru_24.Reset();
-        a1.field_48 = v3->spellnum;
-        a1.field_4C = v2;
-        a1.field_50 = v731;
+        a1.spell_id = v3->spellnum;
+        a1.spell_level = v2;
+        a1.spell_skill = v731;
         a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType);
         a1.uAttributes = 0;
         a1.uSectorID = 0;
@@ -6780,7 +6782,7 @@
         a1.uFacing = 0;
         v532 *= 8;
         LOBYTE(v532) = v532 | OBJECT_Player;
-        a1.field_58_pid = v532;
+        a1.spell_caster_pid = v532;
         a1.uSoundID = LOWORD(v3->field_10);
         a2 = 0;
         if ( (signed int)v726 > 0 )
@@ -6807,7 +6809,7 @@
         goto LABEL_1056;
 
       case SPELL_LIGHT_DAY_OF_PROTECTION:
-        v538 = v12 - 2;
+        v538 = v731 - 2;
         if ( v538 && (v539 = v538 - 1) != 0 && v539 == 1 )
         {
           amount = 5 * v2;
@@ -6847,7 +6849,7 @@
         pParty->pPartyBuffs[PARTY_BUFF_WIZARD_EYE].Apply((signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), v731, v550, 0, 0);
         goto LABEL_1056;
       case 86:
-        v551 = v12 - 2;
+        v551 = v731 - 2;
         if ( !v551 )
           goto LABEL_998;
         v552 = v551 - 1;
@@ -6943,7 +6945,7 @@
         ++v571->uNumDivineInterventionCastsThisDay;
         goto LABEL_1056;
       case 89:
-        v573 = v12 - 2;
+        v573 = v731 - 2;
         if ( v573 )
         {
           v574 = v573 - 1;
@@ -6998,9 +7000,9 @@
         }
         ++a1.uType;
         a1.stru_24.Reset();
-        a1.field_48 = v3->spellnum;
-        a1.field_4C = v2;
-        a1.field_50 = v731;
+        a1.spell_id = v3->spellnum;
+        a1.spell_level = v2;
+        a1.spell_skill = v731;
         a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType);
         a1.uAttributes = 0;
         a1.uSectorID = 0;
@@ -7011,7 +7013,7 @@
         v580 *= 8;
         LOBYTE(v580) = v580 | OBJECT_Player;
         a1.uFacing = 0;
-        a1.field_58_pid = v580;
+        a1.spell_caster_pid = v580;
         a1.uSoundID = LOWORD(v3->field_10);
         a1.vPosition.x = *(short *)(v721 + 142);
         a1.vPosition.y = *(short *)(v721 + 144);
@@ -7040,7 +7042,7 @@
           *(short *)(v581 + 40) = 10 * amount;
         goto LABEL_1056;
       case 91:
-        v588 = v12 - 1;
+        v588 = v731 - 1;
         amount = 16;
         if ( v588 && (v589 = v588 - 1) != 0 && (v590 = v589 - 1) != 0 )
         {
@@ -7084,7 +7086,7 @@
         *(char *)(v592 + 20) |= 0x80u;
         goto LABEL_1055;
       case 93:
-        v593 = v12 - 2;
+        v593 = v731 - 2;
         if ( !v593 )
           goto LABEL_1062;
         v594 = v593 - 1;
@@ -7105,9 +7107,9 @@
         v726 = (Player *)((signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360);
         v732 = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360 / (amount - 1);
         a1.stru_24.Reset();
-        a1.field_48 = v3->spellnum;
-        a1.field_4C = v2;
-        a1.field_50 = v731;
+        a1.spell_id = v3->spellnum;
+        a1.spell_level = v2;
+        a1.spell_skill = v731;
         a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType);
         a1.vPosition.x = pParty->vPosition.x;
         a1.vPosition.y = pParty->vPosition.y;
@@ -7120,7 +7122,7 @@
         a1.uSpriteFrameID = 0;
         v595 = 8 * v3->uPlayerID;
         LOBYTE(v595) = v595 | OBJECT_Player;
-        a1.field_58_pid = v595;
+        a1.spell_caster_pid = v595;
         a1.field_5C = a2;
         a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance);
         a1.uSoundID = LOWORD(v3->field_10);
@@ -7183,9 +7185,9 @@
           pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335),
           v731, 0, 0, 0);
         a1.stru_24.Reset();
-        a1.field_48 = v3->spellnum;
-        a1.field_4C = v2;
-        a1.field_50 = v731;
+        a1.spell_id = v3->spellnum;
+        a1.spell_level = v2;
+        a1.spell_skill = v731;
         v60 = pObjectList->ObjectIDByItemID(a1.uType);
         v61 = v599;
 LABEL_1086:
@@ -7206,7 +7208,7 @@
         a1.uSpriteFrameID = 0;
         v604 = 8 * v3->uPlayerID;
         LOBYTE(v604) = v604 | OBJECT_Player;
-        a1.field_58_pid = v604;
+        a1.spell_caster_pid = v604;
         a1.field_5C = a2;
         a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance);
         a1.uFacing = LOWORD(v715.uYawAngle);
@@ -7284,15 +7286,15 @@
         LODWORD(v727) = 1;
         goto play_sound_and_continue;
       case 95:
-        if ( v12 <= 0 )
+        if ( v731 <= 0 )
           goto LABEL_1119;
-        if ( v12 <= 3 )
+        if ( v731 <= 3 )
         {
           v614 = 300 * (v2 + 12);
         }
         else
         {
-          if ( v12 != 4 )
+          if ( v731 != 4 )
             goto LABEL_1119;
           v614 = 900 * (v2 + 4);
         }
@@ -7335,9 +7337,9 @@
         v708 = 0;
         v707 = 0;
         a1.stru_24.Reset();
-        a1.field_48 = v3->spellnum;
-        a1.field_4C = v2;
-        a1.field_50 = v731;
+        a1.spell_id = v3->spellnum;
+        a1.spell_level = v2;
+        a1.spell_skill = v731;
         a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType);
         a1.uAttributes = 0;
         a1.uSectorID = 0;
@@ -7347,7 +7349,7 @@
         a1.uFacing = 0;
         v624 *= 8;
         LOBYTE(v624) = v624 | OBJECT_Player;
-        a1.field_58_pid = v624;
+        a1.spell_caster_pid = v624;
         a1.uSoundID = LOWORD(v3->field_10);
         a2 = 0;
         if ( SHIDWORD(v733) > 0 )
@@ -7417,7 +7419,7 @@
           pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
           goto LABEL_203;
         }
-        v640 = v12 - 2;
+        v640 = v731 - 2;
         if ( !v640 || (v641 = v640 - 1) == 0 || (amount = 4, v641 != 1) )
           amount = 3;
         if ( pPlayer->uNumArmageddonCasts >= amount || pParty->armageddon_timer > 0 )
@@ -8147,9 +8149,9 @@
     v9 = v22;
   }
   v10 = 0;
-  a1a.field_50 = 0;
-  a1a.field_4C = 0;
-  a1a.field_48 = 0;
+  a1a.spell_skill = 0;
+  a1a.spell_level = 0;
+  a1a.spell_id = 0;
   a1a.field_54 = 0;
   a1a.uType = v9;
   if ( (signed int)pObjectList->uNumObjects <= 0 )
@@ -8177,7 +8179,7 @@
   a1a.uAttributes = attributes;
   a1a.uSectorID = pIndoor->GetSector(v21, y, z);
   a1a.uSpriteFrameID = 0;
-  a1a.field_58_pid = 0;
+  a1a.spell_caster_pid = 0;
   a1a.field_5C = 0;
   if ( !(a1a.uAttributes & 0x10) )
   {
@@ -8253,9 +8255,9 @@
   a1.stru_24.Reset();
 
   v5 = 0;
-  a1.field_50 = 0;
-  a1.field_4C = 0;
-  a1.field_48 = 0;
+  a1.spell_skill = 0;
+  a1.spell_level = 0;
+  a1.spell_id = 0;
   a1.field_54 = 0;
   a1.uType = 800;
   if ( (signed int)pObjectList->uNumObjects <= 0 )
@@ -8283,7 +8285,7 @@
   a1.uAttributes = 0;
   a1.uSectorID = pIndoor->GetSector(v3, v4, z);
   a1.uSpriteFrameID = 0;
-  a1.field_58_pid = 0;
+  a1.spell_caster_pid = 0;
   a1.field_5C = 0;
   v8 = a1.Create(0, 0, 0, 0);
   if ( v8 != -1 )
@@ -8316,9 +8318,9 @@
   a1a.uType = 600;
   a1a.stru_24.Reset();
 
-  a1a.field_48 = 6;
-  a1a.field_4C = 8;
-  a1a.field_50 = 3;
+  a1a.spell_id = SPELL_FIRE_FIREBALL;
+  a1a.spell_level = 8;
+  a1a.spell_skill = 3;
   v14 = 0;
   if ( (signed int)pObjectList->uNumObjects <= 0 )
   {
@@ -8352,11 +8354,11 @@
   {
     v10 = 8 * a6 - 8;
     LOBYTE(v10) = v10 | OBJECT_Player;
-    a1a.field_58_pid = v10;
+    a1a.spell_caster_pid = v10;
   }
   else
   {
-    a1a.field_58_pid = 0;
+    a1a.spell_caster_pid = 0;
   }
   result = a1a.Create(0, 0, 0, 0);
   if ( result != -1 )
--- a/stru6.cpp	Tue Mar 26 14:55:43 2013 +0200
+++ b/stru6.cpp	Tue Mar 26 17:56:24 2013 +0200
@@ -830,9 +830,9 @@
       AddMobileLight(a2, 0xFF3C1E, 256);
       if (pRenderer->pRenderD3D)
       {
-        result = a2->field_58_pid & 7;
-        if ((a2->field_58_pid & 7) != OBJECT_Actor &&
-            (a2->field_58_pid & 7) != OBJECT_Item)
+        result = a2->spell_caster_pid & 7;
+        if ((a2->spell_caster_pid & 7) != OBJECT_Actor &&
+            (a2->spell_caster_pid & 7) != OBJECT_Item)
         {
           if (field_204 != 4)
           {