 |
Crossfire Server, Trunk
1.75.0
|
Go to the documentation of this file.
45 #include "libloaderapi.h"
49 #define NR_OF_HOOKS (sizeof(plug_hooks)/sizeof(*plug_hooks))
270 if (!strcmp(
id,
plugin->id)) {
280 static char buf[256];
284 err = GetLastError();
285 if (FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM, NULL, err, 0,
buf,
sizeof (
buf), NULL) == 0)
286 snprintf(
buf,
sizeof (
buf),
"error %lu", err);
287 p = strchr(
buf,
'\0');
288 while (p >
buf && (p[-1] ==
'\r' || p[-1] ==
'\n'))
305 if (op->
env != NULL) {
335 va_start(args,
type);
336 request_type = va_arg(args,
int);
337 if (request_type == 0) {
340 fid = va_arg(args,
int);
352 buf = va_arg(args,
char *);
392 if (svn_rev == NULL) {
393 LOG(
llevError,
"Unable to find SvnRevPlugin in %s\n", libfile);
404 if (initfunc == NULL) {
410 if (propfunc == NULL) {
416 if (eventfunc == NULL) {
422 if (postfunc == NULL) {
428 if (closefunc == NULL) {
440 propfunc(&i,
"Identification", cp->
id,
sizeof(cp->
id));
459 for (
int eventcode = 0; eventcode <
NR_EVENTS; eventcode++) {
481 "List of loaded plugins:\n-----------------------");
486 cp->id, cp->fullname);
500 int length, largest_coin;
503 va_start(args,
type);
504 cost = va_arg(args, uint64_t);
505 largest_coin = va_arg(args,
int);
506 buffer = va_arg(args,
char*);
507 length = va_arg(args,
int);
517 strncpy(
buffer,
final, length - 1);
518 buffer[length - 1] =
'\0';
533 va_start(args,
type);
534 name = va_arg(args,
const char *);
535 num = va_arg(args,
int *);
539 (*num) = anim ? anim->
num : 0;
555 va_start(args,
type);
556 face = va_arg(args,
const char *);
557 error = va_arg(args,
int);
558 num = va_arg(args,
int *);
562 (*num) = f ? f->
number : 0;
576 va_start(args,
type);
577 txt = va_arg(args,
const char *);
578 ret = va_arg(args,
char **);
592 va_start(args,
type);
593 eventcode = va_arg(args,
int);
594 pname = va_arg(args,
char *);
612 va_start(args,
type);
613 eventcode = va_arg(args,
int);
614 pname = va_arg(args,
char *);
628 va_start(args,
type);
629 int property = va_arg(args,
int);
630 std::vector<object *> *
list = va_arg(args, std::vector<object *> *);
636 list->push_back(pl->ob);
656 va_start(args,
type);
657 int property = va_arg(args,
int);
658 std::vector<mapstruct *> *
list = va_arg(args, std::vector<mapstruct *> *);
663 list->push_back(map);
672 va_start(args,
type);
673 int property = va_arg(args,
int);
674 std::vector<archetype *> *
list = va_arg(args, std::vector<archetype *> *);
686 va_start(args,
type);
687 int property = va_arg(args,
int);
688 std::vector<region *> *
list = va_arg(args, std::vector<region *> *);
700 va_start(args,
type);
701 int property = va_arg(args,
int);
702 std::vector<partylist *> *
list = va_arg(args, std::vector<partylist *> *);
708 list->push_back(party);
727 va_start(args,
type);
728 str = va_arg(args,
const char *);
746 va_start(args,
type);
765 va_start(args,
type);
766 str = va_arg(args,
const char *);
785 va_start(args,
type);
787 name = va_arg(args,
char *);
788 prepend_dir = va_arg(args,
int);
789 ret = va_arg(args,
int *);
808 va_start(args,
type);
810 str = va_arg(args,
char *);
811 regexp = va_arg(args,
char *);
812 rv = va_arg(args,
const char **);
814 *rv =
re_cmp(str, regexp);
825 va_start(args,
type);
827 dirtype = va_arg(args,
int);
828 str = va_arg(args,
const char **);
877 va_start(args,
type);
885 #define string_get_int(name) \
889 va_start(args, type); \
890 index = va_arg(args, int); \
891 str = va_arg(args, const char **); \
893 *str = name(index); \
894 *type = CFAPI_STRING; \
963 va_start(args,
type);
964 ob = va_arg(args,
object *);
965 delay = va_arg(args,
long);
966 mode = va_arg(args,
int);
967 timer = va_arg(args,
int *);
993 va_start(args,
type);
994 id = va_arg(args,
int);
995 err = va_arg(args,
int *);
1012 va_start(args,
type);
1013 logLevel =
static_cast<LogLevel>(va_arg(args,
int));
1014 message = va_arg(args,
const char *);
1040 va_start(args,
type);
1042 ctype = va_arg(args,
int);
1046 x = va_arg(args,
int);
1047 y = va_arg(args,
int);
1053 name = va_arg(args,
const char *);
1054 x = va_arg(args,
int);
1061 nx = va_arg(args,
int);
1062 ny = va_arg(args,
int);
1087 va_start(args,
type);
1088 string = va_arg(args,
char *);
1106 va_start(args,
type);
1108 ctype = va_arg(args,
int);
1109 str = va_arg(args,
const char *);
1110 name = va_arg(args,
char *);
1111 size = va_arg(args,
int);
1146 va_start(args,
type);
1149 property = va_arg(args,
int);
1154 x = va_arg(args,
int);
1155 y = va_arg(args,
int);
1156 nx = va_arg(args, int16_t *);
1157 ny = va_arg(args, int16_t *);
1158 rint = va_arg(args,
int *);
1164 rint = va_arg(args,
int *);
1170 rstr = va_arg(args,
sstring *);
1176 rstr = va_arg(args,
sstring *);
1182 rstr = va_arg(args,
sstring *);
1188 rint = va_arg(args,
int *);
1194 rint = va_arg(args,
int *);
1200 rint = va_arg(args,
int *);
1206 rint = va_arg(args,
int *);
1212 rint = va_arg(args,
int *);
1218 rint = va_arg(args,
int *);
1224 rint = va_arg(args,
int *);
1230 rint = va_arg(args,
int *);
1236 rstr = va_arg(args,
sstring *);
1248 rreg = va_arg(args,
region **);
1254 rint = va_arg(args,
int *);
1272 va_start(args,
type);
1275 property = va_arg(args,
int);
1279 buf = va_arg(args,
const char *);
1302 va_start(args,
type);
1304 x = va_arg(args,
int);
1305 y = va_arg(args,
int);
1306 rint = va_arg(args,
int *);
1323 va_start(args,
type);
1326 x = va_arg(args,
int);
1327 y = va_arg(args,
int);
1337 va_start(args,
type);
1353 va_start(args,
type);
1355 string = va_arg(args,
const char *);
1356 color = va_arg(args,
int);
1376 va_start(args,
type);
1378 x = va_arg(args,
int);
1379 y = va_arg(args,
int);
1380 robj = va_arg(args,
object **);
1405 va_start(args,
type);
1407 msg = va_arg(args,
char *);
1409 x = va_arg(args,
int);
1410 y = va_arg(args,
int);
1411 robj = va_arg(args,
object **);
1431 va_start(args,
type);
1433 change = va_arg(args,
int);
1434 rint = va_arg(args,
int *);
1465 va_start(args,
type);
1466 kind = va_arg(args,
int);
1469 op = va_arg(args,
object *);
1470 direction = va_arg(args,
int);
1471 activator = va_arg(args,
object *);
1472 ret = va_arg(args,
int *);
1474 *ret =
move_ob(op, direction, activator);
1478 pl = va_arg(args,
player *);
1479 direction = va_arg(args,
int);
1480 ret = va_arg(args,
int *);
1486 op = va_arg(args,
object *);
1487 ret = va_arg(args,
int *);
1508 const char *keyname;
1512 va_start(args,
type);
1513 op = va_arg(args,
object *);
1514 keyname = va_arg(args,
const char *);
1515 value = va_arg(args,
const char **);
1530 const char *keyname;
1536 va_start(args,
type);
1537 op = va_arg(args,
object *);
1538 keyname = va_arg(args,
char *);
1539 value = va_arg(args,
char *);
1540 add_key = va_arg(args,
int);
1541 ret = va_arg(args,
int *);
1569 va_start(args,
type);
1571 op = va_arg(args,
object *);
1572 property = va_arg(args,
int);
1575 robject = va_arg(args,
object **);
1576 *robject = op->
above;
1581 robject = va_arg(args,
object **);
1582 *robject = op->
below;
1587 robject = va_arg(args,
object **);
1593 robject = va_arg(args,
object **);
1599 robject = va_arg(args,
object **);
1605 robject = va_arg(args,
object **);
1611 robject = va_arg(args,
object **);
1612 *robject = op->
head;
1617 robject = va_arg(args,
object **);
1629 rint = va_arg(args,
int *);
1635 rbuffer = va_arg(args,
char *);
1636 rbufsize = va_arg(args,
int);
1642 rsstring = va_arg(args,
sstring *);
1648 rsstring = va_arg(args,
sstring *);
1649 *rsstring = op->
title;
1654 rsstring = va_arg(args,
sstring *);
1655 *rsstring = op->
race;
1660 rsstring = va_arg(args,
sstring *);
1666 rsstring = va_arg(args,
sstring *);
1667 *rsstring = op->
skill;
1672 rsstring = va_arg(args,
sstring *);
1673 *rsstring = op->
msg;
1678 rsstring = va_arg(args,
sstring *);
1679 *rsstring = op->
lore;
1684 rint = va_arg(args,
int *);
1690 rint = va_arg(args,
int *);
1696 rfloat = va_arg(args,
float *);
1697 *rfloat = op->
speed;
1702 rfloat = va_arg(args,
float *);
1708 rint = va_arg(args,
int *);
1714 rint = va_arg(args,
int *);
1720 rint = va_arg(args,
int *);
1726 rint = va_arg(args,
int *);
1732 rint = va_arg(args,
int *);
1738 rint = va_arg(args,
int *);
1747 idx = va_arg(args,
int);
1748 resist = va_arg(args, int16_t *);
1749 *resist = op->
resist[idx];
1755 rint = va_arg(args,
int *);
1761 rint = va_arg(args,
int *);
1767 rint = va_arg(args,
int *);
1773 rint = va_arg(args,
int *);
1779 rint = va_arg(args,
int *);
1785 rsstring = va_arg(args,
sstring *);
1791 rint = va_arg(args,
int *);
1797 rlong = va_arg(args,
long *);
1803 rint = va_arg(args,
int *);
1809 rint = va_arg(args,
int *);
1815 rint = va_arg(args,
int *);
1821 rint = va_arg(args,
int *);
1827 rint = va_arg(args,
int *);
1833 rint = va_arg(args,
int *);
1839 rint = va_arg(args,
int *);
1845 rint = va_arg(args,
int *);
1851 rint = va_arg(args,
int *);
1857 rint = va_arg(args,
int *);
1863 rint = va_arg(args,
int *);
1869 rint = va_arg(args,
int *);
1875 rint = va_arg(args,
int *);
1881 rint64 = va_arg(args, int64_t *);
1887 robject = va_arg(args,
object **);
1893 robject = va_arg(args,
object **);
1894 *robject = op->
enemy;
1899 robject = va_arg(args,
object **);
1905 rint = va_arg(args,
int *);
1911 robject = va_arg(args,
object **);
1917 rint = va_arg(args,
int *);
1923 rint = va_arg(args,
int *);
1929 rint = va_arg(args,
int *);
1935 robject = va_arg(args,
object **);
1941 rdouble = va_arg(args,
double *);
1959 rsstring = va_arg(args,
sstring *);
1965 rint = va_arg(args,
int *);
1971 rint = va_arg(args,
int *);
1977 rbuffer = va_arg(args,
char *);
1978 rbufsize = va_arg(args,
int);
1986 i = va_arg(args,
int);
1987 rbuffer = va_arg(args,
char *);
1988 rbufsize = va_arg(args,
int);
1995 rsstring = va_arg(args,
sstring *);
1996 *rsstring = op->
name;
2001 rint = va_arg(args,
int *);
2007 rint = va_arg(args,
int *);
2013 rint64 = va_arg(args, int64_t *);
2019 robject = va_arg(args,
object **);
2027 stype = va_arg(args,
int);
2029 unsigned char ptype;
2034 ptype = (
unsigned char)(va_arg(args,
int));
2035 robject = va_arg(args,
object **);
2040 ptype = (
unsigned char)(va_arg(args,
int));
2041 buf = va_arg(args,
char *);
2042 robject = va_arg(args,
object **);
2048 robject = va_arg(args,
object **);
2057 rint = va_arg(args,
int *);
2065 op2 = va_arg(args,
object *);
2066 rint = va_arg(args,
int *);
2075 op2 = va_arg(args,
object *);
2076 rint = va_arg(args,
int *);
2085 fl = va_arg(args,
int);
2086 rint = va_arg(args,
int *);
2093 rint = va_arg(args,
int *);
2099 rint = va_arg(args,
int *);
2105 rint = va_arg(args,
int *);
2111 rint = va_arg(args,
int *);
2117 rint = va_arg(args,
int *);
2123 rint = va_arg(args,
int *);
2129 rint = va_arg(args,
int *);
2135 rint = va_arg(args,
int *);
2141 rint = va_arg(args,
int *);
2147 rint = va_arg(args,
int *);
2153 rint = va_arg(args,
int *);
2159 rint = va_arg(args,
int *);
2165 rint = va_arg(args,
int *);
2171 rint = va_arg(args,
int *);
2177 rint = va_arg(args,
int *);
2183 rint = va_arg(args,
int *);
2189 rint = va_arg(args,
int *);
2195 rsstring = va_arg(args,
sstring *);
2201 rsstring = va_arg(args,
sstring *);
2207 rint = va_arg(args,
int *);
2213 rsstring = va_arg(args,
sstring *);
2214 if (op->
face != NULL) {
2224 rsstring = va_arg(args,
sstring *);
2235 rint = va_arg(args,
int *);
2241 rsstring = va_arg(args,
sstring *);
2247 robject = va_arg(args,
object **);
2259 robject = va_arg(args,
object **);
2269 rbuffer = va_arg(args,
char *);
2270 rbufsize = va_arg(args,
int);
2276 robject = va_arg(args,
object **);
2318 rfloat = va_arg(args,
float *);
2324 rbuffer = va_arg(args,
char *);
2325 rbufsize = va_arg(args,
int);
2331 rint = va_arg(args,
int *);
2337 rint = va_arg(args,
int *);
2343 rint = va_arg(args,
int *);
2366 if (strlen(msg) == 0) {
2394 va_start(args,
type);
2395 op = va_arg(args,
object *);
2396 property = va_arg(args,
int);
2399 if (op != NULL && (!op->
arch || (op != &op->
arch->
clone))) {
2402 sarg = va_arg(args,
char *);
2409 sarg = va_arg(args,
char *);
2416 sarg = va_arg(args,
char *);
2422 sarg = va_arg(args,
char *);
2428 sarg = va_arg(args,
char *);
2434 sarg = va_arg(args,
char *);
2440 sarg = va_arg(args,
char *);
2446 sarg = va_arg(args,
char *);
2452 farg = va_arg(args,
double);
2454 if (farg != op->
speed) {
2461 farg = va_arg(args,
double);
2467 iarg = va_arg(args,
int);
2471 if (op->
nrof > (uint32_t)iarg)
2473 else if (op->
nrof < (uint32_t)iarg) {
2478 if (op->
env != NULL) {
2504 iarg = va_arg(args,
int);
2510 iarg = va_arg(args,
int);
2516 int iargbis = va_arg(args,
int);
2519 iarg = va_arg(args,
int);
2520 op->
resist[iargbis] = iarg;
2525 iarg = va_arg(args,
int);
2531 iarg = va_arg(args,
int);
2537 iarg = va_arg(args,
int);
2543 iarg = va_arg(args,
int);
2549 iarg = va_arg(args,
int);
2558 iarg = va_arg(args,
int);
2564 larg = va_arg(args,
long);
2570 iarg = va_arg(args,
int);
2577 iarg = va_arg(args,
int);
2583 iarg = va_arg(args,
int);
2589 iarg = va_arg(args,
int);
2595 iarg = va_arg(args,
int);
2601 iarg = va_arg(args,
int);
2607 iarg = va_arg(args,
int);
2613 iarg = va_arg(args,
int);
2619 iarg = va_arg(args,
int);
2625 iarg = va_arg(args,
int);
2627 if (op->
weight != iarg) {
2632 if (op->
env != NULL) {
2658 iarg = va_arg(args,
int);
2664 iarg = va_arg(args,
int);
2671 if (tmp->
map != NULL) {
2680 s64arg = va_arg(args, int64_t);
2686 oparg = va_arg(args,
object *);
2692 iarg = va_arg(args,
int);
2698 oparg = va_arg(args,
object *);
2704 iarg = va_arg(args,
int);
2710 iarg = va_arg(args,
int);
2716 iarg = va_arg(args,
int);
2722 oparg = va_arg(args,
object *);
2728 darg = va_arg(args,
double);
2734 sarg = va_arg(args,
char *);
2741 iarg = va_arg(args,
int);
2747 iarg = va_arg(args,
int);
2756 iarg = va_arg(args,
int);
2762 s64arg = va_arg(args, int64_t);
2768 oparg = va_arg(args,
object *);
2781 iarg = va_arg(args,
int);
2782 iargbis = va_arg(args,
int);
2793 iarg = va_arg(args,
int);
2799 iarg = va_arg(args,
int);
2805 iarg = va_arg(args,
int);
2811 iarg = va_arg(args,
int);
2817 iarg = va_arg(args,
int);
2823 iarg = va_arg(args,
int);
2829 iarg = va_arg(args,
int);
2835 iarg = va_arg(args,
int);
2841 iarg = va_arg(args,
int);
2847 iarg = va_arg(args,
int);
2853 iarg = va_arg(args,
int);
2859 iarg = va_arg(args,
int);
2865 iarg = va_arg(args,
int);
2871 iarg = va_arg(args,
int);
2877 iarg = va_arg(args,
int);
2883 iarg = va_arg(args,
int);
2889 iarg = va_arg(args,
int);
2896 sarg = va_arg(args,
char *);
2897 ret = va_arg(args,
int *);
2904 (*ret) =
face->number;
2912 sarg = va_arg(args,
char *);
2913 ret = va_arg(args,
int *);
2928 iarg = va_arg(args,
int);
2935 oparg = va_arg(args,
object *);
2955 sarg = va_arg(args,
char *);
2961 iarg = va_arg(args,
int);
2967 iarg = va_arg(args,
int);
2973 sarg = va_arg(args,
char *);
3037 va_start(args,
type);
3039 applier = va_arg(args,
object *);
3060 va_start(args,
type);
3062 applier = va_arg(args,
object *);
3063 applied = va_arg(args,
object *);
3064 aflags = va_arg(args,
int);
3065 ret = va_arg(args,
int *);
3080 object *op, **result;
3082 va_start(args,
type);
3084 op = va_arg(args,
object *);
3085 result = va_arg(args,
object **);
3105 va_start(args,
type);
3107 op = va_arg(args,
object *);
3108 owner = va_arg(args,
object *);
3109 desc = va_arg(args,
char *);
3110 size = va_arg(args,
int);
3115 strncpy(desc,
final, size);
3116 desc[size - 1] =
'\0';
3126 va_start(args,
type);
3128 op = va_arg(args,
object *);
3129 ds = va_arg(args,
int);
3144 va_start(args,
type);
3146 op = va_arg(args,
object *);
3147 level = va_arg(args,
int);
3148 result = va_arg(args,
int*);
3161 va_start(args,
type);
3163 op = va_arg(args,
object *);
3179 va_start(args,
type);
3181 op = va_arg(args,
object *);
3182 skillname = va_arg(args,
char *);
3196 va_start(args,
type);
3198 op = va_arg(args,
object *);
3199 chg = va_arg(args,
object *);
3211 va_start(args,
type);
3213 op = va_arg(args,
object *);
3232 va_start(args,
type);
3234 op = va_arg(args,
object *);
3237 LOG(
llevError,
"Plugin trying to free freed/non removed object %s\n", op->
name);
3261 va_start(args,
type);
3263 op = va_arg(args,
object *);
3264 kind = va_arg(args,
int);
3265 robj = va_arg(args,
object **);
3291 va_start(args,
type);
3292 ival = va_arg(args,
int);
3297 robj = va_arg(args,
object **);
3305 sval = va_arg(args,
const char *);
3306 robj = va_arg(args,
object **);
3335 va_start(args,
type);
3337 op = va_arg(args,
object *);
3339 LOG(
llevError,
"cfapi_object_insert: called with NULL object!\n");
3344 LOG(
llevError,
"cfapi_object_insert: called with FREED object!\n");
3349 LOG(
llevError,
"cfapi_object_insert: called with not removed object %s!\n", op->
name);
3352 itype = va_arg(args,
int);
3357 orig = va_arg(args,
object *);
3358 flag = va_arg(args,
int);
3359 x = va_arg(args,
int);
3360 y = va_arg(args,
int);
3361 robj = va_arg(args,
object **);
3363 LOG(
llevError,
"cfapi_object_insert (0): called with NULL map, object %s!\n", op->
name);
3373 orig = va_arg(args,
object *);
3374 flag = va_arg(args,
int);
3375 robj = va_arg(args,
object **);
3377 LOG(
llevError,
"cfapi_object_insert (1): called with NULL map, object %s!\n", op->
name);
3387 orig = va_arg(args,
object *);
3388 flag = va_arg(args,
int);
3389 x = va_arg(args,
int);
3390 y = va_arg(args,
int);
3391 robj = va_arg(args,
object **);
3393 LOG(
llevError,
"cfapi_object_insert (0): called with NULL map, object %s!\n", op->
name);
3409 orig = va_arg(args,
object *);
3410 robj = va_arg(args,
object **);
3412 LOG(
llevError,
"cfapi_object_insert (3): called with NULL orig, object %s!\n", op->
name);
3421 LOG(
llevError,
"cfapi_object_insert (1): called with itype %d which is not valid, object %s!\n", itype, op->
name);
3442 va_start(args,
type);
3444 op = va_arg(args,
object *);
3445 nr = va_arg(args,
int);
3446 buf = va_arg(args,
char *);
3447 size = va_arg(args,
int);
3448 split = va_arg(args,
object **);
3473 va_start(args,
type);
3475 op = va_arg(args,
object *);
3476 op2 = va_arg(args,
object *);
3477 merge = va_arg(args,
object **);
3495 va_start(args,
type);
3497 op = va_arg(args,
object *);
3498 op2 = va_arg(args,
object *);
3499 rint = va_arg(args,
int *);
3515 va_start(args,
type);
3517 op = va_arg(args,
object *);
3518 action = va_arg(args,
int);
3534 va_start(args,
type);
3536 op = va_arg(args,
object *);
3553 va_start(args,
type);
3555 op = va_arg(args,
object *);
3567 va_start(args,
type);
3568 op = va_arg(args,
object *);
3580 va_start(args,
type);
3581 op1 = va_arg(args,
object *);
3582 op2 = va_arg(args,
object *);
3583 rint = va_arg(args,
int *);
3595 va_start(args,
type);
3596 trap = va_arg(args,
object *);
3597 victim = va_arg(args,
object *);
3615 va_start(args,
type);
3616 op = va_arg(args,
object *);
3617 cause = va_arg(args,
object *);
3618 rint = va_arg(args,
int *);
3642 va_start(args,
type);
3644 cause = va_arg(args,
object *);
3645 state = va_arg(args,
int);
3661 va_start(args,
type);
3662 op = va_arg(args,
object *);
3663 rint = va_arg(args,
int *);
3684 va_start(args,
type);
3685 op = va_arg(args,
object *);
3686 caster = va_arg(args,
object *);
3687 dir = va_arg(args,
int);
3688 sp = va_arg(args,
object *);
3689 str = va_arg(args,
char *);
3690 rint = va_arg(args,
int *);
3700 *rint =
cast_spell(op, caster, dir, sp, str);
3709 va_start(args,
type);
3710 op = va_arg(args,
object *);
3711 sp = va_arg(args,
object *);
3712 prayer = va_arg(args,
int);
3724 va_start(args,
type);
3725 op = va_arg(args,
object *);
3726 sp = va_arg(args,
object *);
3744 va_start(args,
type);
3745 op = va_arg(args,
object *);
3746 spellname = va_arg(args,
char *);
3747 robj = va_arg(args,
object **);
3764 va_start(args,
type);
3765 op = va_arg(args,
object *);
3766 amount = va_arg(args, uint64_t);
3767 rint = va_arg(args,
int *);
3786 va_start(args,
type);
3787 tobuy = va_arg(args,
object *);
3788 op = va_arg(args,
object *);
3789 rint = va_arg(args,
int *);
3806 int x, y, randompos, ttype, flag;
3812 va_start(args,
type);
3813 op = va_arg(args,
object *);
3814 ttype = va_arg(args,
int);
3817 x = va_arg(args,
int);
3818 y = va_arg(args,
int);
3819 randompos = va_arg(args,
int);
3820 originator = va_arg(args,
object *);
3821 rint = va_arg(args,
int *);
3824 *rint =
transfer_ob(op, x, y, randompos, originator);
3831 originator = va_arg(args,
object *);
3832 flag = va_arg(args,
int);
3833 x = va_arg(args,
int);
3834 y = va_arg(args,
int);
3835 robj = va_arg(args,
object **);
3837 if (x < 0 || y < 0) {
3847 x = va_arg(args,
int);
3848 y = va_arg(args,
int);
3849 rint = va_arg(args,
int *);
3874 va_start(args,
type);
3875 op = va_arg(args,
object *);
3877 str = va_arg(args,
char *);
3878 robj = va_arg(args,
object **);
3881 if (*robj == NULL) {
3888 if (!strncmp(
name, str, strlen(str)))
3890 if (!strncmp(tmp->name, str, strlen(str)))
3893 if (tmp->slaying && !strcmp(tmp->slaying, str))
3908 va_start(args,
type);
3909 who = va_arg(args,
const object *);
3910 name = va_arg(args,
const char *);
3911 result = va_arg(args,
object **);
3924 va_start(args,
type);
3925 who = va_arg(args,
const object *);
3926 name = va_arg(args,
const char *);
3927 result = va_arg(args,
object **);
3944 va_start(args,
type);
3945 op = va_arg(args,
object *);
3946 author = va_arg(args,
object *);
3968 va_start(args,
type);
3969 op = va_arg(args,
object *);
3970 tmp = va_arg(args,
object *);
3971 rint = va_arg(args,
int *);
3985 va_start(args,
type);
3986 op = va_arg(args,
object *);
3987 msg = va_arg(args,
char *);
3988 rint = va_arg(args,
int *);
4011 va_start(args,
type);
4013 sval = va_arg(args,
char *);
4014 rpl = va_arg(args,
player **);
4029 va_start(args,
type);
4031 flags = va_arg(args,
int);
4032 pri = va_arg(args,
int);
4033 pl = va_arg(args,
object *);
4034 buf = va_arg(args,
const char *);
4053 va_start(args,
type);
4054 op = va_arg(args,
object *);
4055 rlong = va_arg(args, int64_t *);
4074 va_start(args,
type);
4075 ob = va_arg(args,
object *);
4076 exp = va_arg(args, int64_t);
4077 skill = va_arg(args,
const char *);
4078 flag = va_arg(args,
int);
4095 va_start(args,
type);
4096 pl = va_arg(args,
object *);
4097 rint = va_arg(args,
int *);
4113 const char *knowledge;
4115 va_start(args,
type);
4116 what = va_arg(args,
int);
4121 pl = va_arg(args,
object *);
4122 knowledge = va_arg(args,
const char *);
4123 rint = va_arg(args,
int *);
4127 if (pl->
contr == NULL) {
4128 LOG(
llevError,
"cfapi_player_knowledge: 'has' called for non player object %s", pl->
name);
4138 pl = va_arg(args,
object *);
4139 knowledge = va_arg(args,
const char *);
4141 if (pl->
contr != NULL)
4147 LOG(
llevError,
"cfapi_player_knowledge: invalid what %d", what);
4165 va_start(args,
type);
4166 who = va_arg(args,
object *);
4168 x = va_arg(args,
int);
4169 y = va_arg(args,
int);
4170 res = va_arg(args,
int *);
4182 va_start(args,
type);
4183 who = va_arg(args,
object *);
4184 what = va_arg(args,
object *);
4200 va_start(args,
type);
4202 prop = va_arg(args,
int);
4206 rsstring = va_arg(args,
sstring *);
4207 *rsstring = arch->
name;
4219 *rarch = arch->
head;
4225 *rarch = arch->
more;
4230 robject = va_arg(args,
object **);
4231 *robject = &arch->
clone;
4256 va_start(args,
type);
4258 prop = va_arg(args,
int);
4261 rsstring = va_arg(args,
sstring *);
4273 rsstring = va_arg(args,
sstring *);
4280 obarg = va_arg(args,
object *);
4281 rplayer = va_arg(args,
player **);
4283 for (; *rplayer != NULL; (*rplayer) = (*rplayer)->
next)
4284 if ((*rplayer)->ob->contr->party == party) {
4310 va_start(args,
type);
4311 reg = va_arg(args,
region *);
4312 prop = va_arg(args,
int);
4315 rsstring = va_arg(args,
sstring *);
4316 *rsstring = reg->
name;
4321 rregion = va_arg(args,
region **);
4327 rregion = va_arg(args,
region **);
4333 rsstring = va_arg(args,
sstring *);
4339 rsstring = va_arg(args,
sstring *);
4340 *rsstring = reg->
msg;
4346 rint = va_arg(args,
int*);
4352 rsstring = va_arg(args,
sstring *);
4380 va_start(args,
type);
4381 ob = va_arg(args,
object *);
4382 robject = va_arg(args,
object **);
4405 va_start(args,
type);
4407 buf = va_arg(args,
const char *);
4408 ret = va_arg(args,
int *);
4429 va_start(args,
type);
4430 name = va_arg(args,
const char *);
4432 use_layout = va_arg(args,
char **);
4433 reset_group = va_arg(args,
sstring);
4449 va_start(args,
type);
4450 op = va_arg(args,
object *);
4451 activator = va_arg(args,
object *);
4452 third = va_arg(args,
object *);
4453 message = va_arg(args,
const char *);
4454 fix = va_arg(args,
int);
4455 ret = va_arg(args,
int *);
4470 va_start(args,
type);
4471 op = va_arg(args,
int);
4472 player = va_arg(args,
object *);
4475 if (
player->contr == NULL) {
4476 LOG(
llevError,
"cfapi_player_quest called with non player object %s!\n",
player->name);
4484 int state = va_arg(args,
int);
4490 int *ret = va_arg(args,
int *);
4496 int state = va_arg(args,
int);
4502 int *ret = va_arg(args,
int*);
4517 const char *
name = NULL, *extra = NULL;
4521 uint8_t register_type, command_type;
4524 va_start(args,
type);
4525 register_type = va_arg(args,
int);
4526 name = va_arg(args,
const char *);
4527 if (register_type == 1) {
4530 extra = va_arg(args,
const char *);
4533 command_type = (uint8_t)va_arg(args,
int);
4537 time = va_arg(args,
double);
4541 if (register_type == 1) {
4554 va_start(args,
type);
4571 struct dirent *currentfile;
4574 char buf[
sizeof(LIBDIR) + 9 +
sizeof(dirent::d_name)];
4576 snprintf(
buf,
sizeof(
buf),
"%s/plugins/", LIBDIR);
4580 if (plugdir == NULL)
4583 while ((currentfile =
readdir(plugdir)) != NULL) {
4584 l = strlen(currentfile->d_name);
4585 if (l > strlen(PLUGIN_SUFFIX)) {
4588 if (strcmp(currentfile->d_name+l-strlen(PLUGIN_SUFFIX), PLUGIN_SUFFIX) != 0)
4592 if (strcmp(*disable,
"All") == 0) {
4593 LOG(
llevInfo,
"plugins: disabling (all) %s\n", currentfile->d_name);
4597 if (strncmp(*disable, currentfile->d_name, strlen(*disable)) == 0 && strlen(currentfile->d_name) == strlen(PLUGIN_SUFFIX) + strlen(*disable)) {
4598 LOG(
llevInfo,
"plugins: disabling %s\n", currentfile->d_name);
4604 snprintf(
buf,
sizeof(
buf),
"%s/plugins/%s", LIBDIR, currentfile->d_name);
4605 LOG(
llevInfo,
"plugins: loading %s\n", currentfile->d_name);
static crossfire_plugin * plugins_find_plugin(const char *id)
Find a plugin from its internal name.
f_plug_property propfunc
Plugin getProperty function
sstring name
Face name, as used by archetypes and such.
sstring name_pl
The plural name of the object.
#define GET_MAP_OB(M, X, Y)
Gets the bottom object on a map.
New face structure - this enforces the notion that data is face by face only - you can not change the...
static void cfapi_object_transfer(int *type,...)
Object transfer.
static void cfapi_object_clean_object(int *type,...)
static void cfapi_object_forget_spell(int *type,...)
int16_t bed_y
x,y - coordinates of respawn (savebed).
static void cfapi_map_change_light(int *type,...)
Wrapper for change_map_light().
#define UP_OBJ_FACE
Only thing that changed was the face.
#define CFAPI_OBJECT_PROP_TITLE
static void cfapi_object_split(int *type,...)
Wrapper for object_split().
object * object_get_owner(object *op)
Returns the object which this object marks as being the owner.
const char * mapdir
Where the map files are.
player * next
Pointer to next player, NULL if this is last.
int cftimer_find_free_id(void)
Finds a free ID for a new timer.
#define FREE_OBJ_NO_DESTROY_CALLBACK
Do not run the destroy callback.
#define CFAPI_OBJECT_PROP_X
static void cfapi_object_move(int *type,...)
Moves an object.
static void cfapi_timer_destroy(int *type,...)
Wrapper for cftimer_destroy().
player * first_player
First player.
struct Settings settings
Server settings.
int32_t move_status
What stage in attack mode.
object * object_get_env_recursive(object *op)
Utility function.
#define CFAPI_PARTY_VECTOR
Pointer to a std::vector<partylist *>
int(* f_plug_postinit)(void)
Function called after the plugin was initialized.
void remove_friendly_object(object *op)
Removes the specified object from the linked list of friendly objects.
#define CFAPI_OBJECT_VECTOR
Pointer to a std::vector<object *>
#define CFAPI_OBJECT_PROP_CHA
int16_t maxhp
Max hit points.
#define CFAPI_MAP_PROP_TMPNAME
#define CFAPI_OBJECT_PROP_ARCH_NAME
#define CFAPI_OBJECT_PROP_ATTACK_MOVEMENT
@ llevError
Error, serious thing.
static void cfapi_object_distance(int *type,...)
Wrapper for object_distance().
static void cfapi_object_delete(int *type,...)
static void cfapi_player_quest(int *type,...)
Quest-related wrappers, for all quest-related operations.
#define MOVE_ALL
Mask of all movement types.
static void cfapi_timer_create(int *type,...)
Wrapper for cfapi_timer_create().
uint32_t path_attuned
Paths the object is attuned to.
void command_say(object *op, const char *params)
'say' command.
#define CFAPI_PARTY_PROP_NAME
static void cfapi_archetype_get_property(int *type,...)
#define NR_EVENTS
Number of events, maximum code + 1.
void LOG(LogLevel logLevel, const char *format,...)
Logs a message to stderr, or to file.
mapstruct * get_empty_map(int sizex, int sizey)
Creates and returns a map of the specific size.
void monster_npc_say(object *npc, const char *cp)
Simple function to have some NPC say something.
#define CFAPI_MAP_PROP_RESET_TIME
void drain_specific_stat(object *op, int deplete_stats)
Drain a specified stat from op.
#define CFAPI_MAP_PROP_RESET_TIMEOUT
archetype * more
Next part of a linked object.
static void cfapi_system_register_global_event(int *type,...)
#define CFAPI_REGION_PROP_LONGNAME
static void cfapi_system_get_party_vector(int *type,...)
#define CFAPI_OBJECT_PROP_LEVEL
std::vector< crossfire_plugin * > plugins_list
List of loaded plugins.
uint16_t client_type
Public type information.
#define CFAPI_PLAYER_PROP_BED_X
object * inv
Pointer to the first object in the inventory.
static void cfapi_object_drop(int *type,...)
Wrapper for drop().
mapstruct * ready_map_name(const char *name, int flags)
Makes sure the given map is loaded and swapped in.
#define QUERY_FLAG(xyz, p)
static void cfapi_system_get_map_vector(int *type,...)
#define CFAPI_REGION_PROP_NEXT
archetype * get_next_archetype(archetype *current)
#define CFAPI_MAP_PROP_NEXT
#define NR_OF_HOOKS
Number of hooked functions a plugin can call.
void do_learn_spell(object *op, object *spell, int special_prayer)
Actually makes op learn spell.
uint8_t ignore_plugin_compatibility
If set, don't check plugin version.
mapstruct * has_been_loaded(const char *name)
Checks whether map has been loaded.
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.
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...
uint32_t mark_count
Count of marked object.
object * get_next_friend(object *current)
Get the next object on the friendly list.
#define CFAPI_OBJECT_PROP_SLAYING
static void cfapi_get_weekday_name(int *type,...)
Wrapper for get_season_name().
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,...
#define CFAPI_OBJECT_PROP_DEX
#define CFAPI_OBJECT_PROP_FRIENDLY
#define CFAPI_OBJECT_PROP_ARCHETYPE
int8_t item_power
Power rating of the object.
static void cfapi_map_out_of_map(int *type,...)
Wrapper for out_of_map().
const char * datadir
Read only data files.
struct archetype * arch
Pointer to archetype.
int cast_spell(object *op, object *caster, int dir, object *spell_ob, char *stringarg)
Main dispatch when someone casts a spell.
void events_unregister_object_handler(const char *id)
Remove an object event handler.
int16_t players
How many players are on this level right now.
#define CFAPI_PLAYER_PROP_COUNT
#define CFAPI_OBJECT_PROP_BASE_NAME
uint16_t attack_movement
What kind of attack movement.
One function the server exposes to plugins.
float speed
Frequency of object 'moves' relative to server tick rate.
void object_set_enemy(object *op, object *enemy)
Sets the enemy of an object.
int16_t invisible
How much longer the object will be invis.
char * tmpname
Name of temporary file.
#define CFAPI_OBJECT_PROP_LAST_EAT
#define CFAPI_OBJECT_PROP_MOVE_ON
object * ob
The object representing the player.
void spring_trap(object *trap, object *victim)
This function generalizes attacks by runes/traps.
static void cfapi_object_get_property(int *type,...)
Main object property getter.
char fullname[MAX_BUF]
Plugin full name
#define CFAPI_OBJECT_PROP_STR
object * transport
Transport the player is in.
static void cfapi_object_create(int *type,...)
Wrapper for object_new(), create_archetype() and create_archetype_by_object_name().
float speed_left
How much speed is left to spend this round.
uint8_t pick_up
See crossfire.doc.
static void cfapi_object_drain(int *type,...)
struct mapstruct * map
Pointer to the map in which this object is present.
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,...
int set_random_map_variable(RMParms *rp, const char *buf)
void quest_set_player_state(player *pl, sstring quest_code, int state)
Set the state of a quest for a player.
#define CFAPI_OBJECT_PROP_GOD
unsigned char MoveType
Typdef here to define type large enough to hold bitmask of all movement types.
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_set_owner(object *op, object *owner)
Sets the owner and sets the skill and exp pointers to owner's current skill and experience objects.
double expmul
needed experience = (calc_exp*expmul) - means some races/classes can need less/more exp to gain level...
Represents the ingame time.
#define CFAPI_OBJECT_PROP_NEXT_ACTIVE_OB
void player_set_own_title(struct player *pl, const char *title)
Sets the custom title.
uint16_t height
Width and height of map.
#define CFAPI_PLAYER_PROP_MARKED_ITEM
#define SET_ANIMATION(ob, newanim)
static void cfapi_object_find_archetype_inside(int *type,...)
Kinda wrapper for arch__present_in_ob().
non standard information is not specified or uptime this means how long since the executable has been started A particular host may have been running a server for quite a long time
#define CFAPI_SYSTEM_ARCHETYPES
void draw_ext_info_format(int flags, int pri, const object *pl, uint8_t type, uint8_t subtype, const char *format,...) PRINTF_ARGS(6
archetype * head
The main part of a linked object.
#define CFAPI_OBJECT_PROP_MAXSP
#define CFAPI_OBJECT_PROP_RAW_NAME
#define CFAPI_OBJECT_PROP_SPELL_ITEM
int move_player(object *op, int dir)
Move player in the given direction.
void object_reset(object *op)
Totally resets the specified object, without freeing associated memory.
#define CFAPI_ARCH_PROP_NEXT
int8_t direction
Means the object is moving that way.
#define CFAPI_OBJECT_PROP_Y
static const flag_definition flags[]
Flag mapping.
tag_t count
Unique object number for this object.
#define CFAPI_OBJECT_PROP_ENEMY
int16_t last_grace
As last_sp, except for grace.
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...
void clean_object(object *op)
Remove and free all objects in the inventory of the given object.
#define CFAPI_OBJECT_PROP_MOVE_TYPE
char savebed_map[MAX_BUF]
Map where player will respawn after death.
void fix_object(object *op)
Updates all abilities given by applied objects in the inventory of the given object.
void get_tod(timeofday_t *tod)
Computes the ingame time of the day.
#define CFAPI_OBJECT_PROP_FACE
static void cfapi_object_say(int *type,...)
#define CFAPI_REGION_PROP_PARENT
#define CFAPI_OBJECT_PROP_ENVIRONMENT
#define COMMAND_TYPE_NORMAL
Standard commands.
#define CFAPI_OBJECT_PROP_ATTACKED_BY
char * name
Shortend name of the region as maps refer to it.
mapstruct * generate_random_map(const char *OutFileName, RMParms *RP, char **use_layout, sstring reset_group)
Main random map routine.
#define FOR_ABOVE_PREPARE(op_, it_)
Constructs a loop iterating over all objects above an object.
object * enemy
Monster/player to follow even if not closest.
#define CFAPI_SYSTEM_PLAYERS
#define CFAPI_OBJECT_PROP_PRESENT
#define CFAPI_REGION_PROP_JAIL_PATH
#define CFAPI_MAP_PROP_WIDTH
static void cfapi_get_hooks(int *type,...)
#define CFAPI_ARCH_PROP_NAME
#define CFAPI_OBJECT_PROP_ITEM_POWER
#define CFAPI_MAP_PROP_UNIQUE
uint8_t hide
The object is hidden, not invisible.
sstring title
Of foo, etc.
int(* f_plug_init)(const char *iversion, f_plug_api gethooksptr)
First function called in a plugin.
int apply_manual(object *op, object *tmp, int aflag)
Main apply handler.
char path[HUGE_BUF]
Filename of the map.
const char * object_get_value(const object *op, const char *const key)
Get an extra value by key.
void apply_by_living_below(object *pl)
Attempt to apply the object 'below' the player.
#define MSG_TYPE_MISC
Messages that don't go elsewhere.
void initPlugins(void)
Plugins initialization.
#define CFAPI_OBJECT_PROP_CURRENT_WEAPON
int16_t level
Level of creature or object.
static void cfapi_friendlylist_get_next(int *type,...)
Friend list access, to get objects on it.
AssetsManager * getManager()
static void cfapi_object_identify(int *type,...)
Wrapper for identify().
static void cfapi_map_set_map_property(int *type,...)
object * object_insert_in_ob(object *op, object *where)
This function inserts the object op in the linked list inside the object environment.
object * above
Pointer to the object stacked above this one.
LIBPTRTYPE libptr
Pointer to the plugin library
static void cfapi_object_user_event(int *type,...)
#define MSG_TYPE_COMMAND
Responses to commands, eg, who.
#define CFAPI_MAP_PROP_ENTER_X
static void cfapi_object_update(int *type,...)
Wrapper for object_update().
#define CFAPI_OBJECT_PROP_INVISIBLE
static void cfapi_system_directory(int *type,...)
int16_t resist[NROFATTACKS]
Resistance adjustments for attacks.
#define plugins_dlerror()
Library error.
Plugin animator file specs[Config] name
static void cfapi_object_change_abil(int *type,...)
Wrapper for change_abil().
const char * get_season_name(const int index)
give access to season names
#define CFAPI_OBJECT_PROP_SKILL
event_registration events_register_global_handler(int eventcode, f_plug_event hook)
Register a global event handler.
#define CFAPI_OBJECT_PROP_CLIENT_TYPE
uint32_t path_denied
Paths the object is denied access to.
void object_clear(object *op)
Frees everything allocated by an object, and also clears all variables and flags to default settings.
char * longname
Official title of the region, this might be defined to be the same as name.
uint32_t update_look
If true, we need to send the look window.
void party_join(object *op, partylist *party)
Makes a player join a party.
static void cfapi_object_get_key(int *type,...)
Gets a key/value value for an object.
#define TIMER_ERR_ID
Invalid timer id.
#define MSG_TYPE_COMMAND_DEBUG
Various debug type commands.
int32_t carrying
How much weight this object contains.
int plugins_remove_plugin(const char *id)
Unload the specified plugin.
#define CFAPI_OBJECT_PROP_PATH_DENIED
#define CFAPI_MAP_PROP_REGION
#define TIMER_ERR_NONE
No error.
uint32_t path_repelled
Paths the object is repelled from.
int16_t y
Position in the map for this object.
#define CFAPI_OBJECT_PROP_ANIM_SPEED
static event_registration m
static void cfapi_system_unregister_global_event(int *type,...)
#define CFAPI_OBJECT_PROP_AC
void events_register_object_handler(const char *id, f_plug_event handler)
Register an object event handler.
static void cfapi_register_command(int *type,...)
char * stringbuffer_finish(StringBuffer *sb)
Deallocate the string buffer instance and return the string.
partylist * party_get_first(void)
Returns the first party from the list of all parties.
void object_free_drop_inventory(object *ob)
Frees everything allocated by an object, removes it from the list of used objects,...
void object_update(object *op, int action)
object_update() updates the array which represents the map.
struct player * contr
Pointer to the player which control this object.
object * object_find_by_name(const object *who, const char *name)
Finds an object in inventory name.
static void cfapi_player_find(int *type,...)
Wrapper for find_player_partial_name().
DIR * opendir(const char *)
#define CFAPI_OBJECT_PROP_LORE
#define CFAPI_ARCH_PROP_HEAD
object * chosen_skill
The skill chosen to use.
#define CFAPI_OBJECT_PROP_PICK_UP
#define CFAPI_OBJECT_PROP_MOVE_OFF
int32_t last_heal
Last healed.
uint8_t subtype
Subtype of object.
#define FLAG_WAS_WIZ
Player was once a wiz.
#define CFAPI_PLAYER_PROP_PARTY
void command_unregister(command_registration command)
Unregister a previously registered command.
f_plug_api func
Function itself.
static void cfapi_player_can_pay(int *type,...)
Wrapper for can_pay().
Used to link together several objects.
const char * determine_god(object *op)
Determines if op worships a god.
int is_friendly(const object *op)
Checks if the given object is already in the friendly list or not.
#define CFAPI_OBJECT_PROP_CHOSEN_SKILL
#define CFAPI_OBJECT_PROP_HP
short freearr_y[SIZEOFFREE]
Y offset when searching around a spot.
#define CFAPI_OBJECT_PROP_MAXHP
void drop(object *op, object *tmp)
Drop an item, either on the floor or in a container.
static void cfapi_map_message(int *type,...)
uint8_t anim_speed
Ticks between animation-frames.
const char * get_weekday(const int index)
give access to weekday names
static void cfapi_map_create_path(int *type,...)
Wrapper for create_pathname() and create_overlay_pathname().
#define CFAPI_OBJECT_PROP_OB_BELOW
static void cfapi_object_apply_below(int *type,...)
Applies an object below.
#define CFAPI_OBJECT_PROP_HIDDEN
#define CFAPI_OBJECT_PROP_CARRYING
#define CFAPI_OBJECT_PROP_TOTAL_EXP
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.
static void cfapi_set_random_map_variable(int *type,...)
Wrapper for set_random_map_variable().
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.
#define CFAPI_PLAYER_PROP_BED_Y
void query_name(const object *op, char *buf, size_t size)
Describes an item.
static void cfapi_object_remove_depletion(int *type,...)
#define CFAPI_OBJECT_PROP_GEN_SP_ARMOUR
#define CFAPI_REGION_PROP_JAIL_Y
#define CFAPI_OBJECT_PROP_CHEATER
#define FOR_ABOVE_FINISH()
Finishes FOR_ABOVE_PREPARE().
void events_unregister_global_handler(int eventcode, event_registration id)
Remove a global event handler.
#define CFAPI_MAP_PROP_MESSAGE
uint16_t number
This is the image unique identifier.
static void cfapi_system_re_cmp(int *type,...)
Wrapper for re_cmp().
#define CFAPI_OBJECT_PROP_RACE
void(* f_plug_api)(int *type,...)
General API function.
object clone
An object from which to do object_copy()
uint8_t run_away
Monster runs away if it's hp goes below this percentage.
static void cfapi_system_get_object_vector(int *type,...)
static void cfapi_party_get_property(int *type,...)
Party-related functions.
int32_t weight_limit
Weight-limit of object.
sstring add_string(const char *str)
This will add 'str' to the hash table.
static void cfapi_object_check_spell(int *type,...)
Wrapper for check_spell_known().
#define CFAPI_OBJECT_PROP_MOVE_BLOCK
#define CFAPI_OBJECT_PROP_FACING
mapstruct * first_map
First map.
static void copy_message(object *op, const char *msg)
Utility function to copy the string to op->msg.
static void cfapi_system_find_face(int *type,...)
Wrapper for find_face().
region * parent
Pointer to the region that is a parent of the current region, if a value isn't defined in the current...
#define CFAPI_OBJECT_PROP_WEIGHT
static void cfapi_system_get_archetype_vector(int *type,...)
static void cfapi_object_reset(int *type,...)
Wrapper for clear_reset().
#define CFAPI_OBJECT_PROP_RESIST
#define CFAPI_PLAYER_PROP_IP
#define CFAPI_OBJECT_PROP_DAM
char * msg
The description of the region.
object * below
Pointer to the object stacked below this one.
int change_map_light(mapstruct *m, int change)
Used to change map light level (darkness) up or down.
MoveType move_type
Type of movement this object uses.
#define NDI_DELAYED
If set, then message is sent only after the player's tick completes.
const char * get_periodofday(const int index)
give access to weekday names
struct dirent * readdir(DIR *)
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...
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.
#define FLAG_FREED
Object is in the list of free objects.
static void cfapi_map_has_been_loaded(int *type,...)
Wrapper for has_been_loaded().
const Face * face
Face with colors.
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.
char * jailmap
Where a player that is arrested in this region should be imprisoned.
sstring find_string(const char *str)
Searches a string in the shared strings.
char * host
Which host it is connected from (ip address).
int32_t last_eat
How long since we last ate.
int32_t value
How much money it is worth (or contains)
f_plug_postinit closefunc
Plugin Termination function
static void cfapi_object_remove(int *type,...)
void object_update_speed(object *op)
Updates the speed of an object.
static void cfapi_system_strdup_local(int *type,...)
Wrapper for strdup_local().
#define FREE_AND_COPY(sv, nv)
Release the shared string if not NULL, and make it a reference to nv.
char id[MAX_BUF]
Plugin identification string
#define CFAPI_OBJECT_PROP_PATH_ATTUNED
int events_execute_object_user(object *op, object *activator, object *third, const char *message, int fix)
Execute an EVENT_USER on the specified object.
uint8_t type
PLAYER, BULLET, etc.
TIPS on SURVIVING Crossfire is populated with a wealth of different monsters These monsters can have varying immunities and attack types In some of them can be quite a bit smarter than others It will be important for new players to learn the abilities of different monsters and learn just how much it will take to kill them This section discusses how monsters can interact with players Most monsters in the game are out to mindlessly kill and destroy the players These monsters will help boost a player s after he kills them When fighting a large amount of monsters in a single attempt to find a narrower hallway so that you are not being attacked from all sides Charging into a room full of Beholders for instance would not be open the door and fight them one at a time For there are several maps designed for them Find these areas and clear them out All throughout these a player can find signs and books which they can read by stepping onto them and hitting A to apply the book sign These messages will help the player to learn the system One more always keep an eye on your food If your food drops to your character will soon so BE CAREFUL ! NPCs Non Player Character are special monsters which have intelligence Players may be able to interact with these monsters to help solve puzzles and find items of interest To speak with a monster you suspect to be a simply move to an adjacent square to them and push the double ie Enter your message
#define CFAPI_ARCH_PROP_CLONE
int16_t dam
How much damage this object does when hitting.
int8_t magic
Any magical bonuses to this item.
#define CFAPI_OBJECT_PROP_EXP
#define SET_MAP_FLAGS(M, X, Y, C)
Sets map flags.
#define CFAPI_OBJECT_PROP_SPEED
#define CFAPI_OBJECT_PROP_TYPE
object * active_prev
Previous object in the 'active list This is used in process_events so that the entire object list doe...
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.
#define CFAPI_OBJECT_PROP_NROF
sstring materialname
Specific material name.
object * object_create_arch(archetype *at)
Create a full object using the given archetype.
#define CFAPI_PLAYER_PROP_TITLE
#define CFAPI_MAP_PROP_PATH
std::vector< char * > disabled_plugins
List of disabled plugins, 'All' means all.
static void cfapi_object_transmute(int *type,...)
void object_free(object *ob, int flags)
Frees everything allocated by an object, removes it from the list of used objects,...
#define CFAPI_OBJECT_PROP_CUSTOM_NAME
static void cfapi_region_get_property(int *type,...)
Regions-related functions.
static void cfapi_unregister_command(int *type,...)
#define CFAPI_OBJECT_PROP_PICKABLE
#define FOR_INV_FINISH()
Finishes FOR_INV_PREPARE().
#define CFAPI_REGION_VECTOR
Pointer to a std::vector<region *>
MoveType move_on
Move types affected moving on to this space.
int32_t food
How much food in stomach.
void change_exp(object *op, int64_t exp, const char *skill_name, int flag)
Changes experience to a player/monster.
static void cfapi_object_teleport(int *type,...)
Teleports an object at a specified destination if possible.
#define CFAPI_PLAYER_QUEST_START
#define CFAPI_REGION_PROP_NAME
static void cfapi_object_spring_trap(int *type,...)
The archetype structure is a set of rules on how to generate and manipulate objects which point to ar...
#define CFAPI_OBJECT_PROP_INVISIBLE_TIME
#define CFAPI_OBJECT_PROP_ATTACK_TYPE
#define CFAPI_SYSTEM_MAPS
int move_to(object *op, int x, int y)
Move an object one square toward a specified destination on the same map.
#define CFAPI_REGION_PROP_JAIL_X
static void cfapi_get_time(int *type,...)
Wrapper for get_tod().
static void cfapi_object_pay_item(int *type,...)
Wrapper for pay_for_item().
const char * confdir
Configuration files.
#define FLAG_NO_DROP
Object can't be dropped.
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...
void each(std::function< void(T *)> op)
Apply a function to each asset.
const Face * get_face_by_id(uint16_t id)
Get a face from its unique identifier.
event_registration global_registration[NR_EVENTS]
Global event registration identifiers.
with a maximum of six This is not so if you are wearing plate you receive no benefit Armour is additive with all the supplementry forms of which means that it lasts until the next semi permanent spell effect is cast upon the character weak special and current protections and immunities dark elf priest killer panther all others vampire that they only take damage from cold based attacks but it also inflicts hp rnd The range of the cone covers(2+Wisdom bonus) squares. spell will not cure poison or disease prayer
void delete_map(mapstruct *m)
Frees the map, including the mapstruct.
char * partyname
Party name.
sstring race
Human, goblin, dragon, etc.
#define CFAPI_OBJECT_PROP_OWNER
int8_t facing
Object is oriented/facing that way.
const Animations * animation
Animation of this item, NULL if not animated.
static void cfapi_object_pickup(int *type,...)
#define CFAPI_SYSTEM_REGIONS
static void cfapi_object_on_same_map(int *type,...)
#define CFAPI_OBJECT_PROP_NAME_PLURAL
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...
struct archetype * other_arch
Pointer used for various things - mostly used for what this objects turns into or what this object cr...
object * object_create_clone(object *asrc)
Create clone from object to another.
#define CFAPI_PARTY_PROP_NEXT
#define P_OUT_OF_MAP
This space is outside the map.
Archetypes * archetypes()
Get archetypes.
#define MAX_BUF
Used for all kinds of things.
static void cfapi_get_month_name(int *type,...)
Wrapper for get_season_name().
static void cfapi_system_check_path(int *type,...)
Wrapper for check_path().
size_t strlcpy(char *dst, const char *src, size_t size)
Portable implementation of strlcpy(3).
#define CFAPI_MAP_PROP_NAME
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...
object * object_new(void)
Grabs an object from the list of unused objects, makes sure it is initialised, and returns it.
void create_overlay_pathname(const char *name, char *buf, size_t size)
Same as create_pathname(), but for the overlay maps.
#define UP_OBJ_INSERT
Object was inserted.
object * head
Points to the main object of a large body.
StringBuffer * describe_item(const object *op, const object *owner, int use_media_tags, StringBuffer *buf)
Describes an item, in all its details.
#define COMMAND_TYPE_WIZARD
Wizard-only commands.
#define CFAPI_OBJECT_PROP_WIS
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 * current_weapon
Pointer to the weapon currently used.
const char * re_cmp(const char *, const char *)
re-cmp - get regular expression match.
int32_t weight
Attributes of the object.
#define CFAPI_OBJECT_PROP_POW
void free_string(sstring str)
This will reduce the refcount, and if it has reached 0, str will be freed.
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.
static void cfapi_map_get_map(int *type,...)
Gets map information.
int8_t wc
Weapon Class, lower WC increases probability of hitting.
#define CFAPI_REGION_PROP_MESSAGE
float move_slow_penalty
How much this slows down the object.
const char * playerdir
Where the player files are.
Animations * try_find_animation(const char *name)
partylist * party_get_next(const partylist *party)
Returns the next party from the list of all parties.
int16_t maxgrace
Maximum grace.
#define CFAPI_OBJECT_PROP_CONTAINER
int change_abil(object *op, object *tmp)
Permanently alters an object's stats/flags based on another object.
static void send_changed_object(object *op)
Notify clients about a changed object.
#define CFAPI_OBJECT_PROP_INVENTORY
#define CFAPI_OBJECT_PROP_MAP
object * mark
Marked object.
#define CFAPI_MAP_PROP_FLAGS
static void cfapi_system_find_string(int *type,...)
Wrapper for find_string().
static void cfapi_system_remove_string(int *type,...)
Wrapper for free_string().
#define CFAPI_MAP_PROP_DARKNESS
#define CFAPI_MAP_PROP_PLAYERS
#define FLAG_REMOVED
Object is not in any map or invenory.
#define CFAPI_OBJECT_PROP_RUN_AWAY
object * object_decrease_nrof(object *op, uint32_t i)
Decreases a specified number from the amount of an object.
#define PERM_EXP(exptotal)
Convert saved total experience into permanent experience.
static void cfapi_map_delete_map(int *type,...)
void plugins_display_list(object *op)
Displays a list of loaded plugins (keystrings and description) in the game log window.
#define CFAPI_PLAYER_PROP_TRANSPORT
sstring lore
Obscure information about this object, to get put into books and the like.
#define NDI_UNIQUE
Print immediately, don't buffer.
sstring slaying
Which race to do double damage to.
static void cfapi_map_get_map_property(int *type,...)
int8_t glow_radius
indicates the glow radius of the object
#define CFAPI_PARTY_PROP_PLAYER
std::vector< region * > all_regions
#define CFAPI_PLAYER_QUEST_GET_STATE
#define CFAPI_MAP_PROP_DIFFICULTY
archetype * find_archetype_by_object_name(const char *name)
This function retrieves an archetype given the name that appears during the game (for example,...
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...
sstring name
The name of the object, obviously...
static void cfapi_system_get_region_vector(int *type,...)
static void cfapi_object_describe(int *type,...)
Wrapper for describe_item().
static void cfapi_object_give_skill(int *type,...)
static void cfapi_generate_random_map(int *type,...)
Wrapper for generate_random_map().
object * spellitem
Spell ability monster is choosing to use.
#define CFAPI_OBJECT_PROP_ANIMATION
object * object_find_by_arch_name(const object *who, const char *name)
Find object in inventory by archetype name.
#define CFAPI_OBJECT_PROP_INT
#define CFAPI_OBJECT_PROP_SP
static void cfapi_object_fix(int *type,...)
const char * party_get_password(const partylist *party)
Returns the party's password.
#define CFAPI_SYSTEM_FRIENDLY_LIST
void cleanupPlugins(void)
Call the crossfire_plugin::closefunc on the various plugins, used at server shutdown.
int object_can_pick(const object *who, const object *item)
Finds out if an object can be picked up.
void add_friendly_object(object *op)
Add a new friendly object to the list of friendly objects.
#define CFAPI_PLAYER_QUEST_SET_STATE
same as sound ncom command like but with extra the client want tick commands so it knows animation timing the client wants to be informed of pickup mode changes Mode will be sent when the player successfully logs and afterward any time the value is but over many options have become defaults This documents those now obsolete client can handle the bit exp values that are now used values are sent as bit Setting this flag also means that skill exp will be and it will be sent in revised method as described in the stats command Value is an integer in string format else Deprecated client should presume all servers support this server will return FALSE Deprecated replaced with sound2 setup but rather that the server was unable to complete the given protocol request the command(just the command name) that generated the failure. reason the server will only keep track of the latest mark sent The server will generally send a drawinfo command informing the player
#define CFAPI_OBJECT_PROP_NAME
#define CFAPI_OBJECT_PROP_EXP_MULTIPLIER
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_.
int16_t maxsp
Max spell points.
int is_magical(const object *op)
Checks whether object is magical.
#define CFAPI_OBJECT_PROP_PREV_ACTIVE_OB
uint32_t reset_timeout
How many seconds must elapse before this map should be reset.
#define P_NEED_UPDATE
This space is out of date.
#define CFAPI_OBJECT_PROP_HEAD
object * env
Pointer to the object which is the environment.
char * create_pathname(const char *name, char *buf, size_t size)
Get the full path to a map file.
object * check_spell_known(object *op, const char *name)
Checks to see if player knows the spell.
static void cfapi_object_change_exp(int *type,...)
Wrapper for change_exp().
int32_t last_sp
As last_heal, but for spell points.
int(* f_plug_event)(int *type,...)
Function to call to handle global or object-related events.
const typedef char * sstring
This represents one animation.
int8_t gen_sp_armour
Sp regen penalty this object has (was last_heal)
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_PLAYER_PROP_BED_MAP
sstring skill
Name of the skill this object uses/grants.
object * object_split(object *orig_ob, uint32_t nr, char *err, size_t size)
object_split(ob,nr) splits up ob into two parts.
#define CFAPI_OBJECT_PROP_WC
char * name
Name of map as given by its creator.
#define plugins_dlsym(lib, name)
Get a function from a shared library.
#define CFAPI_OBJECT_PROP_GLOW_RADIUS
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...
uint64_t query_money(const object *op)
Determine the amount of money the given object contains, including what is inside containers.
static void cfapi_object_find_by_arch_name(int *type,...)
void object_set_msg(object *op, const char *msg)
Set the message field of an object.
void esrv_update_item(int flags, object *pl, object *op)
Updates object *op for player *pl.
#define CFAPI_OBJECT_PROP_PATH_REPELLED
sstring msg
If this is a book/sign/magic mouth/etc.
#define CFAPI_OBJECT_PROP_CON
#define CFAPI_ARCHETYPE_VECTOR
Pointer to a std::vector<archetype *>
static const hook_entry plug_hooks[]
All hooked functions plugins can call.
if you malloc the data for the buffer
int on_same_map(const object *op1, const object *op2)
Checks whether 2 objects are on the same map or not.
#define CFAPI_MAP_VECTOR
Pointer to a std::vector<mapstruct *>
#define CLEAR_FLAG(xyz, p)
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 ...
#define CFAPI_OBJECT_PROP_GP
#define CFAPI_OBJECT_PROP_MAGICAL
uint16_t num
Where we are in the array.
#define CFAPI_OBJECT_PROP_LAST_SP
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.
int8_t ac
Armor Class, lower AC increases probability of not getting hit.
int player_arrest(object *who)
Put a player into jail, taking into account cursed exits and player's region.
player * find_player_partial_name(const char *plname)
Find a player by a partial name.
object * attacked_by
This object start to attack us! only player & monster.
int16_t duration
Number of moves (see 'speed') spell lasts.
#define CFAPI_OBJECT_PROP_MATERIAL
static void cfapi_object_insert(int *type,...)
#define CFAPI_OBJECT_PROP_DURATION
#define CFAPI_OBJECT_PROP_MOVE_STATUS
static void cfapi_map_update_position(int *type,...)
Wrapper for update_position().
#define CFAPI_OBJECT_PROP_OTHER_ARCH
static void cfapi_get_periodofday_name(int *type,...)
Wrapper for get_season_name().
#define CFAPI_OBJECT_PROP_OB_ABOVE
partylist * party
Party this player is part of.
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.
uint32_t count
Any numbers typed before a command.
int object_distance(const object *ob1, const object *ob2)
Return the square of the distance between the two given objects.
#define CFAPI_MAP_PROP_ENTER_Y
#define string_get_int(name)
void quest_start(player *pl, sstring quest_code, int state)
Start a quest for a player.
#define CFAPI_OBJECT_PROP_LAST_HEAL
static void cfapi_player_message(int *type,...)
#define CFAPI_OBJECT_PROP_MOVE_ALLOW
void knowledge_give(player *pl, const char *marker, const object *book)
Give a knowledge item from its code.
region * get_region_by_map(mapstruct *m)
Gets a region from a map.
#define CFAPI_ARCH_PROP_MORE
static void cfapi_system_add_string(int *type,...)
Wrapper for add_string().
object * container
Current container being used.
void(* command_function_extra)(object *op, const char *params, const char *extra)
One command function, with a custom parameter specified at registration time.
command_registration command_register(const char *name, uint8_t type, command_function func, float time)
Register a player-issued command.
#define CFAPI_SYSTEM_PARTIES
static void cfapi_log(int *type,...)
Wrapper for LOG().
object * active_next
Next object in the 'active' list This is used in process_events so that the entire object list does n...
void object_remove(object *op)
This function removes the object op from the linked list of objects which it is currently tied to.
archetype * try_find_archetype(const char *name)
#define CFAPI_OBJECT_PROP_MOVE_SLOW
#define CFAPI_OBJECT_PROP_MERGEABLE
MoveType move_off
Move types affected moving off this space.
signed long object_sum_weight(object *op)
object_sum_weight() is a recursive function which calculates the weight an object is carrying.
const Face * try_find_face(const char *name, const Face *error)
void do_forget_spell(object *op, const char *spell)
Erases spell from player's inventory.
int16_t enter_y
Enter_x and enter_y are default entrance coordinates to use for a map such that when an exit specifie...
uint64_t command_registration
Identifier when registering a command.
static void cfapi_object_set_key(int *type,...)
Write a key/value for an object.
int remove_depletion(object *op, int level)
Remove depletion from op, if present, and warn player of such restorations.
static void cfapi_object_pay_amount(int *type,...)
Wrapper for pay_for_amount().
const char * get_month_name(const int index)
give access to month names
#define CFAPI_OBJECT_PROP_MAGIC
#define CFAPI_OBJECT_PROP_FLAGS
#define CFAPI_OBJECT_PROP_LUCK
#define CFAPI_MAP_PROP_HEIGHT
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.
static void cfapi_system_find_animation(int *type,...)
Wrapper for find_animation().
Crossfire Architecture the general intention is to enhance the enjoyability and playability of CF In this code
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...
uint8_t state
How the object was last drawn (animation)
uint32_t unique
If set, this is a per player unique map.
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.
int calculate_difficulty(mapstruct *m)
This routine is supposed to find out the difficulty of the map.
sstring name
More definite name, like "generate_kobold".
uint32_t nrof
Number of objects.
socket_struct * socket
Socket information for this player.
mapstruct * next
Next map, linked list.
static std::vector< std::string > split(const std::string &field, const std::string &by)
static void cfapi_object_apply(int *type,...)
Applies an object.
uint32_t reset_time
Server time when map gets reset, seconds since epoch.
#define CFAPI_OBJECT_PROP_VALUE
void query_base_name(const object *op, int plural, char *buf, size_t size)
Query a short name for the item.
#define CFAPI_OBJECT_PROP_MESSAGE
living stats
Str, Con, Dex, etc.
static void cfapi_object_perm_exp(int *type,...)
Wrapper for permanent experience calculation.
How to Install a Crossfire Server on you must install a python script engine on your computer Python is the default script engine of Crossfire You can find the python engine you have only to install them The VisualC Crossfire settings are for but you habe then to change the pathes in the VC settings Go in Settings C and Settings Link and change the optional include and libs path to the new python installation path o except the maps ! You must download a map package and install them the share folder Its must look like doubleclick on crossfire32 dsw There are projects in your libcross lib and plugin_python You need to compile all Easiest way is to select the plugin_python ReleaseLog as active this will compile all others too Then in Visual C press< F7 > to compile If you don t have an appropriate compiler you can try to get the the VC copies the crossfire32 exe in the crossfire folder and the plugin_python dll in the crossfire share plugins folder we will remove it when we get time for it o Last showing lots of weird write to the Crossfire mailing list
#define CFAPI_OBJECT_PROP_MOVE_SLOW_PENALTY
MoveType move_allow
What movement types explicitly allowed.
LogLevel
Log levels for the LOG() function.
int object_set_value(object *op, const char *key, const char *value, int add_key)
Updates the key in op to value.
#define CFAPI_OBJECT_PROP_MAXGP
#define CFAPI_OBJECT_PROP_COUNT
#define CFAPI_OBJECT_PROP_SUBTYPE
const char * tmpdir
Directory to use for temporary files.
static void cfapi_player_knowledge(int *type,...)
Wrapper for knowledge-related functions().
short freearr_x[SIZEOFFREE]
X offset when searching around a spot.
#define CFAPI_PLAYER_QUEST_WAS_COMPLETED
int64_t total_exp
All exp ever earned (used to calc perm_exp)
void(* command_function)(object *op, const char *params)
One command function.
#define plugins_dlclose(lib)
Unload a shared library.
pluglist shows those as well as a short text describing each the list will simply appear empty The keyword for the Python plugin is Python plugout< keyword > Unloads a given plugin
static void cfapi_map_get_object_at(int *type,...)
Wrapper for GET_MAP_OB().
int plugins_init_plugin(const char *libfile)
Try to load the specified plugin.
uint8_t darkness
Indicates level of darkness of map.
static void cfapi_object_cast(int *type,...)
Wrapper for query_money().
uint32_t attacktype
Bitmask of attacks this object does.
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...
void pick_up(object *op, object *alt)
Try to pick up an item.
object * object_get_player_container(object *op)
Finds the player carrying an object.
#define CFAPI_OBJECT_PROP_FP
static void cfapi_object_query_money(int *type,...)
Wrapper for query_money().
uint16_t material
What materials this object consist of.
#define CUSTOM_NAME_FIELD
Key in an object for the player-assigned custom name.
object * find_marked_object(object *op)
Return the object the player has marked with the 'mark' command below.
MoveType move_block
What movement types this blocks.
void free_dialog_information(object *op)
Frees obj::dialog_information.
#define FOR_INV_PREPARE(op_, it_)
Constructs a loop iterating over the inventory of an object.
int8_t luck
Affects thaco and ac from time to time.
int check_path(const char *name, int prepend_dir)
This function checks if a file with the given path exists.
#define CFAPI_PARTY_PROP_PASSWORD
#define CFAPI_OBJECT_PROP_LAST_GRACE
static void cfapi_get_season_name(int *type,...)
Wrapper for get_season_name().
void *(* f_plug_property)(int *type,...)
Get various plugin properties.
static void cfapi_object_merge(int *type,...)
Wrapper for object_merge().
#define CFAPI_PLAYER_PROP_NEXT
#define CFAPI_OBJECT_PROP_DIRECTION
static void cfapi_object_clone(int *type,...)
Clone an object, either through object_create_clone() or object_copy().
#define CFAPI_OBJECT_PROP_SHORT_NAME
sstring name
Name of the animation sequence.
static void cfapi_object_learn_spell(int *type,...)
int object_can_merge(object *ob1, object *ob2)
Examines the 2 objects given to it, and returns true if they can be merged together,...
@ llevDebug
Only for debugging purposes.
#define CFAPI_OBJECT_PROP_MATERIAL_NAME
int16_t jaily
The coodinates in jailmap to which the player should be sent.
static void cfapi_map_trigger_connected(int *type,...)
Wrapper for trigger_connected().
static void cfapi_object_find_by_name(int *type,...)
static void cfapi_object_set_property(int *type,...)
Sets the property of an object.
#define plugins_dlopen(fname)
Load a shared library.
char * cost_string_from_value(uint64_t cost, int largest_coin)
Converts a price to number of coins.
#define CFAPI_OBJECT_PROP_WEIGHT_LIMIT
in that case they will be relative to whatever the PWD of the crossfire server process is You probably shouldn though Notes on Specific and settings file datadir Usually usr share crossfire Contains data that the server does not need to modify while such as the etc A default install will pack the and treasurelist definitions into a single or trs file and the graphics into a face(metadata) and .tar(bitmaps) file
const char * uniquedir
Directory for the unique items.
#define CFAPI_OBJECT_PROP_SPEED_LEFT
int quest_get_player_state(player *pl, sstring quest_code)
Get the quest state for a player.
static void cfapi_map_find_by_archetype_name(int *type,...)
Kinda wrapper for map_find_by_archetype() (but uses a string, not an archetype*).
int cftimer_create(int id, long delay, object *ob, int mode)
Creates a new timer.
void player_get_title(const player *pl, char *buf, size_t bufsize)
Returns the player's title.
static void cfapi_object_check_trigger(int *type,...)
Wrapper for check_trigger().
static void cfapi_object_clear(int *type,...)
Wrapper for object_clear().
object * identify(object *op)
Identifies an item.
const char * localdir
Read/write data files.