OpenMW
components/esm/cellref.hpp
Go to the documentation of this file.
00001 #ifndef OPENMW_ESM_CELLREF_H
00002 #define OPENMW_ESM_CELLREF_H
00003 
00004 #include <string>
00005 
00006 #include "defs.hpp"
00007 
00008 namespace ESM
00009 {
00010     class ESMWriter;
00011 
00012     /* Cell reference. This represents ONE object (of many) inside the
00013     cell. The cell references are not loaded as part of the normal
00014     loading process, but are rather loaded later on demand when we are
00015     setting up a specific cell.
00016     */
00017 
00018     class CellRef
00019     {
00020         public:
00021 
00022             int mRefnum;           // Reference number
00023             std::string mRefID;    // ID of object being referenced (must be lowercase)
00024 
00025             float mScale;          // Scale applied to mesh
00026 
00027             // The NPC that owns this object (and will get angry if you steal
00028             // it)
00029             std::string mOwner;
00030 
00031             // I have no idea, looks like a link to a global variable?
00032             std::string mGlob;
00033 
00034             // ID of creature trapped in this soul gem (?)
00035             std::string mSoul;
00036 
00037             // ?? CNAM has a faction name, might be for objects/beds etc
00038             // belonging to a faction.
00039             std::string mFaction;
00040 
00041             // INDX might be PC faction rank required to use the item? Sometimes
00042             // is -1, which I assume means "any rank".
00043             int mFactIndex;
00044 
00045             // For weapon or armor, this is the remaining item health.
00046             // For tools (lockpicks, probes, repair hammer) it is the remaining uses.
00047             int mCharge;
00048 
00049             // Remaining enchantment charge
00050             float mEnchantmentCharge;
00051 
00052             // This is 5 for Gold_005 references, 100 for Gold_100 and so on.
00053             int mGoldValue;
00054 
00055             // For doors - true if this door teleports to somewhere else, false
00056             // if it should open through animation.
00057             bool mTeleport;
00058 
00059             // Teleport location for the door, if this is a teleporting door.
00060             Position mDoorDest;
00061 
00062             // Destination cell for doors (optional)
00063             std::string mDestCell;
00064 
00065             // Lock level for doors and containers
00066             int mLockLevel;
00067             std::string mKey, mTrap; // Key and trap ID names, if any
00068 
00069             // This corresponds to the "Reference Blocked" checkbox in the construction set,
00070             // which prevents editing that reference.
00071             // -1 is not blocked, otherwise it is blocked.
00072             signed char mReferenceBlocked;
00073 
00074             // Track deleted references. 0 - not deleted, 1 - deleted, but respawns, 2 - deleted and does not respawn.
00075             int mDeleted;
00076 
00077             // Occurs in Tribunal.esm, eg. in the cell "Mournhold, Plaza
00078             // Brindisi Dorom", where it has the value 100. Also only for
00079             // activators.
00080             int mFltv;
00081             int mNam0;
00082 
00083             // Position and rotation of this object within the cell
00084             Position mPos;
00085 
00086             void save(ESMWriter &esm) const;
00087 
00088             void blank();
00089     };
00090 }
00091 
00092 #endif