OpenMW
components/esm/loadmgef.hpp
Go to the documentation of this file.
00001 #ifndef OPENMW_ESM_MGEF_H
00002 #define OPENMW_ESM_MGEF_H
00003 
00004 #include <string>
00005 #include <map>
00006 
00007 namespace ESM
00008 {
00009 
00010 class ESMReader;
00011 class ESMWriter;
00012 
00013 struct MagicEffect
00014 {
00015     static unsigned int sRecordId;
00016 
00017     enum Flags
00018     {
00019         TargetSkill = 0x1, // Affects a specific skill, which is specified elsewhere in the effect structure.
00020         TargetAttribute = 0x2, // Affects a specific attribute, which is specified elsewhere in the effect structure.
00021         NoDuration = 0x4, // Has no duration. Only runs effect once on cast.
00022         NoMagnitude = 0x8, // Has no magnitude.
00023         Harmful = 0x10, // Counts as a negative effect. Interpreted as useful for attack, and is treated as a bad effect in alchemy.
00024         ContinuousVfx = 0x20, // The effect's hit particle VFX repeats for the full duration of the spell, rather than occuring once on hit.
00025         CastSelf = 0x40, // Allows range - cast on self.
00026         CastTouch = 0x80, // Allows range - cast on touch.
00027         CastTarget = 0x100, // Allows range - cast on target.
00028         UncappedDamage = 0x1000, // Negates multiple cap behaviours. Allows an effect to reduce an attribute below zero; removes the normal minimum effect duration of 1 second.
00029         NonRecastable = 0x4000, // Does not land if parent spell is already affecting target. Shows "you cannot re-cast" message for self target.
00030         Unreflectable = 0x10000, // Cannot be reflected, the effect always lands normally.
00031         CasterLinked = 0x20000, // Must quench if caster is dead, or not an NPC/creature. Not allowed in containter/door trap spells.
00032         SpellMaking = 0x0200,
00033         Enchanting = 0x0400,
00034         Negative = 0x0800 // A harmful effect. Will determine whether
00035                           // eg. NPCs regard this spell as an attack. (same as 0x10?)
00036     };
00037     enum MagnitudeDisplayType
00038     {
00039         MDT_None,
00040         MDT_Feet,
00041         MDT_Level,
00042         MDT_Percentage,
00043         MDT_Points,
00044         MDT_TimesInt
00045     };
00046 
00047     struct MEDTstruct
00048     {
00049         int mSchool; // SpellSchool, see defs.hpp
00050         float mBaseCost;
00051         int mFlags;
00052         // Glow color for enchanted items with this effect
00053         int mRed, mGreen, mBlue;
00054         // Properties of the fired magic 'ball'
00055         float mSpeed, mSize, mSizeCap;
00056     }; // 36 bytes
00057 
00058     static const std::map<short,std::string> sNames;
00059 
00060     static const std::string &effectIdToString(short effectID);
00061     static short effectStringToId(const std::string &effect);
00062 
00064     static short getResistanceEffect(short effect);
00066     static short getWeaknessEffect(short effect);
00067 
00068     MagnitudeDisplayType getMagnitudeDisplayType() const;
00069 
00070 
00071     MEDTstruct mData;
00072 
00073     std::string mIcon, mParticle; // Textures
00074     std::string mCasting, mHit, mArea; // ESM::Static
00075     std::string mBolt; // ESM::Weapon
00076     std::string mCastSound, mBoltSound, mHitSound, mAreaSound; // Sounds
00077     std::string mDescription;
00078 
00079     // Index of this magical effect. Corresponds to one of the
00080     // hard-coded effects in the original engine:
00081     // 0-136 in Morrowind
00082     // 137 in Tribunal
00083     // 138-140 in Bloodmoon (also changes 64?)
00084     // 141-142 are summon effects introduced in bloodmoon, but not used
00085     // there. They can be redefined in mods by setting the name in GMST
00086     // sEffectSummonCreature04/05 creature id in
00087     // sMagicCreature04ID/05ID.
00088     int mIndex;
00089 
00090     void load(ESMReader &esm);
00091     void save(ESMWriter &esm) const;
00092 
00093 
00094     enum Effects
00095     {
00096         WaterBreathing = 0,
00097         SwiftSwim = 1,
00098         WaterWalking = 2,
00099         Shield = 3,
00100         FireShield = 4,
00101         LightningShield = 5,
00102         FrostShield = 6,
00103         Burden = 7,
00104         Feather = 8,
00105         Jump = 9,
00106         Levitate = 10,
00107         SlowFall = 11,
00108         Lock = 12,
00109         Open = 13,
00110         FireDamage = 14,
00111         ShockDamage = 15,
00112         FrostDamage = 16,
00113         DrainAttribute = 17,
00114         DrainHealth = 18,
00115         DrainMagicka = 19,
00116         DrainFatigue = 20,
00117         DrainSkill = 21,
00118         DamageAttribute = 22,
00119         DamageHealth = 23,
00120         DamageMagicka = 24,
00121         DamageFatigue = 25,
00122         DamageSkill = 26,
00123         Poison = 27,
00124         WeaknessToFire = 28,
00125         WeaknessToFrost = 29,
00126         WeaknessToShock = 30,
00127         WeaknessToMagicka = 31,
00128         WeaknessToCommonDisease = 32,
00129         WeaknessToBlightDisease = 33,
00130         WeaknessToCorprusDisease = 34,
00131         WeaknessToPoison = 35,
00132         WeaknessToNormalWeapons = 36,
00133         DisintegrateWeapon = 37,
00134         DisintegrateArmor = 38,
00135         Invisibility = 39,
00136         Chameleon = 40,
00137         Light = 41,
00138         Sanctuary = 42,
00139         NightEye = 43,
00140         Charm = 44,
00141         Paralyze = 45,
00142         Silence = 46,
00143         Blind = 47,
00144         Sound = 48,
00145         CalmHumanoid = 49,
00146         CalmCreature = 50,
00147         FrenzyHumanoid = 51,
00148         FrenzyCreature = 52,
00149         DemoralizeHumanoid = 53,
00150         DemoralizeCreature = 54,
00151         RallyHumanoid = 55,
00152         RallyCreature = 56,
00153         Dispel = 57,
00154         Soultrap = 58,
00155         Telekinesis = 59,
00156         Mark = 60,
00157         Recall = 61,
00158         DivineIntervention = 62,
00159         AlmsiviIntervention = 63,
00160         DetectAnimal = 64,
00161         DetectEnchantment = 65,
00162         DetectKey = 66,
00163         SpellAbsorption = 67,
00164         Reflect = 68,
00165         CureCommonDisease = 69,
00166         CureBlightDisease = 70,
00167         CureCorprusDisease = 71,
00168         CurePoison = 72,
00169         CureParalyzation = 73,
00170         RestoreAttribute = 74,
00171         RestoreHealth = 75,
00172         RestoreMagicka = 76,
00173         RestoreFatigue = 77,
00174         RestoreSkill = 78,
00175         FortifyAttribute = 79,
00176         FortifyHealth = 80,
00177         FortifyMagicka= 81,
00178         FortifyFatigue = 82,
00179         FortifySkill = 83,
00180         FortifyMaximumMagicka = 84,
00181         AbsorbAttribute = 85,
00182         AbsorbHealth = 86,
00183         AbsorbMagicka = 87,
00184         AbsorbFatigue = 88,
00185         AbsorbSkill = 89,
00186         ResistFire = 90,
00187         ResistFrost = 91,
00188         ResistShock = 92,
00189         ResistMagicka = 93,
00190         ResistCommonDisease = 94,
00191         ResistBlightDisease = 95,
00192         ResistCorprusDisease = 96,
00193         ResistPoison = 97,
00194         ResistNormalWeapons = 98,
00195         ResistParalysis = 99,
00196         RemoveCurse = 100,
00197         TurnUndead = 101,
00198         SummonScamp = 102,
00199         SummonClannfear = 103,
00200         SummonDaedroth = 104,
00201         SummonDremora = 105,
00202         SummonAncestralGhost = 106,
00203         SummonSkeletalMinion = 107,
00204         SummonBonewalker = 108,
00205         SummonGreaterBonewalker = 109,
00206         SummonBonelord = 110,
00207         SummonWingedTwilight = 111,
00208         SummonHunger = 112,
00209         SummonGoldenSaint = 113,
00210         SummonFlameAtronach = 114,
00211         SummonFrostAtronach = 115,
00212         SummonStormAtronach = 116,
00213         FortifyAttack = 117,
00214         CommandCreature = 118,
00215         CommandHumanoid = 119,
00216         BoundDagger = 120,
00217         BoundLongsword = 121,
00218         BoundMace = 122,
00219         BoundBattleAxe = 123,
00220         BoundSpear = 124,
00221         BoundLongbow = 125,
00222         ExtraSpell = 126,
00223         BoundCuirass = 127,
00224         BoundHelm = 128,
00225         BoundBoots = 129,
00226         BoundShield = 130,
00227         BoundGloves = 131,
00228         Corprus = 132,
00229         Vampirism = 133,
00230         SummonCenturionSphere = 134,
00231         SunDamage = 135,
00232         StuntedMagicka = 136,
00233 
00234         // Tribunal only
00235         SummonFabricant = 137,
00236 
00237         // Bloodmoon only
00238         SummonWolf = 138,
00239         SummonBear = 139,
00240         SummonBonewolf = 140,
00241         SummonCreature04 = 141,
00242         SummonCreature05 = 142,
00243 
00244         Length
00245     };
00246 };
00247 }
00248 #endif