79 "No such player.", NULL);
85 "You can't do that to yourself.", NULL);
90 "That player is in no state for that right now.", NULL);
113 "loadtest will stress server through teleporting at different map places. "
114 "Use at your own risk. Very long loop used so server may have to be reset. "
115 "type loadtest TRUE to run",
123 if (strncmp(params,
"TRUE", 4))
152 "You are no longer hidden from other players", NULL);
156 "%s has entered the game.",
157 "%s has entered the game.",
162 "The Dungeon Master has arrived!", NULL);
167 "Other players will no longer see you.", NULL);
172 "The Dungeon Master is gone..", NULL);
176 "%s leaves the game.",
177 "%s leaves the game.",
214 if (params[0] ==
'#')
237 if (!params || !(str = strchr(params,
' '))) {
239 "Usage: setgod object god", NULL);
247 "Set whose god - can not find object %s?",
248 "Set whose god - can not find object %s?",
259 "%s is not a player - can not change its god",
260 "%s is not a player - can not change its god",
301 "Usage: banish <player>.", NULL);
311 if ((banishfile = fopen(buf,
"a")) == NULL) {
314 "Could not find banish_file.", NULL);
323 fprintf(banishfile,
"# %s (%s) banned by %s at %s\n", pl->
ob->
name, pl->
socket.
host, op->
name, ctime(&now));
324 fprintf(banishfile,
"*@%s\n", pl->
socket.
host);
335 "%s banishes %s from the land!",
336 "%s banishes %s from the land!",
356 if ((params == NULL || !strcmp(pl->
ob->
name, params)) && pl->
ob != op) {
369 "%s is kicked out of the game.",
370 "%s is kicked out of the game.",
412 "Overlay save error!", NULL);
415 "Current map has been saved as an overlay.", NULL);
435 if (!stat(filename, &stats))
438 "Overlay successfully removed.", NULL);
441 "Overlay couldn't be removed.", NULL);
444 "No overlay for current map.", NULL);
464 "Usage: toggle_shout <player>.", NULL);
476 "You have been muzzled by the DM!", NULL);
489 "You are allowed to shout and chat again.", NULL);
491 "You remove %s's muzzle.",
492 "You remove %s's muzzle.",
539 if (params == NULL) {
541 "Go to what level?", NULL);
577 "Usage: freeze [ticks] <player>.", NULL);
581 ticks = atoi(params);
583 while ((isdigit(*params) || isspace(*params)) && *params != 0)
587 "Usage: freeze [ticks] <player>.", NULL);
598 "You have been frozen by the DM!", NULL);
601 "You freeze %s for %d ticks",
602 "You freeze %s for %d ticks",
625 if (params == NULL) {
627 "Usage: arrest <player>.", NULL);
637 "Can't jail player, there is no map to hold them", NULL);
643 "You have been arrested.", NULL);
669 if (params == NULL) {
671 "Usage: summon <player>.", NULL);
682 "Can not find a free spot to place summoned player.", NULL);
693 "You are summoned.", NULL);
720 if (params == NULL) {
722 "Usage: teleport <player>.", NULL);
729 "No such player or ambiguous name.", NULL);
736 "Can not find a free spot to teleport to.", NULL);
748 "You see a portal open.", NULL);
750 "You teleport to %s",
751 "You teleport to %s",
785 int i, magic,
set_magic = 0, set_nrof = 0, gotquote, gotspace;
787 char buf[
MAX_BUF], *cp, *bp = buf, *bp2, *bp3, *bp4, *endline;
794 if (params == NULL) {
796 "Usage: create [nr] [magic] <archetype> [ of <artifact>] [variable_to_patch setting]",
803 endline = bp+strlen(bp);
805 if (sscanf(bp,
"%u ", &nrof)) {
806 if ((bp = strchr(params,
' ')) == NULL) {
808 "Usage: create [nr] [magic] <archetype> [ of <artifact>] [variable_to_patch setting]",
816 if (sscanf(bp,
"%d ", &magic)) {
817 if ((bp = strchr(bp,
' ')) == NULL) {
819 "Usage: create [nr] [magic] <archetype> [ of <artifact>] [variable_to_patch setting]",
827 if ((cp = strstr(bp,
" of ")) != NULL) {
831 for (bp2 = bp; *bp2; bp2++) {
841 "No such archetype.", NULL);
846 char spell_name[
MAX_BUF], *fsp = NULL;
858 strcpy(spell_name, cp);
859 fsp = strchr(spell_name,
' ');
867 bp2 = cp+strlen(spell_name)+1;
880 "No artifact list for type %d\n",
881 "No artifact list for type %d\n",
890 }
while (art != NULL);
893 "No such artifact ([%d] of %s)",
894 "No such artifact ([%d] of %s)",
898 LOG(
llevDebug,
"%s creates: (%d) (%d) (%s) of (%s)\n", op->
name, set_nrof ? nrof : 0, set_magic ? magic : 0, bp, cp);
905 "Unable to find spell %s for object that needs it, or it is of wrong type",
906 "Unable to find spell %s for object that needs it, or it is of wrong type",
935 while (*bp2 && bp2 <= endline) {
940 for (bp3 = bp2; *bp3 && gotspace < 2 && gotquote < 2; bp3++) {
955 }
else if (*bp3 ==
' ') {
965 if (gotspace == 2 || gotquote == 2) {
968 }
else if (*bp3 ==
'\0')
971 if ((gotquote && gotquote != 2)
972 || (gotspace != 2 && gotquote != 2)) {
981 "Malformed create line: %s",
982 "Malformed create line: %s",
991 "Unknown variable %s",
992 "Unknown variable %s",
1028 for (i = 0; i < (set_nrof ? nrof : 1); i++) {
1030 object *prev = NULL, *head = NULL, *dup;
1032 for (atmp = at; atmp != NULL; atmp = atmp->
more) {
1048 dup->x = op->
x+dup->arch->clone.x;
1049 dup->y = op->
y+dup->arch->clone.y;
1060 object *check = head;
1067 check = check->
more;
1071 if (head->x < size_x || head->y < size_y) {
1075 "Object too big to insert in map, or wrong position.", NULL);
1084 check = check->
more;
1132 if (!sscanf(params,
"%d", &i) || (tmp =
find_object(i)) == NULL) {
1134 "Inventory of what object (nr)?", NULL);
1187 "Object is marked original", NULL);
1207 "Aggression turned OFF", NULL);
1212 "Aggression turned ON", NULL);
1239 if (params != NULL) {
1240 if (sscanf(params,
"%d", &i))
1242 else if (sscanf(params,
"%s", buf))
1245 if (victim == NULL) {
1247 "Patch what object (nr)?", NULL);
1253 "As insane as you are, I cannot allow you to possess yourself.", NULL);
1273 if (i == 1 || i == 6 || i == 8 || i == 9)
1309 "Patch what values?", NULL);
1313 if ((arg2 = strchr(arg,
' ')))
1319 "Unknown variable %s",
1320 "Unknown variable %s",
1349 "Remove what object (nr)?", NULL);
1355 "Unable to remove a player!", NULL);
1364 "%s is already removed!",
1365 "%s is already removed!",
1377 if (tmp->
speed != 0) {
1402 "Free what object (nr)?", NULL);
1415 "Warning: item was not removed, will do so now.", NULL);
1436 object *skillob = NULL;
1440 if ((params == NULL)
1442 || ((q = sscanf(params,
"%s %d %s", buf, &i, skill)) < 2)) {
1444 "Usage: addexp player quantity [skill].", NULL);
1454 "No such player.", NULL);
1462 "Unable to find skill %s in %s",
1463 "Unable to find skill %s in %s",
1496 if (params == NULL || !sscanf(params,
"%d", &i)) {
1498 "Current speed is %d",
1499 "Current speed is %d",
1507 "The speed is changed to %d.",
1508 "The speed is changed to %d.",
1531 if (params == NULL) {
1540 "No such player.", NULL);
1545 "[Fixed]Statistics for %s:",
"Statistics for %s:", pl->
ob->
name);
1548 "[fixed]Str : %-2d H.P. : %-4d MAX : %d",
1549 "Str : %-2d H.P. : %-4d MAX : %d",
1553 "[fixed]Dex : %-2d S.P. : %-4d MAX : %d",
1554 "Dex : %-2d S.P. : %-4d MAX : %d",
1558 "[fixed]Con : %-2d AC : %-4d WC : %d",
1559 "Con : %-2d AC : %-4d WC : %d",
1563 "[fixed]Int : %-2d Damage : %d",
1564 "Int : %-2d Damage : %d",
1568 "[fixed]Wis : %-2d EXP : %"FMT64,
1569 "Wis : %-2d EXP : %"FMT64,
1573 "[fixed]Pow : %-2d Grace : %d",
1574 "Pow : %-2d Grace : %d",
1578 "[fixed]Cha : %-2d Food : %d",
1579 "Cha : %-2d Food : %d",
1596 char thing[20], thing2[20];
1604 || !sscanf(params,
"%s %s %d", thing, thing2, &iii)
1611 if (thing2 == NULL) {
1613 "You can't change that.", NULL);
1617 if (iii < MIN_STAT || iii >
MAX_STAT) {
1619 "Illegal range of stat.\n", NULL);
1624 if (!strcmp(pl->
ob->
name, thing)) {
1627 if (!strcmp(
"str", thing2))
1629 if (!strcmp(
"dex", thing2))
1631 if (!strcmp(
"con", thing2))
1633 if (!strcmp(
"wis", thing2))
1635 if (!strcmp(
"cha", thing2))
1637 if (!strcmp(
"int", thing2))
1639 if (!strcmp(
"pow", thing2))
1642 "%s has been altered.",
1643 "%s has been altered.",
1651 "No such player.", NULL);
1667 object *dummy = NULL, *tmp = NULL;
1669 char *space, *confirmation = NULL;
1672 if (params == NULL) {
1674 "Reset what map [name]?", NULL);
1678 space = strchr(params,
' ');
1679 if (space != NULL) {
1680 confirmation = params;
1684 if (strcmp(params,
".") == 0)
1691 "No such map.", NULL);
1696 if (strcmp(params,
".") == 0 && m->
unique) {
1698 "Can't reset a player unique map while on it, use 'reset full-reset %s' while not on it.",
1699 "Can't reset a player unique map while on it, use 'reset full-reset %s' while not on it.",
1704 if (strncmp(
"full-reset", confirmation, strlen(
"full-reset"))) {
1706 "Invalid confirmation, must be 'full-reset'.",
"Invalid confirmation, must be 'full-reset'.");
1716 "You need to disembark first.", NULL);
1724 LOG(
llevError,
"Tried to swap out map which was not in memory.\n");
1733 if (strncmp(m->
path,
"/random/", 8) == 0) {
1743 "You cannot reset a random map when inside it.", NULL);
1761 int playercount = 0;
1772 "Reset failed, error code: %d.", NULL, res);
1775 "Reset failed, couldn't swap map, the following players are on it:",
1778 if (pl->
ob->
map == m && pl->
ob != op) {
1786 "hmm, I don't see any other players on this map, something else is the problem.",
1809 "Fully resetting map %s.",
"Fully resetting map %s.",
1813 "Resetting map %s.",
"Resetting map %s.",
1821 if (confirmation == NULL) {
1823 "Use 'reset full-reset %s' to fully reset the map.", params);
1850 "You are no longer hidden from other players", NULL);
1853 "%s has entered the game.",
1854 "%s has entered the game.",
1860 "The Dungeon Master is gone..", NULL);
1887 static int checkdm(
object *op,
const char *pl_name,
const char *pl_passwd,
const char *pl_host) {
1890 char line_buf[160], name[160], passwd[160], host[160];
1892 #ifdef RESTRICTIVE_DM
1893 *pl_name = op->
name ? op->
name :
"*";
1897 if ((dmfile = fopen(buf,
"r")) == NULL) {
1902 while (fgets(line_buf, 160, dmfile) != NULL) {
1903 if (line_buf[0] ==
'#')
1905 if (sscanf(line_buf,
"%[^:]:%[^:]:%s\n", name, passwd, host) != 3) {
1906 LOG(
llevError,
"Warning - malformed dm file entry: %s\n", line_buf);
1907 }
else if ((!strcmp(name,
"*") || (pl_name && !strcmp(pl_name, name)))
1908 && (!strcmp(passwd,
"*") || !strcmp(passwd, pl_passwd))
1909 && (!strcmp(host,
"*") || !strcmp(host, pl_host))) {
1938 "You are already the Dungeon Master!", NULL);
1948 "Ok, you are the Dungeon Master!", NULL);
1961 "The Dungeon Master has arrived!", NULL);
1966 "Sorry Pal, I don't think so.", NULL);
2003 "You turn invisible.", NULL);
2030 size_t spell_name_length;
2039 if (strncmp(ar->
name,
"spelldirect_", 12) == 0)
2042 if (strcmp(ar->
clone.
name, spell_name) != 0)
2045 if (found != NULL) {
2046 if (!conflict_found) {
2049 "More than one archetype matches the spell name %s:",
2050 "More than one archetype matches the spell name %s:",
2076 spell_name_length = strlen(spell_name);
2083 if (strncmp(ar->
name,
"spelldirect_", 12) == 0)
2086 if (strncmp(ar->
clone.
name, spell_name, spell_name_length) != 0)
2089 if (found != NULL) {
2090 if (!conflict_found) {
2093 "More than one spell matches %s:",
2094 "More than one spell matches %s:",
2121 "The spell %s does not exist.",
2122 "The spell %s does not exist.",
2144 if (op->
contr == NULL || params == NULL) {
2146 "Which spell do you want to learn?", NULL);
2157 "You already know the spell %s.",
2158 "You already know the spell %s.",
2213 if (op->
contr == NULL || params == NULL) {
2215 "Which spell do you want to forget?", NULL);
2220 if (spell == NULL) {
2222 "You do not know the spell %s.",
2223 "You do not know the spell %s.",
2262 if (params == NULL) {
2264 "Load which plugin?", NULL);
2269 strcat(buf,
"/plugins/");
2270 strcat(buf, params);
2275 "Plugin %s successfully loaded.",
2276 "Plugin %s successfully loaded.",
2280 "Could not load plugin %s.",
2281 "Could not load plugin %s.",
2299 if (params == NULL) {
2301 "Remove which plugin?", NULL);
2308 "Plugin %s successfully removed.",
2309 "Plugin %s successfully removed.",
2313 "Could not remove plugin %s.",
2314 "Could not remove plugin %s.",
2350 "Empty stack!", NULL);
2356 "Popped item from stack, %d left.",
2357 "Popped item from stack, %d left.",
2378 "Empty stack!", NULL);
2385 "Stacked item was removed!", NULL);
2411 "Item stack full!", NULL);
2417 "Item stacked as %d.",
2418 "Item stacked as %d.",
2451 int item_tag, item_position;
2457 if (!params || !*params || **params ==
'\0') {
2465 while (**params ==
' ')
2469 if (sscanf(*params,
"%d", &item_tag)) {
2471 while (isdigit(**params))
2475 while (**params ==
' ')
2498 if (sscanf(*params,
"$%d", &item_position)) {
2502 while (isdigit(**params))
2504 while (**params ==
' ')
2511 "No such stack item %d!",
2512 "No such stack item %d!",
2522 "Stack item %d was removed.",
2523 "Stack item %d was removed.",
2534 if (!strncmp(*params,
"me", 2)) {
2541 while (**params ==
' ')
2606 "Item stack contents:", NULL);
2618 " %d : (lost item: %d)",
2619 " %d : (lost item: %d)",
2639 "Item stack cleared.", NULL);
2665 object *left, *right, *top;
2668 int left_from, right_from;
2675 "Compare to what item?", NULL);
2687 "Compare what item?", NULL);
2692 "Item difference:", NULL);
2705 "(Note: first item taken from undertop)", NULL);
2715 if (*diff ==
'\0') {
2734 object *left, *right, *inserted;
2735 int left_from, right_from;
2741 "Insert into what object?", NULL);
2753 "Insert what item?", NULL);
2768 "(Note: item to insert into taken from undertop)", NULL);
2775 if (left == right) {
2777 "Can't insert an object into itself!", NULL);
2783 "Can't insert a player into something!", NULL);
2791 if (inserted != right)
2798 "Inserted %s in %s",
2799 "Inserted %s in %s",
2818 int maps_used = 0, mapmem = 0, objects_used = 0, x, y;
2821 for (mp = styles; mp != NULL; mp = mp->
next) {
2832 "[fixed]Style maps loaded: %d",
2833 "Style maps loaded: %d",
2836 "[fixed]Memory used, not",
2837 "Memory used, not");
2839 "[fixed]including objects: %d",
2840 "including objects: %d",
2843 "Style objects: %d",
2844 "Style objects: %d",
2847 "Mem for objects: %d",
2848 "Mem for objects: %d",
2849 objects_used*
sizeof(
object));
2879 if (other == op->
contr) {
void do_wizard_hide(object *op, int silent_dm)
object * lookup_spell_by_name(object *op, const char *spname)
#define NUM_BODY_LOCATIONS
int command_inventory(object *op, char *params)
archetype * find_archetype(const char *name)
void show_skills(object *op, const char *search)
void enter_exit(object *op, object *exit_ob)
void esrv_new_player(player *pl, uint32 weight)
int command_nowiz(object *op, char *params)
object * check_spell_known(object *op, const char *name)
int command_skills(object *op, char *params)
int command_overlay_reset(object *op, char *params)
int command_create(object *op, char *params)
void do_forget_spell(object *op, const char *spell)
void do_some_living(object *op)
int command_forget_spell(object *op, char *params)
struct artifactstruct * items
object * insert_ob_in_map_at(object *op, mapstruct *m, object *originator, int flag, int x, int y)
int save_player(object *op, int flag)
StringBuffer * stringbuffer_new(void)
int command_listplugins(object *op, char *params)
object * find_object_name(const char *str)
void esrv_update_item(int flags, object *pl, object *op)
struct treasureliststruct * randomitems
int command_arrest(object *op, char *params)
#define MSG_TYPE_COMMAND_SUCCESS
short freearr_x[SIZEOFFREE]
int command_dmhide(object *op, char *params)
#define MSG_TYPE_ADMIN_PLAYER
void draw_ext_info(int flags, int pri, const object *pl, uint8 type, uint8 subtype, const char *message, const char *oldmessage)
void esrv_send_inventory(object *pl, object *op)
int command_insert_into(object *op, char *params)
void update_object(object *op, int action)
void play_again(object *op)
void dm_stack_pop(player *pl)
int command_stack_clear(object *op, char *params)
int command_setgod(object *op, char *params)
int command_style_map_info(object *op, char *params)
int command_possess(object *op, char *params)
const object * find_god(const char *name)
object * find_object(tag_t i)
int command_diff(object *op, char *params)
int command_addexp(object *op, char *params)
int command_toggle_shout(object *op, char *params)
void draw_ext_info_format(int flags, int pri, const object *pl, uint8 type, uint8 subtype, const char *new_format, const char *old_format,...)
int swap_map(mapstruct *map)
object * get_jail_exit(object *op)
short freearr_y[SIZEOFFREE]
int command_reset(object *op, char *params)
#define FLAG_KNOWN_MAGICAL
void create_treasure(treasurelist *t, object *op, int flag, int difficulty, int tries)
int command_invisible(object *op, char *params)
void remove_ob(object *op)
void flush_old_maps(void)
int command_patch(object *op, char *params)
void player_lvl_adj(object *who, object *op)
int command_remove(object *op, char *params)
#define FLAG_OBJ_ORIGINAL
artifactlist * find_artifactlist(int type)
int command_freeze(object *op, char *params)
#define FLAG_UNAGGRESSIVE
int plugins_init_plugin(const char *libfile)
static int checkdm(object *op, const char *pl_name, const char *pl_passwd, const char *pl_host)
void dump_object(object *op, StringBuffer *sb)
char * path_combine_and_normalize(const char *src, const char *dst, char *path, size_t size)
void set_max_time(long t)
int command_speed(object *op, char *params)
static object * find_object_both(char *params)
int command_hide(object *op, char *params)
int execute_global_event(int eventcode,...)
archetype * find_archetype_by_object_name(const char *name)
void check_score(object *op, int quiet)
void do_learn_spell(object *op, object *spell, int special_prayer)
int plugins_remove_plugin(const char *id)
int command_goto(object *op, char *params)
#define FREE_AND_CLEAR_STR(xyz)
static object * get_spell_by_name(object *op, const char *spell_name)
int command_stack_list(object *op, char *params)
#define QUERY_FLAG(xyz, p)
#define CLEAR_FLAG(xyz, p)
void clear_los(object *op)
object * insert_ob_in_ob(object *op, object *where)
void plugins_display_list(object *op)
object * object_create_arch(archetype *at)
object * get_object(void)
#define MSG_TYPE_COMMAND_DEBUG
object * insert_ob_in_map(object *op, mapstruct *m, object *originator, int flag)
#define MSG_TYPE_ADMIN_DM
int command_free(object *op, char *params)
static void set_magic(int difficulty, object *op, int max_magic, int flags)
int do_wizard_dm(object *op, char *params, int silent)
void inventory(object *op, object *inv)
void calc_perm_exp(object *op)
int save_map(mapstruct *m, int flag)
int need_identify(const object *op)
sint8 body_info[NUM_BODY_LOCATIONS]
void become_follower(object *op, const object *new_god)
int snprintf(char *dest, int max, const char *format,...)
void get_ob_diff(StringBuffer *sb, object *op, object *op2)
int command_loadtest(object *op, char *params)
int command_summon(object *op, char *params)
int command_overlay_save(object *op, char *params)
int command_follow(object *op, char *params)
int command_mon_aggr(object *op, char *params)
mapstruct * has_been_loaded(const char *name)
int command_learn_spell(object *op, char *params)
int set_variable(object *op, char *buf)
object * dm_stack_peek(player *pl)
sint64 check_exp_adjust(const object *op, sint64 exp)
int out_of_map(mapstruct *m, int x, int y)
int command_teleport(object *op, char *params)
void update_los(object *op)
int command_stack_pop(object *op, char *params)
void update_ob_speed(object *op)
int command_unloadplugin(object *op, char *params)
sstring add_string(const char *str)
EXTERN player * first_player
int command_abil(object *op, char *params)
#define GET_MAP_OB(M, X, Y)
int find_free_spot(const object *ob, mapstruct *m, int x, int y, int start, int stop)
void give_artifact_abilities(object *op, object *artifact)
void LOG(LogLevel logLevel, const char *format,...)
int command_learn_special_prayer(object *op, char *params)
static player * get_other_player_from_name(object *op, const char *name)
object * get_dm_object(player *pl, char **params, int *from)
void set_abs_magic(object *op, int magic)
int command_kick(object *op, const char *params)
void copy_object(object *op2, object *op)
int command_banish(object *op, char *params)
void query_name(const object *op, char *buf, size_t size)
void free_object(object *ob)
void create_overlay_pathname(const char *name, char *buf, size_t size)
int command_shutdown(object *op, char *params)
static int command_learn_spell_or_prayer(object *op, char *params, int special_prayer)
#define MSG_TYPE_COMMAND_MAPS
#define MSG_TYPE_COMMAND_DM
void map_remove_unique_files(const mapstruct *map)
int command_stats(object *op, char *params)
#define SAVE_ERROR_PLAYER
void fix_object(object *op)
player * find_player_partial_name(const char *plname)
#define MSG_TYPE_COMMAND_ERROR
EXTERN archetype * first_archetype
object * find_skill_by_name(object *who, const char *name)
object * arch_to_object(archetype *at)
#define SAVE_MODE_OVERLAY
char * stringbuffer_finish(StringBuffer *sb)
struct artifactstruct * next
int command_stack_push(object *op, char *params)
int command_dm(object *op, char *params)
int command_dump(object *op, char *params)
int command_loadplugin(object *op, char *params)
void dm_stack_push(player *pl, tag_t item)