mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-04-01 20:36:42 +00:00
[General] Include AI services for creatures/NPCs in RecordDynamic
This commit is contained in:
parent
18e2a14645
commit
ef432d1419
5 changed files with 41 additions and 0 deletions
|
@ -1206,6 +1206,23 @@ void RecordsDynamicFunctions::SetRecordAIFight(int aiFight) noexcept
|
||||||
tempOverrides.hasAiFight = true;
|
tempOverrides.hasAiFight = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RecordsDynamicFunctions::SetRecordAIServices(int aiServices) noexcept
|
||||||
|
{
|
||||||
|
unsigned short writeRecordsType = WorldstateFunctions::writeWorldstate.recordsType;
|
||||||
|
|
||||||
|
if (writeRecordsType == mwmp::RECORD_TYPE::CREATURE)
|
||||||
|
tempCreature.data.mAiData.mServices = aiServices;
|
||||||
|
else if (writeRecordsType == mwmp::RECORD_TYPE::NPC)
|
||||||
|
tempNpc.data.mAiData.mServices = aiServices;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
LOG_MESSAGE_SIMPLE(Log::LOG_ERROR, "Tried to set AI services for record type %i which lacks that property", writeRecordsType);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
tempOverrides.hasAiServices = true;
|
||||||
|
}
|
||||||
|
|
||||||
void RecordsDynamicFunctions::SetRecordOpenSound(const char* sound) noexcept
|
void RecordsDynamicFunctions::SetRecordOpenSound(const char* sound) noexcept
|
||||||
{
|
{
|
||||||
unsigned short writeRecordsType = WorldstateFunctions::writeWorldstate.recordsType;
|
unsigned short writeRecordsType = WorldstateFunctions::writeWorldstate.recordsType;
|
||||||
|
|
|
@ -84,7 +84,9 @@
|
||||||
{"SetRecordLevel", RecordsDynamicFunctions::SetRecordLevel},\
|
{"SetRecordLevel", RecordsDynamicFunctions::SetRecordLevel},\
|
||||||
{"SetRecordMagicka", RecordsDynamicFunctions::SetRecordMagicka},\
|
{"SetRecordMagicka", RecordsDynamicFunctions::SetRecordMagicka},\
|
||||||
{"SetRecordFatigue", RecordsDynamicFunctions::SetRecordFatigue},\
|
{"SetRecordFatigue", RecordsDynamicFunctions::SetRecordFatigue},\
|
||||||
|
\
|
||||||
{"SetRecordAIFight", RecordsDynamicFunctions::SetRecordAIFight},\
|
{"SetRecordAIFight", RecordsDynamicFunctions::SetRecordAIFight},\
|
||||||
|
{"SetRecordAIServices", RecordsDynamicFunctions::SetRecordAIServices},\
|
||||||
\
|
\
|
||||||
{"SetRecordOpenSound", RecordsDynamicFunctions::SetRecordOpenSound},\
|
{"SetRecordOpenSound", RecordsDynamicFunctions::SetRecordOpenSound},\
|
||||||
{"SetRecordCloseSound", RecordsDynamicFunctions::SetRecordCloseSound},\
|
{"SetRecordCloseSound", RecordsDynamicFunctions::SetRecordCloseSound},\
|
||||||
|
@ -735,6 +737,15 @@ public:
|
||||||
*/
|
*/
|
||||||
static void SetRecordAIFight(int aiFight) noexcept;
|
static void SetRecordAIFight(int aiFight) noexcept;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Set the AI services value of the temporary record stored on the server for the
|
||||||
|
* currently specified record type.
|
||||||
|
*
|
||||||
|
* \param aiServices The AI services value of the record.
|
||||||
|
* \return void
|
||||||
|
*/
|
||||||
|
static void SetRecordAIServices(int aiServices) noexcept;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Set the opening sound of the temporary record stored on the server for the
|
* \brief Set the opening sound of the temporary record stored on the server for the
|
||||||
* currently specified record type.
|
* currently specified record type.
|
||||||
|
|
|
@ -214,6 +214,9 @@ void RecordHelper::overrideCreatureRecord(const mwmp::CreatureRecord& record)
|
||||||
if (record.baseOverrides.hasAiFight)
|
if (record.baseOverrides.hasAiFight)
|
||||||
finalData.mAiData.mFight = recordData.mAiData.mFight;
|
finalData.mAiData.mFight = recordData.mAiData.mFight;
|
||||||
|
|
||||||
|
if (record.baseOverrides.hasAiServices)
|
||||||
|
finalData.mAiData.mServices = recordData.mAiData.mServices;
|
||||||
|
|
||||||
if (record.baseOverrides.hasFlags)
|
if (record.baseOverrides.hasFlags)
|
||||||
finalData.mFlags = recordData.mFlags;
|
finalData.mFlags = recordData.mFlags;
|
||||||
|
|
||||||
|
@ -320,6 +323,9 @@ void RecordHelper::overrideNpcRecord(const mwmp::NpcRecord& record)
|
||||||
if (record.baseOverrides.hasAiFight)
|
if (record.baseOverrides.hasAiFight)
|
||||||
finalData.mAiData.mFight = recordData.mAiData.mFight;
|
finalData.mAiData.mFight = recordData.mAiData.mFight;
|
||||||
|
|
||||||
|
if (record.baseOverrides.hasAiServices)
|
||||||
|
finalData.mAiData.mServices = recordData.mAiData.mServices;
|
||||||
|
|
||||||
if (record.baseOverrides.hasFlags)
|
if (record.baseOverrides.hasFlags)
|
||||||
finalData.mFlags = recordData.mFlags;
|
finalData.mFlags = recordData.mFlags;
|
||||||
|
|
||||||
|
|
|
@ -110,7 +110,9 @@ namespace mwmp
|
||||||
bool hasLevel = false;
|
bool hasLevel = false;
|
||||||
bool hasMagicka = false;
|
bool hasMagicka = false;
|
||||||
bool hasFatigue = false;
|
bool hasFatigue = false;
|
||||||
|
|
||||||
bool hasAiFight = false;
|
bool hasAiFight = false;
|
||||||
|
bool hasAiServices = false;
|
||||||
|
|
||||||
bool hasOpenSound = false;
|
bool hasOpenSound = false;
|
||||||
bool hasCloseSound = false;
|
bool hasCloseSound = false;
|
||||||
|
|
|
@ -216,6 +216,7 @@ void PacketRecordDynamic::Packet(RakNet::BitStream *bs, bool send)
|
||||||
RW(recordData.mData.mMana, send);
|
RW(recordData.mData.mMana, send);
|
||||||
RW(recordData.mData.mFatigue, send);
|
RW(recordData.mData.mFatigue, send);
|
||||||
RW(recordData.mAiData.mFight, send);
|
RW(recordData.mAiData.mFight, send);
|
||||||
|
RW(recordData.mAiData.mServices, send);
|
||||||
RW(recordData.mFlags, send);
|
RW(recordData.mFlags, send);
|
||||||
RW(recordData.mScript, send, true);
|
RW(recordData.mScript, send, true);
|
||||||
ProcessInventoryList(record.inventory, recordData.mInventory, send);
|
ProcessInventoryList(record.inventory, recordData.mInventory, send);
|
||||||
|
@ -231,6 +232,7 @@ void PacketRecordDynamic::Packet(RakNet::BitStream *bs, bool send)
|
||||||
RW(overrides.hasMagicka, send);
|
RW(overrides.hasMagicka, send);
|
||||||
RW(overrides.hasFatigue, send);
|
RW(overrides.hasFatigue, send);
|
||||||
RW(overrides.hasAiFight, send);
|
RW(overrides.hasAiFight, send);
|
||||||
|
RW(overrides.hasAiServices, send);
|
||||||
RW(overrides.hasFlags, send);
|
RW(overrides.hasFlags, send);
|
||||||
RW(overrides.hasScript, send);
|
RW(overrides.hasScript, send);
|
||||||
RW(overrides.hasInventory, send);
|
RW(overrides.hasInventory, send);
|
||||||
|
@ -260,6 +262,8 @@ void PacketRecordDynamic::Packet(RakNet::BitStream *bs, bool send)
|
||||||
RW(recordData.mNpdt.mMana, send);
|
RW(recordData.mNpdt.mMana, send);
|
||||||
RW(recordData.mNpdt.mFatigue, send);
|
RW(recordData.mNpdt.mFatigue, send);
|
||||||
RW(recordData.mAiData.mFight, send);
|
RW(recordData.mAiData.mFight, send);
|
||||||
|
RW(recordData.mAiData.mServices, send);
|
||||||
|
|
||||||
RW(recordData.mNpdtType, send);
|
RW(recordData.mNpdtType, send);
|
||||||
ProcessInventoryList(record.inventory, recordData.mInventory, send);
|
ProcessInventoryList(record.inventory, recordData.mInventory, send);
|
||||||
|
|
||||||
|
@ -279,6 +283,7 @@ void PacketRecordDynamic::Packet(RakNet::BitStream *bs, bool send)
|
||||||
RW(overrides.hasMagicka, send);
|
RW(overrides.hasMagicka, send);
|
||||||
RW(overrides.hasFatigue, send);
|
RW(overrides.hasFatigue, send);
|
||||||
RW(overrides.hasAiFight, send);
|
RW(overrides.hasAiFight, send);
|
||||||
|
RW(overrides.hasAiServices, send);
|
||||||
RW(overrides.hasAutoCalc, send);
|
RW(overrides.hasAutoCalc, send);
|
||||||
RW(overrides.hasInventory, send);
|
RW(overrides.hasInventory, send);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue