mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-11-16 05:08:21 +00:00
6aa90ad5b2
* Breakout rest of the enums from dcommonvars so we don't have to deal with merge conflicts ePlayerFlags is not a scoped enum, yet, due to it's complexity * address feedback * make player flag types consistent * fix typo
27 lines
866 B
C++
27 lines
866 B
C++
#include "NpcCowboyServer.h"
|
|
#include "eMissionState.h"
|
|
#include "InventoryComponent.h"
|
|
|
|
void NpcCowboyServer::OnMissionDialogueOK(Entity* self, Entity* target, int missionID, eMissionState missionState) {
|
|
if (missionID != 1880) {
|
|
return;
|
|
}
|
|
|
|
auto* inventoryComponent = target->GetComponent<InventoryComponent>();
|
|
|
|
if (inventoryComponent == nullptr) {
|
|
return;
|
|
}
|
|
|
|
if (missionState == eMissionState::COMPLETE_ACTIVE ||
|
|
missionState == eMissionState::ACTIVE ||
|
|
missionState == eMissionState::AVAILABLE ||
|
|
missionState == eMissionState::COMPLETE_AVAILABLE) {
|
|
if (inventoryComponent->GetLotCount(14378) == 0) {
|
|
inventoryComponent->AddItem(14378, 1, eLootSourceType::NONE);
|
|
}
|
|
} else if (missionState == eMissionState::READY_TO_COMPLETE || missionState == eMissionState::COMPLETE_READY_TO_COMPLETE) {
|
|
inventoryComponent->RemoveItem(14378, 1);
|
|
}
|
|
}
|