From 5089f24cba4f91c6b1acbe161aad19b6170839c7 Mon Sep 17 00:00:00 2001 From: Wanne Date: Mon, 1 Jul 2013 18:34:49 +0000 Subject: [PATCH] Brother Santos Patch (by Jazz) - Brothers Santos use these same files edt and npc (151.edt and 151.npc). After use of this small patch, brothers can use separate files npc and edt. o Herve - 151.edt and 151.npc o Peter - 152.edt and 152.npc o Alberto - 153.edt and 153.npc o Carlo - 154.edt and 154.npc If the files do not exist, then the game reads default files 151.edt and 151.npc git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6183 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Tactical/Dialogue Control.cpp | 33 ++++++++++++++++++++++++++++++++- TacticalAI/NPC.cpp | 31 +++++++++++++++++++++++++++++-- 2 files changed, 61 insertions(+), 3 deletions(-) diff --git a/Tactical/Dialogue Control.cpp b/Tactical/Dialogue Control.cpp index 5a9f9afa1..a6a5abefa 100644 --- a/Tactical/Dialogue Control.cpp +++ b/Tactical/Dialogue Control.cpp @@ -1941,6 +1941,7 @@ void CreateTalkingUI( INT8 bUIHandlerID, INT32 iFaceIndex, UINT8 ubCharacterNum, CHAR8 *GetDialogueDataFilename( UINT8 ubCharacterNum, UINT16 usQuoteNum, BOOLEAN fWavFile ) { static CHAR8 zFileName[164]; + static CHAR8 zFileNameExists[164]; UINT8 ubFileNumID; // Are we an NPC OR an RPC that has not been recruited? @@ -1987,11 +1988,41 @@ CHAR8 *GetDialogueDataFilename( UINT8 ubCharacterNum, UINT16 usQuoteNum, BOOLEAN ubFileNumID = ubCharacterNum; // ATE: If we are merc profile ID #151-154, all use 151's data.... - if ( ubCharacterNum >= HERVE && ubCharacterNum <= CARLO ) + //if ( ubCharacterNum >= HERVE && ubCharacterNum <= CARLO ) + //{ + //ubFileNumID = HERVE; + //} + + if ( ubCharacterNum == HERVE ) + { + ubFileNumID = HERVE; + } + else if ( ubCharacterNum == PETER ) + { + sprintf( (char *)zFileNameExists,"NPCDATA\\%03d.EDT", PETER ); + if ( !FileExists( zFileName ) ) + ubFileNumID = HERVE; + else + ubFileNumID = PETER; + } + else if ( ubCharacterNum == ALBERTO ) + { + sprintf( (char *)zFileNameExists,"NPCDATA\\%03d.EDT", ALBERTO ); + if ( !FileExists( zFileName ) ) + ubFileNumID = HERVE; + else + ubFileNumID = ALBERTO; + } + else if ( ubCharacterNum == CARLO ) { + sprintf( (char *)zFileNameExists,"NPCDATA\\%03d.EDT", CARLO ); + if ( !FileExists( zFileName ) ) ubFileNumID = HERVE; + else + ubFileNumID = CARLO; } + // If we are character #155, check fact! if ( ubCharacterNum == MANNY && !gubFact[ FACT_MANNY_IS_BARTENDER ] ) { diff --git a/TacticalAI/NPC.cpp b/TacticalAI/NPC.cpp index 3f69f84bb..c1f156c4e 100644 --- a/TacticalAI/NPC.cpp +++ b/TacticalAI/NPC.cpp @@ -148,8 +148,35 @@ NPCQuoteInfo * LoadQuoteFile( UINT8 ubNPC ) if ( ubNPC == PETER || ubNPC == ALBERTO || ubNPC == CARLO ) { - // use a copy of Herve's data file instead! - sprintf( zFileName, "NPCData\\%03d.npc", HERVE ); + + if ( ubNPC == PETER ) + { + sprintf( zFileName, "NPCData\\%03d.npc", PETER ); + if ( !FileExists( zFileName ) ) + { + // use a copy of Herve's data file instead! + sprintf( zFileName, "NPCData\\%03d.npc", HERVE ); + } + } + else if ( ubNPC == ALBERTO ) + { + sprintf( zFileName, "NPCData\\%03d.npc", ALBERTO ); + if ( !FileExists( zFileName ) ) + { + // use a copy of Herve's data file instead! + sprintf( zFileName, "NPCData\\%03d.npc", HERVE ); + } + } + else if ( ubNPC == CARLO ) + { + sprintf( zFileName, "NPCData\\%03d.npc", CARLO ); + if ( !FileExists( zFileName ) ) + { + // use a copy of Herve's data file instead! + sprintf( zFileName, "NPCData\\%03d.npc", HERVE ); + } + } + } //else if ( ubNPC < FIRST_RPC || ubNPC >= GASTON || (ubNPC < FIRST_NPC && gMercProfiles[ ubNPC ].ubMiscFlags & PROFILE_MISC_FLAG_RECRUITED ) ) //new profiles by Jazz