// Copyright (c) rAthena Dev Teams - Licensed under GNU GPL
// For more information, see LICENCE in the main folder

#ifndef NPC_HPP
#define NPC_HPP

#include "../common/timer.hpp"

#include "map.hpp" // struct block_list
#include "status.hpp" // struct status_change
#include "unit.hpp" // struct unit_data

struct block_list;
struct npc_data;
struct view_data;

struct npc_timerevent_list {
	int timer,pos;
};

struct npc_label_list {
	char name[NAME_LENGTH+1];
	int pos;
};

/// Item list for NPC sell/buy list
struct npc_item_list {
	t_itemid nameid;
	unsigned int value;
#if PACKETVER >= 20131223
	unsigned short qty; ///< Stock counter (Market shop)
	uint8 flag; ///< 1: Item added by npcshopitem/npcshopadditem, force load! (Market shop)
#endif
};

#if !defined(sun) && (!defined(__NETBSD__) || __NetBSD_Version__ >= 600000000) // NetBSD 5 and Solaris don't like pragma pack but accept the packed attribute
#pragma pack(push, 1)
#endif // not NetBSD < 6 / Solaris

/// List of bought/sold item for NPC shops
struct s_npc_buy_list {
	unsigned short qty;		///< Amount of item will be bought
#if PACKETVER_MAIN_NUM >= 20181121 || PACKETVER_RE_NUM >= 20180704 || PACKETVER_ZERO_NUM >= 20181114
	uint32 nameid;	///< ID of item will be bought
#else
	uint16 nameid;	///< ID of item will be bought
#endif
} __attribute__((packed));

#if !defined(sun) && (!defined(__NETBSD__) || __NetBSD_Version__ >= 600000000) // NetBSD 5 and Solaris don't like pragma pack but accept the packed attribute
#pragma pack(pop)
#endif // not NetBSD < 6 / Solaris

struct s_stylist_costs{
	uint32 price;
	t_itemid requiredItem;
	t_itemid requiredItemBox;
};

struct s_stylist_entry{
	uint16 look;
	int16 index;
	uint32 value;
	std::shared_ptr<s_stylist_costs> human;
	std::shared_ptr<s_stylist_costs> doram;
};

struct s_stylist_list{
	uint16 look;
	std::unordered_map<int16, std::shared_ptr<s_stylist_entry>> entries;
};

class StylistDatabase : public TypesafeYamlDatabase<uint32, s_stylist_list>{
private:
	bool parseCostNode( std::shared_ptr<s_stylist_entry> entry, bool doram, const YAML::Node& node );

public:
	StylistDatabase() : TypesafeYamlDatabase( "STYLIST_DB", 1 ){

	}

	const std::string getDefaultLocation() override;
	uint64 parseBodyNode( const YAML::Node& node ) override;
};

extern StylistDatabase stylist_db;

struct s_questinfo {
	e_questinfo_types icon;
	e_questinfo_markcolor color;
	struct script_code* condition;

	~s_questinfo(){
		if( this->condition != nullptr ){
			script_free_code( this->condition );
		}
	}
};

struct npc_data {
	struct block_list bl;
	struct unit_data ud; //Because they need to be able to move....
	struct view_data vd;
	struct status_change sc; //They can't have status changes, but.. they want the visual opt values.
	struct npc_data *master_nd;
	short class_,speed;
	char name[NPC_NAME_LENGTH+1];// display name
	char exname[NPC_NAME_LENGTH+1];// unique npc name
	int chat_id,touching_id;
	unsigned int next_walktime;
	int instance_id;

	unsigned size : 2;

	struct status_data status;
	unsigned int level,stat_point;
	struct s_npc_params {
		unsigned short str, agi, vit, int_, dex, luk;
	} params;

	void* chatdb; // pointer to a npc_parse struct (see npc_chat.cpp)
	char* path;/* path dir */
	enum npc_subtype subtype;
	bool trigger_on_hidden;
	int src_id;
	union {
		struct {
			struct script_code *script;
			short xs,ys; // OnTouch area radius
			int guild_id;
			t_tick timer;
			int timerid,timeramount,rid;
			t_tick timertick;
			struct npc_timerevent_list *timer_event;
			int label_list_num;
			struct npc_label_list *label_list;
		} scr;
		struct {
			struct npc_item_list *shop_item;
			uint16 count;
			t_itemid itemshop_nameid; // Item Shop cost item ID
			char pointshop_str[32]; // Point Shop cost variable name
			bool discount;
		} shop;
		struct {
			short xs,ys; // OnTouch area radius
			short x,y; // destination coords
			unsigned short mapindex; // destination map
		} warp;
		struct {
			struct mob_data *md;
			time_t kill_time;
			char killer_name[NAME_LENGTH];
			int spawn_timer;
		} tomb;
	} u;

	struct sc_display_entry **sc_display;
	unsigned char sc_display_count;

	std::vector<std::shared_ptr<s_questinfo>> qi_data;

