Crossfire Server, Trunk
R21670
|
#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include "plugin.h"
#include "shop.h"
#include "sproto.h"
#include "svnversion.h"
#include "timers.h"
Go to the source code of this file.
Macros | |
#define | NR_OF_HOOKS (sizeof(plug_hooks)/sizeof(*plug_hooks)) |
#define | string_get_int(name) |
Functions | |
static void | cfapi_archetype_get_property (int *type,...) |
static void | cfapi_cost_string_from_value (int *type,...) |
static void | cfapi_friendlylist_get_next (int *type,...) |
static void | cfapi_generate_random_map (int *type,...) |
static void | cfapi_get_hooks (int *type,...) |
static void | cfapi_get_month_name (int *type,...) |
static void | cfapi_get_periodofday_name (int *type,...) |
static void | cfapi_get_season_name (int *type,...) |
static void | cfapi_get_time (int *type,...) |
static void | cfapi_get_weekday_name (int *type,...) |
static void | cfapi_log (int *type,...) |
static void | cfapi_map_change_light (int *type,...) |
static void | cfapi_map_create_path (int *type,...) |
static void | cfapi_map_delete_map (int *type,...) |
static void | cfapi_map_find_by_archetype_name (int *type,...) |
static void | cfapi_map_get_map (int *type,...) |
static void | cfapi_map_get_map_property (int *type,...) |
static void | cfapi_map_get_object_at (int *type,...) |
static void | cfapi_map_has_been_loaded (int *type,...) |
static void | cfapi_map_message (int *type,...) |
static void | cfapi_map_out_of_map (int *type,...) |
static void | cfapi_map_set_map_property (int *type,...) |
static void | cfapi_map_trigger_connected (int *type,...) |
static void | cfapi_map_update_position (int *type,...) |
static void | cfapi_object_apply (int *type,...) |
static void | cfapi_object_apply_below (int *type,...) |
static void | cfapi_object_cast (int *type,...) |
static void | cfapi_object_change_abil (int *type,...) |
static void | cfapi_object_change_exp (int *type,...) |
static void | cfapi_object_check_spell (int *type,...) |
static void | cfapi_object_check_trigger (int *type,...) |
static void | cfapi_object_clean_object (int *type,...) |
static void | cfapi_object_clear (int *type,...) |
static void | cfapi_object_clone (int *type,...) |
static void | cfapi_object_create (int *type,...) |
static void | cfapi_object_delete (int *type,...) |
static void | cfapi_object_describe (int *type,...) |
static void | cfapi_object_distance (int *type,...) |
static void | cfapi_object_drain (int *type,...) |
static void | cfapi_object_drop (int *type,...) |
static void | cfapi_object_find_archetype_inside (int *type,...) |
static void | cfapi_object_find_by_arch_name (int *type,...) |
static void | cfapi_object_find_by_name (int *type,...) |
static void | cfapi_object_fix (int *type,...) |
static void | cfapi_object_forget_spell (int *type,...) |
static void | cfapi_object_get_key (int *type,...) |
static void | cfapi_object_get_property (int *type,...) |
static void | cfapi_object_give_skill (int *type,...) |
static void | cfapi_object_identify (int *type,...) |
static void | cfapi_object_insert (int *type,...) |
static void | cfapi_object_learn_spell (int *type,...) |
static void | cfapi_object_merge (int *type,...) |
static void | cfapi_object_move (int *type,...) |
static void | cfapi_object_on_same_map (int *type,...) |
static void | cfapi_object_pay_amount (int *type,...) |
static void | cfapi_object_pay_item (int *type,...) |
static void | cfapi_object_perm_exp (int *type,...) |
static void | cfapi_object_pickup (int *type,...) |
static void | cfapi_object_query_money (int *type,...) |
static void | cfapi_object_remove (int *type,...) |
static void | cfapi_object_remove_depletion (int *type,...) |
static void | cfapi_object_reset (int *type,...) |
static void | cfapi_object_say (int *type,...) |
static void | cfapi_object_set_key (int *type,...) |
static void | cfapi_object_set_property (int *type,...) |
static void | cfapi_object_split (int *type,...) |
static void | cfapi_object_spring_trap (int *type,...) |
static void | cfapi_object_teleport (int *type,...) |
static void | cfapi_object_transfer (int *type,...) |
static void | cfapi_object_transmute (int *type,...) |
static void | cfapi_object_update (int *type,...) |
static void | cfapi_object_user_event (int *type,...) |
static void | cfapi_party_get_property (int *type,...) |
static void | cfapi_player_can_pay (int *type,...) |
static void | cfapi_player_find (int *type,...) |
static void | cfapi_player_knowledge (int *type,...) |
static void | cfapi_player_message (int *type,...) |
static void | cfapi_player_quest (int *type,...) |
static void | cfapi_region_get_property (int *type,...) |
static void | cfapi_set_random_map_variable (int *type,...) |
static void | cfapi_system_add_string (int *type,...) |
static void | cfapi_system_check_path (int *type,...) |
static void | cfapi_system_directory (int *type,...) |
static void | cfapi_system_find_animation (int *type,...) |
static void | cfapi_system_find_face (int *type,...) |
static void | cfapi_system_find_string (int *type,...) |
static void | cfapi_system_re_cmp (int *type,...) |
static void | cfapi_system_register_global_event (int *type,...) |
static void | cfapi_system_remove_string (int *type,...) |
static void | cfapi_system_strdup_local (int *type,...) |
static void | cfapi_system_unregister_global_event (int *type,...) |
static void | cfapi_timer_create (int *type,...) |
static void | cfapi_timer_destroy (int *type,...) |
void | cleanupPlugins (void) |
static void | copy_message (object *op, const char *msg) |
static int | do_execute_event (object *op, int eventcode, object *activator, object *third, const char *message, int fix, talk_info *talk) |
int | execute_event (object *op, int eventcode, object *activator, object *third, const char *message, int fix) |
int | execute_global_event (int eventcode,...) |
command_array_struct * | find_plugin_command (const char *cmd, command_array_struct *command) |
void | initPlugins (void) |
int | plugin_event_say (object *npc, talk_info *talk) |
void | plugins_display_list (object *op) |
static crossfire_plugin * | plugins_find_plugin (const char *id) |
int | plugins_init_plugin (const char *libfile) |
int | plugins_remove_plugin (const char *id) |
static void | send_changed_object (object *op) |
int | user_event (object *op, object *activator, object *third, const char *message, int fix) |
Variables | |
static const hook_entry | plug_hooks [] |
crossfire_plugin * | plugins_list = NULL |
Plugin API.
Definition in file plugins.c.
#define NR_OF_HOOKS (sizeof(plug_hooks)/sizeof(*plug_hooks)) |
Number of hooked functions a plugin can call.
Definition at line 43 of file plugins.c.
Referenced by cfapi_get_hooks().
#define string_get_int | ( | name | ) |
Definition at line 1062 of file plugins.c.
Referenced by cfapi_get_month_name(), cfapi_get_periodofday_name(), cfapi_get_season_name(), and cfapi_get_weekday_name().
|
static |
Definition at line 4393 of file plugins.c.
References CFAPI_ARCH_PROP_CLONE, CFAPI_ARCH_PROP_HEAD, CFAPI_ARCH_PROP_MORE, CFAPI_ARCH_PROP_NAME, CFAPI_ARCH_PROP_NEXT, CFAPI_NONE, CFAPI_PARCH, CFAPI_POBJECT, CFAPI_SSTRING, archt::clone, first_archetype, archt::head, archt::more, archt::name, and archt::next.
|
static |
Wrapper for cost_string_from_value, modified to take a buffer and length instead of a StringBuffer.
type | will be CFAPI_NONE. |
Definition at line 769 of file plugins.c.
References CFAPI_NONE, and cost_string_from_value().
|
static |
Friend list access, to get objects on it.
Expects one parameter, ob.
type | unused |
Definition at line 4576 of file plugins.c.
References CFAPI_POBJECT, first_friendly_object, oblnk::next, and oblnk::ob.
|
static |
Wrapper for generate_random_map().
type | unused. |
Definition at line 4640 of file plugins.c.
References generate_random_map().
|
static |
Definition at line 567 of file plugins.c.
References CFAPI_FUNC, CFAPI_NONE, _hook_entry::func, and NR_OF_HOOKS.
Referenced by plugins_init_plugin().
|
static |
Wrapper for get_season_name().
type | will be CFAPI_STRING. Other parameters are int index and char** where to store result string |
Definition at line 1105 of file plugins.c.
References get_month_name(), and string_get_int.
|
static |
Wrapper for get_season_name().
type | will be CFAPI_STRING. Other parameters are int index and char** where to store result string |
Definition at line 1117 of file plugins.c.
References get_periodofday(), and string_get_int.
|
static |
Wrapper for get_season_name().
type | will be CFAPI_STRING. Other parameters are int index and char** where to store result string |
Definition at line 1081 of file plugins.c.
References get_season_name(), and string_get_int.
|
static |
Wrapper for get_tod().
type | will be CFAPI_NONE. |
Definition at line 1050 of file plugins.c.
References CFAPI_NONE, and get_tod().
|
static |
Wrapper for get_season_name().
type | will be CFAPI_STRING. Other parameters are int index and char** where to store result string |
Definition at line 1093 of file plugins.c.
References get_weekday(), and string_get_int.
|
static |
Wrapper for LOG().
type | will be CFAPI_NONE. |
Definition at line 1184 of file plugins.c.
References CFAPI_NONE, and LOG().
|
static |
Wrapper for change_map_light().
type | will be CFAPI_INT. |
Definition at line 1602 of file plugins.c.
References CFAPI_INT, and change_map_light().
|
static |
Wrapper for create_pathname() and create_overlay_pathname().
type | will be CFAPI_STRING. |
Definition at line 1277 of file plugins.c.
References CFAPI_NONE, CFAPI_STRING, create_overlay_pathname(), create_pathname(), and MAX_BUF.
|
static |
Definition at line 1511 of file plugins.c.
References CFAPI_NONE, and delete_map().
|
static |
Kinda wrapper for map_find_by_archetype() (but uses a string, not an archetype*).
type | will be CFAPI_POBJECT. |
Definition at line 1575 of file plugins.c.
References CFAPI_POBJECT, map_find_by_archetype(), and try_find_archetype().
|
static |
Gets map information.
First parameter is a integer, which should be:
Definition at line 1208 of file plugins.c.
References CFAPI_NONE, CFAPI_PMAP, get_empty_map(), get_map_from_coord(), and ready_map_name().
|
static |
Definition at line 1311 of file plugins.c.
References calculate_difficulty(), CFAPI_INT, CFAPI_MAP_PROP_DARKNESS, CFAPI_MAP_PROP_DIFFICULTY, CFAPI_MAP_PROP_ENTER_X, CFAPI_MAP_PROP_ENTER_Y, CFAPI_MAP_PROP_FLAGS, CFAPI_MAP_PROP_HEIGHT, CFAPI_MAP_PROP_MESSAGE, CFAPI_MAP_PROP_NAME, CFAPI_MAP_PROP_NEXT, CFAPI_MAP_PROP_PATH, CFAPI_MAP_PROP_PLAYERS, CFAPI_MAP_PROP_REGION, CFAPI_MAP_PROP_RESET_TIME, CFAPI_MAP_PROP_RESET_TIMEOUT, CFAPI_MAP_PROP_TMPNAME, CFAPI_MAP_PROP_UNIQUE, CFAPI_MAP_PROP_WIDTH, CFAPI_NONE, CFAPI_PMAP, CFAPI_PREGION, CFAPI_SSTRING, mapdef::darkness, mapdef::enter_x, mapdef::enter_y, first_map, get_map_flags(), get_region_by_map(), mapdef::height, mapdef::msg, mapdef::name, mapdef::next, mapdef::path, mapdef::players, mapdef::reset_time, mapdef::reset_timeout, mapdef::tmpname, mapdef::unique, and mapdef::width.
|
static |
Wrapper for GET_MAP_OB().
type | will be CFAPI_POBJECT. |
Definition at line 1546 of file plugins.c.
References CFAPI_POBJECT, get_map_flags(), GET_MAP_OB, and P_OUT_OF_MAP.
|
static |
Wrapper for has_been_loaded().
type | will be CFAPI_PMAP. |
Definition at line 1259 of file plugins.c.
References CFAPI_PMAP, and has_been_loaded().
|
static |
Definition at line 1524 of file plugins.c.
References CFAPI_NONE, ext_info_map(), MSG_SUBTYPE_NONE, and MSG_TYPE_MISC.
|
static |
Wrapper for out_of_map().
type | will be CFAPI_INT. |
Definition at line 1473 of file plugins.c.
References CFAPI_INT, and out_of_map().
|
static |
Definition at line 1443 of file plugins.c.
References CFAPI_MAP_PROP_PATH, CFAPI_NONE, CFAPI_STRING, mapdef::path, and strlcpy().
|
static |
Wrapper for trigger_connected().
Expected parameters after type:
[out] | type | Will be CFAPI_NONE. |
Definition at line 3819 of file plugins.c.
References CFAPI_NONE, and trigger_connected().
|
static |
Wrapper for update_position().
type | CFAPI_NONE. |
Definition at line 1495 of file plugins.c.
References CFAPI_NONE, and update_position().
|
static |
Applies an object.
type | will be CFAPI_INT. |
Definition at line 3236 of file plugins.c.
References apply_manual(), and CFAPI_INT.
|
static |
Applies an object below.
type | will be CFAPI_NONE. |
Definition at line 3216 of file plugins.c.
References apply_by_living_below(), and CFAPI_NONE.
|
static |
Wrapper for query_money().
type | Will be CFAPI_INT. |
Definition at line 3858 of file plugins.c.
References cast_spell(), CFAPI_INT, and obj::map.
|
static |
Wrapper for change_abil().
Definition at line 4144 of file plugins.c.
References CFAPI_INT, and change_abil().
|
static |
Wrapper for change_exp().
type | will be CFAPI_NONE. |
Definition at line 4248 of file plugins.c.
References CFAPI_NONE, and change_exp().
|
static |
Wrapper for check_spell_known().
type | Will be CFAPI_POBJECT. |
Definition at line 3921 of file plugins.c.
References CFAPI_POBJECT, and check_spell_known().
|
static |
Wrapper for check_trigger().
type | Will be CFAPI_INT. |
Definition at line 3792 of file plugins.c.
References CFAPI_INT, and check_trigger().
|
static |
Definition at line 3746 of file plugins.c.
References CFAPI_NONE, and clean_object().
|
static |
Wrapper for object_clear().
type | Will be CFAPI_NONE. |
Definition at line 3714 of file plugins.c.
References CFAPI_NONE, and object_clear().
|
static |
Clone an object, either through object_create_clone() or object_copy().
type | will be CFAPI_POBJECT. |
Definition at line 3438 of file plugins.c.
References CFAPI_POBJECT, object_copy(), object_create_clone(), and object_new().
|
static |
Wrapper for object_new(), create_archetype() and create_archetype_by_object_name().
type | will be CFAPI_POBJECT, or CFAPI_NONE if invalid value asked for. |
Definition at line 3470 of file plugins.c.
References CFAPI_NONE, CFAPI_POBJECT, find_archetype_by_object_name(), object_create_arch(), object_new(), and try_find_archetype().
|
static |
Definition at line 3411 of file plugins.c.
References CFAPI_NONE, FLAG_FREED, FLAG_REMOVED, llevError, LOG(), obj::name, object_free_drop_inventory(), and QUERY_FLAG.
|
static |
Wrapper for describe_item().
type | will be CFAPI_STRING. |
Definition at line 3281 of file plugins.c.
References CFAPI_STRING, describe_item(), and stringbuffer_finish().
|
static |
Wrapper for object_distance().
type | will be CFAPI_INT. |
Definition at line 3673 of file plugins.c.
References CFAPI_INT, and object_distance().
|
static |
Definition at line 3303 of file plugins.c.
References CFAPI_NONE, and drain_specific_stat().
|
static |
Wrapper for drop().
type | will be CFAPI_NONE. |
Definition at line 4120 of file plugins.c.
References CFAPI_NONE, obj::contr, pl::count, drop(), FLAG_NO_DROP, PLAYER, QUERY_FLAG, pl::socket, obj::type, and socket_struct::update_look.
|
static |
Kinda wrapper for arch__present_in_ob().
Definition at line 4050 of file plugins.c.
References arch_present_in_ob(), CFAPI_POBJECT, FOR_INV_FINISH, FOR_INV_PREPARE, MAX_BUF, query_name(), and try_find_archetype().
|
static |
Definition at line 4083 of file plugins.c.
References CFAPI_POBJECT, and object_find_by_arch_name().
|
static |
Definition at line 4099 of file plugins.c.
References CFAPI_POBJECT, and object_find_by_name().
|
static |
Definition at line 3340 of file plugins.c.
References CFAPI_NONE, and fix_object().
|
static |
Definition at line 3901 of file plugins.c.
References CFAPI_NONE, do_forget_spell(), MAX_BUF, and query_name().
|
static |
Gets a key/value value for an object.
type | will contain CFAPI_SSTRING. |
Definition at line 1683 of file plugins.c.
References CFAPI_SSTRING, and object_get_value().
|
static |
Main object property getter.
Definition at line 1728 of file plugins.c.
References obj::above, liv::ac, obj::active_next, obj::active_prev, obj::anim_speed, obj::animation, obj::arch, arch_present_in_ob(), obj::attack_movement, obj::attacked_by, obj::attacktype, pl::bed_x, pl::bed_y, obj::below, obj::carrying, CFAPI_DOUBLE, CFAPI_FLOAT, CFAPI_INT, CFAPI_INT16, CFAPI_LONG, CFAPI_MOVETYPE, CFAPI_NONE, CFAPI_OBJECT_PROP_AC, CFAPI_OBJECT_PROP_ANIM_SPEED, CFAPI_OBJECT_PROP_ANIMATION, CFAPI_OBJECT_PROP_ARCH_NAME, CFAPI_OBJECT_PROP_ARCHETYPE, CFAPI_OBJECT_PROP_ATTACK_MOVEMENT, CFAPI_OBJECT_PROP_ATTACK_TYPE, CFAPI_OBJECT_PROP_ATTACKED_BY, CFAPI_OBJECT_PROP_BASE_NAME, CFAPI_OBJECT_PROP_CARRYING, CFAPI_OBJECT_PROP_CHA, CFAPI_OBJECT_PROP_CHEATER, CFAPI_OBJECT_PROP_CHOSEN_SKILL, CFAPI_OBJECT_PROP_CLIENT_TYPE, CFAPI_OBJECT_PROP_CON, CFAPI_OBJECT_PROP_CONTAINER, CFAPI_OBJECT_PROP_COUNT, CFAPI_OBJECT_PROP_CURRENT_WEAPON, CFAPI_OBJECT_PROP_CUSTOM_NAME, CFAPI_OBJECT_PROP_DAM, CFAPI_OBJECT_PROP_DEX, CFAPI_OBJECT_PROP_DIRECTION, CFAPI_OBJECT_PROP_DURATION, CFAPI_OBJECT_PROP_ENEMY, CFAPI_OBJECT_PROP_ENVIRONMENT, CFAPI_OBJECT_PROP_EXP, CFAPI_OBJECT_PROP_EXP_MULTIPLIER, CFAPI_OBJECT_PROP_FACE, CFAPI_OBJECT_PROP_FACING, CFAPI_OBJECT_PROP_FLAGS, CFAPI_OBJECT_PROP_FP, CFAPI_OBJECT_PROP_FRIENDLY, CFAPI_OBJECT_PROP_GEN_SP_ARMOUR, CFAPI_OBJECT_PROP_GLOW_RADIUS, CFAPI_OBJECT_PROP_GOD, CFAPI_OBJECT_PROP_GP, CFAPI_OBJECT_PROP_HEAD, CFAPI_OBJECT_PROP_HIDDEN, CFAPI_OBJECT_PROP_HP, CFAPI_OBJECT_PROP_INT, CFAPI_OBJECT_PROP_INVENTORY, CFAPI_OBJECT_PROP_INVISIBLE, CFAPI_OBJECT_PROP_INVISIBLE_TIME, CFAPI_OBJECT_PROP_ITEM_POWER, CFAPI_OBJECT_PROP_LAST_EAT, CFAPI_OBJECT_PROP_LAST_GRACE, CFAPI_OBJECT_PROP_LAST_HEAL, CFAPI_OBJECT_PROP_LAST_SP, CFAPI_OBJECT_PROP_LEVEL, CFAPI_OBJECT_PROP_LORE, CFAPI_OBJECT_PROP_LUCK, CFAPI_OBJECT_PROP_MAGIC, CFAPI_OBJECT_PROP_MAGICAL, CFAPI_OBJECT_PROP_MAP, CFAPI_OBJECT_PROP_MATERIAL, CFAPI_OBJECT_PROP_MATERIAL_NAME, CFAPI_OBJECT_PROP_MAXGP, CFAPI_OBJECT_PROP_MAXHP, CFAPI_OBJECT_PROP_MAXSP, CFAPI_OBJECT_PROP_MERGEABLE, CFAPI_OBJECT_PROP_MESSAGE, CFAPI_OBJECT_PROP_MOVE_ALLOW, CFAPI_OBJECT_PROP_MOVE_BLOCK, CFAPI_OBJECT_PROP_MOVE_OFF, CFAPI_OBJECT_PROP_MOVE_ON, CFAPI_OBJECT_PROP_MOVE_SLOW, CFAPI_OBJECT_PROP_MOVE_SLOW_PENALTY, CFAPI_OBJECT_PROP_MOVE_STATUS, CFAPI_OBJECT_PROP_MOVE_TYPE, CFAPI_OBJECT_PROP_NAME, CFAPI_OBJECT_PROP_NAME_PLURAL, CFAPI_OBJECT_PROP_NEXT_ACTIVE_OB, CFAPI_OBJECT_PROP_NROF, CFAPI_OBJECT_PROP_OB_ABOVE, CFAPI_OBJECT_PROP_OB_BELOW, CFAPI_OBJECT_PROP_OTHER_ARCH, CFAPI_OBJECT_PROP_OWNER, CFAPI_OBJECT_PROP_PATH_ATTUNED, CFAPI_OBJECT_PROP_PATH_DENIED, CFAPI_OBJECT_PROP_PATH_REPELLED, CFAPI_OBJECT_PROP_PICK_UP, CFAPI_OBJECT_PROP_PICKABLE, CFAPI_OBJECT_PROP_POW, CFAPI_OBJECT_PROP_PRESENT, CFAPI_OBJECT_PROP_PREV_ACTIVE_OB, CFAPI_OBJECT_PROP_RACE, CFAPI_OBJECT_PROP_RAW_NAME, CFAPI_OBJECT_PROP_RESIST, CFAPI_OBJECT_PROP_RUN_AWAY, CFAPI_OBJECT_PROP_SHORT_NAME, CFAPI_OBJECT_PROP_SKILL, CFAPI_OBJECT_PROP_SLAYING, CFAPI_OBJECT_PROP_SP, CFAPI_OBJECT_PROP_SPEED, CFAPI_OBJECT_PROP_SPEED_LEFT, CFAPI_OBJECT_PROP_SPELL_ITEM, CFAPI_OBJECT_PROP_STR, CFAPI_OBJECT_PROP_SUBTYPE, CFAPI_OBJECT_PROP_TITLE, CFAPI_OBJECT_PROP_TOTAL_EXP, CFAPI_OBJECT_PROP_TYPE, CFAPI_OBJECT_PROP_VALUE, CFAPI_OBJECT_PROP_WC, CFAPI_OBJECT_PROP_WEIGHT, CFAPI_OBJECT_PROP_WEIGHT_LIMIT, CFAPI_OBJECT_PROP_WIS, CFAPI_OBJECT_PROP_X, CFAPI_OBJECT_PROP_Y, CFAPI_PARCH, CFAPI_PLAYER_PROP_BED_MAP, CFAPI_PLAYER_PROP_BED_X, CFAPI_PLAYER_PROP_BED_Y, CFAPI_PLAYER_PROP_IP, CFAPI_PLAYER_PROP_MARKED_ITEM, CFAPI_PLAYER_PROP_NEXT, CFAPI_PLAYER_PROP_PARTY, CFAPI_PLAYER_PROP_TITLE, CFAPI_PMAP, CFAPI_POBJECT, CFAPI_PPARTY, CFAPI_SINT64, CFAPI_SSTRING, CFAPI_STRING, liv::Cha, obj::chosen_skill, obj::client_type, liv::Con, obj::container, obj::contr, obj::count, obj::current_weapon, obj::custom_name, liv::dam, determine_god(), liv::Dex, obj::direction, obj::duration, obj::enemy, obj::env, liv::exp, obj::expmul, obj::face, obj::facing, find_marked_object(), first_player, FLAG_WAS_WIZ, liv::food, obj::gen_sp_armour, obj::glow_radius, liv::grace, obj::head, obj::hide, socket_struct::host, liv::hp, liv::Int, obj::inv, obj::invisible, is_friendly(), is_magical(), obj::item_power, obj::last_eat, obj::last_grace, obj::last_heal, obj::last_sp, obj::level, obj::lore, liv::luck, obj::magic, obj::map, obj::material, obj::materialname, liv::maxgrace, liv::maxhp, liv::maxsp, obj::move_allow, obj::move_block, obj::move_off, obj::move_on, obj::move_slow_penalty, obj::move_status, obj::move_type, obj::msg, Face::name, animations_struct::name, obj::name, archt::name, obj::name_pl, pl::next, obj::nrof, pl::ob, object_can_merge(), object_can_pick(), object_get_owner(), object_present_in_ob(), object_present_in_ob_by_name(), obj::other_arch, pl::party, obj::path_attuned, obj::path_denied, obj::path_repelled, obj::pick_up, player_get_title(), liv::Pow, query_base_name(), QUERY_FLAG, query_name(), query_short_name(), obj::race, obj::resist, obj::run_away, pl::savebed_map, obj::skill, obj::slaying, pl::socket, liv::sp, obj::speed, obj::speed_left, obj::spellitem, obj::stats, liv::Str, strlcpy(), obj::subtype, obj::title, obj::total_exp, obj::type, obj::value, liv::wc, obj::weight, obj::weight_limit, liv::Wis, obj::x, and obj::y.
|
static |
Definition at line 3356 of file plugins.c.
References CFAPI_POBJECT, and give_skill_by_name().
|
static |
Wrapper for identify().
type | will be CFAPI_NONE. |
Definition at line 3261 of file plugins.c.
References CFAPI_POBJECT, and identify().
|
static |
Definition at line 3509 of file plugins.c.
References CFAPI_NONE, CFAPI_POBJECT, FLAG_FREED, FLAG_REMOVED, FREE_OBJ_NO_DESTROY_CALLBACK, freearr_x, freearr_y, llevError, LOG(), obj::name, object_find_free_spot(), object_free(), object_free_drop_inventory(), object_insert_in_map_at(), object_insert_in_ob(), object_remove(), QUERY_FLAG, SIZEOFFREE, obj::x, and obj::y.
|
static |
Definition at line 3886 of file plugins.c.
References CFAPI_NONE, and do_learn_spell().
|
static |
Wrapper for object_merge().
type | Will be CFAPI_POBJECT. |
Definition at line 3650 of file plugins.c.
References CFAPI_POBJECT, and object_merge().
|
static |
Moves an object.
Syntax is: cfapi_object_move(&type, kind) where kind is:
type | will contain CFAPI_INT. |
Definition at line 1633 of file plugins.c.
References CFAPI_INT, move_ob(), move_player(), pl::ob, and player_arrest().
|
static |
Definition at line 3757 of file plugins.c.
References CFAPI_INT, and on_same_map().
|
static |
Wrapper for pay_for_amount().
type | will be CFAPI_INT. |
Definition at line 3941 of file plugins.c.
References CFAPI_INT, and pay_for_amount().
|
static |
Wrapper for pay_for_item().
type | will be CFAPI_INT. |
Definition at line 3962 of file plugins.c.
References CFAPI_INT, and pay_for_item().
|
static |
Wrapper for permanent experience calculation. This is because the settings struct is not visible inside the plugin.
type | will be CFAPI_SINT64. |
Definition at line 4229 of file plugins.c.
References CFAPI_SINT64, PERM_EXP, and obj::total_exp.
|
static |
Definition at line 4378 of file plugins.c.
References CFAPI_NONE, and pick_up().
|
static |
Wrapper for query_money().
type | Will be CFAPI_INT. |
Definition at line 3839 of file plugins.c.
References CFAPI_INT, and query_money().
|
static |
Definition at line 3390 of file plugins.c.
References CFAPI_NONE, FLAG_REMOVED, llevError, LOG(), obj::name, object_remove(), and QUERY_FLAG.
|
static |
Definition at line 3321 of file plugins.c.
References CFAPI_INT, and remove_depletion().
|
static |
Wrapper for clear_reset().
type | Will be CFAPI_NONE. |
Definition at line 3732 of file plugins.c.
References CFAPI_NONE, and object_reset().
|
static |
Definition at line 4159 of file plugins.c.
References CFAPI_INT, command_say(), monster_npc_say(), PLAYER, and obj::type.
|
static |
Write a key/value for an object.
type | will contain CFAPI_SSTRING. |
Definition at line 1705 of file plugins.c.
References CFAPI_INT, and object_set_value().
|
static |
Sets the property of an object. Will send changes to client if required. First argument should be an object*, second an integer.. Will not change an archetype's object.
type | will contain the type of the first argument used to change the property. |
Definition at line 2563 of file plugins.c.
References liv::ac, add_friendly_object(), obj::anim_speed, obj::animation, obj::arch, obj::attack_movement, obj::attacktype, pl::bed_x, pl::bed_y, CFAPI_DOUBLE, CFAPI_FLOAT, CFAPI_INT, CFAPI_INT16, CFAPI_LONG, CFAPI_MOVETYPE, CFAPI_NONE, CFAPI_OBJECT_PROP_AC, CFAPI_OBJECT_PROP_ANIM_SPEED, CFAPI_OBJECT_PROP_ANIMATION, CFAPI_OBJECT_PROP_ATTACK_MOVEMENT, CFAPI_OBJECT_PROP_ATTACK_TYPE, CFAPI_OBJECT_PROP_CHA, CFAPI_OBJECT_PROP_CHEATER, CFAPI_OBJECT_PROP_CHOSEN_SKILL, CFAPI_OBJECT_PROP_CON, CFAPI_OBJECT_PROP_CUSTOM_NAME, CFAPI_OBJECT_PROP_DAM, CFAPI_OBJECT_PROP_DEX, CFAPI_OBJECT_PROP_DIRECTION, CFAPI_OBJECT_PROP_DURATION, CFAPI_OBJECT_PROP_ENEMY, CFAPI_OBJECT_PROP_EXP, CFAPI_OBJECT_PROP_EXP_MULTIPLIER, CFAPI_OBJECT_PROP_FACE, CFAPI_OBJECT_PROP_FACING, CFAPI_OBJECT_PROP_FLAGS, CFAPI_OBJECT_PROP_FP, CFAPI_OBJECT_PROP_FRIENDLY, CFAPI_OBJECT_PROP_GEN_SP_ARMOUR, CFAPI_OBJECT_PROP_GLOW_RADIUS, CFAPI_OBJECT_PROP_GP, CFAPI_OBJECT_PROP_HIDDEN, CFAPI_OBJECT_PROP_HP, CFAPI_OBJECT_PROP_INT, CFAPI_OBJECT_PROP_INVISIBLE_TIME, CFAPI_OBJECT_PROP_ITEM_POWER, CFAPI_OBJECT_PROP_LAST_EAT, CFAPI_OBJECT_PROP_LAST_GRACE, CFAPI_OBJECT_PROP_LAST_HEAL, CFAPI_OBJECT_PROP_LAST_SP, CFAPI_OBJECT_PROP_LEVEL, CFAPI_OBJECT_PROP_LORE, CFAPI_OBJECT_PROP_LUCK, CFAPI_OBJECT_PROP_MAGIC, CFAPI_OBJECT_PROP_MATERIAL, CFAPI_OBJECT_PROP_MATERIAL_NAME, CFAPI_OBJECT_PROP_MAXGP, CFAPI_OBJECT_PROP_MAXHP, CFAPI_OBJECT_PROP_MAXSP, CFAPI_OBJECT_PROP_MESSAGE, CFAPI_OBJECT_PROP_MOVE_ALLOW, CFAPI_OBJECT_PROP_MOVE_BLOCK, CFAPI_OBJECT_PROP_MOVE_OFF, CFAPI_OBJECT_PROP_MOVE_ON, CFAPI_OBJECT_PROP_MOVE_SLOW, CFAPI_OBJECT_PROP_MOVE_STATUS, CFAPI_OBJECT_PROP_MOVE_TYPE, CFAPI_OBJECT_PROP_NAME, CFAPI_OBJECT_PROP_NAME_PLURAL, CFAPI_OBJECT_PROP_NROF, CFAPI_OBJECT_PROP_OWNER, CFAPI_OBJECT_PROP_PATH_ATTUNED, CFAPI_OBJECT_PROP_PATH_DENIED, CFAPI_OBJECT_PROP_PATH_REPELLED, CFAPI_OBJECT_PROP_PICK_UP, CFAPI_OBJECT_PROP_POW, CFAPI_OBJECT_PROP_RACE, CFAPI_OBJECT_PROP_RESIST, CFAPI_OBJECT_PROP_RUN_AWAY, CFAPI_OBJECT_PROP_SKILL, CFAPI_OBJECT_PROP_SLAYING, CFAPI_OBJECT_PROP_SP, CFAPI_OBJECT_PROP_SPEED, CFAPI_OBJECT_PROP_SPEED_LEFT, CFAPI_OBJECT_PROP_SPELL_ITEM, CFAPI_OBJECT_PROP_STR, CFAPI_OBJECT_PROP_TITLE, CFAPI_OBJECT_PROP_TOTAL_EXP, CFAPI_OBJECT_PROP_VALUE, CFAPI_OBJECT_PROP_WC, CFAPI_OBJECT_PROP_WEIGHT, CFAPI_OBJECT_PROP_WEIGHT_LIMIT, CFAPI_OBJECT_PROP_WIS, CFAPI_PLAYER_PROP_BED_MAP, CFAPI_PLAYER_PROP_BED_X, CFAPI_PLAYER_PROP_BED_Y, CFAPI_PLAYER_PROP_MARKED_ITEM, CFAPI_PLAYER_PROP_PARTY, CFAPI_PLAYER_PROP_TITLE, CFAPI_POBJECT, CFAPI_PPARTY, CFAPI_SINT64, CFAPI_STRING, liv::Cha, obj::chosen_skill, CLEAR_FLAG, archt::clone, liv::Con, obj::container, obj::contr, copy_message(), obj::count, obj::custom_name, liv::dam, liv::Dex, obj::direction, obj::duration, obj::env, esrv_update_item(), liv::exp, obj::expmul, obj::face, obj::facing, find_face(), first_player, fix_object(), liv::food, FOR_ABOVE_FINISH, FOR_ABOVE_PREPARE, FREE_AND_COPY, obj::gen_sp_armour, obj::glow_radius, liv::grace, obj::hide, liv::hp, liv::Int, obj::invisible, is_friendly(), obj::item_power, obj::last_eat, obj::last_grace, obj::last_heal, obj::last_sp, obj::level, obj::lore, liv::luck, obj::magic, obj::map, pl::mark, pl::mark_count, obj::material, MAX_BUF, liv::maxgrace, liv::maxhp, liv::maxsp, MOVE_ALL, obj::move_allow, obj::move_block, obj::move_off, obj::move_on, obj::move_status, obj::move_type, obj::name, obj::name_pl, pl::next, obj::nrof, animations_struct::num, Face::number, pl::ob, object_decrease_nrof(), object_get_env_recursive(), object_get_player_container(), object_set_cheat(), object_set_enemy(), object_set_owner(), object_sum_weight(), object_update(), object_update_speed(), P_NEED_UPDATE, party_join(), obj::path_attuned, obj::path_denied, obj::path_repelled, obj::pick_up, PLAYER, player_set_own_title(), liv::Pow, obj::race, remove_friendly_object(), obj::resist, obj::run_away, safe_strncpy, pl::savebed_map, send_changed_object(), SET_ANIMATION, SET_FLAG, SET_MAP_FLAGS, obj::skill, obj::slaying, pl::socket, liv::sp, obj::speed, obj::speed_left, obj::spellitem, obj::state, obj::stats, liv::Str, obj::title, obj::total_exp, try_find_animation(), obj::type, UP_OBJ_FACE, UP_OBJ_INSERT, UPD_NROF, UPD_WEIGHT, update_all_los(), socket_struct::update_look, update_position(), obj::value, liv::wc, obj::weight, obj::weight_limit, liv::Wis, obj::x, and obj::y.
|
static |
Wrapper for object_split().
type | will be CFAPI_POBJECT, or CFAPI_NONE if split failed. |
Definition at line 3617 of file plugins.c.
References CFAPI_NONE, CFAPI_POBJECT, and object_split().
|
static |
Definition at line 3773 of file plugins.c.
References CFAPI_NONE, and spring_trap().
|
static |
Teleports an object at a specified destination if possible.
type | Will be CFAPI_INT. |
Definition at line 4339 of file plugins.c.
References CFAPI_INT, obj::contr, FLAG_REMOVED, map_newmap_cmd(), object_find_first_free_spot(), object_insert_in_map_at(), object_remove(), out_of_map(), PLAYER, player_update_bg_music(), QUERY_FLAG, pl::socket, and obj::type.
|
static |
Object transfer. Parameters are object*, int meaning: 0: call to transfer_ob() 1: call to object_insert_in_map_at() 2: call to move_to()
Definition at line 3986 of file plugins.c.
References CFAPI_INT, CFAPI_NONE, CFAPI_POBJECT, mapdef::enter_x, mapdef::enter_y, move_to(), object_insert_in_map_at(), and transfer_ob().
|
static |
Definition at line 3373 of file plugins.c.
References CFAPI_NONE, and transmute_materialname().
|
static |
Wrapper for object_update().
type | Will be CFAPI_NONE. |
Definition at line 3694 of file plugins.c.
References CFAPI_NONE, and object_update().
|
static |
Definition at line 4657 of file plugins.c.
References CFAPI_INT, and user_event().
|
static |
Party-related functions.
type | data type returned. |
Definition at line 4448 of file plugins.c.
References CFAPI_NONE, CFAPI_PARTY_PROP_NAME, CFAPI_PARTY_PROP_NEXT, CFAPI_PARTY_PROP_PASSWORD, CFAPI_PARTY_PROP_PLAYER, CFAPI_PPARTY, CFAPI_PPLAYER, CFAPI_SSTRING, obj::contr, first_player, pl::next, party_get_first(), party_get_next(), party_get_password(), and party_struct::partyname.
|
static |
|
static |
Wrapper for find_player_partial_name().
type | will be CFAPI_PPLAYER. |
Definition at line 4188 of file plugins.c.
References CFAPI_PPLAYER, and find_player_partial_name().
|
static |
Wrapper for knowledge-related functions().
type | Depends on the type. |
Definition at line 4290 of file plugins.c.
References CFAPI_INT, CFAPI_NONE, obj::contr, knowledge_give(), knowledge_player_knows(), llevError, LOG(), and obj::name.
|
static |
Definition at line 4203 of file plugins.c.
References CFAPI_NONE, draw_ext_info(), flags, MSG_SUBTYPE_NONE, and MSG_TYPE_MISC.
|
static |
Quest-related wrappers, for all quest-related operations.
Definition at line 4681 of file plugins.c.
References CFAPI_INT, CFAPI_NONE, CFAPI_PLAYER_QUEST_GET_STATE, CFAPI_PLAYER_QUEST_SET_STATE, CFAPI_PLAYER_QUEST_START, CFAPI_PLAYER_QUEST_WAS_COMPLETED, obj::contr, llevError, LOG(), obj::name, quest_get_player_state(), quest_set_player_state(), quest_start(), and quest_was_completed().
|
static |
Regions-related functions.
type | data type returned. |
Return values.
Definition at line 4503 of file plugins.c.
References CFAPI_INT, CFAPI_NONE, CFAPI_PREGION, CFAPI_REGION_PROP_JAIL_PATH, CFAPI_REGION_PROP_JAIL_X, CFAPI_REGION_PROP_JAIL_Y, CFAPI_REGION_PROP_LONGNAME, CFAPI_REGION_PROP_MESSAGE, CFAPI_REGION_PROP_NAME, CFAPI_REGION_PROP_NEXT, CFAPI_REGION_PROP_PARENT, CFAPI_SSTRING, first_region, regiondef::jailmap, regiondef::jailx, regiondef::jaily, regiondef::longname, regiondef::msg, regiondef::name, regiondef::next, and regiondef::parent.
|
static |
Wrapper for set_random_map_variable().
type | will be CFAPI_INT. |
Definition at line 4618 of file plugins.c.
References CFAPI_INT, and set_random_map_variable().
|
static |
Wrapper for add_string().
type | will be CFAPI_SSTRING. |
Definition at line 899 of file plugins.c.
References add_string(), and CFAPI_SSTRING.
|
static |
Wrapper for check_path().
type | will be CFAPI_INT. |
Definition at line 956 of file plugins.c.
References CFAPI_INT, and check_path().
|
static |
Definition at line 997 of file plugins.c.
References CFAPI_STRING, Settings::confdir, Settings::datadir, Settings::localdir, Settings::mapdir, Settings::playerdir, settings, Settings::tmpdir, and Settings::uniquedir.
|
static |
Wrapper for find_animation().
type | will be CFAPI_INT. |
Definition at line 799 of file plugins.c.
References CFAPI_INT, animations_struct::num, and try_find_animation().
|
static |
Wrapper for find_face().
type | will be CFAPI_INT. |
Definition at line 820 of file plugins.c.
References CFAPI_INT, find_face(), get_face_by_id(), and Face::number.
|
static |
Wrapper for find_string().
type | will be CFAPI_SSTRING. |
Definition at line 937 of file plugins.c.
References CFAPI_SSTRING, and find_string().
|
static |
Wrapper for re_cmp().
type | will be CFAPI_STRING. |
Definition at line 979 of file plugins.c.
References CFAPI_STRING, and re_cmp().
|
static |
Definition at line 857 of file plugins.c.
References CFAPI_NONE, _crossfire_plugin::gevent, and plugins_find_plugin().
|
static |
Wrapper for free_string().
type | will be CFAPI_NONE. |
Definition at line 919 of file plugins.c.
References CFAPI_NONE, and free_string().
|
static |
Wrapper for strdup_local().
type | will be CFAPI_STRING. |
Definition at line 843 of file plugins.c.
References CFAPI_STRING, and strdup_local.
|
static |
Definition at line 876 of file plugins.c.
References CFAPI_NONE, _crossfire_plugin::gevent, and plugins_find_plugin().
|
static |
Wrapper for cfapi_timer_create().
type | unused |
Additional parameters:
Definition at line 1132 of file plugins.c.
References CFAPI_INT, cftimer_create(), cftimer_find_free_id(), TIMER_ERR_ID, and TIMER_ERR_NONE.
|
static |
Wrapper for cftimer_destroy().
type | will be CFAPI_INT. |
Additional parameters:
Definition at line 1165 of file plugins.c.
References CFAPI_INT, and cftimer_destroy().
void cleanupPlugins | ( | void | ) |
Call the crossfire_plugin::closefunc on the various plugins, used at server shutdown. Will not unload plugins. Free all items of plugins_list.
Definition at line 4819 of file plugins.c.
References _crossfire_plugin::closefunc, and _crossfire_plugin::next.
Referenced by cleanup().
|
static |
Utility function to copy the string to op->msg and ensure there is a final newline.
op | object to copy to. |
msg | message to copy. |
Definition at line 2530 of file plugins.c.
References fatal(), free_dialog_information(), object_set_msg(), OUT_OF_MEMORY, and snprintf.
Referenced by cfapi_object_set_property().
|
static |
Definition at line 314 of file plugins.c.
References obj::count, EVENT_CONNECTOR, _crossfire_plugin::eventfunc, FLAG_UNIQUE, FOR_INV_FINISH, FOR_INV_PREPARE, FREE_OBJ_NO_DESTROY_CALLBACK, llevDebug, llevError, LOG(), obj::map, obj::name, mapdef::name, object_free(), object_get_env_recursive(), object_remove(), object_was_destroyed, plugins_find_plugin(), QUERY_FLAG, obj::x, and obj::y.
Referenced by execute_event(), and plugin_event_say().
int execute_event | ( | object * | op, |
int | eventcode, | ||
object * | activator, | ||
object * | third, | ||
const char * | message, | ||
int | fix | ||
) |
Definition at line 377 of file plugins.c.
References do_execute_event().
Referenced by user_event().
int execute_global_event | ( | int | eventcode, |
... | |||
) |
Definition at line 385 of file plugins.c.
References EVENT_BORN, EVENT_CLOCK, EVENT_CRASH, EVENT_GKILL, EVENT_KICK, EVENT_LOGIN, EVENT_LOGOUT, EVENT_MAPENTER, EVENT_MAPLEAVE, EVENT_MAPLOAD, EVENT_MAPRESET, EVENT_MAPUNLOAD, EVENT_MUZZLE, EVENT_PLAYER_DEATH, EVENT_REMOVE, EVENT_SHOUT, EVENT_TELL, _crossfire_plugin::gevent, and _crossfire_plugin::next.
command_array_struct* find_plugin_command | ( | const char * | cmd, |
command_array_struct * | command | ||
) |
Tries to find if a given command is handled by a plugin. Note that this function is called before the internal commands are checked, meaning that you can "overwrite" them.
cmd | command to search for. |
command | must be a valid structure pointer, that will be returned if the command is indeed handled by a plugin. |
Definition at line 4748 of file plugins.c.
References _crossfire_plugin::next, and _crossfire_plugin::propfunc.
Referenced by execute_newserver_command().
void initPlugins | ( | void | ) |
Plugins initialization. Browses the plugins directory and call plugins_init_plugin() for each file found.
Definition at line 4769 of file plugins.c.
References closedir(), dirent::d_name, Settings::disabled_plugins, LIBDIR, llevDebug, llevInfo, LOG(), MAX_BUF, linked_char::name, linked_char::next, opendir(), PLUGIN_SUFFIX, plugins_init_plugin(), readdir(), settings, and snprintf.
Referenced by server_main().
Definition at line 381 of file plugins.c.
References do_execute_event(), EVENT_SAY, SCRIPT_FIX_ALL, talk_info::text, and talk_info::who.
Referenced by monster_talk_to_npc().
void plugins_display_list | ( | object * | op | ) |
Displays a list of loaded plugins (keystrings and description) in the game log window.
op | who to display the list to. |
Definition at line 746 of file plugins.c.
References draw_ext_info(), draw_ext_info_format(), _crossfire_plugin::fullname, _crossfire_plugin::id, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DEBUG, NDI_UNIQUE, and _crossfire_plugin::next.
Referenced by command_listplugins().
|
static |
Find a plugin from its internal name.
id | internal plugin name. |
Definition at line 248 of file plugins.c.
References _crossfire_plugin::id, _crossfire_plugin::next, plugins_dlerror, and snprintf.
Referenced by cfapi_system_register_global_event(), cfapi_system_unregister_global_event(), and do_execute_event().
int plugins_init_plugin | ( | const char * | libfile | ) |
Try to load the specified plugin. Update plugins_list if successful. Log errors at llevError.
libfile | full path to the plugin. |
Definition at line 613 of file plugins.c.
References cfapi_get_hooks(), _crossfire_plugin::closefunc, _crossfire_plugin::eventfunc, _crossfire_plugin::fullname, _crossfire_plugin::gevent, _crossfire_plugin::id, Settings::ignore_plugin_compatibility, _crossfire_plugin::libptr, LIBPTRTYPE, llevError, LOG(), _crossfire_plugin::next, NR_EVENTS, plugins_dlclose, plugins_dlerror, plugins_dlopen, plugins_dlsym, _crossfire_plugin::prev, _crossfire_plugin::propfunc, and settings.
Referenced by command_loadplugin(), and initPlugins().
int plugins_remove_plugin | ( | const char * | id | ) |
Unload the specified plugin. No logging is done in case of error. Updates plugins_list.
id | plugin internal identifier. |
Definition at line 704 of file plugins.c.
References _crossfire_plugin::closefunc, _crossfire_plugin::id, _crossfire_plugin::libptr, _crossfire_plugin::next, plugins_dlclose, and _crossfire_plugin::prev.
Referenced by command_unloadplugin().
|
static |
Notify clients about a changed object.
op | the object that has changed |
Definition at line 284 of file plugins.c.
References obj::container, obj::contr, obj::env, esrv_update_item(), first_player, FOR_ABOVE_FINISH, FOR_ABOVE_PREPARE, pl::next, pl::ob, object_get_player_container(), PLAYER, pl::socket, obj::type, UPD_ALL, and socket_struct::update_look.
Referenced by cfapi_object_set_property().
Definition at line 310 of file plugins.c.
References EVENT_USER, and execute_event().
Referenced by cfapi_object_user_event().
|
static |
crossfire_plugin* plugins_list = NULL |