mirror of
https://github.com/tbamud/tbamud.git
synced 2026-01-02 15:38:49 +01:00
zlist update and a few bug fixes
This commit is contained in:
parent
358d18b7fd
commit
143364cbc9
9 changed files with 104 additions and 47 deletions
|
|
@ -35,6 +35,12 @@ export (QQ's a zone into a tarball)
|
|||
Xlist (mlist, olist, rlist, zlist, slist, tlist, qlist)
|
||||
(lots of major bugfixes too)
|
||||
@
|
||||
[Dec 05 2010] - Jamdog
|
||||
Bug-Fix: 'Did you mean' now only shows commands you have access to (thanks Welcor)
|
||||
Bug-Fix: Fixed crash bug introduced by new house system when saving house contents
|
||||
Scan command now tells you when nothing is nearby (thanks Mirad)
|
||||
zlist command can now list by builder, like show zones
|
||||
zlist now uses page_string (thanks Mirad)
|
||||
[Dec 02 2010] - Jamdog
|
||||
Bug-Fix: identify command in shops was listing incorrect buy price (thanks Kam)
|
||||
Added %actor.admlevel% and %actor.admlevel(<level>)% to dg-scripts
|
||||
|
|
|
|||
|
|
@ -2670,6 +2670,7 @@ distance, int door)
|
|||
ACMD(do_scan)
|
||||
{
|
||||
int door;
|
||||
bool found=FALSE;
|
||||
|
||||
int range;
|
||||
int maxrange = 3;
|
||||
|
|
@ -2692,15 +2693,21 @@ ACMD(do_scan)
|
|||
send_to_char(ch, "%s: It's too dark to see, but you can hear shuffling.\r\n", dirs[door]);
|
||||
else
|
||||
send_to_char(ch, "%s: It is too dark to see anything.\r\n", dirs[door]);
|
||||
} else {
|
||||
if (world[scanned_room].people)
|
||||
found=TRUE;
|
||||
} else {
|
||||
if (world[scanned_room].people) {
|
||||
list_scanned_chars(world[scanned_room].people, ch, range - 1, door);
|
||||
}
|
||||
found=TRUE;
|
||||
}
|
||||
}
|
||||
} // end of if
|
||||
else
|
||||
break;
|
||||
} // end of range
|
||||
scanned_room = IN_ROOM(ch);
|
||||
} // end of directions
|
||||
if (!found) {
|
||||
send_to_char(ch, "You don't see aanything nearby!\r\n");
|
||||
}
|
||||
} // end of do_scan
|
||||
|
||||
|
|
|
|||
|
|
@ -1568,7 +1568,6 @@ void set_default_admin_privs(struct char_data *ch, bool keep_old)
|
|||
SET_BIT_AR(ADM_FLAGS(ch), ADM_TELLALL);
|
||||
SET_BIT_AR(ADM_FLAGS(ch), ADM_EATANYTHING);
|
||||
SET_BIT_AR(ADM_FLAGS(ch), ADM_BUILD);
|
||||
SET_BIT_AR(ADM_FLAGS(ch), ADM_MONEY);
|
||||
case ADMLVL_GOD: SET_BIT_AR(ADM_FLAGS(ch), ADM_WALKANYWHERE);
|
||||
SET_BIT_AR(ADM_FLAGS(ch), ADM_NOKEYS);
|
||||
SET_BIT_AR(ADM_FLAGS(ch), ADM_SEEINV);
|
||||
|
|
@ -1577,6 +1576,7 @@ void set_default_admin_privs(struct char_data *ch, bool keep_old)
|
|||
SET_BIT_AR(ADM_FLAGS(ch), ADM_ALLSHOPS);
|
||||
SET_BIT_AR(ADM_FLAGS(ch), ADM_SEESECRET);
|
||||
SET_BIT_AR(ADM_FLAGS(ch), ADM_NOSTEAL);
|
||||
SET_BIT_AR(ADM_FLAGS(ch), ADM_MONEY);
|
||||
case ADMLVL_IMMORT: SET_BIT_AR(ADM_FLAGS(ch), ADM_KNOWWEATHER);
|
||||
SET_BIT_AR(ADM_FLAGS(ch), ADM_SETQP);
|
||||
SET_BIT_AR(ADM_FLAGS(ch), ADM_NOPOISON);
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@
|
|||
#include "oasis.h"
|
||||
#include "class.h"
|
||||
#include "quest.h"
|
||||
#include "act.h"
|
||||
|
||||
/* Utility functions */
|
||||
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ int is_name(const char *str, const char *namelist)
|
|||
{
|
||||
const char *curname, *curstr;
|
||||
|
||||
if (!*str || !*namelist || !str || !namelist)
|
||||
if (!str || !namelist || !*str || !*namelist)
|
||||
return (0);
|
||||
|
||||
curname = namelist;
|
||||
|
|
|
|||
|
|
@ -104,6 +104,8 @@ int House_save(struct obj_data *obj, FILE *fp)
|
|||
int result;
|
||||
room_vnum rv;
|
||||
|
||||
if (!obj) return(1);
|
||||
|
||||
rv = world[(IN_ROOM(obj))].number;
|
||||
hse = find_house(rv);
|
||||
|
||||
|
|
|
|||
|
|
@ -482,6 +482,22 @@ void sort_commands(void)
|
|||
qsort(cmd_sort_info + 1, num_of_cmds - 2, sizeof(int), sort_commands_helper);
|
||||
}
|
||||
|
||||
/* Returns TRUE if 'ch' has sufficient access to use the command 'cmd' */
|
||||
bool can_use_command(struct char_data *ch, int cmd)
|
||||
{
|
||||
if (complete_cmd_info[cmd].admin_flag == ADM_NONE &&
|
||||
complete_cmd_info[cmd].minimum_admlevel == ADMLVL_MORTAL &&
|
||||
GET_LEVEL(ch) >= complete_cmd_info[cmd].minimum_level)
|
||||
return TRUE;
|
||||
|
||||
if (complete_cmd_info[cmd].admin_flag == ADM_NONE && GET_ADMLEVEL(ch) >= complete_cmd_info[cmd].minimum_admlevel)
|
||||
return TRUE;
|
||||
|
||||
if (complete_cmd_info[cmd].admin_flag != ADM_NONE && ADM_FLAGGED(ch, complete_cmd_info[cmd].admin_flag))
|
||||
return TRUE;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* This is the actual command interpreter called from game_loop() in comm.c
|
||||
* It makes sure you are the proper level and position to execute the command,
|
||||
|
|
@ -567,12 +583,15 @@ void command_interpreter(struct char_data *ch, char *argument)
|
|||
if ( (levenshtein_distance(arg, cmd_info[cmd].command) <= 2) &&
|
||||
(cmd_info[cmd].minimum_level >= 0) )
|
||||
{
|
||||
if (!found)
|
||||
{
|
||||
send_to_char(ch, "\r\nDid you mean:\r\n");
|
||||
found = 1;
|
||||
/* Does this person have access to this command? */
|
||||
if (can_use_command(ch, cmd)) {
|
||||
if (!found)
|
||||
{
|
||||
send_to_char(ch, "\r\nDid you mean:\r\n");
|
||||
found = 1;
|
||||
}
|
||||
send_to_char(ch, " %s\r\n", cmd_info[cmd].command);
|
||||
}
|
||||
send_to_char(ch, " %s\r\n", cmd_info[cmd].command);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@
|
|||
#include "constants.h"
|
||||
#include "dg_scripts.h"
|
||||
#include "quest.h"
|
||||
#include "modify.h"
|
||||
|
||||
/* local functions */
|
||||
static void list_triggers(struct char_data *ch, zone_rnum rnum, trig_vnum vmin, trig_vnum vmax);
|
||||
|
|
@ -29,7 +30,7 @@ static void list_rooms(struct char_data *ch , zone_rnum rnum, room_vnum vmin, r
|
|||
static void list_mobiles(struct char_data *ch, zone_rnum rnum, mob_vnum vmin , mob_vnum vmax );
|
||||
static void list_objects(struct char_data *ch, zone_rnum rnum, obj_vnum vmin , obj_vnum vmax );
|
||||
static void list_shops(struct char_data *ch , zone_rnum rnum, shop_vnum vmin, shop_vnum vmax);
|
||||
static void list_zones(struct char_data *ch, zone_rnum rnum, zone_vnum vmin, zone_vnum vmax);
|
||||
static void list_zones(struct char_data *ch, zone_rnum rnum, zone_vnum vmin, zone_vnum vmax, char *name);
|
||||
|
||||
void perform_mob_flag_list(struct char_data * ch, char *arg)
|
||||
{
|
||||
|
|
@ -102,6 +103,7 @@ ACMD(do_oasis_list)
|
|||
char smin[MAX_INPUT_LENGTH];
|
||||
char smax[MAX_INPUT_LENGTH];
|
||||
char arg[MAX_INPUT_LENGTH], arg2[MAX_INPUT_LENGTH];
|
||||
bool use_name = FALSE;
|
||||
|
||||
two_arguments(argument, smin, smax);
|
||||
|
||||
|
|
@ -110,7 +112,10 @@ ACMD(do_oasis_list)
|
|||
} else if (!*smax) {
|
||||
rzone = real_zone(atoi(smin));
|
||||
|
||||
if (rzone == NOWHERE) {
|
||||
if ((rzone == NOWHERE || rzone == 0) && subcmd == SCMD_OASIS_ZLIST && !isdigit(*smin)) {
|
||||
/* Must be zlist, with builder name as arg */
|
||||
use_name = TRUE;
|
||||
} else if (rzone == NOWHERE) {
|
||||
send_to_char(ch, "Sorry, there's no zone with that number\r\n");
|
||||
return;
|
||||
}
|
||||
|
|
@ -130,40 +135,42 @@ ACMD(do_oasis_list)
|
|||
|
||||
two_arguments(argument, arg, arg2);
|
||||
|
||||
if (is_abbrev(arg, "level") || is_abbrev(arg, "flags")) {
|
||||
if (is_abbrev(arg, "level") || is_abbrev(arg, "flags")) {
|
||||
int i;
|
||||
|
||||
int i;
|
||||
if (!*arg2) {
|
||||
send_to_char(ch, "Which mobile flag or level do you want to list?\r\n");
|
||||
for (i=0; i<NUM_MOB_FLAGS; i++)
|
||||
{
|
||||
send_to_char(ch, "%s%2d%s-%s%-14s%s", CCNRM(ch, C_NRM), i, CCNRM(ch, C_NRM), CCYEL(ch, C_NRM), action_bits[i], CCNRM(ch, C_NRM));
|
||||
if (!((i+1)%4)) send_to_char(ch, "\r\n");
|
||||
}
|
||||
send_to_char(ch, "\r\n");
|
||||
send_to_char(ch, "Usage: %smlist flags <num>%s\r\n", CCYEL(ch, C_NRM), CCNRM(ch, C_NRM));
|
||||
send_to_char(ch, " %smlist level <num>%s\r\n", CCYEL(ch, C_NRM), CCNRM(ch, C_NRM));
|
||||
send_to_char(ch, "Displays mobs with the selected flag, or at the selected level\r\n\r\n");
|
||||
|
||||
if (!*arg2) {
|
||||
send_to_char(ch, "Which mobile flag or level do you want to list?\r\n");
|
||||
for (i=0; i<NUM_MOB_FLAGS; i++)
|
||||
{
|
||||
send_to_char(ch, "%s%2d%s-%s%-14s%s", CCNRM(ch, C_NRM), i, CCNRM(ch, C_NRM), CCYEL(ch, C_NRM), action_bits[i], CCNRM(ch, C_NRM));
|
||||
if (!((i+1)%4)) send_to_char(ch, "\r\n");
|
||||
}
|
||||
send_to_char(ch, "\r\n");
|
||||
send_to_char(ch, "Usage: %smlist flags <num>%s\r\n", CCYEL(ch, C_NRM), CCNRM(ch, C_NRM));
|
||||
send_to_char(ch, " %smlist level <num>%s\r\n", CCYEL(ch, C_NRM), CCNRM(ch, C_NRM));
|
||||
send_to_char(ch, "Displays mobs with the selected flag, or at the selected level\r\n\r\n");
|
||||
|
||||
return;
|
||||
}
|
||||
if (is_abbrev(arg, "level"))
|
||||
perform_mob_level_list(ch, arg2);
|
||||
else
|
||||
perform_mob_flag_list(ch, arg2);
|
||||
} else
|
||||
list_mobiles(ch, rzone, vmin, vmax); break;
|
||||
return;
|
||||
}
|
||||
if (is_abbrev(arg, "level"))
|
||||
perform_mob_level_list(ch, arg2);
|
||||
else
|
||||
perform_mob_flag_list(ch, arg2);
|
||||
} else
|
||||
list_mobiles(ch, rzone, vmin, vmax);
|
||||
break;
|
||||
case SCMD_OASIS_OLIST: list_objects(ch, rzone, vmin, vmax); break;
|
||||
case SCMD_OASIS_RLIST: list_rooms(ch, rzone, vmin, vmax); break;
|
||||
case SCMD_OASIS_TLIST: list_triggers(ch, rzone, vmin, vmax); break;
|
||||
case SCMD_OASIS_SLIST: list_shops(ch, rzone, vmin, vmax); break;
|
||||
case SCMD_OASIS_QLIST: list_quests(ch, rzone, vmin, vmax); break;
|
||||
case SCMD_OASIS_ZLIST:
|
||||
if (!*smin)
|
||||
list_zones(ch, NOWHERE, 0, zone_table[top_of_zone_table].number);
|
||||
else
|
||||
list_zones(ch, rzone, vmin, vmax);
|
||||
if (!*smin) /* No args - list all zones */
|
||||
list_zones(ch, NOWHERE, 0, zone_table[top_of_zone_table].number, NULL);
|
||||
else if (use_name) /* Builder name as arg */
|
||||
list_zones(ch, NOWHERE, 0, zone_table[top_of_zone_table].number, smin);
|
||||
else /* Numerical args */
|
||||
list_zones(ch, rzone, vmin, vmax, NULL);
|
||||
break;
|
||||
default:
|
||||
send_to_char(ch, "You can't list that!\r\n");
|
||||
|
|
@ -402,22 +409,30 @@ static void list_shops(struct char_data *ch, zone_rnum rnum, shop_vnum vmin, sho
|
|||
}
|
||||
|
||||
/* List all zones in the world (sort of like 'show zones'). */
|
||||
static void list_zones(struct char_data *ch, zone_rnum rnum, zone_vnum vmin, zone_vnum vmax)
|
||||
static void list_zones(struct char_data *ch, zone_rnum rnum, zone_vnum vmin, zone_vnum vmax, char *name)
|
||||
{
|
||||
int counter = 0;
|
||||
int counter = 0, len=0, tmp_len = 0;
|
||||
zone_rnum i;
|
||||
zone_vnum bottom, top;
|
||||
char buf[MAX_STRING_LENGTH];
|
||||
bool use_name=FALSE;
|
||||
|
||||
bottom = vmin;
|
||||
top = vmax;
|
||||
|
||||
if (rnum != NOWHERE) {
|
||||
/* Only one parameter was supplied - just list that zone */
|
||||
print_zone(ch, zone_table[rnum].number);
|
||||
return;
|
||||
} else {
|
||||
bottom = vmin;
|
||||
top = vmax;
|
||||
} else if (name && *name) {
|
||||
use_name = TRUE;
|
||||
if (!vmin)
|
||||
bottom = zone_table[0].number; /* Lowest Zone */
|
||||
if (!vmax)
|
||||
top = zone_table[top_of_zone_table].number; /* Highest Zone */
|
||||
}
|
||||
|
||||
send_to_char(ch,
|
||||
len = snprintf(buf, sizeof(buf),
|
||||
"VNum Zone Name Builder(s)\r\n"
|
||||
"----- ------------------------------ --------------------------------------\r\n");
|
||||
|
||||
|
|
@ -426,15 +441,21 @@ static void list_zones(struct char_data *ch, zone_rnum rnum, zone_vnum vmin, zon
|
|||
|
||||
for (i = 0; i <= top_of_zone_table; i++) {
|
||||
if (zone_table[i].number >= bottom && zone_table[i].number <= top) {
|
||||
send_to_char(ch, "[%s%3d%s] %s%-*s %s%-1s%s\r\n",
|
||||
QGRN, zone_table[i].number, QNRM, QCYN, count_color_chars(zone_table[i].name)+30, zone_table[i].name,
|
||||
QYEL, zone_table[i].builders ? zone_table[i].builders : "None.", QNRM);
|
||||
tmp_len = 0;
|
||||
if ((!use_name) || (is_name(name, zone_table[i].builders))) {
|
||||
tmp_len = snprintf(buf+len, sizeof(buf)-len, "[%s%3d%s] %s%-*s %s%-1s%s\r\n",
|
||||
QGRN, zone_table[i].number, QNRM, QCYN, count_color_chars(zone_table[i].name)+30, zone_table[i].name,
|
||||
QYEL, zone_table[i].builders ? zone_table[i].builders : "None.", QNRM);
|
||||
}
|
||||
len += tmp_len;
|
||||
counter++;
|
||||
}
|
||||
}
|
||||
|
||||
if (!counter)
|
||||
send_to_char(ch, " None found within those parameters.\r\n");
|
||||
else
|
||||
page_string(ch->desc, buf, TRUE);
|
||||
}
|
||||
|
||||
/* Prints all of the zone information for the selected zone. */
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@
|
|||
#include "act.h"
|
||||
#include "modify.h"
|
||||
#include "spells.h" /* for skill_name() */
|
||||
#include "screen.h"
|
||||
|
||||
/* Global variables definitions used externally */
|
||||
/* Constant list for printing out who we sell to */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue