2015-01-16 23:11:36 +00:00
|
|
|
#include "importnpcc.hpp"
|
|
|
|
|
|
|
|
#include <components/esm/esmreader.hpp>
|
|
|
|
|
|
|
|
namespace ESSImport
|
|
|
|
{
|
|
|
|
|
|
|
|
void NPCC::load(ESM::ESMReader &esm)
|
|
|
|
{
|
2015-01-18 18:59:29 +00:00
|
|
|
mIndex = 0;
|
|
|
|
esm.getHNOT(mIndex, "INDX");
|
|
|
|
|
2015-01-16 23:11:36 +00:00
|
|
|
esm.getHNT(mNPDT, "NPDT");
|
|
|
|
|
2015-01-18 18:59:29 +00:00
|
|
|
while (esm.isNextSub("NPCO"))
|
|
|
|
{
|
|
|
|
InventoryItem item;
|
|
|
|
item.mId = esm.getHString();
|
|
|
|
|
|
|
|
if (esm.isNextSub("XIDX"))
|
|
|
|
esm.skipHSub();
|
|
|
|
|
|
|
|
item.mCondition = -1;
|
|
|
|
esm.getHNOT(item.mCondition, "XHLT");
|
|
|
|
mInventory.push_back(item);
|
|
|
|
}
|
|
|
|
|
|
|
|
while (esm.isNextSub("WIDX"))
|
|
|
|
{
|
|
|
|
// equipping?
|
|
|
|
esm.skipHSub();
|
|
|
|
}
|
2015-01-16 23:11:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|