	struct {
		t_tick timeout;
		unsigned long color;
	} progressbar;
};

struct eri;
extern struct eri *npc_sc_display_ers;

#define START_NPC_NUM 110000000

enum e_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ES,
	JT_4_M_MD_HARWORD,
	JT_4_F_MD_MAGALETA,
	JT_4_F_MD_SHECIL,
	JT_4_F_MD_KATRINN,
	JT_4_M_MD_SEYREN_H,
	JT_4_M_MD_EREMES_H,
	JT_4_M_MD_HARWORD_H,
	JT_4_F_MD_MAGALETA_H,
	JT_4_F_MD_SHECIL_H,
	JT_4_F_MD_KATRINN_H,
	JT_4_M_MD_SEYREN_D,
	JT_4_M_MD_EREMES_D,
	JT_4_M_MD_HARWORD_D,
	JT_4_F_MD_MAGALETA_D,
	JT_4_F_MD_SHECIL_D,
	JT_4_F_MD_KATRINN_D,
	JT_4_F_MD_YGNIZEM,
	JT_4_F_ERENE,
	JT_4_M_EINCPTMINER,
	JT_4_F_EINRESERCHER,
	JT_4_F_REINDEER,
	JT_4_PIGOCTO,
	JT_4_ORK_HERO,
	JT_4_JP_16TH,
	JT_4_EP17_MASTER_A,
	JT_4_EP17_BASIC_B,
	JT_4_EP17_GUARD_B,
	JT_4_EP17_BASIC_B_NG,
	JT_4_EP17_GUARD_B_NG,
	JT_4_EP17_SWEETY,
	JT_4_EP17_BOY_A,
	JT_4_EP17_BOY_B,
	JT_4_EP17_TAMARIN,
	JT_4_EP17_SCISSORE,
	JT_4_EP17_TABLET,
	JT_4_EP17_BUCKETS,
	JT_4_EP17_CLEANER,
	JT_4_EP17_BASKET,
	JT_4_EP17_BROKENBETA,
	JT_4_EP17_CLEANER_W,
	JT_4_EP17_MERMAID,
	JT_4_JP_AB_NPC_009,
	JT_4_JP_AB_NPC_010,

	JT_4_4JOB_SILLA = 10364,
	JT_4_4JOB_MAGGI,
	JT_4_4JOB_ROBIN,
	JT_4_4JOB_ROBIN_DRUNK,
	JT_4_4JOB_LETICIA,
	JT_4_4JOB_SERANG,
	JT_4_4JOB_EINHAR,
	JT_4_4JOB_SEALSTONE,
	JT_4_4JOB_PHANTOMBOOK1,
	JT_4_4JOB_PHANTOMBOOK2,
	JT_4_4JOB_PHANTOMBOOK3,
	JT_4_VENDING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_STRANGE_B_SMITH1,
	JT_STRONGER_B_SMTIH,

	JT_NEW_NPC_3RD_END = 19999,
	NPC_RANGE3_END, // Official: JT_NEW_NPC_3RD_END=19999

	// Unofficial
	JT_INVISIBLE = 32767,
	JT_FAKENPC = -1
};

// Old NPC range
#define MAX_NPC_CLASS NPC_RANGE2_END
// New NPC range
#define MAX_NPC_CLASS2_START NPC_RANGE3_START
#define MAX_NPC_CLASS2_END NPC_RANGE3_END

//Checks if a given id is a valid npc id. [Skotlex]
//Since new npcs are added all the time, the max valid value is the one before the first mob (Scorpion = 1001)
#define npcdb_checkid(id) ( ( (id) > NPC_RANGE1_START && (id) < NPC_RANGE1_END ) || (id) == JT_HIDDEN_WARP_NPC || ( (id) > NPC_RANGE2_START && (id) < NPC_RANGE2_END ) || (id) == JT_INVISIBLE || ( (id) > NPC_RANGE3_START && (id) < NPC_RANGE3_END ) )

#ifdef PCRE_SUPPORT
void npc_chat_finalize(struct npc_data* nd);
#endif

//Script NPC events.
enum npce_event : uint8 {
	NPCE_LOGIN,
	NPCE_LOGOUT,
	NPCE_LOADMAP,
	NPCE_BASELVUP,
	NPCE_JOBLVUP,
	NPCE_DIE,
	NPCE_KILLPC,
	NPCE_KILLNPC,
	NPCE_MAX
};

// Status of NPC view.
enum e_npcv_status : uint8 {
	NPCVIEW_DISABLE  = 0x01,
	NPCVIEW_ENABLE   = 0x02,
	NPCVIEW_HIDEOFF  = 0x04,
	NPCVIEW_HIDEON   = 0x08,
	NPCVIEW_CLOAKOFF = 0x10,
	NPCVIEW_CLOAKON  = 0x20,

