Crossfire Server, Trunk  1.75.0
plugin_common.h
Go to the documentation of this file.
1 /*****************************************************************************/
2 /* Crossfire Plugin Interface Common Parts */
3 /* Version: 2.0beta8 (also known as "Alexander") */
4 /* Contact: yann.chachkoff@myrealbox.com */
5 /*****************************************************************************/
6 /* That code is placed under the GNU General Public Licence (GPL) */
7 /* (C)2001-2005 by Chachkoff Yann (Feel free to deliver your complaints) */
8 /*****************************************************************************/
9 /* CrossFire, A Multiplayer game for X-windows */
10 /* */
11 /* Copyright (C) 2000 Mark Wedel */
12 /* Copyright (C) 1992 Frank Tore Johansen */
13 /* */
14 /* This program is free software; you can redistribute it and/or modify */
15 /* it under the terms of the GNU General Public License as published by */
16 /* the Free Software Foundation; either version 2 of the License, or */
17 /* (at your option) any later version. */
18 /* */
19 /* This program is distributed in the hope that it will be useful, */
20 /* but WITHOUT ANY WARRANTY; without even the implied warranty of */
21 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
22 /* GNU General Public License for more details. */
23 /* */
24 /* You should have received a copy of the GNU General Public License */
25 /* along with this program; if not, write to the Free Software */
26 /* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
27 /* */
28 /*****************************************************************************/
29 #ifndef PLUGIN_COMMON_H
30 #define PLUGIN_COMMON_H
31 
32 #ifdef WIN32
33 #define CF_PLUGIN __declspec(dllexport)
34 #else
35 #ifdef HAVE_VISIBILITY
36 #define CF_PLUGIN __attribute__((visibility("default")))
37 #else
38 #define CF_PLUGIN
39 #endif
40 #endif
41 
42 #include <plugin.h>
43 
44 #define PLUGIN_ERROR_INT 0x0FFFFF
45 
46 extern int cf_init_plugin(f_plug_api getHooks);
47 extern void cf_system_register_global_event(int event, const char *name, f_plug_event hook);
48 extern void cf_system_unregister_global_event(int event, const char *name);
49 extern command_registration cf_system_register_command(const char *name, command_function func, uint8_t command_type, float time);
50 extern command_registration cf_system_register_command_extra(const char *name, const char *extra, command_function_extra func, uint8_t command_type, float time);
52 
53 /* General functions */
54 extern sstring cf_add_string(const char *str);
55 extern void cf_free_string(sstring str);
56 extern sstring cf_find_string(const char *str);
57 extern char *cf_strdup_local(const char *str);
58 extern char *cf_get_maps_directory(const char *name, char *buf, int size);
59 extern int cf_find_animation(const char *txt);
60 extern int cf_find_face(const char *name, int error);
61 extern void cf_log(LogLevel logLevel, const char *format, ...);
62 extern void cf_log_plain(LogLevel logLevel, const char *message);
63 extern void cf_get_time(timeofday_t *tod);
64 extern int cf_timer_create(object *ob, long delay, int mode);
65 extern int cf_timer_destroy(int id);
66 extern const char *cf_get_directory(int id);
67 extern const char *cf_re_cmp(const char *str, const char *regexp);
68 extern const char *cf_get_season_name(int index);
69 extern const char *cf_get_month_name(int index);
70 extern const char *cf_get_weekday_name(int index);
71 extern const char *cf_get_periodofday_name(int index);
72 extern void cf_cost_string_from_value(uint64_t cost, int largest_coin, char *buffer, int length);
73 extern void cf_system_get_object_vector(int property, std::vector<object *> *list);
74 extern void cf_system_get_map_vector(int property, std::vector<mapstruct *> *list);
75 extern void cf_system_get_archetype_vector(int property, std::vector<archetype *> *list);
76 extern void cf_system_get_party_vector(int property, std::vector<partylist *> *list);
77 extern void cf_system_get_region_vector(int property, std::vector<region *> *list);
78 
79 /* Objects */
80 extern void cf_object_set_int_property(object *op, int propcode, int value);
81 extern int cf_object_get_int_property(object *op, int propcode);
82 extern long cf_object_get_long_property(object *op, long propcode);
83 extern void cf_object_set_movetype_property(object *op, int propcode, MoveType value);
84 extern MoveType cf_object_get_movetype_property(object *op, int propcode);
85 extern object *cf_object_get_object_property(object *op, int propcode);
86 extern void cf_object_set_object_property(object *op, int propcode, object *value);
87 extern float cf_object_get_float_property(object *op, int propcode);
88 extern void cf_object_set_float_property(object *op, int propcode, float value);
89 extern mapstruct *cf_object_get_map_property(object *op, int propcode);
90 extern archetype *cf_object_get_archetype_property(object *op, int propcode);
91 extern partylist *cf_object_get_partylist_property(object *op, int propcode);
92 extern int64_t cf_object_get_int64_property(object *op, int propcode);
93 extern void cf_object_set_int64_property(object *op, int propcode, int64_t value);
94 extern double cf_object_get_double_property(object *op, int propcode);
95 extern sstring cf_object_get_sstring_property(object *op, int propcode);
96 extern char *cf_object_get_string_property(object *op, int propcode, char *buf, int size);
97 extern void cf_fix_object(object *op);
98 extern char *cf_query_name(object *ob, char *name, int size);
99 extern sstring cf_query_name_pl(object *ob);
100 extern const char *cf_object_get_msg(object *);
101 extern void cf_object_set_weight(object *ob, int weight);
102 extern int cf_object_get_weight(object *ob);
103 extern void cf_object_set_weight_limit(object *ob, int weight);
104 extern int cf_object_get_weight_limit(object *ob);
105 extern int cf_object_set_nrof(object *, int nrof);
106 extern int cf_object_get_nrof(object *);
107 extern int cf_object_get_flag(object *ob, int flag);
108 extern void cf_object_set_flag(object *ob, int flag, int value);
109 extern object *cf_object_insert_in_ob(object *op, object *where);
110 extern void cf_object_set_string_property(object *op, int propcode, const char *value);
111 extern void cf_spring_trap(object *trap, object *victim);
112 extern int cf_object_check_trigger(object *op, object *cause);
113 extern int cf_object_query_money(const object *op);
114 extern int cf_object_query_cost(const object *tmp, object *who, int flag);
115 extern void cf_object_query_cost_string(const object *tmp, object *who, int flag, char *buffer, int length);
116 extern int cf_object_cast_spell(object *op, object *caster, int dir, object *spell_ob, char *stringarg);
117 extern void cf_object_learn_spell(object *op, object *spell, int special_prayer);
118 extern void cf_object_forget_spell(object *op, object *sp);
119 extern object *cf_object_check_for_spell(object *op, const char *name);
120 extern int cf_object_pay_amount(object *pl, uint64_t to_pay);
121 extern int cf_object_pay_item(object *op, object *pl);
122 extern void cf_object_set_long_property(object *op, int propcode, long value);
123 extern int cf_object_transfer(object *op, int x, int y, int randomly, object *originator);
124 extern int cf_object_move_to(object *op, int x, int y);
125 extern int cf_object_out_of_map(object *op, int x, int y);
126 extern void cf_object_drop(object *op, object *author);
127 extern void cf_object_say(object *op, const char *msg);
128 extern object *cf_object_insert_object(object *op, object *container);
129 extern object *cf_object_present_archname_inside(object *op, char *whatstr);
130 extern int cf_object_apply(object *op, object *author, int flags);
131 extern void cf_object_remove(object *op);
132 extern void cf_object_free_drop_inventory(object *ob);
133 extern object *cf_create_object(void);
134 extern object *cf_create_object_by_name(const char *name);
135 extern object *cf_object_change_map(object *op, mapstruct *m, object *originator, int flag, int x, int y);
136 extern int cf_object_teleport(object *ob, mapstruct *map, int x, int y);
137 extern void cf_object_update(object *op, int flags);
138 extern int cf_object_pickup(object *op, object *what);
139 extern const char *cf_object_get_key(object *op, const char *keyname);
140 extern int cf_object_set_key(object *op, const char *keyname, const char *value, int add_key);
141 extern int16_t cf_object_get_resistance(object *op, int rtype);
142 extern void cf_object_set_resistance(object *op, int rtype, int16_t value);
143 extern int cf_object_move(object *op, int dir, object*originator);
144 extern void cf_object_apply_below(object *pl);
145 extern object *cf_object_clone(object *op, int clonetype);
146 extern void cf_object_change_exp(object *op, int64_t exp, const char *skill_name, int flag);
147 extern int cf_object_change_abil(object *op, object *tmp);
148 extern int cf_object_user_event(object *op, object *activator, object *third, const char *message, int fix);
149 extern int cf_object_remove_depletion(object *op, int level);
150 extern object *cf_object_find_by_arch_name(const object *who, const char *name);
151 extern object *cf_object_find_by_name(const object *who, const char *name);
152 extern object *cf_object_split(object *orig_ob, uint32_t nr, char *err, size_t size);
153 extern object *cf_object_clone(object *op, int clonetype);
154 extern int cf_object_set_face(object *op, const char *face);
155 extern int cf_object_set_animation(object *op, const char *animation);
156 extern object *cf_identify(object *op);
157 extern int64_t cf_object_perm_exp(object *op);
158 /* Maps */
159 /*extern void *cf_map_get_property(mapstruct *map, int propcode);*/
160 extern sstring cf_map_get_sstring_property(mapstruct *map, int propcode);
161 extern mapstruct *cf_map_get_map_property(mapstruct *map, int propcode);
162 extern region *cf_map_get_region_property(mapstruct *map, int propcode);
163 extern int cf_map_get_int_property(mapstruct *map, int property);
164 
165 extern void cf_map_set_int_property(mapstruct *map, int propcode, int value);
166 extern void cf_map_set_string_property(mapstruct *map, int propcode, const char *value);
167 extern mapstruct *cf_map_get_map(const char *name, int flags);
168 extern mapstruct *cf_get_empty_map(int sizex, int sizey);
169 extern mapstruct *cf_map_get_first(void);
170 extern mapstruct *cf_map_has_been_loaded(const char *name);
171 extern void cf_map_message(mapstruct *m, const char *msg, int color);
172 extern object *cf_map_get_object_at(mapstruct *m, int x, int y);
173 extern object *cf_map_insert_object(mapstruct *where, object *op, int x, int y);
174 extern object *cf_map_insert_object_around(mapstruct *where, object *op, int x, int y);
175 extern object *cf_map_find_by_archetype_name(const char *str, mapstruct *map, int nx, int ny);
176 extern int cf_map_get_flags(mapstruct *oldmap, mapstruct **newmap, int16_t x, int16_t y, int16_t *nx, int16_t *ny);
177 extern object *cf_map_insert_object_there(object *op, mapstruct *m, object *originator, int flag);
178 extern int cf_map_get_difficulty(mapstruct *map);
179 extern int cf_map_get_reset_time(mapstruct *map);
180 extern int cf_map_get_reset_timeout(mapstruct *map);
181 extern int cf_map_get_players(mapstruct *map);
182 extern int cf_map_get_darkness(mapstruct *map);
183 extern int cf_map_get_light(mapstruct *map);
184 extern int cf_map_get_width(mapstruct *map);
185 extern int cf_map_get_height(mapstruct *map);
186 extern int cf_map_get_enter_x(mapstruct *map);
187 extern int cf_map_get_enter_y(mapstruct *map);
188 extern int cf_map_change_light(mapstruct *m, int change);
189 extern void cf_map_trigger_connected(objectlink *ol, object *cause, int state);
190 
191 /* Random maps */
192 extern int cf_random_map_set_variable(RMParms *rp, const char *buf);
193 extern mapstruct *cf_random_map_generate(const char *OutFileName, RMParms *RP, char **use_layout, sstring reset_group);
194 
195 /* Players */
196 extern char *cf_player_get_title(object *op, char *title, int size);
197 extern void cf_player_set_title(object *op, const char *title);
198 extern sstring cf_player_get_ip(object *op);
199 extern object *cf_player_get_marked_item(object *op);
200 extern void cf_player_set_marked_item(object *op, object *ob);
201 extern player *cf_player_find(const char *plname);
202 extern void cf_player_message(object *op, const char *txt, int flags);
203 extern int cf_player_move(player *pl, int dir);
204 extern partylist *cf_player_get_party(object *op);
205 extern void cf_player_set_party(object *op, partylist *party);
206 extern int cf_player_can_pay(object *op);
207 extern int cf_player_knowledge_has(object *op, const char *knowledge);
208 extern void cf_player_knowledge_give(object *op, const char *knowledge);
209 extern int cf_player_arrest(object *who);
210 
211 /* Archetypes */
212 extern archetype *cf_archetype_get_first(void);
217 extern object *cf_archetype_get_clone(archetype *arch);
218 
219 /* Parties */
220 extern partylist *cf_party_get_first(void);
221 extern const char *cf_party_get_name(partylist *party);
222 extern partylist *cf_party_get_next(partylist *party);
223 extern const char *cf_party_get_password(partylist *party);
225 extern player *cf_party_get_next_player(partylist *party, player *op);
226 
227 /* Regions */
228 extern region *cf_region_get_first(void);
229 extern const char *cf_region_get_name(region *reg);
230 extern region *cf_region_get_next(region *reg);
231 extern region *cf_region_get_parent(region *reg);
232 extern const char *cf_region_get_longname(region *reg);
233 extern const char *cf_region_get_message(region *reg);
234 extern int cf_region_get_jail_x(region *reg);
235 extern int cf_region_get_jail_y(region *reg);
236 extern const char *cf_region_get_jail_path(region *reg);
237 
238 /* Friendly list */
239 extern object *cf_friendlylist_get_first(void);
240 extern object *cf_friendlylist_get_next(object *ob);
241 
242 /* Quest-related functions */
243 extern int cf_quest_get_player_state(object *pl, sstring quest_code);
244 extern void cf_quest_start(object *pl, sstring quest_code, int state);
245 extern void cf_quest_set_player_state(object *pl, sstring quest_code, int state);
246 extern int cf_quest_was_completed(object *pl, sstring quest_code);
247 
248 #endif /* PLUGIN_COMMON_H */
cf_cost_string_from_value
void cf_cost_string_from_value(uint64_t cost, int largest_coin, char *buffer, int length)
Wrapper for cost_string_from_value modified to take a char* and length instead of a StringBuffer.
Definition: plugin_common.cpp:994
cf_map_get_region_property
region * cf_map_get_region_property(mapstruct *map, int propcode)
Definition: plugin_common.cpp:288
cf_log
void cf_log(LogLevel logLevel, const char *format,...)
Wrapper for LOG().
Definition: plugin_common.cpp:1522
cf_query_name_pl
sstring cf_query_name_pl(object *ob)
Definition: plugin_common.cpp:1209
cf_map_get_height
int cf_map_get_height(mapstruct *map)
Definition: plugin_common.cpp:1404
cf_object_check_for_spell
object * cf_object_check_for_spell(object *op, const char *name)
Wrapper for check_spell_known().
Definition: plugin_common.cpp:778
cf_get_weekday_name
const char * cf_get_weekday_name(int index)
Definition: plugin_common.cpp:1574
cf_region_get_jail_y
int cf_region_get_jail_y(region *reg)
Get region's jail y coordinate.
Definition: plugin_common.cpp:1989
cf_add_string
sstring cf_add_string(const char *str)
Wrapper for add_string().
Definition: plugin_common.cpp:1167
cf_map_get_first
mapstruct * cf_map_get_first(void)
Gives access to first_map.
Definition: plugin_common.cpp:975
cf_map_get_sstring_property
sstring cf_map_get_sstring_property(mapstruct *map, int propcode)
Definition: plugin_common.cpp:270
cf_get_directory
const char * cf_get_directory(int id)
Gets a directory Crossfire uses.
Definition: plugin_common.cpp:1130
cf_object_get_weight
int cf_object_get_weight(object *ob)
Definition: plugin_common.cpp:1241
cf_map_get_int_property
int cf_map_get_int_property(mapstruct *map, int property)
Definition: plugin_common.cpp:254
cf_player_set_marked_item
void cf_player_set_marked_item(object *op, object *ob)
Definition: plugin_common.cpp:866
cf_map_get_players
int cf_map_get_players(mapstruct *map)
Definition: plugin_common.cpp:1392
cf_object_teleport
int cf_object_teleport(object *ob, mapstruct *map, int x, int y)
Definition: plugin_common.cpp:1360
cf_party_get_name
const char * cf_party_get_name(partylist *party)
Definition: plugin_common.cpp:1798
cf_object_out_of_map
int cf_object_out_of_map(object *op, int x, int y)
Definition: plugin_common.cpp:1035
cf_get_season_name
const char * cf_get_season_name(int index)
Definition: plugin_common.cpp:1556
cf_object_get_string_property
char * cf_object_get_string_property(object *op, int propcode, char *buf, int size)
Definition: plugin_common.cpp:448
cf_object_get_long_property
long cf_object_get_long_property(object *op, long propcode)
Definition: plugin_common.cpp:342
cf_object_apply_below
void cf_object_apply_below(object *pl)
Wrapper for apply_by_living_below().
Definition: plugin_common.cpp:553
player
One player.
Definition: player.h:105
cf_archetype_get_name
sstring cf_archetype_get_name(archetype *arch)
Get archetype's name.
Definition: plugin_common.cpp:1702
cf_archetype_get_first
archetype * cf_archetype_get_first(void)
Get first archetype.
Definition: plugin_common.cpp:1686
cf_object_get_sstring_property
sstring cf_object_get_sstring_property(object *op, int propcode)
Definition: plugin_common.cpp:440
cf_player_knowledge_has
int cf_player_knowledge_has(object *op, const char *knowledge)
Wrapper for knowledge_player_has().
Definition: plugin_common.cpp:900
cf_object_query_cost
int cf_object_query_cost(const object *tmp, object *who, int flag)
cf_object_get_object_property
object * cf_object_get_object_property(object *op, int propcode)
Definition: plugin_common.cpp:365
command
same as sound ncom command like but with extra the client want tick commands so it knows animation timing the client wants to be informed of pickup mode changes Mode will be sent when the player successfully logs and afterward any time the value is but over many options have become defaults This documents those now obsolete client can handle the bit exp values that are now used values are sent as bit Setting this flag also means that skill exp will be and it will be sent in revised method as described in the stats command Value is an integer in string format else Deprecated client should presume all servers support this server will return FALSE Deprecated replaced with sound2 setup command
Definition: protocol.txt:461
cf_object_cast_spell
int cf_object_cast_spell(object *op, object *caster, int dir, object *spell_ob, char *stringarg)
Wrapper for cast_spell().
Definition: plugin_common.cpp:744
cf_fix_object
void cf_fix_object(object *op)
Wrapper for fix_object().
Definition: plugin_common.cpp:1156
cf_region_get_jail_path
const char * cf_region_get_jail_path(region *reg)
Get jail path of region.
Definition: plugin_common.cpp:2004
cf_player_knowledge_give
void cf_player_knowledge_give(object *op, const char *knowledge)
Wrapper for knowledge_give();.
Definition: plugin_common.cpp:913
cf_strdup_local
char * cf_strdup_local(const char *str)
Wrapper for strdup_local().
Definition: plugin_common.cpp:1446
cf_create_object_by_name
object * cf_create_object_by_name(const char *name)
Wrapper for create_archetype() and create_archetype_by_object_name().
Definition: plugin_common.cpp:1093
cf_map_get_reset_time
int cf_map_get_reset_time(mapstruct *map)
Definition: plugin_common.cpp:1384
MoveType
unsigned char MoveType
Typdef here to define type large enough to hold bitmask of all movement types.
Definition: define.h:417
timeofday_t
Represents the ingame time.
Definition: tod.h:38
cf_query_name
char * cf_query_name(object *ob, char *name, int size)
Definition: plugin_common.cpp:1201
cf_map_insert_object_around
object * cf_map_insert_object_around(mapstruct *where, object *op, int x, int y)
Will insert op in the map where around the spot x, y.
Definition: plugin_common.cpp:1351
cf_object_set_float_property
void cf_object_set_float_property(object *op, int propcode, float value)
Definition: plugin_common.cpp:396
cf_party_get_first_player
player * cf_party_get_first_player(partylist *party)
Get first player in party.
Definition: plugin_common.cpp:1846
cf_timer_destroy
int cf_timer_destroy(int id)
Destroys specified timer, equivalent of calling cftimer_destroy().
Definition: plugin_common.cpp:1620
time
non standard information is not specified or uptime this means how long since the executable has been started A particular host may have been running a server for quite a long time
Definition: arch-handbook.txt:206
cf_object_apply
int cf_object_apply(object *op, object *author, int flags)
Wrapper for apply_manual().
Definition: plugin_common.cpp:542
cf_region_get_next
region * cf_region_get_next(region *reg)
Get next region in region list.
Definition: plugin_common.cpp:1910
cf_object_get_int64_property
int64_t cf_object_get_int64_property(object *op, int propcode)
Definition: plugin_common.cpp:381
cf_object_move_to
int cf_object_move_to(object *op, int x, int y)
Wrapper for move_to().
Definition: plugin_common.cpp:630
cf_object_free_drop_inventory
void cf_object_free_drop_inventory(object *ob)
Wrapper for object_free_drop_inventory().
Definition: plugin_common.cpp:571
flags
static const flag_definition flags[]
Flag mapping.
Definition: gridarta-types-convert.cpp:101
cf_player_can_pay
int cf_player_can_pay(object *op)
Wrapper for can_pay().
Definition: plugin_common.cpp:886
cf_find_string
sstring cf_find_string(const char *str)
Definition: plugin_common.cpp:1189
cf_object_set_string_property
void cf_object_set_string_property(object *op, int propcode, const char *value)
Definition: plugin_common.cpp:456
cf_object_perm_exp
int64_t cf_object_perm_exp(object *op)
Wrapper for PERM_EXP macro.
Definition: plugin_common.cpp:515
plugin.h
cf_quest_set_player_state
void cf_quest_set_player_state(object *pl, sstring quest_code, int state)
Wrapper for quest_set_player_state();.
Definition: plugin_common.cpp:2075
cf_map_get_light
int cf_map_get_light(mapstruct *map)
cf_object_pickup
int cf_object_pickup(object *op, object *what)
Definition: plugin_common.cpp:1434
cf_map_insert_object
object * cf_map_insert_object(mapstruct *where, object *op, int x, int y)
Wrapper for object_insert_in_map_at().
Definition: plugin_common.cpp:1329
cf_player_arrest
int cf_player_arrest(object *who)
Wrapper for player_arrest().
Definition: plugin_common.cpp:924
cf_player_move
int cf_player_move(player *pl, int dir)
Definition: plugin_common.cpp:524
cf_party_get_next
partylist * cf_party_get_next(partylist *party)
Get next party in party list.
Definition: plugin_common.cpp:1814
partylist
One party.
Definition: party.h:10
buf
StringBuffer * buf
Definition: readable.cpp:1565
cf_archetype_get_clone
object * cf_archetype_get_clone(archetype *arch)
Get clone of archetype.
Definition: plugin_common.cpp:1767
cf_player_set_title
void cf_player_set_title(object *op, const char *title)
Definition: plugin_common.cpp:842
RMParms
Random map parameters.
Definition: random_map.h:14
cf_spring_trap
void cf_spring_trap(object *trap, object *victim)
Wrapper for spring_trap().
Definition: plugin_common.cpp:1005
cf_object_get_msg
const char * cf_object_get_msg(object *)
Definition: plugin_common.cpp:1218
cf_object_pay_amount
int cf_object_pay_amount(object *pl, uint64_t to_pay)
Wrapper for pay_for_amount().
Definition: plugin_common.cpp:732
name
Plugin animator file specs[Config] name
Definition: animfiles.txt:4
cf_object_change_abil
int cf_object_change_abil(object *op, object *tmp)
Wrapper for change_abil().
Definition: plugin_common.cpp:1671
cf_object_set_key
int cf_object_set_key(object *op, const char *keyname, const char *value, int add_key)
Sets a value for specified key, equivalent to object_set_value().
Definition: plugin_common.cpp:1659
cf_system_get_region_vector
void cf_system_get_region_vector(int property, std::vector< region * > *list)
Definition: plugin_common.cpp:2140
cf_quest_start
void cf_quest_start(object *pl, sstring quest_code, int state)
Wrapper for quest_start().
Definition: plugin_common.cpp:2064
cf_region_get_parent
region * cf_region_get_parent(region *reg)
Get parent of region.
Definition: plugin_common.cpp:1926
m
static event_registration m
Definition: citylife.cpp:424
cf_archetype_get_more
archetype * cf_archetype_get_more(archetype *arch)
Get next part of archetype.
Definition: plugin_common.cpp:1735
cf_object_set_animation
int cf_object_set_animation(object *op, const char *animation)
Set the object's animation.
Definition: plugin_common.cpp:486
cf_log_plain
void cf_log_plain(LogLevel logLevel, const char *message)
Wrapper for LOG() that uses directly a buffer, without format.
Definition: plugin_common.cpp:1542
cf_party_get_first
partylist * cf_party_get_first(void)
Get first party.
Definition: plugin_common.cpp:1783
cf_player_get_party
partylist * cf_player_get_party(object *op)
Definition: plugin_common.cpp:872
cf_object_say
void cf_object_say(object *op, const char *msg)
Definition: plugin_common.cpp:1049
cf_map_get_object_at
object * cf_map_get_object_at(mapstruct *m, int x, int y)
Wrapper for GET_MAP_OB().
Definition: plugin_common.cpp:655
cf_timer_create
int cf_timer_create(object *ob, long delay, int mode)
Creates a timer, equivalent of calling cftimer_create().
Definition: plugin_common.cpp:1604
cf_identify
object * cf_identify(object *op)
Wrapper for identify().
Definition: plugin_common.cpp:812
cf_object_set_int64_property
void cf_object_set_int64_property(object *op, int propcode, int64_t value)
Definition: plugin_common.cpp:402
cf_find_face
int cf_find_face(const char *name, int error)
Wrapper for find_face().
Definition: plugin_common.cpp:1510
cf_map_insert_object_there
object * cf_map_insert_object_there(object *op, mapstruct *m, object *originator, int flag)
Wrapper for object_insert_in_map().
Definition: plugin_common.cpp:1315
f_plug_api
void(* f_plug_api)(int *type,...)
General API function.
Definition: plugin.h:79
cf_map_get_enter_y
int cf_map_get_enter_y(mapstruct *map)
Definition: plugin_common.cpp:1412
cf_system_unregister_global_event
void cf_system_unregister_global_event(int event, const char *name)
Definition: plugin_common.cpp:1109
cf_get_month_name
const char * cf_get_month_name(int index)
Definition: plugin_common.cpp:1565
cf_init_plugin
int cf_init_plugin(f_plug_api getHooks)
Definition: plugin_common.cpp:146
cf_object_get_movetype_property
MoveType cf_object_get_movetype_property(object *op, int propcode)
Definition: plugin_common.cpp:357
cf_object_find_by_arch_name
object * cf_object_find_by_arch_name(const object *who, const char *name)
Wrapper for object_find_by_arch_name().
Definition: plugin_common.cpp:592
cf_object_get_map_property
mapstruct * cf_object_get_map_property(object *op, int propcode)
Definition: plugin_common.cpp:373
cf_object_query_money
int cf_object_query_money(const object *op)
Wrapper for query_money().
Definition: plugin_common.cpp:983
cf_region_get_longname
const char * cf_region_get_longname(region *reg)
Get longname of region.
Definition: plugin_common.cpp:1942
cf_get_empty_map
mapstruct * cf_get_empty_map(int sizex, int sizey)
Wrapper for get_empty_map().
Definition: plugin_common.cpp:948
cf_region_get_first
region * cf_region_get_first(void)
Get first region in region list.
Definition: plugin_common.cpp:1878
cf_map_set_int_property
void cf_map_set_int_property(mapstruct *map, int propcode, int value)
Definition: plugin_common.cpp:298
cf_object_query_cost_string
void cf_object_query_cost_string(const object *tmp, object *who, int flag, char *buffer, int length)
cf_object_get_partylist_property
partylist * cf_object_get_partylist_property(object *op, int propcode)
Definition: plugin_common.cpp:424
cf_object_get_nrof
int cf_object_get_nrof(object *)
Definition: plugin_common.cpp:1270
cf_object_set_weight_limit
void cf_object_set_weight_limit(object *ob, int weight)
Definition: plugin_common.cpp:1234
cf_object_clone
object * cf_object_clone(object *op, int clonetype)
Clone an object.
Definition: plugin_common.cpp:683
message
TIPS on SURVIVING Crossfire is populated with a wealth of different monsters These monsters can have varying immunities and attack types In some of them can be quite a bit smarter than others It will be important for new players to learn the abilities of different monsters and learn just how much it will take to kill them This section discusses how monsters can interact with players Most monsters in the game are out to mindlessly kill and destroy the players These monsters will help boost a player s after he kills them When fighting a large amount of monsters in a single attempt to find a narrower hallway so that you are not being attacked from all sides Charging into a room full of Beholders for instance would not be open the door and fight them one at a time For there are several maps designed for them Find these areas and clear them out All throughout these a player can find signs and books which they can read by stepping onto them and hitting A to apply the book sign These messages will help the player to learn the system One more always keep an eye on your food If your food drops to your character will soon so BE CAREFUL ! NPCs Non Player Character are special monsters which have intelligence Players may be able to interact with these monsters to help solve puzzles and find items of interest To speak with a monster you suspect to be a simply move to an adjacent square to them and push the double ie Enter your message
Definition: survival-guide.txt:34
spell
with a maximum of six This is not so if you are wearing plate you receive no benefit Armour is additive with all the supplementry forms of which means that it lasts until the next semi permanent spell effect is cast upon the character spell
Definition: tome-of-magic.txt:44
cf_object_get_double_property
double cf_object_get_double_property(object *op, int propcode)
Definition: plugin_common.cpp:432
title
Information on one title.
Definition: readable.cpp:108
cf_map_message
void cf_map_message(mapstruct *m, const char *msg, int color)
Partial wrapper for ext_info_map().
Definition: plugin_common.cpp:667
archetype
The archetype structure is a set of rules on how to generate and manipulate objects which point to ar...
Definition: object.h:483
cf_map_get_reset_timeout
int cf_map_get_reset_timeout(mapstruct *map)
Definition: plugin_common.cpp:1388
cf_object_get_flag
int cf_object_get_flag(object *ob, int flag)
Definition: plugin_common.cpp:1277
cf_object_drop
void cf_object_drop(object *op, object *author)
Definition: plugin_common.cpp:1043
cf_map_get_enter_x
int cf_map_get_enter_x(mapstruct *map)
Definition: plugin_common.cpp:1408
cf_map_get_map_property
mapstruct * cf_map_get_map_property(mapstruct *map, int propcode)
Definition: plugin_common.cpp:279
cf_object_transfer
int cf_object_transfer(object *op, int x, int y, int randomly, object *originator)
Wrapper for transfer_ob().
Definition: plugin_common.cpp:618
weight
TIPS on SURVIVING Crossfire is populated with a wealth of different monsters These monsters can have varying immunities and attack types In some of them can be quite a bit smarter than others It will be important for new players to learn the abilities of different monsters and learn just how much it will take to kill them This section discusses how monsters can interact with players Most monsters in the game are out to mindlessly kill and destroy the players These monsters will help boost a player s after he kills them When fighting a large amount of monsters in a single attempt to find a narrower hallway so that you are not being attacked from all sides Charging into a room full of Beholders for instance would not be open the door and fight them one at a time For there are several maps designed for them Find these areas and clear them out All throughout these a player can find signs and books which they can read by stepping onto them and hitting A to apply the book sign These messages will help the player to learn the system One more always keep an eye on your food If your food drops to your character will soon so BE CAREFUL ! NPCs Non Player Character are special monsters which have intelligence Players may be able to interact with these monsters to help solve puzzles and find items of interest To speak with a monster you suspect to be a simply move to an adjacent square to them and push the double ie Enter your and press< Return > You can also use say if you feel like typing a little extra Other NPCs may not speak to but display intelligence with their movement Some monsters can be and may attack the nearest of your enemies Others can be in that they follow you around and help you in your quest to kill enemies and find treasure SPECIAL ITEMS There are many special items which can be found in of these the most important may be the signs all a player must do is apply the handle In the case of the player must move items over the button to hold it down Some of the larger buttons may need very large items to be moved onto before they can be activated Gates and locked but be for you could fall down into a pit full of ghosts or dragons and not be able to get back out Break away sometimes it may be worth a player s time to test the walls of a map for secret doors Fire such as missile weapons and spells you will notice them going up in smoke ! So be careful not to destroy valuable items Spellbooks sometimes a player can learn the other times they cannot There are many different types of books and scrolls out there Improve item have lower weight
Definition: survival-guide.txt:100
cf_object_set_movetype_property
void cf_object_set_movetype_property(object *op, int propcode, MoveType value)
Definition: plugin_common.cpp:350
cf_map_get_flags
int cf_map_get_flags(mapstruct *oldmap, mapstruct **newmap, int16_t x, int16_t y, int16_t *nx, int16_t *ny)
Wrapper for get_map_flags().
Definition: plugin_common.cpp:1461
cf_free_string
void cf_free_string(sstring str)
Wrapper for free_string().
Definition: plugin_common.cpp:1182
cf_region_get_message
const char * cf_region_get_message(region *reg)
Get message of region.
Definition: plugin_common.cpp:1958
cf_random_map_set_variable
int cf_random_map_set_variable(RMParms *rp, const char *buf)
Wrapper for set_random_map_variable().
Definition: plugin_common.cpp:1473
cf_object_present_archname_inside
object * cf_object_present_archname_inside(object *op, char *whatstr)
Kinda wrapper for arch_present_in_ob().
Definition: plugin_common.cpp:579
cf_object_find_by_name
object * cf_object_find_by_name(const object *who, const char *name)
Wrapper for object_find_by_name().
Definition: plugin_common.cpp:605
cf_region_get_jail_x
int cf_region_get_jail_x(region *reg)
Get region's jail x coordinate.
Definition: plugin_common.cpp:1974
cf_object_get_archetype_property
archetype * cf_object_get_archetype_property(object *op, int propcode)
Definition: plugin_common.cpp:416
cf_player_get_marked_item
object * cf_player_get_marked_item(object *op)
Definition: plugin_common.cpp:857
cf_system_register_command_extra
command_registration cf_system_register_command_extra(const char *name, const char *extra, command_function_extra func, uint8_t command_type, float time)
Definition: plugin_common.cpp:2103
cf_map_set_string_property
void cf_map_set_string_property(mapstruct *map, int propcode, const char *value)
Definition: plugin_common.cpp:305
cf_object_insert_in_ob
object * cf_object_insert_in_ob(object *op, object *where)
Wrapper for object_insert_in_ob().
Definition: plugin_common.cpp:1298
cf_object_user_event
int cf_object_user_event(object *op, object *activator, object *third, const char *message, int fix)
Definition: plugin_common.cpp:262
cf_object_move
int cf_object_move(object *op, int dir, object *originator)
Definition: plugin_common.cpp:531
region
This is a game region.
Definition: map.h:274
cf_system_get_object_vector
void cf_system_get_object_vector(int property, std::vector< object * > *list)
Definition: plugin_common.cpp:2116
cf_object_split
object * cf_object_split(object *orig_ob, uint32_t nr, char *err, size_t size)
Wrapper for object_split().
Definition: plugin_common.cpp:697
cf_system_register_global_event
void cf_system_register_global_event(int event, const char *name, f_plug_event hook)
Definition: plugin_common.cpp:1102
cf_system_register_command
command_registration cf_system_register_command(const char *name, command_function func, uint8_t command_type, float time)
Definition: plugin_common.cpp:2095
cf_player_set_party
void cf_player_set_party(object *op, partylist *party)
Definition: plugin_common.cpp:876
cf_find_animation
int cf_find_animation(const char *txt)
Wrapper for find_animation().
Definition: plugin_common.cpp:1498
cf_object_set_weight
void cf_object_set_weight(object *ob, int weight)
Definition: plugin_common.cpp:1227
cf_archetype_get_next
archetype * cf_archetype_get_next(archetype *arch)
Get next archetype in linked list.
Definition: plugin_common.cpp:1719
cf_get_periodofday_name
const char * cf_get_periodofday_name(int index)
Definition: plugin_common.cpp:1583
cf_map_trigger_connected
void cf_map_trigger_connected(objectlink *ol, object *cause, int state)
Wrapper for trigger_connected().
Definition: plugin_common.cpp:1028
mapstruct
This is a game-map.
Definition: map.h:315
cf_object_set_flag
void cf_object_set_flag(object *ob, int flag, int value)
Definition: plugin_common.cpp:1288
cf_system_get_map_vector
void cf_system_get_map_vector(int property, std::vector< mapstruct * > *list)
Definition: plugin_common.cpp:2122
f_plug_event
int(* f_plug_event)(int *type,...)
Function to call to handle global or object-related events.
Definition: events.h:82
sstring
const typedef char * sstring
Definition: sstring.h:2
cf_region_get_name
const char * cf_region_get_name(region *reg)
Get name of region.
Definition: plugin_common.cpp:1894
cf_object_set_nrof
int cf_object_set_nrof(object *, int nrof)
Definition: plugin_common.cpp:1260
cf_map_has_been_loaded
mapstruct * cf_map_has_been_loaded(const char *name)
Wrapper for has_been_loaded().
Definition: plugin_common.cpp:961
cf_re_cmp
const char * cf_re_cmp(const char *str, const char *regexp)
Wrapper for re_cmp().
Definition: plugin_common.cpp:1143
cf_object_check_trigger
int cf_object_check_trigger(object *op, object *cause)
Wrapper for check_trigger().
Definition: plugin_common.cpp:1016
cf_quest_get_player_state
int cf_quest_get_player_state(object *pl, sstring quest_code)
Wrapper for quest_get_player_state().
Definition: plugin_common.cpp:2051
cf_object_set_long_property
void cf_object_set_long_property(object *op, int propcode, long value)
Definition: plugin_common.cpp:390
buffer
if you malloc the data for the buffer
Definition: protocol.txt:2106
cf_create_object
object * cf_create_object(void)
Wrapper for object_new().
Definition: plugin_common.cpp:1081
cf_get_maps_directory
char * cf_get_maps_directory(const char *name, char *buf, int size)
Wrapper for create_pathname().
Definition: plugin_common.cpp:1069
cf_object_get_key
const char * cf_object_get_key(object *op, const char *keyname)
Gets value for specified key, equivalent of object_get_value().
Definition: plugin_common.cpp:1637
level
int level
Definition: readable.cpp:1563
cf_system_get_archetype_vector
void cf_system_get_archetype_vector(int property, std::vector< archetype * > *list)
Definition: plugin_common.cpp:2128
cf_player_find
player * cf_player_find(const char *plname)
Wrapper for find_player_partial_name().
Definition: plugin_common.cpp:825
cf_friendlylist_get_next
object * cf_friendlylist_get_next(object *ob)
Get next object on friendly list.
Definition: plugin_common.cpp:2036
cf_party_get_password
const char * cf_party_get_password(partylist *party)
Get party's password.
Definition: plugin_common.cpp:1830
cf_player_get_title
char * cf_player_get_title(object *op, char *title, int size)
Definition: plugin_common.cpp:834
cf_system_unregister_command
void cf_system_unregister_command(command_registration command)
Definition: plugin_common.cpp:2111
cf_archetype_get_head
archetype * cf_archetype_get_head(archetype *arch)
Get head of archetype.
Definition: plugin_common.cpp:1751
command_function_extra
void(* command_function_extra)(object *op, const char *params, const char *extra)
One command function, with a custom parameter specified at registration time.
Definition: commands.h:29
cf_map_get_difficulty
int cf_map_get_difficulty(mapstruct *map)
Definition: plugin_common.cpp:1380
cf_party_get_next_player
player * cf_party_get_next_player(partylist *party, player *op)
Get next player in party.
Definition: plugin_common.cpp:1864
cf_object_set_face
int cf_object_set_face(object *op, const char *face)
Set the object's face.
Definition: plugin_common.cpp:474
command_registration
uint64_t command_registration
Identifier when registering a command.
Definition: commands.h:32
cf_map_get_darkness
int cf_map_get_darkness(mapstruct *map)
Definition: plugin_common.cpp:1396
cf_player_message
void cf_player_message(object *op, const char *txt, int flags)
Definition: plugin_common.cpp:787
cf_map_get_map
mapstruct * cf_map_get_map(const char *name, int flags)
Wrapper for ready_map_name().
Definition: plugin_common.cpp:935
cf_object_change_map
object * cf_object_change_map(object *op, mapstruct *m, object *originator, int flag, int x, int y)
Wrapper for object_insert_in_map_at().
Definition: plugin_common.cpp:642
cf_random_map_generate
mapstruct * cf_random_map_generate(const char *OutFileName, RMParms *RP, char **use_layout, sstring reset_group)
Wrapper for generate_random_map().
Definition: plugin_common.cpp:1485
cf_object_forget_spell
void cf_object_forget_spell(object *op, object *sp)
Wrapper for do_forget_spell(), except takes an object, not a string.
Definition: plugin_common.cpp:768
cf_object_pay_item
int cf_object_pay_item(object *op, object *pl)
Wrapper for pay_for_item().
Definition: plugin_common.cpp:720
cf_object_get_weight_limit
int cf_object_get_weight_limit(object *ob)
Definition: plugin_common.cpp:1249
cf_system_get_party_vector
void cf_system_get_party_vector(int property, std::vector< partylist * > *list)
Definition: plugin_common.cpp:2134
cf_object_insert_object
object * cf_object_insert_object(object *op, object *container)
Definition: plugin_common.cpp:1056
cf_object_get_resistance
int16_t cf_object_get_resistance(object *op, int rtype)
Definition: plugin_common.cpp:313
cf_object_set_int_property
void cf_object_set_int_property(object *op, int propcode, int value)
Definition: plugin_common.cpp:329
list
How to Install a Crossfire Server on you must install a python script engine on your computer Python is the default script engine of Crossfire You can find the python engine you have only to install them The VisualC Crossfire settings are for but you habe then to change the pathes in the VC settings Go in Settings C and Settings Link and change the optional include and libs path to the new python installation path o except the maps ! You must download a map package and install them the share folder Its must look like doubleclick on crossfire32 dsw There are projects in your libcross lib and plugin_python You need to compile all Easiest way is to select the plugin_python ReleaseLog as active this will compile all others too Then in Visual C press< F7 > to compile If you don t have an appropriate compiler you can try to get the the VC copies the crossfire32 exe in the crossfire folder and the plugin_python dll in the crossfire share plugins folder we will remove it when we get time for it o Last showing lots of weird write to the Crossfire mailing list
Definition: INSTALL_WIN32.txt:50
LogLevel
LogLevel
Log levels for the LOG() function.
Definition: logger.h:10
cf_object_update
void cf_object_update(object *op, int flags)
Definition: plugin_common.cpp:1428
cf_friendlylist_get_first
object * cf_friendlylist_get_first(void)
Get first object on friendly list.
Definition: plugin_common.cpp:2020
cf_object_remove
void cf_object_remove(object *op)
Wrapper for object_remove().
Definition: plugin_common.cpp:562
command_function
void(* command_function)(object *op, const char *params)
One command function.
Definition: commands.h:17
cf_object_change_exp
void cf_object_change_exp(object *op, int64_t exp, const char *skill_name, int flag)
Wrapper for change_exp().
Definition: plugin_common.cpp:504
cf_player_get_ip
sstring cf_player_get_ip(object *op)
Definition: plugin_common.cpp:848
cf_object_set_object_property
void cf_object_set_object_property(object *op, int propcode, object *value)
Definition: plugin_common.cpp:493
cf_map_find_by_archetype_name
object * cf_map_find_by_archetype_name(const char *str, mapstruct *map, int nx, int ny)
Kinda wrapper for map_find_by_archetype_name().
Definition: plugin_common.cpp:1371
cf_object_learn_spell
void cf_object_learn_spell(object *op, object *spell, int special_prayer)
Wrapper for do_learn_spell().
Definition: plugin_common.cpp:756
cf_map_get_width
int cf_map_get_width(mapstruct *map)
Definition: plugin_common.cpp:1400
cf_object_get_int_property
int cf_object_get_int_property(object *op, int propcode)
Definition: plugin_common.cpp:335
cf_quest_was_completed
int cf_quest_was_completed(object *pl, sstring quest_code)
Wrapper for quest_was_completed().
Definition: plugin_common.cpp:2086
cf_object_get_float_property
float cf_object_get_float_property(object *op, int propcode)
Definition: plugin_common.cpp:408
cf_map_change_light
int cf_map_change_light(mapstruct *m, int change)
Wrapper for change_map_light().
Definition: plugin_common.cpp:1420
cf_get_time
void cf_get_time(timeofday_t *tod)
Definition: plugin_common.cpp:1549
cf_object_set_resistance
void cf_object_set_resistance(object *op, int rtype, int16_t value)
Definition: plugin_common.cpp:321
cf_object_remove_depletion
int cf_object_remove_depletion(object *op, int level)
Wrapper for remove_depletion().
Definition: plugin_common.cpp:798
face
in that case they will be relative to whatever the PWD of the crossfire server process is You probably shouldn though Notes on Specific and settings file datadir Usually usr share crossfire Contains data that the server does not need to modify while such as the etc A default install will pack the and treasurelist definitions into a single or trs file and the graphics into a face(metadata) and .tar(bitmaps) file