1 |
root |
1.2 |
/* |
2 |
|
|
* This file is part of Crossfire TRT, the Multiplayer Online Role Playing Game. |
3 |
|
|
* |
4 |
|
|
* Copyright (©) 2005,2006,2007 Marc Alexander Lehmann / Robin Redeker / the Crossfire TRT team |
5 |
|
|
* Copyright (©) 2001-2005,2007 by Chachkoff Yann (Feel free to deliver your complaints) |
6 |
|
|
* Copyright (©) 2002,2007 Mark Wedel & Crossfire Development Team |
7 |
|
|
* Copyright (©) 1992,2007 Frank Tore Johansen |
8 |
|
|
* |
9 |
|
|
* Crossfire TRT is free software; you can redistribute it and/or modify it |
10 |
|
|
* under the terms of the GNU General Public License as published by the Free |
11 |
|
|
* Software Foundation; either version 2 of the License, or (at your option) |
12 |
|
|
* any later version. |
13 |
|
|
* |
14 |
|
|
* This program is distributed in the hope that it will be useful, but |
15 |
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY |
16 |
|
|
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
17 |
|
|
* for more details. |
18 |
|
|
* |
19 |
|
|
* You should have received a copy of the GNU General Public License along |
20 |
|
|
* with Crossfire TRT; if not, write to the Free Software Foundation, Inc. 51 |
21 |
|
|
* Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
22 |
|
|
* |
23 |
|
|
* The authors can be reached via e-mail to <crossfire@schmorp.de> |
24 |
|
|
*/ |
25 |
|
|
|
26 |
root |
1.1 |
/*****************************************************************************/ |
27 |
|
|
/* Crossfire Plugin Interface Common Parts */ |
28 |
|
|
/* Version: 2.0beta8 (also known as "Alexander") */ |
29 |
|
|
/* Contact: yann.chachkoff@myrealbox.com */ |
30 |
|
|
/*****************************************************************************/ |
31 |
root |
1.2 |
|
32 |
root |
1.1 |
#ifndef PLUGIN_COMMON_H |
33 |
|
|
#define PLUGIN_COMMON_H |
34 |
|
|
|
35 |
|
|
#ifdef WIN32 |
36 |
|
|
#define CF_PLUGIN __declspec(dllexport) |
37 |
|
|
#else |
38 |
|
|
#define CF_PLUGIN |
39 |
|
|
#endif |
40 |
|
|
|
41 |
|
|
#include <plugin.h> |
42 |
|
|
|
43 |
|
|
#define PLUGIN_ERROR_INT 0x0FFFFF |
44 |
|
|
|
45 |
|
|
extern int cf_init_plugin( f_plug_api getHooks ); |
46 |
|
|
extern void cf_system_register_global_event( int event, const char* name, f_plug_api hook ); |
47 |
|
|
|
48 |
|
|
/* General functions */ |
49 |
|
|
extern char* cf_add_string( char* str ); |
50 |
|
|
extern void cf_free_string( char* str ); |
51 |
|
|
extern char* cf_strdup_local(char* txt); |
52 |
|
|
extern char* cf_get_maps_directory( char* str ); |
53 |
|
|
extern int cf_find_animation(char* txt); |
54 |
|
|
|
55 |
|
|
/* Objects */ |
56 |
|
|
extern void* cf_object_set_int_property(object* op, int propcode, int value); |
57 |
|
|
extern void* cf_object_get_property(object* op, int propcode); |
58 |
|
|
extern void cf_free_object( object* ob ); |
59 |
|
|
extern void cf_fix_object( object* pl ); |
60 |
|
|
extern char* cf_query_name( object* ob ); |
61 |
|
|
extern char* cf_query_name_pl( object* ob ); |
62 |
|
|
extern char* cf_query_base_name( object* ob, int plural ); |
63 |
|
|
extern object* cf_insert_ob_in_ob( object* ob, object* where ); |
64 |
|
|
extern const char* cf_object_get_msg( object* ); |
65 |
|
|
extern void cf_object_set_weight( object* ob, int weight ); |
66 |
|
|
extern int cf_object_get_weight( object* ob ); |
67 |
|
|
extern void cf_object_set_weight_limit( object* ob, int weight ); |
68 |
|
|
extern int cf_object_get_weight_limit( object* ob ); |
69 |
|
|
extern int cf_object_set_nrof( object*, int nrof ); |
70 |
|
|
extern int cf_object_get_nrof( object* ); |
71 |
|
|
extern int cf_object_get_flag( object* ob, int flag ); |
72 |
|
|
extern void cf_object_set_flag( object* ob, int flag, int value ); |
73 |
|
|
extern object* cf_object_insert_in_ob( object* ob, object* where ); |
74 |
|
|
extern void* cf_object_set_string_property(object* op, int propcode, char* value); |
75 |
|
|
extern void cf_object_activate_rune( object* op , object* victim); |
76 |
|
|
extern int cf_object_check_trigger( object* op, object* cause ); |
77 |
|
|
extern int cf_object_query_money( object* op); |
78 |
|
|
extern int cf_object_query_cost( object* op, object* who, int flags); |
79 |
|
|
extern void* cf_object_set_string_property(object* op, int propcode, char* value); |
80 |
|
|
extern int cf_object_cast_spell(object* caster, object* ctoo, int dir, object* sp, char* flags); |
81 |
|
|
extern void cf_object_learn_spell(object* op, object* sp); |
82 |
|
|
extern void cf_object_forget_spell(object* op, object* sp); |
83 |
|
|
extern object* cf_object_check_for_spell(object* op, char* spellname); |
84 |
|
|
extern int cf_object_cast_ability(object* caster, object* ctoo, int dir, object* sp, char* flags); |
85 |
|
|
extern int cf_object_pay_amount(object* op, uint64 amount); |
86 |
|
|
extern int cf_object_pay_item(object* op, object* buyer); |
87 |
|
|
extern void* cf_object_set_long_property(object* op, int propcode, long value); |
88 |
|
|
extern int cf_object_transfer(object* op,int x,int y,int r,object* orig); |
89 |
|
|
extern int cf_object_out_of_map( object* op, int x, int y); |
90 |
|
|
extern void cf_object_drop( object* op, object* author); |
91 |
|
|
extern void cf_object_take( object* op, object* author); |
92 |
|
|
extern void cf_object_say( object* op, char* msg); |
93 |
|
|
extern void cf_object_speak( object* op, char* msg); |
94 |
|
|
extern object* cf_object_insert_object(object* op, object* container); |
95 |
|
|
extern object* cf_object_present_archname_inside(object* op, char* whatstr); |
96 |
|
|
extern void cf_object_apply(object* op, object* author, int flags); |
97 |
|
|
extern void cf_object_remove(object* op); |
98 |
|
|
extern void cf_object_free(object* op); |
99 |
|
|
extern object* cf_create_object(void); |
100 |
|
|
extern object* cf_create_object_by_name( const char* name ); |
101 |
|
|
extern int cf_object_change_map(object* op, int x, int y, maptile* map); |
102 |
|
|
extern int cf_object_teleport( object* ob, maptile* map, int x, int y ); |
103 |
|
|
extern void cf_object_update( object* op, int flags); |
104 |
|
|
extern void cf_object_pickup( object* op, object* what); |
105 |
|
|
extern char* cf_object_get_key(object* op, char* keyname); |
106 |
|
|
extern void cf_object_set_key(object* op, char* keyname, char* value); |
107 |
|
|
extern sint16 cf_object_get_resistance(object* op, int rtype); |
108 |
|
|
extern void cf_object_move(object* op, int dir, object*originator); |
109 |
|
|
extern void cf_object_apply_below(object* op); |
110 |
|
|
extern object* cf_object_clone(object* op, int clonetype); |
111 |
|
|
|
112 |
|
|
/* Maps */ |
113 |
|
|
extern void* cf_map_get_property(maptile* map, int propcode); |
114 |
|
|
extern void* cf_map_set_int_property(maptile* map, int propcode, int value); |
115 |
|
|
extern maptile* cf_map_get_map( char* name ); |
116 |
|
|
extern maptile* cf_map_get_first(void); |
117 |
|
|
extern void cf_map_message(maptile* m, char* msg, int color); |
118 |
|
|
extern object* cf_map_get_object_at(maptile* m, int x, int y); |
119 |
|
|
extern object* cf_map_insert_object(maptile* where, object* op, int x, int y); |
120 |
|
|
extern object* cf_map_present_arch_by_name(const char* str, maptile* map, int nx, int ny); |
121 |
|
|
extern int cf_map_get_flags( maptile* map, maptile** nmap, sint16 x, sint16 y, sint16* nx, sint16* ny ); |
122 |
|
|
extern object* cf_map_insert_object_there(maptile* where, object* op, object* originator, int flags); |
123 |
|
|
extern int cf_map_get_difficulty(maptile* map); |
124 |
|
|
extern int cf_map_get_reset_time(maptile* map); |
125 |
|
|
extern int cf_map_get_reset_timeout(maptile* map); |
126 |
|
|
extern int cf_map_get_players(maptile* map); |
127 |
|
|
extern int cf_map_get_darkness(maptile* map); |
128 |
|
|
extern int cf_map_get_width(maptile* map); |
129 |
|
|
extern int cf_map_get_height(maptile* map); |
130 |
|
|
extern int cf_map_get_enter_x(maptile* map); |
131 |
|
|
extern int cf_map_get_enter_y(maptile* map); |
132 |
|
|
extern int cf_map_get_temperature(maptile* map); |
133 |
|
|
extern int cf_map_get_pressure(maptile* map); |
134 |
|
|
extern int cf_map_get_humidity(maptile* map); |
135 |
|
|
extern int cf_map_get_windspeed(maptile* map); |
136 |
|
|
extern int cf_map_get_winddir(maptile* map); |
137 |
|
|
extern int cf_map_get_sky(maptile* map); |
138 |
|
|
extern int cf_map_get_wpartx(maptile* map); |
139 |
|
|
extern int cf_map_get_wparty(maptile* map); |
140 |
|
|
|
141 |
|
|
/* Players */ |
142 |
|
|
extern char* cf_player_get_ip(object* op); |
143 |
|
|
extern object* cf_player_get_marked_item(object* op); |
144 |
|
|
extern void cf_player_set_marked_item(object* op, object* ob); |
145 |
|
|
extern player* cf_player_find(char* txt); |
146 |
|
|
extern void cf_player_message(object* op, char* txt, int flags); |
147 |
|
|
extern object* cf_player_send_inventory(object* op); |
148 |
|
|
extern void cf_player_move(player* pl, int dir); |
149 |
|
|
extern partylist* cf_player_get_party(object* op); |
150 |
|
|
extern void cf_player_set_party(object* op, partylist* party); |
151 |
|
|
|
152 |
|
|
/* Archetypes */ |
153 |
|
|
extern archetype* cf_archetype_get_first(void); |
154 |
|
|
extern const char* cf_archetype_get_name(archetype* arch); |
155 |
|
|
extern archetype* cf_archetype_get_next(archetype* arch); |
156 |
|
|
extern archetype* cf_archetype_get_more(archetype* arch); |
157 |
|
|
extern archetype* cf_archetype_get_head(archetype* arch); |
158 |
|
|
extern object* cf_archetype_get_clone(archetype* arch); |
159 |
|
|
|
160 |
|
|
/* Parties */ |
161 |
|
|
extern partylist* cf_party_get_first(void); |
162 |
|
|
extern const char* cf_party_get_name(partylist* party); |
163 |
|
|
extern partylist* cf_party_get_next(partylist* party); |
164 |
|
|
extern const char* cf_party_get_password(partylist* party); |
165 |
|
|
extern player* cf_party_get_first_player(partylist* party); |
166 |
|
|
extern player* cf_party_get_next_player(partylist* party, player* op); |
167 |
|
|
|
168 |
|
|
/* Regions */ |
169 |
|
|
extern region* cf_region_get_first(void); |
170 |
|
|
extern const char* cf_region_get_name(region* reg); |
171 |
|
|
extern region* cf_region_get_next(region* reg); |
172 |
|
|
extern region* cf_region_get_parent(region* reg); |
173 |
|
|
extern const char* cf_region_get_longname(region* reg); |
174 |
|
|
extern const char* cf_region_get_message(region* reg); |
175 |
|
|
|
176 |
|
|
/* temp */ |
177 |
|
|
//extern f_plug_api cfapi_object_get_property; |
178 |
|
|
//extern f_plug_api cfapi_object_set_property; |
179 |
|
|
//extern f_plug_api cfapi_object_apply; |
180 |
|
|
//extern f_plug_api cfapi_object_remove; |
181 |
|
|
|
182 |
|
|
#ifdef WIN32 |
183 |
|
|
|
184 |
|
|
struct timezone { |
185 |
|
|
int tz_minuteswest; |
186 |
|
|
int tz_dsttime; |
187 |
|
|
}; |
188 |
|
|
int gettimeofday(struct timeval *time_Info, struct timezone *timezone_Info); |
189 |
|
|
|
190 |
|
|
#endif |
191 |
|
|
|
192 |
|
|
#endif /* PLUGIN_COMMON_H */ |