diff Actor.cpp @ 1519:4c787c28ddce

Clean CastSpellInfo. (2)
author yoctozepto
date Wed, 04 Sep 2013 16:00:15 +0200
parents c3da3c2985b8
children 61458df2cb4f
line wrap: on
line diff
--- a/Actor.cpp	Wed Sep 04 15:27:01 2013 +0200
+++ b/Actor.cpp	Wed Sep 04 16:00:15 2013 +0200
@@ -294,7 +294,7 @@
 }
 
 //----- (00404AC7) --------------------------------------------------------
-void __fastcall Actor::AI_SpellAttack(unsigned int uActorID, AIDirection *pDir, int spellnum, int a4, unsigned int uSkillLevel)
+void __fastcall Actor::AI_SpellAttack(unsigned int uActorID, AIDirection *pDir, int uSpellID, int a4, unsigned int uSkillLevel)
 {
   Actor *v5; // esi@1
   unsigned int v6; // edi@1
@@ -426,25 +426,25 @@
   v117 = pDir;
   v6 = uSkillLevel & 0x3F;
   v7 = SkillToMastery(uSkillLevel);
-  if ( spellnum <= 47 )
+  if ( uSpellID <= 47 )
   {
-    if ( spellnum != 47 )
+    if ( uSpellID != 47 )
     {
-      if ( spellnum <= 18 )
+      if ( uSpellID <= 18 )
       {
-        if ( spellnum == 18 || spellnum == 2 )
+        if ( uSpellID == 18 || uSpellID == 2 )
           goto LABEL_159;
-        if ( spellnum != 5 )
+        if ( uSpellID != 5 )
         {
-          if ( spellnum == 6 )
+          if ( uSpellID == 6 )
             goto LABEL_159;
-          if ( spellnum != 9 )
+          if ( uSpellID != 9 )
           {
-            if ( spellnum != 11 )
+            if ( uSpellID != 11 )
             {
-              if ( spellnum != 15 )
+              if ( uSpellID != 15 )
               {
-                if ( spellnum != 17 )
+                if ( uSpellID != 17 )
                   return;
                 if ( (signed int)v7 <= 0 )
                   goto LABEL_20;
@@ -577,7 +577,7 @@
               return;
             }
 LABEL_159:
-            a1.uType = stru_4E3ACC[spellnum].uType;
+            a1.uType = stru_4E3ACC[uSpellID].uType;
             v119 = 0.0;
             if ( (signed int)pObjectList->uNumObjects <= 0 )
             {
@@ -598,7 +598,7 @@
             }
             a1.uObjectDescID = v82;
             a1.stru_24.Reset();
-            a1.spell_id = spellnum;
+            a1.spell_id = uSpellID;
             v83 = v5->vPosition.x;
             v84 = v5->vPosition.y;
             a1.spell_level = uSkillLevel;
@@ -660,7 +660,7 @@
               LOBYTE(v92) = v92 | 2;
               v100 = 0;
               v99 = v92;
-              v22 = (SoundID)word_4EE088_sound_ids[spellnum];
+              v22 = (SoundID)word_4EE088_sound_ids[uSpellID];
               goto LABEL_202;
             }
             return;
@@ -844,13 +844,13 @@
         v39 = 0;
         goto LABEL_79;
       }
-      if ( spellnum == 26 || spellnum == 29 )
+      if ( uSpellID == 26 || uSpellID == 29 )
         goto LABEL_159;
-      if ( spellnum != 38 )
+      if ( uSpellID != 38 )
       {
-        if ( spellnum == 39 || spellnum == 41 )
+        if ( uSpellID == 39 || uSpellID == 41 )
           goto LABEL_159;
-        if ( spellnum != 46 )
+        if ( uSpellID != 46 )
           return;
         if ( (signed int)v7 > 0 )
         {
@@ -971,9 +971,9 @@
     LOWORD(v48) = 0;
     goto LABEL_114;
   }
-  if ( spellnum <= 80 )
+  if ( uSpellID <= 80 )
   {
-    if ( spellnum == 80 )
+    if ( uSpellID == 80 )
     {
       v56 = pParty->pPartyBuffs;
       do
@@ -1019,11 +1019,11 @@
       v22 = (SoundID)word_4EE088_sound_ids[80];
       goto LABEL_202;
     }
-    if ( spellnum != 51 )
+    if ( uSpellID != 51 )
     {
-      if ( spellnum == 57 || spellnum == 65 || spellnum == 70 )
+      if ( uSpellID == 57 || uSpellID == 65 || uSpellID == 70 )
         goto LABEL_159;
-      if ( spellnum == 73 )
+      if ( uSpellID == 73 )
       {
         if ( (signed int)v7 <= 0 || (signed int)v7 > 4 )
           v51 = 0;
@@ -1048,7 +1048,7 @@
         v98 = (SoundID)16060;
         goto LABEL_222;
       }
-      if ( spellnum == 77 )
+      if ( uSpellID == 77 )
       {
         v5->sCurrentHP += 5 * v6 + 10;
         if ( v5->sCurrentHP >= (signed int)v5->pMonsterInfo.uHP )
@@ -1057,7 +1057,7 @@
         v47 = 0;
         goto LABEL_127;
       }
-      v49 = spellnum == 78;
+      v49 = uSpellID == 78;
 LABEL_158:
       if ( !v49 )
         return;
@@ -1104,7 +1104,7 @@
     v54 = 0;
     goto LABEL_142;
   }
-  if ( spellnum == 85 )
+  if ( uSpellID == 85 )
   {
     if ( (signed int)v7 > 0 )
     {
@@ -1148,7 +1148,7 @@
     v96 = 0;
     goto LABEL_221;
   }
-  if ( spellnum == 86 )
+  if ( uSpellID == 86 )
   {
     if ( (signed int)v7 > 0 )
     {
@@ -1191,13 +1191,13 @@
     v94 = 0;
     goto LABEL_212;
   }
-  if ( spellnum == 90 )
+  if ( uSpellID == 90 )
     goto LABEL_159;
-  if ( spellnum != 93 )
+  if ( uSpellID != 93 )
   {
-    if ( spellnum != 95 )
+    if ( uSpellID != 95 )
     {
-      v49 = spellnum == 97;
+      v49 = uSpellID == 97;
       goto LABEL_158;
     }
     if ( (signed int)v7 > 0 )