diff CastSpellInfo.cpp @ 1519:4c787c28ddce

Clean CastSpellInfo. (2)
author yoctozepto
date Wed, 04 Sep 2013 16:00:15 +0200
parents c3da3c2985b8
children 30db6d265ceb
line wrap: on
line diff
--- a/CastSpellInfo.cpp	Wed Sep 04 15:27:01 2013 +0200
+++ b/CastSpellInfo.cpp	Wed Sep 04 16:00:15 2013 +0200
@@ -313,13 +313,13 @@
   {
     pCastSpell = &pCastSpellInfo[n];
     HIDWORD(v733) = (int)pCastSpell;
-    if ( pCastSpell->spellnum == 0 )
+    if ( pCastSpell->uSpellID == 0 )
       continue;
 
     if (pParty->Invisible())
       pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].Reset();
 
-    if ( pCastSpell->field_8 & 0x3CA )
+    if ( pCastSpell->uFlags & 0x3CA )
     {
       if ( !pParty->pPlayers[pCastSpell->uPlayerID].CanAct() )
         _427D48();
@@ -330,9 +330,9 @@
     a2 = pCastSpell->spell_target_pid;
     if (!pCastSpell->spell_target_pid)
     {
-      if (pCastSpell->spellnum == SPELL_LIGHT_DESTROY_UNDEAD ||
-          pCastSpell->spellnum == SPELL_SPIRIT_TURN_UNDEAD ||
-          pCastSpell->spellnum == SPELL_DARK_CONTROL_UNDEAD )
+      if (pCastSpell->uSpellID == SPELL_LIGHT_DESTROY_UNDEAD ||
+          pCastSpell->uSpellID == SPELL_SPIRIT_TURN_UNDEAD ||
+          pCastSpell->uSpellID == SPELL_DARK_CONTROL_UNDEAD )
         v666 = 1;
       else
         v666 = 0;
@@ -344,7 +344,7 @@
     }
 
 
-    pSpellSprite.uType = stru_4E3ACC[pCastSpell->spellnum].uType;
+    pSpellSprite.uType = stru_4E3ACC[pCastSpell->uSpellID].uType;
     if (pSpellSprite.uType)
     {
       if (PID_TYPE(a2) == OBJECT_Actor)
@@ -370,25 +370,25 @@
     else
     {
       //v667 = PLAYER_SKILL_STAFF;
-      if (pCastSpell->spellnum < SPELL_AIR_WIZARD_EYE)
+      if (pCastSpell->uSpellID < SPELL_AIR_WIZARD_EYE)
         v667 = PLAYER_SKILL_FIRE;
-      else if (pCastSpell->spellnum < SPELL_WATER_AWAKEN)
+      else if (pCastSpell->uSpellID < SPELL_WATER_AWAKEN)
         v667 = PLAYER_SKILL_AIR;
-      else if (pCastSpell->spellnum < SPELL_EARTH_STUN)
+      else if (pCastSpell->uSpellID < SPELL_EARTH_STUN)
         v667 = PLAYER_SKILL_WATER;
-      else if (pCastSpell->spellnum < SPELL_SPIRIT_DETECT_LIFE)
+      else if (pCastSpell->uSpellID < SPELL_SPIRIT_DETECT_LIFE)
         v667 = PLAYER_SKILL_EARTH;
-      else if (pCastSpell->spellnum < SPELL_MIND_REMOVE_FEAR)
+      else if (pCastSpell->uSpellID < SPELL_MIND_REMOVE_FEAR)
         v667 = PLAYER_SKILL_SPIRIT;
-      else if (pCastSpell->spellnum < SPELL_BODY_CURE_WEAKNESS)
+      else if (pCastSpell->uSpellID < SPELL_BODY_CURE_WEAKNESS)
         v667 = PLAYER_SKILL_MIND;
-      else if (pCastSpell->spellnum < SPELL_LIGHT_LIGHT_BOLT)
+      else if (pCastSpell->uSpellID < SPELL_LIGHT_LIGHT_BOLT)
         v667 = PLAYER_SKILL_BODY;
-      else if (pCastSpell->spellnum < SPELL_DARK_REANIMATE)
+      else if (pCastSpell->uSpellID < SPELL_DARK_REANIMATE)
         v667 = PLAYER_SKILL_LIGHT;
-      else if (pCastSpell->spellnum < SPELL_BOW_ARROW)
+      else if (pCastSpell->uSpellID < SPELL_BOW_ARROW)
         v667 = PLAYER_SKILL_DARK;
-      else if (pCastSpell->spellnum == SPELL_BOW_ARROW)
+      else if (pCastSpell->uSpellID == SPELL_BOW_ARROW)
         v667 = PLAYER_SKILL_BOW;
       else assert(false && "Unknown spell");
 
@@ -403,21 +403,21 @@
     if (pCastSpell->forced_spell_skill_level)
       uRequiredMana = 0;
     else 
-      uRequiredMana = pSpellDatas[pCastSpell->spellnum - 1].mana_per_skill[v731 - 1];
-    sRecoveryTime = pSpellDatas[pCastSpell->spellnum - 1].recovery_per_skill[v731 - 1];
+      uRequiredMana = pSpellDatas[pCastSpell->uSpellID - 1].mana_per_skill[v731 - 1];
+    sRecoveryTime = pSpellDatas[pCastSpell->uSpellID - 1].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)
       uRequiredMana = 0;
 
-    if (pCastSpell->spellnum < SPELL_BOW_ARROW && pPlayer->sMana < uRequiredMana)
+    if (pCastSpell->uSpellID < SPELL_BOW_ARROW && pPlayer->sMana < uRequiredMana)
     {
       ShowStatusBarString(pGlobalTXT_LocalizationStrings[586], 2u); // "Not enough spell points"
-      pCastSpell->spellnum = 0;
+      pCastSpell->uSpellID = 0;
       continue;
     }
-    v730 = pCastSpell->spellnum;
-    if (pPlayer->IsCursed() && pCastSpell->spellnum < SPELL_BOW_ARROW && rand() % 100 < 50)
+    v730 = pCastSpell->uSpellID;
+    if (pPlayer->IsCursed() && pCastSpell->uSpellID < SPELL_BOW_ARROW && rand() % 100 < 50)
     {
       if (!pParty->bTurnBasedModeOn)
       {
@@ -437,12 +437,12 @@
       }
       ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2u); // "Spell failed"
       pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
-      pCastSpellInfo[n].spellnum = 0;
+      pCastSpellInfo[n].uSpellID = 0;
       pPlayer->sMana -= uRequiredMana;
       return;
     }
 
-    switch ( pCastSpell->spellnum )
+    switch ( pCastSpell->uSpellID )
     {
 		case SPELL_101:
 			assert(false && "Unknown spell effect #101 (prolly flaming bow arrow");
@@ -454,7 +454,7 @@
 			sRecoveryTime = pPlayer->GetAttackRecoveryTime(true);
 			pSpellSprite.stru_24.Reset();
 			pSpellSprite.spell_level = v2;
-			pSpellSprite.spell_id = pCastSpell->spellnum;
+			pSpellSprite.spell_id = pCastSpell->uSpellID;
 			pSpellSprite.spell_skill = v731;
 			pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
 			if ( pPlayer->WearsItem(ITEM_ARTEFACT_ULLYSES, EQUIP_BOW) )
@@ -489,7 +489,7 @@
 		{
 			sRecoveryTime = pPlayer->GetAttackRecoveryTime(0);
 			pSpellSprite.stru_24.Reset();
-			pSpellSprite.spell_id = pCastSpell->spellnum;
+			pSpellSprite.spell_id = pCastSpell->uSpellID;
 			pSpellSprite.spell_level = v723;
 			pSpellSprite.spell_skill = v731;
 			pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
@@ -572,13 +572,13 @@
 			{
 				ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed
 				pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
-				pCastSpell->spellnum = 0;
+				pCastSpell->uSpellID = 0;
 				continue;
 			}
 			if ( !pPlayer->CanCastSpell(uRequiredMana) )
 				break;
 			pSpellSprite.stru_24.Reset();
-			pSpellSprite.spell_id = pCastSpell->spellnum;
+			pSpellSprite.spell_id = pCastSpell->uSpellID;
 			pSpellSprite.spell_level = v2;
 			pSpellSprite.spell_skill = v731;
 			pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
@@ -609,7 +609,7 @@
 			{
 				ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed
 				pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
-				pCastSpell->spellnum = 0;
+				pCastSpell->uSpellID = 0;
 				continue;
 			}
 			if (PID_TYPE(a2) != OBJECT_Actor)
@@ -621,7 +621,7 @@
 			v697.y = 0;
 			v697.z = 0;
 			pSpellSprite.stru_24.Reset();
-			pSpellSprite.spell_id = pCastSpell->spellnum;
+			pSpellSprite.spell_id = pCastSpell->uSpellID;
 			pSpellSprite.spell_level = v2;
 			pSpellSprite.spell_skill = v731;
 			pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
@@ -655,7 +655,7 @@
 			v704.y = 0;
 			v704.z = 0;
 			pSpellSprite.stru_24.Reset();
-			pSpellSprite.spell_id = pCastSpell->spellnum;
+			pSpellSprite.spell_id = pCastSpell->uSpellID;
 			pSpellSprite.spell_level = v2;
 			pSpellSprite.spell_skill = v731;
 			pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
@@ -685,7 +685,7 @@
 			v691.y = 0;
 			v691.z = 0;
 			pSpellSprite.stru_24.Reset();
-			pSpellSprite.spell_id = pCastSpell->spellnum;
+			pSpellSprite.spell_id = pCastSpell->uSpellID;
 			pSpellSprite.spell_level = v2;
 			pSpellSprite.spell_skill = v731;
 			pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
@@ -706,7 +706,7 @@
 			{
 				ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed
 				pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
-				pCastSpell->spellnum = 0;
+				pCastSpell->uSpellID = 0;
 				continue;
 			}
 			DamageMonsterFromParty(PID(OBJECT_Item, obj_id), PID_ID(a2), &v691);
@@ -730,7 +730,7 @@
 			if ( !pPlayer->CanCastSpell(uRequiredMana) )
 				break;
 			pSpellSprite.stru_24.Reset();
-			pSpellSprite.spell_id = pCastSpell->spellnum;
+			pSpellSprite.spell_id = pCastSpell->uSpellID;
 			pSpellSprite.spell_level = v2;
 			pSpellSprite.spell_skill = v731;
 			pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
@@ -750,7 +750,7 @@
 			pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id);
 			if ( pParty->bTurnBasedModeOn == 1 )
 				LOBYTE(pSpellSprite.uAttributes) |= 4u;
-			if ( pCastSpell->spellnum == SPELL_AIR_LIGHNING_BOLT )
+			if ( pCastSpell->uSpellID == SPELL_AIR_LIGHNING_BOLT )
 				LOBYTE(pSpellSprite.uAttributes) |= 0x40u;
 			v659 = pObjectList->pObjects[(signed __int16)pSpellSprite.uObjectDescID].uSpeed;
 			if ( pSpellSprite.Create(v715.uYawAngle, v715.uPitchAngle, v659, pCastSpell->uPlayerID + 1) != -1 && pParty->bTurnBasedModeOn == 1 )
@@ -766,7 +766,7 @@
 			if ( !pPlayer->CanCastSpell(uRequiredMana) )
 				break;
 			pSpellSprite.stru_24.Reset();
-			pSpellSprite.spell_id = pCastSpell->spellnum;
+			pSpellSprite.spell_id = pCastSpell->uSpellID;
 			pSpellSprite.spell_level = v2;
 			pSpellSprite.spell_skill = v731;
 			pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
@@ -800,13 +800,13 @@
 			{
 				ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed
 				pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
-				pCastSpell->spellnum = 0;
+				pCastSpell->uSpellID = 0;
 				continue;
 			}
 			if ( pPlayer->CanCastSpell(uRequiredMana) )
 			{
 				pSpellSprite.stru_24.Reset();
-				pSpellSprite.spell_id = pCastSpell->spellnum;
+				pSpellSprite.spell_id = pCastSpell->uSpellID;
 				pSpellSprite.spell_skill = v731;
 				pSpellSprite.spell_level = v2;
 				pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
@@ -918,7 +918,7 @@
 		pActors[PID_ID(a2)].pActorBuffs[1].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)(power << 7) * 0.033333335),
 			v731, 0, 0, 0);
 		pSpellSprite.stru_24.Reset();
