mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-12-20 03:30:18 +00:00
Public release of the DLU server code!
Have fun!
This commit is contained in:
33
dScripts/NpcCowboyServer.cpp
Normal file
33
dScripts/NpcCowboyServer.cpp
Normal file
@@ -0,0 +1,33 @@
|
||||
#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)
|
||||
{
|
||||
inventoryComponent->AddItem(14378, 1);
|
||||
}
|
||||
}
|
||||
else if (missionState == MissionState::MISSION_STATE_READY_TO_COMPLETE || missionState == MissionState::MISSION_STATE_READY_TO_COMPLETE)
|
||||
{
|
||||
inventoryComponent->RemoveItem(14378, 1);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user