1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-15 15:49:56 +00:00
openmw-tes3mp/components/esm/loadspel.hpp
Stanislav Bas 926c825d0c Add NAME and DELE handling to ESM records.
Changed records are those where DELE is located after NAME sub-record.
And DELE is the last sub-record.
2015-07-10 00:18:00 +03:00

57 lines
1.3 KiB
C++

#ifndef OPENMW_ESM_SPEL_H
#define OPENMW_ESM_SPEL_H
#include <string>
#include "effectlist.hpp"
namespace ESM
{
class ESMReader;
class ESMWriter;
struct Spell
{
static unsigned int sRecordId;
/// Return a string descriptor for this record type. Currently used for debugging / error logs only.
static std::string getRecordType() { return "Spell"; }
enum SpellType
{
ST_Spell = 0, // Normal spell, must be cast and costs mana
ST_Ability = 1, // Inert ability, always in effect
ST_Blight = 2, // Blight disease
ST_Disease = 3, // Common disease
ST_Curse = 4, // Curse (?)
ST_Power = 5 // Power, can use once a day
};
enum Flags
{
F_Autocalc = 1, // Can be selected by NPC spells auto-calc
F_PCStart = 2, // Can be selected by player spells auto-calc
F_Always = 4 // Casting always succeeds
};
struct SPDTstruct
{
int mType; // SpellType
int mCost; // Mana cost
int mFlags; // Flags
};
SPDTstruct mData;
std::string mId, mName;
EffectList mEffects;
bool mIsDeleted;
void load(ESMReader &esm);
void save(ESMWriter &esm) const;
void blank();
///< Set record to default state (does not touch the ID/index).
};
}
#endif