-		pSpellSprite.spell_id = pCastSpell->spellnum;
+		pSpellSprite.spell_id = pCastSpell->uSpellID;
 		pSpellSprite.spell_level = v2;
 		pSpellSprite.spell_skill = v731;
 		v60 = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
@@ -1026,7 +1026,7 @@
 
 			ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed
 			pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
-			pCastSpell->spellnum = 0;
+			pCastSpell->uSpellID = 0;
 			continue;
 		}
 		case SPELL_BODY_REGENERATION:
@@ -1043,7 +1043,7 @@
 			if ( !pPlayer->CanCastSpell(uRequiredMana) )
 				break;
 
-			pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, pCastSpell->uPlayerID_2);
+			pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, pCastSpell->uPlayerID_2);
 
 			pParty->pPlayers[pCastSpell->uPlayerID_2].pPlayerBuffs[PLAYER_BUFF_REGENERATION].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)v733 * 4.2666669), v731, amount, 0, 0);
 			LODWORD(v727) = 1;
@@ -1066,7 +1066,7 @@
 				assert(false);
 			}
 
-			switch (pCastSpell->spellnum)
+			switch (pCastSpell->uSpellID)
 			{
 			  case SPELL_FIRE_PROTECTION_FROM_FIRE:
 				LODWORD(v725) = PARTY_BUFF_RESIST_FIRE;
@@ -1092,10 +1092,10 @@
 			}
 			if ( !pPlayer->CanCastSpell(uRequiredMana) )
 			  break;
