1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-30 22:15:32 +00:00

ESSImport: convert breath meter and skill increases

This commit is contained in:
scrawl 2015-01-20 19:30:39 +01:00
parent d473629dcd
commit eede2c8e55
7 changed files with 47 additions and 17 deletions

View file

@ -37,6 +37,8 @@ namespace ESSImport
npcStats.mSkills[i].mRegular.mCurrent = actorData.mSkills[i][1]; npcStats.mSkills[i].mRegular.mCurrent = actorData.mSkills[i][1];
npcStats.mSkills[i].mRegular.mBase = actorData.mSkills[i][0]; npcStats.mSkills[i].mRegular.mBase = actorData.mSkills[i][0];
} }
npcStats.mTimeToStartDrowning = actorData.mACDT.mBreathMeter;
} }
} }

View file

@ -215,6 +215,8 @@ public:
faction.mReputation = it->mReputation; faction.mReputation = it->mReputation;
mContext->mPlayer.mObject.mNpcStats.mFactions[it->mFactionName.toString()] = faction; mContext->mPlayer.mObject.mNpcStats.mFactions[it->mFactionName.toString()] = faction;
} }
for (int i=0; i<8; ++i)
mContext->mPlayer.mObject.mNpcStats.mSkillIncrease[i] = pcdt.mPNAM.mSkillIncreases[i];
for (std::vector<std::string>::const_iterator it = pcdt.mKnownDialogueTopics.begin(); for (std::vector<std::string>::const_iterator it = pcdt.mKnownDialogueTopics.begin();
it != pcdt.mKnownDialogueTopics.end(); ++it) it != pcdt.mKnownDialogueTopics.end(); ++it)

View file

@ -13,14 +13,24 @@ namespace ESSImport
/// Actor data, shared by (at least) REFR and CellRef /// Actor data, shared by (at least) REFR and CellRef
#pragma pack(push)
#pragma pack(1)
struct ACDT struct ACDT
{ {
unsigned char mUnknown1[40]; // Note, not stored at *all*:
// - Level changes are lost on reload, except for the player (there it's in the NPC record).
unsigned char mUnknown1[16];
float mBreathMeter; // Seconds left before drowning
unsigned char mUnknown2[20];
float mDynamic[3][2]; float mDynamic[3][2];
unsigned char mUnknown2[16]; unsigned char mUnknown3[16];
float mAttributes[8][2]; float mAttributes[8][2];
unsigned char mUnknown3[120]; unsigned char mUnknown4[109];
// This seems to increase when purchasing training, though I don't see it anywhere ingame.
int mGold;
unsigned char mUnknown5[7];
}; };
#pragma pack(pop)
struct ActorData struct ActorData
{ {

View file

@ -104,6 +104,11 @@ namespace ESSImport
blacklist.insert(std::make_pair("GLOB", "FLTV")); // gamehour blacklist.insert(std::make_pair("GLOB", "FLTV")); // gamehour
blacklist.insert(std::make_pair("REFR", "DATA")); // player position blacklist.insert(std::make_pair("REFR", "DATA")); // player position
blacklist.insert(std::make_pair("CELL", "NAM8")); // fog of war blacklist.insert(std::make_pair("CELL", "NAM8")); // fog of war
blacklist.insert(std::make_pair("GAME", "GMDT")); // weather data, current time always changes
// this changes way too often, name suggests some renderer internal data?
blacklist.insert(std::make_pair("CELL", "ND3D"));
blacklist.insert(std::make_pair("REFR", "ND3D"));
File file1; File file1;
read(mEssFile, file1); read(mEssFile, file1);

View file

@ -23,8 +23,8 @@ namespace ESSImport
mKnownDialogueTopics.push_back(esm.getHString()); mKnownDialogueTopics.push_back(esm.getHString());
} }
if (esm.isNextSub("PNAM")) esm.getHNT(mPNAM, "PNAM");
esm.skipHSub();
if (esm.isNextSub("SNAM")) if (esm.isNextSub("SNAM"))
esm.skipHSub(); esm.skipHSub();
if (esm.isNextSub("NAM9")) if (esm.isNextSub("NAM9"))

View file

@ -38,6 +38,8 @@ struct PCDT
std::vector<std::string> mKnownDialogueTopics; std::vector<std::string> mKnownDialogueTopics;
#pragma pack(push)
#pragma pack(1)
struct FNAM struct FNAM
{ {
unsigned char mRank; unsigned char mRank;
@ -47,7 +49,16 @@ struct PCDT
unsigned char mUnknown2[3]; unsigned char mUnknown2[3];
ESM::NAME32 mFactionName; ESM::NAME32 mFactionName;
}; };
struct PNAM
{
unsigned char mUnknown1[116];
unsigned char mSkillIncreases[8]; // number of skill increases for each attribute
unsigned char mUnknown2[88];
};
#pragma pack(pop)
std::vector<FNAM> mFactions; std::vector<FNAM> mFactions;
PNAM mPNAM;
void load(ESM::ESMReader& esm); void load(ESM::ESMReader& esm);
}; };

View file

@ -22,27 +22,27 @@ namespace MWMechanics
class NpcStats : public CreatureStats class NpcStats : public CreatureStats
{ {
int mDisposition;
SkillValue mSkill[ESM::Skill::Length];
SkillValue mWerewolfSkill[ESM::Skill::Length];
int mReputation;
int mCrimeId;
int mProfit;
// ----- used by the player only, maybe should be moved at some point -------
int mBounty;
int mWerewolfKills;
/// NPCs other than the player can only have one faction. But for the sake of consistency /// NPCs other than the player can only have one faction. But for the sake of consistency
/// we use the same data structure for the PC and the NPCs. /// we use the same data structure for the PC and the NPCs.
/// \note the faction key must be in lowercase /// \note the faction key must be in lowercase
std::map<std::string, int> mFactionRank; std::map<std::string, int> mFactionRank;
int mDisposition;
SkillValue mSkill[ESM::Skill::Length];
SkillValue mWerewolfSkill[ESM::Skill::Length];
int mBounty;
std::set<std::string> mExpelled; std::set<std::string> mExpelled;
std::map<std::string, int> mFactionReputation; std::map<std::string, int> mFactionReputation;
int mReputation;
int mCrimeId;
int mWerewolfKills;
int mProfit;
int mLevelProgress; // 0-10 int mLevelProgress; // 0-10
std::vector<int> mSkillIncreases; // number of skill increases for each attribute std::vector<int> mSkillIncreases; // number of skill increases for each attribute
std::set<std::string> mUsedIds; std::set<std::string> mUsedIds;
// ---------------------------------------------------------------------------
/// Countdown to getting damage while underwater /// Countdown to getting damage while underwater
float mTimeToStartDrowning; float mTimeToStartDrowning;