	NPCVIEW_VISIBLE   = 0x16,
	NPCVIEW_INVISIBLE = 0x29,
	NPCVIEW_CLOAK     = 0x30,
};
struct view_data* npc_get_viewdata(int class_);
int npc_chat_sub(struct block_list* bl, va_list ap);
int npc_event_dequeue(struct map_session_data* sd,bool free_script_stack=true);
int npc_event(struct map_session_data* sd, const char* eventname, int ontouch);
int npc_touch_areanpc(struct map_session_data* sd, int16 m, int16 x, int16 y, struct npc_data* nd);
int npc_touch_area_allnpc(struct map_session_data* sd, int16 m, int16 x, int16 y);
int npc_touch_areanpc2(struct mob_data *md); // [Skotlex]
int npc_check_areanpc(int flag, int16 m, int16 x, int16 y, int16 range);
int npc_touchnext_areanpc(struct map_session_data* sd,bool leavemap);
int npc_click(struct map_session_data* sd, struct npc_data* nd);
bool npc_scriptcont(struct map_session_data* sd, int id, bool closing);
struct npc_data* npc_checknear(struct map_session_data* sd, struct block_list* bl);
int npc_buysellsel(struct map_session_data* sd, int id, int type);
uint8 npc_buylist(struct map_session_data* sd, uint16 n, struct s_npc_buy_list *item_list);
static int npc_buylist_sub(struct map_session_data* sd, uint16 n, struct s_npc_buy_list *item_list, struct npc_data* nd);
uint8 npc_selllist(struct map_session_data* sd, int n, unsigned short *item_list);
void npc_parse_mob2(struct spawn_data* mob);
struct npc_data* npc_add_warp(char* name, short from_mapid, short from_x, short from_y, short xs, short ys, unsigned short to_mapindex, short to_x, short to_y);
int npc_globalmessage(const char* name,const char* mes);
const char *npc_get_script_event_name(int npce_index);

void npc_setcells(struct npc_data* nd);
void npc_unsetcells(struct npc_data* nd);
bool npc_movenpc(struct npc_data* nd, int16 x, int16 y);
bool npc_is_cloaked(struct npc_data* nd, struct map_session_data* sd);
bool npc_enable_target(npc_data& nd, uint32 char_id, e_npcv_status flag);
#define npc_enable(nd, flag) npc_enable_target(nd, 0, flag)
void npc_setdisplayname(struct npc_data* nd, const char* newname);
void npc_setclass(struct npc_data* nd, short class_);
struct npc_data* npc_name2id(const char* name);
int npc_isnear_sub(struct block_list* bl, va_list args);
bool npc_isnear(struct block_list * bl);

int npc_get_new_npc_id(void);

int npc_addsrcfile(const char* name, bool loadscript);
void npc_delsrcfile(const char* name);
int npc_parsesrcfile(const char* filepath);
void do_clear_npc(void);
void do_final_npc(void);
void do_init_npc(void);
void npc_event_do_oninit(void);

int npc_event_do(const char* name);
int npc_event_do_id(const char* name, int rid);
int npc_event_doall(const char* name);
void npc_event_runall( const char* eventname );
int npc_event_doall_id(const char* name, int rid);
int npc_event_doall_path(const char* event_name, const char* path);

int npc_timerevent_start(struct npc_data* nd, int rid);
int npc_timerevent_stop(struct npc_data* nd);
void npc_timerevent_quit(struct map_session_data* sd);
t_tick npc_gettimerevent_tick(struct npc_data* nd);
int npc_settimerevent_tick(struct npc_data* nd, int newtimer);
int npc_remove_map(struct npc_data* nd);
void npc_unload_duplicates (struct npc_data* nd);
int npc_unload(struct npc_data* nd, bool single);
int npc_reload(void);
void npc_read_event_script(void);
int npc_script_event(struct map_session_data* sd, enum npce_event type);

int npc_duplicate4instance(struct npc_data *snd, int16 m);
int npc_instanceinit(struct npc_data* nd);
int npc_instancedestroy(struct npc_data* nd);
int npc_cashshop_buy(struct map_session_data *sd, t_itemid nameid, int amount, int points);

void npc_shop_currency_type(struct map_session_data *sd, struct npc_data *nd, int cost[2], bool display);

extern struct npc_data* fake_nd;

int npc_cashshop_buylist(struct map_session_data *sd, int points, int count, struct PACKET_CZ_PC_BUY_CASH_POINT_ITEM_sub* item_list);
bool npc_shop_discount(struct npc_data* nd);

#if PACKETVER >= 20131223
void npc_market_tosql(const char *exname, struct npc_item_list *list);
void npc_market_delfromsql_(const char *exname, t_itemid nameid, bool clear);
#endif

#ifdef SECURE_NPCTIMEOUT
	TIMER_FUNC(npc_secure_timeout_timer);
#endif

// @commands (script-based)
int npc_do_atcmd_event(struct map_session_data* sd, const char* command, const char* message, const char* eventname);

bool npc_unloadfile( const char* path );

#endif /* NPC_HPP */
