diff Party.cpp @ 151:a8f4a158e284

ActiveSkill
author Ritor1
date Tue, 27 Nov 2012 17:31:15 +0600
parents 96ab6bba8408
children e27e846bc996 2cc68f234b29
line wrap: on
line diff
--- a/Party.cpp	Mon Nov 26 09:35:24 2012 +0600
+++ b/Party.cpp	Tue Nov 27 17:31:15 2012 +0600
@@ -285,7 +285,7 @@
   int pResMagicBase; // ecx@1
   Player *pCharacter; // esi@3
   signed int uSpellBookPageCount; // edx@5
-  int v7; // eax@5
+  int pMagicSkills; // eax@5
   int uSkillIdx; // eax@11
   //unsigned __int8 v9; // zf@37
   //char v10; // sf@37
@@ -368,32 +368,36 @@
   pParty->pPlayers[3].pActiveSkills[12] = 1;        // fire
   pParty->pPlayers[3].pActiveSkills[0] = 1;         // staff
   pCharacter = &pParty->pPlayers[0];
-  uNumPlayers = 4;
-  while ( 1 )
+  //uNumPlayers = 4;
+  //while ( 1 )
+  for (uNumPlayers = 0; uNumPlayers < 4; uNumPlayers++)
   {
     if ( !pCharacter->uClass )
       *(short *)pResMagicBase = v3; //player[i].pResMagicBase
     uSpellBookPageCount = 0;
-    v7 = pResMagicBase - 5726;// Skills
-    while ( !*(short *)v7 )         //player[i].skillFire  or
-                                    //player[i].pActiveSkills[12]
+    //pMagicSkills = pPlayers[uNumPlayers].pActiveSkills[12];// Skills
+    //while ( !*(short *)pMagicSkills )         //player[i].skillFire
+	for (int i = 0; i < 9; i++)
     {
-      ++uSpellBookPageCount;
-      v7 += 2;
-      if ( uSpellBookPageCount >= 9 )
-        goto LABEL_10;
+      //++uSpellBookPageCount;
+      //pMagicSkills++;
+      //if ( uSpellBookPageCount >= 9 )
+        //goto LABEL_10;
+	    if (pPlayers[uNumPlayers].pActiveSkills[12+i])
+			++uSpellBookPageCount;
     }
     pCharacter->pNumSpellBookPage = uSpellBookPageCount;
-LABEL_10:
+//LABEL_10:
     pCharacter->uExpressionTimePassed = 0;
     Dst.Reset();
     if ( bGiveItems )
     {
       pItemsTable->GenerateItem(2, 40, &Dst);
       pCharacter->AddItem2(-1, &Dst);
-      uSkillIdx = 0;
-      v18 = 0;
-      do
+      //uSkillIdx = 0;
+      //v18 = 0;
+      //do
+	  for (uSkillIdx = 0; uSkillIdx < 36; uSkillIdx++)
       {
         if ( pCharacter->pActiveSkills[uSkillIdx] )
         {
@@ -477,12 +481,12 @@
               break;
           }
         }
-        uSkillIdx = v18 + 1;
+        //uSkillIdx = v18 + 1;
         //v11 = uSkillIdx > 36;
         //v9 = v18 == 35;
         //v10 = uSkillIdx - 35 < 0;
       }
-      while (uSkillIdx < 36);
+      //while (uSkillIdx < 36);
       pAttributes = (char *)&pCharacter->pInventoryItems[0].uAttributes;
       //v13 = 138;
       for (v13 = 138; v13 > 0; --v13)
@@ -497,9 +501,9 @@
     pCharacter->sHealth = pCharacter->GetMaxHealth();
     pCharacter->sMana = pCharacter->GetMaxMana();
     pCharacter++;
-    uNumPlayers--;
-    if (!uNumPlayers)
-      break;
+    //uNumPlayers--;
+    //if (!uNumPlayers)
+      //break;
     pResMagicBase = (int)pCharacter;
     v3 = 10;
   }