2012-09-23 18:11:08 +00:00
|
|
|
#ifndef OPENMW_ESM_CREA_H
|
|
|
|
#define OPENMW_ESM_CREA_H
|
2010-02-22 13:09:43 +00:00
|
|
|
|
2012-09-17 07:37:50 +00:00
|
|
|
#include <string>
|
|
|
|
|
2010-02-22 13:09:43 +00:00
|
|
|
#include "loadcont.hpp"
|
2012-09-17 07:37:50 +00:00
|
|
|
#include "spelllist.hpp"
|
2012-08-29 17:35:06 +00:00
|
|
|
#include "aipackage.hpp"
|
2010-02-22 13:09:43 +00:00
|
|
|
|
2011-04-08 13:58:21 +00:00
|
|
|
namespace ESM
|
|
|
|
{
|
2010-02-22 13:09:43 +00:00
|
|
|
|
2012-09-30 20:51:54 +00:00
|
|
|
class ESMReader;
|
|
|
|
class ESMWriter;
|
|
|
|
|
2010-02-22 13:09:43 +00:00
|
|
|
/*
|
|
|
|
* Creature definition
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2012-09-30 19:34:53 +00:00
|
|
|
struct Creature
|
2010-02-22 13:09:43 +00:00
|
|
|
{
|
2013-09-24 11:17:28 +00:00
|
|
|
static unsigned int sRecordId;
|
|
|
|
|
2011-04-08 13:58:21 +00:00
|
|
|
// Default is 0x48?
|
|
|
|
enum Flags
|
2010-02-22 13:09:43 +00:00
|
|
|
{
|
2014-01-17 09:52:44 +00:00
|
|
|
// Movement types
|
|
|
|
Bipedal = 0x001,
|
2012-09-17 07:37:50 +00:00
|
|
|
Swims = 0x010,
|
|
|
|
Flies = 0x020, // Don't know what happens if several
|
|
|
|
Walks = 0x040, // of these are set
|
2014-01-17 09:52:44 +00:00
|
|
|
|
|
|
|
Respawn = 0x002,
|
|
|
|
Weapon = 0x004, // Has weapon and shield
|
2014-05-03 10:09:34 +00:00
|
|
|
None = 0x008, // ?? This flag appears set for every creature in Morrowind.esm
|
2012-09-17 07:37:50 +00:00
|
|
|
Essential = 0x080,
|
2014-01-17 09:52:44 +00:00
|
|
|
|
|
|
|
// Blood types
|
|
|
|
Skeleton = 0x400,
|
|
|
|
Metal = 0x800
|
2010-02-22 13:09:43 +00:00
|
|
|
};
|
|
|
|
|
2011-04-08 13:58:21 +00:00
|
|
|
enum Type
|
2010-02-22 13:09:43 +00:00
|
|
|
{
|
2011-04-08 18:26:27 +00:00
|
|
|
Creatures = 0,
|
2014-01-05 00:34:35 +00:00
|
|
|
Daedra = 1,
|
2011-04-08 18:26:27 +00:00
|
|
|
Undead = 2,
|
|
|
|
Humanoid = 3
|
2010-02-22 13:09:43 +00:00
|
|
|
};
|
|
|
|
|
2011-04-08 13:58:21 +00:00
|
|
|
struct NPDTstruct
|
|
|
|
{
|
2012-09-17 07:37:50 +00:00
|
|
|
int mType;
|
2011-04-08 13:58:21 +00:00
|
|
|
// For creatures we obviously have to use ints, not shorts and
|
|
|
|
// bytes like we use for NPCs.... this file format just makes so
|
|
|
|
// much sense! (Still, _much_ easier to decode than the NIFs.)
|
2012-09-17 07:37:50 +00:00
|
|
|
int mLevel;
|
|
|
|
int mStrength,
|
|
|
|
mIntelligence,
|
|
|
|
mWillpower,
|
|
|
|
mAgility,
|
|
|
|
mSpeed,
|
|
|
|
mEndurance,
|
|
|
|
mPersonality,
|
|
|
|
mLuck;
|
|
|
|
|
|
|
|
int mHealth, mMana, mFatigue; // Stats
|
|
|
|
int mSoul; // The creatures soul value (used with soul gems.)
|
2014-01-15 14:50:45 +00:00
|
|
|
// Creatures have generalized combat, magic and stealth stats which substitute for
|
|
|
|
// the specific skills (in the same way as specializations).
|
|
|
|
int mCombat, mMagic, mStealth;
|
2012-09-17 07:37:50 +00:00
|
|
|
int mAttack[6]; // AttackMin1, AttackMax1, ditto2, ditto3
|
|
|
|
int mGold;
|
2013-12-23 11:32:35 +00:00
|
|
|
}; // 96 byte
|
2010-02-22 13:09:43 +00:00
|
|
|
|
2012-09-17 07:37:50 +00:00
|
|
|
NPDTstruct mData;
|
2010-02-22 13:09:43 +00:00
|
|
|
|
2012-09-17 07:37:50 +00:00
|
|
|
int mFlags;
|
2013-05-16 16:50:26 +00:00
|
|
|
|
|
|
|
bool mPersistent;
|
|
|
|
|
2012-09-17 07:37:50 +00:00
|
|
|
float mScale;
|
2010-02-22 13:09:43 +00:00
|
|
|
|
2012-09-30 19:34:53 +00:00
|
|
|
std::string mId, mModel, mName, mScript;
|
2012-09-17 07:37:50 +00:00
|
|
|
std::string mOriginal; // Base creature that this is a modification of
|
2010-02-22 13:09:43 +00:00
|
|
|
|
2012-09-17 07:37:50 +00:00
|
|
|
InventoryList mInventory;
|
2012-08-29 17:35:06 +00:00
|
|
|
SpellList mSpells;
|
2010-02-22 13:09:43 +00:00
|
|
|
|
|
|
|
|
2012-08-29 17:35:06 +00:00
|
|
|
bool mHasAI;
|
|
|
|
AIData mAiData;
|
|
|
|
AIPackageList mAiPackage;
|
2012-05-17 11:12:38 +00:00
|
|
|
|
2012-04-08 09:51:52 +00:00
|
|
|
void load(ESMReader &esm);
|
2013-09-16 10:32:35 +00:00
|
|
|
void save(ESMWriter &esm) const;
|
2013-05-06 12:10:43 +00:00
|
|
|
|
|
|
|
void blank();
|
|
|
|
///< Set record to default state (does not touch the ID).
|
2010-02-22 13:09:43 +00:00
|
|
|
};
|
2012-09-17 07:37:50 +00:00
|
|
|
|
2010-02-22 13:09:43 +00:00
|
|
|
}
|
|
|
|
#endif
|