fix: add Nexus Tower missing scripts (#1349)

add final missing scripts for nt

also fix the turnin for the breadcrumb missions not showing the completion window.

Fix another missing script

Add another script

fix include guards

Fix dirt clouds not appearing on mission accept
This commit is contained in:
David Markowitz
2023-12-22 23:53:21 -08:00
committed by GitHub
parent c07c909a57
commit c1e8546d48
38 changed files with 334 additions and 17 deletions

View File

@@ -47,10 +47,6 @@ std::vector<LWOMAPID> EntityManager::m_GhostingExcludedZones = {
// Configure some exceptions for ghosting, nessesary for some special objects.
std::vector<LOT> EntityManager::m_GhostingExcludedLOTs = {
// NT - Pipes
9524,
12408,
// AG - Footrace
4967
};

View File

@@ -621,3 +621,12 @@ bool MissionComponent::HasCollectible(int32_t collectibleID) {
bool MissionComponent::HasMission(uint32_t missionId) {
return GetMission(missionId) != nullptr;
}
void MissionComponent::ResetMission(const int32_t missionId) {
auto* mission = GetMission(missionId);
if (!mission) return;
m_Missions.erase(missionId);
GameMessages::SendResetMissions(m_Parent, m_Parent->GetSystemAddress(), missionId);
}

View File

@@ -170,6 +170,7 @@ public:
*/
bool HasMission(uint32_t missionId);
void ResetMission(const int32_t missionId);
private:
/**
* All the missions owned by this entity, mapped by mission ID

View File

@@ -29,11 +29,11 @@ uint32_t OfferedMission::GetMissionId() const {
return this->missionId;
}
bool OfferedMission::GetOfferMission() const {
bool OfferedMission::GetOffersMission() const {
return this->offersMission;
}
bool OfferedMission::GetAcceptMission() const {
bool OfferedMission::GetAcceptsMission() const {
return this->acceptsMission;
}
@@ -203,7 +203,10 @@ void MissionOfferComponent::OfferMissions(Entity* entity, const uint32_t specifi
const auto selected = canAcceptPool[GeneralUtils::GenerateRandomNumber<int>(0, canAcceptPool.size() - 1)];
GameMessages::SendOfferMission(entity->GetObjectID(), entity->GetSystemAddress(), selected, m_Parent->GetObjectID());
} else if (std::find(offered.begin(), offered.end(), missionId) == offered.end() && offeredMission->GetOfferMission()) {
} else if (
std::find(offered.begin(), offered.end(), missionId) == offered.end()
&&
(offeredMission->GetOffersMission() || offeredMission->GetAcceptsMission())) {
GameMessages::SendOfferMission(entity->GetObjectID(), entity->GetSystemAddress(), missionId, m_Parent->GetObjectID());
}
}

View File

@@ -30,13 +30,13 @@ struct OfferedMission {
* Returns if this mission is offered by the entity
* @return true if this mission is offered by the entity, false otherwise
*/
bool GetOfferMission() const;
bool GetOffersMission() const;
/**
* Returns if this mission may be accepted by the entity (currently unused)
* @return true if this mission may be accepted by the entity, false otherwise
*/
bool GetAcceptMission() const;
bool GetAcceptsMission() const;
private:

View File

@@ -345,6 +345,19 @@ void GameMessages::SendStartPathing(Entity* entity) {
SEND_PACKET_BROADCAST;
}
void GameMessages::SendResetMissions(Entity* entity, const SystemAddress& sysAddr, const int32_t missionid) {
CBITSTREAM;
CMSGHEADER;
bitStream.Write(entity->GetObjectID());
bitStream.Write(eGameMessageType::RESET_MISSIONS);
bitStream.Write(missionid != -1);
if (missionid != -1) bitStream.Write(missionid);
SEND_PACKET;
}
void GameMessages::SendPlatformResync(Entity* entity, const SystemAddress& sysAddr, bool bStopAtDesiredWaypoint,
int iIndex, int iDesiredWaypointIndex, int nextIndex,
eMovementPlatformState movementState) {

View File

@@ -74,6 +74,7 @@ namespace GameMessages {
int iIndex = 0, int iDesiredWaypointIndex = 1, int nextIndex = 1,
eMovementPlatformState movementState = eMovementPlatformState::Moving);
void SendResetMissions(Entity* entity, const SystemAddress& sysAddr, const int32_t missionid = -1);
void SendRestoreToPostLoadStats(Entity* entity, const SystemAddress& sysAddr);
void SendServerDoneLoadingAllObjects(Entity* entity, const SystemAddress& sysAddr);
void SendGMLevelBroadcast(const LWOOBJID& objectID, eGameMasterLevel level);

View File

@@ -349,6 +349,17 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
});
}
if (chatCommand == "resetmission") {
uint32_t missionId;
if (!GeneralUtils::TryParse(args[0], missionId)) {
ChatPackets::SendSystemMessage(sysAddr, u"Invalid mission ID.");
return;
}
auto* missionComponent = entity->GetComponent<MissionComponent>();
if (!missionComponent) return;
missionComponent->ResetMission(missionId);
}
if (user->GetMaxGMLevel() == eGameMasterLevel::CIVILIAN || entity->GetGMLevel() >= eGameMasterLevel::CIVILIAN) {
if (chatCommand == "die") {
entity->Smash(entity->GetObjectID());