[General] Add creature attack values to RecordDynamic packets

pull/593/head
David Cernat 4 years ago
parent 44d037c078
commit 86630b048f

@ -1027,6 +1027,11 @@ void RecordsDynamicFunctions::SetRecordDamageChop(unsigned int minDamage, unsign
tempWeapon.data.mData.mChop[0] = minDamage;
tempWeapon.data.mData.mChop[1] = maxDamage;
}
else if (writeRecordsType == mwmp::RECORD_TYPE::CREATURE)
{
tempCreature.data.mData.mAttack[0] = minDamage;
tempCreature.data.mData.mAttack[1] = maxDamage;
}
else
{
LOG_MESSAGE_SIMPLE(TimedLog::LOG_ERROR, "Tried to set chop damage for record type %i which lacks that property", writeRecordsType);
@ -1045,6 +1050,11 @@ void RecordsDynamicFunctions::SetRecordDamageSlash(unsigned int minDamage, unsig
tempWeapon.data.mData.mSlash[0] = minDamage;
tempWeapon.data.mData.mSlash[1] = maxDamage;
}
else if (writeRecordsType == mwmp::RECORD_TYPE::CREATURE)
{
tempCreature.data.mData.mAttack[2] = minDamage;
tempCreature.data.mData.mAttack[3] = maxDamage;
}
else
{
LOG_MESSAGE_SIMPLE(TimedLog::LOG_ERROR, "Tried to set slash damage for record type %i which lacks that property", writeRecordsType);
@ -1063,6 +1073,11 @@ void RecordsDynamicFunctions::SetRecordDamageThrust(unsigned int minDamage, unsi
tempWeapon.data.mData.mThrust[0] = minDamage;
tempWeapon.data.mData.mThrust[1] = maxDamage;
}
else if (writeRecordsType == mwmp::RECORD_TYPE::CREATURE)
{
tempCreature.data.mData.mAttack[4] = minDamage;
tempCreature.data.mData.mAttack[5] = maxDamage;
}
else
{
LOG_MESSAGE_SIMPLE(TimedLog::LOG_ERROR, "Tried to set thrust damage for record type %i which lacks that property", writeRecordsType);

@ -567,6 +567,24 @@ void RecordHelper::overrideRecord(const mwmp::CreatureRecord& record)
if (record.baseOverrides.hasSoulValue)
finalData.mData.mSoul = recordData.mData.mSoul;
if (record.baseOverrides.hasDamageChop)
{
finalData.mData.mAttack[0] = recordData.mData.mAttack[0];
finalData.mData.mAttack[1] = recordData.mData.mAttack[1];
}
if (record.baseOverrides.hasDamageSlash)
{
finalData.mData.mAttack[2] = recordData.mData.mAttack[2];
finalData.mData.mAttack[3] = recordData.mData.mAttack[3];
}
if (record.baseOverrides.hasDamageThrust)
{
finalData.mData.mAttack[4] = recordData.mData.mAttack[4];
finalData.mData.mAttack[5] = recordData.mData.mAttack[5];
}
if (record.baseOverrides.hasAiFight)
finalData.mAiData.mFight = recordData.mAiData.mFight;

@ -552,6 +552,12 @@ void PacketRecordDynamic::Packet(RakNet::BitStream *newBitstream, bool send)
RW(recordData.mData.mMana, send);
RW(recordData.mData.mFatigue, send);
RW(recordData.mData.mSoul, send);
RW(recordData.mData.mAttack[0], send);
RW(recordData.mData.mAttack[1], send);
RW(recordData.mData.mAttack[2], send);
RW(recordData.mData.mAttack[3], send);
RW(recordData.mData.mAttack[4], send);
RW(recordData.mData.mAttack[5], send);
RW(recordData.mAiData.mFight, send);
RW(recordData.mAiData.mFlee, send);
RW(recordData.mAiData.mAlarm, send);
@ -573,6 +579,9 @@ void PacketRecordDynamic::Packet(RakNet::BitStream *newBitstream, bool send)
RW(overrides.hasMagicka, send);
RW(overrides.hasFatigue, send);
RW(overrides.hasSoulValue, send);
RW(overrides.hasDamageChop, send);
RW(overrides.hasDamageSlash, send);
RW(overrides.hasDamageThrust, send);
RW(overrides.hasAiFight, send);
RW(overrides.hasAiFlee, send);
RW(overrides.hasAiAlarm, send);

Loading…
Cancel
Save