mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-10-12 10:28:05 +00:00
Merge remote-tracking branch 'upstream/main' into PetFixes
This commit is contained in:
@@ -85,7 +85,7 @@ void BossSpiderQueenEnemyServer::WithdrawSpider(Entity* self, const bool withdra
|
||||
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"SetColGroup", 10, 0, 0, "", UNASSIGNED_SYSTEM_ADDRESS);
|
||||
|
||||
//First rotate for anim
|
||||
NiQuaternion rot = NiQuaternion::IDENTITY;
|
||||
NiQuaternion rot = NiQuaternionConstant::IDENTITY;
|
||||
|
||||
controllable->SetStatic(false);
|
||||
|
||||
@@ -179,7 +179,7 @@ void BossSpiderQueenEnemyServer::SpiderWaveManager(Entity* self) {
|
||||
|
||||
std::vector<LWOOBJID> spiderEggs{};
|
||||
|
||||
auto spooders = Game::entityManager->GetEntitiesInGroup("EGG");
|
||||
auto spooders = Game::entityManager->GetEntitiesInGroup("SpiderEggs");
|
||||
for (auto spodder : spooders) {
|
||||
spiderEggs.push_back(spodder->GetObjectID());
|
||||
}
|
||||
@@ -402,7 +402,7 @@ void BossSpiderQueenEnemyServer::OnTimerDone(Entity* self, const std::string tim
|
||||
const auto withdrawn = self->GetBoolean(u"isWithdrawn");
|
||||
if (!withdrawn) return;
|
||||
|
||||
NiQuaternion rot = NiQuaternion::IDENTITY;
|
||||
NiQuaternion rot = NiQuaternionConstant::IDENTITY;
|
||||
|
||||
//First rotate for anim
|
||||
controllable->SetStatic(false);
|
||||
@@ -597,12 +597,12 @@ void BossSpiderQueenEnemyServer::OnUpdate(Entity* self) {
|
||||
|
||||
if (!isWithdrawn) return;
|
||||
|
||||
if (controllable->GetRotation() == NiQuaternion::IDENTITY) {
|
||||
if (controllable->GetRotation() == NiQuaternionConstant::IDENTITY) {
|
||||
return;
|
||||
}
|
||||
|
||||
controllable->SetStatic(false);
|
||||
controllable->SetRotation(NiQuaternion::IDENTITY);
|
||||
controllable->SetRotation(NiQuaternionConstant::IDENTITY);
|
||||
controllable->SetStatic(true);
|
||||
|
||||
Game::entityManager->SerializeEntity(self);
|
||||
|
@@ -7,6 +7,7 @@
|
||||
#include "GeneralUtils.h"
|
||||
#include "DestroyableComponent.h"
|
||||
#include "eReplicaComponentType.h"
|
||||
#include "dNavMesh.h"
|
||||
|
||||
void BaseEnemyMech::OnStartup(Entity* self) {
|
||||
auto* destroyableComponent = self->GetComponent<DestroyableComponent>();
|
||||
@@ -19,7 +20,7 @@ void BaseEnemyMech::OnDie(Entity* self, Entity* killer) {
|
||||
ControllablePhysicsComponent* controlPhys = static_cast<ControllablePhysicsComponent*>(self->GetComponent(eReplicaComponentType::CONTROLLABLE_PHYSICS));
|
||||
if (!controlPhys) return;
|
||||
|
||||
NiPoint3 newLoc = { controlPhys->GetPosition().x, dpWorld::Instance().GetNavMesh()->GetHeightAtPoint(controlPhys->GetPosition()), controlPhys->GetPosition().z };
|
||||
NiPoint3 newLoc = { controlPhys->GetPosition().x, dpWorld::GetNavMesh()->GetHeightAtPoint(controlPhys->GetPosition()), controlPhys->GetPosition().z };
|
||||
|
||||
EntityInfo info = EntityInfo();
|
||||
std::vector<LDFBaseData*> cfg;
|
||||
|
@@ -13,7 +13,7 @@ void AgLaserSensorServer::OnStartup(Entity* self) {
|
||||
phantomPhysicsComponent->SetPhysicsEffectActive(true);
|
||||
phantomPhysicsComponent->SetEffectType(ePhysicsEffectType::REPULSE);
|
||||
phantomPhysicsComponent->SetDirectionalMultiplier(repelForce);
|
||||
phantomPhysicsComponent->SetDirection(NiPoint3::UNIT_Y);
|
||||
phantomPhysicsComponent->SetDirection(NiPoint3Constant::UNIT_Y);
|
||||
}
|
||||
|
||||
|
||||
|
@@ -1,6 +1,7 @@
|
||||
#include "NpcCowboyServer.h"
|
||||
#include "eMissionState.h"
|
||||
#include "InventoryComponent.h"
|
||||
#include "dZoneManager.h"
|
||||
|
||||
void NpcCowboyServer::OnMissionDialogueOK(Entity* self, Entity* target, int missionID, eMissionState missionState) {
|
||||
if (missionID != 1880) {
|
||||
@@ -23,4 +24,17 @@ void NpcCowboyServer::OnMissionDialogueOK(Entity* self, Entity* target, int miss
|
||||
} else if (missionState == eMissionState::READY_TO_COMPLETE || missionState == eMissionState::COMPLETE_READY_TO_COMPLETE) {
|
||||
inventoryComponent->RemoveItem(14378, 1);
|
||||
}
|
||||
|
||||
// Next up hide or show the samples based on the mission state
|
||||
int32_t visible = 1;
|
||||
if (missionState == eMissionState::READY_TO_COMPLETE || missionState == eMissionState::COMPLETE_READY_TO_COMPLETE) {
|
||||
visible = 0;
|
||||
}
|
||||
|
||||
auto spawners = Game::zoneManager->GetSpawnersByName("PlungerGunTargets");
|
||||
for (auto* spawner : spawners) {
|
||||
for (const auto entity : spawner->GetSpawnedObjectIDs())
|
||||
GameMessages::SendNotifyClientObject(entity, u"SetVisibility", visible, 0,
|
||||
target->GetObjectID(), "", target->GetSystemAddress());
|
||||
}
|
||||
}
|
||||
|
@@ -1,9 +1,10 @@
|
||||
#include "NpcWispServer.h"
|
||||
#include "InventoryComponent.h"
|
||||
#include "EntityManager.h"
|
||||
#include "dZoneManager.h"
|
||||
#include "Entity.h"
|
||||
#include "GameMessages.h"
|
||||
#include "eMissionState.h"
|
||||
#include "Spawner.h"
|
||||
|
||||
void NpcWispServer::OnMissionDialogueOK(Entity* self, Entity* target, int missionID, eMissionState missionState) {
|
||||
if (missionID != 1849 && missionID != 1883)
|
||||
@@ -25,7 +26,7 @@ void NpcWispServer::OnMissionDialogueOK(Entity* self, Entity* target, int missio
|
||||
}
|
||||
|
||||
// Next up hide or show the samples based on the mission state
|
||||
auto visible = 1;
|
||||
int32_t visible = 1;
|
||||
if (missionState == eMissionState::READY_TO_COMPLETE || missionState == eMissionState::COMPLETE_READY_TO_COMPLETE) {
|
||||
visible = 0;
|
||||
}
|
||||
@@ -35,9 +36,10 @@ void NpcWispServer::OnMissionDialogueOK(Entity* self, Entity* target, int missio
|
||||
: std::vector<std::string>{ "MaelstromSamples", "MaelstromSamples2ndary1", "MaelstromSamples2ndary2" };
|
||||
|
||||
for (const auto& group : groups) {
|
||||
auto samples = Game::entityManager->GetEntitiesInGroup(group);
|
||||
for (auto* sample : samples) {
|
||||
GameMessages::SendNotifyClientObject(sample->GetObjectID(), u"SetVisibility", visible, 0,
|
||||
auto spawners = Game::zoneManager->GetSpawnersByName(group);
|
||||
for (const auto* spawner : spawners) {
|
||||
for (const auto objId : spawner->GetSpawnedObjectIDs())
|
||||
GameMessages::SendNotifyClientObject(objId, u"SetVisibility", visible, 0,
|
||||
target->GetObjectID(), "", target->GetSystemAddress());
|
||||
}
|
||||
}
|
||||
|
@@ -66,7 +66,7 @@ void AmDrawBridge::OnTimerDone(Entity* self, std::string timerName) {
|
||||
return;
|
||||
}
|
||||
|
||||
simplePhysicsComponent->SetAngularVelocity(NiPoint3::ZERO);
|
||||
simplePhysicsComponent->SetAngularVelocity(NiPoint3Constant::ZERO);
|
||||
|
||||
Game::entityManager->SerializeEntity(bridge);
|
||||
}
|
||||
|
@@ -12,16 +12,12 @@ void AmDropshipComputer::OnStartup(Entity* self) {
|
||||
void AmDropshipComputer::OnUse(Entity* self, Entity* user) {
|
||||
auto* quickBuildComponent = self->GetComponent<QuickBuildComponent>();
|
||||
|
||||
if (quickBuildComponent == nullptr || quickBuildComponent->GetState() != eQuickBuildState::COMPLETED) {
|
||||
return;
|
||||
}
|
||||
if (!quickBuildComponent || quickBuildComponent->GetState() != eQuickBuildState::COMPLETED) return;
|
||||
|
||||
auto* missionComponent = user->GetComponent<MissionComponent>();
|
||||
auto* inventoryComponent = user->GetComponent<InventoryComponent>();
|
||||
|
||||
if (missionComponent == nullptr || inventoryComponent == nullptr) {
|
||||
return;
|
||||
}
|
||||
if (!missionComponent || !inventoryComponent) return;
|
||||
|
||||
if (inventoryComponent->GetLotCount(m_NexusTalonDataCard) != 0 || missionComponent->GetMission(979)->GetMissionState() == eMissionState::COMPLETE) {
|
||||
return;
|
||||
@@ -33,14 +29,12 @@ void AmDropshipComputer::OnUse(Entity* self, Entity* user) {
|
||||
void AmDropshipComputer::OnDie(Entity* self, Entity* killer) {
|
||||
const auto myGroup = GeneralUtils::UTF16ToWTF8(self->GetVar<std::u16string>(u"spawner_name"));
|
||||
|
||||
int32_t pipeNum = 0;
|
||||
if (!GeneralUtils::TryParse<int32_t>(myGroup.substr(10, 1), pipeNum)) {
|
||||
return;
|
||||
}
|
||||
const auto pipeNum = GeneralUtils::TryParse<int32_t>(myGroup.substr(10, 1));
|
||||
if (!pipeNum) return;
|
||||
|
||||
const auto pipeGroup = myGroup.substr(0, 10);
|
||||
|
||||
const auto nextPipeNum = pipeNum + 1;
|
||||
const auto nextPipeNum = pipeNum.value() + 1;
|
||||
|
||||
const auto samePipeSpawners = Game::zoneManager->GetSpawnersByName(myGroup);
|
||||
|
||||
@@ -70,11 +64,9 @@ void AmDropshipComputer::OnDie(Entity* self, Entity* killer) {
|
||||
}
|
||||
|
||||
void AmDropshipComputer::OnTimerDone(Entity* self, std::string timerName) {
|
||||
auto* quickBuildComponent = self->GetComponent<QuickBuildComponent>();
|
||||
const auto* const quickBuildComponent = self->GetComponent<QuickBuildComponent>();
|
||||
|
||||
if (quickBuildComponent == nullptr) {
|
||||
return;
|
||||
}
|
||||
if (!quickBuildComponent) return;
|
||||
|
||||
if (timerName == "reset" && quickBuildComponent->GetState() == eQuickBuildState::OPEN) {
|
||||
self->Smash(self->GetObjectID(), eKillType::SILENT);
|
||||
|
@@ -144,13 +144,10 @@ void AmSkullkinTower::OnChildRemoved(Entity* self, Entity* child) {
|
||||
);
|
||||
|
||||
for (const auto& mission : missions) {
|
||||
int32_t missionID = 0;
|
||||
const auto missionID = GeneralUtils::TryParse<int32_t>(mission);
|
||||
if (!missionID) continue;
|
||||
|
||||
if (!GeneralUtils::TryParse(mission, missionID)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
missionIDs.push_back(missionID);
|
||||
missionIDs.push_back(missionID.value());
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -12,12 +12,9 @@ void AmTemplateSkillVolume::OnSkillEventFired(Entity* self, Entity* caster, cons
|
||||
const auto missionIDs = GeneralUtils::SplitString(missionIDsVariable, '_');
|
||||
|
||||
for (const auto& missionIDStr : missionIDs) {
|
||||
int32_t missionID = 0;
|
||||
const auto missionID = GeneralUtils::TryParse<uint32_t>(missionIDStr);
|
||||
if (!missionID) continue;
|
||||
|
||||
if (!GeneralUtils::TryParse(missionIDStr, missionID)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
missionComponent->ForceProgressTaskType(missionID, 1, 1, false);
|
||||
missionComponent->ForceProgressTaskType(missionID.value(), 1, 1, false);
|
||||
}
|
||||
}
|
||||
|
@@ -81,7 +81,7 @@ void MastTeleport::OnTimerDone(Entity* self, std::string timerName) {
|
||||
|
||||
GameMessages::SendOrientToAngle(playerId, true, rads, player->GetSystemAddress());
|
||||
|
||||
GameMessages::SendTeleport(playerId, position, NiQuaternion::IDENTITY, player->GetSystemAddress());
|
||||
GameMessages::SendTeleport(playerId, position, NiQuaternionConstant::IDENTITY, player->GetSystemAddress());
|
||||
|
||||
GameMessages::SendSetStunned(playerId, eStateChangeType::POP, player->GetSystemAddress(),
|
||||
LWOOBJID_EMPTY, true, true, true, true, true, true, true
|
||||
|
@@ -119,7 +119,7 @@ void PetDigServer::HandleXBuildDig(const Entity* self, Entity* owner, Entity* pe
|
||||
return;
|
||||
|
||||
auto* playerEntity = Game::entityManager->GetEntity(playerID);
|
||||
if (!playerEntity || !playerEntity->GetParentUser() || !playerEntity->GetParentUser()->GetLastUsedChar())
|
||||
if (!playerEntity || !playerEntity->GetCharacter())
|
||||
return;
|
||||
|
||||
auto* player = playerEntity->GetCharacter();
|
||||
|
@@ -17,12 +17,12 @@ void QbEnemyStunner::OnQuickBuildComplete(Entity* self, Entity* target) {
|
||||
if (!skillComponent) return;
|
||||
|
||||
// Get the skill IDs of this object.
|
||||
CDObjectSkillsTable* skillsTable = CDClientManager::Instance().GetTable<CDObjectSkillsTable>();
|
||||
CDObjectSkillsTable* skillsTable = CDClientManager::GetTable<CDObjectSkillsTable>();
|
||||
auto skills = skillsTable->Query([=](CDObjectSkills entry) {return (entry.objectTemplate == self->GetLOT()); });
|
||||
std::map<uint32_t, uint32_t> skillBehaviorMap;
|
||||
// For each skill, cast it with the associated behavior ID.
|
||||
for (auto skill : skills) {
|
||||
CDSkillBehaviorTable* skillBehaviorTable = CDClientManager::Instance().GetTable<CDSkillBehaviorTable>();
|
||||
CDSkillBehaviorTable* skillBehaviorTable = CDClientManager::GetTable<CDSkillBehaviorTable>();
|
||||
CDSkillBehavior behaviorData = skillBehaviorTable->GetSkillByID(skill.skillID);
|
||||
|
||||
skillBehaviorMap.insert(std::make_pair(skill.skillID, behaviorData.behaviorID));
|
||||
|
@@ -40,6 +40,6 @@ void PetFromDigServer::OnNotifyPetTamingMinigame(Entity* self, Entity* tamer, eP
|
||||
return;
|
||||
// TODO: Remove custom group?
|
||||
// Command the pet to the player as it may otherwise go to its spawn point which is non existant
|
||||
// petComponent->Command(NiPoint3::ZERO, LWOOBJID_EMPTY, 6, 202, true);
|
||||
// petComponent->Command(NiPoint3Constant::ZERO, LWOOBJID_EMPTY, 6, 202, true);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user