2021-12-05 17:54:36 +00:00
|
|
|
#include "NjColeNPC.h"
|
|
|
|
#include "MissionComponent.h"
|
|
|
|
#include "InventoryComponent.h"
|
|
|
|
#include "eMissionState.h"
|
|
|
|
|
|
|
|
void NjColeNPC::OnEmoteReceived(Entity* self, int32_t emote, Entity* target) {
|
|
|
|
if (emote != 393) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
auto* inventoryComponent = target->GetComponent<InventoryComponent>();
|
|
|
|
|
|
|
|
if (inventoryComponent == nullptr) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!inventoryComponent->IsEquipped(14499) && !inventoryComponent->IsEquipped(16644)) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
auto* missionComponent = target->GetComponent<MissionComponent>();
|
|
|
|
|
|
|
|
if (missionComponent == nullptr) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
missionComponent->ForceProgressTaskType(1818, 1, 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
void NjColeNPC::OnMissionDialogueOK(Entity* self, Entity* target, int missionID, eMissionState missionState) {
|
|
|
|
NjNPCMissionSpinjitzuServer::OnMissionDialogueOK(self, target, missionID, missionState);
|
2022-07-28 13:39:57 +00:00
|
|
|
|
2021-12-05 17:54:36 +00:00
|
|
|
if (missionID == 1818 && missionState >= eMissionState::READY_TO_COMPLETE) {
|
|
|
|
auto* missionComponent = target->GetComponent<MissionComponent>();
|
|
|
|
auto* inventoryComponent = target->GetComponent<InventoryComponent>();
|
2022-07-28 13:39:57 +00:00
|
|
|
|
2021-12-05 17:54:36 +00:00
|
|
|
if (missionComponent == nullptr || inventoryComponent == nullptr) {
|
|
|
|
return;
|
|
|
|
}
|
2022-07-28 13:39:57 +00:00
|
|
|
|
2021-12-05 17:54:36 +00:00
|
|
|
if (inventoryComponent->GetLotCount(14499) > 0) {
|
|
|
|
inventoryComponent->RemoveItem(14499, 1);
|
|
|
|
} else {
|
|
|
|
return;
|
|
|
|
}
|
2022-07-28 13:39:57 +00:00
|
|
|
|
2022-04-25 01:40:20 +00:00
|
|
|
inventoryComponent->AddItem(16644, 1, eLootSourceType::LOOT_SOURCE_NONE);
|
2021-12-05 17:54:36 +00:00
|
|
|
}
|
|
|
|
}
|