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 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 Apparatus::save(ESMWriter &esm) const { esm.writeHNCString("MODL", mModel); esm.writeHNCString("FNAM", mName); esm.writeHNT("AADT", mData, 16); esm.writeHNOCString("SCRI", mScript); esm.writeHNCString("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 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 StartScript::save(ESMWriter &esm, bool isDeleted) const { esm.writeHNCString("NAME", mId); if (isDeleted) { esm.writeHNCString("DELE", ""); } else { esm.writeHNString("DATA", mData); } }
void Enchantment::save(ESMWriter &esm, bool isDeleted) const { esm.writeHNCString("NAME", mId); if (isDeleted) { esm.writeHNCString("DELE", ""); return; } esm.writeHNT("ENDT", mData, 16); 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 ESM::DebugProfile::save (ESMWriter& esm, bool isDeleted) const { esm.writeHNCString ("NAME", mId); if (isDeleted) { esm.writeHNCString("DELE", ""); return; } esm.writeHNCString ("DESC", mDescription); esm.writeHNCString ("SCRP", mScriptText); esm.writeHNT ("FLAG", mFlags); }
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 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 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 Apparatus::save(ESMWriter &esm, bool isDeleted) const { esm.writeHNCString("NAME", mId); if (isDeleted) { esm.writeHNCString("DELE", ""); return; } esm.writeHNCString("MODL", mModel); esm.writeHNCString("FNAM", mName); esm.writeHNT("AADT", mData, 16); esm.writeHNOCString("SCRI", mScript); esm.writeHNCString("ITEX", mIcon); }
void Pathgrid::save(ESMWriter &esm) { esm.writeHNT("DATA", mData, 12); esm.writeHNCString("NAME", mCell); if (!mPoints.empty()) { esm.startSubRecord("PGRP"); for (PointList::iterator it = mPoints.begin(); it != mPoints.end(); ++it) { esm.writeT(*it); } esm.endRecord("PGRP"); } if (!mEdges.empty()) { esm.startSubRecord("PGRC"); for (std::vector<Edge>::iterator it = mEdges.begin(); it != mEdges.end(); ++it) { esm.writeT(it->mV1); } esm.endRecord("PGRC"); } }
void Race::save(ESMWriter &esm) { esm.writeHNCString("FNAM", mName); esm.writeHNT("RADT", mData, 140); mPowers.save(esm); esm.writeHNOString("DESC", mDescription); }
void BirthSign::save(ESMWriter &esm) { esm.writeHNCString("FNAM", mName); esm.writeHNOCString("TNAM", mTexture); esm.writeHNOCString("DESC", mDescription); mPowers.save(esm); }
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 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 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 LevelledListBase::save(ESMWriter &esm, bool isDeleted) const { esm.writeHNCString("NAME", mId); if (isDeleted) { esm.writeHNCString("DELE", ""); return; } esm.writeHNT("DATA", mFlags); esm.writeHNT("NNAM", mChanceNone); esm.writeHNT<int>("INDX", mList.size()); for (std::vector<LevelItem>::const_iterator it = mList.begin(); it != mList.end(); ++it) { esm.writeHNCString(mRecName, it->mId); esm.writeHNT("INTV", it->mLevel); } }
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 LeveledListBase::save(ESMWriter &esm) { esm.writeHNT("DATA", mFlags); esm.writeHNT("NNAM", mChanceNone); esm.writeHNT<int>("INDX", mList.size()); for (std::vector<LevelItem>::iterator it = mList.begin(); it != mList.end(); ++it) { esm.writeHNCString(mRecName, it->mId); esm.writeHNT("INTV", it->mLevel); } }
void WeatherState::save(ESMWriter& esm) const { esm.writeHNCString(currentRegionRecord, mCurrentRegion.c_str()); esm.writeHNT(timePassedRecord, mTimePassed); esm.writeHNT(fastForwardRecord, mFastForward); esm.writeHNT(weatherUpdateTimeRecord, mWeatherUpdateTime); esm.writeHNT(transitionFactorRecord, mTransitionFactor); esm.writeHNT(currentWeatherRecord, mCurrentWeather); esm.writeHNT(nextWeatherRecord, mNextWeather); esm.writeHNT(queuedWeatherRecord, mQueuedWeather); std::map<std::string, RegionWeatherState>::const_iterator it = mRegions.begin(); for(; it != mRegions.end(); ++it) { esm.writeHNCString(regionNameRecord, it->first.c_str()); esm.writeHNT(regionWeatherRecord, it->second.mWeather); for(size_t i = 0; i < it->second.mChances.size(); ++i) { esm.writeHNT(regionChanceRecord, it->second.mChances[i]); } } }
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 ESM::Header::save (ESMWriter &esm) { esm.writeHNT ("HEDR", mData, 300); if (mFormat>0) esm.writeHNT ("FORM", mFormat); for (std::vector<Header::MasterData>::iterator iter = mMaster.begin(); iter != mMaster.end(); ++iter) { esm.writeHNCString ("MAST", iter->name); esm.writeHNT ("DATA", iter->size); } }
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 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 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); }