From e77f8f2bd68fae3be42d8c695bfafc27e4b05d4c Mon Sep 17 00:00:00 2001 From: Flugente Date: Thu, 4 Jun 2015 12:56:31 +0000 Subject: [PATCH] Kyle takes over the San Mona leather shop once his quest is over git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7887 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- GameVersion.cpp | 18 +++++++++--------- Strategic/LuaInitNPCs.cpp | 33 ++++++++++++++------------------- Tactical/Arms Dealer Init.cpp | 10 +++++++--- 3 files changed, 30 insertions(+), 31 deletions(-) diff --git a/GameVersion.cpp b/GameVersion.cpp index 807dbd53..06ab52ba 100644 --- a/GameVersion.cpp +++ b/GameVersion.cpp @@ -15,9 +15,9 @@ #ifdef JA2EDITOR #ifdef JA2UB - CHAR16 zVersionLabel[256] = { L"Unfinished Business - Map Editor v1.13.7884 (Development Build)" }; + CHAR16 zVersionLabel[256] = { L"Unfinished Business - Map Editor v1.13.7887 (Development Build)" }; #else - CHAR16 zVersionLabel[256] = { L"Map Editor v1.13.7884 (Development Build)" }; + CHAR16 zVersionLabel[256] = { L"Map Editor v1.13.7887 (Development Build)" }; #endif // ------------------------------ @@ -27,11 +27,11 @@ //DEBUG BUILD VERSION #ifdef JA2UB - CHAR16 zVersionLabel[256] = { L"Debug: Unfinished Business - v1.13.7884 (Development Build)" }; + CHAR16 zVersionLabel[256] = { L"Debug: Unfinished Business - v1.13.7887 (Development Build)" }; #elif defined (JA113DEMO) - CHAR16 zVersionLabel[256] = { L"Debug: JA2 Demo - v1.13.7884 (Development Build)" }; + CHAR16 zVersionLabel[256] = { L"Debug: JA2 Demo - v1.13.7887 (Development Build)" }; #else - CHAR16 zVersionLabel[256] = { L"Debug: v1.13.7884 (Development Build)" }; + CHAR16 zVersionLabel[256] = { L"Debug: v1.13.7887 (Development Build)" }; #endif #elif defined CRIPPLED_VERSION @@ -46,16 +46,16 @@ //RELEASE BUILD VERSION #ifdef JA2UB - CHAR16 zVersionLabel[256] = { L"Release Unfinished Business - v1.13.7884 (Development Build)" }; + CHAR16 zVersionLabel[256] = { L"Release Unfinished Business - v1.13.7887 (Development Build)" }; #elif defined (JA113DEMO) - CHAR16 zVersionLabel[256] = { L"Release JA2 Demo - v1.13.7884 (Development Build)" }; + CHAR16 zVersionLabel[256] = { L"Release JA2 Demo - v1.13.7887 (Development Build)" }; #else - CHAR16 zVersionLabel[256] = { L"Release v1.13.7884 (Development Build)" }; + CHAR16 zVersionLabel[256] = { L"Release v1.13.7887 (Development Build)" }; #endif #endif -CHAR8 czVersionNumber[16] = { "Build 15.06.01" }; //YY.MM.DD +CHAR8 czVersionNumber[16] = { "Build 15.06.04" }; //YY.MM.DD CHAR16 zTrackingNumber[16] = { L"Z" }; // SAVE_GAME_VERSION is defined in header, change it there diff --git a/Strategic/LuaInitNPCs.cpp b/Strategic/LuaInitNPCs.cpp index e994b880..d39e3f7b 100644 --- a/Strategic/LuaInitNPCs.cpp +++ b/Strategic/LuaInitNPCs.cpp @@ -2577,6 +2577,7 @@ BOOLEAN LuaHandleQuestCodeOnSector( INT16 sSectorX, INT16 sSectorY, INT8 bSector lua_register(_LS.L(), "CheckFact", l_CheckFact); lua_register(_LS.L(), "CheckForMissingHospitalSupplies", l_CheckForMissingHospitalSupplies); lua_register(_LS.L(), "CheckForKingpinsMoneyMissing", l_FunctionCheckForKingpinsMoneyMissing); + lua_register(_LS.L(), "SetProfileStrategicInsertionData", l_ProfilesStrategicInsertionData ); IniFunction( _LS.L(), TRUE ); IniGlobalGameSetting( _LS.L() ); @@ -4132,28 +4133,22 @@ int l_InitMapProfil (lua_State *L) static int l_ProfilesStrategicInsertionData (lua_State *L) { -UINT8 n = lua_gettop(L); -int i; - -INT32 GridNo = 0; -UINT8 ProfilID = NO_PROFILE; - - for (i= 1; i<=n; i++ ) + if ( lua_gettop( L ) >= 2 ) { - if (i == 1 ) ProfilID = lua_tointeger(L,i); - if (i == 2 ) GridNo = lua_tointeger(L,i); + UINT8 ProfilID = lua_tointeger( L, 1 ); + INT32 sGridNo = lua_tointeger( L, 2 ); + + if ( ProfilID != NO_PROFILE ) + { + gMercProfiles[ ProfilID ].sGridNo = sGridNo; + gMercProfiles[ ProfilID ].fUseProfileInsertionInfo = TRUE; + gMercProfiles[ ProfilID ].ubStrategicInsertionCode = INSERTION_CODE_GRIDNO; + gMercProfiles[ ProfilID ].usStrategicInsertionData = sGridNo; + gMercProfiles[ ProfilID ].ubMiscFlags3 = PROFILE_MISC_FLAG3_PERMANENT_INSERTION_CODE; + } } - if ( ProfilID != NO_PROFILE ) - { - gMercProfiles[ ProfilID ].sGridNo = GridNo; - gMercProfiles[ ProfilID ].fUseProfileInsertionInfo = TRUE; - gMercProfiles[ ProfilID ].ubStrategicInsertionCode = INSERTION_CODE_GRIDNO; - gMercProfiles[ ProfilID ].usStrategicInsertionData = GridNo; - gMercProfiles[ ProfilID ].ubMiscFlags3 = PROFILE_MISC_FLAG3_PERMANENT_INSERTION_CODE; - } - - return 0; + return 0; } static int l_EnvBeginRainStorm (lua_State *L) diff --git a/Tactical/Arms Dealer Init.cpp b/Tactical/Arms Dealer Init.cpp index 377ed1cf..bc725599 100644 --- a/Tactical/Arms Dealer Init.cpp +++ b/Tactical/Arms Dealer Init.cpp @@ -1140,16 +1140,20 @@ UINT32 GetArmsDealerItemTypeFromItemNumber( UINT16 usItem ) BOOLEAN IsMercADealer( UINT8 ubMercID ) { - UINT8 cnt; - // Manny is not actually a valid dealer unless a particular event sets that fact if( ( ubMercID == MANNY ) && !CheckFact( FACT_MANNY_IS_BARTENDER, 0 ) ) { return( FALSE ); } + // Flugente: if we give Kyle the deed of the leather shop, he becomes a shop owner + if ( (ubMercID == KYLE) && gubQuest[QUEST_LEATHER_SHOP_DREAM] != QUESTDONE ) + { + return(FALSE); + } + //loop through the list of arms dealers - for( cnt=0; cnt