OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
loadinfo.hpp
Go to the documentation of this file.
1 #ifndef OPENMW_ESM_INFO_H
2 #define OPENMW_ESM_INFO_H
3 
4 #include <string>
5 #include <vector>
6 
7 #include "defs.hpp"
8 #include "variant.hpp"
9 
10 namespace ESM
11 {
12 
13 class ESMReader;
14 class ESMWriter;
15 
16 /*
17  * Dialogue information. A series of these follow after DIAL records,
18  * and form a linked list of dialogue items.
19  */
20 
21 struct DialInfo
22 {
23  static unsigned int sRecordId;
25  static std::string getRecordType() { return "DialInfo"; }
26 
27  enum Gender
28  {
29  Male = 0,
30  Female = 1,
31  NA = -1
32  };
33 
34  struct DATAstruct
35  {
36  int mUnknown1;
37  union
38  {
39  int mDisposition; // Used for dialogue responses
40  int mJournalIndex; // Used for journal entries
41  };
42  signed char mRank; // Rank of NPC
43  signed char mGender; // See Gender enum
44  signed char mPCrank; // Player rank
45  signed char mUnknown2;
46  }; // 12 bytes
48 
49  // The rules for whether or not we will select this dialog item.
50  struct SelectStruct
51  {
52  std::string mSelectRule; // This has a complicated format
54  };
55 
56  // Journal quest indices (introduced with the quest system in Tribunal)
58  {
59  QS_None = 0,
60  QS_Name = 1,
63  };
64 
65  // Rules for when to include this item in the final list of options
66  // visible to the player.
67  std::vector<SelectStruct> mSelects;
68 
69  // Id of this, previous and next INFO items
70  std::string mId, mPrev, mNext;
71 
72  // Various references used in determining when to select this item.
74 
75  // Sound and text associated with this item
76  std::string mSound, mResponse;
77 
78  // Result script (uncompiled) to run whenever this dialog item is
79  // selected
80  std::string mResultScript;
81 
82  // ONLY include this item the NPC is not part of any faction.
84 
85  // Status of this quest item
87 
88  // Hexadecimal versions of the various subrecord names.
89  enum SubNames
90  {
91  REC_ONAM = 0x4d414e4f,
92  REC_RNAM = 0x4d414e52,
93  REC_CNAM = 0x4d414e43,
94  REC_FNAM = 0x4d414e46,
95  REC_ANAM = 0x4d414e41,
96  REC_DNAM = 0x4d414e44,
97  REC_SNAM = 0x4d414e53,
98  REC_NAME = 0x454d414e,
99  REC_SCVR = 0x52564353,
100 
101  REC_BNAM = 0x4d414e42,
102  REC_QSTN = 0x4e545351,
103  REC_QSTF = 0x46545351,
104  REC_QSTR = 0x52545351,
105  REC_DELE = 0x454c4544
106  };
107 
108  void load(ESMReader &esm, bool &isDeleted);
110 
111  void save(ESMWriter &esm, bool isDeleted = false) const;
112 
113  void blank();
115 };
116 
117 }
118 #endif
Definition: loadinfo.hpp:102
Definition: loadinfo.hpp:103
signed char mGender
Definition: loadinfo.hpp:43
Definition: loadinfo.hpp:34
Definition: esmreader.hpp:21
SubNames
Definition: loadinfo.hpp:89
Definition: loadinfo.hpp:104
std::string mFaction
Definition: loadinfo.hpp:73
std::vector< SelectStruct > mSelects
Definition: loadinfo.hpp:67
QuestStatus
Definition: loadinfo.hpp:57
std::string mClass
Definition: loadinfo.hpp:73
int mUnknown1
Definition: loadinfo.hpp:36
std::string mSound
Definition: loadinfo.hpp:76
int mJournalIndex
Definition: loadinfo.hpp:40
Definition: loadinfo.hpp:95
Definition: loadinfo.hpp:62
std::string mSelectRule
Definition: loadinfo.hpp:52
Definition: loadinfo.hpp:98
std::string mPrev
Definition: loadinfo.hpp:70
Definition: loadinfo.hpp:96
Definition: esmwriter.hpp:17
Definition: loadinfo.hpp:92
Definition: loadinfo.hpp:21
Variant mValue
Definition: loadinfo.hpp:53
void blank()
Set record to default state (does not touch the ID).
Definition: loadinfo.cpp:134
std::string mRace
Definition: loadinfo.hpp:73
std::string mId
Definition: loadinfo.hpp:70
std::string mNext
Definition: loadinfo.hpp:70
Definition: loadinfo.hpp:105
void save(ESMWriter &esm, bool isDeleted=false) const
Definition: loadinfo.cpp:95
DATAstruct mData
Definition: loadinfo.hpp:47
bool mFactionLess
Definition: loadinfo.hpp:83
signed char mUnknown2
Definition: loadinfo.hpp:45
std::string mActor
Definition: loadinfo.hpp:73
std::string mPcFaction
Definition: loadinfo.hpp:73
Definition: loadinfo.hpp:97
Definition: loadinfo.hpp:60
signed char mPCrank
Definition: loadinfo.hpp:44
std::string mCell
Definition: loadinfo.hpp:73
Definition: loadinfo.hpp:50
Definition: loadinfo.hpp:61
static std::string getRecordType()
Return a string descriptor for this record type. Currently used for debugging / error logs only...
Definition: loadinfo.hpp:25
signed char mRank
Definition: loadinfo.hpp:42
Gender
Definition: loadinfo.hpp:27
std::string mResponse
Definition: loadinfo.hpp:76
std::string mResultScript
Definition: loadinfo.hpp:80
int mDisposition
Definition: loadinfo.hpp:39
Definition: loadinfo.hpp:29
Definition: variant.hpp:25
Definition: loadinfo.hpp:101
QuestStatus mQuestStatus
Definition: loadinfo.hpp:86
Definition: loadinfo.hpp:93
Definition: loadinfo.hpp:30
Definition: loadinfo.hpp:91
Definition: loadinfo.hpp:99
Definition: loadinfo.hpp:59
Definition: loadinfo.hpp:31
Definition: loadinfo.hpp:94
static unsigned int sRecordId
Definition: loadinfo.hpp:23
void load(ESMReader &esm, bool &isDeleted)
Loads Info record.
Definition: loadinfo.cpp:11