Crossfire Server  1.75.0
plugin_common.cpp
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 /* The CPICP are the various functions of the server that can be used by all */
7 /* plugins. It is recommended that plugins do not call the server-provided */
8 /* functions directly, but instead use the wrappers provided here by the */
9 /* CPICP interface. By doing so, various validity checks can be performed */
10 /* by CPICP, protecting the server from potential nasty effects of passing */
11 /* it wrong parameter values. */
12 /*****************************************************************************/
13 /* That code is placed under the GNU General Public Licence (GPL) */
14 /* (C)2001-2005 by Chachkoff Yann (Feel free to deliver your complaints) */
15 /*****************************************************************************/
16 /* CrossFire, A Multiplayer game for X-windows */
17 /* */
18 /* Copyright (C) 2000 Mark Wedel */
19 /* Copyright (C) 1992 Frank Tore Johansen */
20 /* */
21 /* This program is free software; you can redistribute it and/or modify */
22 /* it under the terms of the GNU General Public License as published by */
23 /* the Free Software Foundation; either version 2 of the License, or */
24 /* (at your option) any later version. */
25 /* */
26 /* This program is distributed in the hope that it will be useful, */
27 /* but WITHOUT ANY WARRANTY; without even the implied warranty of */
28 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
29 /* GNU General Public License for more details. */
30 /* */
31 /* You should have received a copy of the GNU General Public License */
32 /* along with this program; if not, write to the Free Software */
33 /* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
34 /* */
35 /*****************************************************************************/
36 
37 #include <assert.h>
38 #include <string.h>
39 
40 #include "plugin_common.h"
41 
56 
137 
138 #define GET_HOOK(x, y, z) { \
139  getHooks(&z, 1, y, &x); \
140  if (z != CFAPI_FUNC) { \
141  printf("unable to find hook %s!\n", y); \
142  return 0; \
143  } \
144 }
145 
146 int cf_init_plugin(f_plug_api getHooks) {
147  int z;
148 
149  GET_HOOK(cfapiSystem_strdup_local, "cfapi_system_strdup_local", z);
150  GET_HOOK(cfapiSystem_add_string, "cfapi_system_add_string", z);
151  GET_HOOK(cfapiSystem_register_global_event, "cfapi_system_register_global_event", z);
152  GET_HOOK(cfapiSystem_remove_string, "cfapi_system_remove_string", z);
153  GET_HOOK(cfapiSystem_directory, "cfapi_system_directory", z);
154  GET_HOOK(cfapiSystem_unregister_global_event, "cfapi_system_unregister_global_event", z);
155  GET_HOOK(cfapiSystem_find_animation, "cfapi_system_find_animation", z);
156  GET_HOOK(cfapiSystem_find_face, "cfapi_system_find_face", z);
157  GET_HOOK(cfapiSystem_re_cmp, "cfapi_system_re_cmp", z);
158  GET_HOOK(cfapiObject_get_property, "cfapi_object_get_property", z);
159  GET_HOOK(cfapiObject_set_property, "cfapi_object_set_property", z);
160  GET_HOOK(cfapiObject_apply, "cfapi_object_apply", z);
161  GET_HOOK(cfapiObject_identify, "cfapi_object_identify", z);
162  GET_HOOK(cfapiObject_describe, "cfapi_object_describe", z);
163  GET_HOOK(cfapiObject_drain, "cfapi_object_drain", z);
164  GET_HOOK(cfapiObject_fix, "cfapi_object_fix", z);
165  GET_HOOK(cfapiObject_give_skill, "cfapi_object_give_skill", z);
166  GET_HOOK(cfapiObject_transmute, "cfapi_object_transmute", z);
167  GET_HOOK(cfapiObject_remove, "cfapi_object_remove", z);
168  GET_HOOK(cfapiObject_delete, "cfapi_object_delete", z);
169  GET_HOOK(cfapiObject_clone, "cfapi_object_clone", z);
170  GET_HOOK(cfapiObject_create, "cfapi_object_create", z);
171  GET_HOOK(cfapiObject_insert, "cfapi_object_insert", z);
172  GET_HOOK(cfapiObject_split, "cfapi_object_split", z);
173  GET_HOOK(cfapiObject_merge, "cfapi_object_merge", z);
174  GET_HOOK(cfapiObject_distance, "cfapi_object_distance", z);
175  GET_HOOK(cfapiObject_update, "cfapi_object_update", z);
176  GET_HOOK(cfapiObject_clear, "cfapi_object_clear", z);
177  GET_HOOK(cfapiObject_reset, "cfapi_object_reset", z);
178  GET_HOOK(cfapiObject_activate_rune, "cfapi_object_spring_trap", z);
179  GET_HOOK(cfapiObject_check_trigger, "cfapi_object_check_trigger", z);
180  GET_HOOK(cfapiObject_query_money, "cfapi_object_query_money", z);
181  GET_HOOK(cfapiObject_cast, "cfapi_object_cast", z);
182  GET_HOOK(cfapiObject_learn_spell, "cfapi_object_learn_spell", z);
183  GET_HOOK(cfapiObject_forget_spell, "cfapi_object_forget_spell", z);
184  GET_HOOK(cfapiObject_check_spell, "cfapi_object_check_spell", z);
185  GET_HOOK(cfapiObject_pay_amount, "cfapi_object_pay_amount", z);
186  GET_HOOK(cfapiObject_pay_item, "cfapi_object_pay_item", z);
187  GET_HOOK(cfapiObject_transfer, "cfapi_object_transfer", z);
188  GET_HOOK(cfapiObject_find_archetype_inside, "cfapi_object_find_archetype_inside", z);
189  GET_HOOK(cfapiObject_remove, "cfapi_object_remove", z);
190  GET_HOOK(cfapiObject_delete, "cfapi_object_delete", z);
191  GET_HOOK(cfapiObject_out_of_map, "cfapi_map_out_of_map", z);
192  GET_HOOK(cfapiObject_drop, "cfapi_object_drop", z);
193  GET_HOOK(cfapiObject_change_abil, "cfapi_object_change_abil", z);
194  GET_HOOK(cfapiObject_say, "cfapi_object_say", z);
195  GET_HOOK(cfapiMap_create_path, "cfapi_map_create_path", z);
196  GET_HOOK(cfapiMap_get_property, "cfapi_map_get_property", z);
197  GET_HOOK(cfapiMap_set_property, "cfapi_map_set_property", z);
198  GET_HOOK(cfapiMap_get_map, "cfapi_map_get_map", z);
199  GET_HOOK(cfapiMap_message, "cfapi_map_message", z);
200  GET_HOOK(cfapiMap_get_object_at, "cfapi_map_get_object_at", z);
201  GET_HOOK(cfapiMap_find_by_archetype_name, "cfapi_map_find_by_archetype_name", z);
202  GET_HOOK(cfapiMap_change_light, "cfapi_map_change_light", z);
203  GET_HOOK(cfapiMap_has_been_loaded, "cfapi_map_has_been_loaded", z);
204  GET_HOOK(cfapiMap_trigger_connected, "cfapi_map_trigger_connected", z);
205  GET_HOOK(cfapiPlayer_find, "cfapi_player_find", z);
206  GET_HOOK(cfapiPlayer_message, "cfapi_player_message", z);
207  GET_HOOK(cfapiObject_teleport, "cfapi_object_teleport", z);
208  GET_HOOK(cfapiObject_pickup, "cfapi_object_pickup", z);
209  GET_HOOK(cfapiObject_get_key, "cfapi_object_get_key", z);
210  GET_HOOK(cfapiObject_set_key, "cfapi_object_set_key", z);
211  GET_HOOK(cfapiObject_move, "cfapi_object_move", z);
212  GET_HOOK(cfapiObject_apply_below, "cfapi_object_apply_below", z);
213  GET_HOOK(cfapiArchetype_get_property, "cfapi_archetype_get_property", z);
214  GET_HOOK(cfapiParty_get_property, "cfapi_party_get_property", z);
215  GET_HOOK(cfapiRegion_get_property, "cfapi_region_get_property", z);
216  GET_HOOK(cfapiPlayer_can_pay, "cfapi_player_can_pay", z);
217  GET_HOOK(cfapiSystem_log, "cfapi_log", z);
218  GET_HOOK(cfapiSystem_get_time, "cfapi_system_get_time", z);
219  GET_HOOK(cfapiSystem_timer_create, "cfapi_system_timer_create", z);
220  GET_HOOK(cfapiSystem_timer_destroy, "cfapi_system_timer_destroy", z);
221  GET_HOOK(cfapiFriendlylist_get_next, "cfapi_friendlylist_get_next", z);
222  GET_HOOK(cfapiSet_random_map_variable, "cfapi_set_random_map_variable", z);
223  GET_HOOK(cfapiGenerate_random_map, "cfapi_generate_random_map", z);
224  GET_HOOK(cfapiObject_change_exp, "cfapi_object_change_exp", z);
225  GET_HOOK(cfapiSystem_get_season_name, "cfapi_system_get_season_name", z);
226  GET_HOOK(cfapiSystem_get_month_name, "cfapi_system_get_month_name", z);
227  GET_HOOK(cfapiSystem_get_weekday_name, "cfapi_system_get_weekday_name", z);
228  GET_HOOK(cfapiSystem_get_periodofday_name, "cfapi_system_get_periodofday_name", z);
229  GET_HOOK(cfapiObject_user_event, "cfapi_object_user_event", z);
230  GET_HOOK(cfapiSystem_find_string, "cfapi_system_find_string", z);
231  GET_HOOK(cfapiCost_string_from_value, "cfapi_cost_string_from_value", z);
232  GET_HOOK(cfapiPlayer_quest, "cfapi_player_quest", z);
233  GET_HOOK(cfapiObject_remove_depletion, "cfapi_object_remove_depletion", z);
234  GET_HOOK(cfapiObject_find_by_arch_name, "cfapi_object_find_by_arch_name", z);
235  GET_HOOK(cfapiObject_find_by_name, "cfapi_object_find_by_name", z);
236  GET_HOOK(cfapiPlayer_knowledge, "cfapi_player_knowledge", z);
237  GET_HOOK(cfapiObject_perm_exp, "cfapi_object_perm_exp", z);
238  GET_HOOK(cfapiSystem_register_command, "cfapi_register_command", z);
239  GET_HOOK(cfapiSystem_unregister_command, "cfapi_unregister_command", z);
240  GET_HOOK(cfapiSystem_get_object_vector, "cfapi_get_object_vector", z);
241  GET_HOOK(cfapiSystem_get_map_vector, "cfapi_get_map_vector", z);
242  GET_HOOK(cfapiSystem_get_archetype_vector, "cfapi_get_archetype_vector", z);
243  GET_HOOK(cfapiSystem_get_party_vector, "cfapi_get_party_vector", z);
244  GET_HOOK(cfapiSystem_get_region_vector, "cfapi_get_region_vector", z);
245  return 1;
246 }
247 
248 /* Should get replaced by tons of more explicit wrappers */
249 /*void *cf_map_get_property(mapstruct *map, int propcode) {
250  int type;
251  return cfapiMap_get_property(&type, propcode, map);
252 }*/
253 
254 int cf_map_get_int_property(mapstruct *map, int property) {
255  int type, value;
256 
257  cfapiMap_get_property(&type, map, property, &value);
258  assert(type == CFAPI_INT);
259  return value;
260 }
261 
262 int cf_object_user_event(object *op, object *activator, object *third, const char *message, int fix) {
263  int type, value;
264 
265  cfapiObject_user_event(&type, op, activator, third, message, fix, &value);
266  assert(type == CFAPI_INT);
267  return value;
268 }
269 
271  int type;
272  sstring value;
273 
274  cfapiMap_get_property(&type, map, propcode, &value);
275  assert(type == CFAPI_SSTRING);
276  return value;
277 }
278 
280  int type;
281  mapstruct *value;
282 
283  cfapiMap_get_property(&type, map, propcode, &value);
284  assert(type == CFAPI_PMAP);
285  return value;
286 }
287 
289  int type;
290  region *value;
291 
292  cfapiMap_get_property(&type, map, propcode, &value);
293  assert(type == CFAPI_PREGION);
294  return value;
295 }
296 
297 /* Should get replaced by tons of more explicit wrappers */
298 void cf_map_set_int_property(mapstruct *map, int propcode, int value) {
299  int type;
300 
301  cfapiMap_set_property(&type, map, propcode, value);
302  assert(type == CFAPI_INT);
303 }
304 
305 void cf_map_set_string_property(mapstruct *map, int propcode, const char *value) {
306  int type;
307 
308  cfapiMap_set_property(&type, map, propcode, value);
309  assert(type == CFAPI_STRING);
310 }
311 
312 /* Should get replaced by tons of more explicit wrappers */
313 int16_t cf_object_get_resistance(object *op, int rtype) {
314  int type;
315  int16_t resist;
316 
317  cfapiObject_get_property(&type, op, CFAPI_OBJECT_PROP_RESIST, rtype, &resist);
318  assert(type == CFAPI_INT16);
319  return resist;
320 }
321 void cf_object_set_resistance(object *op, int rtype, int16_t value) {
322  int type;
323 
324  cfapiObject_set_property(&type, op, CFAPI_OBJECT_PROP_RESIST, rtype, value);
325  assert(type == CFAPI_INT16);
326 }
327 
328 /* Should get replaced by tons of more explicit wrappers */
329 void cf_object_set_int_property(object *op, int propcode, int value) {
330  int type;
331 
332  cfapiObject_set_property(&type, op, propcode, value);
333  assert(type == CFAPI_INT);
334 }
335 int cf_object_get_int_property(object *op, int propcode) {
336  int type, value;
337 
338  cfapiObject_get_property(&type, op, propcode, &value);
339  assert(type == CFAPI_INT);
340  return value;
341 }
342 long cf_object_get_long_property(object *op, long propcode) {
343  int type;
344  long value;
345 
346  cfapiObject_get_property(&type, op, propcode, &value);
347  assert(type == CFAPI_LONG);
348  return value;
349 }
350 void cf_object_set_movetype_property(object *op, int propcode, MoveType value) {
351  int type;
352 
353  /* note: MoveType can't be used through va_arg, so use MoveType * */
354  cfapiObject_set_property(&type, op, propcode, &value);
355  assert(type == CFAPI_MOVETYPE);
356 }
357 MoveType cf_object_get_movetype_property(object *op, int propcode) {
358  int type;
359  MoveType value;
360 
361  cfapiObject_get_property(&type, op, propcode, &value);
362  assert(type == CFAPI_MOVETYPE);
363  return value;
364 }
365 object *cf_object_get_object_property(object *op, int propcode) {
366  int type;
367  object *value;
368 
369  cfapiObject_get_property(&type, op, propcode, &value);
370  assert(type == CFAPI_POBJECT);
371  return value;
372 }
373 mapstruct *cf_object_get_map_property(object *op, int propcode) {
374  int type;
375  mapstruct *value;
376 
377  cfapiObject_get_property(&type, op, propcode, &value);
378  assert(type == CFAPI_PMAP);
379  return value;
380 }
381 int64_t cf_object_get_int64_property(object *op, int propcode) {
382  int type;
383  int64_t value;
384 
385  cfapiObject_get_property(&type, op, propcode, &value);
386  assert(type == CFAPI_SINT64);
387  return value;
388 }
389 /* Should get replaced by tons of more explicit wrappers */
390 void cf_object_set_long_property(object *op, int propcode, long value) {
391  int type;
392 
393  cfapiObject_set_property(&type, op, propcode, value);
394  assert(type == CFAPI_LONG);
395 }
396 void cf_object_set_float_property(object *op, int propcode, float value) {
397  int type;
398 
399  cfapiObject_set_property(&type, op, propcode, value);
400  assert(type == CFAPI_FLOAT);
401 }
402 void cf_object_set_int64_property(object *op, int propcode, int64_t value) {
403  int type;
404 
405  cfapiObject_set_property(&type, op, propcode, value);
406  assert(type == CFAPI_SINT64);
407 }
408 float cf_object_get_float_property(object *op, int propcode) {
409  int type;
410  float value;
411 
412  cfapiObject_get_property(&type, op, propcode, &value);
413  assert(type == CFAPI_FLOAT);
414  return value;
415 }
416 archetype *cf_object_get_archetype_property(object *op, int propcode) {
417  int type;
418  archetype *value;
419 
420  cfapiObject_get_property(&type, op, propcode, &value);
421  assert(type == CFAPI_PARCH);
422  return value;
423 }
424 partylist *cf_object_get_partylist_property(object *op, int propcode) {
425  int type;
426  partylist *value;
427 
428  cfapiObject_get_property(&type, op, propcode, &value);
429  assert(type == CFAPI_PPARTY);
430  return value;
431 }
432 double cf_object_get_double_property(object *op, int propcode) {
433  int type;
434  double value;
435 
436  cfapiObject_get_property(&type, op, propcode, &value);
437  assert(type == CFAPI_DOUBLE);
438  return value;
439 }
440 sstring cf_object_get_sstring_property(object *op, int propcode) {
441  int type;
442  sstring value;
443 
444  cfapiObject_get_property(&type, op, propcode, &value);
445  assert(type == CFAPI_SSTRING);
446  return value;
447 }
448 char *cf_object_get_string_property(object *op, int propcode, char *buf, int size) {
449  int type;
450 
451  cfapiObject_get_property(&type, op, propcode, buf, size);
452  assert(type == CFAPI_STRING);
453  return buf;
454 }
455 /* Should get replaced by tons of more explicit wrappers */
456 void cf_object_set_string_property(object *op, int propcode, const char *value) {
457  int type;
458 
459  /* use cf_object_set_face() for changing the face! */
460  assert(propcode != CFAPI_OBJECT_PROP_FACE);
461  /* use cf_object_set_animation() to change the animation */
462  assert(propcode != CFAPI_OBJECT_PROP_ANIMATION);
463 
464  cfapiObject_set_property(&type, op, propcode, value);
465  assert(type == CFAPI_STRING);
466 }
467 
474 int cf_object_set_face(object *op, const char *face) {
475  int type, ret;
476  cfapiObject_set_property(&type, op, CFAPI_OBJECT_PROP_FACE, face, &ret);
477  assert(type == CFAPI_INT);
478  return ret;
479 }
486 int cf_object_set_animation(object *op, const char *animation) {
487  int type, ret;
488  cfapiObject_set_property(&type, op, CFAPI_OBJECT_PROP_ANIMATION, animation, &ret);
489  assert(type == CFAPI_INT);
490  return ret;
491 }
492 
493 void cf_object_set_object_property(object *op, int propcode, object *value) {
494  int type;
495 
496  cfapiObject_set_property(&type, op, propcode, value);
497  assert(type == CFAPI_POBJECT);
498 }
499 
504 void cf_object_change_exp(object *op, int64_t exp, const char *skill_name, int flag) {
505  int type;
506 
507  cfapiObject_change_exp(&type, op, exp, skill_name && strlen(skill_name) > 0 ? skill_name : NULL, flag);
508  assert(type == CFAPI_NONE);
509 }
510 
515 int64_t cf_object_perm_exp(object *op) {
516  int type;
517  int64_t ret;
518 
519  cfapiObject_perm_exp(&type, op, &ret);
520  assert(type == CFAPI_SINT64);
521  return ret;
522 }
523 
524 int cf_player_move(player *pl, int dir) {
525  int type, ret;
526 
527  cfapiObject_move(&type, 1, pl, dir, &ret);
528  assert(type == CFAPI_INT);
529  return ret;
530 }
531 int cf_object_move(object *op, int dir, object*originator) {
532  int type, ret;
533 
534  cfapiObject_move(&type, 0, op, dir, originator, &ret);
535  assert(type == CFAPI_INT);
536  return ret;
537 }
542 int cf_object_apply(object *op, object *tmp, int aflag) {
543  int type, ret;
544 
545  cfapiObject_apply(&type, op, tmp, aflag, &ret);
546  return ret;
547 }
548 
553 void cf_object_apply_below(object *pl) {
554  int type;
555 
556  cfapiObject_apply_below(&type, pl);
557 }
562 void cf_object_remove(object *op) {
563  int type;
564 
565  cfapiObject_remove(&type, op);
566 }
572  int type;
573 
574  cfapiObject_delete(&type, ob);
575 }
579 object *cf_object_present_archname_inside(object *op, char *whatstr) {
580  int type;
581  object *value;
582 
583  cfapiObject_find_archetype_inside(&type, op, whatstr, &value);
584  assert(type == CFAPI_POBJECT);
585  return value;
586 }
587 
592 object *cf_object_find_by_arch_name(const object *who, const char *name) {
593  int type;
594  object *result;
595 
596  cfapiObject_find_by_arch_name(&type, who, name, &result);
597  assert(type == CFAPI_POBJECT);
598  return result;
599 }
600 
605 object *cf_object_find_by_name(const object *who, const char *name) {
606  int type;
607  object *result;
608 
609  cfapiObject_find_by_name(&type, who, name, &result);
610  assert(type == CFAPI_POBJECT);
611  return result;
612 }
613 
618 int cf_object_transfer(object *op, int x, int y, int randomly, object *originator) {
619  int type, value;
620 
621  cfapiObject_transfer(&type, op, 0, x, y, randomly, originator, &value);
622  assert(type == CFAPI_INT);
623  return value;
624 }
625 
630 int cf_object_move_to(object *op, int x, int y) {
631  int type, value;
632 
633  cfapiObject_transfer(&type, op, 2, x, y, &value);
634  assert(type == CFAPI_INT);
635  return value;
636 }
637 
642 object *cf_object_change_map(object *op, mapstruct *m, object *originator, int flag, int x, int y) {
643  int type;
644  object *value;
645 
646  cfapiObject_transfer(&type, op, 1, m, originator, flag, x, y, &value);
647  assert(type == CFAPI_POBJECT);
648  return value;
649 }
650 
655 object *cf_map_get_object_at(mapstruct *m, int x, int y) {
656  int type;
657  object *value;
658 
659  cfapiMap_get_object_at(&type, m, x, y, &value);
660  assert(type == CFAPI_POBJECT);
661  return value;
662 }
667 void cf_map_message(mapstruct *m, const char *msg, int color) {
668  int type;
669 
670  cfapiMap_message(&type, m, msg, color);
671 }
672 
683 object *cf_object_clone(object *op, int clonetype) {
684  int type;
685  object *value;
686 
687  cfapiObject_clone(&type, op, clonetype, &value);
688  assert(type == CFAPI_POBJECT);
689  return value;
690 }
691 
692 
697 object *cf_object_split(object *orig_ob, uint32_t nr, char *err, size_t size) {
698  int type;
699  object *value;
700 
701  cfapiObject_split(&type, orig_ob, nr, err, size, &value);
702 
703  if (value == NULL)
704  {
705  assert(type == CFAPI_NONE);
706  }
707  else
708  {
709  assert(type == CFAPI_POBJECT);
710  }
711 
712  return value;
713 }
714 
715 
720 int cf_object_pay_item(object *op, object *pl) {
721  int type, value;
722 
723  cfapiObject_pay_item(&type, op, pl, &value);
724  assert(type == CFAPI_INT);
725  return value;
726 }
727 
732 int cf_object_pay_amount(object *pl, uint64_t to_pay) {
733  int type, value;
734 
735  cfapiObject_pay_amount(&type, pl, to_pay, &value);
736  assert(type == CFAPI_INT);
737  return value;
738 }
739 
744 int cf_object_cast_spell(object *op, object *caster, int dir, object *spell_ob, char *stringarg) {
745  int type, value;
746 
747  cfapiObject_cast(&type, op, caster, dir, spell_ob, stringarg, &value);
748  assert(type == CFAPI_INT);
749  return value;
750 }
751 
756 void cf_object_learn_spell(object *op, object *spell, int special_prayer) {
757  int type;
758 
759  cfapiObject_learn_spell(&type, op, spell, special_prayer);
760  assert(type == CFAPI_NONE);
761 }
762 
768 void cf_object_forget_spell(object *op, object *sp) {
769  int type;
770 
771  cfapiObject_forget_spell(&type, op, sp);
772 }
773 
778 object *cf_object_check_for_spell(object *op, const char *name) {
779  int type;
780  object *value;
781 
782  cfapiObject_check_spell(&type, op, name, &value);
783  assert(type == CFAPI_POBJECT);
784  return value;
785 }
786 
787 void cf_player_message(object *op, const char *txt, int flags) {
788  int type;
789 
790  cfapiPlayer_message(&type, flags, 0, op, txt);
791  assert(type == CFAPI_NONE);
792 }
793 
798 int cf_object_remove_depletion(object *op, int level) {
799  int type, result;
800 
801  cfapiObject_remove_depletion(&type, op, level, &result);
802  assert(type == CFAPI_INT);
803  return result;
804 }
805 
812 object *cf_identify(object *op) {
813  int type;
814  object *result;
815 
816  cfapiObject_identify(&type, op, &result);
817  assert(type == CFAPI_POBJECT);
818  return result;
819 }
820 
825 player *cf_player_find(const char *plname) {
826  int type;
827  player *value;
828 
829  cfapiPlayer_find(&type, plname, &value);
830  assert(type == CFAPI_PPLAYER);
831  return value;
832 }
833 
834 char *cf_player_get_title(object *op, char *title, int size) {
835  int type;
836 
837  cfapiObject_get_property(&type, op, CFAPI_PLAYER_PROP_TITLE, title, size);
838  assert(type == CFAPI_STRING);
839  return title;
840 }
841 
842 void cf_player_set_title(object *op, const char *title) {
843  int type;
844 
846 }
847 
849  int type;
850  sstring value;
851 
853  assert(type == CFAPI_SSTRING);
854  return value;
855 }
856 
857 object *cf_player_get_marked_item(object *op) {
858  int type;
859  object *value;
860 
862  assert(type == CFAPI_POBJECT);
863  return value;
864 }
865 
866 void cf_player_set_marked_item(object *op, object *ob) {
867  int type;
868 
870 }
871 
874 }
875 
876 void cf_player_set_party(object *op, partylist *party) {
877  int type;
878 
880 }
881 
886 int cf_player_can_pay(object *pl) {
887  int type, value;
888 
889  cfapiPlayer_can_pay(&type, pl, &value);
890  assert(type == CFAPI_INT);
891  return value;
892 }
893 
900 int cf_player_knowledge_has(object *op, const char *knowledge) {
901  int type, value;
902 
903  cfapiPlayer_knowledge(&type, 1, op, knowledge, &value);
904  assert(type == CFAPI_INT);
905  return value;
906 }
907 
913 void cf_player_knowledge_give(object *op, const char *knowledge) {
914  int type;
915 
916  cfapiPlayer_knowledge(&type, 2, op, knowledge);
917  assert(type == CFAPI_NONE);
918 }
919 
924 int cf_player_arrest(object *who) {
925  int type, value;
926  cfapiObject_move(&type, 2, who, &value);
927  assert(type == CFAPI_INT);
928  return value;
929 }
930 
935 mapstruct *cf_map_get_map(const char *name, int flags) {
936  int type;
937  mapstruct *ret;
938 
939  cfapiMap_get_map(&type, 1, name, flags, &ret);
940  assert(type == CFAPI_PMAP);
941  return ret;
942 }
943 
948 mapstruct *cf_get_empty_map(int sizex, int sizey) {
949  int type;
950  mapstruct *ret;
951 
952  cfapiMap_get_map(&type, 0, sizex, sizey, &ret);
953  assert(type == CFAPI_PMAP);
954  return ret;
955 }
956 
961 mapstruct *cf_map_has_been_loaded(const char *name) {
962  int type;
963  mapstruct *ret;
964 
965  cfapiMap_has_been_loaded(&type, name, &ret);
966  assert(type == CFAPI_PMAP);
967  return ret;
968 }
969 
977 }
978 
983 int cf_object_query_money(const object *op) {
984  int type, value;
985 
986  cfapiObject_query_money(&type, op, &value);
987  assert(type == CFAPI_INT);
988  return value;
989 }
990 
994 void cf_cost_string_from_value(uint64_t cost, int largest_coin, char *buffer, int length) {
995  int type;
996 
997  cfapiCost_string_from_value(&type, cost, largest_coin, buffer, length);
998  assert(type == CFAPI_NONE);
999 }
1000 
1005 void cf_spring_trap(object *trap, object *victim) {
1006  int type;
1007 
1008  if (trap)
1009  cfapiObject_activate_rune(&type, trap, victim);
1010 }
1011 
1016 int cf_object_check_trigger(object *op, object *cause) {
1017  int type, value;
1018 
1019  cfapiObject_check_trigger(&type, op, cause, &value);
1020  assert(type == CFAPI_INT);
1021  return value;
1022 }
1023 
1028 void cf_map_trigger_connected(objectlink *ol, object *cause, int state) {
1029  int type;
1030 
1031  cfapiMap_trigger_connected(&type, ol, cause, state);
1032  assert(type == CFAPI_NONE);
1033 }
1034 
1035 int cf_object_out_of_map(object *op, int x, int y) {
1036  int type, value;
1037 
1038  cfapiObject_out_of_map(&type, op->map, x, y, &value);
1039  assert(type == CFAPI_INT);
1040  return value;
1041 }
1042 
1043 void cf_object_drop(object *op, object *author) {
1044  int type;
1045 
1046  cfapiObject_drop(&type, op, author);
1047 }
1048 
1049 void cf_object_say(object *op, const char *msg) {
1050  int type, value;
1051 
1052  cfapiObject_say(&type, op, msg, &value);
1053  assert(type == CFAPI_INT);
1054 }
1055 
1056 object *cf_object_insert_object(object *op, object *container) {
1057  int type;
1058  object *value;
1059 
1060  cfapiObject_insert(&type, op, 3, container, &value);
1061  assert(type == CFAPI_POBJECT);
1062  return value;
1063 }
1064 
1069 char *cf_get_maps_directory(const char *name, char *buf, int size) {
1070  int type;
1071 
1072  cfapiMap_create_path(&type, 0, name, buf, size);
1073  assert(type == CFAPI_STRING);
1074  return buf;
1075 }
1076 
1081 object *cf_create_object(void) {
1082  int type;
1083  object *value;
1084 
1085  cfapiObject_create(&type, 0, &value);
1086  assert(type == CFAPI_POBJECT);
1087  return value;
1088 }
1089 
1093 object *cf_create_object_by_name(const char *name) {
1094  int type;
1095  object *value;
1096 
1097  cfapiObject_create(&type, 1, name, &value);
1098  assert(type == CFAPI_POBJECT);
1099  return value;
1100 }
1101 
1102 void cf_system_register_global_event(int event, const char *name, f_plug_event hook) {
1103  int type;
1104 
1105  cfapiSystem_register_global_event(&type, event, name, hook);
1106  assert(type == CFAPI_NONE);
1107 }
1108 
1109 void cf_system_unregister_global_event(int event, const char *name) {
1110  int type;
1111 
1112  cfapiSystem_unregister_global_event(&type, event, name);
1113  assert(type == CFAPI_NONE);
1114 }
1115 
1130 const char *cf_get_directory(int id) {
1131  int type;
1132  const char *ret;
1133 
1134  cfapiSystem_directory(&type, id, &ret);
1135  assert(type == CFAPI_STRING);
1136  return ret;
1137 }
1138 
1143 const char *cf_re_cmp(const char *str, const char *regexp) {
1144  int type;
1145  const char *result;
1146 
1147  cfapiSystem_re_cmp(&type, str, regexp, &result);
1148  assert(type == CFAPI_STRING);
1149  return result;
1150 }
1151 
1156 void cf_fix_object(object *op) {
1157  int type;
1158 
1159  if (op)
1160  cfapiObject_fix(&type, op);
1161 }
1162 
1167 sstring cf_add_string(const char *str) {
1168  int type;
1169  sstring ret;
1170 
1171  if (!str)
1172  return NULL;
1173  cfapiSystem_add_string(&type, str, &ret);
1174  assert(type == CFAPI_SSTRING);
1175  return ret;
1176 }
1177 
1183  int type;
1184 
1185  if (str)
1186  cfapiSystem_remove_string(&type, str);
1187 }
1188 
1189 sstring cf_find_string(const char *str) {
1190  int type;
1191  sstring ret;
1192 
1193  if (!str)
1194  return NULL;
1195 
1196  cfapiSystem_find_string(&type, str, &ret);
1197  assert(type == CFAPI_SSTRING);
1198  return ret;
1199 }
1200 
1201 char *cf_query_name(object *ob, char *name, int size) {
1202  int type;
1203 
1204  cfapiObject_get_property(&type, ob, CFAPI_OBJECT_PROP_NAME, name, size);
1205  assert(type == CFAPI_STRING);
1206  return name;
1207 }
1208 
1210  int type;
1211  sstring value;
1212 
1214  assert(type == CFAPI_SSTRING);
1215  return value;
1216 }
1217 
1219  int type;
1220  sstring value;
1221 
1223  assert(type == CFAPI_SSTRING);
1224  return value;
1225 }
1226 
1227 void cf_object_set_weight(object *ob, int weight) {
1228  int type;
1229 
1231  assert(type == CFAPI_INT);
1232 }
1233 
1234 void cf_object_set_weight_limit(object *ob, int weight_limit) {
1235  int type;
1236 
1237  cfapiObject_set_property(&type, ob, CFAPI_OBJECT_PROP_WEIGHT_LIMIT, weight_limit);
1238  assert(type == CFAPI_INT);
1239 }
1240 
1241 int cf_object_get_weight(object *ob) {
1242  int type, weight;
1243 
1245  assert(type == CFAPI_INT);
1246  return weight;
1247 }
1248 
1250  int type, limit;
1251 
1253  assert(type == CFAPI_INT);
1254  return limit;
1255 }
1256 
1260 int cf_object_set_nrof(object *ob, int nrof) {
1261  int type;
1262 
1263  if (nrof < 0)
1264  return -1;
1265 
1267  return 0;
1268 }
1269 
1270 int cf_object_get_nrof(object *ob) {
1271  int type, nrof;
1272 
1274  return nrof;
1275 }
1276 
1277 int cf_object_get_flag(object *ob, int flag) {
1278  int type;
1279  int rv;
1280 
1281  cfapiObject_get_property(&type, ob, CFAPI_OBJECT_PROP_FLAGS, flag, &rv);
1282  if (rv != 0)
1283  return 1;
1284  else
1285  return 0;
1286 }
1287 
1288 void cf_object_set_flag(object *ob, int flag, int value) {
1289  int type;
1290 
1291  cfapiObject_set_property(&type, ob, CFAPI_OBJECT_PROP_FLAGS, flag, value ? 1 : 0);
1292 }
1293 
1298 object *cf_object_insert_in_ob(object *op, object *where) {
1299  int type;
1300  object *value;
1301 
1302  if (!cf_object_get_flag(op, FLAG_REMOVED)) {
1303  cfapiObject_remove(&type, op);
1304  }
1305 
1306  cfapiObject_insert(&type, op, 3, where, &value);
1307  assert(type == CFAPI_POBJECT);
1308  return value;
1309 }
1310 
1315 object *cf_map_insert_object_there(object *op, mapstruct *m, object *originator, int flag) {
1316  int type;
1317  object *value;
1318 
1319  cfapiObject_insert(&type, op, 1, m, originator, flag, &value);
1320  assert(type == CFAPI_POBJECT);
1321  return value;
1322 }
1323 
1329 object *cf_map_insert_object(mapstruct *where, object *op, int x, int y) {
1330  int type;
1331  object *value;
1332 
1333  cfapiObject_insert(&type, op, 0, where, NULL, 0 , x, y, &value);
1334  assert(type == CFAPI_POBJECT);
1335  return value;
1336 }
1337 
1351 object *cf_map_insert_object_around(mapstruct *where, object *op, int x, int y) {
1352  int type;
1353  object *value;
1354 
1355  cfapiObject_insert(&type, op, 2, where, NULL, 0 , x, y, &value);
1356  assert(type == CFAPI_POBJECT);
1357  return value;
1358 }
1359 
1360 int cf_object_teleport(object *op, mapstruct *map, int x, int y) {
1361  int type, value;
1362 
1363  cfapiObject_teleport(&type, op, map, x, y, &value);
1364  assert(type == CFAPI_INT);
1365  return value;
1366 }
1367 
1371 object *cf_map_find_by_archetype_name(const char *str, mapstruct *map, int nx, int ny) {
1372  int type;
1373  object *value;
1374 
1375  cfapiMap_find_by_archetype_name(&type, str, map, nx, ny, &value);
1376  assert(type == CFAPI_POBJECT);
1377  return value;
1378 }
1379 
1382 }
1383 
1386 }
1387 
1390 }
1391 
1394 }
1395 
1398 }
1399 
1402 }
1403 
1406 }
1407 
1410 }
1411 
1414 }
1415 
1420 int cf_map_change_light(mapstruct *m, int change) {
1421  int type, value;
1422 
1423  cfapiMap_change_light(&type, m, change, &value);
1424  assert(type == CFAPI_INT);
1425  return value;
1426 }
1427 
1428 void cf_object_update(object *op, int flags) {
1429  int type;
1430 
1431  cfapiObject_update(&type, op, flags);
1432 }
1433 
1434 int cf_object_pickup(object *op, object *what) {
1435  int type, value;
1436  cfapiObject_pickup(&type, op, what, &value);
1437  assert(type == CFAPI_INT);
1438  return value;
1439 }
1440 
1446 char *cf_strdup_local(const char *str) {
1447  int type;
1448  char *dup;
1449 
1450  if (str == NULL)
1451  return NULL;
1452  cfapiSystem_strdup_local(&type, str, &dup);
1453  assert(type == CFAPI_STRING);
1454  return dup;
1455 }
1456 
1461 int cf_map_get_flags(mapstruct *oldmap, mapstruct **newmap, int16_t x, int16_t y, int16_t *nx, int16_t *ny) {
1462  int type, value;
1463 
1464  cfapiMap_get_property(&type, oldmap, CFAPI_MAP_PROP_FLAGS, newmap, x, y, nx, ny, &value);
1465  assert(type == CFAPI_INT);
1466  return value;
1467 }
1468 
1473 int cf_random_map_set_variable(RMParms *rp, const char *buf) {
1474  int type, ret;
1475 
1476  cfapiSet_random_map_variable(&type, rp, buf, &ret);
1477  assert(type == CFAPI_INT);
1478  return ret;
1479 }
1480 
1485 mapstruct *cf_random_map_generate(const char *OutFileName, RMParms *RP, char **use_layout, sstring reset_group) {
1486  int type;
1487  mapstruct *map;
1488 
1489  cfapiGenerate_random_map(&type, OutFileName, RP, use_layout, reset_group, &map);
1490  assert(type == CFAPI_PMAP);
1491  return map;
1492 }
1493 
1498 int cf_find_animation(const char *name) {
1499  int type, anim;
1500 
1501  cfapiSystem_find_animation(&type, name, &anim);
1502  assert(type == CFAPI_INT);
1503  return anim;
1504 }
1505 
1510 int cf_find_face(const char *name, int error) {
1511  int type, anim;
1512 
1513  cfapiSystem_find_face(&type, name, error, &anim);
1514  assert(type == CFAPI_INT);
1515  return anim;
1516 }
1517 
1522 void cf_log(LogLevel logLevel, const char *format, ...) {
1523  int type;
1524  /* Copied from common/logger.c */
1525  char buf[20480]; /* This needs to be really really big - larger than any other buffer, since that buffer may
1526  need to be put in this one. */
1527  va_list ap;
1528 
1529  va_start(ap, format);
1530  buf[0] = '\0';
1531  vsprintf(buf, format, ap);
1532  va_end(ap);
1533 
1534  cfapiSystem_log(&type, (int)logLevel, buf);
1535  assert(type == CFAPI_NONE);
1536 }
1537 
1542 void cf_log_plain(LogLevel logLevel, const char *message) {
1543  int type;
1544 
1545  cfapiSystem_log(&type, logLevel, message);
1546  assert(type == CFAPI_NONE);
1547 }
1548 
1550  int type;
1551 
1552  cfapiSystem_get_time(&type, tod);
1553  assert(type == CFAPI_NONE);
1554 }
1555 
1556 const char *cf_get_season_name(int index) {
1557  int type;
1558  char *result;
1559 
1560  cfapiSystem_get_season_name(&type, index, &result);
1561  assert(type == CFAPI_STRING);
1562  return result;
1563 }
1564 
1565 const char *cf_get_month_name(int index) {
1566  int type;
1567  char *result;
1568 
1569  cfapiSystem_get_month_name(&type, index, &result);
1570  assert(type == CFAPI_STRING);
1571  return result;
1572 }
1573 
1574 const char *cf_get_weekday_name(int index) {
1575  int type;
1576  char *result;
1577 
1578  cfapiSystem_get_weekday_name(&type, index, &result);
1579  assert(type == CFAPI_STRING);
1580  return result;
1581 }
1582 
1583 const char *cf_get_periodofday_name(int index) {
1584  int type;
1585  char *result;
1586 
1587  cfapiSystem_get_periodofday_name(&type, index, &result);
1588  assert(type == CFAPI_STRING);
1589  return result;
1590 }
1591 
1604 int cf_timer_create(object *ob, long delay, int mode) {
1605  int type, timer;
1606 
1607  cfapiSystem_timer_create(&type, ob, delay, mode, &timer);
1608  assert(type == CFAPI_INT);
1609  return timer;
1610 }
1611 
1620 int cf_timer_destroy(int id) {
1621  int type, code;
1622 
1623  cfapiSystem_timer_destroy(&type, id, &code);
1624  assert(type == CFAPI_INT);
1625  return code;
1626 }
1627 
1637 const char *cf_object_get_key(object *op, const char *keyname) {
1638  int type;
1639  const char *value;
1640 
1641  cfapiObject_get_key(&type, op, keyname, &value);
1642  assert(type == CFAPI_SSTRING);
1643  return value;
1644 }
1645 
1659 int cf_object_set_key(object *op, const char *keyname, const char *value, int add_key) {
1660  int type, ret;
1661 
1662  cfapiObject_set_key(&type, op, keyname, value, add_key, &ret);
1663  assert(type == CFAPI_INT);
1664  return ret;
1665 }
1666 
1671 int cf_object_change_abil(object *op, object *tmp) {
1672  int type, ret;
1673 
1674  cfapiObject_change_abil(&type, op, tmp, &ret);
1675  assert(type == CFAPI_INT);
1676  return ret;
1677 }
1678 
1679 /* Archetype-related functions */
1680 
1687  int type;
1688  archetype *value;
1689 
1690  cfapiArchetype_get_property(&type, NULL, CFAPI_ARCH_PROP_NEXT, &value);
1691  assert(type == CFAPI_PARCH);
1692  return value;
1693 }
1694 
1703  int type;
1704  sstring name;
1705 
1707  assert(type == CFAPI_SSTRING);
1708  return name;
1709 }
1710 
1720  int type;
1721  archetype *value;
1722 
1723  cfapiArchetype_get_property(&type, arch, CFAPI_ARCH_PROP_NEXT, &value);
1724  assert(type == CFAPI_PARCH);
1725  return value;
1726 }
1727 
1736  int type;
1737  archetype *value;
1738 
1739  cfapiArchetype_get_property(&type, arch, CFAPI_ARCH_PROP_MORE, &value);
1740  assert(type == CFAPI_PARCH);
1741  return value;
1742 }
1743 
1752  int type;
1753  archetype *value;
1754 
1755  cfapiArchetype_get_property(&type, arch, CFAPI_ARCH_PROP_HEAD, &value);
1756  assert(type == CFAPI_PARCH);
1757  return value;
1758 }
1759 
1768  int type;
1769  object *value;
1770 
1771  cfapiArchetype_get_property(&type, arch, CFAPI_ARCH_PROP_CLONE, &value);
1772  assert(type == CFAPI_POBJECT);
1773  return value;
1774 }
1775 
1776 /* Party-related functions */
1777 
1784  int type;
1785  partylist *value;
1786 
1787  cfapiParty_get_property(&type, NULL, CFAPI_PARTY_PROP_NEXT, &value);
1788  assert(type == CFAPI_PPARTY);
1789  return value;
1790 }
1791 
1798 const char *cf_party_get_name(partylist *party) {
1799  int type;
1800  sstring value;
1801 
1802  cfapiParty_get_property(&type, party, CFAPI_PARTY_PROP_NAME, &value);
1803  assert(type == CFAPI_SSTRING);
1804  return value;
1805 }
1806 
1815  int type;
1816  partylist *value;
1817 
1818  cfapiParty_get_property(&type, party, CFAPI_PARTY_PROP_NEXT, &value);
1819  assert(type == CFAPI_PPARTY);
1820  return value;
1821 }
1822 
1830 const char *cf_party_get_password(partylist *party) {
1831  int type;
1832  sstring value;
1833 
1834  cfapiParty_get_property(&type, party, CFAPI_PARTY_PROP_PASSWORD, &value);
1835  assert(type == CFAPI_SSTRING);
1836  return value;
1837 }
1838 
1847  int type;
1848  player *value;
1849 
1850  cfapiParty_get_property(&type, party, CFAPI_PARTY_PROP_PLAYER, NULL, &value);
1851  assert(type == CFAPI_PPLAYER);
1852  return value;
1853 }
1854 
1865  int type;
1866  player *value;
1867 
1868  cfapiParty_get_property(&type, party, CFAPI_PARTY_PROP_PLAYER, op, &value);
1869  assert(type == CFAPI_PPLAYER);
1870  return value;
1871 }
1872 
1879  int type;
1880  region *value;
1881 
1882  cfapiRegion_get_property(&type, NULL, CFAPI_REGION_PROP_NEXT, &value);
1883  assert(type == CFAPI_PREGION);
1884  return value;
1885 }
1886 
1894 const char *cf_region_get_name(region *reg) {
1895  int type;
1896  sstring value;
1897 
1898  cfapiRegion_get_property(&type, reg, CFAPI_REGION_PROP_NAME, &value);
1899  assert(type == CFAPI_SSTRING);
1900  return value;
1901 }
1902 
1911  int type;
1912  region *value;
1913 
1914  cfapiRegion_get_property(&type, reg, CFAPI_REGION_PROP_NEXT, &value);
1915  assert(type == CFAPI_PREGION);
1916  return value;
1917 }
1918 
1927  int type;
1928  region *value;
1929 
1931  assert(type == CFAPI_PREGION);
1932  return value;
1933 }
1934 
1942 const char *cf_region_get_longname(region *reg) {
1943  int type;
1944  sstring value;
1945 
1947  assert(type == CFAPI_SSTRING);
1948  return value;
1949 }
1950 
1958 const char *cf_region_get_message(region *reg) {
1959  int type;
1960  sstring value;
1961 
1963  assert(type == CFAPI_SSTRING);
1964  return value;
1965 }
1966 
1975  int type, value;
1976 
1978  assert(type == CFAPI_INT);
1979  return value;
1980 }
1981 
1990  int type, value;
1991 
1993  assert(type == CFAPI_INT);
1994  return value;
1995 }
1996 
2004 const char *cf_region_get_jail_path(region *reg) {
2005  int type;
2006  sstring value;
2007 
2009  assert(type == CFAPI_SSTRING);
2010  return value;
2011 }
2012 
2013 /* Friendlylist functions. */
2014 
2021  int type;
2022  object *value;
2023 
2024  cfapiFriendlylist_get_next(&type, NULL, &value);
2025  assert(type == CFAPI_POBJECT);
2026  return value;
2027 }
2028 
2036 object *cf_friendlylist_get_next(object *ob) {
2037  int type;
2038  object *value;
2039 
2040  cfapiFriendlylist_get_next(&type, ob, &value);
2041  assert(type == CFAPI_POBJECT);
2042  return value;
2043 }
2044 
2045 /* Quest-related functions */
2046 
2051 int cf_quest_get_player_state(object *pl, sstring quest_code) {
2052  int type, ret;
2053 
2054  cfapiPlayer_quest(&type, CFAPI_PLAYER_QUEST_GET_STATE, pl, quest_code, &ret);
2055  assert(type == CFAPI_INT);
2056 
2057  return ret;
2058 }
2059 
2064 void cf_quest_start(object *pl, sstring quest_code, int state) {
2065  int type;
2066 
2067  cfapiPlayer_quest(&type, CFAPI_PLAYER_QUEST_START, pl, quest_code, state);
2068  assert(type == CFAPI_NONE);
2069 }
2070 
2075 void cf_quest_set_player_state(object *pl, sstring quest_code, int state) {
2076  int type;
2077 
2078  cfapiPlayer_quest(&type, CFAPI_PLAYER_QUEST_SET_STATE, pl, quest_code, state);
2079  assert(type == CFAPI_NONE);
2080 }
2081 
2086 int cf_quest_was_completed(object *pl, sstring quest_code) {
2087  int type, ret;
2088 
2089  cfapiPlayer_quest(&type, CFAPI_PLAYER_QUEST_WAS_COMPLETED, pl, quest_code, &ret);
2090  assert(type == CFAPI_INT);
2091 
2092  return ret;
2093 }
2094 
2095 command_registration cf_system_register_command(const char *name, command_function func, uint8_t command_type, float time) {
2096  int type;
2098  cfapiSystem_register_command(&type, 1, name, func, command_type, time, &cr);
2099  assert(type == CFAPI_SINT64);
2100  return cr;
2101 }
2102 
2103 command_registration cf_system_register_command_extra(const char *name, const char *extra, command_function_extra func, uint8_t command_type, float time) {
2104  int type;
2106  cfapiSystem_register_command(&type, 2, name, extra, func, command_type, time, &cr);
2107  assert(type == CFAPI_SINT64);
2108  return cr;
2109 }
2110 
2112  int type;
2113  cfapiSystem_unregister_command(&type, command);
2114 }
2115 
2116 void cf_system_get_object_vector(int property, std::vector<object *> *list) {
2117  int type;
2118  cfapiSystem_get_object_vector(&type, property, list);
2119  assert(type == CFAPI_OBJECT_VECTOR);
2120 }
2121 
2122 void cf_system_get_map_vector(int property, std::vector<mapstruct *> *list) {
2123  int type;
2124  cfapiSystem_get_map_vector(&type, property, list);
2125  assert(type == CFAPI_MAP_VECTOR);
2126 }
2127 
2128 void cf_system_get_archetype_vector(int property, std::vector<archetype *> *list) {
2129  int type;
2130  cfapiSystem_get_archetype_vector(&type, property, list);
2131  assert(type == CFAPI_ARCHETYPE_VECTOR);
2132 }
2133 
2134 void cf_system_get_party_vector(int property, std::vector<partylist *> *list) {
2135  int type;
2136  cfapiSystem_get_party_vector(&type, property, list);
2137  assert(type == CFAPI_PARTY_VECTOR);
2138 }
2139 
2140 void cf_system_get_region_vector(int property, std::vector<region *> *list) {
2141  int type;
2142  cfapiSystem_get_region_vector(&type, property, list);
2143  assert(type == CFAPI_REGION_VECTOR);
2144 }
partylist * cf_party_get_next(partylist *party)
Get next party in party list.
partylist * cf_party_get_first(void)
Get first party.
void cf_system_unregister_command(command_registration command)
object * cf_object_change_map(object *op, mapstruct *m, object *originator, int flag, int x, int y)
Wrapper for object_insert_in_map_at().
int cf_object_pay_amount(object *pl, uint64_t to_pay)
Wrapper for pay_for_amount().
void cf_object_apply_below(object *pl)
Wrapper for apply_by_living_below().
sstring cf_map_get_sstring_property(mapstruct *map, int propcode)
object * cf_object_check_for_spell(object *op, const char *name)
Wrapper for check_spell_known().
static f_plug_api cfapiMap_has_been_loaded
static f_plug_api cfapiSystem_register_global_event
void cf_map_set_string_property(mapstruct *map, int propcode, const char *value)
#define CFAPI_PLAYER_QUEST_GET_STATE
Definition: plugin.h:242
int cf_object_teleport(object *op, mapstruct *map, int x, int y)
void cf_spring_trap(object *trap, object *victim)
Wrapper for spring_trap().
#define CFAPI_PARTY_PROP_PASSWORD
Definition: plugin.h:273
player * cf_party_get_next_player(partylist *party, player *op)
Get next player in party.
int cf_object_move(object *op, int dir, object *originator)
void cf_object_set_object_property(object *op, int propcode, object *value)
Random map parameters.
Definition: random_map.h:14
#define CFAPI_OBJECT_PROP_ANIMATION
Definition: plugin.h:218
static f_plug_api cfapiObject_apply_below
void cf_object_set_flag(object *ob, int flag, int value)
char * cf_get_maps_directory(const char *name, char *buf, int size)
Wrapper for create_pathname().
int cf_map_get_int_property(mapstruct *map, int property)
#define CFAPI_OBJECT_PROP_NAME
Definition: plugin.h:130
static f_plug_api cfapiObject_set_key
#define CFAPI_PREGION
Definition: plugin.h:66
#define CFAPI_PLAYER_PROP_TITLE
Definition: plugin.h:237
static f_plug_api cfapiCost_string_from_value
static f_plug_api cfapiObject_merge
int16_t cf_object_get_resistance(object *op, int rtype)
static f_plug_api cfapiObject_find_by_name
#define CFAPI_MAP_PROP_ENTER_Y
Definition: plugin.h:259
#define CFAPI_REGION_PROP_MESSAGE
Definition: plugin.h:280
#define CFAPI_MAP_PROP_FLAGS
Definition: plugin.h:246
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...
#define CFAPI_MAP_PROP_DARKNESS
Definition: plugin.h:255
int cf_region_get_jail_x(region *reg)
Get region&#39;s jail x coordinate.
#define CFAPI_OBJECT_PROP_WEIGHT
Definition: plugin.h:166
static f_plug_api cfapiSystem_find_string
const char * cf_party_get_name(partylist *party)
int cf_quest_was_completed(object *pl, sstring quest_code)
Wrapper for quest_was_completed().
static f_plug_api cfapiObject_find_archetype_inside
int cf_init_plugin(f_plug_api getHooks)
#define CFAPI_OBJECT_PROP_FACE
Definition: plugin.h:217
void cf_map_set_int_property(mapstruct *map, int propcode, int value)
static f_plug_api cfapiObject_say
object * cf_object_present_archname_inside(object *op, char *whatstr)
Kinda wrapper for arch_present_in_ob().
long cf_object_get_long_property(object *op, long propcode)
static f_plug_api cfapiObject_drop
sstring cf_archetype_get_name(archetype *arch)
Get archetype&#39;s name.
static f_plug_api cfapiObject_pay_item
#define CFAPI_MAP_PROP_DIFFICULTY
Definition: plugin.h:247
#define CFAPI_MAP_PROP_HEIGHT
Definition: plugin.h:257
static f_plug_api cfapiObject_give_skill
object * cf_object_get_object_property(object *op, int propcode)
command_registration cf_system_register_command_extra(const char *name, const char *extra, command_function_extra func, uint8_t command_type, float time)
int cf_object_pickup(object *op, object *what)
object * cf_object_insert_object(object *op, object *container)
partylist * cf_object_get_partylist_property(object *op, int propcode)
const char * cf_object_get_key(object *op, const char *keyname)
Gets value for specified key, equivalent of object_get_value().
int64_t cf_object_get_int64_property(object *op, int propcode)
static f_plug_api cfapiSystem_find_animation
static f_plug_api cfapiObject_fix
void cf_system_get_object_vector(int property, std::vector< object *> *list)
static f_plug_api cfapiObject_split
partylist * cf_player_get_party(object *op)
int level
Definition: readable.cpp:1561
void cf_object_set_weight_limit(object *ob, int weight_limit)
#define CFAPI_REGION_PROP_JAIL_X
Definition: plugin.h:281
#define CFAPI_ARCH_PROP_MORE
Definition: plugin.h:268
#define CFAPI_INT16
Definition: plugin.h:67
void(* command_function)(object *op, const char *params)
One command function.
Definition: commands.h:17
void cf_get_time(timeofday_t *tod)
#define CFAPI_OBJECT_PROP_FLAGS
Definition: plugin.h:196
int cf_object_remove_depletion(object *op, int level)
Wrapper for remove_depletion().
archetype * cf_archetype_get_head(archetype *arch)
Get head of archetype.
#define CFAPI_PARTY_VECTOR
Pointer to a std::vector<partylist *>
Definition: plugin.h:76
#define CFAPI_SINT64
Definition: plugin.h:69
#define CFAPI_OBJECT_PROP_NAME_PLURAL
Definition: plugin.h:131
void cf_object_set_int64_property(object *op, int propcode, int64_t value)
void cf_object_set_float_property(object *op, int propcode, float value)
unsigned char MoveType
Typdef here to define type large enough to hold bitmask of all movement types.
Definition: define.h:424
static f_plug_api cfapiSystem_get_time
static f_plug_api cfapiRegion_get_property
static f_plug_api cfapiSystem_get_weekday_name
void cf_player_knowledge_give(object *op, const char *knowledge)
Wrapper for knowledge_give();.
static f_plug_api cfapiMap_find_by_archetype_name
#define CFAPI_OBJECT_PROP_MESSAGE
Definition: plugin.h:136
static f_plug_api cfapiSystem_get_map_vector
int cf_timer_create(object *ob, long delay, int mode)
Creates a timer, equivalent of calling cftimer_create().
Represents the ingame time.
Definition: tod.h:38
#define CFAPI_MAP_PROP_RESET_TIMEOUT
Definition: plugin.h:252
static f_plug_api cfapiSystem_get_month_name
#define CFAPI_PLAYER_QUEST_START
Definition: plugin.h:241
#define CFAPI_DOUBLE
Definition: plugin.h:61
void cf_object_set_string_property(object *op, int propcode, const char *value)
static f_plug_api cfapiObject_transmute
static f_plug_api cfapiObject_drain
#define CFAPI_REGION_PROP_NEXT
Definition: plugin.h:277
int cf_object_get_weight_limit(object *ob)
void cf_object_learn_spell(object *op, object *spell, int special_prayer)
Wrapper for do_learn_spell().
mapstruct * cf_random_map_generate(const char *OutFileName, RMParms *RP, char **use_layout, sstring reset_group)
Wrapper for generate_random_map().
static f_plug_api cfapiObject_update
char * cf_query_name(object *ob, char *name, int size)
MoveType cf_object_get_movetype_property(object *op, int propcode)
#define CFAPI_MAP_PROP_NEXT
Definition: plugin.h:261
int cf_object_pay_item(object *op, object *pl)
Wrapper for pay_for_item().
mapstruct * cf_map_get_map_property(mapstruct *map, int propcode)
void cf_system_unregister_global_event(int event, const char *name)
void cf_system_get_map_vector(int property, std::vector< mapstruct *> *list)
static f_plug_api cfapiSystem_get_archetype_vector
static f_plug_api cfapiObject_identify
static f_plug_api cfapiSystem_register_command
static f_plug_api cfapiMap_get_object_at
static f_plug_api cfapiObject_describe
static f_plug_api cfapiObject_learn_spell
#define CFAPI_PMAP
Definition: plugin.h:59
#define GET_HOOK(x, y, z)
#define CFAPI_POBJECT
Definition: plugin.h:58
void cf_object_say(object *op, const char *msg)
#define CFAPI_REGION_PROP_JAIL_PATH
Definition: plugin.h:283
#define FLAG_REMOVED
Object is not in any map or invenory.
Definition: define.h:219
#define CFAPI_MAP_VECTOR
Pointer to a std::vector<mapstruct *>
Definition: plugin.h:73
int cf_object_check_trigger(object *op, object *cause)
Wrapper for check_trigger().
void cf_fix_object(object *op)
Wrapper for fix_object().
static f_plug_api cfapiObject_clone
#define CFAPI_NONE
Definition: plugin.h:53
static f_plug_api cfapiSystem_log
static f_plug_api cfapiObject_find_by_arch_name
sstring cf_query_name_pl(object *ob)
int cf_object_apply(object *op, object *tmp, int aflag)
Wrapper for apply_manual().
int cf_map_change_light(mapstruct *m, int change)
Wrapper for change_map_light().
sstring cf_add_string(const char *str)
Wrapper for add_string().
#define CFAPI_FLOAT
Definition: plugin.h:60
#define CFAPI_REGION_VECTOR
Pointer to a std::vector<region *>
Definition: plugin.h:75
object * cf_friendlylist_get_next(object *ob)
Get next object on friendly list.
object * cf_map_insert_object_there(object *op, mapstruct *m, object *originator, int flag)
Wrapper for object_insert_in_map().
#define CFAPI_PARCH
Definition: plugin.h:62
int cf_player_can_pay(object *pl)
Wrapper for can_pay().
static f_plug_api cfapiObject_teleport
static f_plug_api cfapiSystem_add_string
#define CFAPI_MAP_PROP_PLAYERS
Definition: plugin.h:253
void cf_quest_start(object *pl, sstring quest_code, int state)
Wrapper for quest_start().
void cf_object_drop(object *op, object *author)
One party.
Definition: party.h:10
int cf_object_set_animation(object *op, const char *animation)
Set the object&#39;s animation.
region * cf_region_get_next(region *reg)
Get next region in region list.
#define CFAPI_PLAYER_PROP_IP
Definition: plugin.h:230
object * cf_map_get_object_at(mapstruct *m, int x, int y)
Wrapper for GET_MAP_OB().
object * cf_create_object(void)
Wrapper for object_new().
#define CFAPI_PARTY_PROP_PLAYER
Definition: plugin.h:274
static f_plug_api cfapiObject_clear
const char * cf_region_get_message(region *reg)
Get message of region.
The archetype structure is a set of rules on how to generate and manipulate objects which point to ar...
Definition: object.h:483
void cf_object_set_movetype_property(object *op, int propcode, MoveType value)
#define CFAPI_STRING
Definition: plugin.h:57
static f_plug_api cfapiPlayer_quest
static f_plug_api cfapiObject_out_of_map
#define CFAPI_MAP_PROP_RESET_TIME
Definition: plugin.h:251
int cf_map_get_reset_timeout(mapstruct *map)
#define CFAPI_ARCH_PROP_HEAD
Definition: plugin.h:267
void cf_object_set_weight(object *ob, int weight)
object * cf_archetype_get_clone(archetype *arch)
Get clone of archetype.
int cf_find_face(const char *name, int error)
Wrapper for find_face().
int cf_find_animation(const char *name)
Wrapper for find_animation().
Information on one title.
Definition: readable.cpp:108
int cf_object_move_to(object *op, int x, int y)
Wrapper for move_to().
int cf_object_user_event(object *op, object *activator, object *third, const char *message, int fix)
void cf_system_register_global_event(int event, const char *name, f_plug_event hook)
static f_plug_api cfapiSystem_get_region_vector
void cf_object_set_resistance(object *op, int rtype, int16_t value)
uint64_t command_registration
Identifier when registering a command.
Definition: commands.h:32
static f_plug_api cfapiObject_cast
#define CFAPI_ARCH_PROP_NEXT
Definition: plugin.h:266
int cf_player_move(player *pl, int dir)
void cf_system_get_party_vector(int property, std::vector< partylist *> *list)
void cf_system_get_region_vector(int property, std::vector< region *> *list)
object * cf_object_split(object *orig_ob, uint32_t nr, char *err, size_t size)
Wrapper for object_split().
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
int cf_object_get_nrof(object *ob)
int cf_object_set_nrof(object *ob, int nrof)
static f_plug_api cfapiObject_transfer
static f_plug_api cfapiMap_set_property
#define CFAPI_ARCHETYPE_VECTOR
Pointer to a std::vector<archetype *>
Definition: plugin.h:74
int cf_object_transfer(object *op, int x, int y, int randomly, object *originator)
Wrapper for transfer_ob().
This is a game-map.
Definition: map.h:320
const char * cf_get_season_name(int index)
void cf_player_set_party(object *op, partylist *party)
const char * cf_party_get_password(partylist *party)
Get party&#39;s password.
const char * cf_re_cmp(const char *str, const char *regexp)
Wrapper for re_cmp().
const char * cf_region_get_longname(region *reg)
Get longname of region.
object * cf_map_insert_object(mapstruct *where, object *op, int x, int y)
Wrapper for object_insert_in_map_at().
mapstruct * cf_get_empty_map(int sizex, int sizey)
Wrapper for get_empty_map().
int cf_map_get_height(mapstruct *map)
static f_plug_api cfapiObject_forget_spell
#define CFAPI_OBJECT_PROP_WEIGHT_LIMIT
Definition: plugin.h:167
#define CFAPI_PLAYER_QUEST_SET_STATE
Definition: plugin.h:243
int64_t cf_object_perm_exp(object *op)
Wrapper for PERM_EXP macro.
#define CFAPI_LONG
Definition: plugin.h:55
archetype * cf_archetype_get_more(archetype *arch)
Get next part of archetype.
void cf_object_set_long_property(object *op, int propcode, long value)
#define CFAPI_SSTRING
Definition: plugin.h:70
void cf_object_change_exp(object *op, int64_t exp, const char *skill_name, int flag)
Wrapper for change_exp().
static f_plug_api cfapiPlayer_find
#define CFAPI_PPLAYER
Definition: plugin.h:64
void cf_map_message(mapstruct *m, const char *msg, int color)
Partial wrapper for ext_info_map().
const char * cf_get_weekday_name(int index)
static f_plug_api cfapiMap_change_light
char * cf_object_get_string_property(object *op, int propcode, char *buf, int size)
int cf_random_map_set_variable(RMParms *rp, const char *buf)
Wrapper for set_random_map_variable().
region * cf_map_get_region_property(mapstruct *map, int propcode)
static f_plug_api cfapiPlayer_message
#define CFAPI_REGION_PROP_JAIL_Y
Definition: plugin.h:282
int cf_object_cast_spell(object *op, object *caster, int dir, object *spell_ob, char *stringarg)
Wrapper for cast_spell().
float cf_object_get_float_property(object *op, int propcode)
static f_plug_api cfapiSystem_find_face
void cf_object_remove(object *op)
Wrapper for object_remove().
static f_plug_api cfapiObject_create
static f_plug_api cfapiMap_message
static f_plug_api cfapiObject_activate_rune
int cf_map_get_difficulty(mapstruct *map)
#define CFAPI_REGION_PROP_LONGNAME
Definition: plugin.h:279
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().
#define CFAPI_PARTY_PROP_NAME
Definition: plugin.h:271
#define CFAPI_PLAYER_PROP_PARTY
Definition: plugin.h:232
LogLevel
Log levels for the LOG() function.
Definition: logger.h:10
static f_plug_api cfapiPlayer_knowledge
object * cf_object_find_by_arch_name(const object *who, const char *name)
Wrapper for object_find_by_arch_name().
static f_plug_api cfapiObject_perm_exp
mapstruct * cf_map_has_been_loaded(const char *name)
Wrapper for has_been_loaded().
void cf_player_set_marked_item(object *op, object *ob)
static f_plug_api cfapiMap_get_map
int cf_map_get_players(mapstruct *map)
struct mapstruct * map
Pointer to the map in which this object is present.
Definition: object.h:305
region * cf_region_get_parent(region *reg)
Get parent of region.
void cf_free_string(sstring str)
Wrapper for free_string().
sstring cf_object_get_sstring_property(object *op, int propcode)
static f_plug_api cfapiObject_remove
static f_plug_api cfapiSystem_timer_destroy
void cf_system_get_archetype_vector(int property, std::vector< archetype *> *list)
mapstruct * cf_map_get_map(const char *name, int flags)
Wrapper for ready_map_name().
const char * cf_get_periodofday_name(int index)
object * cf_object_clone(object *op, int clonetype)
Clone an object.
static f_plug_api cfapiObject_user_event
static f_plug_api cfapiObject_set_property
double cf_object_get_double_property(object *op, int propcode)
sstring cf_player_get_ip(object *op)
static const flag_definition flags[]
Flag mapping.
int cf_object_change_abil(object *op, object *tmp)
Wrapper for change_abil().
static f_plug_api cfapiSystem_remove_string
static f_plug_api cfapiMap_trigger_connected
void cf_player_message(object *op, const char *txt, int flags)
static f_plug_api cfapiObject_check_trigger
char * cf_strdup_local(const char *str)
Wrapper for strdup_local().
int cf_object_out_of_map(object *op, int x, int y)
char * cf_player_get_title(object *op, char *title, int size)
object * cf_player_get_marked_item(object *op)
const char * cf_get_directory(int id)
Gets a directory Crossfire uses.
static f_plug_api cfapiObject_insert
#define CFAPI_REGION_PROP_PARENT
Definition: plugin.h:278
region * cf_region_get_first(void)
Get first region in region list.
#define CFAPI_INT
Definition: plugin.h:54
int cf_region_get_jail_y(region *reg)
Get region&#39;s jail y coordinate.
archetype * cf_object_get_archetype_property(object *op, int propcode)
#define CFAPI_ARCH_PROP_NAME
Definition: plugin.h:265
static f_plug_api cfapiPlayer_can_pay
static f_plug_api cfapiObject_change_abil
static event_registration m
Definition: citylife.cpp:424
static f_plug_api cfapiObject_distance
archetype * cf_archetype_get_first(void)
Get first archetype.
static f_plug_api cfapiObject_delete
object * cf_object_insert_in_ob(object *op, object *where)
Wrapper for object_insert_in_ob().
const char * cf_region_get_jail_path(region *reg)
Get jail path of region.
int cf_map_get_darkness(mapstruct *map)
int(* f_plug_event)(int *type,...)
Function to call to handle global or object-related events.
Definition: events.h:82
static f_plug_api cfapiSet_random_map_variable
int cf_quest_get_player_state(object *pl, sstring quest_code)
Wrapper for quest_get_player_state().
static f_plug_api cfapiObject_move
int cf_player_knowledge_has(object *op, const char *knowledge)
Wrapper for knowledge_player_has().
int cf_object_get_flag(object *ob, int flag)
void cf_log_plain(LogLevel logLevel, const char *message)
Wrapper for LOG() that uses directly a buffer, without format.
int cf_object_set_face(object *op, const char *face)
Set the object&#39;s face.
static f_plug_api cfapiSystem_unregister_global_event
void cf_object_update(object *op, int flags)
int cf_map_get_enter_x(mapstruct *map)
void cf_object_set_int_property(object *op, int propcode, int value)
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.
void cf_object_forget_spell(object *op, object *sp)
Wrapper for do_forget_spell(), except takes an object, not a string.
void cf_player_set_title(object *op, const char *title)
static f_plug_api cfapiObject_pickup
static f_plug_api cfapiObject_get_key
#define CFAPI_OBJECT_VECTOR
Pointer to a std::vector<object *>
Definition: plugin.h:72
player * cf_player_find(const char *plname)
Wrapper for find_player_partial_name().
int cf_map_get_reset_time(mapstruct *map)
static f_plug_api cfapiMap_get_property
#define CFAPI_MOVETYPE
Definition: plugin.h:71
object * cf_object_find_by_name(const object *who, const char *name)
Wrapper for object_find_by_name().
static f_plug_api cfapiSystem_timer_create
sstring cf_object_get_msg(object *ob)
object * cf_create_object_by_name(const char *name)
Wrapper for create_archetype() and create_archetype_by_object_name().
static f_plug_api cfapiObject_check_spell
static f_plug_api cfapiSystem_re_cmp
static f_plug_api cfapiSystem_directory
#define CFAPI_MAP_PROP_WIDTH
Definition: plugin.h:256
object * cf_map_find_by_archetype_name(const char *str, mapstruct *map, int nx, int ny)
Kinda wrapper for map_find_by_archetype_name().
player * cf_party_get_first_player(partylist *party)
Get first player in party.
int cf_object_query_money(const object *op)
Wrapper for query_money().
const char * cf_get_month_name(int index)
void cf_quest_set_player_state(object *pl, sstring quest_code, int state)
Wrapper for quest_set_player_state();.
#define CFAPI_PLAYER_QUEST_WAS_COMPLETED
Definition: plugin.h:244
static f_plug_api cfapiFriendlylist_get_next
#define CFAPI_PARTY_PROP_NEXT
Definition: plugin.h:272
static f_plug_api cfapiObject_apply
static f_plug_api cfapiObject_change_exp
#define CFAPI_OBJECT_PROP_NROF
Definition: plugin.h:142
static f_plug_api cfapiObject_get_property
#define CFAPI_ARCH_PROP_CLONE
Definition: plugin.h:269
static f_plug_api cfapiSystem_get_object_vector
static f_plug_api cfapiObject_reset
#define CFAPI_PLAYER_PROP_MARKED_ITEM
Definition: plugin.h:231
One player.
Definition: player.h:107
command_registration cf_system_register_command(const char *name, command_function func, uint8_t command_type, float time)
StringBuffer * buf
Definition: readable.cpp:1563
static f_plug_api cfapiObject_query_money
#define CFAPI_OBJECT_PROP_RESIST
Definition: plugin.h:148
static f_plug_api cfapiGenerate_random_map
const char * sstring
Definition: sstring.h:2
static f_plug_api cfapiSystem_unregister_command
object * cf_friendlylist_get_first(void)
Get first object on friendly list.
static f_plug_api cfapiSystem_get_party_vector
int cf_object_get_weight(object *ob)
static f_plug_api cfapiObject_pay_amount
This is a game region.
Definition: map.h:279
const char * cf_region_get_name(region *reg)
Get name of region.
static f_plug_api cfapiSystem_get_season_name
mapstruct * cf_object_get_map_property(object *op, int propcode)
mapstruct * cf_map_get_first(void)
Gives access to first_map.
int cf_map_get_enter_y(mapstruct *map)
#define CFAPI_MAP_PROP_ENTER_X
Definition: plugin.h:258
void cf_object_free_drop_inventory(object *ob)
Wrapper for object_free_drop_inventory().
static f_plug_api cfapiObject_remove_depletion
int cf_player_arrest(object *who)
Wrapper for player_arrest().
int cf_timer_destroy(int id)
Destroys specified timer, equivalent of calling cftimer_destroy().
int cf_object_get_int_property(object *op, int propcode)
static f_plug_api cfapiSystem_get_periodofday_name
void cf_map_trigger_connected(objectlink *ol, object *cause, int state)
Wrapper for trigger_connected().
void(* f_plug_api)(int *type,...)
General API function.
Definition: plugin.h:79
void cf_log(LogLevel logLevel, const char *format,...)
Wrapper for LOG().
static f_plug_api cfapiArchetype_get_property
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().
#define CFAPI_REGION_PROP_NAME
Definition: plugin.h:276
sstring cf_find_string(const char *str)
int cf_map_get_width(mapstruct *map)
archetype * cf_archetype_get_next(archetype *arch)
Get next archetype in linked list.
static f_plug_api cfapiSystem_strdup_local
#define CFAPI_PPARTY
Definition: plugin.h:65
static f_plug_api cfapiParty_get_property
static f_plug_api cfapiMap_create_path
object * cf_identify(object *op)
Wrapper for identify().