mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-06-27 00:54:22 +00:00
Compare commits
3 Commits
debugger-i
...
chore--mou
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bf5169baea | ||
|
|
73bcb949d7 | ||
|
|
d079f3621b |
@@ -4,6 +4,7 @@
|
|||||||
#include "dCommonVars.h"
|
#include "dCommonVars.h"
|
||||||
#include "Logger.h"
|
#include "Logger.h"
|
||||||
#include "Game.h"
|
#include "Game.h"
|
||||||
|
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
@@ -367,37 +368,9 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
template<typename AmfType = AMFArrayValue>
|
template<typename AmfType = AMFArrayValue>
|
||||||
AmfType& PushDebug(const std::string_view name, const std::string& objectType = "", const uint32_t warningLevel = 0) {
|
AmfType& PushDebug(const std::string_view name) {
|
||||||
size_t i = 0;
|
|
||||||
for (; i < m_Dense.size(); i++) {
|
|
||||||
const auto& cast = dynamic_cast<AMFArrayValue*>(m_Dense[i].get());
|
|
||||||
if (!cast) continue;
|
|
||||||
|
|
||||||
const auto& nameValue = cast->Get<std::string>("name");
|
|
||||||
if (!nameValue || nameValue->GetValue() != name) continue;
|
|
||||||
|
|
||||||
if (!objectType.empty()) {
|
|
||||||
cast->Insert<std::string>("type", objectType);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (warningLevel != 0) {
|
|
||||||
cast->Insert<double>("warningLevel", warningLevel);
|
|
||||||
}
|
|
||||||
|
|
||||||
// found a duplicate, return this instead
|
|
||||||
auto valueCast = dynamic_cast<AmfType*>(cast->Get("value"));
|
|
||||||
if (valueCast) return *valueCast;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto* value = PushArray();
|
auto* value = PushArray();
|
||||||
value->Insert<std::string>("name", name.data());
|
value->Insert("name", name.data());
|
||||||
if (!objectType.empty()) {
|
|
||||||
value->Insert<std::string>("type", objectType);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (warningLevel != 0) {
|
|
||||||
value->Insert<double>("warningLevel", warningLevel);
|
|
||||||
}
|
|
||||||
return value->Insert<AmfType>("value", std::make_unique<AmfType>());
|
return value->Insert<AmfType>("value", std::make_unique<AmfType>());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1019,7 +1019,6 @@ void Entity::WriteBaseReplicaData(RakNet::BitStream& outBitStream, eReplicaPacke
|
|||||||
const bool hasParent = m_ParentEntity != nullptr || m_SpawnerID != 0;
|
const bool hasParent = m_ParentEntity != nullptr || m_SpawnerID != 0;
|
||||||
outBitStream.Write(hasParent);
|
outBitStream.Write(hasParent);
|
||||||
if (hasParent) {
|
if (hasParent) {
|
||||||
// 触るな!
|
|
||||||
if (m_ParentEntity != nullptr) outBitStream.Write(GeneralUtils::SetBit(m_ParentEntity->GetObjectID(), static_cast<uint32_t>(eObjectBits::CLIENT)));
|
if (m_ParentEntity != nullptr) outBitStream.Write(GeneralUtils::SetBit(m_ParentEntity->GetObjectID(), static_cast<uint32_t>(eObjectBits::CLIENT)));
|
||||||
else if (m_Spawner != nullptr && m_Spawner->m_Info.isNetwork) outBitStream.Write(m_SpawnerID);
|
else if (m_Spawner != nullptr && m_Spawner->m_Info.isNetwork) outBitStream.Write(m_SpawnerID);
|
||||||
else outBitStream.Write(GeneralUtils::SetBit(m_SpawnerID, static_cast<uint32_t>(eObjectBits::CLIENT)));
|
else outBitStream.Write(GeneralUtils::SetBit(m_SpawnerID, static_cast<uint32_t>(eObjectBits::CLIENT)));
|
||||||
@@ -2236,16 +2235,11 @@ bool Entity::MsgRequestServerObjectInfo(GameMessages::RequestServerObjectInfo& r
|
|||||||
|
|
||||||
const auto& objTableInfo = table->GetByID(GetLOT());
|
const auto& objTableInfo = table->GetByID(GetLOT());
|
||||||
|
|
||||||
objectInfo.PushDebug<AMFStringValue>("Name", "name") = objTableInfo.name;
|
objectInfo.PushDebug<AMFStringValue>("Name") = objTableInfo.name;
|
||||||
objectInfo.PushDebug<AMFIntValue>("Template ID(LOT)", "LOT") = GetLOT();
|
objectInfo.PushDebug<AMFIntValue>("Template ID(LOT)") = GetLOT();
|
||||||
objectInfo.PushDebug<AMFStringValue>("Object ID", "LWOOBJID") = std::to_string(GetObjectID());
|
objectInfo.PushDebug<AMFStringValue>("Object ID") = std::to_string(GetObjectID());
|
||||||
objectInfo.PushDebug<AMFStringValue>("Spawner's Object ID", "LWOOBJID") = std::to_string(GetSpawnerID());
|
objectInfo.PushDebug<AMFStringValue>("Spawner's Object ID") = std::to_string(GetSpawnerID());
|
||||||
objectInfo.PushDebug<AMFStringValue>("Owner override", "LWOOBJID") = std::to_string(m_OwnerOverride);
|
objectInfo.PushDebug<AMFStringValue>("Owner override") = std::to_string(m_OwnerOverride);
|
||||||
auto& children = objectInfo.PushDebug("Child Objects");
|
|
||||||
int i = 1;
|
|
||||||
for (const auto* child : m_ChildEntities) {
|
|
||||||
if (child) children.PushDebug<AMFStringValue>("Child " + std::to_string(i++), "LWOOBJID") = std::to_string(child->GetObjectID());
|
|
||||||
}
|
|
||||||
|
|
||||||
auto& componentDetails = objectInfo.PushDebug("Component Information");
|
auto& componentDetails = objectInfo.PushDebug("Component Information");
|
||||||
for (const auto [id, component] : m_Components) {
|
for (const auto [id, component] : m_Components) {
|
||||||
|
|||||||
@@ -521,10 +521,6 @@ void BaseCombatAIComponent::Serialize(RakNet::BitStream& outBitStream, bool bIsI
|
|||||||
|
|
||||||
void BaseCombatAIComponent::SetAiState(AiState newState) {
|
void BaseCombatAIComponent::SetAiState(AiState newState) {
|
||||||
if (newState == this->m_State) return;
|
if (newState == this->m_State) return;
|
||||||
GameMessages::NotifyCombatAIStateChange stateMsg;
|
|
||||||
stateMsg.prevState = this->m_State;
|
|
||||||
stateMsg.newState = newState;
|
|
||||||
m_Parent->HandleMsg(stateMsg);
|
|
||||||
this->m_State = newState;
|
this->m_State = newState;
|
||||||
m_DirtyStateOrTarget = true;
|
m_DirtyStateOrTarget = true;
|
||||||
Game::entityManager->SerializeEntity(m_Parent);
|
Game::entityManager->SerializeEntity(m_Parent);
|
||||||
@@ -864,7 +860,7 @@ bool BaseCombatAIComponent::MsgGetObjectReportInfo(GameMessages::GetObjectReport
|
|||||||
auto& cmptType = reportInfo.info->PushDebug("Base Combat AI");
|
auto& cmptType = reportInfo.info->PushDebug("Base Combat AI");
|
||||||
cmptType.PushDebug<AMFIntValue>("Component ID") = GetComponentID();
|
cmptType.PushDebug<AMFIntValue>("Component ID") = GetComponentID();
|
||||||
auto& targetInfo = cmptType.PushDebug("Current Target Info");
|
auto& targetInfo = cmptType.PushDebug("Current Target Info");
|
||||||
targetInfo.PushDebug<AMFStringValue>("Current Target ID", "LWOOBJID") = std::to_string(m_Target);
|
targetInfo.PushDebug<AMFStringValue>("Current Target ID") = std::to_string(m_Target);
|
||||||
// if (m_Target != LWOOBJID_EMPTY) {
|
// if (m_Target != LWOOBJID_EMPTY) {
|
||||||
// LWOGameMessages::ObjGetName nameMsg(m_CurrentTarget);
|
// LWOGameMessages::ObjGetName nameMsg(m_CurrentTarget);
|
||||||
// SEND_GAMEOBJ_MSG(nameMsg);
|
// SEND_GAMEOBJ_MSG(nameMsg);
|
||||||
@@ -905,7 +901,10 @@ bool BaseCombatAIComponent::MsgGetObjectReportInfo(GameMessages::GetObjectReport
|
|||||||
//}
|
//}
|
||||||
//cmptType.PushDebug("Current Combat Role") = curState;
|
//cmptType.PushDebug("Current Combat Role") = curState;
|
||||||
|
|
||||||
cmptType.PushDebug("Tether Point").PushDebug(m_StartPosition);
|
auto& tetherPoint = cmptType.PushDebug("Tether Point");
|
||||||
|
tetherPoint.PushDebug<AMFDoubleValue>("X") = m_StartPosition.x;
|
||||||
|
tetherPoint.PushDebug<AMFDoubleValue>("Y") = m_StartPosition.y;
|
||||||
|
tetherPoint.PushDebug<AMFDoubleValue>("Z") = m_StartPosition.z;
|
||||||
cmptType.PushDebug<AMFDoubleValue>("Hard Tether Radius") = m_HardTetherRadius;
|
cmptType.PushDebug<AMFDoubleValue>("Hard Tether Radius") = m_HardTetherRadius;
|
||||||
cmptType.PushDebug<AMFDoubleValue>("Soft Tether Radius") = m_SoftTetherRadius;
|
cmptType.PushDebug<AMFDoubleValue>("Soft Tether Radius") = m_SoftTetherRadius;
|
||||||
cmptType.PushDebug<AMFDoubleValue>("Aggro Radius") = m_AggroRadius;
|
cmptType.PushDebug<AMFDoubleValue>("Aggro Radius") = m_AggroRadius;
|
||||||
|
|||||||
@@ -361,11 +361,17 @@ void ControllablePhysicsComponent::SetStunImmunity(
|
|||||||
|
|
||||||
bool ControllablePhysicsComponent::OnGetObjectReportInfo(GameMessages::GetObjectReportInfo& reportInfo) {
|
bool ControllablePhysicsComponent::OnGetObjectReportInfo(GameMessages::GetObjectReportInfo& reportInfo) {
|
||||||
PhysicsComponent::OnGetObjectReportInfo(reportInfo);
|
PhysicsComponent::OnGetObjectReportInfo(reportInfo);
|
||||||
auto& info = reportInfo.subCategory->PushDebug("Controllable Physics");
|
auto& info = reportInfo.subCategory->PushDebug("Controllable Info");
|
||||||
|
|
||||||
info.PushDebug("Velocity").PushDebug(m_Velocity);
|
auto& vel = info.PushDebug("Velocity");
|
||||||
|
vel.PushDebug<AMFDoubleValue>("x") = m_Velocity.x;
|
||||||
|
vel.PushDebug<AMFDoubleValue>("y") = m_Velocity.y;
|
||||||
|
vel.PushDebug<AMFDoubleValue>("z") = m_Velocity.z;
|
||||||
|
|
||||||
info.PushDebug("Angular Velocity").PushDebug(m_AngularVelocity);
|
auto& angularVelocity = info.PushDebug("Angular Velocity");
|
||||||
|
angularVelocity.PushDebug<AMFDoubleValue>("x") = m_AngularVelocity.x;
|
||||||
|
angularVelocity.PushDebug<AMFDoubleValue>("y") = m_AngularVelocity.y;
|
||||||
|
angularVelocity.PushDebug<AMFDoubleValue>("z") = m_AngularVelocity.z;
|
||||||
|
|
||||||
info.PushDebug<AMFBoolValue>("Is On Ground") = m_IsOnGround;
|
info.PushDebug<AMFBoolValue>("Is On Ground") = m_IsOnGround;
|
||||||
info.PushDebug<AMFBoolValue>("Is On Rail") = m_IsOnRail;
|
info.PushDebug<AMFBoolValue>("Is On Rail") = m_IsOnRail;
|
||||||
@@ -397,13 +403,12 @@ bool ControllablePhysicsComponent::OnGetObjectReportInfo(GameMessages::GetObject
|
|||||||
info.PushDebug<AMFBoolValue>("Is In Bubble") = m_IsInBubble;
|
info.PushDebug<AMFBoolValue>("Is In Bubble") = m_IsInBubble;
|
||||||
info.PushDebug<AMFStringValue>("Bubble Type") = StringifiedEnum::ToString(m_BubbleType).data();
|
info.PushDebug<AMFStringValue>("Bubble Type") = StringifiedEnum::ToString(m_BubbleType).data();
|
||||||
info.PushDebug<AMFBoolValue>("Special Anims") = m_SpecialAnims;
|
info.PushDebug<AMFBoolValue>("Special Anims") = m_SpecialAnims;
|
||||||
auto& immunity = info.PushDebug("Immunity Effects");
|
info.PushDebug<AMFIntValue>("Immune To Stun Attack Count") = m_ImmuneToStunAttackCount;
|
||||||
immunity.PushDebug<AMFBoolValue>("Immune to Stun Move") = m_ImmuneToStunMoveCount != 0;
|
info.PushDebug<AMFIntValue>("Immune To Stun Equip Count") = m_ImmuneToStunEquipCount;
|
||||||
immunity.PushDebug<AMFBoolValue>("Immune to Stun Turn") = m_ImmuneToStunTurnCount != 0;
|
info.PushDebug<AMFIntValue>("Immune To Stun Interact Count") = m_ImmuneToStunInteractCount;
|
||||||
immunity.PushDebug<AMFBoolValue>("Immune to Stun Attack") = m_ImmuneToStunAttackCount != 0;
|
info.PushDebug<AMFIntValue>("Immune To Stun Jump Count") = m_ImmuneToStunJumpCount;
|
||||||
immunity.PushDebug<AMFBoolValue>("Immune to Stun Use Item") = m_ImmuneToStunUseItemCount != 0;
|
info.PushDebug<AMFIntValue>("Immune To Stun Move Count") = m_ImmuneToStunMoveCount;
|
||||||
immunity.PushDebug<AMFBoolValue>("Immune to Stun Equip") = m_ImmuneToStunEquipCount != 0;
|
info.PushDebug<AMFIntValue>("Immune To Stun Turn Count") = m_ImmuneToStunTurnCount;
|
||||||
immunity.PushDebug<AMFBoolValue>("Immune to Stun Interact") = m_ImmuneToStunInteractCount != 0;
|
info.PushDebug<AMFIntValue>("Immune To Stun UseItem Count") = m_ImmuneToStunUseItemCount;
|
||||||
immunity.PushDebug<AMFBoolValue>("Immune to Stun Jump") = m_ImmuneToStunJumpCount != 0;
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -328,7 +328,7 @@ private:
|
|||||||
/**
|
/**
|
||||||
* The effect that plays while using the jetpack
|
* The effect that plays while using the jetpack
|
||||||
*/
|
*/
|
||||||
int32_t m_JetpackEffectID{};
|
int32_t m_JetpackEffectID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The current speed multiplier, allowing an entity to run faster
|
* The current speed multiplier, allowing an entity to run faster
|
||||||
|
|||||||
@@ -1146,7 +1146,7 @@ bool DestroyableComponent::OnGetObjectReportInfo(GameMessages::GetObjectReportIn
|
|||||||
destroyableInfo.PushDebug<AMFDoubleValue>("Explode Factor") = m_ExplodeFactor;
|
destroyableInfo.PushDebug<AMFDoubleValue>("Explode Factor") = m_ExplodeFactor;
|
||||||
destroyableInfo.PushDebug<AMFBoolValue>("Has Threats") = m_HasThreats;
|
destroyableInfo.PushDebug<AMFBoolValue>("Has Threats") = m_HasThreats;
|
||||||
|
|
||||||
destroyableInfo.PushDebug<AMFStringValue>("Killer ID", "LWOOBJID") = std::to_string(m_KillerID);
|
destroyableInfo.PushDebug<AMFStringValue>("Killer ID") = std::to_string(m_KillerID);
|
||||||
|
|
||||||
// "Scripts"; idk what to do about scripts yet
|
// "Scripts"; idk what to do about scripts yet
|
||||||
auto& immuneCounts = destroyableInfo.PushDebug("Immune Counts");
|
auto& immuneCounts = destroyableInfo.PushDebug("Immune Counts");
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ bool GhostComponent::OnGetGMInvis(GameMessages::GetGMInvis& gmInvisMsg) {
|
|||||||
bool GhostComponent::MsgGetObjectReportInfo(GameMessages::GetObjectReportInfo& reportMsg) {
|
bool GhostComponent::MsgGetObjectReportInfo(GameMessages::GetObjectReportInfo& reportMsg) {
|
||||||
auto& cmptType = reportMsg.info->PushDebug("Ghost");
|
auto& cmptType = reportMsg.info->PushDebug("Ghost");
|
||||||
cmptType.PushDebug<AMFIntValue>("Component ID") = GetComponentID();
|
cmptType.PushDebug<AMFIntValue>("Component ID") = GetComponentID();
|
||||||
cmptType.PushDebug<AMFBoolValue>("Is GM Invis") = m_IsGMInvisible;
|
cmptType.PushDebug<AMFBoolValue>("Is GM Invis") = false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -110,9 +110,15 @@ bool HavokVehiclePhysicsComponent::OnGetObjectReportInfo(GameMessages::GetObject
|
|||||||
|
|
||||||
auto& info = reportInfo.subCategory->PushDebug("Havok Vehicle Physics Info");
|
auto& info = reportInfo.subCategory->PushDebug("Havok Vehicle Physics Info");
|
||||||
|
|
||||||
auto& velocity = info.PushDebug("Velocity").PushDebug(m_Velocity);
|
auto& velocity = info.PushDebug("Velocity");
|
||||||
|
velocity.PushDebug<AMFDoubleValue>("x") = m_Velocity.x;
|
||||||
|
velocity.PushDebug<AMFDoubleValue>("y") = m_Velocity.y;
|
||||||
|
velocity.PushDebug<AMFDoubleValue>("z") = m_Velocity.z;
|
||||||
|
|
||||||
auto& angularVelocity = info.PushDebug("Angular Velocity").PushDebug(m_AngularVelocity);
|
auto& angularVelocity = info.PushDebug("Angular Velocity");
|
||||||
|
angularVelocity.PushDebug<AMFDoubleValue>("x") = m_AngularVelocity.x;
|
||||||
|
angularVelocity.PushDebug<AMFDoubleValue>("y") = m_AngularVelocity.y;
|
||||||
|
angularVelocity.PushDebug<AMFDoubleValue>("z") = m_AngularVelocity.z;
|
||||||
|
|
||||||
info.PushDebug<AMFBoolValue>("Is On Ground") = m_IsOnGround;
|
info.PushDebug<AMFBoolValue>("Is On Ground") = m_IsOnGround;
|
||||||
info.PushDebug<AMFBoolValue>("Is On Rail") = m_IsOnRail;
|
info.PushDebug<AMFBoolValue>("Is On Rail") = m_IsOnRail;
|
||||||
|
|||||||
@@ -723,6 +723,10 @@ void InventoryComponent::Serialize(RakNet::BitStream& outBitStream, const bool b
|
|||||||
for (const auto& pair : m_Equipped) {
|
for (const auto& pair : m_Equipped) {
|
||||||
const auto item = pair.second;
|
const auto item = pair.second;
|
||||||
|
|
||||||
|
if (bIsInitialUpdate) {
|
||||||
|
AddItemSkills(item.lot);
|
||||||
|
}
|
||||||
|
|
||||||
outBitStream.Write(item.id);
|
outBitStream.Write(item.id);
|
||||||
outBitStream.Write(item.lot);
|
outBitStream.Write(item.lot);
|
||||||
|
|
||||||
@@ -1147,12 +1151,14 @@ LOT InventoryComponent::GetConsumable() const {
|
|||||||
void InventoryComponent::AddItemSkills(const LOT lot) {
|
void InventoryComponent::AddItemSkills(const LOT lot) {
|
||||||
const auto info = Inventory::FindItemComponent(lot);
|
const auto info = Inventory::FindItemComponent(lot);
|
||||||
|
|
||||||
const auto slot = FindBehaviorSlot(info.equipLocation);
|
const auto slot = FindBehaviorSlot(static_cast<eItemType>(info.itemType));
|
||||||
|
|
||||||
if (slot == BehaviorSlot::Invalid) {
|
if (slot == BehaviorSlot::Invalid) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const auto index = m_Skills.find(slot);
|
||||||
|
|
||||||
const auto skill = FindSkill(lot);
|
const auto skill = FindSkill(lot);
|
||||||
|
|
||||||
SetSkill(slot, skill);
|
SetSkill(slot, skill);
|
||||||
@@ -1180,7 +1186,7 @@ void InventoryComponent::FixInvisibleItems() {
|
|||||||
void InventoryComponent::RemoveItemSkills(const LOT lot) {
|
void InventoryComponent::RemoveItemSkills(const LOT lot) {
|
||||||
const auto info = Inventory::FindItemComponent(lot);
|
const auto info = Inventory::FindItemComponent(lot);
|
||||||
|
|
||||||
const auto slot = FindBehaviorSlot(info.equipLocation);
|
const auto slot = FindBehaviorSlot(static_cast<eItemType>(info.itemType));
|
||||||
|
|
||||||
if (slot == BehaviorSlot::Invalid) {
|
if (slot == BehaviorSlot::Invalid) {
|
||||||
return;
|
return;
|
||||||
@@ -1192,31 +1198,15 @@ void InventoryComponent::RemoveItemSkills(const LOT lot) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto skillId = FindSkill(lot);
|
const auto old = index->second;
|
||||||
|
|
||||||
// Only act on this slot if it still holds the skill from this item.
|
GameMessages::SendRemoveSkill(m_Parent, old);
|
||||||
// Another item may have overwritten the slot since this one was equipped.
|
|
||||||
if (index->second != skillId) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
m_Skills.erase(slot);
|
m_Skills.erase(slot);
|
||||||
|
|
||||||
// Find another slot that still holds this skillID (if any).
|
|
||||||
const auto surviving = std::ranges::find_if(m_Skills, [skillId](const auto& pair) {
|
|
||||||
return pair.second == skillId;
|
|
||||||
});
|
|
||||||
|
|
||||||
// The client stores one acquiredSkillsInfo entry per skillID, tagged with the slotID
|
|
||||||
// it was originally added with. Always send RemoveSkill to clear that entry, then
|
|
||||||
// re-add with the surviving slot so the client shows it in the correct place.
|
|
||||||
GameMessages::SendRemoveSkill(m_Parent, skillId);
|
|
||||||
if (surviving != m_Skills.end()) {
|
|
||||||
GameMessages::SendAddSkill(m_Parent, skillId, surviving->first);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (slot == BehaviorSlot::Primary) {
|
if (slot == BehaviorSlot::Primary) {
|
||||||
m_Skills.insert_or_assign(BehaviorSlot::Primary, 1);
|
m_Skills.insert_or_assign(BehaviorSlot::Primary, 1);
|
||||||
|
|
||||||
GameMessages::SendAddSkill(m_Parent, 1, BehaviorSlot::Primary);
|
GameMessages::SendAddSkill(m_Parent, 1, BehaviorSlot::Primary);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1308,17 +1298,23 @@ void InventoryComponent::RemoveDatabasePet(LWOOBJID id) {
|
|||||||
m_Pets.erase(id);
|
m_Pets.erase(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
BehaviorSlot InventoryComponent::FindBehaviorSlot(const std::string& equipLocation) {
|
BehaviorSlot InventoryComponent::FindBehaviorSlot(const eItemType type) {
|
||||||
// Skill slot is determined by equipLocation, not itemType.
|
switch (type) {
|
||||||
// Mapping confirmed against live captures and client data (issue #1339).
|
case eItemType::HAT:
|
||||||
if (equipLocation == "special_r") return BehaviorSlot::Primary;
|
return BehaviorSlot::Head;
|
||||||
if (equipLocation == "hair") return BehaviorSlot::Head;
|
case eItemType::NECK:
|
||||||
if (equipLocation == "special_l") return BehaviorSlot::Offhand;
|
return BehaviorSlot::Neck;
|
||||||
if (equipLocation == "clavicle") return BehaviorSlot::Neck;
|
case eItemType::LEFT_HAND:
|
||||||
return BehaviorSlot::Invalid;
|
return BehaviorSlot::Offhand;
|
||||||
|
case eItemType::RIGHT_HAND:
|
||||||
|
return BehaviorSlot::Primary;
|
||||||
|
case eItemType::CONSUMABLE:
|
||||||
|
return BehaviorSlot::Consumable;
|
||||||
|
default:
|
||||||
|
return BehaviorSlot::Invalid;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool InventoryComponent::IsTransferInventory(eInventoryType type, bool includeVault) {
|
bool InventoryComponent::IsTransferInventory(eInventoryType type, bool includeVault) {
|
||||||
return type == VENDOR_BUYBACK || (includeVault && (type == VAULT_ITEMS || type == VAULT_MODELS)) || type == TEMP_ITEMS || type == TEMP_MODELS || type == MODELS_IN_BBB;
|
return type == VENDOR_BUYBACK || (includeVault && (type == VAULT_ITEMS || type == VAULT_MODELS)) || type == TEMP_ITEMS || type == TEMP_MODELS || type == MODELS_IN_BBB;
|
||||||
}
|
}
|
||||||
@@ -1659,28 +1655,10 @@ bool InventoryComponent::SetSkill(BehaviorSlot slot, uint32_t skillId) {
|
|||||||
const auto index = m_Skills.find(slot);
|
const auto index = m_Skills.find(slot);
|
||||||
if (index != m_Skills.end()) {
|
if (index != m_Skills.end()) {
|
||||||
const auto old = index->second;
|
const auto old = index->second;
|
||||||
// Only remove the old skill from the client if no other slot still holds it.
|
GameMessages::SendRemoveSkill(m_Parent, old);
|
||||||
// The client's acquiredSkillsInfo is keyed by skillID (one entry per skill),
|
|
||||||
// so RemoveSkill clears it globally — sending it while another slot still uses
|
|
||||||
// the same skillID would break that slot on the client.
|
|
||||||
const auto usedElsewhere = std::ranges::any_of(m_Skills, [&](const auto& pair) {
|
|
||||||
return pair.first != slot && pair.second == old;
|
|
||||||
});
|
|
||||||
if (!usedElsewhere) {
|
|
||||||
GameMessages::SendRemoveSkill(m_Parent, old);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Only send AddSkill if the client doesn't already know about this skillID.
|
|
||||||
// The client early-exits on duplicate AddSkill (same skillID already in
|
|
||||||
// acquiredSkillsInfo) without updating the slot — so only send when it's new.
|
|
||||||
const auto alreadyKnown = std::ranges::any_of(m_Skills, [&](const auto& pair) {
|
|
||||||
return pair.first != slot && pair.second == skillId;
|
|
||||||
});
|
|
||||||
if (!alreadyKnown) {
|
|
||||||
GameMessages::SendAddSkill(m_Parent, skillId, slot);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GameMessages::SendAddSkill(m_Parent, skillId, slot);
|
||||||
m_Skills.insert_or_assign(slot, skillId);
|
m_Skills.insert_or_assign(slot, skillId);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -1860,9 +1838,9 @@ bool InventoryComponent::OnGetObjectReportInfo(GameMessages::GetObjectReportInfo
|
|||||||
std::stringstream ss;
|
std::stringstream ss;
|
||||||
ss << "%[Objects_" << item->GetLot() << "_name] Slot " << item->GetSlot();
|
ss << "%[Objects_" << item->GetLot() << "_name] Slot " << item->GetSlot();
|
||||||
auto& slot = curInv.PushDebug(ss.str());
|
auto& slot = curInv.PushDebug(ss.str());
|
||||||
slot.PushDebug<AMFStringValue>("Object ID", "LWOOBJID") = std::to_string(item->GetId());
|
slot.PushDebug<AMFStringValue>("Object ID") = std::to_string(item->GetId());
|
||||||
slot.PushDebug<AMFIntValue>("LOT", "LOT") = item->GetLot();
|
slot.PushDebug<AMFIntValue>("LOT") = item->GetLot();
|
||||||
if (item->GetSubKey() != LWOOBJID_EMPTY) slot.PushDebug<AMFStringValue>("Subkey", "LWOOBJID") = std::to_string(item->GetSubKey());
|
if (item->GetSubKey() != LWOOBJID_EMPTY) slot.PushDebug<AMFStringValue>("Subkey") = std::to_string(item->GetSubKey());
|
||||||
slot.PushDebug<AMFIntValue>("Count") = item->GetCount();
|
slot.PushDebug<AMFIntValue>("Count") = item->GetCount();
|
||||||
slot.PushDebug<AMFIntValue>("Slot") = item->GetSlot();
|
slot.PushDebug<AMFIntValue>("Slot") = item->GetSlot();
|
||||||
slot.PushDebug<AMFBoolValue>("Bind on pickup") = item->GetInfo().isBOP;
|
slot.PushDebug<AMFBoolValue>("Bind on pickup") = item->GetInfo().isBOP;
|
||||||
@@ -1881,8 +1859,7 @@ bool InventoryComponent::OnGetObjectReportInfo(GameMessages::GetObjectReportInfo
|
|||||||
ss << "%[Objects_" << info.lot << "_name]";
|
ss << "%[Objects_" << info.lot << "_name]";
|
||||||
auto& equipSlot = equipped.PushDebug(ss.str());
|
auto& equipSlot = equipped.PushDebug(ss.str());
|
||||||
equipSlot.PushDebug<AMFStringValue>("Location") = location;
|
equipSlot.PushDebug<AMFStringValue>("Location") = location;
|
||||||
equipSlot.PushDebug<AMFStringValue>("Object ID", "LWOOBJID") = std::to_string(info.id);
|
equipSlot.PushDebug<AMFStringValue>("Object ID") = std::to_string(info.id);
|
||||||
equipSlot.PushDebug<AMFIntValue>("LOT", "LOT") = info.lot;
|
|
||||||
equipSlot.PushDebug<AMFIntValue>("Slot") = info.slot;
|
equipSlot.PushDebug<AMFIntValue>("Slot") = info.slot;
|
||||||
equipSlot.PushDebug<AMFIntValue>("Count") = info.count;
|
equipSlot.PushDebug<AMFIntValue>("Count") = info.count;
|
||||||
auto& extra = equipSlot.PushDebug("Extra Info");
|
auto& extra = equipSlot.PushDebug("Extra Info");
|
||||||
|
|||||||
@@ -367,10 +367,11 @@ public:
|
|||||||
void RemoveDatabasePet(LWOOBJID id);
|
void RemoveDatabasePet(LWOOBJID id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the behavior slot for the given equipLocation string.
|
* Returns the current behavior slot active for the passed item type
|
||||||
* This is the authoritative mapping used for skill slot assignment.
|
* @param type the item type to find the behavior slot for
|
||||||
|
* @return the current behavior slot active for the passed item type
|
||||||
*/
|
*/
|
||||||
static BehaviorSlot FindBehaviorSlot(const std::string& equipLocation);
|
static BehaviorSlot FindBehaviorSlot(eItemType type);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if the inventory type is a temp inventory
|
* Checks if the inventory type is a temp inventory
|
||||||
@@ -402,8 +403,6 @@ public:
|
|||||||
|
|
||||||
std::map<BehaviorSlot, uint32_t> GetSkills() { return m_Skills; };
|
std::map<BehaviorSlot, uint32_t> GetSkills() { return m_Skills; };
|
||||||
|
|
||||||
void ClearSkills() { m_Skills.clear(); };
|
|
||||||
|
|
||||||
bool SetSkill(int slot, uint32_t skillId);
|
bool SetSkill(int slot, uint32_t skillId);
|
||||||
bool SetSkill(BehaviorSlot slot, uint32_t skillId);
|
bool SetSkill(BehaviorSlot slot, uint32_t skillId);
|
||||||
|
|
||||||
|
|||||||
@@ -652,7 +652,7 @@ void PushMissions(const std::map<uint32_t, Mission*>& missions, AMFArrayValue& V
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool MissionComponent::OnGetObjectReportInfo(GameMessages::GetObjectReportInfo& reportInfo) {
|
bool MissionComponent::OnGetObjectReportInfo(GameMessages::GetObjectReportInfo& reportInfo) {
|
||||||
auto& missionInfo = reportInfo.info->PushDebug("Mission (Laggy)", "", 1);
|
auto& missionInfo = reportInfo.info->PushDebug("Mission (Laggy)");
|
||||||
missionInfo.PushDebug<AMFIntValue>("Component ID") = GetComponentID();
|
missionInfo.PushDebug<AMFIntValue>("Component ID") = GetComponentID();
|
||||||
// Sort the missions so they are easier to parse and present to the end user
|
// Sort the missions so they are easier to parse and present to the end user
|
||||||
std::map<uint32_t, Mission*> achievements;
|
std::map<uint32_t, Mission*> achievements;
|
||||||
|
|||||||
@@ -355,8 +355,8 @@ bool ModelComponent::OnGetObjectReportInfo(GameMessages::GetObjectReportInfo& re
|
|||||||
|
|
||||||
cmptInfo.PushDebug<AMFStringValue>("Name") = "Objects_" + std::to_string(m_Parent->GetLOT()) + "_name";
|
cmptInfo.PushDebug<AMFStringValue>("Name") = "Objects_" + std::to_string(m_Parent->GetLOT()) + "_name";
|
||||||
cmptInfo.PushDebug<AMFBoolValue>("Has Unique Name") = false;
|
cmptInfo.PushDebug<AMFBoolValue>("Has Unique Name") = false;
|
||||||
cmptInfo.PushDebug<AMFStringValue>("UGID (from item)", "LWOOBJID") = std::to_string(m_userModelID);
|
cmptInfo.PushDebug<AMFStringValue>("UGID (from item)") = std::to_string(m_userModelID);
|
||||||
cmptInfo.PushDebug<AMFStringValue>("UGID", "LWOOBJID") = std::to_string(m_userModelID);
|
cmptInfo.PushDebug<AMFStringValue>("UGID") = std::to_string(m_userModelID);
|
||||||
cmptInfo.PushDebug<AMFStringValue>("Description") = "";
|
cmptInfo.PushDebug<AMFStringValue>("Description") = "";
|
||||||
cmptInfo.PushDebug<AMFIntValue>("Behavior Count") = m_Behaviors.size();
|
cmptInfo.PushDebug<AMFIntValue>("Behavior Count") = m_Behaviors.size();
|
||||||
|
|
||||||
|
|||||||
@@ -535,14 +535,20 @@ bool MovementAIComponent::OnGetObjectReportInfo(GameMessages::GetObjectReportInf
|
|||||||
movementInfo.PushDebug<AMFDoubleValue>("Pulling To Point") = m_PullingToPoint;
|
movementInfo.PushDebug<AMFDoubleValue>("Pulling To Point") = m_PullingToPoint;
|
||||||
movementInfo.PushDebug<AMFBoolValue>("At Final Waypoint") = m_AtFinalWaypoint;
|
movementInfo.PushDebug<AMFBoolValue>("At Final Waypoint") = m_AtFinalWaypoint;
|
||||||
|
|
||||||
auto& pullPointInfo = movementInfo.PushDebug("Pull Point").PushDebug(m_PullPoint);
|
auto& pullPointInfo = movementInfo.PushDebug("Pull Point");
|
||||||
|
pullPointInfo.PushDebug<AMFDoubleValue>("X") = m_PullPoint.x;
|
||||||
|
pullPointInfo.PushDebug<AMFDoubleValue>("Y") = m_PullPoint.y;
|
||||||
|
pullPointInfo.PushDebug<AMFDoubleValue>("Z") = m_PullPoint.z;
|
||||||
|
|
||||||
// movementInfo.PushDebug<AMFDoubleValue>("Delay") = m_Delay;
|
// movementInfo.PushDebug<AMFDoubleValue>("Delay") = m_Delay;
|
||||||
|
|
||||||
auto& waypoints = movementInfo.PushDebug("Interpolated Waypoints");
|
auto& waypoints = movementInfo.PushDebug("Interpolated Waypoints");
|
||||||
int i = 0;
|
int i = 0;
|
||||||
for (const auto& point : m_InterpolatedWaypoints) {
|
for (const auto& point : m_InterpolatedWaypoints) {
|
||||||
waypoints.PushDebug("Waypoint " + std::to_string(++i)).PushDebug(point);
|
auto& waypoint = waypoints.PushDebug("Waypoint " + std::to_string(++i));
|
||||||
|
waypoint.PushDebug<AMFDoubleValue>("X") = point.x;
|
||||||
|
waypoint.PushDebug<AMFDoubleValue>("Y") = point.y;
|
||||||
|
waypoint.PushDebug<AMFDoubleValue>("Z") = point.z;
|
||||||
}
|
}
|
||||||
|
|
||||||
i = 0;
|
i = 0;
|
||||||
@@ -550,7 +556,10 @@ bool MovementAIComponent::OnGetObjectReportInfo(GameMessages::GetObjectReportInf
|
|||||||
auto pathCopy = m_CurrentPath; // Copy to avoid modifying the original stack
|
auto pathCopy = m_CurrentPath; // Copy to avoid modifying the original stack
|
||||||
while (!pathCopy.empty()) {
|
while (!pathCopy.empty()) {
|
||||||
const auto& waypoint = pathCopy.top();
|
const auto& waypoint = pathCopy.top();
|
||||||
currentPath.PushDebug("Waypoint " + std::to_string(++i)).PushDebug(waypoint.position);
|
auto& pathWaypoint = currentPath.PushDebug("Waypoint " + std::to_string(++i));
|
||||||
|
pathWaypoint.PushDebug<AMFDoubleValue>("X") = waypoint.position.x;
|
||||||
|
pathWaypoint.PushDebug<AMFDoubleValue>("Y") = waypoint.position.y;
|
||||||
|
pathWaypoint.PushDebug<AMFDoubleValue>("Z") = waypoint.position.z;
|
||||||
|
|
||||||
pathCopy.pop();
|
pathCopy.pop();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -238,7 +238,10 @@ bool PhantomPhysicsComponent::OnGetObjectReportInfo(GameMessages::GetObjectRepor
|
|||||||
info.PushDebug<AMFIntValue>("Effect Type") = static_cast<int>(m_EffectType);
|
info.PushDebug<AMFIntValue>("Effect Type") = static_cast<int>(m_EffectType);
|
||||||
info.PushDebug<AMFDoubleValue>("Directional Multiplier") = m_DirectionalMultiplier;
|
info.PushDebug<AMFDoubleValue>("Directional Multiplier") = m_DirectionalMultiplier;
|
||||||
info.PushDebug<AMFBoolValue>("Is Directional") = m_IsDirectional;
|
info.PushDebug<AMFBoolValue>("Is Directional") = m_IsDirectional;
|
||||||
auto& direction = info.PushDebug("Direction").PushDebug(m_Direction);
|
auto& direction = info.PushDebug("Direction");
|
||||||
|
direction.PushDebug<AMFDoubleValue>("x") = m_Direction.x;
|
||||||
|
direction.PushDebug<AMFDoubleValue>("y") = m_Direction.y;
|
||||||
|
direction.PushDebug<AMFDoubleValue>("z") = m_Direction.z;
|
||||||
|
|
||||||
if (m_MinMax) {
|
if (m_MinMax) {
|
||||||
auto& minMaxInfo = info.PushDebug("Min Max Info");
|
auto& minMaxInfo = info.PushDebug("Min Max Info");
|
||||||
@@ -249,8 +252,15 @@ bool PhantomPhysicsComponent::OnGetObjectReportInfo(GameMessages::GetObjectRepor
|
|||||||
if (m_IsRespawnVolume) {
|
if (m_IsRespawnVolume) {
|
||||||
auto& respawnInfo = info.PushDebug("Respawn Info");
|
auto& respawnInfo = info.PushDebug("Respawn Info");
|
||||||
respawnInfo.PushDebug<AMFBoolValue>("Is Respawn Volume") = m_IsRespawnVolume;
|
respawnInfo.PushDebug<AMFBoolValue>("Is Respawn Volume") = m_IsRespawnVolume;
|
||||||
respawnInfo.PushDebug("Respawn Position").PushDebug(m_RespawnPos);
|
auto& respawnPos = respawnInfo.PushDebug("Respawn Position");
|
||||||
respawnInfo.PushDebug("Respawn Rotation").PushDebug(m_RespawnRot);
|
respawnPos.PushDebug<AMFDoubleValue>("x") = m_RespawnPos.x;
|
||||||
|
respawnPos.PushDebug<AMFDoubleValue>("y") = m_RespawnPos.y;
|
||||||
|
respawnPos.PushDebug<AMFDoubleValue>("z") = m_RespawnPos.z;
|
||||||
|
auto& respawnRot = respawnInfo.PushDebug("Respawn Rotation");
|
||||||
|
respawnRot.PushDebug<AMFDoubleValue>("w") = m_RespawnRot.w;
|
||||||
|
respawnRot.PushDebug<AMFDoubleValue>("x") = m_RespawnRot.x;
|
||||||
|
respawnRot.PushDebug<AMFDoubleValue>("y") = m_RespawnRot.y;
|
||||||
|
respawnRot.PushDebug<AMFDoubleValue>("z") = m_RespawnRot.z;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -249,11 +249,18 @@ bool PhysicsComponent::OnGetObjectReportInfo(GameMessages::GetObjectReportInfo&
|
|||||||
auto& info = reportInfo.info->PushDebug("Physics");
|
auto& info = reportInfo.info->PushDebug("Physics");
|
||||||
reportInfo.subCategory = &info;
|
reportInfo.subCategory = &info;
|
||||||
|
|
||||||
auto& pos = info.PushDebug("Position").PushDebug(m_Position);
|
auto& pos = info.PushDebug("Position");
|
||||||
|
pos.PushDebug<AMFDoubleValue>("x") = m_Position.x;
|
||||||
|
pos.PushDebug<AMFDoubleValue>("y") = m_Position.y;
|
||||||
|
pos.PushDebug<AMFDoubleValue>("z") = m_Position.z;
|
||||||
|
|
||||||
auto& rot = info.PushDebug("Rotation").PushDebug(m_Rotation);
|
auto& rot = info.PushDebug("Rotation");
|
||||||
|
rot.PushDebug<AMFDoubleValue>("w") = m_Rotation.w;
|
||||||
|
rot.PushDebug<AMFDoubleValue>("x") = m_Rotation.x;
|
||||||
|
rot.PushDebug<AMFDoubleValue>("y") = m_Rotation.y;
|
||||||
|
rot.PushDebug<AMFDoubleValue>("z") = m_Rotation.z;
|
||||||
|
|
||||||
info.PushDebug<AMFIntValue>("Collision Group") = m_CollisionGroup;
|
info.PushDebug<AMFIntValue>("CollisionGroup") = m_CollisionGroup;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -80,9 +80,8 @@ bool ProximityMonitorComponent::OnGetObjectReportInfo(GameMessages::GetObjectRep
|
|||||||
proxAmf.PushDebug("Position").PushDebug(entity->GetPosition());
|
proxAmf.PushDebug("Position").PushDebug(entity->GetPosition());
|
||||||
proxAmf.PushDebug("Rotation").PushDebug(entity->GetRotation());
|
proxAmf.PushDebug("Rotation").PushDebug(entity->GetRotation());
|
||||||
auto& collidingAmf = proxAmf.PushDebug("Colliding Objects");
|
auto& collidingAmf = proxAmf.PushDebug("Colliding Objects");
|
||||||
int i = 1;
|
|
||||||
for (const auto& colliding : entity->GetCurrentlyCollidingObjects()) {
|
for (const auto& colliding : entity->GetCurrentlyCollidingObjects()) {
|
||||||
collidingAmf.PushDebug<AMFStringValue>(std::to_string(i++), "LWOOBJID") = std::to_string(colliding);
|
collidingAmf.PushDebug(std::to_string(colliding));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -576,25 +576,25 @@ bool QuickBuildComponent::OnGetObjectReportInfo(GameMessages::GetObjectReportInf
|
|||||||
auto& quickbuild = reportInfo.info->PushDebug("Quick Build");
|
auto& quickbuild = reportInfo.info->PushDebug("Quick Build");
|
||||||
quickbuild.PushDebug<AMFStringValue>("State") = StringifiedEnum::ToString(m_State).data();
|
quickbuild.PushDebug<AMFStringValue>("State") = StringifiedEnum::ToString(m_State).data();
|
||||||
quickbuild.PushDebug<AMFDoubleValue>("Timer") = m_Timer;
|
quickbuild.PushDebug<AMFDoubleValue>("Timer") = m_Timer;
|
||||||
quickbuild.PushDebug<AMFDoubleValue>("Timer Incomplete") = m_TimerIncomplete;
|
quickbuild.PushDebug<AMFDoubleValue>("TimerIncomplete") = m_TimerIncomplete;
|
||||||
quickbuild.PushDebug("Activator Position").PushDebug(m_ActivatorPosition);
|
quickbuild.PushDebug("ActivatorPosition").PushDebug(m_ActivatorPosition);
|
||||||
quickbuild.PushDebug<AMFStringValue>("Activator ID", "LWOOBJID") = std::to_string(m_ActivatorId);
|
quickbuild.PushDebug<AMFStringValue>("ActivatorId") = std::to_string(m_ActivatorId);
|
||||||
quickbuild.PushDebug<AMFBoolValue>("Show Reset Effect") = m_ShowResetEffect;
|
quickbuild.PushDebug<AMFBoolValue>("ShowResetEffect") = m_ShowResetEffect;
|
||||||
quickbuild.PushDebug<AMFDoubleValue>("Taken") = m_Taken;
|
quickbuild.PushDebug<AMFDoubleValue>("Taken") = m_Taken;
|
||||||
quickbuild.PushDebug<AMFDoubleValue>("Reset Time") = m_ResetTime;
|
quickbuild.PushDebug<AMFDoubleValue>("ResetTime") = m_ResetTime;
|
||||||
quickbuild.PushDebug<AMFDoubleValue>("Complete Time") = m_CompleteTime;
|
quickbuild.PushDebug<AMFDoubleValue>("CompleteTime") = m_CompleteTime;
|
||||||
quickbuild.PushDebug<AMFIntValue>("Take Imagination") = m_TakeImagination;
|
quickbuild.PushDebug<AMFIntValue>("TakeImagination") = m_TakeImagination;
|
||||||
quickbuild.PushDebug<AMFBoolValue>("Interruptible") = m_Interruptible;
|
quickbuild.PushDebug<AMFBoolValue>("Interruptible") = m_Interruptible;
|
||||||
quickbuild.PushDebug<AMFBoolValue>("Self Activator") = m_SelfActivator;
|
quickbuild.PushDebug<AMFBoolValue>("SelfActivator") = m_SelfActivator;
|
||||||
auto& modules = quickbuild.PushDebug("Custom Modules");
|
auto& modules = quickbuild.PushDebug("CustomModules");
|
||||||
for (const auto cmodule : m_CustomModules) modules.PushDebug<AMFIntValue>("Module") = cmodule;
|
for (const auto cmodule : m_CustomModules) modules.PushDebug<AMFIntValue>("Module") = cmodule;
|
||||||
quickbuild.PushDebug<AMFIntValue>("Activity Id") = m_ActivityId;
|
quickbuild.PushDebug<AMFIntValue>("ActivityId") = m_ActivityId;
|
||||||
quickbuild.PushDebug<AMFIntValue>("Post Imagination Cost") = m_PostImaginationCost;
|
quickbuild.PushDebug<AMFIntValue>("PostImaginationCost") = m_PostImaginationCost;
|
||||||
quickbuild.PushDebug<AMFDoubleValue>("Time Before Smash") = m_TimeBeforeSmash;
|
quickbuild.PushDebug<AMFDoubleValue>("TimeBeforeSmash") = m_TimeBeforeSmash;
|
||||||
quickbuild.PushDebug<AMFDoubleValue>("Time Before Drain") = m_TimeBeforeDrain;
|
quickbuild.PushDebug<AMFDoubleValue>("TimeBeforeDrain") = m_TimeBeforeDrain;
|
||||||
quickbuild.PushDebug<AMFIntValue>("Drained Imagination") = m_DrainedImagination;
|
quickbuild.PushDebug<AMFIntValue>("DrainedImagination") = m_DrainedImagination;
|
||||||
quickbuild.PushDebug<AMFBoolValue>("Reposition Player") = m_RepositionPlayer;
|
quickbuild.PushDebug<AMFBoolValue>("RepositionPlayer") = m_RepositionPlayer;
|
||||||
quickbuild.PushDebug<AMFDoubleValue>("Soft Timer") = m_SoftTimer;
|
quickbuild.PushDebug<AMFDoubleValue>("SoftTimer") = m_SoftTimer;
|
||||||
quickbuild.PushDebug<AMFStringValue>("Builder", "LWOOBJID") = std::to_string(m_Builder);
|
quickbuild.PushDebug<AMFStringValue>("Builder") = std::to_string(m_Builder);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ ScriptComponent::ScriptComponent(Entity* parent, const int32_t componentID, cons
|
|||||||
m_ScriptName = scriptName;
|
m_ScriptName = scriptName;
|
||||||
|
|
||||||
SetScript(scriptName);
|
SetScript(scriptName);
|
||||||
Component::RegisterMsg(&ScriptComponent::OnGetObjectReportInfo);
|
RegisterMsg(&ScriptComponent::OnGetObjectReportInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScriptComponent::Serialize(RakNet::BitStream& outBitStream, bool bIsInitialUpdate) {
|
void ScriptComponent::Serialize(RakNet::BitStream& outBitStream, bool bIsInitialUpdate) {
|
||||||
|
|||||||
@@ -8,9 +8,6 @@
|
|||||||
|
|
||||||
#include "CppScripts.h"
|
#include "CppScripts.h"
|
||||||
#include "Component.h"
|
#include "Component.h"
|
||||||
#include "GameMessages.h"
|
|
||||||
#include <functional>
|
|
||||||
#include <map>
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include "eReplicaComponentType.h"
|
#include "eReplicaComponentType.h"
|
||||||
|
|
||||||
@@ -48,19 +45,6 @@ public:
|
|||||||
|
|
||||||
bool OnGetObjectReportInfo(GameMessages::GetObjectReportInfo& reportInfo);
|
bool OnGetObjectReportInfo(GameMessages::GetObjectReportInfo& reportInfo);
|
||||||
|
|
||||||
// Registers a message from a script to be listened for on the parent object
|
|
||||||
template<typename ScriptClass, typename DerivedMsgType>
|
|
||||||
void RegisterMsg(ScriptClass* scriptThis, bool (ScriptClass::*scriptHandler)(Entity&, DerivedMsgType&)) {
|
|
||||||
static_assert(std::is_base_of_v<GameMessages::GameMsg, DerivedMsgType>, "DerivedMsgType must derive from GameMessages::GameMsg base class.");
|
|
||||||
const auto boundMsg = std::bind(scriptHandler, scriptThis, std::placeholders::_1, std::placeholders::_2);
|
|
||||||
auto* const parent = m_Parent;
|
|
||||||
const auto castWrapper = [parent, boundMsg](GameMessages::GameMsg& msg) {
|
|
||||||
return boundMsg(*parent, static_cast<DerivedMsgType&>(msg));
|
|
||||||
};
|
|
||||||
DerivedMsgType msg;
|
|
||||||
m_Parent->RegisterMsg(msg.msgId, castWrapper);
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -79,8 +79,14 @@ void SimplePhysicsComponent::SetPhysicsMotionState(uint32_t value) {
|
|||||||
bool SimplePhysicsComponent::OnGetObjectReportInfo(GameMessages::GetObjectReportInfo& reportInfo) {
|
bool SimplePhysicsComponent::OnGetObjectReportInfo(GameMessages::GetObjectReportInfo& reportInfo) {
|
||||||
PhysicsComponent::OnGetObjectReportInfo(reportInfo);
|
PhysicsComponent::OnGetObjectReportInfo(reportInfo);
|
||||||
auto& info = reportInfo.subCategory->PushDebug("Simple Physics Info");
|
auto& info = reportInfo.subCategory->PushDebug("Simple Physics Info");
|
||||||
info.PushDebug("Velocity").PushDebug(m_Velocity);
|
auto& velocity = info.PushDebug("Velocity");
|
||||||
info.PushDebug("Angular Velocity").PushDebug(m_AngularVelocity);
|
velocity.PushDebug<AMFDoubleValue>("x") = m_Velocity.x;
|
||||||
|
velocity.PushDebug<AMFDoubleValue>("y") = m_Velocity.y;
|
||||||
|
velocity.PushDebug<AMFDoubleValue>("z") = m_Velocity.z;
|
||||||
|
auto& angularVelocity = info.PushDebug("Angular Velocity");
|
||||||
|
angularVelocity.PushDebug<AMFDoubleValue>("x") = m_AngularVelocity.x;
|
||||||
|
angularVelocity.PushDebug<AMFDoubleValue>("y") = m_AngularVelocity.y;
|
||||||
|
angularVelocity.PushDebug<AMFDoubleValue>("z") = m_AngularVelocity.z;
|
||||||
info.PushDebug<AMFIntValue>("Physics Motion State") = m_PhysicsMotionState;
|
info.PushDebug<AMFIntValue>("Physics Motion State") = m_PhysicsMotionState;
|
||||||
info.PushDebug<AMFStringValue>("Climbable Type") = StringifiedEnum::ToString(m_ClimbableType).data();
|
info.PushDebug<AMFStringValue>("Climbable Type") = StringifiedEnum::ToString(m_ClimbableType).data();
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -159,10 +159,6 @@ void GameMessageHandler::HandleMessage(RakNet::BitStream& inStream, const System
|
|||||||
|
|
||||||
InventoryComponent* inv = entity->GetComponent<InventoryComponent>();
|
InventoryComponent* inv = entity->GetComponent<InventoryComponent>();
|
||||||
if (inv) {
|
if (inv) {
|
||||||
// Clear server-side skill state so AddItemSkills sends fresh AddSkill
|
|
||||||
// packets to the now-ready client. Skills sent during entity construction
|
|
||||||
// (Serialize) arrive before LWOSkillComponent is initialized and are dropped.
|
|
||||||
inv->ClearSkills();
|
|
||||||
auto items = inv->GetEquippedItems();
|
auto items = inv->GetEquippedItems();
|
||||||
for (auto pair : items) {
|
for (auto pair : items) {
|
||||||
const auto item = pair.second;
|
const auto item = pair.second;
|
||||||
|
|||||||
@@ -45,7 +45,6 @@ enum class BehaviorSlot : int32_t;
|
|||||||
enum class eVendorTransactionResult : uint32_t;
|
enum class eVendorTransactionResult : uint32_t;
|
||||||
enum class eReponseMoveItemBetweenInventoryTypeCode : int32_t;
|
enum class eReponseMoveItemBetweenInventoryTypeCode : int32_t;
|
||||||
enum class eMissionState : int;
|
enum class eMissionState : int;
|
||||||
enum class AiState : uint32_t;
|
|
||||||
|
|
||||||
enum class eCameraTargetCyclingMode : int32_t {
|
enum class eCameraTargetCyclingMode : int32_t {
|
||||||
ALLOW_CYCLE_TEAMMATES,
|
ALLOW_CYCLE_TEAMMATES,
|
||||||
@@ -981,12 +980,5 @@ namespace GameMessages {
|
|||||||
LWOOBJID objectID{};
|
LWOOBJID objectID{};
|
||||||
LOT lot{};
|
LOT lot{};
|
||||||
};
|
};
|
||||||
|
|
||||||
struct NotifyCombatAIStateChange : public GameMsg {
|
|
||||||
NotifyCombatAIStateChange() : GameMsg(MessageType::Game::NOTIFY_COMBAT_AI_STATE_CHANGE) {}
|
|
||||||
|
|
||||||
AiState newState{};
|
|
||||||
AiState prevState{};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
#endif // GAMEMESSAGES_H
|
#endif // GAMEMESSAGES_H
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
set(DSCRIPTS_SOURCES_02_SERVER_ENEMY_FV
|
set(DSCRIPTS_SOURCES_02_SERVER_ENEMY_FV
|
||||||
"DragonRonin.cpp"
|
|
||||||
"FvMaelstromCavalry.cpp"
|
"FvMaelstromCavalry.cpp"
|
||||||
"FvMaelstromDragon.cpp"
|
"FvMaelstromDragon.cpp"
|
||||||
PARENT_SCOPE)
|
PARENT_SCOPE)
|
||||||
|
|||||||
@@ -1,6 +0,0 @@
|
|||||||
#include "DragonRonin.h"
|
|
||||||
|
|
||||||
void DragonRonin::OnStartup(Entity* self) {
|
|
||||||
self->SetVar<float>(u"suicideTimer", 40.0f);
|
|
||||||
CountdownDestroyAI::OnStartup(self);
|
|
||||||
}
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
#include "CountdownDestroyAI.h"
|
|
||||||
|
|
||||||
class DragonRonin : public CountdownDestroyAI {
|
|
||||||
public:
|
|
||||||
void OnStartup(Entity* self) override;
|
|
||||||
};
|
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
set(DSCRIPTS_SOURCES_02_SERVER_ENEMY_GENERAL
|
set(DSCRIPTS_SOURCES_02_SERVER_ENEMY_GENERAL
|
||||||
"BaseEnemyMech.cpp"
|
"BaseEnemyMech.cpp"
|
||||||
"BaseEnemyApe.cpp"
|
"BaseEnemyApe.cpp"
|
||||||
"CountdownDestroyAI.cpp"
|
|
||||||
"GfApeSmashingQB.cpp"
|
"GfApeSmashingQB.cpp"
|
||||||
"TreasureChestDragonServer.cpp"
|
"TreasureChestDragonServer.cpp"
|
||||||
"EnemyNjBuff.cpp"
|
"EnemyNjBuff.cpp"
|
||||||
|
|||||||
@@ -1,50 +0,0 @@
|
|||||||
#include "CountdownDestroyAI.h"
|
|
||||||
|
|
||||||
#include "BaseCombatAIComponent.h"
|
|
||||||
#include "ScriptComponent.h"
|
|
||||||
|
|
||||||
void CountdownDestroyAI::OnStartup(Entity* self) {
|
|
||||||
CountdownStartup(*self);
|
|
||||||
auto* scriptComp = self->GetComponent<ScriptComponent>();
|
|
||||||
if (scriptComp) scriptComp->RegisterMsg(this, &CountdownDestroyAI::OnNotifyCombatAIStateChange);
|
|
||||||
}
|
|
||||||
|
|
||||||
void CountdownDestroyAI::CountdownStartup(Entity& self) {
|
|
||||||
auto suicideTimer = self.GetVar<float>(u"suicideTimer");
|
|
||||||
if (suicideTimer == 0.0f) suicideTimer = 60;
|
|
||||||
self.AddTimer("Dead", suicideTimer);
|
|
||||||
}
|
|
||||||
|
|
||||||
void CountdownDestroyAI::OnHit(Entity* self, Entity* attacker) {
|
|
||||||
if (!self->GetVar<bool>(u"ShouldBeDead")) return;
|
|
||||||
self->CancelTimer("IsBeingAttacked");
|
|
||||||
self->AddTimer("Dead", 5.0f);
|
|
||||||
}
|
|
||||||
|
|
||||||
void CountdownDestroyAI::OnTimerDone(Entity* self, std::string timerName) {
|
|
||||||
if (timerName == "Dead") {
|
|
||||||
self->SetVar<bool>(u"ShouldBeDead", true);
|
|
||||||
if (self->GetVar<bool>(u"Busy")) {
|
|
||||||
self->AddTimer("IsBeingAttacked", 5.0f);
|
|
||||||
} else {
|
|
||||||
self->Smash();
|
|
||||||
}
|
|
||||||
} else if (timerName == "IsBeingAttacked") {
|
|
||||||
self->Smash();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool CountdownDestroyAI::OnNotifyCombatAIStateChange(Entity& self, GameMessages::NotifyCombatAIStateChange& notifyMsg) {
|
|
||||||
const auto curState = notifyMsg.newState;
|
|
||||||
if (curState == AiState::dead) return true;
|
|
||||||
|
|
||||||
if (curState == AiState::aggro || curState == AiState::tether) {
|
|
||||||
self.SetVar(u"Busy", true);
|
|
||||||
} else {
|
|
||||||
self.SetVar(u"Busy", false);
|
|
||||||
if (self.GetVar<bool>(u"ShouldBeDead")) {
|
|
||||||
self.Smash();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
#include "CppScripts.h"
|
|
||||||
|
|
||||||
#include "GameMessages.h"
|
|
||||||
|
|
||||||
class CountdownDestroyAI : public CppScripts::Script {
|
|
||||||
public:
|
|
||||||
void OnStartup(Entity* self) override;
|
|
||||||
void CountdownStartup(Entity& self);
|
|
||||||
void OnHit(Entity* self, Entity* attacker) override;
|
|
||||||
void OnTimerDone(Entity* self, std::string timerName) override;
|
|
||||||
bool OnNotifyCombatAIStateChange(Entity& self, GameMessages::NotifyCombatAIStateChange& msg);
|
|
||||||
};
|
|
||||||
@@ -6,7 +6,6 @@ set(DSCRIPTS_SOURCES_02_SERVER_MAP_NJHUB
|
|||||||
"EnemySkeletonSpawner.cpp"
|
"EnemySkeletonSpawner.cpp"
|
||||||
"FallingTile.cpp"
|
"FallingTile.cpp"
|
||||||
"FlameJetServer.cpp"
|
"FlameJetServer.cpp"
|
||||||
"LightningOrbServer.cpp"
|
|
||||||
"ImaginationShrineServer.cpp"
|
"ImaginationShrineServer.cpp"
|
||||||
"Lieutenant.cpp"
|
"Lieutenant.cpp"
|
||||||
"MonCoreNookDoors.cpp"
|
"MonCoreNookDoors.cpp"
|
||||||
|
|||||||
@@ -1,12 +0,0 @@
|
|||||||
#include "LightningOrbServer.h"
|
|
||||||
|
|
||||||
void LightningOrbServer::OnCollisionPhantom(Entity* self, Entity* target) {
|
|
||||||
GameMessages::GetPosition playerPos;
|
|
||||||
playerPos.Send(target->GetObjectID());
|
|
||||||
GameMessages::GetPosition selfPos;
|
|
||||||
selfPos.Send(self->GetObjectID());
|
|
||||||
const NiPoint3 newVec((playerPos.pos.x - selfPos.pos.x) * 2.5, 15, (playerPos.pos.z - selfPos.pos.z) * 2.5);
|
|
||||||
// ahhhh aron said to put a TODO here moving platforms don't work lol. disable this so people can actually do the puzzle
|
|
||||||
// GameMessages::SendKnockback(target->GetObjectID(), self->GetObjectID(), self->GetObjectID(), 0, newVec);
|
|
||||||
// GameMessages::SendPlayFXEffect(target->GetObjectID(), -1, u"knockback", "knockback");
|
|
||||||
}
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
#include "CppScripts.h"
|
|
||||||
|
|
||||||
class LightningOrbServer : public CppScripts::Script
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
void OnCollisionPhantom(Entity* self, Entity* target) override;
|
|
||||||
};
|
|
||||||
@@ -135,11 +135,8 @@
|
|||||||
#include "FvMaelstromCavalry.h"
|
#include "FvMaelstromCavalry.h"
|
||||||
#include "FvHorsemenTrigger.h"
|
#include "FvHorsemenTrigger.h"
|
||||||
#include "FvFlyingCreviceDragon.h"
|
#include "FvFlyingCreviceDragon.h"
|
||||||
#include "FvDragonInstanceServer.h"
|
|
||||||
#include "FvMaelstromDragon.h"
|
#include "FvMaelstromDragon.h"
|
||||||
#include "DragonRonin.h"
|
|
||||||
#include "FvDragonSmashingGolemQb.h"
|
#include "FvDragonSmashingGolemQb.h"
|
||||||
#include "CountdownDestroyAI.h"
|
|
||||||
#include "TreasureChestDragonServer.h"
|
#include "TreasureChestDragonServer.h"
|
||||||
#include "InstanceExitTransferPlayerToLastNonInstance.h"
|
#include "InstanceExitTransferPlayerToLastNonInstance.h"
|
||||||
#include "FvFreeGfNinjas.h"
|
#include "FvFreeGfNinjas.h"
|
||||||
@@ -277,7 +274,6 @@
|
|||||||
#include "MonCoreNookDoors.h"
|
#include "MonCoreNookDoors.h"
|
||||||
#include "MonCoreSmashableDoors.h"
|
#include "MonCoreSmashableDoors.h"
|
||||||
#include "FlameJetServer.h"
|
#include "FlameJetServer.h"
|
||||||
#include "LightningOrbServer.h"
|
|
||||||
#include "BurningTile.h"
|
#include "BurningTile.h"
|
||||||
#include "NjEarthDragonPetServer.h"
|
#include "NjEarthDragonPetServer.h"
|
||||||
#include "NjEarthPetServer.h"
|
#include "NjEarthPetServer.h"
|
||||||
@@ -494,10 +490,7 @@ namespace {
|
|||||||
{"scripts\\ai\\FV\\L_ACT_NINJA_TURRET_1.lua", []() {return new ActNinjaTurret();}},
|
{"scripts\\ai\\FV\\L_ACT_NINJA_TURRET_1.lua", []() {return new ActNinjaTurret();}},
|
||||||
{"scripts\\02_server\\Map\\FV\\L_FV_HORSEMEN_TRIGGER.lua", []() {return new FvHorsemenTrigger();}},
|
{"scripts\\02_server\\Map\\FV\\L_FV_HORSEMEN_TRIGGER.lua", []() {return new FvHorsemenTrigger();}},
|
||||||
{"scripts\\ai\\FV\\L_FV_FLYING_CREVICE_DRAGON.lua", []() {return new FvFlyingCreviceDragon();}},
|
{"scripts\\ai\\FV\\L_FV_FLYING_CREVICE_DRAGON.lua", []() {return new FvFlyingCreviceDragon();}},
|
||||||
{"scripts\\ai\\FV\\Dragon_Instance\\L_FV_DRAGON_INSTANCE_SERVER.lua", []() {return new FvDragonInstanceServer();}},
|
|
||||||
{"scripts\\02_server\\Enemy\\FV\\L_FV_DRAGON_RONIN.lua", []() {return new DragonRonin();}},
|
|
||||||
{"scripts\\02_server\\Enemy\\FV\\L_FV_MAELSTROM_DRAGON.lua", []() {return new FvMaelstromDragon();}},
|
{"scripts\\02_server\\Enemy\\FV\\L_FV_MAELSTROM_DRAGON.lua", []() {return new FvMaelstromDragon();}},
|
||||||
{"scripts\\02_server\\Enemy\\General\\L_COUNTDOWN_DESTROY_AI.lua", []() {return new CountdownDestroyAI();}},
|
|
||||||
{"scripts\\ai\\FV\\L_FV_DRAGON_SMASHING_GOLEM_QB.lua", []() {return new FvDragonSmashingGolemQb();}},
|
{"scripts\\ai\\FV\\L_FV_DRAGON_SMASHING_GOLEM_QB.lua", []() {return new FvDragonSmashingGolemQb();}},
|
||||||
{"scripts\\02_server\\Enemy\\General\\L_TREASURE_CHEST_DRAGON_SERVER.lua", []() {return new TreasureChestDragonServer();}},
|
{"scripts\\02_server\\Enemy\\General\\L_TREASURE_CHEST_DRAGON_SERVER.lua", []() {return new TreasureChestDragonServer();}},
|
||||||
{"scripts\\ai\\GENERAL\\L_INSTANCE_EXIT_TRANSFER_PLAYER_TO_LAST_NON_INSTANCE.lua", []() {return new InstanceExitTransferPlayerToLastNonInstance();}},
|
{"scripts\\ai\\GENERAL\\L_INSTANCE_EXIT_TRANSFER_PLAYER_TO_LAST_NON_INSTANCE.lua", []() {return new InstanceExitTransferPlayerToLastNonInstance();}},
|
||||||
@@ -635,7 +628,6 @@ namespace {
|
|||||||
{"scripts\\02_server\\Map\\njhub\\L_MON_CORE_SMASHABLE_DOORS.lua", []() {return new MonCoreSmashableDoors();}},
|
{"scripts\\02_server\\Map\\njhub\\L_MON_CORE_SMASHABLE_DOORS.lua", []() {return new MonCoreSmashableDoors();}},
|
||||||
{"scripts\\02_server\\Map\\njhub\\L_MON_CORE_SMASHABLE_DOORS.lua", []() {return new MonCoreSmashableDoors();}},
|
{"scripts\\02_server\\Map\\njhub\\L_MON_CORE_SMASHABLE_DOORS.lua", []() {return new MonCoreSmashableDoors();}},
|
||||||
{"scripts\\02_server\\Map\\njhub\\L_FLAME_JET_SERVER.lua", []() {return new FlameJetServer();}},
|
{"scripts\\02_server\\Map\\njhub\\L_FLAME_JET_SERVER.lua", []() {return new FlameJetServer();}},
|
||||||
{"scripts\\02_server\\Map\\njhub\\L_LIGHTNING_ORB_SERVER.lua", []() {return new LightningOrbServer();}},
|
|
||||||
{"scripts\\02_server\\Map\\njhub\\L_BURNING_TILE.lua", []() {return new BurningTile();}},
|
{"scripts\\02_server\\Map\\njhub\\L_BURNING_TILE.lua", []() {return new BurningTile();}},
|
||||||
{"scripts\\02_server\\Map\\njhub\\L_SPAWN_EARTH_PET_SERVER.lua", []() {return new NjEarthDragonPetServer();}},
|
{"scripts\\02_server\\Map\\njhub\\L_SPAWN_EARTH_PET_SERVER.lua", []() {return new NjEarthDragonPetServer();}},
|
||||||
{"scripts\\02_server\\Map\\njhub\\L_EARTH_PET_SERVER.lua", []() {return new NjEarthPetServer();}},
|
{"scripts\\02_server\\Map\\njhub\\L_EARTH_PET_SERVER.lua", []() {return new NjEarthPetServer();}},
|
||||||
|
|||||||
@@ -18,13 +18,7 @@ set(DSCRIPTS_SOURCES_AI_FV
|
|||||||
"FvMaelstromGeyser.cpp"
|
"FvMaelstromGeyser.cpp"
|
||||||
"TriggerGas.cpp")
|
"TriggerGas.cpp")
|
||||||
|
|
||||||
add_subdirectory(Dragon_Instance)
|
|
||||||
|
|
||||||
foreach(file ${DSCRIPTS_SOURCES_AI_FV_DRAGON_INSTANCE})
|
|
||||||
set(DSCRIPTS_SOURCES_AI_FV ${DSCRIPTS_SOURCES_AI_FV} "Dragon_Instance/${file}")
|
|
||||||
endforeach()
|
|
||||||
|
|
||||||
add_library(dScriptsAiFV OBJECT ${DSCRIPTS_SOURCES_AI_FV})
|
add_library(dScriptsAiFV OBJECT ${DSCRIPTS_SOURCES_AI_FV})
|
||||||
target_include_directories(dScriptsAiFV PUBLIC "." "Dragon_Instance")
|
target_include_directories(dScriptsAiFV PUBLIC ".")
|
||||||
target_precompile_headers(dScriptsAiFV REUSE_FROM dScriptsBase)
|
target_precompile_headers(dScriptsAiFV REUSE_FROM dScriptsBase)
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +0,0 @@
|
|||||||
set(DSCRIPTS_SOURCES_AI_FV_DRAGON_INSTANCE
|
|
||||||
"FvDragonInstanceServer.cpp"
|
|
||||||
PARENT_SCOPE)
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
#include "FvDragonInstanceServer.h"
|
|
||||||
|
|
||||||
#include "Entity.h"
|
|
||||||
#include "DestroyableComponent.h"
|
|
||||||
|
|
||||||
void FvDragonInstanceServer::OnPlayerLoaded(Entity* self, Entity* player) {
|
|
||||||
auto* const destComp = player->GetComponent<DestroyableComponent>();
|
|
||||||
if (destComp) {
|
|
||||||
destComp->SetHealth(destComp->GetMaxHealth());
|
|
||||||
destComp->SetArmor(destComp->GetMaxArmor());
|
|
||||||
destComp->SetImagination(destComp->GetMaxImagination());
|
|
||||||
Game::entityManager->SerializeEntity(player);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
#include "CppScripts.h"
|
|
||||||
|
|
||||||
class FvDragonInstanceServer : public CppScripts::Script {
|
|
||||||
public:
|
|
||||||
void OnPlayerLoaded(Entity* self, Entity* player) override;
|
|
||||||
};
|
|
||||||
Reference in New Issue
Block a user