diff Items.cpp @ 296:af7e848d6def

Merge
author Nomad
date Tue, 19 Feb 2013 13:31:50 +0200
parents 640a176c030f a672f297c163
children 2a09e1d6fc8f
line wrap: on
line diff
--- a/Items.cpp	Tue Feb 19 13:29:02 2013 +0200
+++ b/Items.cpp	Tue Feb 19 13:31:50 2013 +0200
@@ -1518,8 +1518,9 @@
 //----- (00456620) --------------------------------------------------------
 void ItemsTable::GenerateItem(int treasure_level, int a3, ItemGen *out_item)
 {
-  //ItemGen *v4; // esi@1
-  //ItemsTable *v5; // edi@1
+  
+ItemGen *v4; // esi@1
+  ItemsTable *v5; // edi@1
   int v6; // ebx@3
   int *v7; // ecx@33
   //int v8; // eax@34
@@ -1567,8 +1568,8 @@
   int v50; // eax@123
   int Dst[800]; // [sp+Ch] [bp-C88h]@33
   int v52; // [sp+C8Ch] [bp-8h]@33
-  //int v53; // [sp+C90h] [bp-4h]@1
-  //int v54; // [sp+C9Ch] [bp+8h]@3
+  int v53; // [sp+C90h] [bp-4h]@1
+  int v54; // [sp+C9Ch] [bp+8h]@3
   //int v55; // [sp+CA0h] [bp+Ch]@34
   signed int v56; // [sp+CA0h] [bp+Ch]@55
   int v57; // [sp+CA0h] [bp+Ch]@62
@@ -1578,14 +1579,13 @@
   int a2b; // [sp+CA4h] [bp+10h]@101
   int a2c; // [sp+CA4h] [bp+10h]@120
 
-  //v53 = -1;
-  //v4 = pItem;
-  //v5 = this;
+  v53 = -1;
+  v5 = this;
   if (!out_item)
     out_item = (ItemGen *)pAllocator->AllocNamedChunk(out_item, sizeof(*out_item), "newItemGen");
   memset(out_item, 0, sizeof(*out_item));
 
-  auto v4 = out_item;
+  v4 = out_item;
   v6 = treasure_level - 1;
   //v54 = treasure_level - 1;
   if ( a3 )
@@ -1705,7 +1705,7 @@
       return;
     }
     v57 = 0;
-    v18 = rand() % 10;// v5->field_11684[v54];
+    v18 = rand() % v5->uChanceByTreasureLvlSumm[v54];// v5->field_11684[v54];
     v4->uItemID = 0;
     if ( v18 > 0 )
     {
@@ -1746,7 +1746,7 @@
   v20 = pItems[v4->uItemID].uEquipType;
   if ( v20 <= EQUIP_BOW )
   {
-    v37 = 10;//(int)&v5->field_1169C[4 * v54 + 48];
+    v37 = v5->uBonusChanceWpSpecial[v54];
     if ( !*(unsigned int *)v37 )
       return;
     v38 = rand() % 100;