-			pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 0);
-			pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 1);
-			pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 2);
-			pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 3);
+			pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 0);
+			pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 1);
+			pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 2);
+			pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 3);
 			v90 = (double)(signed int)v733 * 4.2666669;
 			pParty->pPartyBuffs[LODWORD(v725)].Apply(pParty->uTimePlayed + (signed int)(signed __int64)v90, v731, amount, 0, 0);
 			LODWORD(v727) = 1;
@@ -1127,10 +1127,10 @@
 				{
 					pParty->pPartyBuffs[PARTY_BUFF_HASTE].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, 0, 0, 0);
 
-					pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 0);
-					pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 1);
-					pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 2);
-					pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 3);
+					pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 0);
+					pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 1);
+					pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 2);
+					pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 3);
 				}
 			}
 			break;
@@ -1152,7 +1152,7 @@
 			if ( v731 == 1 )
 			{
 				v108 = pCastSpell->uPlayerID_2;
-				v109 = pCastSpell->spellnum;
+				v109 = pCastSpell->uSpellID;
 				v110 = pGame->GetStru6();
 				pGame->GetStru6()->SetPlayerBuffAnim(v109, v108);
 				v111 = pOtherOverlayList->_4418B1(10000, pCastSpell->uPlayerID_2 + 310, 0, 65536);
@@ -1176,7 +1176,7 @@
 			v730b = pParty->pPlayers;//[0].pPlayerBuffs[1];
 			do
 			{
-				pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, v105);
+				pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, v105);
 				v716 = pOtherOverlayList->_4418B1(10000, v105 + 310, 0, 65536);
 				v730b->pPlayerBuffs[1].Apply(pParty->uTimePlayed + v717, v731, amount, v716, 0);
 				++v730b;
@@ -1223,7 +1223,7 @@
 					v701.y = 0;
 					v701.z = 0;
 					pSpellSprite.stru_24.Reset();
-					pSpellSprite.spell_id = pCastSpell->spellnum;
+					pSpellSprite.spell_id = pCastSpell->uSpellID;
 					pSpellSprite.spell_level = v723;
 					pSpellSprite.spell_skill = v731;
 					pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
@@ -1246,7 +1246,7 @@
 				{
 					ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2u);
 					pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
-					pCastSpell->spellnum = 0;
+					pCastSpell->uSpellID = 0;
 				}
 				//pCastSpell = (CastSpellInfo *)HIDWORD(v733);
 			}
@@ -1265,7 +1265,7 @@
 				default:
 				assert(false);
 			}
-			v127 = pCastSpell->spellnum;
+			v127 = pCastSpell->uSpellID;
 			if ( v127 == 17 )
 			{
 				amount = 0;
@@ -1288,10 +1288,10 @@
 			}
 			if ( !pPlayer->CanCastSpell(uRequiredMana) )
 				break;
-			pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 0);
-			pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 1);
-			pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 2);
-			pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 3);
+			pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 0);
+			pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 1);
+			pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 2);
+			pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 3);
 			v90 = (double)(signed int)((int)v733 << 7) * 0.033333335;
 	//LABEL_304:
 			pParty->pPartyBuffs[LODWORD(v725)].Apply(pParty->uTimePlayed + (signed int)(signed __int64)v90, v731, amount, 0, 0);
@@ -1307,10 +1307,10 @@
 			if ( !pPlayer->CanCastSpell(uRequiredMana) )
 				break;
 
-			pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 0);
-			pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 1);
-			pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 2);
-			pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 3);
+			pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 0);
+			pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 1);
+			pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 2);
+			pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 3);
 
 			pParty->pPartyBuffs[PARTY_BUFF_IMMOLATION].Apply(pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, v2, 0, 0);
 			LODWORD(v727) = 1;
@@ -1333,7 +1333,7 @@
 			{
 				ShowStatusBarString(pGlobalTXT_LocalizationStrings[491], 2);  // Can't cast Meteor Shower indoors!
 				pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
-				pCastSpell->spellnum = 0;
+				pCastSpell->uSpellID = 0;
 				continue;
 			}
 			if ( !pPlayer->CanCastSpell(uRequiredMana) )
