1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-26 09:35:28 +00:00
OpenMW/components/esm/loadnpc.hpp

109 lines
2.2 KiB
C++
Raw Normal View History

#ifndef _ESM_NPC_H
#define _ESM_NPC_H
#include "esm_reader.hpp"
#include "loadcont.hpp"
#include "defs.hpp"
2012-08-29 21:35:06 +04:00
#include "aipackage.hpp"
namespace ESM {
/*
* NPC definition
*/
struct NPC
{
// Services
enum Services
{
// This merchant buys:
2011-01-05 22:18:21 +01:00
Weapon = 0x00001,
2012-08-29 21:35:06 +04:00
Armor = 0x00002,
2011-01-05 22:18:21 +01:00
Clothing = 0x00004,
2012-08-29 21:35:06 +04:00
Books = 0x00008,
2011-01-05 22:18:21 +01:00
Ingredients = 0x00010,
2012-08-29 21:35:06 +04:00
Picks = 0x00020,
2011-01-05 22:18:21 +01:00
Probes = 0x00040,
Lights = 0x00080,
Apparatus = 0x00100,
RepairItem = 0x00200,
2012-08-29 21:35:06 +04:00
Misc = 0x00400,
// Other services
2011-01-05 22:18:21 +01:00
Spells = 0x00800,
MagicItems = 0x01000,
Potions = 0x02000,
Training = 0x04000, // What skills?
Spellmaking = 0x08000,
Enchanting = 0x10000,
Repair = 0x20000
};
enum Flags
{
2011-01-05 22:18:21 +01:00
Female = 0x0001,
Essential = 0x0002,
2011-01-05 22:18:21 +01:00
Respawn = 0x0004,
Autocalc = 0x0008,
Skeleton = 0x0400, // Skeleton blood effect (white)
2012-08-29 21:35:06 +04:00
Metal = 0x0800 // Metal blood effect (golden?)
};
#pragma pack(push)
#pragma pack(1)
struct NPDTstruct52
{
short level;
char strength, intelligence, willpower, agility,
speed, endurance, personality, luck;
char skills[27];
2010-08-13 15:51:42 +02:00
char reputation;
short health, mana, fatigue;
2010-08-13 15:51:42 +02:00
char disposition, factionID, rank;
char unknown;
int gold;
}; // 52 bytes
struct NPDTstruct12
{
short level;
char disposition, reputation, rank,
unknown1, unknown2, unknown3;
int gold; // ?? not certain
}; // 12 bytes
#pragma pack(pop)
2012-08-29 14:01:10 +04:00
struct Dest
{
2012-08-29 21:35:06 +04:00
Position mPos;
std::string mCellName;
2012-08-29 14:01:10 +04:00
};
NPDTstruct52 npdt52;
NPDTstruct12 npdt12; // Use this if npdt52.gold == -10
int flags;
InventoryList inventory;
SpellList spells;
2012-08-29 21:35:06 +04:00
AIData mAiData;
bool mHasAI;
2012-08-29 21:35:06 +04:00
std::vector<Dest> mTransport;
AIPackageList mAiPackage;
2012-08-29 14:01:10 +04:00
2012-08-29 21:35:06 +04:00
std::string name, model, race, cls, faction, script;
// body parts
std::string hair, head;
std::string mId;
2012-08-29 21:35:06 +04:00
// Implementation moved to load_impl.cpp
void load(ESMReader &esm, const std::string& id);
};
}
#endif