summaryrefslogtreecommitdiff
path: root/src/map/chat.h
blob: 695e59b6ecc775610e9600cf3e9c8e7cdcdacad9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
// Copyright (c) Hercules Dev Team, licensed under GNU GPL.
// See the LICENSE file
// Portions Copyright (c) Athena Dev Teams

#ifndef _CHAT_H_
#define _CHAT_H_

#include "map.h" // struct block_list, CHATROOM_TITLE_SIZE

struct map_session_data;
struct chat_data;

struct chat_data {
	struct block_list bl;            // data for this map object
	char title[CHATROOM_TITLE_SIZE]; // room title 
	char pass[CHATROOM_PASS_SIZE];   // password
	bool pub;                        // private/public flag
	uint8 users;                     // current user count
	uint8 limit;                     // join limit
	uint8 trigger;                   // number of users needed to trigger event
	uint32 zeny;						 // required zeny to join
	uint32 minLvl;					 // minimum base level to join
	uint32 maxLvl;					 // maximum base level allowed to join
	struct map_session_data* usersd[20];
	struct block_list* owner;
	char npc_event[EVENT_NAME_LENGTH];
	/* isn't this a waste? there is a enormous overhead, wouldn't something like skill_blockpc_start be better here? [Ind] */
	DBMap* kick_list;				//DBMap of users who were kicked from this chat
};

/*=====================================
* Interface : chat.h 
* Generated by HerculesInterfaceMaker
* created by Susu
*-------------------------------------*/
struct chat_interface {
	
	/* funcs */
	int (*create_pc_chat) (struct map_session_data* sd, const char* title, const char* pass, int limit, bool pub);
	int (*join) (struct map_session_data* sd, int chatid, const char* pass);
	int (*leave) (struct map_session_data* sd, bool kicked);
	int (*change_owner) (struct map_session_data* sd, const char* nextownername);
	int (*change_status) (struct map_session_data* sd, const char* title, const char* pass, int limit, bool pub);
	int (*kick) (struct map_session_data* sd, const char* kickusername);
	int (*create_npc_chat) (struct npc_data* nd, const char* title, int limit, bool pub, int trigger, const char* ev, int zeny, int minLvl, int maxLvl);
	int (*delete_npc_chat) (struct npc_data* nd);
	int (*enable_event) (struct chat_data* cd);
	int (*disable_event) (struct chat_data* cd);
	int (*npc_kick_all) (struct chat_data* cd);
	int (*trigger_event) (struct chat_data *cd);
	struct chat_data* (*create) (struct block_list* bl, const char* title, const char* pass, int limit, bool pub, int trigger, const char* ev, int zeny, int minLvl, int maxLvl);
};

struct chat_interface *chat;

void chat_defaults(void);

#endif /* _CHAT_H_ */