@@ -1377,7 +1377,7 @@
 													stru_5C6E00->Atan2(j, k));
 					}
 					pSpellSprite.stru_24.Reset();
-					pSpellSprite.spell_id = pCastSpell->spellnum;
+					pSpellSprite.spell_id = pCastSpell->uSpellID;
 					pSpellSprite.spell_level = v2;
 					pSpellSprite.spell_skill = v731;
 					pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
@@ -1412,7 +1412,7 @@
 			{
 				ShowStatusBarString(pGlobalTXT_LocalizationStrings[492], 2); // Can't cast Inferno outdoors!
 				pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
-				pCastSpell->spellnum = 0;
+				pCastSpell->uSpellID = 0;
 				continue;
 			}
 			if ( !pPlayer->CanCastSpell(uRequiredMana) )
@@ -1422,7 +1422,7 @@
 			v700.y = 0;
 			v700.x = 0;
 			pSpellSprite.stru_24.Reset();
-			pSpellSprite.spell_id = pCastSpell->spellnum;
+			pSpellSprite.spell_id = pCastSpell->uSpellID;
 			pSpellSprite.spell_level = v2;
 			pSpellSprite.spell_skill = v731;
 			pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
@@ -1489,10 +1489,10 @@
 			do
 				pOtherOverlayList->_4418B1(2010, v174++ + 100, 0, 65536);
 			while ( v174 < 4 );
-			pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 0);
-			pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 1);
-			pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 2);
-			pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 3);
+			pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 0);
+			pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 1);
+			pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 2);
+			pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 3);
 
 			pParty->pPartyBuffs[PARTY_BUFF_FEATHER_FALL].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, 0, 0, 0);
 			LODWORD(v727) = 1;
@@ -1513,7 +1513,7 @@
 				break;
 			auto _v726 = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360;
 			pSpellSprite.stru_24.Reset();
-			pSpellSprite.spell_id = pCastSpell->spellnum;
+			pSpellSprite.spell_id = pCastSpell->uSpellID;
 			pSpellSprite.spell_level = v2;
 			pSpellSprite.spell_skill = v731;
 			pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
@@ -1583,15 +1583,15 @@
 			{
 				ShowStatusBarString(pGlobalTXT_LocalizationStrings[638], 2);  // There are hostile creatures nearby!
 				pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
-				pCastSpell->spellnum = 0;
+				pCastSpell->uSpellID = 0;
 				continue;
 			}
 			if ( pPlayer->CanCastSpell(uRequiredMana) )
 			{
-				pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 0);
-				pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 1);
-				pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 2);
-				pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 3);
+				pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 0);
+				pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 1);
+				pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 2);
+				pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 3);
 
 				pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, amount, 0, 0);
 				LODWORD(v727) = 1;
@@ -1638,7 +1638,7 @@
 			{
 				ShowStatusBarString(pGlobalTXT_LocalizationStrings[495], 2);  // Can't cast Starburst indoors!
 				pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
-				pCastSpell->spellnum = 0;
+				pCastSpell->uSpellID = 0;
 				continue;
 			}
 			if ( !pPlayer->CanCastSpell(uRequiredMana) )
@@ -1693,7 +1693,7 @@
 								stru_5C6E00->Atan2((signed __int64)v216, (signed __int64)*(float *)&uRequiredMana));
 				}
 				pSpellSprite.stru_24.Reset();
-				pSpellSprite.spell_id = pCastSpell->spellnum;
+				pSpellSprite.spell_id = pCastSpell->uSpellID;
 				pSpellSprite.spell_level = v2;
 				pSpellSprite.spell_skill = v731;
 				pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
@@ -1778,7 +1778,7 @@
 			if ( amount == 1 )
 			{
 				pSpellSprite.stru_24.Reset();
-				pSpellSprite.spell_id = pCastSpell->spellnum;
+				pSpellSprite.spell_id = pCastSpell->uSpellID;
 				pSpellSprite.spell_skill = v731;
 				pSpellSprite.spell_level = v2;
 				pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
@@ -1807,7 +1807,7 @@
 			else
 			{
 				pSpellSprite.stru_24.Reset();
-				pSpellSprite.spell_id = pCastSpell->spellnum;
+				pSpellSprite.spell_id = pCastSpell->uSpellID;
 				pSpellSprite.spell_level = v2;
 				pSpellSprite.spell_skill = v731;
 				pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
@@ -1862,10 +1862,10 @@
 			if ( !pPlayer->CanCastSpell(uRequiredMana) )
 				break;
 			v716 = pOtherOverlayList->_4418B1(10005, 201, 0, 65536);
-			pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 0);
-			pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 1);
-			pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 2);
-			pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 3);
+			pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 0);
+			pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 1);
+			pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 2);
+			pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 3);
 
 			pParty->pPartyBuffs[PARTY_BUFF_WATER_WALK].Apply(
 				pParty->uTimePlayed + (signed int)(signed __int64)((double)(v229 << 7) * 0.033333335),
@@ -1892,7 +1892,7 @@
 
 				ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2);  // Spell failed
 				pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
-				pCastSpell->spellnum = 0;
+				pCastSpell->uSpellID = 0;
 				continue;
 			}
 			if ( v731 == 1 || v731 == 2 )
@@ -1924,7 +1924,7 @@
 				dword_50C9D8 = 1;
 				ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2u);
 				pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
-				pCastSpell->spellnum = 0;
+				pCastSpell->uSpellID = 0;
 				v2 = v723;
 				continue;
 			}
@@ -2099,7 +2099,7 @@
 				ShowStatusBarString(v317, 2u);
 				pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
 				v318 =  &pParty->pPlayers[pCastSpell->uPlayerID_2];
-				pCastSpell->spellnum = 0;
+				pCastSpell->uSpellID = 0;
 				v318->PlaySound(SPEECH_43, 0);
 			}
 
@@ -2114,7 +2114,7 @@
 			{
 				ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed
 				pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
-				pCastSpell->spellnum = 0;
+				pCastSpell->uSpellID = 0;
 				continue;
 			}
 			town_portal_caster_id = LOBYTE(pCastSpell->uPlayerID);
