 |
Crossfire Server, Trunk
1.75.0
|
Go to the documentation of this file.
78 "You can't do that to yourself.");
83 "That player is in no state for that right now.");
104 "Popped item from stack, %d left.",
132 "Stacked item was removed!");
164 "Item stacked as %d.",
197 int item_tag, item_position;
203 if (**params ==
'\0') {
211 while (**params ==
' ')
215 if (sscanf(*params,
"%d", &item_tag)) {
217 while (isdigit(**params))
221 while (**params ==
' ')
243 if (sscanf(*params,
"$%d", &item_position)) {
247 while (isdigit(**params))
249 while (**params ==
' ')
256 "No such stack item %d!",
266 "Stack item %d was removed.",
277 if (!strncmp(*params,
"me", 2)) {
284 while (**params ==
' ')
311 "loadtest will stress server through teleporting at different map places. "
312 "Use at your own risk. Very long loop used so server may have to be reset. "
313 "type loadtest TRUE to run");
319 if (strncmp(params,
"TRUE", 4))
338 "You are no longer hidden from other players");
341 "%s has entered the game.", op->
name);
358 "The Dungeon Master has arrived!");
363 "Other players will no longer see you.");
368 "The Dungeon Master is gone...");
372 "%s leaves the game.",
404 if (params[0] ==
'#')
423 if (*params ==
'\0' || !(str =
const_cast<char *
>(strchr(params,
' ')))) {
425 "Usage: set_god player god");
433 "Set whose god - can not find object %s?",
444 "%s is not a player - can not change its god",
472 if ((*params ==
'\0' || !strcmp(pl->
ob->
name, params)) && pl->
ob != op) {
478 "%s is kicked out of the game.",
508 if (*params ==
'\0') {
510 "Usage: banish <player>.");
520 if ((banishfile = fopen(
buf,
"a")) == NULL) {
523 "Could not find banish_file.");
532 fprintf(banishfile,
"# %s (%s) banned by %s at %s\n", pl->
ob->
name, pl->
socket->
host, op->
name, ctime(&now));
533 fprintf(banishfile,
"*@%s\n", pl->
socket->
host);
543 "%s banishes %s from the land!",
575 "Overlay save error!");
578 "Current map has been saved as an overlay.");
595 if (!stat(filename, &
stats))
596 if (!unlink(filename))
598 "Overlay successfully removed.");
601 "Overlay couldn't be removed.");
604 "No overlay for current map.");
618 if (*params ==
'\0') {
620 "Usage: toggle_shout <player>.");
632 "You have been muzzled by the DM!");
644 "You are allowed to shout and chat again.");
646 "You remove %s's muzzle.",
659 if (strlen(params) == 0) {
673 }
else if (strcmp(params,
"cancel") == 0) {
683 }
else if (strncmp(params,
"now", 3) == 0) {
690 }
else if (strcmp(params,
"idle") == 0) {
699 int minutes = atoi(params);
701 if (minutes > 0 && minutes <= 720) {
704 "Server will shut down in %d minutes.", minutes);
707 LOG(
llevInfo,
"Server shutdown scheduled in %d minutes by %s.\n", minutes, op->
name);
711 "Please specify a reasonable time in minutes.");
728 if (*params ==
'\0') {
730 "Go to what level?");
749 if (*params ==
'\0') {
751 "Usage: freeze [ticks] <player>.");
755 ticks = atoi(params);
757 while ((isdigit(*params) || isspace(*params)) && *params != 0)
761 "Usage: freeze [ticks] <player>.");
772 "You have been frozen by the DM!");
775 "You freeze %s for %d ticks",
807 if (cur == who->
map && x == who->
x && y == who->
y)
827 if (*params ==
'\0') {
829 "Usage: arrest <player>.");
840 "Can't jail player, there is no map to hold them");
846 "Can't jail player, map loading issue or already in jail's position");
852 "You have been arrested.");
874 if (*params ==
'\0') {
876 "Usage: summon <player>.");
887 "Can not find a free spot to place summoned player.");
898 "You are summoned.");
908 if (*params ==
'\0') {
941 if (*params ==
'\0') {
943 "Usage: teleport <player>.");
950 "No such player or ambiguous name.");
957 "Can not find a free spot to teleport to.");
969 "You see a portal open.");
971 "You teleport to %s",
1002 int magic,
set_magic = 0, set_nrof = 0, gotquote, gotspace;
1004 char *cp, *bp, *bp2, *bp3, *endline, cpy[
MAX_BUF];
1011 if (*params ==
'\0') {
1013 "Usage: create [nr] [magic] <archetype> [ of <artifact>] [variable_to_patch setting]");
1020 endline = bp+strlen(bp);
1022 if (sscanf(bp,
"%u ", &nrof)) {
1023 if ((bp = strchr(cpy,
' ')) == NULL) {
1025 "Usage: create [nr] [magic] <archetype> [ of <artifact>] [variable_to_patch setting]");
1032 if (sscanf(bp,
"%d ", &magic)) {
1033 if ((bp = strchr(bp,
' ')) == NULL) {
1035 "Usage: create [nr] [magic] <archetype> [ of <artifact>] [variable_to_patch setting]");
1042 if ((cp = strstr(bp,
" of ")) != NULL) {
1046 for (bp2 = bp; *bp2; bp2++) {
1056 "No such archetype.");
1061 char spell_name[
MAX_BUF], *fsp = NULL;
1074 fsp = strchr(spell_name,
' ');
1082 bp2 = cp+strlen(spell_name)+1;
1095 "No artifact list for type %d\n",
1099 auto i = std::find_if(items.cbegin(), items.cend(),
1100 [&] (
const auto art) { return !strcmp(art->item->name, cp) && legal_artifact_combination(&at->clone, art); });
1101 art = i == items.cend() ? nullptr : *i;
1105 "No such artifact ([%d] of %s)",
1116 "Unable to find spell %s for object that needs it, or it is of wrong type",
1123 "Unable to find spell %s for object that needs it, or it is of wrong type",
1152 while (*bp2 && bp2 <= endline) {
1156 for (bp3 = bp2; *bp3 && gotspace < 2 && gotquote < 2; bp3++) {
1170 }
else if (*bp3 ==
' ') {
1180 if (gotspace == 2 || gotquote == 2) {
1183 }
else if (*bp3 ==
'\0')
1186 if ((gotquote && gotquote != 2)
1187 || (gotspace != 2 && gotquote != 2)) {
1196 "Malformed create line: %s",
1205 "Unknown variable %s",
1241 for (i = 0; i < (set_nrof ? nrof : 1); i++) {
1243 object *prev = NULL, *head = NULL, *dup;
1245 for (atmp = at; atmp != NULL; atmp = atmp->
more) {
1261 dup->x = op->
x+dup->arch->clone.x;
1262 dup->y = op->
y+dup->arch->clone.y;
1273 object *check = head;
1280 check = check->
more;
1284 if (head->x < size_x || head->y < size_y) {
1288 "Object too big to insert in map, or wrong position.");
1297 check = check->
more;
1339 if (*params ==
'\0') {
1346 "Inventory of what object (nr)?");
1393 "Object is marked original");
1411 "Aggression turned OFF");
1416 "Aggression turned ON");
1439 if (*params !=
'\0') {
1440 if (sscanf(params,
"%d", &i))
1442 else if (sscanf(params,
"%s",
buf))
1445 if (victim == NULL) {
1447 "Patch what object (nr)?");
1453 "As insane as you are, I cannot allow you to possess yourself.");
1473 if (i == 1 || i == 6 || i == 8 || i == 9)
1494 const char *arg, *arg2;
1506 "Patch what values?");
1510 if ((arg2 = strchr(arg,
' ')))
1516 "Unknown variable %s",
1572 "Remove what object (nr)?");
1578 "Unable to remove a player!");
1587 "%s is already removed!",
1598 if (tmp->
speed != 0) {
1620 "Free what object (nr)?");
1631 "Warning: item was not removed, will do so now.");
1641 if (sscanf(params,
"%s %[^\n]", account_name, newpw) != 2) {
1643 "Usage: accountpasswd ACCOUNT PASSWORD");
1651 "Updated account password.");
1655 "Invalid characters in new password.");
1659 "Invalid characters in new password.");
1663 "Error changing password.");
1679 object *skillob = NULL;
1683 if ((*params ==
'\0')
1685 || ((q = sscanf(params,
"%s %d %[^\r\n]",
buf, &i,
skill)) < 2)) {
1687 "Usage: addexp player quantity [skill].");
1705 "Unable to find skill %s in %s",
1735 if (*params ==
'\0' || !sscanf(params,
"%d", &i)) {
1737 "Current speed is %d",
1745 "The speed is changed to %d.",
1765 if (*params ==
'\0') {
1779 "[Fixed]Statistics for %s:", pl->
ob->
name);
1782 "[fixed]Str : %-2d H.P. : %-4d MAX : %d",
1786 "[fixed]Dex : %-2d S.P. : %-4d MAX : %d",
1790 "[fixed]Con : %-2d AC : %-4d WC : %d",
1794 "[fixed]Int : %-2d Damage : %d",
1798 "[fixed]Wis : %-2d EXP : %" FMT64,
1802 "[fixed]Pow : %-2d Grace : %d",
1806 "[fixed]Cha : %-2d Food : %d",
1820 char thing[20], thing2[20];
1828 || sscanf(params,
"%s %s %d", thing, thing2, &iii) != 3
1829 || thing[0] ==
'\0') {
1835 if (thing2[0] ==
'\0') {
1837 "You can't change that.");
1843 "Illegal range of stat.\n");
1848 if (!strcmp(pl->
ob->
name, thing)) {
1851 if (!strcmp(
"str", thing2))
1853 if (!strcmp(
"dex", thing2))
1855 if (!strcmp(
"con", thing2))
1857 if (!strcmp(
"wis", thing2))
1859 if (!strcmp(
"cha", thing2))
1861 if (!strcmp(
"int", thing2))
1863 if (!strcmp(
"pow", thing2))
1866 "%s has been altered.",
1887 object *dummy = NULL, *tmp = NULL;
1889 const char *space, *confirmation = NULL;
1892 if (*params ==
'\0') {
1898 space = strchr(params,
' ');
1899 if (space != NULL) {
1900 confirmation = params;
1905 if (strcmp(params,
".") == 0) {
1919 if (
m->unique && (op->
map ==
m)) {
1922 "Cannot reset a unique player map while on it. Use "
1923 "'reset full-reset %s' while standing somewhere else.",
1928 if (strncmp(
"full-reset", confirmation, strlen(
"full-reset"))) {
1940 "You need to disembark first.");
1946 sstring reset_group =
m->reset_group;
1947 m->reset_group = NULL;
1951 LOG(
llevError,
"Tried to swap out map which was not in memory.\n");
1952 m->reset_group = reset_group;
1961 if (strncmp(
m->path,
"/random/", 8) == 0) {
1971 "You cannot reset a random map when inside it.");
1972 m->reset_group = reset_group;
1990 int playercount = 0;
2001 "Reset failed, error code: %d.", res);
2012 m->reset_group = reset_group;
2018 "Reset failed, couldn't swap map, the following players are on it:");
2020 if (pl->
ob->
map ==
m && pl->
ob != op) {
2028 "hmm, I don't see any other players on this map, something else is the problem.");
2029 m->reset_group = reset_group;
2065 if (confirmation == NULL) {
2068 "Use 'reset full-reset %s' to fully reset the map.", params);
2092 "The Dungeon Master is gone...");
2117 static int checkdm(
object *op,
const char *pl_name,
const char *pl_passwd,
const char *pl_host) {
2120 char line_buf[160],
name[160], passwd[160], host[160];
2122 #ifdef RESTRICTIVE_DM
2123 *pl_name = op->
name ? op->
name :
"*";
2129 if ((dmfile = fopen(
buf,
"r")) == NULL) {
2134 while (fgets(line_buf, 160, dmfile) != NULL) {
2136 if (line_buf[0] ==
'#' || line_buf[0] ==
'\n')
2138 if (sscanf(line_buf,
"%[^:]:%[^:]:%s\n",
name, passwd, host) != 3) {
2139 LOG(
llevError,
"Warning - malformed dm file entry: %s\n", line_buf);
2140 }
else if ((!strcmp(
name,
"*") || (pl_name && !strcmp(pl_name,
name)))
2141 && (!strcmp(passwd,
"*") || !strcmp(passwd, pl_passwd))
2142 && (!strcmp(host,
"*") || !strcmp(host, pl_host))) {
2171 "You are already the Dungeon Master!");
2181 "Ok, you are the Dungeon Master!");
2193 "The Dungeon Master has arrived!");
2199 "Sorry Pal, I don't think so.");
2232 "You turn invisible.");
2256 size_t spell_name_length;
2262 if (ar->clone.type !=
SPELL)
2265 if (strncmp(ar->name,
"spelldirect_", 12) == 0)
2268 if (strcmp(ar->clone.name, spell_name) != 0)
2272 if (!conflict_found) {
2275 "More than one archetype matches the spell name %s:",
2299 spell_name_length = strlen(spell_name);
2304 if (ar->clone.type !=
SPELL)
2307 if (strncmp(ar->name,
"spelldirect_", 12) == 0)
2310 if (strncmp(ar->clone.name, spell_name, spell_name_length) != 0)
2314 if (!conflict_found) {
2317 "More than one spell matches %s:",
2342 "The spell %s does not exist.",
2360 if (op->
contr == NULL || *params ==
'\0') {
2362 "Which spell do you want to learn?");
2373 "You already know the spell %s.",
2418 if (op->
contr == NULL || *params ==
'\0') {
2420 "Which spell do you want to forget?");
2425 if (
spell == NULL) {
2427 "You do not know the spell %s.",
2461 if (*params ==
'\0') {
2463 "Load which plugin?");
2467 snprintf(
buf,
sizeof(
buf), LIBDIR
"/plugins/%s", params);
2472 "Plugin %s successfully loaded.",
2476 "Could not load plugin %s.",
2491 if (*params ==
'\0') {
2493 "Remove which plugin?");
2500 "Plugin %s successfully removed.",
2505 "Could not remove plugin %s.",
2572 "Item stack contents:");
2583 " %d : (lost item: %d)",
2600 "Item stack cleared.");
2623 object *left, *right;
2626 int left_from, right_from;
2631 "Compare to what item?");
2643 "Compare what item?");
2648 "Item difference:");
2661 "(Note: first item taken from undertop)");
2671 if (*diff ==
'\0') {
2687 object *left, *right, *inserted;
2688 int left_from, right_from;
2694 "Insert into what object?");
2706 "Insert what item?");
2721 "(Note: item to insert into taken from undertop)");
2728 if (left == right) {
2730 "Can't insert an object into itself!");
2736 "Can't insert a player into something!");
2744 if (inserted != right)
2751 "Inserted %s in %s",
2766 int maps_used = 0, mapmem = 0, objects_used = 0, x, y;
2769 for (mp =
styles; mp != NULL; mp = mp->
next) {
2781 "[fixed]Style maps loaded: %d",
2784 "[fixed]Memory used, not");
2786 "[fixed]including objects: %d",
2789 "[fixed]Style objects: %d",
2792 "[fixed]Mem for objects: %lu",
2793 (
unsigned long)(objects_used*
sizeof(
object)));
2812 if (*params ==
'\0') {
2825 if (other == op->
contr) {
2835 "You can only follow members in the same party.");
2889 if (op && op->
below) {
2904 if (op && op->
above) {
uint8_t casting_time
It takes awhile to cast a spell.
static player * get_other_player_from_name(object *op, const char *name)
Enough of the DM functions seem to need this that I broke it out to a separate function.
void command_overlay_reset(object *op, const char *params)
Removes the overlay for op's current map.
void command_possess(object *op, const char *params)
DM can possess a monster.
@ STACK_FROM_NONE
Item was not found.
#define UP_OBJ_FACE
Only thing that changed was the face.
tag_t * stack_items
Item stack for patch/dump/...
player * next
Pointer to next player, NULL if this is last.
static void set_magic(int difficulty, object *op, int max_magic, int flags)
Sets a random magical bonus in the given object based upon the given difficulty, and the given max po...
#define FREE_AND_CLEAR_STR_IF(xyz)
#define FREE_OBJ_NO_DESTROY_CALLBACK
Do not run the destroy callback.
player * first_player
First player.
struct Settings settings
Server settings.
void set_abs_magic(object *op, int magic)
Sets magical bonus in an object, and recalculates the effect on the armour variable,...
#define STACK_SIZE
Stack size, static.
#define FOR_MAP_FINISH()
Finishes FOR_MAP_PREPARE().
@ STACK_FROM_NUMBER
Item is a number (may be top)
int16_t maxhp
Max hit points.
void command_overlay_save(object *op, const char *params)
Saves the op's map as an overlay - objects are persisted.
#define NUM_BODY_LOCATIONS
Number of body locations.
#define MSG_TYPE_COMMAND_SUCCESS
Successful result from command.
void command_style_map_info(object *op, const char *params)
Displays information about styles loaded for random maps.
@ llevError
Error, serious thing.
uint16_t difficulty
What level the player should be to play here.
#define MSG_TYPE_ADMIN_PLAYER
Player coming/going/death.
void LOG(LogLevel logLevel, const char *format,...)
Logs a message to stderr, or to file.
static void reset_faces_sent(struct socket_struct *socket)
archetype * more
Next part of a linked object.
void command_patch(object *op, const char *params)
Wizard wants to altar an object.
uint8_t resurrection
Ressurection possible w/ permadeth on.
#define QUERY_FLAG(xyz, p)
int plugins_remove_plugin(const char *id)
Unload the specified plugin.
int plugins_init_plugin(const char *libfile)
Try to load the specified plugin.
uint8_t set_title
Players can set thier title.
void do_learn_spell(object *op, object *spell, int special_prayer)
Actually makes op learn spell.
void command_shutdown(object *op, const char *params)
Totally shutdowns the server.
mapstruct * has_been_loaded(const char *name)
Checks whether map has been loaded.
Socket structure, represents a client-server connection.
int allocated_sockets
Number of allocated items in init_sockets.
void flush_old_maps(void)
Reset maps that need to, remove their swap file.
void esrv_new_player(player *pl, uint32_t weight)
Tells the client that here is a player it should start using.
uint8_t not_permadeth
If true, death is non-permament.
void command_speed(object *op, const char *params)
Changes the server speed.
uint8_t permanent_exp_ratio
How much exp should be 'permenant' and unable to be lost.
void esrv_send_inventory(object *pl, object *op)
Sends inventory of a container.
static int do_wizard_dm(object *op, const char *params, int silent)
Actually changes a player to wizard.
void command_learn_spell(object *op, const char *params)
Wizard wants to learn a regular spell.
const char * datadir
Read only data files.
struct archetype * arch
Pointer to archetype.
StringBuffer * stringbuffer_new(void)
Create a new string buffer.
int16_t players
How many players are on this level right now.
uint32_t no_shout
if True, player is *not *able to use shout command.
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.
std::vector< artifact * > items
Artifacts for this type.
int16_t invisible
How much longer the object will be invis.
static void dm_stack_pop(player *pl)
Remove an item from the wizard's item stack.
#define FLAG_OBJ_ORIGINAL
NEVER SET THIS.
object * ob
The object representing the player.
object * transport
Transport the player is in.
float speed_left
How much speed is left to spend this round.
void give_artifact_abilities(object *op, const object *artifact)
Fixes the given object, giving it the abilities and titles it should have due to the second artifact-...
Socket_Info socket_info
Socket information.
struct mapstruct * map
Pointer to the map in which this object is present.
void command_arrest(object *op, const char *params)
Wizard jails player.
uint32_t worldmaptilesy
Number of tiles high the worldmap is.
void command_teleport(object *op, const char *params)
Teleport next to target player.
void command_mon_aggr(object *op, const char *params)
When DM is possessing a monster, flip aggression on and off, to allow better motion.
object * item
Special values of the artifact.
static void dm_stack_push(player *pl, tag_t item)
Push specified item on player stack.
int64_t check_exp_adjust(const object *op, int64_t exp)
Returns the maximum experience the object can gain or lose.
uint32_t worldmapstartx
Starting x tile for the worldmap.
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
void command_purge_quest(object *op, const char *param)
void calc_perm_exp(object *op)
Ensure that the permanent experience requirements in an exp object are met.
static void unhide(object *op)
void do_dump(object *who, object *what)
tag_t count
Unique object number for this object.
#define FLAG_WIZCAST
The wizard can cast spells in no-magic area.
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 command_invisible(object *op, const char *params)
Wizard wants to become invisible.
void fix_object(object *op)
Updates all abilities given by applied objects in the inventory of the given object.
void command_banish(object *op, const char *params)
Add player's IP to ban_file and kick them off the server.
uint32_t hidden
If True, player (DM) is hidden from view.
object * enemy
Monster/player to follow even if not closest.
void plugins_display_list(object *op)
Displays a list of loaded plugins (keystrings and description) in the game log window.
void command_addexp(object *op, const char *params)
This adds exp to a player.
void command_listplugins(object *op, const char *params)
Lists all plugins currently loaded with their IDs and full names.
#define MSG_TYPE_COMMAND_ERROR
Bad syntax/can't use command.
object * object_find_by_tag_global(tag_t i)
Returns the object which has the count-variable equal to the argument.
char path[HUGE_BUF]
Filename of the map.
void set_tick_duration(long t)
Sets the tick duration.
AssetsManager * getManager()
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.
#define MSG_TYPE_COMMAND
Responses to commands, eg, who.
const object * find_god(const char *name)
Returns a god's object from its name.
Plugin animator file specs[Config] name
#define SAVE_MODE_OVERLAY
Map is persisted as an overlay.
uint32_t worldmaptilesx
Number of tiles wide the worldmap is.
#define FLAG_ALIVE
Object can fight (or be fought)
void command_learn_special_prayer(object *op, const char *params)
Wizard wants to learn a god-given spell.
void command_remove(object *op, const char *params)
Remove an object from its position.
void map_remove_unique_files(const mapstruct *map)
Remove files containing the map's unique items.
#define MSG_TYPE_ADMIN_DM
DM related admin actions.
#define MSG_TYPE_COMMAND_DEBUG
Various debug type commands.
uint8_t spell_encumbrance
Encumbrance effects spells.
int16_t y
Position in the map for this object.
static event_registration m
void clear_los(player *pl)
Clears/initialises the los-array associated to the player controlling the object.
#define MAP_IN_MEMORY
Map is fully loaded.
char * stringbuffer_finish(StringBuffer *sb)
Deallocate the string buffer instance and return the string.
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.
time_t time
When using SHUTDOWN_TIME, time of shutdown.
struct player * contr
Pointer to the player which control this object.
void command_toggle_shout(object *op, const char *params)
A simple toggle for the no_shout field.
uint32_t map_size(mapstruct *m)
Calculate map size without intermediate sign extension.
void command_setgod(object *op, const char *params)
Sets the god for some objects.
#define FLAG_WAS_WIZ
Player was once a wiz.
short freearr_y[SIZEOFFREE]
Y offset when searching around a spot.
void command_create(object *op, const char *params)
Wizard wants to create an object.
uint8_t death_penalty_ratio
Hhow much exp should be lost at death.
void command_reset(object *op, const char *params)
Resets a map.
static void do_wizard_hide(object *op, int silent_dm)
Actually hides or unhides specified player (obviously a DM).
void query_name(const object *op, char *buf, size_t size)
Describes an item.
void command_summon(object *op, const char *params)
Summons player near DM.
uint16_t set_friendly_fire
Percent of damage done by peaceful player vs player damage.
sstring followed_player
Player the DM is following.
char * path_combine_and_normalize(const char *src, const char *dst, char *path, size_t size)
Combines the 2 paths.
#define MSG_TYPE_COMMAND_DM
DM related commands.
void command_purge_quest_definitions(object *op, const char *param)
object clone
An object from which to do object_copy()
@ STACK_FROM_TOP
Item is stack top.
void object_dump(const object *op, StringBuffer *sb)
Dumps an object.
uint32_t worldmapstarty
Starting y tile for the worldmap.
sstring add_string(const char *str)
This will add 'str' to the hash table.
#define HEAD(op)
Returns the head part of an object.
void free_quest(void)
Free all quest status structures.
object * below
Pointer to the object stacked below this one.
void command_dm(object *op, const char *params)
Actual command to perhaps become dm.
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 * host
Which host it is connected from (ip address).
void command_abil(object *op, const char *params)
Changes an object's statistics.
object * lookup_spell_by_name(object *op, const char *spname)
Look at object 'op' and see if they know the spell spname.
void command_dumpbelow(object *op, const char *params)
Player wants to dump object below her.
void command_diff(object *op, const char *params)
Get a diff of specified items.
void object_update_speed(object *op)
Updates the speed of an object.
uint8_t type
PLAYER, BULLET, etc.
void command_inventory(object *op, const char *params)
Shows the inventory or some item.
void do_goto(object *op, const char *name, int x, int y)
int16_t dam
How much damage this object does when hitting.
void command_swap(object *op, const char *params)
Mark a map as ready for swapping.
void command_help(object *op, const char *params)
Player is asking for some help.
struct shutdown_s shutdown_state
void show_skills(object *op, const char *search)
Displays a player's skill list, and some other non skill related info (god, max weapon improvements,...
void command_skills(object *op, const char *params)
Player is asking for her skills.
object * object_create_arch(archetype *at)
Create a full object using the given archetype.
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 spell
void player_lvl_adj(object *who, object *op)
For the new exp system.
#define FLAG_WIZPASS
The wizard can go through walls.
void object_free(object *ob, int flags)
Frees everything allocated by an object, removes it from the list of used objects,...
void command_dumpabove(object *op, const char *params)
Player wants to dump object above her.
float item_power_factor
See note in setings file.
#define DMFILE
File containing valid names that can be dm, one on each line.
void command_insert_into(object *op, const char *params)
Puts an object into another.
int32_t food
How much food in stomach.
#define FLAG_UNAGGRESSIVE
Monster doesn't attack players.
void assets_finish_archetypes_for_play()
uint32_t tag_t
Object tag, unique during the whole game.
The archetype structure is a set of rules on how to generate and manipulate objects which point to ar...
const char * confdir
Configuration files.
void each(std::function< void(T *)> op)
Apply a function to each asset.
This structure contains all information related to one map square.
int become_follower(object *op, const object *new_god)
This function is called whenever a player has switched to a new god.
void command_goto(object *op, const char *params)
Wizard teleports to a map.
void init_signals()
Setup our signal handlers.
uint8_t death_penalty_level
How many levels worth of exp may be lost on one death.
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...
#define FLAG_MONSTER
Will attack players.
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,...
#define MAP_WIDTH(m)
Map width.
void command_kick(object *op, const char *params)
Kicks a player from the server.
void command_loadtest(object *op, const char *params)
This command will stress server.
Archetypes * archetypes()
Get archetypes.
#define MAX_BUF
Used for all kinds of things.
size_t strlcpy(char *dst, const char *src, size_t size)
Portable implementation of strlcpy(3).
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.
living orig_stats
Permanent real stats of player.
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 identified by its _keyword_ So if you want to unload the Python you need to do plugout Python plugin< libname > Loads a given whose _filename_ is libname So in the case of you d have to do a plugin cfpython so Note that all filenames are relative to the default plugin path(SHARE/plugins). Console messages. ----------------- When Crossfire starts
void monster_check_apply_all(object *monster)
Calls monster_check_apply() for all inventory objects.
void command_hide(object *op, const char *params)
Wizard 'hide' command.
int8_t wc
Weapon Class, lower WC increases probability of hitting.
#define SAVE_ERROR_UCREATION
Couldn't create the file for unique objects.
A buffer that will be expanded as content is added to it.
#define FREE_AND_CLEAR_STR(xyz)
Release the shared string, and set it to NULL.
void command_freeze(object *op, const char *params)
Freezes a player for a specified tick count, 100 by default.
uint8_t spell_failure_effects
Nasty backlash to spell failures.
#define MSG_TYPE_COMMAND_FAILURE
Failed result from command.
#define FOR_MAP_PREPARE(map_, mx_, my_, it_)
Constructs a loop iterating over all objects of a map tile.
#define ST_PLAYING
Usual state.
void command_forget_spell(object *op, const char *params)
Command for players to forget a spell.
#define FLAG_REMOVED
Object is not in any map or invenory.
int allow_denied_spells_writing
If set, players can write spells they can't cast.
void command_nowiz(object *op, const char *params)
Steps down from wizard mode.
#define FLAG_WIZ
Object has special privilegies.
mapstruct * styles
Loaded styles maps cache, to avoid having to load all the time.
int swap_map(mapstruct *map)
Swaps a map to disk.
void command_loadplugin(object *op, const char *params)
Loads the given plugin.
#define NDI_UNIQUE
Print immediately, don't buffer.
#define EVENT_MUZZLE
A player was Muzzled (no_shout set).
archetype * find_archetype_by_object_name(const char *name)
This function retrieves an archetype given the name that appears during the game (for example,...
#define FLAG_FRIENDLY
Will help players.
object * get_jail_exit(object *op)
Returns an object which is an exit through which the player represented by op should be sent in order...
sstring name
The name of the object, obviously...
static void command_learn_spell_or_prayer(object *op, const char *params, int special_prayer)
Wizards wants to learn a spell.
static object * get_spell_by_name(object *op, const char *spell_name)
Returns spell object (from archetypes) by name.
int16_t maxsp
Max spell points.
bool can_follow(object *op, player *other)
int is_identifiable_type(const object *op)
Return true if this item's type is one that cares about whether or not it's been identified – e....
void enter_exit(object *op, object *exit_ob)
Tries to move 'op' to exit_ob.
object * object_find_by_name_global(const char *str)
Finds an object by name.
object * check_spell_known(object *op, const char *name)
Checks to see if player knows the spell.
static object * find_object_both(const char *params)
This finds and returns the object which matches the name or object number (specified via num #whateve...
const typedef char * sstring
void command_settings(object *op, const char *ignored)
Wizard wants to know some server settings, so display.
#define NDI_ALL
Inform all players of this message.
int set_variable(object *op, const char *buf)
This takes a buffer, scans it for variables, and sets those variables as appropriate in op.
void command_stats(object *op, const char *params)
Displays the statistics of a player.
uint8_t state
Input state of the player (name, password, etc).
void command_dump(object *op, const char *params)
Dumps the difference between an object and its archetype.
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...
void command_dmhide(object *op, const char *params)
A players wants to become DM and hide.
void esrv_update_item(int flags, object *pl, object *op)
Updates object *op for player *pl.
void command_unloadplugin(object *op, const char *params)
Unloads the given plugin.
uint8_t max_stat
Maximum stat value - 255 should be sufficient.
This is used by get_rangevector to determine where the other creature is.
#define MAP_SWAPPED
Map spaces have been saved to disk.
void reset_sleep(void)
Initialise all variables used in the timing routines.
#define CLEAR_FLAG(xyz, p)
int player_arrest(object *who)
Put a player into jail, taking into account cursed exits and player's region.
size_t faces_sent_len
This is the number of elements allocated in faces_sent[].
void command_follow(object *op, const char *params)
Follow a player, or stop following a player.
static object * get_dm_object(player *pl, const char **params, int *from)
Checks 'params' for object code.
#define MAP_HEIGHT(m)
Map height.
int8_t ac
Armor Class, lower AC increases probability of not getting hit.
uint32_t tick_duration
Gloabal variables:
#define NDI_DK_ORANGE
DarkOrange2.
void get_ob_diff(StringBuffer *sb, const object *op, const object *op2)
Returns a pointer to a static string which contains all variables which are different in the two give...
player * find_player_partial_name(const char *plname)
Find a player by a partial name.
int account_change_password(const char *account_name, const char *current_password, const char *new_password)
Change an account password.
uint8_t * faces_sent
This is a bitmap on sent face status.
object * arch_to_object(archetype *at)
Creates and returns a new object which is a copy of the given archetype.
void object_give_identified_properties(object *op)
Ensure op has all its "identified" properties set.
Player Stats effect how well a character can survie and interact inside the crossfire world This section discusses the various stats
int get_rangevector(object *op1, const object *op2, rv_vector *retval, int flags)
From map.c This is used by get_player to determine where the other creature is.
partylist * party
Party this player is part of.
static int checkdm(object *op, const char *pl_name, const char *pl_passwd, const char *pl_host)
object *op is trying to become dm.
#define MSG_TYPE_COMMAND_MAPS
uint32_t count
Any numbers typed before a command.
int8_t body_info[NUM_BODY_LOCATIONS]
Body info as loaded from the file.
void command_accountpasswd(object *op, const char *params)
struct treasurelist * randomitems
Items to be generated.
uint8_t real_wiz
Use mud-like wizards.
#define MSG_TYPE_COMMUNICATION_PARTY
Party message.
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)
void inventory(object *op, object *inv)
Prints object's inventory.
void do_forget_spell(object *op, const char *spell)
Erases spell from player's inventory.
static void command_kick2(object *op, const char *params)
Kicks a player from the server.
void do_some_living(object *op)
Regenerate hp/sp/gr, decreases food.
@ STACK_FROM_STACK
Item is somewhere in stack.
int save_map(mapstruct *m, int flag)
Saves a map to file.
uint32_t nrof
Number of objects.
int stack_position
Current stack position, 0 for no item.
void command_stack_push(object *op, const char *params)
Push specified item on stack.
socket_struct * socket
Socket information for this player.
mapstruct * next
Next map, linked list.
void assets_collect(const char *datadir, int what)
Collect all assets from the specified directory and all its subdirectories.
uint8_t no_player_stealing
If 1, can not steal from other players.
living stats
Str, Con, Dex, etc.
This is one artifact, ie one special item.
void command_free(object *op, const char *params)
Totally free an object.
object * more
Pointer to the rest of a large body of objects.
#define MSG_TYPE_COMMUNICATION
Communication between players.
void update_los(object *op)
Recalculates the array which specifies what is visible for the given player-object.
short freearr_x[SIZEOFFREE]
X offset when searching around a spot.
void command_recollect(object *op, const char *params)
void command_stack_pop(object *op, const char *params)
Pop the stack top.
uint8_t create_home_portals
If 1, can create portals in unique maps (apartments)
artifactlist * find_artifactlist(int type)
Finds the artifact list for a certain item type.
unsigned int distance
Distance, in squares.
#define EVENT_KICK
A player was Kicked by a DM
#define SAVE_ERROR_PLAYER
Player on map to save.
void create_treasure(treasurelist *t, object *op, int flag, int difficulty, int tries)
This calls the appropriate treasure creation function.
static object * dm_stack_peek(player *pl)
Get current stack top item for player.
#define NDI_LT_GREEN
DarkSeaGreen, which is actually paler than seagreen - also background color.
void events_execute_global_event(int eventcode,...)
Execute a global event.
@ llevDebug
Only for debugging purposes.
#define FLAG_IDENTIFIED
Player knows full info about item.
void command_stack_clear(object *op, const char *params)
Empty DM item stack.
void command_stack_list(object *op, const char *params)
Displays stack contents.
const char * localdir
Read/write data files.