changeset 118:acff5a5d563b

Items bonus fix
author Ritor1
date Sun, 10 Feb 2013 23:06:36 +0600
parents ff2dbca3de20
children be3c07c98861 4e35bb416dea
files Player.cpp mm7_data.cpp
diffstat 2 files changed, 21 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/Player.cpp	Sun Feb 10 18:46:10 2013 +0600
+++ b/Player.cpp	Sun Feb 10 23:06:36 2013 +0600
@@ -3389,7 +3389,7 @@
   {
     v6 = 0;
     while ( !HasItemEquipped((ITEM_EQUIP_TYPE)v6)
-         || *(int *)&this->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * *(int *)v7 + 5] != a1 )
+         || *(int *)&this->pInventoryItems[a2-1].uItemID != a1 )
     {
       ++v6;
       if ( (signed int)v6 >= 16 )
@@ -5450,12 +5450,13 @@
     {
       if ( v6->HasItemEquipped(EQUIP_TWO_HANDED) )
       {
-        v22 = v21->GetEquippedItemEquipType(1u);
+        v22 = this->GetEquippedItemEquipType(1u);
         if ( v22 >= 0 )
         {
           if ( v22 <= 2 )
           {
-            if ( v6->pEquipment.uOffHand || (v24 = v23, pItemsTable->pItems[v23].uSkillType != 4) )
+			  v23 = this->pInventoryItems[this->pEquipment.uMainHand].uItemID;
+            if ( v6->pEquipment.uOffHand || pItemsTable->pItems[v23].uSkillType != 4 )
             {
               v24 = v23;
               v26 = pItemsTable->pItems[v23].uDamageRoll;
@@ -5496,7 +5497,7 @@
     }
     if ( v6->HasItemEquipped(EQUIP_TWO_HANDED) )
     {
-      v17 = v16->GetEquippedItemEquipType(1u);
+      v17 = this->GetEquippedItemEquipType(1u);
       if ( v17 >= 0 )
       {
         if ( v17 <= 2 )
@@ -5517,15 +5518,15 @@
     }
     if ( v6->HasItemEquipped(EQUIP_TWO_HANDED) )
     {
-      v9 = v8->GetEquippedItemEquipType(1u);
+      v9 = this->GetEquippedItemEquipType(1u);
       if ( v9 >= 0 )
       {
         if ( v9 <= 2 )
         {
-          v5 = pItemsTable->pItems[v10].uDamageDice + pItemsTable->pItems[v10].uDamageMod;
+          v5 = pItemsTable->pItems[this->pInventoryItems[this->pEquipment.uMainHand].uItemID].uDamageDice + pItemsTable->pItems[this->pInventoryItems[this->pEquipment.uMainHand].uItemID].uDamageMod;
           if ( !v6->pEquipment.uOffHand )
           {
-            if ( pItemsTable->pItems[v10].uSkillType == 4 )
+            if ( pItemsTable->pItems[this->pInventoryItems[this->pEquipment.uMainHand].uItemID].uSkillType == 4 )
               ++v5;
           }
         }
@@ -5533,8 +5534,8 @@
     }
     if ( a3 || !v6->HasItemEquipped((ITEM_EQUIP_TYPE)0) || (v12 = v11->GetEquippedItemEquipType(0), v12 < 0) || v12 > 2 )
       return v5 + v62 + v61;
-    v14 = pItemsTable->pItems[v13].uDamageMod;
-    v15 = pItemsTable->pItems[v13].uDamageDice;
+    v14 = pItemsTable->pItems[this->pInventoryItems[this->pEquipment.uOffHand].uItemID].uDamageMod;
+    v15 = pItemsTable->pItems[this->pInventoryItems[this->pEquipment.uOffHand].uItemID].uDamageDice;
 LABEL_88:
     v5 += v15 + v14;
   }
@@ -6041,8 +6042,8 @@
         {
           if ( v2->HasItemEquipped(v71) )
           {
-            v11 = (PLAYER_SKILL_TYPE)pItemsTable->pItems[*(int *)&v2->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * v9->uOffHand + 5]].uSkillType;
-            LOBYTE(v12) = v10->GetActualSkillLevel(v11);
+            v11 = (PLAYER_SKILL_TYPE)pItemsTable->pItems[v2->pInventoryItems[*(_DWORD *)v9].uItemID].uEquipType;
+            LOBYTE(v12) = this->GetActualSkillLevel(v11);
             a1 = v12;
             SkillToMastery(v12);
             v13 = v11 - 5;
@@ -6099,7 +6100,7 @@
       {
         if ( v2->HasItemEquipped(v20) )
         {
-          v22 = *(int *)&v2->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * *(int *)v21 + 5];
+          v22 = this->pInventoryItems[this->pEquipment.pIndices[v20]].uItemID;
           if ( pItemsTable->pItems[v22].uEquipType <= 1u )
             break;
         }
@@ -6152,7 +6153,7 @@
           if ( v23 == PLAYER_SKILL_MACE )
           {
             v28 = __OFSUB__(v26, 2);
-            v27 = ((v26 - 2) & 0x80000000u) != 0;
+            v27 = v26 - 2 < 0;
             goto LABEL_53;
           }
 LABEL_55:
@@ -6160,7 +6161,7 @@
           return (int)((char *)v69 + v30);
         }
         v28 = __OFSUB__(v26, 3);
-        v27 = ((v26 - 3) & 0x80000000u) != 0;
+        v27 = v26 - 3 < 0;
       }
 LABEL_53:
       if ( !(v27 ^ v28) )
@@ -6184,7 +6185,7 @@
     {
       if ( v2->HasItemEquipped(v35) )
       {
-        v37 = *(int *)&v2->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * *(int *)v36 + 5];
+        v37 = *(int *)&v2->pInventoryItems[v35].uItemID;
         if ( pItemsTable->pItems[v37].uEquipType <= 1u )
           break;
       }
--- a/mm7_data.cpp	Sun Feb 10 18:46:10 2013 +0600
+++ b/mm7_data.cpp	Sun Feb 10 23:06:36 2013 +0600
@@ -663,8 +663,11 @@
 0x8B, 0x31, 0x8B, 0x33, 0x8E, 0x2F, 0x8F, 0x16, 0x8D, 0x18, 0x8C,
 0x19, 0x8C, 0x1B, 0x8E, 0x0C, 0x8C, 0x21, 0x8B, 0x0C, 0x8C, 0x18,
 0x8C, 0x2F, 0x8F
-	};
-int dword_4E5050[8];
+};
+int dword_4E5050[8] = 
+{
+0x64, 0x67, 0x61, 0x67, 0x65, 0x68, 0x6E, 0x74
+};
 int dword_4E5270[8];
 int dword_4E5490[4][7][2];
 int paredoll_array_4E54B8[3][14];