@@ -2129,7 +2129,7 @@
 			{
 				ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed
 				pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
-				pCastSpell->spellnum = 0;
+				pCastSpell->uSpellID = 0;
 				continue;
 			}
 			v319 = uRequiredMana;
@@ -2142,8 +2142,8 @@
 				::uRequiredMana = v319;
 				::sRecoveryTime = sRecoveryTime;
 				dword_50633C = pCastSpell->sound_id;
-				dword_506338 = pCastSpell->spellnum;
-				LOBYTE(pCastSpell->field_8) |= 0x20u;
+				dword_506338 = pCastSpell->uSpellID;
+				pCastSpell->uFlags |= 0x20u;
 			}
 			break;
 		}
@@ -2189,7 +2189,7 @@
 			if ( !pPlayer->CanCastSpell(uRequiredMana) )
 				break;
 			pSpellSprite.stru_24.Reset();
-			pSpellSprite.spell_id = pCastSpell->spellnum;
+			pSpellSprite.spell_id = pCastSpell->uSpellID;
 			pSpellSprite.spell_level = v2;
 			pSpellSprite.spell_skill = v731;
 			pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
@@ -2222,14 +2222,14 @@
 			{
 				ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed
 				pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
-				pCastSpell->spellnum = 0;
+				pCastSpell->uSpellID = 0;
 				continue;
 			}
 			if ( !pPlayer->CanCastSpell(uRequiredMana) )
 				break;
 			pSpellSprite.uType = 4090;
 			pSpellSprite.stru_24.Reset();
-			pSpellSprite.spell_id = pCastSpell->spellnum;
+			pSpellSprite.spell_id = pCastSpell->uSpellID;
 			pSpellSprite.spell_level = v2;
 			pSpellSprite.spell_skill = v731;
 			pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
@@ -2271,10 +2271,10 @@
 			LODWORD(v733) = v330;
 			if ( !pPlayer->CanCastSpell(uRequiredMana) )
 				break;
-			pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 0);
-			pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 1);
-			pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 2);
-			pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 3);
+			pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 0);
+			pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 1);
+			pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 2);
+			pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 3);
 
 			pParty->pPartyBuffs[PARTY_BUFF_DETECT_LIFE].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, 0, 0, 0);
 			LODWORD(v727) = 1;
@@ -2297,7 +2297,7 @@
 			v342 = pCastSpell->spell_target_pid;
 			if ( v342 == 0 )
 			{
-				pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, pCastSpell->uPlayerID_2);
+				pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, pCastSpell->uPlayerID_2);
 
 				pParty->pPlayers[pCastSpell->uPlayerID_2].pPlayerBuffs[PLAYER_BUFF_FATE].Apply(pParty->uTimePlayed + 1280, v731, amount, 0, 0);
 				LODWORD(v727) = 1;
@@ -2351,7 +2351,7 @@
 					break;
 				}
 			}
-			pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, pCastSpell->uPlayerID_2);
+			pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, pCastSpell->uPlayerID_2);
 			LODWORD(v727) = 1;
 			break;
 		}
@@ -2365,7 +2365,7 @@
 				break;
 			if ( v731 == 1 || v731 == 2 )
 			{
-				pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, pCastSpell->uPlayerID_2);
+				pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, pCastSpell->uPlayerID_2);
 				pParty->pPlayers[pCastSpell->uPlayerID_2].pPlayerBuffs[PLAYER_BUFF_PRESERVATION].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, 0, 0, 0);
 				LODWORD(v727) = 1;
 				break;
@@ -2375,7 +2375,7 @@
 			v357 = pParty->pPlayers;//[0].pPlayerBuffs[11];
 			do
 			{
-				pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, a2);
+				pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, a2);
 				v357->pPlayerBuffs[PLAYER_BUFF_PRESERVATION].Apply(pParty->uTimePlayed + v717, v731, 0, 0, 0);
 				++a2;
 				++v357;// = (SpellBuff *)((char *)v357 + 6972);
@@ -2396,7 +2396,7 @@
 			pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xFFFFFFu, 0xC0u);
 			++pSpellSprite.uType;
 			pSpellSprite.stru_24.Reset();
-			pSpellSprite.spell_id = pCastSpell->spellnum;
+			pSpellSprite.spell_id = pCastSpell->uSpellID;
 			pSpellSprite.spell_level = v2;
 			pSpellSprite.spell_skill = v731;
 			pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
@@ -2513,7 +2513,7 @@
 					}
 					v388 = _v733;
 
-					pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, LOWORD(v682[_v733]) - 1);
+					pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, LOWORD(v682[_v733]) - 1);
 					_v733 = v388 + 1;
 				}
 				while ( v388 + 1 < v730 );
@@ -2564,7 +2564,7 @@
 				}
 				pParty->pPlayers[pCastSpell->uPlayerID_2].SetCondition(1u, 1);
 				pParty->pPlayers[pCastSpell->uPlayerID_2].sHealth = 1;
-				pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, pCastSpell->uPlayerID_2);
+				pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, pCastSpell->uPlayerID_2);
 			}
 			LODWORD(v727) = 1;
 			break;
@@ -2583,7 +2583,7 @@
 			if ( !pPlayer->CanCastSpell(uRequiredMana) )
 				break;
 
-			pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, pCastSpell->uPlayerID_2);
+			pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, pCastSpell->uPlayerID_2);
 			v323 = pCastSpell->uPlayerID_2;
 			v324 = (char *)&pParty->pPlayers[v323].pConditions[12];
 			if ( !pParty->pPlayers[v323].pConditions[12] )
@@ -2620,7 +2620,7 @@
 			if ( !pPlayer->CanCastSpell(uRequiredMana) )
 				break;
 
-			pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, pCastSpell->uPlayerID_2);
+			pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, pCastSpell->uPlayerID_2);
 			v323 = pCastSpell->uPlayerID_2;
 			v324 = (char *)&pParty->pPlayers[v323].pConditions[3];
 			if ( !pParty->pPlayers[v323].pConditions[3] )
@@ -2722,7 +2722,7 @@
 			}
 			ShowStatusBarString(pTmpBuf2.data(), 2u);
 			pSpellSprite.stru_24.Reset();
