#pragma once

#include "CoreMinimal.h"
#include "Engine/DataTable.h"
#include "QuestRow.generated.h"

UENUM(BlueprintType)
enum class EQuestKind : uint8
{
	Main        UMETA(DisplayName = "Main"),
	Side        UMETA(DisplayName = "Side"),
	Daily       UMETA(DisplayName = "Daily"),
	Repeatable  UMETA(DisplayName = "Repeatable"),
	Event       UMETA(DisplayName = "Event")
};

UENUM(BlueprintType)
enum class EQuestObjectiveType : uint8
{
	Kill        UMETA(DisplayName = "Kill"),
	Collect     UMETA(DisplayName = "Collect"),
	Talk        UMETA(DisplayName = "Talk"),
	Reach       UMETA(DisplayName = "Reach Location"),
	Use         UMETA(DisplayName = "Use Item"),
	Escort      UMETA(DisplayName = "Escort")
};

USTRUCT(BlueprintType)
struct ZMMO_API FQuestObjective
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Objective")
	EQuestObjectiveType Type = EQuestObjectiveType::Kill;

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Objective")
	FName TargetId;

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Objective")
	int32 Required = 1;

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Objective")
	FText Description;
};

USTRUCT(BlueprintType)
struct ZMMO_API FQuestRow : public FTableRowBase
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Quest")
	FText DisplayName;

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Quest", meta = (MultiLine = true))
	FText Description;

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Quest")
	EQuestKind Kind = EQuestKind::Side;

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Quest")
	int32 LevelRequirement = 1;

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Quest")
	FName GiverNPC;

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Quest")
	FName TurnInNPC;

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Quest")
	TArray<FQuestObjective> Objectives;

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Quest")
	FName RewardRow;

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Quest")
	TArray<FName> Prerequisites;
};
