void NPC::save(ESMWriter &esm) const { esm.writeHNOCString("MODL", mModel); esm.writeHNOCString("FNAM", mName); esm.writeHNCString("RNAM", mRace); esm.writeHNCString("CNAM", mClass); esm.writeHNCString("ANAM", mFaction); esm.writeHNCString("BNAM", mHead); esm.writeHNCString("KNAM", mHair); esm.writeHNOCString("SCRI", mScript); if (mNpdtType == NPC_DEFAULT) esm.writeHNT("NPDT", mNpdt52, 52); else if (mNpdtType == NPC_WITH_AUTOCALCULATED_STATS) esm.writeHNT("NPDT", mNpdt12, 12); esm.writeHNT("FLAG", mFlags); mInventory.save(esm); mSpells.save(esm); if (mHasAI) { esm.writeHNT("AIDT", mAiData, sizeof(mAiData)); } mTransport.save(esm); mAiPackage.save(esm); }
void NPC::save(ESMWriter &esm) { esm.writeHNOCString("MODL", mModel); esm.writeHNOCString("FNAM", mName); esm.writeHNCString("RNAM", mRace); esm.writeHNCString("CNAM", mClass); esm.writeHNCString("ANAM", mFaction); esm.writeHNCString("BNAM", mHead); esm.writeHNCString("KNAM", mHair); esm.writeHNOCString("SCRI", mScript); if (mNpdtType == 52) esm.writeHNT("NPDT", mNpdt52, 52); else if (mNpdtType == 12) esm.writeHNT("NPDT", mNpdt12, 12); esm.writeHNT("FLAG", mFlags); mInventory.save(esm); mSpells.save(esm); if (mHasAI) { esm.writeHNT("AIDT", mAiData, sizeof(mAiData)); } typedef std::vector<Dest>::iterator DestIter; for (DestIter it = mTransport.begin(); it != mTransport.end(); ++it) { esm.writeHNT("DODT", it->mPos, sizeof(it->mPos)); esm.writeHNOCString("DNAM", it->mCellName); } mAiPackage.save(esm); }
void Cell::save(ESMWriter &esm) const { esm.writeHNT("DATA", mData, 12); if (mData.mFlags & Interior) { if (mWater != -1) { if (mWaterInt) { int water = (mWater >= 0) ? (int) (mWater + 0.5) : (int) (mWater - 0.5); esm.writeHNT("INTV", water); } else { esm.writeHNT("WHGT", mWater); } } if (mData.mFlags & QuasiEx) esm.writeHNOCString("RGNN", mRegion); else esm.writeHNT("AMBI", mAmbi, 16); } else { esm.writeHNOCString("RGNN", mRegion); if (mMapColor != 0) esm.writeHNT("NAM5", mMapColor); } if (mNAM0 != 0) esm.writeHNT("NAM0", mNAM0); }
void Door::save(ESMWriter &esm) const { esm.writeHNCString("MODL", mModel); esm.writeHNOCString("FNAM", mName); esm.writeHNOCString("SCRI", mScript); esm.writeHNOCString("SNAM", mOpenSound); esm.writeHNOCString("ANAM", mCloseSound); }
void BirthSign::save(ESMWriter &esm) { esm.writeHNCString("FNAM", mName); esm.writeHNOCString("TNAM", mTexture); esm.writeHNOCString("DESC", mDescription); mPowers.save(esm); }
void Probe::save(ESMWriter &esm) const { esm.writeHNCString("MODL", mModel); esm.writeHNOCString("FNAM", mName); esm.writeHNT("PBDT", mData, 16); esm.writeHNOString("SCRI", mScript); esm.writeHNOCString("ITEX", mIcon); }
void Weapon::save(ESMWriter &esm) const { esm.writeHNCString("MODL", mModel); esm.writeHNOCString("FNAM", mName); esm.writeHNT("WPDT", mData, 32); esm.writeHNOCString("SCRI", mScript); esm.writeHNOCString("ITEX", mIcon); esm.writeHNOCString("ENAM", mEnchant); }
void Book::save(ESMWriter &esm) const { esm.writeHNCString("MODL", mModel); esm.writeHNOCString("FNAM", mName); esm.writeHNT("BKDT", mData, 20); esm.writeHNOCString("SCRI", mScript); esm.writeHNOCString("ITEX", mIcon); esm.writeHNOString("TEXT", mText); esm.writeHNOCString("ENAM", mEnchant); }
void Container::save(ESMWriter &esm) { esm.writeHNCString("MODL", mModel); esm.writeHNOCString("FNAM", mName); esm.writeHNT("CNDT", mWeight, 4); esm.writeHNT("FLAG", mFlags, 4); esm.writeHNOCString("SCRI", mScript); mInventory.save(esm); }
void Clothing::save(ESMWriter &esm) const { esm.writeHNCString("MODL", mModel); esm.writeHNOCString("FNAM", mName); esm.writeHNT("CTDT", mData, 12); esm.writeHNOCString("SCRI", mScript); esm.writeHNOCString("ITEX", mIcon); mParts.save(esm); esm.writeHNOCString("ENAM", mEnchant); }
void NPC::save(ESMWriter &esm, bool isDeleted) const { esm.writeHNCString("NAME", mId); if (isDeleted) { esm.writeHNCString("DELE", ""); return; } esm.writeHNOCString("MODL", mModel); esm.writeHNOCString("FNAM", mName); esm.writeHNCString("RNAM", mRace); esm.writeHNCString("CNAM", mClass); esm.writeHNCString("ANAM", mFaction); esm.writeHNCString("BNAM", mHead); esm.writeHNCString("KNAM", mHair); esm.writeHNOCString("SCRI", mScript); if (mNpdtType == NPC_DEFAULT) { esm.writeHNT("NPDT", mNpdt, 52); } else if (mNpdtType == NPC_WITH_AUTOCALCULATED_STATS) { NPDTstruct12 npdt12; npdt12.mLevel = mNpdt.mLevel; npdt12.mDisposition = mNpdt.mDisposition; npdt12.mReputation = mNpdt.mReputation; npdt12.mRank = mNpdt.mRank; npdt12.mGold = mNpdt.mGold; esm.writeHNT("NPDT", npdt12, 12); } esm.writeHNT("FLAG", mFlags); mInventory.save(esm); mSpells.save(esm); if (mAiData.mHello != 0 || mAiData.mFight != 0 || mAiData.mFlee != 0 || mAiData.mAlarm != 0 || mAiData.mServices != 0) { esm.writeHNT("AIDT", mAiData, sizeof(mAiData)); } mTransport.save(esm); mAiPackage.save(esm); }
void Activator::save(ESMWriter &esm, bool isDeleted) const { esm.writeHNCString("NAME", mId); if (isDeleted) { esm.writeHNCString("DELE", ""); return; } esm.writeHNCString("MODL", mModel); esm.writeHNOCString("FNAM", mName); esm.writeHNOCString("SCRI", mScript); }
void Faction::save(ESMWriter &esm, bool isDeleted) const { esm.writeHNCString("NAME", mId); if (isDeleted) { esm.writeHNCString("DELE", ""); return; } esm.writeHNOCString("FNAM", mName); for (int i = 0; i < 10; i++) { if (mRanks[i].empty()) break; esm.writeHNString("RNAM", mRanks[i], 32); } esm.writeHNT("FADT", mData, 240); for (std::map<std::string, int>::const_iterator it = mReactions.begin(); it != mReactions.end(); ++it) { esm.writeHNString("ANAM", it->first); esm.writeHNT("INTV", it->second); } }
void AIPackageList::save(ESMWriter &esm) const { typedef std::vector<AIPackage>::const_iterator PackageIter; for (PackageIter it = mList.begin(); it != mList.end(); ++it) { switch (it->mType) { case AI_Wander: esm.writeHNT("AI_W", it->mWander, sizeof(it->mWander)); break; case AI_Travel: esm.writeHNT("AI_T", it->mTravel, sizeof(it->mTravel)); break; case AI_Activate: esm.writeHNT("AI_A", it->mActivate, sizeof(it->mActivate)); break; case AI_Escort: case AI_Follow: { const char *name = (it->mType == AI_Escort) ? "AI_E" : "AI_F"; esm.writeHNT(name, it->mTarget, sizeof(it->mTarget)); esm.writeHNOCString("CNDT", it->mCellName); break; } default: break; } } }
void Weapon::save(ESMWriter &esm, bool isDeleted) const { esm.writeHNCString("NAME", mId); if (isDeleted) { esm.writeHNCString("DELE", ""); return; } esm.writeHNCString("MODL", mModel); esm.writeHNOCString("FNAM", mName); esm.writeHNT("WPDT", mData, 32); esm.writeHNOCString("SCRI", mScript); esm.writeHNOCString("ITEX", mIcon); esm.writeHNOCString("ENAM", mEnchant); }
void Repair::save(ESMWriter &esm, bool isDeleted) const { esm.writeHNCString("NAME", mId); if (isDeleted) { esm.writeHNCString("DELE", ""); return; } esm.writeHNCString("MODL", mModel); esm.writeHNOCString("FNAM", mName); esm.writeHNT("RIDT", mData, 16); esm.writeHNOString("SCRI", mScript); esm.writeHNOCString("ITEX", mIcon); }
void Lockpick::save(ESMWriter &esm) { esm.writeHNCString("MODL", mModel); esm.writeHNCString("FNAM", mName); esm.writeHNT("LKDT", mData, 16); esm.writeHNOString("SCRI", mScript); esm.writeHNOCString("ITEX", mIcon); }
void Creature::save(ESMWriter &esm) const { esm.writeHNCString("MODL", mModel); esm.writeHNOCString("CNAM", mOriginal); esm.writeHNOCString("FNAM", mName); esm.writeHNOCString("SCRI", mScript); esm.writeHNT("NPDT", mData, 96); esm.writeHNT("FLAG", mFlags); if (mScale != 1.0) { esm.writeHNT("XSCL", mScale); } mInventory.save(esm); mSpells.save(esm); if (mHasAI) { esm.writeHNT("AIDT", mAiData, sizeof(mAiData)); } mAiPackage.save(esm); }
void ESM::CellRef::save (ESMWriter &esm, bool wideRefNum, bool inInventory, bool isDeleted) const { mRefNum.save (esm, wideRefNum); esm.writeHNCString("NAME", mRefID); if (isDeleted) { esm.writeHNCString("DELE", ""); return; } if (mScale != 1.0) { esm.writeHNT("XSCL", mScale); } esm.writeHNOCString("ANAM", mOwner); esm.writeHNOCString("BNAM", mGlobalVariable); esm.writeHNOCString("XSOL", mSoul); esm.writeHNOCString("CNAM", mFaction); if (mFactionRank != -2) { esm.writeHNT("INDX", mFactionRank); } if (mEnchantmentCharge != -1) esm.writeHNT("XCHG", mEnchantmentCharge); if (mChargeInt != -1) esm.writeHNT("INTV", mChargeInt); if (mGoldValue != 1) { esm.writeHNT("NAM9", mGoldValue); } if (!inInventory && mTeleport) { esm.writeHNT("DODT", mDoorDest); esm.writeHNOCString("DNAM", mDestCell); } if (!inInventory && mLockLevel != 0) { esm.writeHNT("FLTV", mLockLevel); } if (!inInventory) { esm.writeHNOCString ("KNAM", mKey); esm.writeHNOCString ("TNAM", mTrap); } if (mReferenceBlocked != -1) esm.writeHNT("UNAM", mReferenceBlocked); if (!inInventory) esm.writeHNT("DATA", mPos, 24); }
void Spell::save(ESMWriter &esm, bool isDeleted) const { esm.writeHNCString("NAME", mId); if (isDeleted) { esm.writeHNCString("DELE", ""); return; } esm.writeHNOCString("FNAM", mName); esm.writeHNT("SPDT", mData, 12); mEffects.save(esm); }
void Class::save(ESMWriter &esm, bool isDeleted) const { esm.writeHNCString("NAME", mId); if (isDeleted) { esm.writeHNCString("DELE", ""); return; } esm.writeHNOCString("FNAM", mName); esm.writeHNT("CLDT", mData, 60); esm.writeHNOString("DESC", mDescription); }
void MagicEffect::save(ESMWriter &esm) const { esm.writeHNT("INDX", mIndex); esm.writeHNT("MEDT", mData, 36); esm.writeHNOCString("ITEX", mIcon); esm.writeHNOCString("PTEX", mParticle); esm.writeHNOCString("BSND", mBoltSound); esm.writeHNOCString("CSND", mCastSound); esm.writeHNOCString("HSND", mHitSound); esm.writeHNOCString("ASND", mAreaSound); esm.writeHNOCString("CVFX", mCasting); esm.writeHNOCString("BVFX", mBolt); esm.writeHNOCString("HVFX", mHit); esm.writeHNOCString("AVFX", mArea); esm.writeHNOString("DESC", mDescription); }
void Cell::save(ESMWriter &esm, bool isDeleted) const { esm.writeHNOCString("NAME", mName); esm.writeHNT("DATA", mData, 12); if (isDeleted) { esm.writeHNCString("DELE", ""); return; } if (mData.mFlags & Interior) { if (mWaterInt) { int water = (mWater >= 0) ? (int) (mWater + 0.5) : (int) (mWater - 0.5); esm.writeHNT("INTV", water); } else { esm.writeHNT("WHGT", mWater); } if (mData.mFlags & QuasiEx) esm.writeHNOCString("RGNN", mRegion); else esm.writeHNT("AMBI", mAmbi, 16); } else { esm.writeHNOCString("RGNN", mRegion); if (mMapColor != 0) esm.writeHNT("NAM5", mMapColor); } if (mRefNumCounter != 0) esm.writeHNT("NAM0", mRefNumCounter); }
void Race::save(ESMWriter &esm, bool isDeleted) const { esm.writeHNCString("NAME", mId); if (isDeleted) { esm.writeHNCString("DELE", ""); return; } esm.writeHNOCString("FNAM", mName); esm.writeHNT("RADT", mData, 140); mPowers.save(esm); esm.writeHNOString("DESC", mDescription); }
void Region::save(ESMWriter &esm) const { esm.writeHNCString("FNAM", mName); if (esm.getVersion() == VER_12) esm.writeHNT("WEAT", mData, sizeof(mData) - 2); else esm.writeHNT("WEAT", mData); esm.writeHNOCString("BNAM", mSleepList); esm.writeHNT("CNAM", mMapColor); for (std::vector<SoundRef>::const_iterator it = mSoundList.begin(); it != mSoundList.end(); ++it) { esm.writeHNT<SoundRef>("SNAM", *it); } }
void MagicEffect::save(ESMWriter &esm) { esm.writeHNT("INDX", mIndex); mData.mFlags &= 0xe00; esm.writeHNT("MEDT", mData, 36); if (mIndex>=0 && mIndex<NumberOfHardcodedFlags) { mData.mFlags |= HardcodedFlags[mIndex]; } esm.writeHNOCString("ITEX", mIcon); esm.writeHNOCString("PTEX", mParticle); esm.writeHNOCString("BSND", mBoltSound); esm.writeHNOCString("CSND", mCastSound); esm.writeHNOCString("HSND", mHitSound); esm.writeHNOCString("ASND", mAreaSound); esm.writeHNOCString("CVFX", mCasting); esm.writeHNOCString("BVFX", mBolt); esm.writeHNOCString("HVFX", mHit); esm.writeHNOCString("AVFX", mArea); esm.writeHNOString("DESC", mDescription); }
void Faction::save(ESMWriter &esm) const { esm.writeHNOCString("FNAM", mName); for (int i = 0; i < 10; i++) { if (mRanks[i].empty()) break; esm.writeHNString("RNAM", mRanks[i], 32); } esm.writeHNT("FADT", mData, 240); for (std::vector<Reaction>::const_iterator it = mReactions.begin(); it != mReactions.end(); ++it) { esm.writeHNString("ANAM", it->mFaction); esm.writeHNT("INTV", it->mReaction); } }
void DialInfo::save(ESMWriter &esm) { esm.writeHNCString("INAM", mId); esm.writeHNCString("PNAM", mPrev); esm.writeHNCString("NNAM", mNext); esm.writeHNT("DATA", mData, 12); esm.writeHNOCString("ONAM", mActor); esm.writeHNOCString("RNAM", mRace); esm.writeHNOCString("CNAM", mClass); esm.writeHNOCString("FNAM", mNpcFaction); esm.writeHNOCString("ANAM", mCell); esm.writeHNOCString("DNAM", mPcFaction); esm.writeHNOCString("SNAM", mSound); esm.writeHNOString("NAME", mResponse); for (std::vector<SelectStruct>::iterator it = mSelects.begin(); it != mSelects.end(); ++it) { esm.writeHNString("SCVR", it->mSelectRule); switch(it->mType) { case VT_Int: esm.writeHNT("INTV", it->mI); break; case VT_Float: esm.writeHNT("FLTV", it->mF); break; default: break; } } esm.writeHNOString("BNAM", mResultScript); switch(mQuestStatus) { case QS_Name: esm.writeHNT("QSTN",'\1'); break; case QS_Finished: esm.writeHNT("QSTF", '\1'); break; case QS_Restart: esm.writeHNT("QSTR", '\1'); break; case QS_Deleted: esm.writeHNT("DELE", '\1'); break; default: break; } }
void BodyPart::save(ESMWriter &esm) const { esm.writeHNCString("MODL", mModel); esm.writeHNOCString("FNAM", mRace); esm.writeHNT("BYDT", mData, 4); }
void Class::save(ESMWriter &esm) const { esm.writeHNOCString("FNAM", mName); esm.writeHNT("CLDT", mData, 60); esm.writeHNOString("DESC", mDescription); }