-			pSpellSprite.spell_id = pCastSpell->spellnum;
+			pSpellSprite.spell_id = pCastSpell->uSpellID;
 			pSpellSprite.spell_level = v2;
 			pSpellSprite.spell_skill = v731;
 			pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
@@ -2775,7 +2775,7 @@
 				pActors[v426].pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Long;
 			}
 			pSpellSprite.stru_24.Reset();
-			pSpellSprite.spell_id = pCastSpell->spellnum;
+			pSpellSprite.spell_id = pCastSpell->uSpellID;
 			pSpellSprite.spell_level = v2;
 			pSpellSprite.spell_skill = v731;
 			v60 = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
@@ -2825,7 +2825,7 @@
 				v731, 0, 0, 0);
 			}
 			pSpellSprite.stru_24.Reset();
-			pSpellSprite.spell_id = pCastSpell->spellnum;
+			pSpellSprite.spell_id = pCastSpell->uSpellID;
 			pSpellSprite.spell_level = v2;
 			pSpellSprite.spell_skill = v731;
 			v60 = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
@@ -2866,7 +2866,7 @@
 			pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xA0A0Au, 0xC0u);
 			++pSpellSprite.uType;
 			pSpellSprite.stru_24.Reset();
-			pSpellSprite.spell_id = pCastSpell->spellnum;
+			pSpellSprite.spell_id = pCastSpell->uSpellID;
 			pSpellSprite.spell_level = v2;
 			pSpellSprite.spell_skill = v731;
 			pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
@@ -2907,7 +2907,7 @@
 			if ( !pPlayer->CanCastSpell(uRequiredMana) )
 				break;
 
-			pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, pCastSpell->uPlayerID_2);
+			pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, pCastSpell->uPlayerID_2);
 			v440 = pCastSpell->uPlayerID_2;
 			if ( HIDWORD(pParty->pPlayers[v440].pConditions[5]) | LODWORD(pParty->pPlayers[v440].pConditions[5]) )
 			{
@@ -3018,7 +3018,7 @@
 			if ( !pPlayer->CanCastSpell(uRequiredMana) )
 				break;
 
-			pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, pCastSpell->uPlayerID_2);
+			pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, pCastSpell->uPlayerID_2);
 			v323 = pCastSpell->uPlayerID_2;
 			v324 = (char *)&pParty->pPlayers[v323].pConditions[1];
 			if ( !pParty->pPlayers[v323].pConditions[1] )
@@ -3057,7 +3057,7 @@
 			if (!v460)
 			{
 				pParty->pPlayers[pCastSpell->uPlayerID_2].Heal(amount);
-				pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, pCastSpell->uPlayerID_2);
+				pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, pCastSpell->uPlayerID_2);
 			}
 			else
 			{
@@ -3100,7 +3100,7 @@
 			if ( !pPlayer->CanCastSpell(uRequiredMana) )
 				break;
 
-			pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, pCastSpell->uPlayerID_2);
+			pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, pCastSpell->uPlayerID_2);
 			v470 = pCastSpell->uPlayerID_2;
 			if ( !(HIDWORD(pParty->pPlayers[v470].pConditions[6]) | LODWORD(pParty->pPlayers[v470].pConditions[6]))
 				&& !(HIDWORD(pParty->pPlayers[v470].pConditions[8]) | LODWORD(pParty->pPlayers[v470].pConditions[8]))
@@ -3143,10 +3143,10 @@
 			if ( !pPlayer->CanCastSpell(uRequiredMana) )
 				break;
 
-			pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 0);
-			pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 1);
-			pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 2);
-			pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 3);
+			pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 0);
+			pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 1);
+			pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 2);
+			pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 3);
 
 			pParty->pPartyBuffs[PARTY_BUFF_PROTECTION_FROM_MAGIC].Apply(pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, v2, 0, 0);
 			LODWORD(v727) = 1;
@@ -3160,10 +3160,10 @@
 				break;
 			if ( v731 == 4 )
 			{
-				pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 0);
-				pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 1);
-				pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 2);
-				pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 3);
+				pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 0);
+				pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 1);
+				pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 2);
+				pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 3);
 				v732 = (int)v733 << 7;
 				v717 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335);
 				pParty->pPlayers[0].pPlayerBuffs[PLAYER_BUFF_HAMMERHANDS].Apply(pParty->uTimePlayed + v717, 4u, v2, v2, 0);
@@ -3174,7 +3174,7 @@
 				LODWORD(v727) = 1;
 				break;
 			}
-			pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, pCastSpell->uPlayerID_2);
+			pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, pCastSpell->uPlayerID_2);
 
 			pParty->pPlayers[pCastSpell->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);
 			LODWORD(v727) = 1;
@@ -3189,7 +3189,7 @@
 			if ( !pPlayer->CanCastSpell(uRequiredMana) )
 				break;
 
-			pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, pCastSpell->uPlayerID_2);
+			pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, pCastSpell->uPlayerID_2);
 			v498 = pCastSpell->uPlayerID_2;
 			if ( !(HIDWORD(pParty->pPlayers[v498].pConditions[7]) | LODWORD(pParty->pPlayers[v498].pConditions[7]))
 				&& !(HIDWORD(pParty->pPlayers[v498].pConditions[9]) | LODWORD(pParty->pPlayers[v498].pConditions[9]))
@@ -3235,7 +3235,7 @@
 			int v1 = 0;
 			do
 			{
-				pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, v1);
+				pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, v1);
 				v501->Heal(amount);
 				++v501;
 				++v1;
@@ -3258,7 +3258,7 @@
 			v688.y = 0;
 			v688.z = 0;
 			pSpellSprite.stru_24.Reset();
-			pSpellSprite.spell_id = pCastSpell->spellnum;
+			pSpellSprite.spell_id = pCastSpell->uSpellID;
 			pSpellSprite.spell_level = v2;
 			pSpellSprite.spell_skill = v731;
 			pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
