-
Notifications
You must be signed in to change notification settings - Fork 173
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix include guards Fix dirt clouds not appearing on mission accept
- Loading branch information
Showing
13 changed files
with
115 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#include "NTNaomiDirtServer.h" | ||
|
||
namespace { | ||
std::map<int32_t, std::string> VisibilityMissionTable = { | ||
{1253, std::string("Dirt_Clouds_Sent")}, | ||
{1276, std::string("Dirt_Clouds_Assem")}, | ||
{1277, std::string("Dirt_Clouds_Para")}, | ||
{1283, std::string("Dirt_Clouds_Halls")} | ||
}; | ||
}; | ||
|
||
void NTNaomiDirtServer::OnStartup(Entity* self) { | ||
SetGameVariables(VisibilityMissionTable); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#ifndef __NTNAOMIDIRTSERVER__H__ | ||
#define __NTNAOMIDIRTSERVER__H__ | ||
|
||
#include "VisToggleNotifierServer.h" | ||
|
||
class NTNaomiDirtServer : public VisToggleNotifierServer { | ||
public: | ||
void OnStartup(Entity* self) override; | ||
}; | ||
|
||
#endif //!__NTNAOMIDIRTSERVER__H__ |
23 changes: 23 additions & 0 deletions
23
dScripts/02_server/Map/General/VisToggleNotifierServer.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#include "VisToggleNotifierServer.h" | ||
#include "eMissionState.h" | ||
#include "Game.h" | ||
#include "dZoneManager.h" | ||
|
||
void VisToggleNotifierServer::OnMissionDialogueOK(Entity* self, Entity* target, int missionId, eMissionState missionState) { | ||
auto itr = m_GameVariables.find(missionId); | ||
if (itr != m_GameVariables.end()) { | ||
bool visible = true; | ||
if (missionState == eMissionState::READY_TO_COMPLETE || missionState == eMissionState::COMPLETE_READY_TO_COMPLETE) { | ||
visible = false; | ||
} | ||
|
||
auto spawners = Game::zoneManager->GetSpawnersByName(itr->second); | ||
if (spawners.empty()) return; | ||
for (const auto spawner : spawners) { | ||
auto spawnedObjIds = spawner->GetSpawnedObjectIDs(); | ||
for (const auto& objId : spawnedObjIds) { | ||
GameMessages::SendNotifyClientObject(objId, u"SetVisibility", visible); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#ifndef __VISTOGGLENOTIFIERSERVER__H__ | ||
#define __VISTOGGLENOTIFIERSERVER__H__ | ||
|
||
#include "CppScripts.h" | ||
|
||
class VisToggleNotifierServer : public CppScripts::Script { | ||
public: | ||
void OnMissionDialogueOK(Entity* self, Entity* target, int missionID, eMissionState missionState) override; | ||
protected: | ||
void SetGameVariables(std::map<int32_t, std::string>& gameVariables) { m_GameVariables = gameVariables; } | ||
private: | ||
std::map<int32_t, std::string> m_GameVariables; | ||
}; | ||
|
||
#endif //!__VISTOGGLENOTIFIERSERVER__H__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#include "NTPipeVisibilityServer.h" | ||
#include "Entity.h" | ||
#include "Character.h" | ||
|
||
void NTPipeVisibilityServer::OnRebuildComplete(Entity* self, Entity* target) { | ||
const auto flag = self->GetVar<int32_t>(u"flag"); | ||
if (flag == 0) return; | ||
|
||
auto* character = target->GetCharacter(); | ||
if (!character) return; | ||
|
||
character->SetPlayerFlag(flag, true); | ||
|
||
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"PipeBuilt"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#ifndef __NTPIPEVISIBILITYSERVER__H__ | ||
#define __NTPIPEVISIBILITYSERVER__H__ | ||
|
||
#include "CppScripts.h" | ||
|
||
class NTPipeVisibilityServer : public CppScripts::Script { | ||
public: | ||
void OnRebuildComplete(Entity* self, Entity* target) override; | ||
}; | ||
|
||
#endif //!__NTPIPEVISIBILITYSERVER__H__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters