2012-09-23 18:11:08 +00:00
# ifndef OPENMW_ESM_MGEF_H
# define OPENMW_ESM_MGEF_H
2010-02-22 13:09:43 +00:00
2012-09-17 07:37:50 +00:00
# include <string>
2011-04-08 13:58:21 +00:00
namespace ESM
{
2010-02-22 13:09:43 +00:00
2012-09-30 20:51:54 +00:00
class ESMReader ;
class ESMWriter ;
2012-09-30 19:34:53 +00:00
struct MagicEffect
2010-02-22 13:09:43 +00:00
{
2011-04-08 13:58:21 +00:00
enum Flags
2010-02-22 13:09:43 +00:00
{
2012-10-01 21:33:07 +00:00
TargetSkill = 0x1 , // Affects a specific skill, which is specified elsewhere in the effect structure.
TargetAttribute = 0x2 , // Affects a specific attribute, which is specified elsewhere in the effect structure.
NoDuration = 0x4 , // Has no duration. Only runs effect once on cast.
NoMagnitude = 0x8 , // Has no magnitude.
2012-10-12 12:26:10 +00:00
Harmful = 0x10 , // Counts as a negative effect. Interpreted as useful for attack, and is treated as a bad effect in alchemy.
2012-10-01 21:33:07 +00:00
ContinuousVfx = 0x20 , // The effect's hit particle VFX repeats for the full duration of the spell, rather than occuring once on hit.
CastSelf = 0x40 , // Allows range - cast on self.
CastTouch = 0x80 , // Allows range - cast on touch.
CastTarget = 0x100 , // Allows range - cast on target.
UncappedDamage = 0x1000 , // Negates multiple cap behaviours. Allows an effect to reduce an attribute below zero; removes the normal minimum effect duration of 1 second.
NonRecastable = 0x4000 , // Does not land if parent spell is already affecting target. Shows "you cannot re-cast" message for self target.
Unreflectable = 0x10000 , // Cannot be reflected, the effect always lands normally.
2012-10-12 12:26:10 +00:00
CasterLinked = 0x20000 , // Must quench if caster is dead, or not an NPC/creature. Not allowed in containter/door trap spells.
2011-04-08 13:58:21 +00:00
SpellMaking = 0x0200 ,
Enchanting = 0x0400 ,
Negative = 0x0800 // A harmful effect. Will determine whether
2012-10-12 12:26:10 +00:00
// eg. NPCs regard this spell as an attack. (same as 0x10?)
2010-02-22 13:09:43 +00:00
} ;
2011-04-08 13:58:21 +00:00
struct MEDTstruct
{
2012-09-17 07:37:50 +00:00
int mSchool ; // SpellSchool, see defs.hpp
float mBaseCost ;
int mFlags ;
2011-04-08 13:58:21 +00:00
// Properties of the fired magic 'ball' I think
2012-09-17 07:37:50 +00:00
int mRed , mBlue , mGreen ;
float mSpeed , mSize , mSizeCap ;
2011-04-08 13:58:21 +00:00
} ; // 36 bytes
2012-10-01 21:33:07 +00:00
static std : : string effectIdToString ( short effectID ) ;
2012-09-17 07:37:50 +00:00
MEDTstruct mData ;
2011-04-08 13:58:21 +00:00
2012-09-17 07:37:50 +00:00
std : : string mIcon , mParticle ; // Textures
std : : string mCasting , mHit , mArea ; // Statics
std : : string mBolt ; // Weapon
std : : string mCastSound , mBoltSound , mHitSound , mAreaSound ; // Sounds
std : : string mDescription ;
2011-04-08 13:58:21 +00:00
// Index of this magical effect. Corresponds to one of the
// hard-coded effects in the original engine:
// 0-136 in Morrowind
// 137 in Tribunal
// 138-140 in Bloodmoon (also changes 64?)
// 141-142 are summon effects introduced in bloodmoon, but not used
// there. They can be redefined in mods by setting the name in GMST
// sEffectSummonCreature04/05 creature id in
// sMagicCreature04ID/05ID.
2012-09-17 07:37:50 +00:00
int mIndex ;
2011-04-08 13:58:21 +00:00
void load ( ESMReader & esm ) ;
2012-04-06 19:04:30 +00:00
void save ( ESMWriter & esm ) ;
2010-02-22 13:09:43 +00:00
} ;
}
# endif