diff --git a/gemrb/GUIScripts/ie_stats.py b/gemrb/GUIScripts/ie_stats.py index 6eb4461888..85a41e0d99 100644 --- a/gemrb/GUIScripts/ie_stats.py +++ b/gemrb/GUIScripts/ie_stats.py @@ -64,7 +64,7 @@ MC_PLOT_CRITICAL = 0x2000 MC_BEENINPARTY = 0x8000 -MC_HIDDEN = 0x10000 +MC_SEENPARTY = 0x10000 # stats IE_HITPOINTS = 0 diff --git a/gemrb/includes/ie_stats.h b/gemrb/includes/ie_stats.h index b5073b570d..5f6641f9e3 100644 --- a/gemrb/includes/ie_stats.h +++ b/gemrb/includes/ie_stats.h @@ -196,8 +196,8 @@ namespace GemRB { #define MC_HIDE_HP 0x1000 //also 'large creature' according to IE dev info #define MC_PLOT_CRITICAL 0x2000 //if dies, it means game over, also 'limbo creature' according to IE dev info #define MC_BEENINPARTY 0x8000 -#define MC_HIDDEN 0x10000 //iwd - +#define MC_SEENPARTY 0x10000 //iwd2 +#define MC_INVULNERABLE 0x20000 //iwd2 #define MC_NO_TALK 0x80000 //ignore dialoginterrupt //stats diff --git a/gemrb/plugins/AREImporter/AREImporter.cpp b/gemrb/plugins/AREImporter/AREImporter.cpp index b026fe5d51..4ff0465165 100644 --- a/gemrb/plugins/AREImporter/AREImporter.cpp +++ b/gemrb/plugins/AREImporter/AREImporter.cpp @@ -970,6 +970,19 @@ Map* AREImporter::GetMap(const char *ResRef, bool day_or_night) if ((Flags&AF_NAME_OVERRIDE) || (core->HasFeature(GF_IWD2_SCRIPTNAME)) ) { ab->SetScriptName(DefaultName); } + //IWD2 specific hacks + if (core->HasFeature(GF_IWD2_SCRIPTNAME)) { + //This flag is used for something else in IWD2 + if (Flags&AF_NAME_OVERRIDE) { + ab->BaseStats[IE_EA]=EA_EVILCUTOFF; + } + if (Flags&AF_SEEN_PARTY) { + ab->SetMCFlag(MC_SEENPARTY,BM_OR); + } + if (Flags&AF_INVULNERABLE) { + ab->SetMCFlag(MC_INVULNERABLE,BM_OR); + } + } if (Dialog[0]) { ab->SetDialog(Dialog); diff --git a/gemrb/plugins/CREImporter/CREImporter.cpp b/gemrb/plugins/CREImporter/CREImporter.cpp index 114968cde1..1c14eabb81 100644 --- a/gemrb/plugins/CREImporter/CREImporter.cpp +++ b/gemrb/plugins/CREImporter/CREImporter.cpp @@ -1813,7 +1813,16 @@ void CREImporter::GetActorIWD2(Actor *act) act->BaseStats[IE_SAVEDYPOS] = tmpWord; str->ReadWord( &tmpWord ); act->BaseStats[IE_SAVEDFACE] = tmpWord; - str->Seek( 146, GEM_CURRENT_POS ); + + str->Seek( 15, GEM_CURRENT_POS ); + str->Read( &tmpByte, 1); + act->BaseStats[IE_TRANSLUCENT]=tmpByte; + str->Read( &tmpByte, 1); //fade speed + str->Read( &tmpByte, 1); //spec. flags + str->Read( &tmpByte, 1); //invisible + str->ReadWord( &tmpWord); //unknown + str->Read( &tmpByte, 1); //unused skill points + str->Seek( 124, GEM_CURRENT_POS ); str->Read( &tmpByte, 1); act->BaseStats[IE_EA]=tmpByte; str->Read( &tmpByte, 1); @@ -2745,7 +2754,7 @@ int CREImporter::PutActorIWD2(DataStream *stream, Actor *actor) ieByte tmpByte; ieWord tmpWord; int i; - char filling[146]; + char filling[124]; memset(filling,0,sizeof(filling)); tmpByte=(ieByte) actor->BaseStats[IE_AVATARREMOVAL]; @@ -2766,7 +2775,11 @@ int CREImporter::PutActorIWD2(DataStream *stream, Actor *actor) stream->WriteWord( &tmpWord); tmpWord = actor->BaseStats[IE_SAVEDFACE]; stream->WriteWord( &tmpWord); - stream->Write( filling, 146); + stream->Write( filling, 15); + tmpByte = actor->BaseStats[IE_TRANSLUCENT]; + stream->Write(&tmpByte, 1); + stream->Write( filling, 6); //fade speed, spec flags, invisible, unused skill points + stream->Write( filling, 124); //similar in all engines tmpByte = actor->BaseStats[IE_EA]; stream->Write( &tmpByte, 1); diff --git a/gemrb/plugins/FXOpcodes/FXOpcodes.cpp b/gemrb/plugins/FXOpcodes/FXOpcodes.cpp index bcad31745f..4c7555ecd3 100644 --- a/gemrb/plugins/FXOpcodes/FXOpcodes.cpp +++ b/gemrb/plugins/FXOpcodes/FXOpcodes.cpp @@ -5400,8 +5400,7 @@ int fx_power_word_stun (Scriptable* Owner, Actor* target, Effect* fx) int fx_imprisonment (Scriptable* /*Owner*/, Actor* target, Effect* fx) { if(0) print("fx_imprisonment(%2d)", fx->Opcode); - //target->SetMCFlag(MC_HIDDEN, BM_OR); - STAT_BIT_OR( IE_MC_FLAGS, MC_HIDDEN ); + STAT_SET(IE_AVATARREMOVAL, 1); target->AddPortraitIcon(PI_PRISON); return FX_APPLIED; } @@ -5434,9 +5433,8 @@ int fx_maze (Scriptable* /*Owner*/, Actor* target, Effect* fx) fx->Duration = game->GameTime+target->LuckyRoll(dice, size, 0, 0)*100; } } - - //target->SetMCFlag(MC_HIDDEN, BM_OR); - STAT_BIT_OR( IE_MC_FLAGS, MC_HIDDEN ); + + STAT_SET(IE_AVATARREMOVAL, 1); target->AddPortraitIcon(PI_MAZE); return FX_APPLIED; }