DarkflameServer/dScripts/ai/GF/GfJailkeepMission.cpp

40 lines
1.4 KiB
C++
Raw Normal View History

2022-08-06 03:01:59 +00:00
#include "GfJailkeepMission.h"
#include "MissionComponent.h"
#include "Character.h"
#include "eMissionState.h"
void GfJailkeepMission::OnMissionDialogueOK(Entity* self, Entity* target, int missionID, eMissionState missionState) {
auto* missionComponent = target->GetComponent<MissionComponent>();
2022-07-28 13:39:57 +00:00
if (missionComponent == nullptr)
return;
if (missionID == 385 && missionState == eMissionState::AVAILABLE) {
2022-07-28 13:39:57 +00:00
missionComponent->AcceptMission(386, true);
missionComponent->AcceptMission(387, true);
missionComponent->AcceptMission(388, true);
missionComponent->AcceptMission(390, true);
} else if (missionID == 385 && missionState == eMissionState::COMPLETE_READY_TO_COMPLETE) {
2022-07-28 13:39:57 +00:00
auto* character = target->GetCharacter();
if (character != nullptr && character->GetPlayerFlag(68)) {
missionComponent->AcceptMission(701);
missionComponent->AcceptMission(702);
missionComponent->AcceptMission(703);
missionComponent->AcceptMission(704);
}
}
}
2022-07-28 13:39:57 +00:00
void GfJailkeepMission::OnUse(Entity* self, Entity* user) {
auto* missionComponent = user->GetComponent<MissionComponent>();
2022-07-28 13:39:57 +00:00
if (missionComponent == nullptr)
return;
if (missionComponent->GetMissionState(385) == eMissionState::ACTIVE) {
2022-07-28 13:39:57 +00:00
missionComponent->AcceptMission(386, true);
missionComponent->AcceptMission(387, true);
missionComponent->AcceptMission(388, true);
missionComponent->AcceptMission(390, true);
}
}