2021-12-05 17:54:36 +00:00
|
|
|
#include "NsGetFactionMissionServer.h"
|
|
|
|
#include "GameMessages.h"
|
|
|
|
#include "MissionComponent.h"
|
|
|
|
#include "Character.h"
|
2023-03-04 07:16:37 +00:00
|
|
|
#include "eReplicaComponentType.h"
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2022-07-28 13:39:57 +00:00
|
|
|
void NsGetFactionMissionServer::OnRespondToMission(Entity* self, int missionID, Entity* player, int reward) {
|
2021-12-05 17:54:36 +00:00
|
|
|
if (missionID != 474) return;
|
|
|
|
|
|
|
|
if (reward != LOT_NULL) {
|
|
|
|
std::vector<int> factionMissions;
|
|
|
|
int celebrationID = -1;
|
|
|
|
int flagID = -1;
|
|
|
|
|
|
|
|
if (reward == 6980) {
|
|
|
|
// Venture League
|
|
|
|
factionMissions = { 555, 556 };
|
|
|
|
celebrationID = 14;
|
|
|
|
flagID = 46;
|
2022-07-28 13:39:57 +00:00
|
|
|
} else if (reward == 6979) {
|
2021-12-05 17:54:36 +00:00
|
|
|
// Assembly
|
|
|
|
factionMissions = { 544, 545 };
|
|
|
|
celebrationID = 15;
|
|
|
|
flagID = 47;
|
2022-07-28 13:39:57 +00:00
|
|
|
} else if (reward == 6981) {
|
2021-12-05 17:54:36 +00:00
|
|
|
// Paradox
|
|
|
|
factionMissions = { 577, 578 };
|
|
|
|
celebrationID = 16;
|
|
|
|
flagID = 48;
|
2022-07-28 13:39:57 +00:00
|
|
|
} else if (reward == 6978) {
|
2021-12-05 17:54:36 +00:00
|
|
|
// Sentinel
|
|
|
|
factionMissions = { 566, 567 };
|
|
|
|
celebrationID = 17;
|
|
|
|
flagID = 49;
|
|
|
|
}
|
|
|
|
|
|
|
|
factionMissions.push_back(778);
|
|
|
|
|
|
|
|
if (celebrationID != -1) {
|
|
|
|
GameMessages::SendStartCelebrationEffect(player, player->GetSystemAddress(), celebrationID);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (flagID != -1) {
|
2022-01-18 03:43:37 +00:00
|
|
|
player->GetCharacter()->SetPlayerFlag(ePlayerFlags::JOINED_A_FACTION, true);
|
2021-12-05 17:54:36 +00:00
|
|
|
player->GetCharacter()->SetPlayerFlag(flagID, true);
|
|
|
|
}
|
|
|
|
|
2023-03-04 07:16:37 +00:00
|
|
|
MissionComponent* mis = static_cast<MissionComponent*>(player->GetComponent(eReplicaComponentType::MISSION));
|
2021-12-05 17:54:36 +00:00
|
|
|
|
|
|
|
for (int mission : factionMissions) {
|
|
|
|
mis->AcceptMission(mission);
|
|
|
|
mis->CompleteMission(mission);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|