OpenMW
components/esm/loadinfo.hpp
Go to the documentation of this file.
00001 #ifndef OPENMW_ESM_INFO_H
00002 #define OPENMW_ESM_INFO_H
00003 
00004 #include <string>
00005 #include <vector>
00006 
00007 #include "defs.hpp"
00008 #include "variant.hpp"
00009 
00010 namespace ESM
00011 {
00012 
00013 class ESMReader;
00014 class ESMWriter;
00015 
00016 /*
00017  * Dialogue information. A series of these follow after DIAL records,
00018  * and form a linked list of dialogue items.
00019  */
00020 
00021 struct DialInfo
00022 {
00023     static unsigned int sRecordId;
00024 
00025     enum Gender
00026     {
00027         Male = 0,
00028         Female = 1,
00029         NA = -1
00030     };
00031 
00032     struct DATAstruct
00033     {
00034         int mUnknown1;
00035         int mDisposition;
00036         signed char mRank; // Rank of NPC
00037         signed char mGender; // See Gender enum
00038         signed char mPCrank; // Player rank
00039         signed char mUnknown2;
00040     }; // 12 bytes
00041     DATAstruct mData;
00042 
00043     // The rules for whether or not we will select this dialog item.
00044     struct SelectStruct
00045     {
00046         std::string mSelectRule; // This has a complicated format
00047         Variant mValue;
00048     };
00049 
00050     // Journal quest indices (introduced with the quest system in Tribunal)
00051     enum QuestStatus
00052     {
00053         QS_None = 0,
00054         QS_Name = 1,
00055         QS_Finished = 2,
00056         QS_Restart = 3,
00057         QS_Deleted
00058     };
00059 
00060     // Rules for when to include this item in the final list of options
00061     // visible to the player.
00062     std::vector<SelectStruct> mSelects;
00063 
00064     // Id of this, previous and next INFO items
00065     std::string mId, mPrev, mNext;
00066 
00067     // Various references used in determining when to select this item.
00068     std::string mActor, mRace, mClass, mFaction, mPcFaction, mCell;
00069 
00070     // Sound and text associated with this item
00071     std::string mSound, mResponse;
00072 
00073     // Result script (uncomiled) to run whenever this dialog item is
00074     // selected
00075     std::string mResultScript;
00076 
00077     // ONLY include this item the NPC is not part of any faction.
00078     bool mFactionLess;
00079 
00080     // Status of this quest item
00081     QuestStatus mQuestStatus;
00082 
00083     // Hexadecimal versions of the various subrecord names.
00084     enum SubNames
00085     {
00086         REC_ONAM = 0x4d414e4f,
00087         REC_RNAM = 0x4d414e52,
00088         REC_CNAM = 0x4d414e43,
00089         REC_FNAM = 0x4d414e46,
00090         REC_ANAM = 0x4d414e41,
00091         REC_DNAM = 0x4d414e44,
00092         REC_SNAM = 0x4d414e53,
00093         REC_NAME = 0x454d414e,
00094         REC_SCVR = 0x52564353,
00095 
00096         REC_BNAM = 0x4d414e42,
00097         REC_QSTN = 0x4e545351,
00098         REC_QSTF = 0x46545351,
00099         REC_QSTR = 0x52545351,
00100         REC_DELE = 0x454c4544
00101     };
00102 
00103     void load(ESMReader &esm);
00104     void save(ESMWriter &esm) const;
00105 
00106     void blank();
00108 };
00109 
00110 }
00111 #endif