@@ -3327,7 +3327,7 @@
 			{
 				ShowStatusBarString(pGlobalTXT_LocalizationStrings[648], 2);  // This character can't summon any more monsters!
 				pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
-				pCastSpell->spellnum = 0;
+				pCastSpell->uSpellID = 0;
 				continue;
 			}
 			if ( !pPlayer->CanCastSpell(uRequiredMana) )
@@ -3350,10 +3350,10 @@
 			if ( !pPlayer->CanCastSpell(uRequiredMana) )
 				break;
 
-			pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 0);
-			pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 1);
-			pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 2);
-			pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 3);
+			pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 0);
+			pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 1);
+			pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 2);
+			pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 3);
 
 			pParty->pPartyBuffs[PARTY_BUFF_DAY_OF_GODS].Apply(pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, amount, 0, 0);
 			LODWORD(v727) = 1;
@@ -3366,7 +3366,7 @@
 			{
 				ShowStatusBarString(pGlobalTXT_LocalizationStrings[497], 2);  // Can't cast Prismatic Light outdoors!
 				pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
-				pCastSpell->spellnum = 0;
+				pCastSpell->uSpellID = 0;
 				continue;
 			}
 			if ( !pPlayer->CanCastSpell(uRequiredMana) )
@@ -3377,7 +3377,7 @@
 			v694.y = 0;
 			v694.z = 0;
 			pSpellSprite.stru_24.Reset();
-			pSpellSprite.spell_id = pCastSpell->spellnum;
+			pSpellSprite.spell_id = pCastSpell->uSpellID;
 			pSpellSprite.spell_level = v2;
 			pSpellSprite.spell_skill = v731;
 			pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
@@ -3425,10 +3425,10 @@
 			if ( !pPlayer->CanCastSpell(uRequiredMana) )
 				break;
 
-			pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 0);
-			pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 1);
-			pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 2);
-			pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 3);
+			pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 0);
+			pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 1);
+			pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 2);
+			pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 3);
 
 			v732 = v730 << 7;
 			v549 = (double)(v730 << 7) * 0.033333335;
@@ -3471,10 +3471,10 @@
 			*((float *)&v733) = (double)v732 * 0.033333335;
 			do
 			{
-				pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 0);
-				pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 1);
-				pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 2);
-				pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, 3);
+				pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 0);
+				pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 1);
+				pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 2);
+				pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 3);
 
 				//((SpellBuff *)(v553 + 6056))->Apply(
 				v553->pPlayerBuffs[4].Apply((signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733)), v731, v730, 0, 0);
@@ -3501,7 +3501,7 @@
 			{
 				ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed
 				pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
-				pCastSpell->spellnum = 0;
+				pCastSpell->uSpellID = 0;
 				continue;
 			}
 			if ( !pPlayer->CanCastSpell(uRequiredMana) )
@@ -3524,7 +3524,7 @@
 				*(int *)(_this->uItemID + 6460) = v565;
 				v567 = (*v566)->GetMaxMana();
 				*(int *)(_this->uItemID + 6464) = v567;
-				pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, a2);
+				pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, a2);
 				++a2;
 				_this = (ItemGen *)((char *)_this + 4);
 			}
@@ -3557,7 +3557,7 @@
 			if (!v576)
 			{
 				v585 = (char *)&pParty->pPlayers[pCastSpell->uPlayerID_2];
-				pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, pCastSpell->uPlayerID_2);
+				pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, pCastSpell->uPlayerID_2);
 				if ( *((_QWORD *)v585 + 14) )
 				{
 				((Player *)v585)->SetCondition(0x11u, 1);
@@ -3573,7 +3573,7 @@
 			{
 				ShowStatusBarString(pGlobalTXT_LocalizationStrings[496], 2);  // No valid target exists!
 				pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
-				pCastSpell->spellnum = 0;
+				pCastSpell->uSpellID = 0;
 				continue;
 			}
 			v578 = (int)&pActors[(int)v577];
@@ -3582,12 +3582,12 @@
 			{
 				ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed
 				pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
-				pCastSpell->spellnum = 0;
+				pCastSpell->uSpellID = 0;
 				continue;
 			}
 			++pSpellSprite.uType;
 			pSpellSprite.stru_24.Reset();
-			pSpellSprite.spell_id = pCastSpell->spellnum;
+			pSpellSprite.spell_id = pCastSpell->uSpellID;
 			pSpellSprite.spell_level = v2;
 			pSpellSprite.spell_skill = v731;
 			pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
@@ -3656,7 +3656,7 @@
 
 				ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed
 				pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
-				pCastSpell->spellnum = 0;
+				pCastSpell->uSpellID = 0;
 				continue;
 			}
 			v592 = _v733;
@@ -3688,7 +3688,7 @@
 				break;
 			auto _v726 = ((signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360);
 			pSpellSprite.stru_24.Reset();
-			pSpellSprite.spell_id = pCastSpell->spellnum;
+			pSpellSprite.spell_id = pCastSpell->uSpellID;
 			pSpellSprite.spell_level = v2;
 			pSpellSprite.spell_skill = v731;
 			pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
@@ -3754,7 +3754,7 @@
 			{
 				ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed
 				pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
-				pCastSpell->spellnum = 0;
+				pCastSpell->uSpellID = 0;
 				continue;
 			}
 			pActor->pActorBuffs[9].Reset();
@@ -3762,7 +3762,7 @@
 			pActor->pActorBuffs[12].Apply(pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335),
 				v731, 0, 0, 0);
 			pSpellSprite.stru_24.Reset();
-			pSpellSprite.spell_id = pCastSpell->spellnum;
+			pSpellSprite.spell_id = pCastSpell->uSpellID;
 			pSpellSprite.spell_level = v2;
 			pSpellSprite.spell_skill = v731;
 			v60 = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
@@ -3838,7 +3838,7 @@
 			{
 				ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed
 				pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
-				pCastSpell->spellnum = 0;
+				pCastSpell->uSpellID = 0;
 				continue;
 			}
 			v610 = 76 * v609;
