Mercurial > mm7
comparison mm7_4.cpp @ 1453:dfc9484ed94c
GetDayPart and Journal_Draw
author | Ritor1 |
---|---|
date | Thu, 08 Aug 2013 16:34:19 +0600 |
parents | 5930342f092b |
children | 934074e7fcc1 ff2118028c71 |
comparison
equal
deleted
inserted
replaced
1452:9add223260ce | 1453:dfc9484ed94c |
---|---|
1904 } | 1904 } |
1905 | 1905 |
1906 //----- (00495461) -------------------------------------------------------- | 1906 //----- (00495461) -------------------------------------------------------- |
1907 char *BuildDialogueString(char *lpsz, unsigned __int8 uPlayerID, ItemGen *a3, char *a4, int a5, __int64 *a6) | 1907 char *BuildDialogueString(char *lpsz, unsigned __int8 uPlayerID, ItemGen *a3, char *a4, int a5, __int64 *a6) |
1908 { | 1908 { |
1909 unsigned __int8 v6; // bl@1 | |
1910 Player *pPlayer; // ebx@3 | 1909 Player *pPlayer; // ebx@3 |
1911 //NPCData *v9; // eax@4 | 1910 char *pText; // esi@7 |
1912 //size_t v10; // eax@6 | |
1913 char *v11; // esi@7 | |
1914 //int v12; // edx@7 | |
1915 //ItemGen *v13; // edi@7 | |
1916 //char v14; // cl@8 | |
1917 //char *v15; // ecx@10 | |
1918 //int v16; // edx@10 | |
1919 int v17; // eax@10 | 1911 int v17; // eax@10 |
1920 signed __int64 v18; // qax@18 | 1912 signed __int64 v18; // qax@18 |
1921 unsigned int v19; // edi@32 | |
1922 unsigned __int8 *v20; // ebx@32 | 1913 unsigned __int8 *v20; // ebx@32 |
1923 int v21; // ecx@34 | 1914 int v21; // ecx@34 |
1924 __int16 v22; // ax@34 | 1915 int pReputation; // eax@45 |
1925 int v23; // edx@39 | |
1926 int v24; // eax@39 | |
1927 int v25; // eax@45 | |
1928 float *v26; // esi@68 | |
1929 float v27; // ST18_4@68 | |
1930 signed int v28; // eax@68 | |
1931 int v29; // eax@68 | 1916 int v29; // eax@68 |
1932 float v30; // ST18_4@72 | |
1933 signed int v31; // eax@72 | |
1934 float v32; // ST18_4@74 | |
1935 signed int v33; // eax@74 | |
1936 double v34; // st7@75 | |
1937 float v35; // ST18_4@76 | |
1938 signed int v36; // eax@76 | |
1939 float *v37; // esi@78 | |
1940 float v38; // ST18_4@78 | |
1941 int v39; // eax@78 | |
1942 float v40; // ST18_4@82 | |
1943 int v41; // eax@82 | |
1944 float v42; // ST18_4@83 | |
1945 int v43; // eax@83 | |
1946 float v44; // ST18_4@85 | |
1947 int v45; // eax@85 | |
1948 const char *v46; // eax@86 | |
1949 unsigned int v47; // eax@87 | |
1950 float v48; // ST18_4@97 | |
1951 __int64 v49; // ST14_8@107 | |
1952 int v50; // eax@107 | |
1953 int v51; // eax@108 | |
1954 Player *v52; // eax@109 | |
1955 int v53; // [sp-4h] [bp-13Ch]@107 | |
1956 int v54; // [sp+0h] [bp-138h]@107 | |
1957 __int16 v55[56]; // [sp+10h] [bp-128h]@34 | 1917 __int16 v55[56]; // [sp+10h] [bp-128h]@34 |
1958 stru351_summoned_item v56; // [sp+80h] [bp-B8h]@107 | 1918 stru351_summoned_item v56; // [sp+80h] [bp-B8h]@107 |
1959 stru351_summoned_item v57; // [sp+9Ch] [bp-9Ch]@115 | |
1960 char a1[100]; // [sp+B8h] [bp-80h]@3 | 1919 char a1[100]; // [sp+B8h] [bp-80h]@3 |
1961 unsigned int v59; // [sp+11Ch] [bp-1Ch]@3 | |
1962 //size_t v60; // [sp+120h] [bp-18h]@3 | |
1963 //Player *v61; // [sp+124h] [bp-14h]@3 | |
1964 //char *Str; // [sp+128h] [bp-10h]@1 | |
1965 int v63; // [sp+12Ch] [bp-Ch]@32 | 1920 int v63; // [sp+12Ch] [bp-Ch]@32 |
1966 //int v64; // [sp+130h] [bp-8h]@6 | 1921 |
1967 //NPCData *v65; // [sp+134h] [bp-4h]@6 | 1922 if ( IsBadStringPtrA(lpsz, 1) ) |
1968 //int packed; | |
1969 | |
1970 | |
1971 | |
1972 v6 = uPlayerID; | |
1973 //Str = lpsz; | |
1974 if ( IsBadStringPtrA(lpsz, 1u) ) | |
1975 return "Invalid String Passed"; | 1923 return "Invalid String Passed"; |
1976 | 1924 |
1977 a1[0] = 0; | 1925 a1[0] = 0; |
1978 pPlayer = &pParty->pPlayers[v6]; | 1926 pPlayer = &pParty->pPlayers[uPlayerID]; |
1979 v59 = TargetColor(255, 255, 155); | |
1980 //v61 = pPlayer; | |
1981 memset(pTmpBuf2.data(), 0, sizeof(pTmpBuf2)); | 1927 memset(pTmpBuf2.data(), 0, sizeof(pTmpBuf2)); |
1982 | 1928 |
1983 NPCData *npc = nullptr; | 1929 NPCData *npc = nullptr; |
1984 if ( dword_5C35D4 ) | 1930 if ( dword_5C35D4 ) |
1985 { | |
1986 //__debugbreak(); // fix | |
1987 npc = HouseNPCData[(unsigned int)((char *)pDialogueNPCCount + -(dword_591080 != 0))]; //- 1 | 1931 npc = HouseNPCData[(unsigned int)((char *)pDialogueNPCCount + -(dword_591080 != 0))]; //- 1 |
1988 } | |
1989 else | 1932 else |
1990 npc = GetNPCData(sDialogue_SpeakingActorNPC_ID); | 1933 npc = GetNPCData(sDialogue_SpeakingActorNPC_ID); |
1991 //v65 = v9; | 1934 |
1992 //v10 = 0; | 1935 //pText = a4; |
1993 //v64 = 0; | |
1994 | |
1995 //int i = 0; | |
1996 //if ( (signed int)v60 > 0 ) | |
1997 v11 = a4; | |
1998 | |
1999 auto len = strlen(lpsz); | 1936 auto len = strlen(lpsz); |
2000 for (int i = 0, dst = 0; i < len; ++i) | 1937 for (int i = 0, dst = 0; i < len; ++i) |
2001 { | 1938 { |
2002 //v12 = v64; | |
2003 //v13 = a3; | |
2004 //while ( 1 ) | |
2005 //{ | |
2006 char c = lpsz[i]; | 1939 char c = lpsz[i]; |
2007 if (c != '%') | 1940 if (c != '%') |
2008 pTmpBuf2[dst++] = c; | 1941 pTmpBuf2[dst++] = c; |
2009 else | 1942 else |
2010 { | 1943 { |
2011 //v15 = &lpsz[v12 + 1]; | |
2012 //v16 = (unsigned __int8)lpsz[v12 + 2]; | |
2013 //packed = 10 * (int)lpsz[v12 + 1] + lpsz[v12 + 2]; | |
2014 //v17 = packed - 528;// 10 * '0' + '0' | |
2015 v17 = 10 * (int)(lpsz[i + 1] - '0') + lpsz[i + 2] - '0'; | 1944 v17 = 10 * (int)(lpsz[i + 1] - '0') + lpsz[i + 2] - '0'; |
2016 | 1945 |
2017 switch ( v17 ) | 1946 switch ( v17 ) |
2018 { | 1947 { |
2019 case 1: | 1948 case 1://Подробнее |
2020 v11 = npc->pName; | 1949 strcat(pTmpBuf2.data(), npc->pName); |
2021 goto _continue_strcat; | 1950 dst = strlen(pTmpBuf2.data()); |
2022 case 2: | 1951 i += 2; |
2023 v11 = pPlayer->pName; | 1952 break; |
2024 goto _continue_strcat; | 1953 case 2: |
2025 case 3: | 1954 strcat(pTmpBuf2.data(), pPlayer->pName); |
2026 case 4: | 1955 dst = strlen(pTmpBuf2.data()); |
2027 v11 = a1; | 1956 i += 2; |
2028 goto _continue_strcat; | 1957 break; |
2029 case 5: | 1958 case 3: |
2030 v18 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed * 0.234375) / 60 / 60 % 24; | 1959 case 4: |
2031 v11 = pGlobalTXT_LocalizationStrings[397];// "evening" | 1960 strcat(pTmpBuf2.data(), a1); |
2032 if ( SHIDWORD(v18) <= 0 && SHIDWORD(v18) >= 0 && (unsigned int)v18 >= 5 && SHIDWORD(v18) <= 0 ) | 1961 dst = strlen(pTmpBuf2.data()); |
1962 i += 2; | |
1963 break; | |
1964 case 5: | |
1965 v18 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed * 0.234375) / 60 / 60 % 24; | |
1966 pText = pGlobalTXT_LocalizationStrings[397];// "evening" | |
1967 if ( SHIDWORD(v18) <= 0 && SHIDWORD(v18) >= 0 && (unsigned int)v18 >= 5 && SHIDWORD(v18) <= 0 ) | |
1968 { | |
1969 if ( SHIDWORD(v18) >= 0 && (unsigned int)v18 >= 11 ) | |
2033 { | 1970 { |
2034 if ( SHIDWORD(v18) >= 0 && (unsigned int)v18 >= 0xB ) | 1971 if ( v18 < 20 ) |
2035 { | 1972 pText = pGlobalTXT_LocalizationStrings[396];// "day" |
2036 if ( v18 < 20 ) | |
2037 v11 = pGlobalTXT_LocalizationStrings[396];// "day" | |
2038 } | |
2039 else | |
2040 { | |
2041 v11 = pGlobalTXT_LocalizationStrings[395];// "morning" | |
2042 } | |
2043 } | |
2044 goto _continue_strcat; | |
2045 case 6: | |
2046 if ( pPlayer->uSex ) | |
2047 v11 = pGlobalTXT_LocalizationStrings[387];// "lady" | |
2048 else | |
2049 v11 = pGlobalTXT_LocalizationStrings[385];// "sir" | |
2050 goto _continue_strcat; | |
2051 case 7: | |
2052 if ( pPlayer->uSex ) | |
2053 v11 = pGlobalTXT_LocalizationStrings[389];// "Lady" | |
2054 else | |
2055 v11 = pGlobalTXT_LocalizationStrings[386];// "Sir" | |
2056 goto _continue_strcat; | |
2057 case 8: | |
2058 v19 = 0; | |
2059 v63 = 0; | |
2060 v20 = (unsigned __int8 *)pPlayer->_guilds_member_bits; | |
2061 do | |
2062 { | |
2063 if ( (unsigned __int16)_449B57_test_bit(v20, word_4EE150[v19]) ) | |
2064 { | |
2065 v21 = v63; | |
2066 v22 = word_4EE150[v19]; | |
2067 ++v63; | |
2068 v55[v21] = v22; | |
2069 } | |
2070 ++v19; | |
2071 } | |
2072 while ( v19 < 28 ); | |
2073 if ( v63 ) | |
2074 { | |
2075 v23 = rand() % v63; | |
2076 v24 = dword_A74CDC; | |
2077 if ( dword_A74CDC == -1 ) | |
2078 { | |
2079 v24 = v23; | |
2080 dword_A74CDC = v23; | |
2081 } | |
2082 v11 = (char *)pAwards[v55[v24]].pText;//(char *)dword_723E80_award_related[2 * v55[v24]]; | |
2083 } | 1973 } |
2084 else | 1974 else |
2085 { | 1975 { |
2086 v11 = (char *)pNPCTopics[55].pText; | 1976 pText = pGlobalTXT_LocalizationStrings[395];// "morning" |
2087 } | 1977 } |
2088 //pPlayer = v61; | 1978 } |
2089 //v13 = a3; | 1979 strcat(pTmpBuf2.data(), pText); |
2090 goto _continue_strcat; | 1980 dst = strlen(pTmpBuf2.data()); |
2091 case 9: | 1981 i += 2; |
2092 if ( npc->uSex ) | 1982 break; |
2093 v11 = pGlobalTXT_LocalizationStrings[384];// "her" | 1983 case 6: |
2094 else | 1984 if ( pPlayer->uSex ) |
2095 v11 = pGlobalTXT_LocalizationStrings[383];// "his" | 1985 pText = pGlobalTXT_LocalizationStrings[387];// "lady" |
2096 goto _continue_strcat; | 1986 else |
2097 case 10: | 1987 pText = pGlobalTXT_LocalizationStrings[385];// "sir" |
2098 if ( pPlayer->uSex ) | 1988 strcat(pTmpBuf2.data(), pText); |
2099 v11 = pGlobalTXT_LocalizationStrings[389];// "Lady" | 1989 dst = strlen(pTmpBuf2.data()); |
2100 else | 1990 i += 2; |
2101 v11 = pGlobalTXT_LocalizationStrings[388];// "Lord" | 1991 break; |
2102 goto _continue_strcat; | 1992 case 7: |
2103 case 11: | 1993 if ( pPlayer->uSex ) |
2104 v25 = GetPartyReputation(); | 1994 pText = pGlobalTXT_LocalizationStrings[389];// "Lady" |
2105 if ( v25 >= 25 ) | 1995 else |
1996 pText = pGlobalTXT_LocalizationStrings[386];// "Sir" | |
1997 strcat(pTmpBuf2.data(), pText); | |
1998 dst = strlen(pTmpBuf2.data()); | |
1999 i += 2; | |
2000 break; | |
2001 case 8: | |
2002 v63 = 0; | |
2003 v20 = (unsigned __int8 *)pPlayer->_guilds_member_bits; | |
2004 for ( uint i = 0; i < 28; ++i ) | |
2005 { | |
2006 if ( (unsigned __int16)_449B57_test_bit(v20, word_4EE150[i]) ) | |
2106 { | 2007 { |
2107 v11 = pGlobalTXT_LocalizationStrings[379]; | 2008 v21 = v63; |
2009 ++v63; | |
2010 v55[v63] = word_4EE150[i]; | |
2011 } | |
2012 } | |
2013 if ( v63 ) | |
2014 { | |
2015 if ( dword_A74CDC == -1 ) | |
2016 dword_A74CDC = rand() % v63; | |
2017 pText = (char *)pAwards[v55[dword_A74CDC]].pText;//(char *)dword_723E80_award_related[2 * v55[v24]]; | |
2018 } | |
2019 else | |
2020 pText = (char *)pNPCTopics[55].pText; | |
2021 strcat(pTmpBuf2.data(), pText); | |
2022 dst = strlen(pTmpBuf2.data()); | |
2023 i += 2; | |
2024 break; | |
2025 case 9: | |
2026 if ( npc->uSex ) | |
2027 pText = pGlobalTXT_LocalizationStrings[384];// "her" | |
2028 else | |
2029 pText = pGlobalTXT_LocalizationStrings[383];// "his" | |
2030 strcat(pTmpBuf2.data(), pText); | |
2031 dst = strlen(pTmpBuf2.data()); | |
2032 i += 2; | |
2033 break; | |
2034 case 10: | |
2035 if ( pPlayer->uSex ) | |
2036 pText = pGlobalTXT_LocalizationStrings[389];// "Lady" | |
2037 else | |
2038 pText = pGlobalTXT_LocalizationStrings[388];// "Lord" | |
2039 strcat(pTmpBuf2.data(), pText); | |
2040 dst = strlen(pTmpBuf2.data()); | |
2041 i += 2; | |
2042 break; | |
2043 case 11: | |
2044 pReputation = GetPartyReputation(); | |
2045 if ( pReputation >= 25 ) | |
2046 pText = pGlobalTXT_LocalizationStrings[379]; | |
2047 else//v25 < 25 | |
2048 { | |
2049 if ( pReputation < 6 ) | |
2050 { | |
2051 if ( pReputation >= -5 )//6 >= v25 >= -5 | |
2052 pText = pGlobalTXT_LocalizationStrings[399]; | |
2053 else// v25 < -5 | |
2054 { | |
2055 if ( pReputation < -24 )//-24 > v25 | |
2056 pText = pGlobalTXT_LocalizationStrings[434]; | |
2057 else// -5 > v25 > -24 | |
2058 pText = pGlobalTXT_LocalizationStrings[402]; | |
2059 } | |
2060 } | |
2061 else//25 > v25 > 6 | |
2062 pText = pGlobalTXT_LocalizationStrings[392]; | |
2063 } | |
2064 strcat(pTmpBuf2.data(), pText); | |
2065 dst = strlen(pTmpBuf2.data()); | |
2066 i += 2; | |
2067 break; | |
2068 case 12: | |
2069 pReputation = npc->rep; | |
2070 if ( pReputation >= 25 ) | |
2071 pText = pGlobalTXT_LocalizationStrings[379]; | |
2072 else | |
2073 { | |
2074 if ( pReputation < 6 ) | |
2075 { | |
2076 if ( pReputation >= -5 ) | |
2077 pText = pGlobalTXT_LocalizationStrings[399]; | |
2078 else | |
2079 { | |
2080 if ( pReputation < -24 ) | |
2081 pText = pGlobalTXT_LocalizationStrings[434]; | |
2082 else | |
2083 pText = pGlobalTXT_LocalizationStrings[402]; | |
2084 } | |
2108 } | 2085 } |
2109 else | 2086 else |
2087 pText = pGlobalTXT_LocalizationStrings[392]; | |
2088 } | |
2089 strcat(pTmpBuf2.data(), pText); | |
2090 dst = strlen(pTmpBuf2.data()); | |
2091 i += 2; | |
2092 break; | |
2093 case 13: | |
2094 strcat(pTmpBuf2.data(), sub_495366(pPlayer->pName[0], pPlayer->uSex)); | |
2095 dst = strlen(pTmpBuf2.data()); | |
2096 i += 2; | |
2097 break; | |
2098 case 14: | |
2099 if ( npc->uSex ) | |
2100 pText = pGlobalTXT_LocalizationStrings[391];// "sister" | |
2101 else | |
2102 pText = pGlobalTXT_LocalizationStrings[390];// "brother" | |
2103 strcat(pTmpBuf2.data(), pText); | |
2104 dst = strlen(pTmpBuf2.data()); | |
2105 i += 2; | |
2106 break; | |
2107 case 15: | |
2108 strcat(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[393]);// "daughter" | |
2109 dst = strlen(pTmpBuf2.data()); | |
2110 i += 2; | |
2111 break; | |
2112 case 16: | |
2113 if ( npc->uSex ) | |
2114 pText = pGlobalTXT_LocalizationStrings[391];// "sister" | |
2115 else | |
2116 pText = pGlobalTXT_LocalizationStrings[390];// "brother" | |
2117 strcat(pTmpBuf2.data(), pText); | |
2118 dst = strlen(pTmpBuf2.data()); | |
2119 i += 2; | |
2120 break; | |
2121 case 17://текст наёмного НПС | |
2122 { | |
2123 auto pay_percentage = pNPCStats->pProfessions[npc->uProfession - 1].uHirePrice / 100; | |
2124 if ( !pay_percentage ) | |
2125 pay_percentage = 1; | |
2126 sprintf(a1, "%lu", pay_percentage); | |
2127 strcat(pTmpBuf2.data(), a1); | |
2128 dst = strlen(pTmpBuf2.data()); | |
2129 i += 2; | |
2130 break; | |
2131 } | |
2132 case 18: | |
2133 case 19: | |
2134 case 20: | |
2135 case 21: | |
2136 case 22: | |
2137 case 26: | |
2138 strncpy(a1, lpsz + i + 1, 2); | |
2139 sprintf(a1, "%lu", atoi(a1)); | |
2140 strcat(pTmpBuf2.data(), a1); | |
2141 dst = strlen(pTmpBuf2.data()); | |
2142 i += 2; | |
2143 break; | |
2144 case 23: | |
2145 if ( pMapStats->GetMapInfo(pCurrentMapName.data()) ) | |
2146 pText = pMapStats->pInfos[pMapStats->GetMapInfo(pCurrentMapName.data())].pName; | |
2147 else | |
2148 pText = pGlobalTXT_LocalizationStrings[394];// "Unknown" | |
2149 strcat(pTmpBuf2.data(), pText); | |
2150 dst = strlen(pTmpBuf2.data()); | |
2151 i += 2; | |
2152 break; | |
2153 case 24://название товара в продаже | |
2154 sprintfex(a1, format_4E2D80, TargetColor(255, 255, 155), a3->GetDisplayName()); | |
2155 strcat(pTmpBuf2.data(), a1); | |
2156 dst = strlen(pTmpBuf2.data()); | |
2157 i += 2; | |
2158 break; | |
2159 case 25: | |
2160 v29 = pPlayer->GetBaseBuyingPrice(a3->GetValue(), p2DEvents[(signed int)a4 - 1].fPriceMultiplier); | |
2161 switch ( a5 ) | |
2110 { | 2162 { |
2111 if ( v25 < 6 ) | 2163 case 3: |
2164 v29 = pPlayer->GetBaseSellingPrice(a3->GetValue(), p2DEvents[(signed int)a4 - 1].fPriceMultiplier); | |
2165 break; | |
2166 case 4: | |
2167 v29 = pPlayer->GetBaseIdentifyPrice(p2DEvents[(signed int)a4 - 1].fPriceMultiplier); | |
2168 break; | |
2169 case 5: | |
2170 v29 = pPlayer->GetBaseRepairPrice(a3->GetValue(), p2DEvents[(signed int)a4 - 1].fPriceMultiplier); | |
2171 break; | |
2172 case 6: | |
2173 v29 = pPlayer->GetBaseSellingPrice(a3->GetValue(), p2DEvents[(signed int)a4 - 1].fPriceMultiplier) / 2; | |
2174 break; | |
2175 } | |
2176 sprintfex(a1, "%lu", v29); | |
2177 strcat(pTmpBuf2.data(), a1); | |
2178 dst = strlen(pTmpBuf2.data()); | |
2179 i += 2; | |
2180 break; | |
2181 case 27://текст продажи | |
2182 v29 = pPlayer->GetBuyingPrice(a3->GetValue(), p2DEvents[(signed int)a4 - 1].fPriceMultiplier); | |
2183 if ( a5 == 3 ) | |
2184 { | |
2185 v29 = pPlayer->GetPriceSell(a3->GetValue(), p2DEvents[(signed int)a4 - 1].fPriceMultiplier); | |
2186 if (a3->Broken()) | |
2187 v29 = 1; | |
2188 sprintfex(a1, "%lu", v29); | |
2189 strcat(pTmpBuf2.data(), a1); | |
2190 dst = strlen(pTmpBuf2.data()); | |
2191 i += 2; | |
2192 break; | |
2193 } | |
2194 if ( a5 != 4 ) | |
2195 { | |
2196 if ( a5 == 5 ) | |
2197 v29 = pPlayer->GetPriceRepair(a3->GetValue(), p2DEvents[(signed int)a4 - 1].fPriceMultiplier); | |
2198 else | |
2112 { | 2199 { |
2113 if ( v25 >= -5 ) | 2200 if ( a5 == 6 ) |
2114 { | 2201 { |
2115 v11 = pGlobalTXT_LocalizationStrings[399]; | 2202 v29 = pPlayer->GetPriceSell(a3->GetValue(), p2DEvents[(signed int)a4 - 1].fPriceMultiplier) / 2; |
2116 } | 2203 if (a3->Broken()) |
2117 else | 2204 v29 = 1; |
2118 { | 2205 if (!v29) |
2119 if ( v25 < -24 ) | 2206 v29 = 1; |
2120 v11 = pGlobalTXT_LocalizationStrings[434]; | 2207 sprintfex(a1, "%lu", v29); |
2121 else | 2208 strcat(pTmpBuf2.data(), a1); |
2122 v11 = pGlobalTXT_LocalizationStrings[402]; | 2209 dst = strlen(pTmpBuf2.data()); |
2210 i += 2; | |
2211 break; | |
2123 } | 2212 } |
2124 } | 2213 } |
2125 else | 2214 sprintfex(a1, "%lu", v29); |
2126 { | 2215 strcat(pTmpBuf2.data(), a1); |
2127 v11 = pGlobalTXT_LocalizationStrings[392]; | 2216 dst = strlen(pTmpBuf2.data()); |
2128 } | 2217 i += 2; |
2129 } | |
2130 goto _continue_strcat; | |
2131 case 12: | |
2132 v25 = npc->rep; | |
2133 if ( v25 >= 25 ) | |
2134 { | |
2135 v11 = pGlobalTXT_LocalizationStrings[379]; | |
2136 } | |
2137 else | |
2138 { | |
2139 if ( v25 < 6 ) | |
2140 { | |
2141 if ( v25 >= -5 ) | |
2142 { | |
2143 v11 = pGlobalTXT_LocalizationStrings[399]; | |
2144 } | |
2145 else | |
2146 { | |
2147 if ( v25 < -24 ) | |
2148 v11 = pGlobalTXT_LocalizationStrings[434]; | |
2149 else | |
2150 v11 = pGlobalTXT_LocalizationStrings[402]; | |
2151 } | |
2152 } | |
2153 else | |
2154 { | |
2155 v11 = pGlobalTXT_LocalizationStrings[392]; | |
2156 } | |
2157 } | |
2158 goto _continue_strcat; | |
2159 case 13: | |
2160 v11 = sub_495366(pPlayer->pName[0], pPlayer->uSex); | |
2161 goto _continue_strcat; | |
2162 case 14: | |
2163 { | |
2164 if ( npc->uSex ) | |
2165 v11 = pGlobalTXT_LocalizationStrings[391];// "sister" | |
2166 else | |
2167 v11 = pGlobalTXT_LocalizationStrings[390];// "brother" | |
2168 goto _continue_strcat; | |
2169 } | |
2170 | |
2171 case 15: | |
2172 { | |
2173 v11 = pGlobalTXT_LocalizationStrings[393];// "daughter" | |
2174 _continue_strcat: | |
2175 strcat(pTmpBuf2.data(), v11); | |
2176 dst = strlen(pTmpBuf2.data()); | |
2177 //v64 += 2; | |
2178 i += 2; | |
2179 } | |
2180 break; | |
2181 | |
2182 case 16: | |
2183 { | |
2184 if ( npc->uSex ) | |
2185 v11 = pGlobalTXT_LocalizationStrings[391];// "sister" | |
2186 else | |
2187 v11 = pGlobalTXT_LocalizationStrings[390];// "brother" | |
2188 goto _continue_strcat; | |
2189 } | |
2190 case 17: | |
2191 { | |
2192 auto pay_percentage = pNPCStats->pProfessions[npc->uProfession - 1].uHirePrice / 100; | |
2193 if (!pay_percentage) | |
2194 pay_percentage = 1; | |
2195 | |
2196 sprintf(a1, "%lu", pay_percentage); | |
2197 v11 = a1; | |
2198 goto _continue_strcat; | |
2199 } | |
2200 | |
2201 case 18: | |
2202 case 19: | |
2203 case 20: | |
2204 case 21: | |
2205 case 22: | |
2206 case 26: | |
2207 _continue_strncpy: | |
2208 strncpy(a1, lpsz + i + 1, 2); | |
2209 v51 = atoi(a1); | |
2210 sprintf(a1, "%lu", v51); | |
2211 v11 = a1; | |
2212 goto _continue_strcat; | |
2213 | |
2214 case 23: | |
2215 { | |
2216 v47 = pMapStats->GetMapInfo(pCurrentMapName.data()); | |
2217 if ( v47 ) | |
2218 v11 = pMapStats->pInfos[v47].pName; | |
2219 else | |
2220 v11 = pGlobalTXT_LocalizationStrings[394];// "Unknown" | |
2221 goto _continue_strcat; | |
2222 } | |
2223 case 24: | |
2224 { | |
2225 v46 = a3->GetDisplayName(); | |
2226 sprintfex(a1, format_4E2D80, v59, v46); | |
2227 v11 = a1; | |
2228 goto _continue_strcat; | |
2229 } | |
2230 | |
2231 | |
2232 case 25: | |
2233 { | |
2234 v37 = &p2DEvents[(signed int)a4 - 1].fPriceMultiplier; | |
2235 v38 = *v37; | |
2236 v39 = a3->GetValue(); | |
2237 v29 = pPlayer->GetBaseBuyingPrice(v39, v38); | |
2238 switch ( a5 ) | |
2239 { | |
2240 case 3: | |
2241 v44 = *v37; | |
2242 v45 = a3->GetValue(); | |
2243 v29 = pPlayer->GetBaseSellingPrice(v45, v44); | |
2244 break; | |
2245 case 4: | |
2246 v29 = pPlayer->GetBaseIdentifyPrice(*v37); | |
2247 break; | |
2248 case 5: | |
2249 v42 = *v37; | |
2250 v43 = a3->GetValue(); | |
2251 v29 = pPlayer->GetBaseRepairPrice(v43, v42); | |
2252 break; | |
2253 case 6: | |
2254 v40 = *v37; | |
2255 v41 = a3->GetValue(); | |
2256 v29 = pPlayer->GetBaseSellingPrice(v41, v40) / 2; | |
2257 break; | 2218 break; |
2258 } | 2219 } |
2259 goto _continue_sprintf; | 2220 sprintfex(a1, "%lu", pPlayer->GetPriceIdentification(p2DEvents[(signed int)a4 - 1].fPriceMultiplier)); |
2260 } | 2221 strcat(pTmpBuf2.data(), a1); |
2261 | 2222 dst = strlen(pTmpBuf2.data()); |
2262 case 27: | 2223 i += 2; |
2263 { | 2224 break; |
2264 v26 = &p2DEvents[(signed int)a4 - 1].fPriceMultiplier; | 2225 case 28://профессия |
2265 v27 = *v26; | 2226 strcat(pTmpBuf2.data(), (char *)p2DEvents[(signed int)a4 - 1].pProprieterTitle); |
2266 v28 = a3->GetValue(); | 2227 dst = strlen(pTmpBuf2.data()); |
2267 v29 = pPlayer->GetBuyingPrice(v28, v27); | 2228 i += 2; |
2268 if ( a5 == 3 ) | 2229 break; |
2269 { | 2230 case 29: |
2270 v35 = *v26; | 2231 sprintfex(a1, "%lu", pPlayer->GetPriceIdentification(p2DEvents[(signed int)a4 - 1].fPriceMultiplier)); |
2271 v36 = a3->GetValue(); | 2232 strcat(pTmpBuf2.data(), a1); |
2272 v29 = pPlayer->GetPriceSell(v36, v35); | 2233 dst = strlen(pTmpBuf2.data()); |
2273 if (a3->Broken()) | 2234 i += 2; |
2274 v29 = 1; | 2235 break; |
2275 goto _continue_sprintf; | 2236 case 30: |
2276 } | 2237 if ( !a6 ) |
2277 if ( a5 != 4 ) | |
2278 { | |
2279 if ( a5 == 5 ) | |
2280 { | |
2281 v32 = *v26; | |
2282 v33 = a3->GetValue(); | |
2283 v29 = pPlayer->GetPriceRepair(v33, v32); | |
2284 } | |
2285 else | |
2286 { | |
2287 if ( a5 == 6 ) | |
2288 { | 2238 { |
2289 v30 = *v26; | 2239 strcat(pTmpBuf2.data(), a4); |
2290 v31 = a3->GetValue(); | 2240 dst = strlen(pTmpBuf2.data()); |
2291 v29 = pPlayer->GetPriceSell(v31, v30) / 2; | 2241 i += 2; |
2292 if (a3->Broken()) | 2242 break; |
2293 v29 = 1; | |
2294 if (!v29) | |
2295 v29 = 1; | |
2296 goto _continue_sprintf; | |
2297 } | 2243 } |
2298 } | 2244 sub_493F79(&v56, *a6); |
2299 _continue_sprintf: | 2245 sprintfex(a1, pGlobalTXT_LocalizationStrings[378], aMonthNames[v56.field_14_exprie_month], v56.field_C_expire_day + 1, v56.field_18_expire_year); |
2300 sprintfex(a1, "%lu", v29); | 2246 strcat(pTmpBuf2.data(), a1); |
2301 v11 = a1; | 2247 dst = strlen(pTmpBuf2.data()); |
2302 goto _continue_strcat; | 2248 i += 2; |
2303 } | 2249 break; |
2304 v34 = *v26; | |
2305 | |
2306 v48 = v34; | |
2307 v29 = pPlayer->GetPriceIdentification(v48); | |
2308 goto _continue_sprintf; | |
2309 } | |
2310 | |
2311 case 28: | |
2312 { | |
2313 //v11 = (char *)p2DEvents_minus1__10[13 * (signed int)a4]; | |
2314 v11 = (char *)p2DEvents[(signed int)a4 - 1].pProprieterTitle; | |
2315 goto _continue_strcat; | |
2316 } | |
2317 | |
2318 case 29: | |
2319 { | |
2320 //v34 = p2DEvents_minus1__20[13 * (signed int)a4]; | |
2321 v34 = p2DEvents[(signed int)a4 - 1].fPriceMultiplier; | |
2322 v48 = v34; | |
2323 v29 = pPlayer->GetPriceIdentification(v48); | |
2324 goto _continue_sprintf; | |
2325 } | |
2326 | |
2327 case 30: | |
2328 { | |
2329 if ( !a6 ) | |
2330 goto _continue_strcat; | |
2331 sub_493F79(&v57, *a6); | |
2332 v54 = v57.field_18_expire_year; | |
2333 v53 = v57.field_C_expire_day + 1; | |
2334 v50 = v57.field_14_exprie_month; | |
2335 sprintfex(a1, pGlobalTXT_LocalizationStrings[378], aMonthNames[v50], v53, v54); | |
2336 v11 = a1; | |
2337 goto _continue_strcat; | |
2338 } | |
2339 | |
2340 case 31: | 2250 case 31: |
2341 case 32: | 2251 case 32: |
2342 case 33: | 2252 case 33: |
2343 case 34: | 2253 case 34: |
2344 v52 = &pParty->pPlayers[v17 - 31]; | 2254 strcat(pTmpBuf2.data(), pParty->pPlayers[v17 - 31].pName); |
2345 v11 = v52->pName; | 2255 dst = strlen(pTmpBuf2.data()); |
2346 goto _continue_strcat; | 2256 i += 2; |
2347 | 2257 break; |
2348 default: | 2258 default: |
2349 if ( v17 <= 50 || v17 > 70 ) | 2259 if ( v17 <= 50 || v17 > 70 ) |
2350 goto _continue_strncpy; | 2260 { |
2261 strncpy(a1, lpsz + i + 1, 2); | |
2262 sprintf(a1, "%lu", atoi(a1)); | |
2263 strcat(pTmpBuf2.data(), a1); | |
2264 dst = strlen(pTmpBuf2.data()); | |
2265 i += 2; | |
2266 break; | |
2267 } | |
2351 if ( v17 - 51 >= 20 ) | 2268 if ( v17 - 51 >= 20 ) |
2352 goto _continue_strcat; | 2269 { |
2353 v49 = pParty->field_3C._s_times[v17-51]; | 2270 strcat(pTmpBuf2.data(), a4); |
2354 | 2271 dst = strlen(pTmpBuf2.data()); |
2355 sub_493F79(&v56, v49); | 2272 i += 2; |
2356 v54 = v56.field_18_expire_year; | 2273 break; |
2357 v53 = v56.field_C_expire_day + 1; | 2274 } |
2358 v50 = v56.field_14_exprie_month; | 2275 sub_493F79(&v56, pParty->field_3C._s_times[v17-51]); |
2359 sprintfex(a1, pGlobalTXT_LocalizationStrings[378], aMonthNames[v50], v53, v54); | 2276 sprintfex(a1, pGlobalTXT_LocalizationStrings[378], aMonthNames[v56.field_14_exprie_month], v56.field_C_expire_day + 1, v56.field_18_expire_year); |
2360 v11 = a1; | 2277 strcat(pTmpBuf2.data(), a1); |
2361 goto _continue_strcat; | 2278 dst = strlen(pTmpBuf2.data()); |
2279 i += 2; | |
2280 break; | |
2362 } | 2281 } |
2363 } | 2282 } |
2364 } | 2283 } |
2365 return pTmpBuf2.data(); | 2284 return pTmpBuf2.data(); |
2366 } | 2285 } |