changeset 957:1a47a988c0b8

menu Debug
author Ritor1
date Thu, 02 May 2013 15:37:16 +0600
parents e9292c58644a
children 9c2d08e42ed3
files Time.h mm7_2.cpp
diffstat 2 files changed, 130 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/Time.h	Thu May 02 11:03:26 2013 +0600
+++ b/Time.h	Thu May 02 15:37:16 2013 +0600
@@ -41,9 +41,17 @@
   int dt_in_some_format;
   unsigned int uTotalGameTimeElapsed;
 };
+
 #pragma pack(pop)
 
 
 
 extern Timer *pMiscTimer;
-extern Timer *pEventTimer;
\ No newline at end of file
+extern Timer *pEventTimer;
+
+const unsigned int Minute = 256;
+const unsigned int Hour = 60 * Minute;
+const unsigned int Day = 24 * Hour;
+const unsigned int Week = 7 * Day;
+const unsigned int Month = 4 * Week;
+const unsigned int Year = 12 * Month;
\ No newline at end of file
--- a/mm7_2.cpp	Thu May 02 11:03:26 2013 +0600
+++ b/mm7_2.cpp	Thu May 02 15:37:16 2013 +0600
@@ -6872,18 +6872,131 @@
 
         case 40006:  pParty->SetFood(pParty->uNumFoodRations + 20);   return 0;
 
-        case 40062:  pParty->alignment = PartyAlignment_Good;   return 0;
-        case 40063:  pParty->alignment = PartyAlignment_Neutral;   return 0;
-        case 40064:  pParty->alignment = PartyAlignment_Evil;   return 0;
+        case 40062:
+          pParty->alignment = PartyAlignment_Good;
+          SetUserInterface(pParty->alignment, true);
+          return 0;
+        case 40063:
+          pParty->alignment = PartyAlignment_Neutral;
+          SetUserInterface(pParty->alignment, true);
+          return 0;
+        case 40064:
+          pParty->alignment = PartyAlignment_Evil;
+          SetUserInterface(pParty->alignment, true);
+          return 0;
 
         //SubMenu "Time"
-        case 40009:  pParty->uTimePlayed += (signed __int64)((double)(7680 * (24 * 60)) * 0.033333335);   return 0;
-        case 40010:  pParty->uTimePlayed += (signed __int64)((double)(7680 * (7 * (24 * 60))) * 0.033333335);   return 0;
-        case 40011:  pParty->uTimePlayed += (signed __int64)((double)(7680 * (28 * (24 * 60))) * 0.033333335);   return 0;
-        case 40012:  pParty->uTimePlayed += (signed __int64)((double)(7680 * (12 * (28 * (24 * 60)))) * 0.033333335);   return 0;// this incorrect
+        case 40009:  pParty->uTimePlayed += Day;   return 0;
+        case 40010:  pParty->uTimePlayed += Week;   return 0;
+        case 40011:  pParty->uTimePlayed += Month;   return 0;
+        case 40012:  pParty->uTimePlayed += Year;   return 0;
 
         //SubMenu "Items"
-        case 40015:  /* generate item level 1*/;   return 0;
+        case 40015:
+        {
+          int pItemID = rand() % 500;
+          for ( uint i = 0; i < 500; ++i )
+          {
+            if ( pItemID + i > 499 )
+              pItemID = 0;
+            if ( pItemsTable->pItems[pItemID + i].uItemID_Rep_St == 1 )
+            {
+              pPlayers[uActiveCharacter]->AddItem(-1, pItemID + i);
+              return 0;
+            }
+          }
+        }
+        return 0;
+        case 40016:
+        {
+          int pItemID = rand() % 500;
+          for ( uint i = 0; i < 500; ++i )
+          {
+            if ( pItemID + i > 499 )
+              pItemID = 0;
+            if ( pItemsTable->pItems[pItemID + i].uItemID_Rep_St == 2 )
+            {
+              pPlayers[uActiveCharacter]->AddItem(-1, pItemID + i);
+              return 0;
+            }
+          }
+        }
+        return 0;
+        case 40017:
+        {
+          int pItemID = rand() % 500;
+          for ( uint i = 0; i < 500; ++i )
+          {
+            if ( pItemID + i > 499 )
+              pItemID = 0;
+            if ( pItemsTable->pItems[pItemID + i].uItemID_Rep_St == 3 )
+            {
+              pPlayers[uActiveCharacter]->AddItem(-1, pItemID + i);
+              return 0;
+            }
+          }
+        }
+        return 0;
+        case 40018:
+        {
+          int pItemID = rand() % 500;
+          for ( uint i = 0; i < 500; ++i )
+          {
+            if ( pItemID + i > 499 )
+              pItemID = 0;
+            if ( pItemsTable->pItems[pItemID + i].uItemID_Rep_St == 4 )
+            {
+              pPlayers[uActiveCharacter]->AddItem(-1, pItemID + i);
+              return 0;
+            }
+          }
+        }
+        return 0;
+        case 40019:
+        {
+          int pItemID = rand() % 500;
+          for ( uint i = 0; i < 500; ++i )
+          {
+            if ( pItemID + i > 499 )
+              pItemID = 0;
+            if ( pItemsTable->pItems[pItemID + i].uItemID_Rep_St == 5 )
+            {
+              pPlayers[uActiveCharacter]->AddItem(-1, pItemID + i);
+              return 0;
+            }
+          }
+        }
+        return 0;
+        case 40020:
+        {
+          int pItemID = rand() % 500;
+          for ( uint i = 0; i < 500; ++i )
+          {
+            if ( pItemID + i > 499 )
+              pItemID = 0;
+            if ( pItemsTable->pItems[pItemID + i].uItemID_Rep_St == 6 )
+            {
+              pPlayers[uActiveCharacter]->AddItem(-1, pItemID + i);
+              return 0;
+            }
+          }
+        }
+        return 0;
+        case 40061:
+        {
+          int pItemID = rand() % 500;
+          for ( uint i = 0; i < 500; ++i )
+          {
+            if ( pItemID + i > 499 )
+              pItemID = 0;
+            if ( pItemsTable->pItems[pItemID + i].uItemID_Rep_St > 6 )
+            {
+              pPlayers[uActiveCharacter]->AddItem(-1, pItemID + i);
+              return 0;
+            }
+          }
+        }
+        return 0;
 
       }
     }