 |
Crossfire Server, Trunk
1.75.0
|
Go to the documentation of this file.
34 "debug",
"inhibit",
"stop",
"food",
"drink",
35 "valuables",
"bow",
"arrow",
"helmet",
"shield",
36 "armour",
"boots",
"gloves",
"cloak",
"key",
37 "missile",
"melee",
"magical",
"potion",
"spellbook",
38 "skillscroll",
"readables",
"magicdevice",
"notcursed",
"jewels",
39 "flesh",
"container",
"cursed", NULL
60 size_t len = strlen(
name);
75 return best != -2 ? best : -1;
102 object *tmp, *best = NULL;
103 int match_val = 0, tmpmatch;
114 if (tmpmatch > match_val) {
115 match_val = tmpmatch;
145 if (*params ==
'\0') {
147 "Usage: use_skill <skill name>");
164 if (*params ==
'\0') {
166 "Usage: ready_skill <skill name>");
173 "You have no knowledge of the skill %s",
189 const char *missing_message) {
192 do_skill(op, op, skop, op->
facing, *params ==
'\0' ? NULL : params);
253 object *inv = op->
inv;
256 if (*params ==
'\0') {
261 while (*params ==
' ')
263 if (!strncmp(params,
"-a ", 3)) {
267 if (!strncmp(params,
"-u ", 3)) {
271 if (!strncmp(params,
"-o ", 3)) {
275 if (!strncmp(params,
"-b ", 3)) {
285 while (*params ==
' ')
295 "Could not find any match to the %s.",
305 pos =
list.find(delim);
306 auto match =
list.substr(0, pos);
310 if (pos == std::string::npos)
312 list.erase(0, pos + 1);
335 uint32_t
weight, effective_weight_limit;
336 const int tmp_nrof =
NROF(tmp);
339 int16_t x = tmp->
x, y = tmp->
y;
350 "You are levitating, you can't reach the ground!");
358 "The object disappears in a puff of smoke! It must have been an illusion.");
365 if (nrof > tmp_nrof || nrof == 0)
377 "That item is too heavy for you to pick up.");
384 if (nrof != tmp_nrof) {
387 tmp =
object_split(tmp, nrof, failure,
sizeof(failure));
407 snprintf(
buf,
sizeof(
buf),
"%s will cost you %s.",
name, value);
409 snprintf(
buf,
sizeof(
buf),
"%s will cost you %s. You place it in your %s.",
name, value, op->
name);
414 snprintf(
buf,
sizeof(
buf),
"You pick up the %s.",
name);
416 snprintf(
buf,
sizeof(
buf),
"You pick up the %s and put it in your %s.",
name, op->
name);
472 object *tmp = NULL, *tmp1;
480 "You can't pick up the %s.",
488 "There is nothing to pick up here.");
541 object *container = NULL;
556 }
else if (!container) {
571 if (tmp->
env == alt) {
592 "This object cannot be put into containers!");
759 memset(mp, 0,
sizeof(*mp));
760 if (params[0] ==
'\0') {
765 if (params[0] ==
'#') {
773 if (params[0] ==
'*') {
774 if (params[1] ==
'\0') {
785 strncpy(mp->
name, params,
sizeof(mp->
name) - 1);
831 if ((*matcher)(op, &mp, tmp)) {
838 if (params[0] ==
'\0' && !did_one) {
843 "You can't pick up a %s.",
851 "There is nothing to pick up.");
856 "You were unable to take one of the items.");
859 "You were unable to take %d of the items.",
890 object *sack2, *orig = sack;
898 "The %s is not a container.",
905 "You cannot put the %s in the %s.",
906 name_tmp, name_sack);
922 "You move the items from %s into %s.",
923 name_tmp, name_sack);
942 "You can not put a %s into a %s",
961 if (nrof && tmp->
nrof != nrof) {
964 tmp =
object_split(tmp, nrof, failure,
sizeof(failure));
974 if (sack->
nrof > 1) {
988 "You put the %s in %s.",
989 name_tmp, name_sack);
1047 if (nrof && tmp->
nrof != nrof) {
1050 tmp =
object_split(tmp, nrof, failure,
sizeof(failure));
1064 "You drop the %s. The gods who lent it to you retrieve it.",
1077 #ifdef SAVE_INTERVAL
1085 && op->
contr->last_save_time+SAVE_INTERVAL <=
time(NULL)) {
1092 tmp_tag = tmp->
count;
1120 void drop(
object *op,
object *tmp) {
1145 "You don't have anything to drop.");
1150 "This item is locked");
1185 if (op->
inv == NULL) {
1188 "Nothing to drop!");
1207 if (*params ==
'\0') {
1210 && curinv->type !=
MONEY
1211 && curinv->type !=
FOOD
1212 && curinv->type !=
KEY
1214 && curinv->type !=
GEM
1215 && !curinv->invisible
1222 }
else if (strcmp(params,
"weapons") == 0) {
1225 && (curinv->type ==
WEAPON || curinv->type ==
BOW || curinv->type ==
ARROW)) {
1231 }
else if (strcmp(params,
"armor") == 0 || strcmp(params,
"armour") == 0) {
1240 }
else if (strcmp(params,
"food") == 0) {
1243 && (curinv->type ==
FOOD || curinv->type ==
DRINK)) {
1249 }
else if (strcmp(params,
"flesh") == 0) {
1252 && (curinv->type ==
FLESH)) {
1258 }
else if (strcmp(params,
"misc") == 0) {
1262 switch (curinv->type) {
1310 if (*params ==
'\0') {
1327 if ((*matcher)(op, &mp, tmp)) {
1338 "Nothing to drop.");
1341 "One item couldn't be dropped because it was locked.");
1342 else if (missed > 1)
1344 "%d items couldn't be dropped because they were locked.",
1368 if (!container->
inv)
1381 if (inv->below == next)
1405 if (*params ==
'\0') {
1411 if (strcmp(params,
"all") == 0) {
1427 "This is not a container!");
1442 if (*params ==
'\0') {
1456 "Could not find an object that matches %s",
1524 if (*params ==
'\0') {
1528 "You have no marked object.");
1540 "Could not find an object that matches %s",
1571 "It is an undead force.");
1574 "It is likely more powerful than you.");
1577 "It is likely less powerful than you.");
1580 "It is probably as powerful as you.");
1584 "You smell an acrid odor.");
1593 "It is critically wounded.");
1598 "It is in a bad shape.");
1608 "It is somewhat hurt.");
1613 "It is in excellent shape.");
1618 "It looks very ill.");
1631 if (
probe == NULL) {
1671 "You discover mystic forces on %s", tmp->
nrof <= 1?
"that item":
"those items" );
1682 "You have a bad feeling about %s", tmp->
nrof <= 1?
"that item":
"those items" );
1688 LOG(
llevError,
"Attempted to examine item %d with type %d, which is invalid\n", tmp->
count, tmp->
type);
1692 bool have_skill =
false;
1739 bool pl = tmp->
nrof > 1;
1744 "%s made of %s and %s %3.3f kg.",
1746 pl ?
"weigh" :
"weighs",
weight);
1749 "%s made of %s.", pl ?
"They are" :
"It is", tmp->
materialname);
1752 "%s %3.3f kg.", pl ?
"They weigh" :
"it weighs",
weight);
1768 desc =
"It is completely depleted.";
1770 desc =
"It is nearly depleted.";
1772 desc =
"It is very low on power.";
1774 desc =
"It is low on power.";
1776 desc =
"It is well charged.";
1778 desc =
"It is fully charged.";
1780 desc =
"It is overflowing with power.";
1802 if (castings <= 1) {
1803 desc =
"It is nearly depleted.";
1804 }
else if (castings <= 3) {
1805 desc =
"It hums with power.";
1807 desc =
"It crackles with power.";
1838 if (tmp->
msg && strncasecmp(tmp->
msg,
"@match", 6)) {
1839 if (!
output)
return true;
1848 switch (tmp->
type) {
1856 if (!tmp->
skill)
break;
1862 "Unfortunately, it is damaged beyond %s.",
1866 if (
skill->clone.msg) {
1867 if (!
output)
return true;
1869 "%s lets you %s a skill:",
1870 tmp->
nrof > 1 ?
"These objects" :
"This object",
1894 if (!
output)
return true;
1896 "%s holds%s a spell:",
1897 tmp->
nrof > 1 ?
"These objects" :
"This object",
1911 if (!
output)
return true;
1913 "%s a story:", tmp->
nrof > 1 ?
"These objects have" :
"This object has");
1947 "You examine the %s more closely.", tmp->
nrof > 1 ? tmp->
name_pl : tmp->
name);
1958 snprintf(prefix,
MAX_BUF,
"%s:", tmp->
nrof<=1 ?
"That is" :
"Those are");
1962 snprintf(prefix,
MAX_BUF,
"You lack the skill to understand %s:",
1963 tmp->
nrof<=1 ?
"that fully; it is" :
"those fully; they are");
1966 snprintf(prefix,
MAX_BUF,
"You fail to understand %s:",
1967 tmp->
nrof<=1 ?
"that fully; it is" :
"those fully; they are");
1980 "%s %s", prefix,
buf);
1991 switch (tmp->
type) {
2001 if (tmp->
msg != NULL)
2002 snprintf(
buf,
sizeof(
buf),
"Something is written in it.");
2019 "%s %s (%d).", tmp->
nrof > 1 ?
"They go" :
"It goes",
2023 "%s %s.", tmp->
nrof > 1 ?
"They go" :
"It goes",
2028 "%s %s.", tmp->
nrof > 1 ?
"They go" :
"It goes",
2038 snprintf(
buf,
sizeof(
buf),
"You reckon %s worth %s.", tmp->
nrof > 1 ?
"they are" :
"it is", value);
2046 snprintf(
buf,
sizeof(
buf),
"%s is selling this item.", seller);
2051 snprintf(
buf,
sizeof(
buf),
"%s would cost you %s.", tmp->
nrof > 1 ?
"They" :
"It", value);
2055 snprintf(
buf,
sizeof(
buf),
"You are offered %s for %s.", value, tmp->
nrof > 1 ?
"them" :
"it");
2069 bool has_link =
false;
2072 if (tmp_inv->type ==
FORCE && tmp_inv->slaying != NULL
2073 && strcmp(tmp_inv->slaying, op->
map->
path) == 0
2074 && tmp_inv->msg != NULL
2075 && tmp_inv->path_attuned == (uint32_t) conn) {
2080 "This is a buildable item, connected with: %s",
2088 "This is a buildable item.");
2096 "Examine again for more details.");
2119 int items = 0, length;
2122 if (inv == NULL && op == NULL) {
2124 "Inventory of what object?");
2135 "You carry nothing.");
2159 "[fixed]%s- %-*.*s (%5d) %-8s",
2163 "[fixed]%s- %-*.*s %-8s",
2170 41,
"Total weight :",
weight);
2190 "Pickup is now %s.", (old &
PU_INHIBIT) ?
"active" :
"inhibited");
2209 "%d <= x pickup weight/value RATIO (0==off)",
2314 if (*params ==
'\0') {
2326 while (*params ==
' ')
2329 if (*params ==
'+' || *params ==
'-' || *params ==
'!') {
2339 else if (*params ==
'-')
2352 "Pickup: invalid item %s\n",
2357 if (sscanf(params,
"%u", &i) != 1) {
2361 "Usage: pickup <0-7> or <value_density> .");
2381 "Mode: Don't pick up.");
2386 "Mode: Pick up one item.");
2391 "Mode: Pick up one item and stop.");
2396 "Mode: Stop before picking up.");
2401 "Mode: Pick up all items.");
2406 "Mode: Pick up all items and stop.");
2411 "Mode: Pick up all magic items.");
2416 "Mode: Pick up all coins and gems");
2433 if (!params || *params ==
'\0') {
2436 "Example: search magic+1 "
2437 "Would automatically pick up all "
2438 "items containing the word 'magic+1'.");
2443 "Search mode turned off.");
2447 if ((
int)strlen(params) >=
MAX_BUF) {
2449 "Search string too long.");
2454 "Searching for '%s'.",
2477 object *item = NULL;
2479 const char *closebrace;
2482 if (*params !=
'\0') {
2484 while (
' ' == *params)
2488 itemnumber = atoi(params);
2489 if (itemnumber != 0) {
2491 if (inv->count == itemnumber && !inv->invisible) {
2498 "Tried to rename an invalid item.");
2501 while (isdigit(*params) ||
' ' == *params)
2503 }
else if (
'<' == *params) {
2505 closebrace = strchr(params,
'>');
2512 if (closebrace-params > 127) {
2514 "Old name too long (up to 127 characters allowed)!");
2518 snprintf(
buf,
sizeof(
buf),
"%.*s", (
int)(closebrace-(params+1)), params+1);
2524 "Could not find a matching item to rename.");
2529 params = closebrace+1;
2530 while (
' ' == *params)
2537 "No marked item to rename.");
2543 if (!strncmp(params,
"to ", 3)) {
2545 while (
' ' == *params)
2547 if (
'<' != *params) {
2549 "Syntax error, expecting < at start of new name!");
2552 closebrace = strchr(params+1,
'>');
2555 "Syntax error, expecting > at end of new name!");
2560 if (closebrace-params > 127) {
2562 "New name too long (up to 127 characters allowed)!");
2567 snprintf(
buf,
sizeof(
buf),
"%.*s", (
int)(closebrace-(params+1)), params+1);
2570 for (counter = 0; counter < strlen(
buf); counter++) {
2571 if (isalnum(
buf[counter]))
2573 if (
' ' ==
buf[counter])
2575 if (
'\'' ==
buf[counter])
2577 if (
'+' ==
buf[counter])
2579 if (
'_' ==
buf[counter])
2581 if (
'-' ==
buf[counter])
2588 "Invalid new name!");
2593 if (strlen(params)) {
2595 "Syntax error, expected 'to <' after old name!");
2606 "No marked item to rename.");
2617 "This item has no custom name.");
2624 "You stop calling your %s with weird names.",
2628 if (custom_name != NULL && strcmp(custom_name,
buf) == 0) {
2631 "You keep calling your %s %s.",
2641 "Your %s will now be called %s.",
2665 if (*params ==
'\0' || strlen(params) == 0) {
2674 "Can't find any matching item.");
2681 "Unlocked %s.",
name);
2685 "Locked %s.",
name);
2705 object *first, *second;
2714 strlcpy(copy, params,
sizeof(copy));
2715 with = strstr(copy,
" with ");
2722 with = with+strlen(
" with ");
2735 transformation = NULL;
2745 if (transformation->
yield)
2746 generated->
nrof = transformation->
yield;
#define object_was_destroyed(op, old_tag)
Checks if an object still exists.
bool object_value_set(const object *op, const char *const key)
Determine if an extra value is set.
void drop(object *op, object *tmp)
Drop an item, either on the floor or in a container.
sstring name_pl
The plural name of the object.
recipe * find_recipe_for_tool(const char *tool, recipe *from)
Find a recipe for a specified tool.
int do_skill(object *op, object *part, object *skill, int dir, const char *string)
Main skills use function-similar in scope to cast_spell().
bool csv_contains(std::string list, std::string item, std::string delim)
Split list by comma, then see if item matches anything in the list.
struct Settings settings
Global settings.
int16_t maxhp
Max hit points.
static int matcher_pickup_type(object *who, matcher_params *params, object *item)
Check if an item matches a pickup type.
#define NUM_BODY_LOCATIONS
Number of body locations.
#define AT_ACID
Random equipped item might corrode when hit (64)
#define MSG_TYPE_COMMAND_SUCCESS
Successful result from command.
@ CLOSE_CON
Eneq((at)csd.uu.se): Id for close_container archetype.
@ llevError
Error, serious thing.
void command_search(object *op, const char *params)
'search' command.
object * find_skill_by_number(object *who, int skillno)
This returns the first skill pointer of the given subtype (the one that accumulates exp,...
#define MOVE_FLYING
Combo of fly_low and fly_high.
uint32_t mode
Mode of player for pickup.
void LOG(LogLevel logLevel, const char *format,...)
Logs a message to stderr, or to file.
@ FLESH
animal 'body parts' -b.t.
method_ret ob_examine(const object *op, const object *observer, int use_media_tags, char *buf, size_t size)
Get examine text for OP as seen by OBSERVER.
#define FLAG_IS_LINKED
The object is linked with other objects.
object * inv
Pointer to the first object in the inventory.
#define MSG_TYPE_SKILL
Messages related to skill use.
#define QUERY_FLAG(xyz, p)
void command_rename_item(object *op, const char *params)
Changing the custom name of an item.
int yield
Maximum number of items produced by the recipe.
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.
#define AP_APPLY
Item is to be applied.
void examine_monster(object *op, object *tmp, int level)
Player examine a monster.
struct archetype * arch
Pointer to archetype.
StringBuffer * stringbuffer_new(void)
Create a new string buffer.
void examine(object *op, object *tmp)
Player examines some object.
@ SK_DET_MAGIC
Detect magic.
#define FOR_BELOW_PREPARE(op_, it_)
Constructs a loop iterating over all objects below an object.
int16_t invisible
How much longer the object will be invis.
int detect_curse_on_item(object *pl, object *tmp, object *skill)
Runs a 'detect curse' check on a given item.
void command_rskill(object *pl, const char *params)
'ready_skill' command.
uint64_t shop_price_buy(const object *obj, object *who)
Adjust the value of an item to be bought based on the player's bargaining skill and charisma.
@ SK_DISARM_TRAPS
Disarm traps.
void command_use(object *op, const char *params)
Try to use an item on another.
struct mapstruct * map
Pointer to the map in which this object is present.
#define AP_UNAPPLY
Item is to be remvoed.
int identifyskill
Skill used to identify this object class.
void esrv_send_pickup(player *pl)
Sends the "pickup" state to pl if client wants it requested.
void command_uskill(object *pl, const char *params)
'use_skill' command.
#define FLAG_IS_CAULDRON
container can make alchemical stuff
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
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 int matcher_name(object *who, matcher_params *params, object *item)
Check if an item matches a string.
#define FLAG_WIZ
Object has special privilegies.
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 in
#define EVENT_DROP
Object dropped on the floor.
@ SKILL
Also see SKILL_TOOL (74) below.
void examine_wand_charge_level(object *op, object *tmp)
Output charge information for a wand or staff.
tag_t count
Unique object number for this object.
int change_skill(object *who, object *new_skill, int flag)
This changes the object's skill to new_skill.
#define MSG_TYPE_COMMAND_EXAMINE
Player examining something.
void fix_object(object *op)
Updates all abilities given by applied objects in the inventory of the given object.
void command_mark(object *op, const char *params)
'mark' command, to mark an item for some effects (enchant armor, ...).
void command_pickup(object *op, const char *params)
'pickup' command.
char ** arch_name
Possible archetypes of the final product made.
@ TRANSPORT
see doc/Developers/objects
#define MSG_TYPE_COMMAND_ERROR
Bad syntax/can't use command.
int item_to_pick
Index of the item to pick, 1-based.
#define MSG_TYPE_SPELL_INFO
random info about spell, not related to failure/success
char path[HUGE_BUF]
Filename of the map.
void apply_by_living_below(object *pl)
Attempt to apply the object 'below' the player.
#define NDI_BLUE
Actually, it is Dodger Blue.
int16_t level
Level of creature or object.
int events_execute_object_event(object *op, int eventcode, object *activator, object *third, const char *message, int fix)
Execute an event on the specified object.
#define FLAG_NO_SKILL_IDENT
If set, item cannot be identified w/ a skill.
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.
#define HUGE_BUF
Used for messages - some can be quite long.
static void set_pickup_mode(const object *op, int i)
Sets the 'old' pickup mode.
#define MSG_TYPE_COMMAND
Responses to commands, eg, who.
void command_drop(object *op, const char *params)
'drop' command.
const char * nonuse_name
Name to describe objects we can't use.
Plugin animator file specs[Config] name
#define FLAG_REMOVED
Object is not in any map or invenory.
#define FOR_BELOW_FINISH()
Finishes FOR_BELOW_PREPARE().
#define FLAG_KNOWN_CURSED
The object is known to be cursed.
uint32_t update_look
If true, we need to send the look window.
void command_empty(object *op, const char *params)
'empty' command.
int object_matches_pickup_mode(const object *item, int mode)
Checks if an item matches a specific pickup mode.
int32_t carrying
How much weight this object contains.
#define LOOK_OBJ(ob)
This returns TRUE if the object is something that should be displayed in the look window.
Link an object type with skill needed to identify, and general name.
int16_t y
Position in the map for this object.
char * stringbuffer_finish(StringBuffer *sb)
Deallocate the string buffer instance and return the string.
#define FLAG_FREED
Object is in the list of free objects.
void object_free_drop_inventory(object *ob)
Frees everything allocated by an object, removes it from the list of used objects,...
void put_object_in_sack(object *op, object *sack, object *tmp, uint32_t nrof)
Something tries to put an object into another.
struct player * contr
Pointer to the player which control this object.
#define AP_NULL
Nothing specific.
static uint32_t NROF(const object *const ob)
Returns ob->nrof, unless it is 0, in which case return 1.
int use_skill(object *op, const char *string)
Similar to invoke command, it executes the skill in the direction that the user is facing.
static int matcher_all(object *who, matcher_params *params, object *item)
Function allowing all objects.
#define object_decrease_nrof_by_one(xyz)
#define FLAG_KNOWN_MAGICAL
The object is known to be magical.
#define FLAG_NO_DROP
Object can't be dropped.
void command_throw(object *op, const char *params)
'throw' command.
const typedata * get_typedata(int itemtype)
#define FLAG_UNPAID
Object hasn't been paid for yet.
int pickup_type
Value in Pickup modes to match against.
void query_name(const object *op, char *buf, size_t size)
Describes an item.
char name[MAX_BUF]
Name to match for.
const char * use_name
Name used when describing an item we can use.
void examine_weight_and_material(object *op, object *tmp)
Output weight and material information for an examined object.
static int matcher_number(object *who, matcher_params *params, object *item)
Check if an item is the one at the desired position.
int sack_can_hold(const object *pl, const object *sack, const object *op, uint32_t nrof)
Check if an item op can be put into a sack.
@ SK_DET_CURSE
Detect curse.
#define MSG_TYPE_COMMAND_INFO
Generic info: resistances, etc.
sstring add_string(const char *str)
Share a string.
void knowledge_add_probe_monster(object *op, object *mon)
Display monster details, then add to a player's knowledge if not already.
#define FLAG_MONSTER
Will attack players.
#define FOR_OB_AND_BELOW_FINISH()
Finishes FOR_OB_AND_BELOW_PREPARE().
#define HEAD(op)
Returns the head part of an object.
bool player_can_find(object *op, object *ob)
Return true if player 'op' can see object 'op' for purpose of locating items for partial item matchin...
static void pick_up_object(object *pl, object *op, object *tmp, int nrof)
Try to pick up some item.
int transport_can_hold(const object *transport, const object *op, int nrof)
Can transport hold object op? This is a pretty trivial function, but in the future,...
object * below
Pointer to the object stacked below this one.
MoveType move_type
Type of movement this object uses.
object * object_find_by_type_and_name(const object *who, int type, const char *name)
Find object in inventory by type and name.
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...
int32_t value
How much money it is worth (or contains)
int is_identified(const object *op)
Return true if the item is identified, either because it is of a type that doesn't ever need identifi...
char * ob_describe(const object *op, const object *observer, int use_media_tags, char *buf, size_t size)
Returns the description (short item name) of an object, as seen by the given observer.
static void empty_container(object *container, object *pl)
Put all contents of the container on the ground below the player or in opened container,...
uint8_t type
PLAYER, BULLET, etc.
@ SKILLSCROLL
can add a skill to player's inventory -bt.
sstring materialname
Specific material name.
void command_dropall(object *op, const char *params)
Command to drop all items that have not been locked.
#define FOR_INV_FINISH()
Finishes FOR_INV_PREPARE().
#define FLAG_NO_PICK
Object can't be picked up.
#define AP_OPEN
Item is a container to be fully opened.
int identify_object_with_skill(object *tmp, object *pl, object *skill, int print_on_success)
Helper function for do_skill_ident, so that we can loop over inventory AND objects on the ground conv...
int32_t food
How much food in stomach.
#define MSG_TYPE_SKILL_MISSING
Don't have the skill.
void change_exp(object *op, int64_t exp, const char *skill_name, int flag)
Changes experience to a player/monster.
void knowledge_item_can_be_used_alchemy(object *op, const object *item)
Displays known alchemy recipes an item can be used in.
uint32_t tag_t
Object tag, unique during the whole game.
body_locations_struct body_locations[NUM_BODY_LOCATIONS]
The ordering of this is actually doesn't make a difference However, for ease of use,...
The archetype structure is a set of rules on how to generate and manipulate objects which point to ar...
int object_matches_string(object *pl, object *op, const char *name)
This is a subset of the parse_id command.
static item_matcher make_matcher(object *who, const char *params, matcher_params *mp)
Parse parameters and sets up an item matcher based on them.
void stringbuffer_append_string(StringBuffer *sb, const char *str)
Append a string to a string buffer instance.
#define FLAG_IS_FLOOR
Can't see what's underneath this object.
#define FOR_OB_AND_BELOW_PREPARE(op_)
Constructs a loop iterating over an object and all objects below it in the same pile.
#define MSG_TYPE_SPELL
Spell related info.
int16_t SP_level_spellpoint_cost(object *caster, object *spell, int flags)
Scales the spellpoint cost of a spell by it's increased effectiveness.
sstring race
Human, goblin, dragon, etc.
int8_t facing
Object is oriented/facing that way.
static object * find_best_apply_object_match(object *start, object *pl, const char *params, int aflag)
Search from start and through below for what matches best with params.
int detect_magic_on_item(object *pl, object *tmp, object *skill)
Runs a 'detect magic' check on a given item.
TIPS on SURVIVING Crossfire is populated with a wealth of different monsters These monsters can have varying immunities and attack types In some of them can be quite a bit smarter than others It will be important for new players to learn the abilities of different monsters and learn just how much it will take to kill them This section discusses how monsters can interact with players Most monsters in the game are out to mindlessly kill and destroy the players These monsters will help boost a player s after he kills them When fighting a large amount of monsters in a single attempt to find a narrower hallway so that you are not being attacked from all sides Charging into a room full of Beholders for instance would not be open the door and fight them one at a time For there are several maps designed for them Find these areas and clear them out All throughout these a player can find signs and books which they can read by stepping onto them and hitting A to apply the book sign These messages will help the player to learn the system One more always keep an eye on your food If your food drops to your character will soon so BE CAREFUL ! NPCs Non Player Character are special monsters which have intelligence Players may be able to interact with these monsters to help solve puzzles and find items of interest To speak with a monster you suspect to be a simply move to an adjacent square to them and push the double ie Enter your and press< Return > You can also use say if you feel like typing a little extra Other NPCs may not speak to but display intelligence with their movement Some monsters can be and may attack the nearest of your enemies Others can be in that they follow you around and help you in your quest to kill enemies and find treasure SPECIAL ITEMS There are many special items which can be found in of these the most important may be the signs all a player must do is apply the handle In the case of the player must move items over the button to hold it down Some of the larger buttons may need very large items to be moved onto before they can be activated Gates and locked but be for you could fall down into a pit full of ghosts or dragons and not be able to get back out Break away sometimes it may be worth a player s time to test the walls of a map for secret doors Fire such as missile weapons and spells you will notice them going up in smoke ! So be careful not to destroy valuable items Spellbooks sometimes a player can learn the other times they cannot There are many different types of books and scrolls out there Improve item have lower weight
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...
void command_search_items(object *op, const char *params)
'search-items' command.
void inventory(object *op, object *inv)
Prints object's inventory.
#define FLAG_INV_LOCKED
Item will not be dropped from inventory.
object * find_skill_by_name(object *who, const char *name)
This returns the skill pointer of the given name (the one that accumulates exp, has the level,...
int ingred_count
Number of items in ingred.
static std::shared_ptr< inja::Environment > env
Rendering environment.
#define MAX_BUF
Used for all kinds of things.
static void do_skill_by_number(object *op, int skill_subtype, const char *params, const char *missing_message)
Attempt to use a skill from its subtype.
size_t strlcpy(char *dst, const char *src, size_t size)
Portable implementation of strlcpy(3).
object * object_insert_in_map(object *op, mapstruct *m, object *originator, int flag)
This function inserts the object in the two-way linked list which represents what is on a map.
object * create_archetype(const char *name)
Finds which archetype matches the given name, and returns a new object containing a copy of the arche...
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.
uint32_t get_weight_limit(int stat)
int32_t weight
Attributes of the object.
void free_string(sstring str)
This will reduce the refcount, and if it has reached 0, str will be freed.
void command_disarm(object *op, const char *params)
'disarm' command.
static bool IS_PLAYER(object *op)
A buffer that will be expanded as content is added to it.
int item_must_be_pickable
If non zero, then the item number is increased only if the item is pickable.
int probe(object *op, object *caster, object *spell_ob, int dir, int level)
Try to get information about a living thing.
char search_str[MAX_BUF]
Item we are looking for.
#define MSG_TYPE_COMMAND_FAILURE
Failed result from command.
static const uint32_t pickup_modes[]
Value in Pickup modes associated with pickup_names.
static object * find_best_object_match(object *pl, const char *params)
Shortcut to find_best_apply_object_match(pl->inv, pl, params, AF_NULL);.
object * mark
Marked object.
char method_ret
Define some standard return values for callbacks which don't need to return any other results.
static int get_pickup_mode_index(const char *name)
Return the pickup index in pickup_names and pickup_modes associated with the specified name.
#define MSG_TYPE_COMMAND_INVENTORY
Inventory listing.
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.
int(* item_matcher)(object *who, matcher_params *params, object *item)
Prototype for a function checking if an object matches some parameters.
void query_weight(const object *op, char *buf, size_t size)
Formats the item's weight.
int set_object_face_main(object *op)
Makes an object's face the main face, which is supposed to be the "closed" one.
sstring name
The name of the object, obviously...
char * cost_approx_str(const object *obj, object *who)
Return a textual cost approximation in a newly-allocated string.
int object_can_pick(const object *who, const object *item)
Finds out if an object can be picked up.
void stringbuffer_trim_whitespace(StringBuffer *sb)
Trim trailing whitespace from a stringbuffer.
#define EVENT_PICKUP
Object picked up.
char * cost_str(uint64_t cost)
object * env
Pointer to the object which is the environment.
#define FLAG_IS_BUILDABLE
Can build on item.
#define FLAG_IS_THROWN
Object is designed to be thrown.
const typedef char * sstring
#define FLAG_UNDEAD
Monster is undead.
void command_apply(object *op, const char *params)
'apply' command.
bool pick_up(object *op, object *alt)
Try to pick up an item.
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.
bool shop_contains(object *ob)
Check if an object is in a shop.
void command_examine(object *op, const char *params)
'examine' command.
#define FLAG_APPLIED
Object is ready for use by living.
bool examine_fluff(object *op, object *tmp, bool output)
Emit the "fluff", the non-mechanical flavour text, for a given item.
int apply_by_living(object *pl, object *op, int aflag, int quiet)
Living thing is applying an object.
void esrv_update_item(int flags, object *pl, object *op)
Updates object *op for player *pl.
uint8_t max_stat
Maximum stat value - 255 should be sufficient.
sstring msg
If this is a book/sign/magic mouth/etc.
@ SKILL_TOOL
Allows the use of a skill.
sstring object_get_value(const object *op, const char *const key)
Get an extra value by key.
#define AP_NO_MERGE
Don't try to merge object after (un)applying it.
object * find_marked_object(object *op)
Return the object the player has marked with the 'mark' command below.
#define CLEAR_FLAG(xyz, p)
#define SK_SUBTRACT_SKILL_EXP
Used when removing exp.
int apply_special(object *who, object *op, int aflags)
Apply an object.
#define FLAG_STARTEQUIP
Object was given to player at start.
static void display_new_pickup(const object *op, int old)
Utility function to display the pickup mode for a player.
#define INS_NO_MERGE
Don't try to merge with other items.
int identifyskill2
Second skill used to identify this object class.
uint32_t count
Any numbers typed before a command.
#define FLAG_NO_FIX_PLAYER
fix_object() won't be called
int8_t body_info[NUM_BODY_LOCATIONS]
Body info as loaded from the file.
tag_t last_examined
Tag of most recently 'examined object.
int save_player(object *op, int flag)
Saves a player to disk.
uint8_t real_wiz
Use mud-like wizards.
object * stop_item(object *op)
An item (ARROW or such) stops moving.
object * container
Current container being used.
void object_remove(object *op)
This function removes the object op from the linked list of objects which it is currently tied to.
linked_char * ingred
List of ingredients.
object * drop_object(object *op, object *tmp, uint32_t nrof)
Try to drop an object on the floor.
MoveType move_off
Move types affected moving off this space.
void examine_rod_charge_level(object *op, object *tmp)
Output charge information for a rod.
#define FLAG_PROBE
Object displays HP information to player.
void sell_item(object *op, object *pl)
Player is selling an item.
void command_lock_item(object *op, const char *params)
Alternate way to lock/unlock items (command line).
sstring name
More definite name, like "generate_kobold".
uint32_t nrof
Number of objects.
#define FLAG_WAS_WIZ
Player was once a wiz.
socket_struct * socket
Socket information for this player.
int missed
How many items were missed when matching.
void query_base_name(const object *op, int plural, char *buf, size_t size)
Query a short name for the item.
uint8_t search_items
Search_items command.
living stats
Str, Con, Dex, etc.
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
int object_set_value(object *op, const char *key, const char *value, int add_key)
Updates the key in op to value.
@ SK_FIND_TRAPS
Find traps.
void command_take(object *op, const char *params)
This takes (picks up) an item.
static const char * pickup_names[]
Valid names for pickup types.
int item_number
Index of the checked item, 1-based.
uint32_t attacktype
Bitmask of attacks this object does.
object * object_get_player_container(object *op)
Finds the player carrying an object.
#define CUSTOM_NAME_FIELD
Key in an object for the player-assigned custom name.
uint64_t shop_price_sell(const object *obj, object *who)
Adjust the value of an item to be sold based on the player's bargaining skill and charisma.
#define FOR_INV_PREPARE(op_, it_)
Constructs a loop iterating over the inventory of an object.
@ llevDebug
Only for debugging purposes.
#define INS_BELOW_ORIGINATOR
Insert new object immediately below originator.
ex_autoid_result examine_autoidentify(object *op, object *tmp)
When the player examines an unidentified object, try to ID it if they have the requisite skills.
archetype * get_archetype_by_skill_name(const char *skill, int type)
Retrieves an archetype by skill name and type.