mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-29 21:45:32 +00:00
ESSImport: convert breath meter and skill increases
This commit is contained in:
parent
d473629dcd
commit
eede2c8e55
7 changed files with 47 additions and 17 deletions
|
@ -37,6 +37,8 @@ namespace ESSImport
|
|||
npcStats.mSkills[i].mRegular.mCurrent = actorData.mSkills[i][1];
|
||||
npcStats.mSkills[i].mRegular.mBase = actorData.mSkills[i][0];
|
||||
}
|
||||
|
||||
npcStats.mTimeToStartDrowning = actorData.mACDT.mBreathMeter;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -215,6 +215,8 @@ public:
|
|||
faction.mReputation = it->mReputation;
|
||||
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();
|
||||
it != pcdt.mKnownDialogueTopics.end(); ++it)
|
||||
|
|
|
@ -13,14 +13,24 @@ namespace ESSImport
|
|||
|
||||
|
||||
/// Actor data, shared by (at least) REFR and CellRef
|
||||
#pragma pack(push)
|
||||
#pragma pack(1)
|
||||
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];
|
||||
unsigned char mUnknown2[16];
|
||||
unsigned char mUnknown3[16];
|
||||
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
|
||||
{
|
||||
|
|
|
@ -104,6 +104,11 @@ namespace ESSImport
|
|||
blacklist.insert(std::make_pair("GLOB", "FLTV")); // gamehour
|
||||
blacklist.insert(std::make_pair("REFR", "DATA")); // player position
|
||||
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;
|
||||
read(mEssFile, file1);
|
||||
|
|
|
@ -23,8 +23,8 @@ namespace ESSImport
|
|||
mKnownDialogueTopics.push_back(esm.getHString());
|
||||
}
|
||||
|
||||
if (esm.isNextSub("PNAM"))
|
||||
esm.skipHSub();
|
||||
esm.getHNT(mPNAM, "PNAM");
|
||||
|
||||
if (esm.isNextSub("SNAM"))
|
||||
esm.skipHSub();
|
||||
if (esm.isNextSub("NAM9"))
|
||||
|
|
|
@ -38,6 +38,8 @@ struct PCDT
|
|||
|
||||
std::vector<std::string> mKnownDialogueTopics;
|
||||
|
||||
#pragma pack(push)
|
||||
#pragma pack(1)
|
||||
struct FNAM
|
||||
{
|
||||
unsigned char mRank;
|
||||
|
@ -47,7 +49,16 @@ struct PCDT
|
|||
unsigned char mUnknown2[3];
|
||||
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;
|
||||
PNAM mPNAM;
|
||||
|
||||
void load(ESM::ESMReader& esm);
|
||||
};
|
||||
|
|
|
@ -22,27 +22,27 @@ namespace MWMechanics
|
|||
|
||||
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
|
||||
/// we use the same data structure for the PC and the NPCs.
|
||||
/// \note the faction key must be in lowercase
|
||||
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::map<std::string, int> mFactionReputation;
|
||||
int mReputation;
|
||||
int mCrimeId;
|
||||
int mWerewolfKills;
|
||||
int mProfit;
|
||||
|
||||
int mLevelProgress; // 0-10
|
||||
|
||||
std::vector<int> mSkillIncreases; // number of skill increases for each attribute
|
||||
|
||||
std::set<std::string> mUsedIds;
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/// Countdown to getting damage while underwater
|
||||
float mTimeToStartDrowning;
|
||||
|
|
Loading…
Reference in a new issue