Crossfire Server, Branches 1.12
R18729
|
Files | |
file | cfrhg.c |
file | cfrhg.h |
Data Structures | |
struct | house_zone_struct |
Typedefs | |
typedef struct house_zone_struct | house_zone_struct |
Functions | |
static void | add_exit_to_item (object *exit, const house_zone_struct *zone, const mapstruct *map) |
static void | add_exits_to_map (const mapstruct *map) |
CF_PLUGIN void * | cfrhg_globalEventListener (int *type,...) |
CF_PLUGIN int | cfrhg_runPluginCommand (object *op, char *params) |
CF_PLUGIN int | closePlugin (void) |
CF_PLUGIN void * | eventListener (int *type,...) |
static int | get_exit_seed (const object *exit, const mapstruct *map) |
static const house_zone_struct * | get_map_zone (const mapstruct *map) |
CF_PLUGIN void * | getPluginProperty (int *type,...) |
CF_PLUGIN int | initPlugin (const char *iversion, f_plug_api gethooksptr) |
static int | is_suitable_exit (object *exit) |
CF_PLUGIN int | postInitPlugin (void) |
Variables | |
static const house_zone_struct | zones [] |
This plugin links unused exits to random maps. The random map parameters vary based on the map it is in, but each exit will always use the same random seed to have the same layout and content.
Exits will only point to a random map if both their slaying and msg fields are empty.
typedef struct house_zone_struct house_zone_struct |
Link between a map and the exits to generate for it.
|
static |
Change an empty exit to point to a random map.
exit | exit to alter. |
zone | zone we're part of, to know the random map parameters. |
map | map the exit is on. |
Definition at line 150 of file cfrhg.c.
References cf_object_set_string_property(), CFAPI_OBJECT_PROP_MESSAGE, CFAPI_OBJECT_PROP_SLAYING, get_exit_seed(), MAX_BUF, house_zone_struct::monsterstyle, and snprintf().
Referenced by add_exits_to_map().
|
static |
Checks if the map should be processed, and if so process it.
map | map to work on. |
Definition at line 176 of file cfrhg.c.
References obj::above, add_exit_to_item(), GET_MAP_OB, get_map_zone(), is_suitable_exit(), MAP_HEIGHT, and MAP_WIDTH.
Referenced by cfrhg_globalEventListener().
CF_PLUGIN void* cfrhg_globalEventListener | ( | int * | type, |
... | |||
) |
Global server event handling. Only uses EVENT_MAPLOAD.
type | unused. |
Definition at line 204 of file cfrhg.c.
References add_exits_to_map(), and EVENT_MAPLOAD.
Referenced by postInitPlugin().
CF_PLUGIN int closePlugin | ( | void | ) |
Unloading of plugin.
Definition at line 318 of file cfrhg.c.
References cf_log(), llevDebug, and PLUGIN_VERSION.
CF_PLUGIN void* eventListener | ( | int * | type, |
... | |||
) |
Get the random map seed. Will always yield the same value for the same (position included) exit.
exit | exit to get the seed of. |
map | map the exit is on. |
Definition at line 124 of file cfrhg.c.
References obj::arch, archt::name, mapdef::path, snprintf(), obj::x, and obj::y.
Referenced by add_exit_to_item().
|
static |
Get the random map parameters of a map.
map | map to get the zone of. |
Definition at line 86 of file cfrhg.c.
References house_zone_struct::mappath, and mapdef::path.
Referenced by add_exits_to_map().
CF_PLUGIN void* getPluginProperty | ( | int * | type, |
... | |||
) |
Get the plugin identification or full name.
type | unused. |
Definition at line 261 of file cfrhg.c.
References PLUGIN_NAME, PLUGIN_VERSION, and snprintf().
CF_PLUGIN int initPlugin | ( | const char * | iversion, |
f_plug_api | gethooksptr | ||
) |
Plugin initialization.
iversion | server version. |
gethooksptr | function to get hooks. |
Definition at line 246 of file cfrhg.c.
References cf_init_plugin(), cf_log(), llevDebug, and PLUGIN_VERSION.
|
static |
Should we add a random map to this exit?
exit | exit to check. |
Definition at line 104 of file cfrhg.c.
References cf_object_get_int_property(), cf_object_get_sstring_property(), CFAPI_OBJECT_PROP_MESSAGE, CFAPI_OBJECT_PROP_SLAYING, CFAPI_OBJECT_PROP_TYPE, and EXIT.
Referenced by add_exits_to_map().
CF_PLUGIN int postInitPlugin | ( | void | ) |
Plugin initialisation.
Definition at line 305 of file cfrhg.c.
References cf_log(), cf_system_register_global_event(), cfrhg_globalEventListener(), EVENT_MAPLOAD, llevDebug, PLUGIN_NAME, and PLUGIN_VERSION.
|
static |
Maps we work on.
Definition at line 65 of file cfrhg.c.
Referenced by add_npc_to_random_map().