2021-12-05 17:54:36 +00:00
|
|
|
#include "NpcCowboyServer.h"
|
|
|
|
#include "MissionComponent.h"
|
|
|
|
#include "InventoryComponent.h"
|
|
|
|
|
|
|
|
void NpcCowboyServer::OnMissionDialogueOK(Entity* self, Entity* target, int missionID, MissionState missionState)
|
|
|
|
{
|
|
|
|
if (missionID != 1880)
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
auto* inventoryComponent = target->GetComponent<InventoryComponent>();
|
|
|
|
|
|
|
|
if (inventoryComponent == nullptr)
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (missionState == MissionState::MISSION_STATE_COMPLETE_ACTIVE||
|
|
|
|
missionState == MissionState::MISSION_STATE_ACTIVE ||
|
|
|
|
missionState == MissionState::MISSION_STATE_AVAILABLE ||
|
|
|
|
missionState == MissionState::MISSION_STATE_COMPLETE_AVAILABLE)
|
|
|
|
{
|
|
|
|
if (inventoryComponent->GetLotCount(14378) == 0)
|
|
|
|
{
|
2022-04-25 01:40:20 +00:00
|
|
|
inventoryComponent->AddItem(14378, 1, eLootSourceType::LOOT_SOURCE_NONE);
|
2021-12-05 17:54:36 +00:00
|
|
|
}
|
|
|
|
}
|
2022-02-07 20:45:56 +00:00
|
|
|
else if (missionState == MissionState::MISSION_STATE_READY_TO_COMPLETE || missionState == MissionState::MISSION_STATE_COMPLETE_READY_TO_COMPLETE)
|
2021-12-05 17:54:36 +00:00
|
|
|
{
|
|
|
|
inventoryComponent->RemoveItem(14378, 1);
|
|
|
|
}
|
|
|
|
}
|