39 #include "svnversion.h" 46 #include "libloaderapi.h" 50 #define NR_OF_HOOKS (sizeof(plug_hooks)/sizeof(*plug_hooks)) 271 if (!strcmp(
id, plugin->id)) {
281 static char buf[256];
285 err = GetLastError();
286 if (FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM, NULL, err, 0, buf,
sizeof (buf), NULL) == 0)
287 snprintf(buf,
sizeof (buf),
"error %lu", err);
288 p = strchr(buf,
'\0');
289 while (p > buf && (p[-1] ==
'\r' || p[-1] ==
'\n'))
306 if (op->
env != NULL) {
336 va_start(args, type);
337 request_type = va_arg(args,
int);
338 if (request_type == 0) {
341 fid = va_arg(args,
int);
347 *rapi = plug_hooks[fid].
func;
353 buf = va_arg(args,
char *);
358 if (!strcmp(buf, plug_hooks[i].fname)) {
359 *rapi = plug_hooks[i].
func;
393 if (svn_rev == NULL) {
394 LOG(
llevError,
"Unable to find SvnRevPlugin in %s\n", libfile);
399 LOG(
llevError,
"Version mismatch in in %s (%s != %s)\n", libfile, svn_rev, SVN_REV);
405 if (initfunc == NULL) {
411 if (propfunc == NULL) {
417 if (eventfunc == NULL) {
423 if (postfunc == NULL) {
429 if (closefunc == NULL) {
441 propfunc(&i,
"Identification", cp->
id,
sizeof(cp->
id));
456 auto plugin = std::find_if(
plugins_list.begin(),
plugins_list.end(), [&id] (
const auto cp) {
return strcmp(
id, cp->id) == 0; });
460 for (
int eventcode = 0; eventcode <
NR_EVENTS; eventcode++) {
482 "List of loaded plugins:\n-----------------------");
487 cp->id, cp->fullname);
500 char *buffer, *
final;
501 int length, largest_coin;
504 va_start(args, type);
505 cost = va_arg(args, uint64_t);
506 largest_coin = va_arg(args,
int);
507 buffer = va_arg(args,
char*);
508 length = va_arg(args,
int);
518 strncpy(buffer,
final, length - 1);
519 buffer[length - 1] =
'\0';
534 va_start(args, type);
535 name = va_arg(args,
const char *);
536 num = va_arg(args,
int *);
540 (*num) = anim ? anim->
num : 0;
556 va_start(args, type);
557 face = va_arg(args,
const char *);
558 error = va_arg(args,
int);
559 num = va_arg(args,
int *);
563 (*num) = f ? f->
number : 0;
577 va_start(args, type);
578 txt = va_arg(args,
const char *);
579 ret = va_arg(args,
char **);
593 va_start(args, type);
594 eventcode = va_arg(args,
int);
595 pname = va_arg(args,
char *);
613 va_start(args, type);
614 eventcode = va_arg(args,
int);
615 pname = va_arg(args,
char *);
629 va_start(args, type);
630 int property = va_arg(args,
int);
631 std::vector<object *> *list = va_arg(args, std::vector<object *> *);
637 list->push_back(pl->ob);
657 va_start(args, type);
658 int property = va_arg(args,
int);
659 std::vector<mapstruct *> *list = va_arg(args, std::vector<mapstruct *> *);
664 list->push_back(map);
673 va_start(args, type);
674 int property = va_arg(args,
int);
675 std::vector<archetype *> *list = va_arg(args, std::vector<archetype *> *);
687 va_start(args, type);
688 int property = va_arg(args,
int);
689 std::vector<region *> *list = va_arg(args, std::vector<region *> *);
701 va_start(args, type);
702 int property = va_arg(args,
int);
703 std::vector<partylist *> *list = va_arg(args, std::vector<partylist *> *);
709 list->push_back(party);
728 va_start(args, type);
729 str = va_arg(args,
const char *);
747 va_start(args, type);
766 va_start(args, type);
767 str = va_arg(args,
const char *);
786 va_start(args, type);
788 name = va_arg(args,
char *);
789 prepend_dir = va_arg(args,
int);
790 ret = va_arg(args,
int *);
809 va_start(args, type);
811 str = va_arg(args,
char *);
812 regexp = va_arg(args,
char *);
813 rv = va_arg(args,
const char **);
815 *rv =
re_cmp(str, regexp);
826 va_start(args, type);
828 dirtype = va_arg(args,
int);
829 str = va_arg(args,
const char **);
878 va_start(args, type);
886 #define string_get_int(name) \ 890 va_start(args, type); \ 891 index = va_arg(args, int); \ 892 str = va_arg(args, const char **); \ 894 *str = name(index); \ 895 *type = CFAPI_STRING; \ 964 va_start(args, type);
965 ob = va_arg(args,
object *);
966 delay = va_arg(args,
long);
967 mode = va_arg(args,
int);
968 timer = va_arg(args,
int *);
994 va_start(args, type);
995 id = va_arg(args,
int);
996 err = va_arg(args,
int *);
1011 const char *message;
1013 va_start(args, type);
1014 logLevel =
static_cast<LogLevel>(va_arg(args,
int));
1015 message = va_arg(args,
const char *);
1016 LOG(logLevel,
"%s", message);
1041 va_start(args, type);
1043 ctype = va_arg(args,
int);
1047 x = va_arg(args,
int);
1048 y = va_arg(args,
int);
1054 name = va_arg(args,
const char *);
1055 x = va_arg(args,
int);
1062 nx = va_arg(args,
int);
1063 ny = va_arg(args,
int);
1088 va_start(args, type);
1089 string = va_arg(args,
char *);
1107 va_start(args, type);
1109 ctype = va_arg(args,
int);
1110 str = va_arg(args,
const char *);
1111 name = va_arg(args,
char *);
1112 size = va_arg(args,
int);
1147 va_start(args, type);
1150 property = va_arg(args,
int);
1155 x = va_arg(args,
int);
1156 y = va_arg(args,
int);
1157 nx = va_arg(args, int16_t *);
1158 ny = va_arg(args, int16_t *);
1159 rint = va_arg(args,
int *);
1165 rint = va_arg(args,
int *);
1171 rstr = va_arg(args,
sstring *);
1177 rstr = va_arg(args,
sstring *);
1183 rstr = va_arg(args,
sstring *);
1189 rint = va_arg(args,
int *);
1195 rint = va_arg(args,
int *);
1201 rint = va_arg(args,
int *);
1207 rint = va_arg(args,
int *);
1213 rint = va_arg(args,
int *);
1219 rint = va_arg(args,
int *);
1225 rint = va_arg(args,
int *);
1231 rint = va_arg(args,
int *);
1237 rstr = va_arg(args,
sstring *);
1249 rreg = va_arg(args,
region **);
1255 rint = va_arg(args,
int *);
1273 va_start(args, type);
1276 property = va_arg(args,
int);
1280 buf = va_arg(args,
const char *);
1303 va_start(args, type);
1305 x = va_arg(args,
int);
1306 y = va_arg(args,
int);
1307 rint = va_arg(args,
int *);
1324 va_start(args, type);
1327 x = va_arg(args,
int);
1328 y = va_arg(args,
int);
1338 va_start(args, type);
1354 va_start(args, type);
1356 string = va_arg(args,
const char *);
1357 color = va_arg(args,
int);
1377 va_start(args, type);
1379 x = va_arg(args,
int);
1380 y = va_arg(args,
int);
1381 robj = va_arg(args,
object **);
1406 va_start(args, type);
1408 msg = va_arg(args,
char *);
1410 x = va_arg(args,
int);
1411 y = va_arg(args,
int);
1412 robj = va_arg(args,
object **);
1432 va_start(args, type);
1434 change = va_arg(args,
int);
1435 rint = va_arg(args,
int *);
1466 va_start(args, type);
1467 kind = va_arg(args,
int);
1470 op = va_arg(args,
object *);
1471 direction = va_arg(args,
int);
1472 activator = va_arg(args,
object *);
1473 ret = va_arg(args,
int *);
1475 *ret =
move_ob(op, direction, activator);
1479 pl = va_arg(args,
player *);
1480 direction = va_arg(args,
int);
1481 ret = va_arg(args,
int *);
1487 op = va_arg(args,
object *);
1488 ret = va_arg(args,
int *);
1509 const char *keyname;
1513 va_start(args, type);
1514 op = va_arg(args,
object *);
1515 keyname = va_arg(args,
const char *);
1516 value = va_arg(args,
const char **);
1531 const char *keyname;
1537 va_start(args, type);
1538 op = va_arg(args,
object *);
1539 keyname = va_arg(args,
char *);
1540 value = va_arg(args,
char *);
1541 add_key = va_arg(args,
int);
1542 ret = va_arg(args,
int *);
1570 va_start(args, type);
1572 op = va_arg(args,
object *);
1573 property = va_arg(args,
int);
1576 robject = va_arg(args,
object **);
1577 *robject = op->
above;
1582 robject = va_arg(args,
object **);
1583 *robject = op->
below;
1588 robject = va_arg(args,
object **);
1594 robject = va_arg(args,
object **);
1600 robject = va_arg(args,
object **);
1606 robject = va_arg(args,
object **);
1612 robject = va_arg(args,
object **);
1613 *robject = op->
head;
1618 robject = va_arg(args,
object **);
1630 rint = va_arg(args,
int *);
1636 rbuffer = va_arg(args,
char *);
1637 rbufsize = va_arg(args,
int);
1643 rsstring = va_arg(args,
sstring *);
1649 rsstring = va_arg(args,
sstring *);
1650 *rsstring = op->
title;
1655 rsstring = va_arg(args,
sstring *);
1656 *rsstring = op->
race;
1661 rsstring = va_arg(args,
sstring *);
1667 rsstring = va_arg(args,
sstring *);
1668 *rsstring = op->
skill;
1673 rsstring = va_arg(args,
sstring *);
1674 *rsstring = op->
msg;
1679 rsstring = va_arg(args,
sstring *);
1680 *rsstring = op->
lore;
1685 rint = va_arg(args,
int *);
1691 rint = va_arg(args,
int *);
1697 rfloat = va_arg(args,
float *);
1698 *rfloat = op->
speed;
1703 rfloat = va_arg(args,
float *);
1709 rint = va_arg(args,
int *);
1715 rint = va_arg(args,
int *);
1721 rint = va_arg(args,
int *);
1727 rint = va_arg(args,
int *);
1733 rint = va_arg(args,
int *);
1739 rint = va_arg(args,
int *);
1748 idx = va_arg(args,
int);
1749 resist = va_arg(args, int16_t *);
1750 *resist = op->
resist[idx];
1756 rint = va_arg(args,
int *);
1762 rint = va_arg(args,
int *);
1768 rint = va_arg(args,
int *);
1774 rint = va_arg(args,
int *);
1780 rint = va_arg(args,
int *);
1786 rsstring = va_arg(args,
sstring *);
1792 rint = va_arg(args,
int *);
1798 rlong = va_arg(args,
long *);
1804 rint = va_arg(args,
int *);
1810 rint = va_arg(args,
int *);
1816 rint = va_arg(args,
int *);
1822 rint = va_arg(args,
int *);
1828 rint = va_arg(args,
int *);
1834 rint = va_arg(args,
int *);
1840 rint = va_arg(args,
int *);
1846 rint = va_arg(args,
int *);
1852 rint = va_arg(args,
int *);
1858 rint = va_arg(args,
int *);
1864 rint = va_arg(args,
int *);
1870 rint = va_arg(args,
int *);
1876 rint = va_arg(args,
int *);
1882 rint64 = va_arg(args, int64_t *);
1888 robject = va_arg(args,
object **);
1894 robject = va_arg(args,
object **);
1895 *robject = op->
enemy;
1900 robject = va_arg(args,
object **);
1906 rint = va_arg(args,
int *);
1912 robject = va_arg(args,
object **);
1918 rint = va_arg(args,
int *);
1924 rint = va_arg(args,
int *);
1930 rint = va_arg(args,
int *);
1936 robject = va_arg(args,
object **);
1942 rdouble = va_arg(args,
double *);
1960 rsstring = va_arg(args,
sstring *);
1966 rint = va_arg(args,
int *);
1972 rint = va_arg(args,
int *);
1978 rbuffer = va_arg(args,
char *);
1979 rbufsize = va_arg(args,
int);
1987 i = va_arg(args,
int);
1988 rbuffer = va_arg(args,
char *);
1989 rbufsize = va_arg(args,
int);
1996 rsstring = va_arg(args,
sstring *);
1997 *rsstring = op->
name;
2002 rint = va_arg(args,
int *);
2008 rint = va_arg(args,
int *);
2014 rint64 = va_arg(args, int64_t *);
2020 robject = va_arg(args,
object **);
2028 stype = va_arg(args,
int);
2030 unsigned char ptype;
2035 ptype = (
unsigned char)(va_arg(args,
int));
2036 robject = va_arg(args,
object **);
2041 ptype = (
unsigned char)(va_arg(args,
int));
2042 buf = va_arg(args,
char *);
2043 robject = va_arg(args,
object **);
2049 robject = va_arg(args,
object **);
2058 rint = va_arg(args,
int *);
2066 op2 = va_arg(args,
object *);
2067 rint = va_arg(args,
int *);
2076 op2 = va_arg(args,
object *);
2077 rint = va_arg(args,
int *);
2086 fl = va_arg(args,
int);
2087 rint = va_arg(args,
int *);
2094 rint = va_arg(args,
int *);
2100 rint = va_arg(args,
int *);
2106 rint = va_arg(args,
int *);
2112 rint = va_arg(args,
int *);
2118 rint = va_arg(args,
int *);
2124 rint = va_arg(args,
int *);
2130 rint = va_arg(args,
int *);
2136 rint = va_arg(args,
int *);
2142 rint = va_arg(args,
int *);
2148 rint = va_arg(args,
int *);
2154 rint = va_arg(args,
int *);
2160 rint = va_arg(args,
int *);
2166 rint = va_arg(args,
int *);
2172 rint = va_arg(args,
int *);
2178 rint = va_arg(args,
int *);
2184 rint = va_arg(args,
int *);
2190 rint = va_arg(args,
int *);
2196 rsstring = va_arg(args,
sstring *);
2202 rsstring = va_arg(args,
sstring *);
2208 rint = va_arg(args,
int *);
2214 rsstring = va_arg(args,
sstring *);
2215 if (op->
face != NULL) {
2225 rsstring = va_arg(args,
sstring *);
2236 rint = va_arg(args,
int *);
2242 rsstring = va_arg(args,
sstring *);
2248 robject = va_arg(args,
object **);
2260 robject = va_arg(args,
object **);
2270 rbuffer = va_arg(args,
char *);
2271 rbufsize = va_arg(args,
int);
2277 robject = va_arg(args,
object **);
2319 rfloat = va_arg(args,
float *);
2325 rbuffer = va_arg(args,
char *);
2326 rbufsize = va_arg(args,
int);
2332 rint = va_arg(args,
int *);
2338 rint = va_arg(args,
int *);
2344 rint = va_arg(args,
int *);
2367 if (strlen(msg) == 0) {
2395 va_start(args, type);
2396 op = va_arg(args,
object *);
2397 property = va_arg(args,
int);
2400 if (op != NULL && (!op->
arch || (op != &op->
arch->
clone))) {
2403 sarg = va_arg(args,
char *);
2410 sarg = va_arg(args,
char *);
2417 sarg = va_arg(args,
char *);
2423 sarg = va_arg(args,
char *);
2429 sarg = va_arg(args,
char *);
2435 sarg = va_arg(args,
char *);
2441 sarg = va_arg(args,
char *);
2447 sarg = va_arg(args,
char *);
2453 farg = va_arg(args,
double);
2455 if (farg != op->
speed) {
2462 farg = va_arg(args,
double);
2468 iarg = va_arg(args,
int);
2472 if (op->
nrof > (uint32_t)iarg)
2474 else if (op->
nrof < (uint32_t)iarg) {
2479 if (op->
env != NULL) {
2505 iarg = va_arg(args,
int);
2511 iarg = va_arg(args,
int);
2517 int iargbis = va_arg(args,
int);
2520 iarg = va_arg(args,
int);
2521 op->
resist[iargbis] = iarg;
2526 iarg = va_arg(args,
int);
2532 iarg = va_arg(args,
int);
2538 iarg = va_arg(args,
int);
2544 iarg = va_arg(args,
int);
2550 iarg = va_arg(args,
int);
2559 iarg = va_arg(args,
int);
2565 larg = va_arg(args,
long);
2571 iarg = va_arg(args,
int);
2578 iarg = va_arg(args,
int);
2584 iarg = va_arg(args,
int);
2590 iarg = va_arg(args,
int);
2596 iarg = va_arg(args,
int);
2602 iarg = va_arg(args,
int);
2608 iarg = va_arg(args,
int);
2614 iarg = va_arg(args,
int);
2620 iarg = va_arg(args,
int);
2626 iarg = va_arg(args,
int);
2628 if (op->
weight != iarg) {
2633 if (op->
env != NULL) {
2659 iarg = va_arg(args,
int);
2665 iarg = va_arg(args,
int);
2672 if (tmp->
map != NULL) {
2681 s64arg = va_arg(args, int64_t);
2687 oparg = va_arg(args,
object *);
2693 iarg = va_arg(args,
int);
2699 oparg = va_arg(args,
object *);
2705 iarg = va_arg(args,
int);
2711 iarg = va_arg(args,
int);
2717 iarg = va_arg(args,
int);
2723 oparg = va_arg(args,
object *);
2729 darg = va_arg(args,
double);
2735 sarg = va_arg(args,
char *);
2742 iarg = va_arg(args,
int);
2748 iarg = va_arg(args,
int);
2757 iarg = va_arg(args,
int);
2763 s64arg = va_arg(args, int64_t);
2769 oparg = va_arg(args,
object *);
2782 iarg = va_arg(args,
int);
2783 iargbis = va_arg(args,
int);
2795 iarg = va_arg(args,
int);
2801 iarg = va_arg(args,
int);
2807 iarg = va_arg(args,
int);
2813 iarg = va_arg(args,
int);
2819 iarg = va_arg(args,
int);
2825 iarg = va_arg(args,
int);
2831 iarg = va_arg(args,
int);
2837 iarg = va_arg(args,
int);
2843 iarg = va_arg(args,
int);
2849 iarg = va_arg(args,
int);
2855 iarg = va_arg(args,
int);
2861 iarg = va_arg(args,
int);
2867 iarg = va_arg(args,
int);
2873 iarg = va_arg(args,
int);
2879 iarg = va_arg(args,
int);
2885 iarg = va_arg(args,
int);
2891 iarg = va_arg(args,
int);
2898 sarg = va_arg(args,
char *);
2899 ret = va_arg(args,
int *);
2914 sarg = va_arg(args,
char *);
2915 ret = va_arg(args,
int *);
2930 iarg = va_arg(args,
int);
2937 oparg = va_arg(args,
object *);
2957 sarg = va_arg(args,
char *);
2963 iarg = va_arg(args,
int);
2969 iarg = va_arg(args,
int);
2975 sarg = va_arg(args,
char *);
3039 va_start(args, type);
3041 applier = va_arg(args,
object *);
3062 va_start(args, type);
3064 applier = va_arg(args,
object *);
3065 applied = va_arg(args,
object *);
3066 aflags = va_arg(args,
int);
3067 ret = va_arg(args,
int *);
3082 object *op, **result;
3084 va_start(args, type);
3086 op = va_arg(args,
object *);
3087 result = va_arg(args,
object **);
3107 va_start(args, type);
3109 op = va_arg(args,
object *);
3110 owner = va_arg(args,
object *);
3111 desc = va_arg(args,
char *);
3112 size = va_arg(args,
int);
3117 strncpy(desc,
final, size);
3118 desc[size - 1] =
'\0';
3128 va_start(args, type);
3130 op = va_arg(args,
object *);
3131 ds = va_arg(args,
int);
3146 va_start(args, type);
3148 op = va_arg(args,
object *);
3149 level = va_arg(args,
int);
3150 result = va_arg(args,
int*);
3163 va_start(args, type);
3165 op = va_arg(args,
object *);
3181 va_start(args, type);
3183 op = va_arg(args,
object *);
3184 skillname = va_arg(args,
char *);
3198 va_start(args, type);
3200 op = va_arg(args,
object *);
3201 chg = va_arg(args,
object *);
3213 va_start(args, type);
3215 op = va_arg(args,
object *);
3234 va_start(args, type);
3236 op = va_arg(args,
object *);
3239 LOG(
llevError,
"Plugin trying to free freed/non removed object %s\n", op->
name);
3263 va_start(args, type);
3265 op = va_arg(args,
object *);
3266 kind = va_arg(args,
int);
3267 robj = va_arg(args,
object **);
3293 va_start(args, type);
3294 ival = va_arg(args,
int);
3299 robj = va_arg(args,
object **);
3307 sval = va_arg(args,
const char *);
3308 robj = va_arg(args,
object **);
3337 va_start(args, type);
3339 op = va_arg(args,
object *);
3341 LOG(
llevError,
"cfapi_object_insert: called with NULL object!\n");
3346 LOG(
llevError,
"cfapi_object_insert: called with FREED object!\n");
3351 LOG(
llevError,
"cfapi_object_insert: called with not removed object %s!\n", op->
name);
3354 itype = va_arg(args,
int);
3359 orig = va_arg(args,
object *);
3360 flag = va_arg(args,
int);
3361 x = va_arg(args,
int);
3362 y = va_arg(args,
int);
3363 robj = va_arg(args,
object **);
3365 LOG(
llevError,
"cfapi_object_insert (0): called with NULL map, object %s!\n", op->
name);
3375 orig = va_arg(args,
object *);
3376 flag = va_arg(args,
int);
3377 robj = va_arg(args,
object **);
3379 LOG(
llevError,
"cfapi_object_insert (1): called with NULL map, object %s!\n", op->
name);
3389 orig = va_arg(args,
object *);
3390 flag = va_arg(args,
int);
3391 x = va_arg(args,
int);
3392 y = va_arg(args,
int);
3393 robj = va_arg(args,
object **);
3395 LOG(
llevError,
"cfapi_object_insert (0): called with NULL map, object %s!\n", op->
name);
3411 orig = va_arg(args,
object *);
3412 robj = va_arg(args,
object **);
3414 LOG(
llevError,
"cfapi_object_insert (3): called with NULL orig, object %s!\n", op->
name);
3423 LOG(
llevError,
"cfapi_object_insert (1): called with itype %d which is not valid, object %s!\n", itype, op->
name);
3444 va_start(args, type);
3446 op = va_arg(args,
object *);
3447 nr = va_arg(args,
int);
3448 buf = va_arg(args,
char *);
3449 size = va_arg(args,
int);
3450 split = va_arg(args,
object **);
3475 va_start(args, type);
3477 op = va_arg(args,
object *);
3478 op2 = va_arg(args,
object *);
3479 merge = va_arg(args,
object **);
3497 va_start(args, type);
3499 op = va_arg(args,
object *);
3500 op2 = va_arg(args,
object *);
3501 rint = va_arg(args,
int *);
3517 va_start(args, type);
3519 op = va_arg(args,
object *);
3520 action = va_arg(args,
int);
3536 va_start(args, type);
3538 op = va_arg(args,
object *);
3555 va_start(args, type);
3557 op = va_arg(args,
object *);
3569 va_start(args, type);
3570 op = va_arg(args,
object *);
3582 va_start(args, type);
3583 op1 = va_arg(args,
object *);
3584 op2 = va_arg(args,
object *);
3585 rint = va_arg(args,
int *);
3597 va_start(args, type);
3598 trap = va_arg(args,
object *);
3599 victim = va_arg(args,
object *);
3617 va_start(args, type);
3618 op = va_arg(args,
object *);
3619 cause = va_arg(args,
object *);
3620 rint = va_arg(args,
int *);
3644 va_start(args, type);
3646 cause = va_arg(args,
object *);
3647 state = va_arg(args,
int);
3663 va_start(args, type);
3664 op = va_arg(args,
object *);
3665 rint = va_arg(args,
int *);
3686 va_start(args, type);
3687 op = va_arg(args,
object *);
3688 caster = va_arg(args,
object *);
3689 dir = va_arg(args,
int);
3690 sp = va_arg(args,
object *);
3691 str = va_arg(args,
char *);
3692 rint = va_arg(args,
int *);
3702 *rint =
cast_spell(op, caster, dir, sp, str);
3711 va_start(args, type);
3712 op = va_arg(args,
object *);
3713 sp = va_arg(args,
object *);
3714 prayer = va_arg(args,
int);
3726 va_start(args, type);
3727 op = va_arg(args,
object *);
3728 sp = va_arg(args,
object *);
3746 va_start(args, type);
3747 op = va_arg(args,
object *);
3748 spellname = va_arg(args,
char *);
3749 robj = va_arg(args,
object **);
3766 va_start(args, type);
3767 op = va_arg(args,
object *);
3768 amount = va_arg(args, uint64_t);
3769 rint = va_arg(args,
int *);
3788 va_start(args, type);
3789 tobuy = va_arg(args,
object *);
3790 op = va_arg(args,
object *);
3791 rint = va_arg(args,
int *);
3808 int x, y, randompos, ttype, flag;
3814 va_start(args, type);
3815 op = va_arg(args,
object *);
3816 ttype = va_arg(args,
int);
3819 x = va_arg(args,
int);
3820 y = va_arg(args,
int);
3821 randompos = va_arg(args,
int);
3822 originator = va_arg(args,
object *);
3823 rint = va_arg(args,
int *);
3826 *rint =
transfer_ob(op, x, y, randompos, originator);
3833 originator = va_arg(args,
object *);
3834 flag = va_arg(args,
int);
3835 x = va_arg(args,
int);
3836 y = va_arg(args,
int);
3837 robj = va_arg(args,
object **);
3839 if (x < 0 || y < 0) {
3849 x = va_arg(args,
int);
3850 y = va_arg(args,
int);
3851 rint = va_arg(args,
int *);
3876 va_start(args, type);
3877 op = va_arg(args,
object *);
3879 str = va_arg(args,
char *);
3880 robj = va_arg(args,
object **);
3883 if (*robj == NULL) {
3890 if (!strncmp(name, str, strlen(str)))
3892 if (!strncmp(tmp->name, str, strlen(str)))
3895 if (tmp->slaying && !strcmp(tmp->slaying, str))
3910 va_start(args, type);
3911 who = va_arg(args,
const object *);
3912 name = va_arg(args,
const char *);
3913 result = va_arg(args,
object **);
3926 va_start(args, type);
3927 who = va_arg(args,
const object *);
3928 name = va_arg(args,
const char *);
3929 result = va_arg(args,
object **);
3946 va_start(args, type);
3947 op = va_arg(args,
object *);
3948 author = va_arg(args,
object *);
3970 va_start(args, type);
3971 op = va_arg(args,
object *);
3972 tmp = va_arg(args,
object *);
3973 rint = va_arg(args,
int *);
3987 va_start(args, type);
3988 op = va_arg(args,
object *);
3989 msg = va_arg(args,
char *);
3990 rint = va_arg(args,
int *);
4013 va_start(args, type);
4015 sval = va_arg(args,
char *);
4016 rpl = va_arg(args,
player **);
4031 va_start(args, type);
4033 flags = va_arg(args,
int);
4034 pri = va_arg(args,
int);
4035 pl = va_arg(args,
object *);
4036 buf = va_arg(args,
const char *);
4055 va_start(args, type);
4056 op = va_arg(args,
object *);
4057 rlong = va_arg(args, int64_t *);
4076 va_start(args, type);
4077 ob = va_arg(args,
object *);
4078 exp = va_arg(args, int64_t);
4079 skill = va_arg(args,
const char *);
4080 flag = va_arg(args,
int);
4097 va_start(args, type);
4098 pl = va_arg(args,
object *);
4099 rint = va_arg(args,
int *);
4115 const char *knowledge;
4117 va_start(args, type);
4118 what = va_arg(args,
int);
4123 pl = va_arg(args,
object *);
4124 knowledge = va_arg(args,
const char *);
4125 rint = va_arg(args,
int *);
4129 if (pl->
contr == NULL) {
4130 LOG(
llevError,
"cfapi_player_knowledge: 'has' called for non player object %s", pl->
name);
4140 pl = va_arg(args,
object *);
4141 knowledge = va_arg(args,
const char *);
4143 if (pl->
contr != NULL)
4149 LOG(
llevError,
"cfapi_player_knowledge: invalid what %d", what);
4167 va_start(args, type);
4168 who = va_arg(args,
object *);
4170 x = va_arg(args,
int);
4171 y = va_arg(args,
int);
4172 res = va_arg(args,
int *);
4184 va_start(args, type);
4185 who = va_arg(args,
object *);
4186 what = va_arg(args,
object *);
4187 int *res = va_arg(args,
int *);
4203 va_start(args, type);
4205 prop = va_arg(args,
int);
4209 rsstring = va_arg(args,
sstring *);
4210 *rsstring = arch->
name;
4222 *rarch = arch->
head;
4228 *rarch = arch->
more;
4233 robject = va_arg(args,
object **);
4234 *robject = &arch->
clone;
4259 va_start(args, type);
4261 prop = va_arg(args,
int);
4264 rsstring = va_arg(args,
sstring *);
4276 rsstring = va_arg(args,
sstring *);
4283 obarg = va_arg(args,
object *);
4284 rplayer = va_arg(args,
player **);
4286 for (; *rplayer != NULL; (*rplayer) = (*rplayer)->
next)
4287 if ((*rplayer)->ob->contr->party == party) {
4313 va_start(args, type);
4314 reg = va_arg(args,
region *);
4315 prop = va_arg(args,
int);
4318 rsstring = va_arg(args,
sstring *);
4319 *rsstring = reg->
name;
4324 rregion = va_arg(args,
region **);
4330 rregion = va_arg(args,
region **);
4336 rsstring = va_arg(args,
sstring *);
4342 rsstring = va_arg(args,
sstring *);
4343 *rsstring = reg->
msg;
4349 rint = va_arg(args,
int*);
4355 rsstring = va_arg(args,
sstring *);
4383 va_start(args, type);
4384 ob = va_arg(args,
object *);
4385 robject = va_arg(args,
object **);
4408 va_start(args, type);
4410 buf = va_arg(args,
const char *);
4411 ret = va_arg(args,
int *);
4432 va_start(args, type);
4433 name = va_arg(args,
const char *);
4435 use_layout = va_arg(args,
char **);
4436 reset_group = va_arg(args,
sstring);
4447 const char *message;
4452 va_start(args, type);
4453 op = va_arg(args,
object *);
4454 activator = va_arg(args,
object *);
4455 third = va_arg(args,
object *);
4456 message = va_arg(args,
const char *);
4457 fix = va_arg(args,
int);
4458 ret = va_arg(args,
int *);
4473 va_start(args, type);
4474 op = va_arg(args,
int);
4475 player = va_arg(args,
object *);
4478 if (player->
contr == NULL) {
4479 LOG(
llevError,
"cfapi_player_quest called with non player object %s!\n", player->
name);
4487 int state = va_arg(args,
int);
4493 int *ret = va_arg(args,
int *);
4499 int state = va_arg(args,
int);
4505 int *ret = va_arg(args,
int*);
4520 const char *name = NULL, *extra = NULL;
4524 uint8_t register_type, command_type;
4527 va_start(args, type);
4528 register_type = va_arg(args,
int);
4529 name = va_arg(args,
const char *);
4530 if (register_type == 1) {
4533 extra = va_arg(args,
const char *);
4536 command_type = (uint8_t)va_arg(args,
int);
4540 time = va_arg(args,
double);
4544 if (register_type == 1) {
4557 va_start(args, type);
4574 struct dirent *currentfile;
4577 char buf[
sizeof(LIBDIR) + 9 +
sizeof(dirent::d_name)];
4579 snprintf(buf,
sizeof(buf),
"%s/plugins/", LIBDIR);
4583 if (plugdir == NULL)
4586 while ((currentfile =
readdir(plugdir)) != NULL) {
4587 l = strlen(currentfile->d_name);
4588 if (l > strlen(PLUGIN_SUFFIX)) {
4591 if (strcmp(currentfile->d_name+l-strlen(PLUGIN_SUFFIX), PLUGIN_SUFFIX) != 0)
4595 if (strcmp(disable->c_str(),
"All") == 0) {
4596 LOG(
llevInfo,
"plugins: disabling (all) %s\n", currentfile->d_name);
4600 if (strncmp(disable->c_str(), currentfile->d_name, disable->length()) == 0 && strlen(currentfile->d_name) == strlen(PLUGIN_SUFFIX) + disable->length()) {
4601 LOG(
llevInfo,
"plugins: disabling %s\n", currentfile->d_name);
4607 snprintf(buf,
sizeof(buf),
"%s/plugins/%s", LIBDIR, currentfile->d_name);
4608 LOG(
llevInfo,
"plugins: loading %s\n", currentfile->d_name);
4632 plugins_list.clear();
#define CFAPI_OBJECT_PROP_STR
#define CFAPI_OBJECT_PROP_MAP
#define CFAPI_OBJECT_PROP_RUN_AWAY
static void cfapi_object_create(int *type,...)
Wrapper for object_new(), create_archetype() and create_archetype_by_object_name().
void spring_trap(object *trap, object *victim)
This function generalizes attacks by runes/traps.
#define CFAPI_PLAYER_PROP_TRANSPORT
#define CFAPI_OBJECT_PROP_MAGIC
void apply_by_living_below(object *pl)
Attempt to apply the object 'below' the player.
int on_same_map(const object *op1, const object *op2)
Checks whether 2 objects are on the same map or not.
#define CFAPI_PLAYER_QUEST_GET_STATE
int check_path(const char *name, int prepend_dir)
This function checks if a file with the given path exists.
#define MSG_TYPE_MISC
Messages that don't go elsewhere.
#define FLAG_NO_DROP
Object can't be dropped.
#define NDI_DELAYED
If set, then message is sent only after the player's tick completes.
static void cfapi_map_get_object_at(int *type,...)
Wrapper for GET_MAP_OB().
signed long object_sum_weight(object *op)
object_sum_weight() is a recursive function which calculates the weight an object is carrying...
const char * get_periodofday(const int index)
give access to weekday names
#define CFAPI_PARTY_PROP_PASSWORD
static void cfapi_system_add_string(int *type,...)
Wrapper for add_string().
int apply_manual(object *op, object *tmp, int aflag)
Main apply handler.
#define CFAPI_OBJECT_PROP_MATERIAL
uint16_t attack_movement
What kind of attack movement.
const char * determine_god(object *op)
Determines if op worships a god.
#define CFAPI_OBJECT_PROP_ANIMATION
#define CFAPI_OBJECT_PROP_SP
#define UP_OBJ_FACE
Only thing that changed was the face.
void events_register_object_handler(const char *id, f_plug_event handler)
Register an object event handler.
void update_position(mapstruct *m, int x, int y)
This function updates various attributes about a specific space on the map (what it looks like...
char * stringbuffer_finish(StringBuffer *sb)
Deallocate the string buffer instance and return the string.
#define CFAPI_OBJECT_PROP_CARRYING
#define plugins_dlopen(fname)
Load a shared library.
const char * get_month_name(const int index)
give access to month names
#define COMMAND_TYPE_WIZARD
Wizard-only commands.
#define CFAPI_OBJECT_PROP_NAME
#define CFAPI_OBJECT_PROP_OB_BELOW
#define CFAPI_PLAYER_PROP_TITLE
#define CFAPI_MAP_PROP_NAME
int move_player(object *op, int dir)
Move player in the given direction.
void free_dialog_information(object *op)
Frees obj::dialog_information.
int8_t item_power
Power rating of the object.
This represents one animation.
static void cfapi_map_get_map(int *type,...)
Gets map information.
struct archetype * arch
Pointer to archetype.
void quest_start(player *pl, sstring quest_code, int state)
Start a quest for a player.
void plugins_display_list(object *op)
Displays a list of loaded plugins (keystrings and description) in the game log window.
StringBuffer * describe_item(const object *op, const object *owner, int use_media_tags, StringBuffer *buf)
Describes an item, in all its details.
static void cfapi_object_drop(int *type,...)
Wrapper for drop().
char id[MAX_BUF]
Plugin identification string.
#define CFAPI_OBJECT_PROP_RACE
static void cfapi_object_change_abil(int *type,...)
Wrapper for change_abil().
static void cfapi_system_unregister_global_event(int *type,...)
object * check_spell_known(object *op, const char *name)
Checks to see if player knows the spell.
#define CFAPI_MAP_PROP_ENTER_Y
#define CFAPI_REGION_PROP_MESSAGE
#define P_NEED_UPDATE
This space is out of date.
static void cfapi_log(int *type,...)
Wrapper for LOG().
#define CFAPI_MAP_PROP_FLAGS
#define CFAPI_MAP_PROP_DARKNESS
#define CFAPI_OBJECT_PROP_ARCHETYPE
#define CFAPI_OBJECT_PROP_WEIGHT
object * object_get_owner(object *op)
Returns the object which this object marks as being the owner.
#define CFAPI_OBJECT_PROP_ATTACK_TYPE
static void cfapi_system_remove_string(int *type,...)
Wrapper for free_string().
int16_t players
How many players are on this level right now.
#define CFAPI_OBJECT_PROP_FACE
region * get_region_by_map(mapstruct *m)
Gets a region from a map.
#define CFAPI_SYSTEM_MAPS
object * object_split(object *orig_ob, uint32_t nr, char *err, size_t size)
object_split(ob,nr) splits up ob into two parts.
static void cfapi_object_pickup(int *type,...)
void LOG(LogLevel logLevel, const char *format,...)
Logs a message to stderr, or to file.
static void cfapi_object_clone(int *type,...)
Clone an object, either through object_create_clone() or object_copy().
void do_forget_spell(object *op, const char *spell)
Erases spell from player's inventory.
int8_t direction
Means the object is moving that way.
#define plugins_dlsym(lib, name)
Get a function from a shared library.
static void cfapi_object_find_archetype_inside(int *type,...)
Kinda wrapper for arch__present_in_ob().
#define CFAPI_OBJECT_PROP_GOD
#define CFAPI_OBJECT_PROP_PICK_UP
#define CFAPI_MAP_PROP_DIFFICULTY
#define CFAPI_MAP_PROP_HEIGHT
static void cfapi_system_re_cmp(int *type,...)
Wrapper for re_cmp().
#define CFAPI_OBJECT_PROP_DIRECTION
void command_unregister(command_registration command)
Unregister a previously registered command.
#define CFAPI_SYSTEM_FRIENDLY_LIST
void draw_ext_info_format(int flags, int pri, const object *pl, uint8_t type, uint8_t subtype, const char *format,...) PRINTF_ARGS(6
static void cfapi_map_set_map_property(int *type,...)
static std::vector< std::string > split(const std::string &field, const std::string &by)
void player_set_own_title(struct player *pl, const char *title)
Sets the custom title.
#define CFAPI_OBJECT_PROP_NEXT_ACTIVE_OB
#define CFAPI_OBJECT_PROP_MAXGP
int player_arrest(object *who)
Put a player into jail, taking into account cursed exits and player's region.
float move_slow_penalty
How much this slows down the object.
#define CFAPI_OBJECT_PROP_HIDDEN
static void cfapi_map_message(int *type,...)
static void cfapi_object_drain(int *type,...)
void fix_object(object *op)
Updates all abilities given by applied objects in the inventory of the given object.
void object_set_msg(object *op, const char *msg)
Set the message field of an object.
void object_remove(object *op)
This function removes the object op from the linked list of objects which it is currently tied to...
#define CFAPI_OBJECT_PROP_MOVE_STATUS
static void cfapi_object_insert(int *type,...)
uint32_t reset_timeout
How many seconds must elapse before this map should be reset.
player * first_player
First player.
int16_t maxgrace
Maximum grace.
New face structure - this enforces the notion that data is face by face only - you can not change the...
void knowledge_give(player *pl, const char *marker, const object *book)
Give a knowledge item from its code.
int remove_depletion(object *op, int level)
Remove depletion from op, if present, and warn player of such restorations.
const char * playerdir
Where the player files are.
static void cfapi_system_find_animation(int *type,...)
Wrapper for find_animation().
object * below
Pointer to the object stacked below this one.
#define CFAPI_OBJECT_PROP_SUBTYPE
partylist * party_get_next(const partylist *party)
Returns the next party from the list of all parties.
#define UP_OBJ_INSERT
Object was inserted.
int object_find_free_spot(const object *ob, mapstruct *m, int x, int y, int start, int stop)
object_find_free_spot(object, map, x, y, start, stop) will search for a spot at the given map and coo...
object * object_find_by_name(const object *who, const char *name)
Finds an object in inventory name.
uint32_t count
Any numbers typed before a command.
#define TIMER_ERR_ID
Invalid timer id.
#define CFAPI_REGION_PROP_JAIL_X
#define CFAPI_ARCH_PROP_MORE
#define SET_ANIMATION(ob, newanim)
void esrv_update_item(int flags, object *pl, object *op)
Updates object *op for player *pl.
#define CFAPI_OBJECT_PROP_CONTAINER
void(* command_function)(object *op, const char *params)
One command function.
partylist * party
Party this player is part of.
sstring slaying
Which race to do double damage to.
#define CFAPI_OBJECT_PROP_INVENTORY
static uint32_t NROF(const object *const ob)
Returns ob->nrof, unless it is 0, in which case return 1.
static void cfapi_system_find_string(int *type,...)
Wrapper for find_string().
sstring add_string(const char *str)
Share a string.
int32_t value
How much money it is worth (or contains)
#define NR_EVENTS
Number of events, maximum code + 1.
int8_t luck
Affects thaco and ac from time to time.
#define CFAPI_OBJECT_PROP_FLAGS
std::vector< region * > all_regions
object * above
Pointer to the object stacked above this one.
static void cfapi_object_split(int *type,...)
Wrapper for object_split().
#define CFAPI_PARTY_VECTOR
Pointer to a std::vector<partylist *>
void remove_friendly_object(object *op)
Removes the specified object from the linked list of friendly objects.
int object_teleport(object *op, mapstruct *map, int x, int y)
Move the specified object in a free spot around the map's x & y.
#define CFAPI_OBJECT_PROP_NAME_PLURAL
f_plug_api func
Function itself.
void change_exp(object *op, int64_t exp, const char *skill_name, int flag)
Changes experience to a player/monster.
sstring find_string(const char *str)
Searches a string in the shared strings.
Definitions for the plugin system.
DIR * opendir(const char *)
unsigned char MoveType
Typdef here to define type large enough to hold bitmask of all movement types.
char fullname[MAX_BUF]
Plugin full name.
#define CFAPI_OBJECT_PROP_OWNER
const char * party_get_password(const partylist *party)
Returns the party's password.
static void cfapi_system_directory(int *type,...)
int16_t y
Position in the map for this object.
static void cfapi_object_user_event(int *type,...)
int8_t magic
Any magical bonuses to this item.
#define CFAPI_OBJECT_PROP_MOVE_ON
#define CFAPI_OBJECT_PROP_MESSAGE
#define FREE_OBJ_NO_DESTROY_CALLBACK
Do not run the destroy callback.
static void cfapi_object_transmute(int *type,...)
static void cfapi_object_set_property(int *type,...)
Sets the property of an object.
uint16_t material
What materials this object consist of.
#define CFAPI_OBJECT_PROP_EXP_MULTIPLIER
static void cfapi_object_update(int *type,...)
Wrapper for object_update().
uint32_t reset_time
Server time when map gets reset, seconds since epoch.
MoveType move_block
What movement types this blocks.
Represents the ingame time.
#define plugins_dlclose(lib)
Unload a shared library.
#define CFAPI_MAP_PROP_RESET_TIMEOUT
static void cfapi_map_has_been_loaded(int *type,...)
Wrapper for has_been_loaded().
uint16_t height
Width and height of map.
static void copy_message(object *op, const char *msg)
Utility function to copy the string to op->msg.
#define CFAPI_PLAYER_QUEST_START
object * attacked_by
This object start to attack us! only player & monster.
int16_t duration
Number of moves (see 'speed') spell lasts.
MoveType move_on
Move types affected moving on to this space.
void create_overlay_pathname(const char *name, char *buf, size_t size)
Same as create_pathname(), but for the overlay maps.
static void cfapi_object_fix(int *type,...)
object * chosen_skill
The skill chosen to use.
#define CFAPI_SYSTEM_ARCHETYPES
#define CFAPI_REGION_PROP_NEXT
command_registration command_register(const char *name, uint8_t type, command_function func, float time)
Register a player-issued command.
void object_set_owner(object *op, object *owner)
Sets the owner and sets the skill and exp pointers to owner's current skill and experience objects...
int object_distance(const object *ob1, const object *ob2)
Return the square of the distance between the two given objects.
uint32_t path_repelled
Paths the object is repelled from.
static void cfapi_object_clean_object(int *type,...)
static void cfapi_system_register_global_event(int *type,...)
#define CFAPI_MAP_PROP_NEXT
#define CFAPI_OBJECT_PROP_SLAYING
int is_friendly(const object *op)
Checks if the given object is already in the friendly list or not.
struct player * contr
Pointer to the player which control this object.
double expmul
needed experience = (calc_exp*expmul) - means some races/classes can need less/more exp to gain level...
object * object_find_by_arch_name(const object *who, const char *name)
Find object in inventory by archetype name.
void draw_ext_info(int flags, int pri, const object *pl, uint8_t type, uint8_t subtype, const char *message)
Sends message to player(s).
char * longname
Official title of the region, this might be defined to be the same as name.
uint8_t anim_speed
Ticks between animation-frames.
char * host
Which host it is connected from (ip address).
static void cfapi_map_change_light(int *type,...)
Wrapper for change_map_light().
#define CFAPI_OBJECT_PROP_CHOSEN_SKILL
void initPlugins(void)
Plugins initialization.
#define CFAPI_OBJECT_PROP_OTHER_ARCH
#define CFAPI_OBJECT_PROP_LAST_SP
archetype * try_find_archetype(const char *name)
#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 *>
static void cfapi_get_month_name(int *type,...)
Wrapper for get_season_name().
int32_t weight
Attributes of the object.
#define CFAPI_OBJECT_PROP_LAST_GRACE
object * transport
Transport the player is in.
#define CFAPI_OBJECT_PROP_COUNT
mapstruct * get_empty_map(int sizex, int sizey)
Creates and returns a map of the specific size.
archetype * head
The main part of a linked object.
static void cfapi_object_check_trigger(int *type,...)
Wrapper for check_trigger().
void command_say(object *op, const char *params)
'say' command.
#define MOVE_ALL
Mask of all movement types.
uint8_t run_away
Monster runs away if it's hp goes below this percentage.
static void cfapi_system_find_face(int *type,...)
Wrapper for find_face().
f_plug_postinit closefunc
Plugin Termination function.
object * object_create_clone(object *asrc)
Create clone from object to another.
AssetsManager * getManager()
#define CFAPI_REGION_VECTOR
Pointer to a std::vector<region *>
static void cfapi_object_identify(int *type,...)
Wrapper for identify().
static crossfire_plugin * plugins_find_plugin(const char *id)
Find a plugin from its internal name.
static void cfapi_friendlylist_get_next(int *type,...)
Friend list access, to get objects on it.
const Face * try_find_face(const char *name, const Face *error)
int change_abil(object *op, object *tmp)
Permanently alters an object's stats/flags based on another object.
void free_string(sstring str)
This will reduce the refcount, and if it has reached 0, str will be freed.
#define CFAPI_PLAYER_PROP_BED_X
int is_magical(const object *op)
Checks whether object is magical.
uint32_t update_look
If true, we need to send the look window.
int16_t level
Level of creature or object.
static void cfapi_object_apply(int *type,...)
Applies an object.
#define CFAPI_MAP_PROP_PLAYERS
object * object_decrease_nrof(object *op, uint32_t i)
Decreases a specified number from the amount of an object.
int move_to(object *op, int x, int y)
Move an object one square toward a specified destination on the same map.
#define CFAPI_OBJECT_PROP_FACING
void object_free(object *ob, int flags)
Frees everything allocated by an object, removes it from the list of used objects, and puts it on the list of free objects.
player * next
Pointer to next player, NULL if this is last.
#define MSG_TYPE_COMMAND
Responses to commands, eg, who.
int plugins_init_plugin(const char *libfile)
Try to load the specified plugin.
uint8_t hide
The object is hidden, not invisible.
#define CFAPI_PLAYER_PROP_IP
static void cfapi_get_hooks(int *type,...)
int16_t resist[NROFATTACKS]
Resistance adjustments for attacks.
#define CFAPI_OBJECT_PROP_ENVIRONMENT
static void cfapi_system_get_object_vector(int *type,...)
#define CFAPI_OBJECT_PROP_GP
#define CFAPI_OBJECT_PROP_CHA
#define CFAPI_PARTY_PROP_PLAYER
int plugins_remove_plugin(const char *id)
Unload the specified plugin.
static void cfapi_system_check_path(int *type,...)
Wrapper for check_path().
object * identify(object *op)
Identifies an item.
The archetype structure is a set of rules on how to generate and manipulate objects which point to ar...
#define CFAPI_OBJECT_PROP_ATTACKED_BY
sstring materialname
Specific material name.
#define CFAPI_OBJECT_PROP_MOVE_SLOW_PENALTY
#define CFAPI_PLAYER_PROP_COUNT
sstring name
More definite name, like "generate_kobold".
#define CFAPI_MAP_PROP_UNIQUE
uint32_t unique
If set, this is a per player unique map.
static void cfapi_system_strdup_local(int *type,...)
Wrapper for strdup_local().
command_registration command_register_extra(const char *name, const char *extra, uint8_t type, command_function_extra func, float time)
Register a player-issued command with an extra parameter.
char * msg
Message map creator may have left.
int knowledge_player_knows(const player *pl, const char *knowledge)
Determines whether a player knows a specific knowledge or not.
void *(* f_plug_property)(int *type,...)
Get various plugin properties.
#define CFAPI_OBJECT_PROP_INT
static void cfapi_object_delete(int *type,...)
#define CFAPI_MAP_PROP_RESET_TIME
float speed
Frequency of object 'moves' relative to server tick rate.
int32_t carrying
How much weight this object contains.
#define CFAPI_ARCH_PROP_HEAD
void monster_npc_say(object *npc, const char *cp)
Simple function to have some NPC say something.
static void cfapi_player_message(int *type,...)
#define CFAPI_OBJECT_PROP_LEVEL
char path[HUGE_BUF]
Filename of the map.
#define FOR_ABOVE_FINISH()
Finishes FOR_ABOVE_PREPARE().
const char * tmpdir
Directory to use for temporary files.
static void cfapi_object_distance(int *type,...)
Wrapper for object_distance().
object * env
Pointer to the object which is the environment.
#define CFAPI_OBJECT_PROP_HEAD
int32_t last_sp
As last_heal, but for spell points.
#define CFAPI_PLAYER_PROP_BED_MAP
#define QUERY_FLAG(xyz, p)
#define CFAPI_OBJECT_PROP_MOVE_ALLOW
static void cfapi_object_give_skill(int *type,...)
static void cfapi_object_say(int *type,...)
#define CFAPI_OBJECT_PROP_RAW_NAME
void player_get_title(const player *pl, char *buf, size_t bufsize)
Returns the player's title.
uint64_t command_registration
Identifier when registering a command.
uint8_t pick_up
See crossfire.doc.
#define CFAPI_ARCH_PROP_NEXT
std::vector< std::string > disabled_plugins
List of disabled plugins, 'All' means all.
void query_name(const object *op, char *buf, size_t size)
Describes an item.
std::vector< crossfire_plugin * > plugins_list
List of loaded plugins.
#define PERM_EXP(exptotal)
Convert saved total experience into permanent experience.
void object_set_cheat(object *op)
object_set_cheat(object) sets the cheat flag (WAS_WIZ) in the object and in all it's inventory (recur...
void object_free_drop_inventory(object *ob)
Frees everything allocated by an object, removes it from the list of used objects, and puts it on the list of free objects.
short freearr_x[SIZEOFFREE]
X offset when searching around a spot.
uint64_t query_money(const object *op)
Determine the amount of money the given object contains, including what is inside containers...
One function the server exposes to plugins.
void clean_object(object *op)
Remove and free all objects in the inventory of the given object.
void(* command_function_extra)(object *op, const char *params, const char *extra)
One command function, with a custom parameter specified at registration time.
int(* f_plug_postinit)(void)
Function called after the plugin was initialized.
#define FOR_INV_FINISH()
Finishes FOR_INV_PREPARE().
static void cfapi_map_delete_map(int *type,...)
socket_struct * socket
Socket information for this player.
sstring msg
If this is a book/sign/magic mouth/etc.
char * name
Shortend name of the region as maps refer to it.
object * head
Points to the main object of a large body.
static void cfapi_object_on_same_map(int *type,...)
#define CFAPI_ARCHETYPE_VECTOR
Pointer to a std::vector<archetype *>
sstring race
Human, goblin, dragon, etc.
static void cfapi_player_knowledge(int *type,...)
Wrapper for knowledge-related functions().
void object_reset(object *op)
Totally resets the specified object, without freeing associated memory.
const Animations * animation
Animation of this item, NULL if not animated.
#define CFAPI_OBJECT_PROP_FP
static void cfapi_system_get_region_vector(int *type,...)
static void cfapi_region_get_property(int *type,...)
Regions-related functions.
void update_all_los(const mapstruct *map, int x, int y)
This function makes sure that update_los() will be called for all players on the given map within the...
#define FOR_ABOVE_PREPARE(op_, it_)
Constructs a loop iterating over all objects above an object.
#define CFAPI_OBJECT_PROP_MAGICAL
int calculate_difficulty(mapstruct *m)
This routine is supposed to find out the difficulty of the map.
static void cfapi_unregister_command(int *type,...)
static void cfapi_system_get_archetype_vector(int *type,...)
static void cfapi_object_spring_trap(int *type,...)
int change_map_light(mapstruct *m, int change)
Used to change map light level (darkness) up or down.
ServerSettings serverSettings
static void send_changed_object(object *op)
Notify clients about a changed object.
static void cfapi_object_perm_exp(int *type,...)
Wrapper for permanent experience calculation.
Archetypes * archetypes()
Get archetypes.
static void cfapi_map_trigger_connected(int *type,...)
Wrapper for trigger_connected().
Used to link together several objects.
#define CFAPI_OBJECT_PROP_LAST_EAT
int out_of_map(mapstruct *m, int x, int y)
Return 1 if coordinates X and Y are out of the map M, taking into account tiling. ...
sstring object_get_value(const object *op, const char *const key)
Get an extra value by key.
char * partyname
Party name.
static void cfapi_set_random_map_variable(int *type,...)
Wrapper for set_random_map_variable().
int pay_for_amount(uint64_t to_pay, object *pl)
Takes the amount of money from the the player inventory and from it's various pouches using the pay_f...
#define CFAPI_OBJECT_PROP_MOVE_OFF
#define CFAPI_OBJECT_PROP_WEIGHT_LIMIT
#define CFAPI_PLAYER_QUEST_SET_STATE
object * ob
The object representing the player.
const Face * face
Face with colors.
static void cfapi_object_remove(int *type,...)
int8_t glow_radius
indicates the glow radius of the object
#define CFAPI_OBJECT_PROP_CURRENT_WEAPON
uint32_t mark_count
Count of marked object.
#define P_OUT_OF_MAP
This space is outside the map.
int move_ob(object *op, int dir, object *originator)
Op is trying to move in direction dir.
int cftimer_destroy(int id)
Destroys an existing timer.
#define CFAPI_OBJECT_PROP_X
void do_learn_spell(object *op, object *spell, int special_prayer)
Actually makes op learn spell.
static void cfapi_object_clear(int *type,...)
Wrapper for object_clear().
mapstruct * first_map
First map.
static void cfapi_object_describe(int *type,...)
Wrapper for describe_item().
#define CFAPI_OBJECT_PROP_CHEATER
int pay_for_item(object *op, object *pl, uint64_t reduction)
Player attemps to buy an item, if she has enough money then remove coins as needed from active contai...
#define CFAPI_OBJECT_PROP_PICKABLE
struct Settings settings
Global settings.
uint8_t state
How the object was last drawn (animation)
uint8_t ignore_plugin_compatibility
If set, don't check plugin version.
archetype * get_next_archetype(archetype *current)
static void cfapi_object_learn_spell(int *type,...)
#define CFAPI_MAP_PROP_MESSAGE
sstring lore
Obscure information about this object, to get put into books and the like.
object * object_get_env_recursive(object *op)
Utility function.
#define CFAPI_OBJECT_PROP_ENEMY
#define CFAPI_REGION_PROP_JAIL_Y
object * object_new(void)
Grabs an object from the list of unused objects, makes sure it is initialised, and returns it...
object * object_present_in_ob(uint8_t type, const object *op)
Searches for any objects with a matching type variable in the inventory of the given object...
object * get_next_friend(object *current)
Get the next object on the friendly list.
object * find_marked_object(object *op)
Return the object the player has marked with the 'mark' command below.
#define CFAPI_OBJECT_PROP_PATH_REPELLED
int16_t bed_y
x,y - coordinates of respawn (savebed).
static void cfapi_object_apply_below(int *type,...)
Applies an object below.
uint16_t number
This is the image unique identifier.
static void cfapi_object_pay_amount(int *type,...)
Wrapper for pay_for_amount().
int16_t dam
How much damage this object does when hitting.
#define CFAPI_MAP_PROP_TMPNAME
static void cfapi_object_merge(int *type,...)
Wrapper for object_merge().
region * parent
Pointer to the region that is a parent of the current region, if a value isn't defined in the current...
static void cfapi_register_command(int *type,...)
char savebed_map[MAX_BUF]
Map where player will respawn after death.
static void cfapi_object_get_property(int *type,...)
Main object property getter.
uint32_t path_denied
Paths the object is denied access to.
#define CFAPI_OBJECT_PROP_LORE
partylist * party_get_first(void)
Returns the first party from the list of all parties.
#define CFAPI_OBJECT_PROP_ITEM_POWER
static void cfapi_system_get_map_vector(int *type,...)
#define CFAPI_REGION_PROP_LONGNAME
#define MSG_TYPE_COMMAND_DEBUG
Various debug type commands.
living stats
Str, Con, Dex, etc.
const char * re_cmp(const char *, const char *)
re-cmp - get regular expression match.
#define MAX_BUF
Used for all kinds of things.
static void cfapi_timer_create(int *type,...)
Wrapper for cfapi_timer_create().
int quest_get_player_state(player *pl, sstring quest_code)
Get the quest state for a player.
static void cfapi_object_find_by_name(int *type,...)
#define CFAPI_PARTY_PROP_NAME
#define CFAPI_PLAYER_PROP_PARTY
int16_t invisible
How much longer the object will be invis.
static void cfapi_object_check_spell(int *type,...)
Wrapper for check_spell_known().
LogLevel
Log levels for the LOG() function.
void add_friendly_object(object *op)
Add a new friendly object to the list of friendly objects.
void drop(object *op, object *tmp)
Drop an item, either on the floor or in a container.
#define CFAPI_OBJECT_PROP_EXP
void delete_map(mapstruct *m)
Frees the map, including the mapstruct.
size_t strlcpy(char *dst, const char *src, size_t size)
Portable implementation of strlcpy(3).
static void cfapi_object_cast(int *type,...)
Wrapper for query_money().
object * map_find_by_archetype(mapstruct *m, int x, int y, const archetype *at)
Searches for any objects with a matching archetype at the given map and coordinates.
mapstruct * get_map_from_coord(mapstruct *m, int16_t *x, int16_t *y)
This is basically the same as out_of_map above(), but instead we return NULL if no map is valid (coor...
float speed_left
How much speed is left to spend this round.
object * arch_present_in_ob(const archetype *at, const object *op)
Searches for any objects with a matching archetype in the inventory of the given object.
void object_copy(const object *src_ob, object *dest_ob)
Copy object first frees everything allocated by the second object, and then copies the contents of th...
#define NR_OF_HOOKS
Number of hooked functions a plugin can call.
static void cfapi_object_move(int *type,...)
Moves an object.
struct mapstruct * map
Pointer to the map in which this object is present.
#define plugins_dlerror()
Library error.
object * mark
Marked object.
const char * confdir
Configuration files.
int object_can_pick(const object *who, const object *item)
Finds out if an object can be picked up.
static void cfapi_object_remove_depletion(int *type,...)
#define CFAPI_OBJECT_PROP_TOTAL_EXP
short freearr_y[SIZEOFFREE]
Y offset when searching around a spot.
object * object_present_in_ob_by_name(int type, const char *str, const object *op)
Searches for any objects with a matching type & name variable in the inventory of the given object...
static const flag_definition flags[]
Flag mapping.
object * object_create_arch(archetype *at)
Create a full object using the given archetype.
int8_t facing
Object is oriented/facing that way.
const char * uniquedir
Directory for the unique items.
void cleanupPlugins(void)
Call the crossfire_plugin::closefunc on the various plugins, used at server shutdown.
object * object_merge(object *op, object *top)
This function goes through all objects below and including top, and merges op to the first matching o...
#define CFAPI_OBJECT_PROP_DAM
#define CFAPI_OBJECT_PROP_MOVE_TYPE
const char * datadir
Read only data files.
#define CFAPI_OBJECT_PROP_SKILL
struct archetype * other_arch
Pointer used for various things - mostly used for what this objects turns into or what this object cr...
int16_t enter_y
Enter_x and enter_y are default entrance coordinates to use for a map such that when an exit specifie...
#define CFAPI_PLAYER_PROP_NEXT
char * jailmap
Where a player that is arrested in this region should be imprisoned.
#define CFAPI_OBJECT_PROP_AC
#define CFAPI_SYSTEM_PLAYERS
void get_tod(timeofday_t *tod)
Computes the ingame time of the day.
#define SET_MAP_FLAGS(M, X, Y, C)
Sets map flags.
static void cfapi_object_reset(int *type,...)
Wrapper for clear_reset().
#define CFAPI_OBJECT_PROP_BASE_NAME
#define TIMER_ERR_NONE
No error.
uint16_t num
Where we are in the array.
#define CFAPI_REGION_PROP_PARENT
sstring name_pl
The plural name of the object.
void query_base_name(const object *op, int plural, char *buf, size_t size)
Query a short name for the item.
void transmute_materialname(object *op, const object *change)
When doing transmutation of objects, we have to recheck the resistances, as some that did not apply p...
static void cfapi_player_find(int *type,...)
Wrapper for find_player_partial_name().
static void cfapi_object_find_by_arch_name(int *type,...)
object * active_next
Next object in the 'active' list This is used in process_events so that the entire object list does n...
#define CFAPI_ARCH_PROP_NAME
static void cfapi_object_forget_spell(int *type,...)
void quest_set_player_state(player *pl, sstring quest_code, int state)
Set the state of a quest for a player.
Variables for the custom timers.
static event_registration m
object * container
Current container being used.
char * create_pathname(const char *name, char *buf, size_t size)
Get the full path to a map file.
int set_random_map_variable(RMParms *rp, const char *buf)
#define CFAPI_OBJECT_PROP_SPEED_LEFT
#define FREE_AND_COPY(sv, nv)
Release the shared string if not NULL, and make it a reference to nv.
int(* f_plug_event)(int *type,...)
Function to call to handle global or object-related events.
int16_t jaily
The coodinates in jailmap to which the player should be sent.
int cftimer_create(int id, long delay, object *ob, int mode)
Creates a new timer.
const char * localdir
Read/write data files.
Animations * try_find_animation(const char *name)
MoveType move_type
Type of movement this object uses.
sstring name
The name of the object, obviously...
#define CFAPI_OBJECT_PROP_HP
sstring title
Of foo, etc.
object * spellitem
Spell ability monster is choosing to use.
Only for debugging purposes.
uint32_t nrof
Number of objects.
int get_map_flags(mapstruct *oldmap, mapstruct **newmap, int16_t x, int16_t y, int16_t *nx, int16_t *ny)
This rolls up wall, blocks_magic, blocks_view, etc, all into one function that just returns a P_...
#define CFAPI_OBJECT_PROP_TITLE
void drain_specific_stat(object *op, int deplete_stats)
Drain a specified stat from op.
static void cfapi_object_teleport(int *type,...)
Teleports an object at a specified destination if possible.
int cftimer_find_free_id(void)
Finds a free ID for a new timer.
uint8_t darkness
Indicates level of darkness of map.
MoveType move_off
Move types affected moving off this space.
const char * mapdir
Where the map files are.
#define string_get_int(name)
#define CFAPI_PLAYER_PROP_BED_Y
MoveType move_allow
What movement types explicitly allowed.
#define CFAPI_OBJECT_PROP_SPEED
static void cfapi_get_season_name(int *type,...)
Wrapper for get_season_name().
void object_set_enemy(object *op, object *enemy)
Sets the enemy of an object.
static const hook_entry plug_hooks[]
All hooked functions plugins can call.
#define CFAPI_MAP_PROP_PATH
static void cfapi_object_get_key(int *type,...)
Gets a key/value value for an object.
static void cfapi_get_time(int *type,...)
Wrapper for get_tod().
#define CFAPI_OBJECT_PROP_FRIENDLY
char * msg
The description of the region.
#define CLEAR_FLAG(xyz, p)
#define CFAPI_OBJECT_VECTOR
Pointer to a std::vector<object *>
uint8_t type
PLAYER, BULLET, etc.
#define CFAPI_OBJECT_PROP_ANIM_SPEED
int8_t ac
Armor Class, lower AC increases probability of not getting hit.
#define CFAPI_OBJECT_PROP_LUCK
void party_join(object *op, partylist *party)
Makes a player join a party.
struct dirent * readdir(DIR *)
#define CFAPI_OBJECT_PROP_ARCH_NAME
object * active_prev
Previous object in the 'active list This is used in process_events so that the entire object list doe...
#define CFAPI_OBJECT_PROP_INVISIBLE_TIME
#define CFAPI_OBJECT_PROP_DEX
void object_update_speed(object *op)
Updates the speed of an object.
#define CFAPI_OBJECT_PROP_ATTACK_MOVEMENT
#define CFAPI_MAP_PROP_REGION
void events_unregister_global_handler(int eventcode, event_registration id)
Remove a global event handler.
uint16_t client_type
Public type information.
int object_set_value(object *op, const char *key, const char *value, int add_key)
Updates the key in op to value.
object * inv
Pointer to the first object in the inventory.
char * tmpname
Name of temporary file.
#define CFAPI_MAP_PROP_WIDTH
static void cfapi_player_quest(int *type,...)
Quest-related wrappers, for all quest-related operations.
#define CFAPI_OBJECT_PROP_CON
static void cfapi_player_can_pay(int *type,...)
Wrapper for can_pay().
sstring name
Name of the animation sequence.
#define CFAPI_PLAYER_QUEST_WAS_COMPLETED
char * cost_string_from_value(uint64_t cost, int largest_coin)
Converts a price to number of coins.
#define CFAPI_PARTY_PROP_NEXT
event_registration global_registration[NR_EVENTS]
Global event registration identifiers.
int64_t total_exp
All exp ever earned (used to calc perm_exp)
int8_t gen_sp_armour
Sp regen penalty this object has (was last_heal)
archetype * find_archetype_by_object_name(const char *name)
This function retrieves an archetype given the name that appears during the game (for example...
#define GET_MAP_OB(M, X, Y)
Gets the bottom object on a map.
#define CFAPI_OBJECT_PROP_NROF
sstring skill
Name of the skill this object uses/grants.
static void cfapi_get_periodofday_name(int *type,...)
Wrapper for get_season_name().
int16_t maxsp
Max spell points.
uint32_t attacktype
Bitmask of attacks this object does.
#define CFAPI_OBJECT_PROP_MAXSP
#define CFAPI_ARCH_PROP_CLONE
static void cfapi_party_get_property(int *type,...)
Party-related functions.
object * give_skill_by_name(object *op, const char *skill_name)
Given the skill name skill_name, we find the skill archetype/object, set appropriate values...
#define NDI_UNIQUE
Print immediately, don't buffer.
int32_t last_heal
Last healed.
#define CFAPI_PLAYER_PROP_MARKED_ITEM
static void cfapi_timer_destroy(int *type,...)
Wrapper for cftimer_destroy().
const char * get_season_name(const int index)
give access to season names
#define CFAPI_OBJECT_PROP_LAST_HEAL
#define CFAPI_OBJECT_PROP_CLIENT_TYPE
#define CFAPI_OBJECT_PROP_INVISIBLE
bool pick_up(object *op, object *alt)
Try to pick up an item.
C function wrappers to interact with assets.
void events_unregister_object_handler(const char *id)
Remove an object event handler.
#define CFAPI_OBJECT_PROP_TYPE
event_registration events_register_global_handler(int eventcode, f_plug_event hook)
Register a global event handler.
mapstruct * has_been_loaded(const char *name)
Checks whether map has been loaded.
#define CFAPI_OBJECT_PROP_POW
static void cfapi_system_get_party_vector(int *type,...)
archetype * more
Next part of a linked object.
static void cfapi_map_update_position(int *type,...)
Wrapper for update_position().
#define FLAG_WAS_WIZ
Player was once a wiz.
#define CFAPI_OBJECT_PROP_GEN_SP_ARMOUR
f_plug_property propfunc
Plugin getProperty function.
int transfer_ob(object *op, int x, int y, int randomly, object *originator)
Move an object (even linked objects) to another spot on the same map.
int32_t food
How much food in stomach.
#define CFAPI_OBJECT_PROP_GLOW_RADIUS
static void cfapi_object_change_exp(int *type,...)
Wrapper for change_exp().
object * current_weapon
Pointer to the weapon currently used.
static void cfapi_archetype_get_property(int *type,...)
int events_execute_object_user(object *op, object *activator, object *third, const char *message, int fix)
Execute an EVENT_USER on the specified object.
static void cfapi_map_out_of_map(int *type,...)
Wrapper for out_of_map().
#define CFAPI_OBJECT_PROP_PRESENT
#define CFAPI_SYSTEM_PARTIES
#define CFAPI_OBJECT_PROP_MERGEABLE
#define CFAPI_OBJECT_PROP_WC
int16_t maxhp
Max hit points.
uint8_t subtype
Subtype of object.
#define CFAPI_OBJECT_PROP_RESIST
#define CFAPI_OBJECT_PROP_SHORT_NAME
#define CFAPI_OBJECT_PROP_MOVE_SLOW
object * object_get_player_container(object *op)
Finds the player carrying an object.
#define CFAPI_OBJECT_PROP_MATERIAL_NAME
int32_t weight_limit
Weight-limit of object.
#define CFAPI_SYSTEM_REGIONS
static void cfapi_generate_random_map(int *type,...)
Wrapper for generate_random_map().
mapstruct * next
Next map, linked list.
object * object_insert_in_ob(object *op, object *where)
This function inserts the object op in the linked list inside the object environment.
object * object_insert_in_map_at(object *op, mapstruct *m, object *originator, int flag, int x, int y)
Same as object_insert_in_map() except it handle separate coordinates and do a clean job preparing mul...
static void cfapi_map_get_map_property(int *type,...)
int8_t wc
Weapon Class, lower WC increases probability of hitting.
static void cfapi_cost_string_from_value(int *type,...)
Wrapper for cost_string_from_value, modified to take a buffer and length instead of a StringBuffer...
static void cfapi_object_transfer(int *type,...)
Object transfer.
#define CFAPI_OBJECT_PROP_MAXHP
int can_pay(object *pl)
Checks all unpaid items in op's inventory, adds up all the money they have, and checks that they can ...
void object_update(object *op, int action)
object_update() updates the array which represents the map.
tag_t count
Unique object number for this object.
mapstruct * ready_map_name(const char *name, int flags)
Makes sure the given map is loaded and swapped in.
#define CFAPI_OBJECT_PROP_VALUE
#define COMMAND_TYPE_NORMAL
Standard commands.
#define CFAPI_OBJECT_PROP_SPELL_ITEM
static void cfapi_map_find_by_archetype_name(int *type,...)
Kinda wrapper for map_find_by_archetype() (but uses a string, not an archetype*). ...
int32_t move_status
What stage in attack mode.
#define CFAPI_OBJECT_PROP_PATH_ATTUNED
int(* f_plug_init)(const char *iversion, f_plug_api gethooksptr)
First function called in a plugin.
void void ext_info_map(int color, const mapstruct *map, uint8_t type, uint8_t subtype, const char *str1)
Writes to everyone on the specified map.
LIBPTRTYPE libptr
Pointer to the plugin library.
void query_short_name(const object *op, char *buf, size_t size)
query_short_name(object) is similar to query_name(), but doesn't contain any information about object...
int16_t last_grace
As last_sp, except for grace.
static void cfapi_object_set_key(int *type,...)
Write a key/value for an object.
static void cfapi_object_query_money(int *type,...)
Wrapper for query_money().
player * find_player_partial_name(const char *plname)
Find a player by a partial name.
#define CFAPI_OBJECT_PROP_WIS
int quest_was_completed(player *pl, sstring quest_code)
Check if a quest was completed once for a player, without taking account the current state...
int object_can_merge(object *ob1, object *ob2)
Examines the 2 objects given to it, and returns true if they can be merged together, including inventory.
#define CFAPI_OBJECT_PROP_DURATION
#define CFAPI_MAP_PROP_ENTER_X
void object_clear(object *op)
Frees everything allocated by an object, and also clears all variables and flags to default settings...
sstring name
Face name, as used by archetypes and such.
#define CFAPI_OBJECT_PROP_OB_ABOVE
#define CFAPI_OBJECT_PROP_Y
#define CFAPI_OBJECT_PROP_CUSTOM_NAME
object clone
An object from which to do object_copy()
void(* f_plug_api)(int *type,...)
General API function.
static void cfapi_get_weekday_name(int *type,...)
Wrapper for get_season_name().
#define CUSTOM_NAME_FIELD
Key in an object for the player-assigned custom name.
#define CFAPI_OBJECT_PROP_PREV_ACTIVE_OB
#define FOR_INV_PREPARE(op_, it_)
Constructs a loop iterating over the inventory of an object.
static void cfapi_map_create_path(int *type,...)
Wrapper for create_pathname() and create_overlay_pathname().
int cast_spell(object *op, object *caster, int dir, object *spell_ob, char *stringarg)
Main dispatch when someone casts a spell.
#define CFAPI_OBJECT_PROP_PATH_DENIED
#define CFAPI_OBJECT_PROP_MOVE_BLOCK
char * name
Name of map as given by its creator.
static void cfapi_object_pay_item(int *type,...)
Wrapper for pay_for_item().
#define CFAPI_REGION_PROP_NAME
mapstruct * generate_random_map(const char *OutFileName, RMParms *RP, char **use_layout, sstring reset_group)
Main random map routine.
uint32_t path_attuned
Paths the object is attuned to.
const Face * get_face_by_id(uint16_t id)
Get a face from its unique identifier.
int32_t last_eat
How long since we last ate.
#define FLAG_FREED
Object is in the list of free objects.
object * enemy
Monster/player to follow even if not closest.
const char * get_weekday(const int index)
give access to weekday names
void each(std::function< void(T *)> op)
Apply a function to each asset.