OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
loadcrea.hpp
Go to the documentation of this file.
1 #ifndef OPENMW_ESM_CREA_H
2 #define OPENMW_ESM_CREA_H
3 
4 #include <string>
5 
6 #include "loadcont.hpp"
7 #include "spelllist.hpp"
8 #include "aipackage.hpp"
9 #include "transport.hpp"
10 
11 namespace ESM
12 {
13 
14 class ESMReader;
15 class ESMWriter;
16 
17 /*
18  * Creature definition
19  *
20  */
21 
22 struct Creature
23 {
24  static unsigned int sRecordId;
26  static std::string getRecordType() { return "Creature"; }
27 
28  // Default is 0x48?
29  enum Flags
30  {
31  // Movement types
32  Bipedal = 0x001,
33  Swims = 0x010,
34  Flies = 0x020, // Don't know what happens if several
35  Walks = 0x040, // of these are set
36 
37  Respawn = 0x002,
38  Weapon = 0x004, // Has weapon and shield
39  None = 0x008, // ?? This flag appears set for every creature in Morrowind.esm
40  Essential = 0x080,
41 
42  // Blood types
43  Skeleton = 0x400,
44  Metal = 0x800
45  };
46 
47  enum Type
48  {
49  Creatures = 0,
50  Daedra = 1,
51  Undead = 2,
53  };
54 
55  struct NPDTstruct
56  {
57  int mType;
58  // For creatures we obviously have to use ints, not shorts and
59  // bytes like we use for NPCs.... this file format just makes so
60  // much sense! (Still, _much_ easier to decode than the NIFs.)
61  int mLevel;
62  int mStrength,
64  mWillpower,
65  mAgility,
66  mSpeed,
67  mEndurance,
69  mLuck;
70 
71  int mHealth, mMana, mFatigue; // Stats
72  int mSoul; // The creatures soul value (used with soul gems.)
73  // Creatures have generalized combat, magic and stealth stats which substitute for
74  // the specific skills (in the same way as specializations).
76  int mAttack[6]; // AttackMin1, AttackMax1, ditto2, ditto3
77  int mGold;
78  }; // 96 byte
79 
81 
82  int mFlags;
83 
85 
86  float mScale;
87 
88  std::string mId, mModel, mName, mScript;
89  std::string mOriginal; // Base creature that this is a modification of
90 
93 
94  bool mHasAI;
98 
99  const std::vector<Transport::Dest>& getTransport() const;
100 
101  void load(ESMReader &esm, bool &isDeleted);
102  void save(ESMWriter &esm, bool isDeleted = false) const;
103 
104  void blank();
106 };
107 
108 }
109 #endif
Definition: loadcrea.hpp:51
float mScale
Definition: loadcrea.hpp:86
Type
Definition: loadcrea.hpp:47
Definition: aipackage.hpp:90
int mIntelligence
Definition: loadcrea.hpp:62
std::string mId
Definition: loadcrea.hpp:88
Definition: aipackage.hpp:17
Definition: loadcrea.hpp:52
Definition: loadcrea.hpp:34
Transport mTransport
Definition: loadcrea.hpp:97
Definition: esmreader.hpp:21
int mEndurance
Definition: loadcrea.hpp:62
int mSoul
Definition: loadcrea.hpp:72
SpellList mSpells
Definition: loadcrea.hpp:92
int mMagic
Definition: loadcrea.hpp:75
int mGold
Definition: loadcrea.hpp:77
InventoryList, NPCO subrecord.
Definition: loadcont.hpp:26
Definition: loadcrea.hpp:22
Definition: loadcrea.hpp:55
Definition: loadcrea.hpp:44
Definition: loadcrea.hpp:37
List of travel service destination. Shared by CREA and NPC_ records.
Definition: transport.hpp:16
int mAttack[6]
Definition: loadcrea.hpp:76
int mHealth
Definition: loadcrea.hpp:71
Definition: loadcrea.hpp:32
InventoryList mInventory
Definition: loadcrea.hpp:91
Definition: esmwriter.hpp:17
Definition: loadcrea.hpp:33
AIData mAiData
Definition: loadcrea.hpp:95
AIPackageList mAiPackage
Definition: loadcrea.hpp:96
int mLevel
Definition: loadcrea.hpp:61
bool mHasAI
Definition: loadcrea.hpp:94
int mFlags
Definition: loadcrea.hpp:82
std::string mModel
Definition: loadcrea.hpp:88
Definition: spelllist.hpp:16
int mLuck
Definition: loadcrea.hpp:62
Definition: loadcrea.hpp:49
void load(ESMReader &esm, bool &isDeleted)
Definition: loadcrea.cpp:13
int mStrength
Definition: loadcrea.hpp:62
std::string mScript
Definition: loadcrea.hpp:88
void save(ESMWriter &esm, bool isDeleted=false) const
Definition: loadcrea.cpp:108
int mStealth
Definition: loadcrea.hpp:75
int mFatigue
Definition: loadcrea.hpp:71
std::string mName
Definition: loadcrea.hpp:88
std::string mOriginal
Definition: loadcrea.hpp:89
Definition: loadcrea.hpp:43
int mAgility
Definition: loadcrea.hpp:62
Flags
Definition: loadcrea.hpp:29
int mWillpower
Definition: loadcrea.hpp:62
static std::string getRecordType()
Return a string descriptor for this record type. Currently used for debugging / error logs only...
Definition: loadcrea.hpp:26
int mPersonality
Definition: loadcrea.hpp:62
NPDTstruct mData
Definition: loadcrea.hpp:80
static unsigned int sRecordId
Definition: loadcrea.hpp:24
int mCombat
Definition: loadcrea.hpp:75
int mMana
Definition: loadcrea.hpp:71
Definition: loadcrea.hpp:40
int mType
Definition: loadcrea.hpp:57
bool mPersistent
Definition: loadcrea.hpp:84
Definition: loadcrea.hpp:50
Definition: loadcrea.hpp:35
int mSpeed
Definition: loadcrea.hpp:62
void blank()
Set record to default state (does not touch the ID).
Definition: loadcrea.cpp:142
const std::vector< Transport::Dest > & getTransport() const
Definition: loadcrea.cpp:168
Definition: loadcrea.hpp:39
Definition: loadweap.hpp:16