changeset 146:1b7ca63e472e

Слияние
author Ritor1
date Mon, 19 Nov 2012 09:41:32 +0600
parents dac041fc74e8 (current diff) 4e1e3fe8502f (diff)
children 1d44b914b7bd
files Party.cpp
diffstat 3 files changed, 56 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/Party.cpp	Mon Nov 19 09:41:10 2012 +0600
+++ b/Party.cpp	Mon Nov 19 09:41:32 2012 +0600
@@ -290,7 +290,7 @@
   unsigned __int8 v9; // zf@37
   char v10; // sf@37
   unsigned __int8 v11; // of@37
-  char *v12; // eax@38
+  char *pAttributes; // eax@38
   signed int v13; // ecx@38
   int uMaxSP; // eax@42
   unsigned int v15; // [sp-4h] [bp-44h]@14
@@ -372,10 +372,11 @@
   while ( 1 )
   {
     if ( !pCharacter->uClass )
-      *(short *)pResMagicBase = v3;
+      *(short *)pResMagicBase = v3; //player[i].pResMagicBase
     uSpellBookPageCount = 0;
-    v7 = pResMagicBase - 5726;// pSpellBookPageFlags
-    while ( !*(short *)v7 )
+    v7 = pResMagicBase - 5726;// Skills
+    while ( !*(short *)v7 )         //player[i].skillFire  or
+                                    //player[i].pActiveSkills[12]
     {
       ++uSpellBookPageCount;
       v7 += 2;
@@ -402,7 +403,7 @@
               v15 = ITEM_STAFF_1;
               goto wear_item;
             case PLAYER_SKILL_SWORD:
-              v15 = 1;
+              v15 = ITEM_LONGSWORD_1;
               goto wear_item;
             case PLAYER_SKILL_DAGGER:
               v15 = ITEM_DAGGER_1;
@@ -462,7 +463,7 @@
             case PLAYER_SKILL_TRAP_DISARM:
             case PLAYER_SKILL_LEARNING:
               pCharacter->AddItem(-1, ITEM_POTION_BOTTLE);
-              v16 = 5 * ((rand() % 3) + 40);      // simple reagent
+              v16 = 5 * (rand() % 3 + 40);      // simple reagent
               goto add_item;
             case PLAYER_SKILL_DODGE:
               v16 = ITEM_BOOTS_1;
@@ -482,14 +483,13 @@
         v10 = uSkillIdx - 35 < 0;
       }
       while ( (unsigned __int8)(v10 ^ v11) | v9 );
-      v12 = (char *)&pCharacter->pInventoryItems[0].uAttributes;
+      pAttributes = (char *)&pCharacter->pInventoryItems[0].uAttributes;
       //v13 = 138;
-	  for (v13 = 138; v13 > 0; --v13)
-      //do
+      for (v13 = 138; v13 > 0; --v13)
       {
-        if ( *((int *)v12 - 5) )
-          *(int *)v12 |= 1u;
-        v12 += 36;
+        if ( *((int *)pAttributes - 5) )
+          *(int *)pAttributes |= 1;
+        pAttributes += 36;
         //--v13;
       }
       //while ( v13 );
--- a/Player.h	Mon Nov 19 09:41:10 2012 +0600
+++ b/Player.h	Mon Nov 19 09:41:32 2012 +0600
@@ -386,7 +386,50 @@
   int field_FC;
   int field_100;
   int field_104;
-  unsigned __int16 pActiveSkills[37];
+  union
+  {
+    struct
+    {
+      unsigned __int16 skillStaff;
+      unsigned __int16 skillSword;
+      unsigned __int16 skillDagger;
+      unsigned __int16 skillAxe;
+      unsigned __int16 skillSpear;
+      unsigned __int16 skillBow;
+      unsigned __int16 skillMace;
+      unsigned __int16 skillBlaster;
+      unsigned __int16 skillShield;
+      unsigned __int16 skillLeather;
+      unsigned __int16 skillChain;
+      unsigned __int16 skillPlate;
+      unsigned __int16 skillFire;
+      unsigned __int16 skillAir;
+      unsigned __int16 skillWater;
+      unsigned __int16 skillEarth;
+      unsigned __int16 skillSpirit;
+      unsigned __int16 skillMind;
+      unsigned __int16 skillBody;
+      unsigned __int16 skillLight;
+      unsigned __int16 skillDark;
+      unsigned __int16 skillItemId;
+      unsigned __int16 skillMerchant;
+      unsigned __int16 skillRepair;
+      unsigned __int16 skillBodybuilding;
+      unsigned __int16 skillMeditation;
+      unsigned __int16 skillPerception;
+      unsigned __int16 skillDiplomacy;
+      unsigned __int16 skillThievery;
+      unsigned __int16 skillDisarmTrap;
+      unsigned __int16 skillDodge;
+      unsigned __int16 skillUnarmed;
+      unsigned __int16 skillMonsterId;
+      unsigned __int16 skillArmsmaster;
+      unsigned __int16 skillStealing;
+      unsigned __int16 skillAlchemy;
+      unsigned __int16 skillLearning;
+    };
+    unsigned __int16 pActiveSkills[37];
+  };
   char field_152[64];
   PlayerSpells spellbook;
   char field_1F5[30]; // used to be [31]
--- a/mm7_3.cpp	Mon Nov 19 09:41:10 2012 +0600
+++ b/mm7_3.cpp	Mon Nov 19 09:41:32 2012 +0600
@@ -9139,21 +9139,18 @@
 {
   return 64 - (a1 >> 9);
 }
-// 47F458: using guessed type int __stdcall WorldPosToGridCellZ(int);
 
 //----- (0047F469) --------------------------------------------------------
 int __stdcall GridCellToWorldPosX(int a1)
 {
   return (a1 - 64) << 9;
 }
-// 47F469: using guessed type int __stdcall GridCellToWorldPosX(int);
 
 //----- (0047F476) --------------------------------------------------------
 int __stdcall GridCellToWorldPosZ(int a1)
 {
   return (64 - a1) << 9;
 }
-// 47F476: using guessed type int __stdcall GridCellToWorldPosZ(int);
 
 //----- (0047F4D3) --------------------------------------------------------
 void __fastcall sub_47F4D3(int band1, int band2, int band3)