Atrinik Server  4.0
monster_data.h
Go to the documentation of this file.
1 /*************************************************************************
2  * Atrinik, a Multiplayer Online Role Playing Game *
3  * *
4  * Copyright (C) 2009-2014 Alex Tokar and Atrinik Development Team *
5  * *
6  * Fork from Crossfire (Multiplayer game for X-windows). *
7  * *
8  * This program is free software; you can redistribute it and/or modify *
9  * it under the terms of the GNU General Public License as published by *
10  * the Free Software Foundation; either version 2 of the License, or *
11  * (at your option) any later version. *
12  * *
13  * This program is distributed in the hope that it will be useful, *
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
16  * GNU General Public License for more details. *
17  * *
18  * You should have received a copy of the GNU General Public License *
19  * along with this program; if not, write to the Free Software *
20  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
21  * *
22  * The author can be reached at admin@atrinik.org *
23  ************************************************************************/
24 
32 #ifndef MONSTER_DATA_H
33 #define MONSTER_DATA_H
34 
39 #define MONSTER_DATA_INTERFACE_CLEANUP 10
40 
44 #define MONSTER_DATA_INTERFACE_TIMEOUT 60 * 15
45 
53 #define MONSTER_DATA_INTERFACE_DISTANCE 2
54 
58 typedef struct monster_data_dialog {
61 
62  object *ob;
63  tag_t count;
64 
68  long expire;
70 
74 typedef struct monster_data {
78  struct {
79  uint16_t x;
80  uint16_t y;
82  } enemy_coords;
83 
88 
94 
98 #define MONSTER_DATA(_obj) ((monster_data_t *) (_obj)->custom_attrset)
99 
100 /* Prototypes */
101 
102 void monster_data_init(object *op);
103 void monster_data_deinit(object *op);
104 void monster_data_enemy_update(object *op, object *enemy);
105 bool monster_data_enemy_get_coords(object *op, mapstruct **map, uint16_t *x,
106  uint16_t *y);
107 void monster_data_dialogs_add(object *op, object *activator,
108  uint32_t secs);
109 void monster_data_dialogs_remove(object *op, object *activator);
110 bool monster_data_dialogs_check(object *op, object *activator);
111 size_t monster_data_dialogs_num(object *op);
112 void monster_data_dialogs_cleanup(object *op);
113 void monster_data_dialogs_purge(object *op);
114 
115 #endif
struct monster_data::@15 enemy_coords
struct monster_data_dialog * prev
Previous dialog.
Definition: monster_data.h:60
struct monster_data_dialog monster_data_dialog_t
long last_cleanup
Definition: monster_data.h:92
size_t monster_data_dialogs_num(object *op)
Definition: monster_data.c:321
struct monster_data_dialog * next
Next dialog.
Definition: monster_data.h:59
void monster_data_dialogs_cleanup(object *op)
Definition: monster_data.c:349
void monster_data_enemy_update(object *op, object *enemy)
Definition: monster_data.c:89
void monster_data_init(object *op)
Definition: monster_data.c:48
void monster_data_dialogs_purge(object *op)
Definition: monster_data.c:389
struct monster_data monster_data_t
void monster_data_deinit(object *op)
Definition: monster_data.c:62
mapstruct * map
The map.
Definition: monster_data.h:81
void monster_data_dialogs_add(object *op, object *activator, uint32_t secs)
Definition: monster_data.c:214
uint16_t y
Y.
Definition: monster_data.h:80
tag_t count
ID of the object.
Definition: monster_data.h:63
uint16_t x
X.
Definition: monster_data.h:79
object * ob
Object that is talking to the monster.
Definition: monster_data.h:62
void monster_data_dialogs_remove(object *op, object *activator)
Definition: monster_data.c:254
monster_data_dialog_t * dialogs
Definition: monster_data.h:87
Definition: map.h:536
bool monster_data_enemy_get_coords(object *op, mapstruct **map, uint16_t *x, uint16_t *y)
Definition: monster_data.c:120
bool monster_data_dialogs_check(object *op, object *activator)
Definition: monster_data.c:290