 |
Crossfire Server, Trunk
1.75.0
|
Go to the documentation of this file.
29 #ifndef PLUGIN_COMMON_H
30 #define PLUGIN_COMMON_H
33 #define CF_PLUGIN __declspec(dllexport)
35 #ifdef HAVE_VISIBILITY
36 #define CF_PLUGIN __attribute__((visibility("default")))
44 #define PLUGIN_ERROR_INT 0x0FFFFF
67 extern const char *
cf_re_cmp(
const char *str,
const char *regexp);
116 extern int cf_object_cast_spell(
object *op,
object *caster,
int dir,
object *spell_ob,
char *stringarg);
123 extern int cf_object_transfer(
object *op,
int x,
int y,
int randomly,
object *originator);
140 extern int cf_object_set_key(
object *op,
const char *keyname,
const char *value,
int add_key);
143 extern int cf_object_move(
object *op,
int dir,
object*originator);
152 extern object *
cf_object_split(
object *orig_ob, uint32_t nr,
char *err,
size_t size);
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.
region * cf_map_get_region_property(mapstruct *map, int propcode)
void cf_log(LogLevel logLevel, const char *format,...)
Wrapper for LOG().
sstring cf_query_name_pl(object *ob)
int cf_map_get_height(mapstruct *map)
object * cf_object_check_for_spell(object *op, const char *name)
Wrapper for check_spell_known().
const char * cf_get_weekday_name(int index)
int cf_region_get_jail_y(region *reg)
Get region's jail y coordinate.
sstring cf_add_string(const char *str)
Wrapper for add_string().
mapstruct * cf_map_get_first(void)
Gives access to first_map.
sstring cf_map_get_sstring_property(mapstruct *map, int propcode)
const char * cf_get_directory(int id)
Gets a directory Crossfire uses.
int cf_object_get_weight(object *ob)
int cf_map_get_int_property(mapstruct *map, int property)
void cf_player_set_marked_item(object *op, object *ob)
int cf_map_get_players(mapstruct *map)
int cf_object_teleport(object *ob, mapstruct *map, int x, int y)
const char * cf_party_get_name(partylist *party)
int cf_object_out_of_map(object *op, int x, int y)
const char * cf_get_season_name(int index)
char * cf_object_get_string_property(object *op, int propcode, char *buf, int size)
long cf_object_get_long_property(object *op, long propcode)
void cf_object_apply_below(object *pl)
Wrapper for apply_by_living_below().
sstring cf_archetype_get_name(archetype *arch)
Get archetype's name.
archetype * cf_archetype_get_first(void)
Get first archetype.
sstring cf_object_get_sstring_property(object *op, int propcode)
int cf_player_knowledge_has(object *op, const char *knowledge)
Wrapper for knowledge_player_has().
int cf_object_query_cost(const object *tmp, object *who, int flag)
object * cf_object_get_object_property(object *op, int propcode)
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
int cf_object_cast_spell(object *op, object *caster, int dir, object *spell_ob, char *stringarg)
Wrapper for cast_spell().
void cf_fix_object(object *op)
Wrapper for fix_object().
const char * cf_region_get_jail_path(region *reg)
Get jail path of region.
void cf_player_knowledge_give(object *op, const char *knowledge)
Wrapper for knowledge_give();.
char * cf_strdup_local(const char *str)
Wrapper for strdup_local().
object * cf_create_object_by_name(const char *name)
Wrapper for create_archetype() and create_archetype_by_object_name().
int cf_map_get_reset_time(mapstruct *map)
unsigned char MoveType
Typdef here to define type large enough to hold bitmask of all movement types.
Represents the ingame time.
char * cf_query_name(object *ob, char *name, int size)
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_set_float_property(object *op, int propcode, float value)
player * cf_party_get_first_player(partylist *party)
Get first player in party.
int cf_timer_destroy(int id)
Destroys specified timer, equivalent of calling cftimer_destroy().
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
int cf_object_apply(object *op, object *author, int flags)
Wrapper for apply_manual().
region * cf_region_get_next(region *reg)
Get next region in region list.
int64_t cf_object_get_int64_property(object *op, int propcode)
int cf_object_move_to(object *op, int x, int y)
Wrapper for move_to().
void cf_object_free_drop_inventory(object *ob)
Wrapper for object_free_drop_inventory().
static const flag_definition flags[]
Flag mapping.
int cf_player_can_pay(object *op)
Wrapper for can_pay().
sstring cf_find_string(const char *str)
void cf_object_set_string_property(object *op, int propcode, const char *value)
int64_t cf_object_perm_exp(object *op)
Wrapper for PERM_EXP macro.
void cf_quest_set_player_state(object *pl, sstring quest_code, int state)
Wrapper for quest_set_player_state();.
int cf_map_get_light(mapstruct *map)
int cf_object_pickup(object *op, object *what)
object * cf_map_insert_object(mapstruct *where, object *op, int x, int y)
Wrapper for object_insert_in_map_at().
int cf_player_arrest(object *who)
Wrapper for player_arrest().
int cf_player_move(player *pl, int dir)
partylist * cf_party_get_next(partylist *party)
Get next party in party list.
object * cf_archetype_get_clone(archetype *arch)
Get clone of archetype.
void cf_player_set_title(object *op, const char *title)
void cf_spring_trap(object *trap, object *victim)
Wrapper for spring_trap().
const char * cf_object_get_msg(object *)
int cf_object_pay_amount(object *pl, uint64_t to_pay)
Wrapper for pay_for_amount().
Plugin animator file specs[Config] name
int cf_object_change_abil(object *op, object *tmp)
Wrapper for change_abil().
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().
void cf_system_get_region_vector(int property, std::vector< region * > *list)
void cf_quest_start(object *pl, sstring quest_code, int state)
Wrapper for quest_start().
region * cf_region_get_parent(region *reg)
Get parent of region.
static event_registration m
archetype * cf_archetype_get_more(archetype *arch)
Get next part of archetype.
int cf_object_set_animation(object *op, const char *animation)
Set the object's animation.
void cf_log_plain(LogLevel logLevel, const char *message)
Wrapper for LOG() that uses directly a buffer, without format.
Used to link together several objects.
partylist * cf_party_get_first(void)
Get first party.
partylist * cf_player_get_party(object *op)
void cf_object_say(object *op, const char *msg)
object * cf_map_get_object_at(mapstruct *m, int x, int y)
Wrapper for GET_MAP_OB().
int cf_timer_create(object *ob, long delay, int mode)
Creates a timer, equivalent of calling cftimer_create().
object * cf_identify(object *op)
Wrapper for identify().
void cf_object_set_int64_property(object *op, int propcode, int64_t value)
int cf_find_face(const char *name, int error)
Wrapper for find_face().
object * cf_map_insert_object_there(object *op, mapstruct *m, object *originator, int flag)
Wrapper for object_insert_in_map().
void(* f_plug_api)(int *type,...)
General API function.
int cf_map_get_enter_y(mapstruct *map)
void cf_system_unregister_global_event(int event, const char *name)
const char * cf_get_month_name(int index)
int cf_init_plugin(f_plug_api getHooks)
MoveType cf_object_get_movetype_property(object *op, int propcode)
object * cf_object_find_by_arch_name(const object *who, const char *name)
Wrapper for object_find_by_arch_name().
mapstruct * cf_object_get_map_property(object *op, int propcode)
int cf_object_query_money(const object *op)
Wrapper for query_money().
const char * cf_region_get_longname(region *reg)
Get longname of region.
mapstruct * cf_get_empty_map(int sizex, int sizey)
Wrapper for get_empty_map().
region * cf_region_get_first(void)
Get first region in region list.
void cf_map_set_int_property(mapstruct *map, int propcode, int value)
void cf_object_query_cost_string(const object *tmp, object *who, int flag, char *buffer, int length)
partylist * cf_object_get_partylist_property(object *op, int propcode)
int cf_object_get_nrof(object *)
void cf_object_set_weight_limit(object *ob, int weight)
object * cf_object_clone(object *op, int clonetype)
Clone an object.
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
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
double cf_object_get_double_property(object *op, int propcode)
Information on one title.
void cf_map_message(mapstruct *m, const char *msg, int color)
Partial wrapper for ext_info_map().
The archetype structure is a set of rules on how to generate and manipulate objects which point to ar...
int cf_map_get_reset_timeout(mapstruct *map)
int cf_object_get_flag(object *ob, int flag)
void cf_object_drop(object *op, object *author)
int cf_map_get_enter_x(mapstruct *map)
mapstruct * cf_map_get_map_property(mapstruct *map, int propcode)
int cf_object_transfer(object *op, int x, int y, int randomly, object *originator)
Wrapper for transfer_ob().
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
void cf_object_set_movetype_property(object *op, int propcode, MoveType value)
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().
void cf_free_string(sstring str)
Wrapper for free_string().
const char * cf_region_get_message(region *reg)
Get message of region.
int cf_random_map_set_variable(RMParms *rp, const char *buf)
Wrapper for set_random_map_variable().
object * cf_object_present_archname_inside(object *op, char *whatstr)
Kinda wrapper for arch_present_in_ob().
object * cf_object_find_by_name(const object *who, const char *name)
Wrapper for object_find_by_name().
int cf_region_get_jail_x(region *reg)
Get region's jail x coordinate.
archetype * cf_object_get_archetype_property(object *op, int propcode)
object * cf_player_get_marked_item(object *op)
command_registration cf_system_register_command_extra(const char *name, const char *extra, command_function_extra func, uint8_t command_type, float time)
void cf_map_set_string_property(mapstruct *map, int propcode, const char *value)
object * cf_object_insert_in_ob(object *op, object *where)
Wrapper for object_insert_in_ob().
int cf_object_user_event(object *op, object *activator, object *third, const char *message, int fix)
int cf_object_move(object *op, int dir, object *originator)
void cf_system_get_object_vector(int property, std::vector< object * > *list)
object * cf_object_split(object *orig_ob, uint32_t nr, char *err, size_t size)
Wrapper for object_split().
void cf_system_register_global_event(int event, const char *name, f_plug_event hook)
command_registration cf_system_register_command(const char *name, command_function func, uint8_t command_type, float time)
void cf_player_set_party(object *op, partylist *party)
int cf_find_animation(const char *txt)
Wrapper for find_animation().
void cf_object_set_weight(object *ob, int weight)
archetype * cf_archetype_get_next(archetype *arch)
Get next archetype in linked list.
const char * cf_get_periodofday_name(int index)
void cf_map_trigger_connected(objectlink *ol, object *cause, int state)
Wrapper for trigger_connected().
void cf_object_set_flag(object *ob, int flag, int value)
void cf_system_get_map_vector(int property, std::vector< mapstruct * > *list)
int(* f_plug_event)(int *type,...)
Function to call to handle global or object-related events.
const typedef char * sstring
const char * cf_region_get_name(region *reg)
Get name of region.
int cf_object_set_nrof(object *, int nrof)
mapstruct * cf_map_has_been_loaded(const char *name)
Wrapper for has_been_loaded().
const char * cf_re_cmp(const char *str, const char *regexp)
Wrapper for re_cmp().
int cf_object_check_trigger(object *op, object *cause)
Wrapper for check_trigger().
int cf_quest_get_player_state(object *pl, sstring quest_code)
Wrapper for quest_get_player_state().
void cf_object_set_long_property(object *op, int propcode, long value)
if you malloc the data for the buffer
object * cf_create_object(void)
Wrapper for object_new().
char * cf_get_maps_directory(const char *name, char *buf, int size)
Wrapper for create_pathname().
const char * cf_object_get_key(object *op, const char *keyname)
Gets value for specified key, equivalent of object_get_value().
void cf_system_get_archetype_vector(int property, std::vector< archetype * > *list)
player * cf_player_find(const char *plname)
Wrapper for find_player_partial_name().
object * cf_friendlylist_get_next(object *ob)
Get next object on friendly list.
const char * cf_party_get_password(partylist *party)
Get party's password.
char * cf_player_get_title(object *op, char *title, int size)
void cf_system_unregister_command(command_registration command)
archetype * cf_archetype_get_head(archetype *arch)
Get head of archetype.
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_map_get_difficulty(mapstruct *map)
player * cf_party_get_next_player(partylist *party, player *op)
Get next player in party.
int cf_object_set_face(object *op, const char *face)
Set the object's face.
uint64_t command_registration
Identifier when registering a command.
int cf_map_get_darkness(mapstruct *map)
void cf_player_message(object *op, const char *txt, int flags)
mapstruct * cf_map_get_map(const char *name, int flags)
Wrapper for ready_map_name().
object * cf_object_change_map(object *op, mapstruct *m, object *originator, int flag, int x, int y)
Wrapper for object_insert_in_map_at().
mapstruct * cf_random_map_generate(const char *OutFileName, RMParms *RP, char **use_layout, sstring reset_group)
Wrapper for generate_random_map().
void cf_object_forget_spell(object *op, object *sp)
Wrapper for do_forget_spell(), except takes an object, not a string.
int cf_object_pay_item(object *op, object *pl)
Wrapper for pay_for_item().
int cf_object_get_weight_limit(object *ob)
void cf_system_get_party_vector(int property, std::vector< partylist * > *list)
object * cf_object_insert_object(object *op, object *container)
int16_t cf_object_get_resistance(object *op, int rtype)
void cf_object_set_int_property(object *op, int propcode, int value)
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
LogLevel
Log levels for the LOG() function.
void cf_object_update(object *op, int flags)
object * cf_friendlylist_get_first(void)
Get first object on friendly list.
void cf_object_remove(object *op)
Wrapper for object_remove().
void(* command_function)(object *op, const char *params)
One command function.
void cf_object_change_exp(object *op, int64_t exp, const char *skill_name, int flag)
Wrapper for change_exp().
sstring cf_player_get_ip(object *op)
void cf_object_set_object_property(object *op, int propcode, object *value)
object * cf_map_find_by_archetype_name(const char *str, mapstruct *map, int nx, int ny)
Kinda wrapper for map_find_by_archetype_name().
void cf_object_learn_spell(object *op, object *spell, int special_prayer)
Wrapper for do_learn_spell().
int cf_map_get_width(mapstruct *map)
int cf_object_get_int_property(object *op, int propcode)
int cf_quest_was_completed(object *pl, sstring quest_code)
Wrapper for quest_was_completed().
float cf_object_get_float_property(object *op, int propcode)
int cf_map_change_light(mapstruct *m, int change)
Wrapper for change_map_light().
void cf_get_time(timeofday_t *tod)
void cf_object_set_resistance(object *op, int rtype, int16_t value)
int cf_object_remove_depletion(object *op, int level)
Wrapper for remove_depletion().
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