@@ -3883,7 +3883,7 @@
 				break;
 			if ( v731 != 3 && v731 != 4 )
 			{
-				pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, pCastSpell->uPlayerID_2);
+				pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, pCastSpell->uPlayerID_2);
 				pParty->pPlayers[pCastSpell->uPlayerID_2].pPlayerBuffs[PLAYER_BUFF_PAIN_REFLECTION].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, amount, v716, 0);
 				LODWORD(v727) = 1;
 				break;
@@ -3893,7 +3893,7 @@
 			v619 = pParty->pPlayers;//[0].pPlayerBuffs[10];
 			do
 			{
-				pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, a2);
+				pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, a2);
 				v619->pPlayerBuffs[PLAYER_BUFF_PAIN_REFLECTION].Apply(pParty->uTimePlayed + v717, v731, amount, v716, 0);
 				++a2;
 				++v619;
@@ -3913,7 +3913,7 @@
 			v707.y = 0;
 			v707.z = 0;
 			pSpellSprite.stru_24.Reset();
-			pSpellSprite.spell_id = pCastSpell->spellnum;
+			pSpellSprite.spell_id = pCastSpell->uSpellID;
 			pSpellSprite.spell_level = v2;
 			pSpellSprite.spell_skill = v731;
 			pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType);
@@ -3978,7 +3978,7 @@
 						v726->sHealth = v726->GetMaxHealth();
 					v635 = _v733;
 
-					pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->spellnum, WORD2(v733));
+					pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, WORD2(v733));
 					_v733 = v635 + 1;
 				}
 				while ( v635 + 1 < v730 );
@@ -3993,7 +3993,7 @@
 			{
 				ShowStatusBarString(pGlobalTXT_LocalizationStrings[499], 2);  // Can't cast Armageddon indoors!
 				pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
-				pCastSpell->spellnum = 0;
+				pCastSpell->uSpellID = 0;
 				continue;
 			}
 			if ( v731 == 4)
@@ -4004,7 +4004,7 @@
 			{
 				ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed
 				pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
-				pCastSpell->spellnum = 0;
+				pCastSpell->uSpellID = 0;
 				continue;
 			}
 			if ( !pPlayer->CanCastSpell(uRequiredMana) )
@@ -4034,10 +4034,10 @@
 		default:
 			break;
 	}
-	if ( pCastSpell->field_8 & 0x20 )
+	if ( pCastSpell->uFlags & 0x20 )
 	{
 		if ( v727 != 0.0 )
-			pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[pCastSpell->spellnum], 0, 0, -1, 0, pCastSpell->sound_id, 0, 0);
+			pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[pCastSpell->uSpellID], 0, 0, -1, 0, pCastSpell->sound_id, 0, 0);
 	}
 	else
 	{
@@ -4060,29 +4060,29 @@
 		{
 			pPlayer->PlaySound(SPEECH_49, 0);
 			if ( v727 != 0.0 )
-				pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[pCastSpell->spellnum], 0, 0, -1, 0, pCastSpell->sound_id, 0,	0);
+				pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[pCastSpell->uSpellID], 0, 0, -1, 0, pCastSpell->sound_id, 0,	0);
 		}
 	}
-	pCastSpell->spellnum = 0;
+	pCastSpell->uSpellID = 0;
 	v2 = v723;
 	continue;
   }
   
 }
 //----- (00427DA0) --------------------------------------------------------
-unsigned int PushCastSpellInfo(__int16 a2, __int16 uPlayerID, __int16 skill_level, __int16 a5, int spell_sound_id)
+size_t PushCastSpellInfo(uint16_t uSpellID, uint16_t uPlayerID, __int16 skill_level, uint16_t uFlags, int spell_sound_id)
 {
   for (size_t i = 0; i < CastSpellInfoCount; i++)
   {
-    if (!pCastSpellInfo[i].spellnum)
+    if (!pCastSpellInfo[i].uSpellID)
     {
-      pCastSpellInfo[i].spellnum = a2;
+      pCastSpellInfo[i].uSpellID = uSpellID;
       pCastSpellInfo[i].uPlayerID = uPlayerID;
-      if ( a5 & 0x10 )
+      if (uFlags & 0x10)
         pCastSpellInfo[i].uPlayerID_2 = uPlayerID;
       pCastSpellInfo[i].field_6 = 0;
       pCastSpellInfo[i].spell_target_pid = 0;
-      pCastSpellInfo[i].field_8 = a5;
+      pCastSpellInfo[i].uFlags = uFlags;
       pCastSpellInfo[i].forced_spell_skill_level = skill_level;
       pCastSpellInfo[i].sound_id = spell_sound_id;
       return i;
@@ -4095,9 +4095,9 @@
 {
   for (size_t i = 0; i < CastSpellInfoCount; i++)
   {
-    if (pCastSpellInfo[i].spellnum && pCastSpellInfo[i].field_8 & 0x3CA)
+    if (pCastSpellInfo[i].uSpellID && pCastSpellInfo[i].uFlags & 0x3CA)
     {
-      pCastSpellInfo[i].spellnum = 0;
+      pCastSpellInfo[i].uSpellID = 0;
       pGUIWindow_Settings->Release();
       pGUIWindow_Settings = 0;
       pMouse->SetCursorBitmap("MICON1");
@@ -4309,9 +4309,9 @@
     if (a5 & 0x3CA)
     {
       for (uint i = 0; i < CastSpellInfoCount; ++i)
-        if (pCastSpellInfo[i].field_8 & 0x3CA)
+        if (pCastSpellInfo[i].uFlags & 0x3CA)
         {
-          pCastSpellInfo[i].spellnum = 0;
+          pCastSpellInfo[i].uSpellID = 0;
           break;
         }
     }
@@ -4319,11 +4319,11 @@
     for (uint i = 0; i < CastSpellInfoCount; ++i)
     {
       auto spell = &pCastSpellInfo[i];
-      if (!spell->spellnum)
+      if (!spell->uSpellID)
         continue;
 
-      spell->spellnum = 0;
-      if (spell->field_8 & 0x3CA)
+      spell->uSpellID = 0;
+      if (spell->uFlags & 0x3CA)
       {
         pGUIWindow_Settings->Release();
         pGUIWindow_Settings = nullptr;