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); \ 1143 const char *
cf_re_cmp(
const char *str,
const char *regexp) {
1529 va_start(ap, format);
1531 vsprintf(buf, format, ap);
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
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
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)
#define CFAPI_OBJECT_PROP_ANIMATION
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
static f_plug_api cfapiObject_set_key
#define CFAPI_PLAYER_PROP_TITLE
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
#define CFAPI_REGION_PROP_MESSAGE
#define CFAPI_MAP_PROP_FLAGS
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
int cf_region_get_jail_x(region *reg)
Get region's jail x coordinate.
#define CFAPI_OBJECT_PROP_WEIGHT
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
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's name.
static f_plug_api cfapiObject_pay_item
#define CFAPI_MAP_PROP_DIFFICULTY
#define CFAPI_MAP_PROP_HEIGHT
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)
void cf_object_set_weight_limit(object *ob, int weight_limit)
#define CFAPI_REGION_PROP_JAIL_X
#define CFAPI_ARCH_PROP_MORE
void(* command_function)(object *op, const char *params)
One command function.
void cf_get_time(timeofday_t *tod)
#define CFAPI_OBJECT_PROP_FLAGS
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 *>
#define CFAPI_OBJECT_PROP_NAME_PLURAL
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.
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
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.
#define CFAPI_MAP_PROP_RESET_TIMEOUT
static f_plug_api cfapiSystem_get_month_name
#define CFAPI_PLAYER_QUEST_START
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
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
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 GET_HOOK(x, y, z)
void cf_object_say(object *op, const char *msg)
#define CFAPI_REGION_PROP_JAIL_PATH
#define FLAG_REMOVED
Object is not in any map or invenory.
#define CFAPI_MAP_VECTOR
Pointer to a std::vector<mapstruct *>
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
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_REGION_VECTOR
Pointer to a std::vector<region *>
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().
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
void cf_quest_start(object *pl, sstring quest_code, int state)
Wrapper for quest_start().
void cf_object_drop(object *op, object *author)
int cf_object_set_animation(object *op, const char *animation)
Set the object's animation.
region * cf_region_get_next(region *reg)
Get next region in region list.
#define CFAPI_PLAYER_PROP_IP
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
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...
void cf_object_set_movetype_property(object *op, int propcode, MoveType value)
static f_plug_api cfapiPlayer_quest
static f_plug_api cfapiObject_out_of_map
#define CFAPI_MAP_PROP_RESET_TIME
int cf_map_get_reset_timeout(mapstruct *map)
#define CFAPI_ARCH_PROP_HEAD
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.
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.
static f_plug_api cfapiObject_cast
#define CFAPI_ARCH_PROP_NEXT
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.
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 *>
int cf_object_transfer(object *op, int x, int y, int randomly, object *originator)
Wrapper for transfer_ob().
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'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().
Used to link together several objects.
int cf_map_get_height(mapstruct *map)
static f_plug_api cfapiObject_forget_spell
#define CFAPI_OBJECT_PROP_WEIGHT_LIMIT
#define CFAPI_PLAYER_QUEST_SET_STATE
int64_t cf_object_perm_exp(object *op)
Wrapper for PERM_EXP macro.
archetype * cf_archetype_get_more(archetype *arch)
Get next part of archetype.
void cf_object_set_long_property(object *op, int propcode, long value)
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
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
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
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
#define CFAPI_PLAYER_PROP_PARTY
LogLevel
Log levels for the LOG() function.
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.
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
region * cf_region_get_first(void)
Get first region in region list.
int cf_region_get_jail_y(region *reg)
Get region's jail y coordinate.
archetype * cf_object_get_archetype_property(object *op, int propcode)
#define CFAPI_ARCH_PROP_NAME
static f_plug_api cfapiPlayer_can_pay
static f_plug_api cfapiObject_change_abil
static event_registration m
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.
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'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 *>
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
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
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
static f_plug_api cfapiFriendlylist_get_next
#define CFAPI_PARTY_PROP_NEXT
static f_plug_api cfapiObject_apply
static f_plug_api cfapiObject_change_exp
#define CFAPI_OBJECT_PROP_NROF
static f_plug_api cfapiObject_get_property
#define CFAPI_ARCH_PROP_CLONE
static f_plug_api cfapiSystem_get_object_vector
static f_plug_api cfapiObject_reset
#define CFAPI_PLAYER_PROP_MARKED_ITEM
command_registration cf_system_register_command(const char *name, command_function func, uint8_t command_type, float time)
static f_plug_api cfapiObject_query_money
#define CFAPI_OBJECT_PROP_RESIST
static f_plug_api cfapiGenerate_random_map
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
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
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.
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
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
static f_plug_api cfapiParty_get_property
static f_plug_api cfapiMap_create_path
object * cf_identify(object *op)
Wrapper for identify().