diff mm7_3.cpp @ 174:4ae88cd19c30

Обращённый набор изменений: e6db0995ac4b
author Ritor1
date Fri, 15 Feb 2013 10:26:57 +0600
parents a8c700f3f5ec
children 05682713195c
line wrap: on
line diff
--- a/mm7_3.cpp	Fri Feb 15 10:06:47 2013 +0600
+++ b/mm7_3.cpp	Fri Feb 15 10:26:57 2013 +0600
@@ -16484,9 +16484,9 @@
   }
   v51.DrawTitleText(pFontArrus, 483, 112, v2, pTmpBuf, 3);
   pParty->GetPartyFame();
-  if ( (signed int)uDialogueType > DIALOGUE_ARENA_WELCOME )
-  {
-    if ( uDialogueType == DIALOGUE_ARENA_FIGHT_NOT_OVER_YET )
+  if ( (signed int)uDialogueType > 89 )
+  {
+    if ( uDialogueType == 90 )
     {
       pWindow.uFrameWidth = 460;
       pWindow.uFrameZ = 452;
@@ -16504,7 +16504,7 @@
       pDialogueWindow->DrawText(pFontArrus, 13, 354 - v12, 0, v13, 0, 0, 0);
       goto LABEL_42;
     }
-    if ( uDialogueType == DIALOGUE_ARENA_REWARD )
+    if ( uDialogueType == 91 )
     {
       sprintf(v4, pGlobalTXT_LocalizationStrings[576], dword_F8B1B4);// "Congratulations on your win: here's your stuff: %u gold."
       pInString = v4;
@@ -16525,7 +16525,7 @@
       pDialogueWindow->DrawText(pOutString, 13, 354 - v12, v8, v13, v8, v8, v8);
       goto LABEL_42;
     }
-    if ( uDialogueType == DIALOGUE_ARENA_ALREADY_WON )
+    if ( uDialogueType == 92 )
     {
       v7 = pGlobalTXT_LocalizationStrings[582]; // "You already won this trip to the Arena:"
       v8 = 0;
@@ -16549,7 +16549,7 @@
   }
   else
   {
-    if ( uDialogueType == DIALOGUE_ARENA_WELCOME )
+    if ( uDialogueType == 89 )
     {
       v7 = pGlobalTXT_LocalizationStrings[574]; // "Welcome to the Arena of Life and Death.  Remember, you are only allowed one arena combat per visit.  To fight an arena battle, select the option that best describes your abilities and return to me- if you survive:"
       v8 = 0;
@@ -16570,7 +16570,7 @@
       pDialogueWindow->DrawText(pOutString, 13, 354 - v12, v8, v13, v8, v8, v8);
       goto LABEL_42;
     }
-    if ( uDialogueType == DIALOGUE_13 )
+    if ( uDialogueType == 13 )
     {
       v5 = 5 * pNPC->uProfession;
       v6 = (char *)*(&pNPCStats->field_13A64 + v5);
@@ -16593,11 +16593,11 @@
       pDialogueWindow->DrawText(pOutString, 13, 354 - v12, v8, v13, v8, v8, v8);
       goto LABEL_42;
     }
-    if ( (signed int)uDialogueType > DIALOGUE_18 )
-    {
-      if ( (signed int)uDialogueType > DIALOGUE_24 )
-      {
-        if ( uDialogueType == DIALOGUE_77 )
+    if ( (signed int)uDialogueType > 18 )
+    {
+      if ( (signed int)uDialogueType > 24 )
+      {
+        if ( uDialogueType == 77 )
         {
           v5 = 5 * pNPC->uProfession;
           if ( byte_F8B1EC )
@@ -16705,9 +16705,9 @@
     {
       v8 = 0;
       if ( pNPC->uFlags & 0x80 )
-        v9 = (char *)pNPCStats->pProfessions[pNPC->uProfession].pDismissText;
-      else
-        v9 = (char *)pNPCStats->pProfessions[pNPC->uProfession].pJoinText;
+        v9 = (char *)*(&pNPCStats->field_13A68 + 5 * pNPC->uProfession);
+      else
+        v9 = (char *)*(&pNPCStats->field_13A64 + 5 * pNPC->uProfession); //"Invalid String Passed"
       v10 = sub_495461(v9, uActiveCharacter - 1, 0, 0, 0, 0);
 LABEL_32:
       pInString = v10;
@@ -16950,23 +16950,18 @@
   NPCData *result; // eax@5
   int v3; // esi@9
   int v4; // ecx@9
-  //int v5; // edx@9
-  //NPCData *v6; // eax@9
+  int v5; // edx@9
+  NPCData *v6; // eax@9
   char *v7; // ebx@14
   NPCData *v8; // edi@14
   char v9; // al@22
-  char v10;
-  //std::string v10; // [sp-18h] [bp-2Ch]@4
-  int v11;
-  //const char *v11; // [sp-8h] [bp-1Ch]@4
+  std::string v10; // [sp-18h] [bp-2Ch]@4
+  const char *v11; // [sp-8h] [bp-1Ch]@4
   int v12; // [sp-4h] [bp-18h]@4
-  int v13; 
-  char *v14;
-  //std::string *v13; // [sp+Ch] [bp-8h]@4
+  std::string *v13; // [sp+Ch] [bp-8h]@4
   int a3; // [sp+13h] [bp-1h]@4
-  int i;
-
-  /*v1 = npcid;
+
+  v1 = npcid;
   if ( (npcid & 0x80000000u) == 0 )
   {
     if ( (signed int)npcid < 5000 )
@@ -17021,60 +17016,6 @@
     else
       result = &pParty->pHirelings[(unsigned __int8)v9];
   }
-  return result;*/
-  v1 = npcid;
-  if ( npcid >= 0 )
-  {
-    if ( npcid < 5000 )
-    {
-      if ( npcid >= 501 )
-      {
-        MessageBoxW(nullptr, L"NPC id exceeds MAX_DATA!", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Events.cpp:1984", 0);
-      }
-      return &pNPCStats->pNewNPCData[v1 - 1];
-    }
-    return &pNPCStats->array_13EF4[npcid - 5000];
-  }
-
-
-  if ( npcid >= 5000 )
-    return &pNPCStats->array_13EF4[npcid - 5000];
-  if (uDialogue_SpeakingActorNPC_ID >= 0)
-  {
-    result = 0;
-  }
-  else
-  {
-    v3 = uDialogue_SpeakingActorNPC_ID - 1;
-    v4 = 0;
-
-    for (i = 0; i < 4; ++i)
-    {
-      if (pParty->pHirelings[i].pName)
-        pTmpBuf[v4++] = i;
-    }
-
-    if (pNPCStats->uNumNewNPCs > 0)
-    {
-      for (i = 0; i < pNPCStats->uNumNewNPCs; ++i)
-      {
-        if (pNPCStats->pNewNPCData[i].uFlags & 0x80)
-        {
-          if (!pParty->pHirelings[0].pName || strcmp((char *)pNPCStats->pNewNPCData[i].pName, (char *)pParty->pHirelings[0].pName))
-          {
-            if (!pParty->pHirelings[1].pName || strcmp((char *)pNPCStats->pNewNPCData[i].pName, (char *)pParty->pHirelings[1].pName))
-              pTmpBuf[v4++] = i + 2;
-          }
-        }
-      }
-    }
-
-    v9 = pTmpBuf[v3];
-    if ( v9 >= 2 )
-     result = &pNPCStats->pNPCData[499 + v9];
-    else
-      result = &pParty->pHirelings[v9];
-  }
   return result;
 }