mirror of
https://github.com/tbamud/tbamud.git
synced 2025-12-22 18:20:13 +01:00
olist expanded, happyhour script vars and buildwalk update
This commit is contained in:
parent
b06cf00639
commit
d2b4faf1c9
9 changed files with 327 additions and 19 deletions
|
|
@ -35,8 +35,11 @@ export (QQ's a zone into a tarball)
|
||||||
Xlist (mlist, olist, rlist, zlist, slist, tlist, qlist)
|
Xlist (mlist, olist, rlist, zlist, slist, tlist, qlist)
|
||||||
(lots of major bugfixes too)
|
(lots of major bugfixes too)
|
||||||
@
|
@
|
||||||
[Dec 06 2010] - Jamdog
|
[Dec 07 2010] - Jamdog
|
||||||
Fixed erroneous SYSERR report and incorrect contant in new house system (thanks Vatiken)
|
Fixed erroneous SYSERR report and incorrect contant in new house system (thanks Vatiken)
|
||||||
|
Buildwalk now allows builder to specify default sector type (thanks Mirad)
|
||||||
|
Added happyhour script variables (thanks Kam)
|
||||||
|
Added affects list and type list to olist command
|
||||||
[Dec 06 2010] - Jamdog
|
[Dec 06 2010] - Jamdog
|
||||||
Added new mail system, with inbox OLC, index rebuilder and first mail (to ID 1)
|
Added new mail system, with inbox OLC, index rebuilder and first mail (to ID 1)
|
||||||
Bug-Fix: levels command wasn't showing max level, or validating high/low levels
|
Bug-Fix: levels command wasn't showing max level, or validating high/low levels
|
||||||
|
|
|
||||||
|
|
@ -1872,7 +1872,7 @@ ACMD(do_diagnose)
|
||||||
ACMD(do_toggle)
|
ACMD(do_toggle)
|
||||||
{
|
{
|
||||||
char buf2[4], arg[MAX_INPUT_LENGTH], arg2[MAX_INPUT_LENGTH];
|
char buf2[4], arg[MAX_INPUT_LENGTH], arg2[MAX_INPUT_LENGTH];
|
||||||
int toggle, tp, wimp_lev, result = 0, len = 0;
|
int toggle, tp, wimp_lev, result = 0, len = 0, i;
|
||||||
const char *types[] = { "off", "brief", "normal", "on", "\n" };
|
const char *types[] = { "off", "brief", "normal", "on", "\n" };
|
||||||
|
|
||||||
const struct {
|
const struct {
|
||||||
|
|
@ -2147,10 +2147,16 @@ ACMD(do_toggle)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
result = PRF_TOG_CHK(ch, PRF_BUILDWALK);
|
result = PRF_TOG_CHK(ch, PRF_BUILDWALK);
|
||||||
if (PRF_FLAGGED(ch, PRF_BUILDWALK))
|
if (PRF_FLAGGED(ch, PRF_BUILDWALK)) {
|
||||||
|
for (i=0; *arg2 && *(sector_types[i]) != '\n'; i++)
|
||||||
|
if (is_abbrev(arg2, sector_types[i]))
|
||||||
|
break;
|
||||||
|
if (*(sector_types[i]) == '\n') i=0;
|
||||||
|
GET_BUILDWALK_SECTOR(ch) = i;
|
||||||
|
send_to_char(ch, "Default sector type is %s\r\n", sector_types[i]);
|
||||||
mudlog(CMP, GET_LEVEL(ch), TRUE,
|
mudlog(CMP, GET_LEVEL(ch), TRUE,
|
||||||
"OLC: %s turned buildwalk on. Allowed zone %d", GET_NAME(ch), GET_OLC_ZONE(ch));
|
"OLC: %s turned buildwalk on. Allowed zone %d", GET_NAME(ch), GET_OLC_ZONE(ch));
|
||||||
else
|
} else
|
||||||
mudlog(CMP, GET_ADMLEVEL(ch), TRUE,
|
mudlog(CMP, GET_ADMLEVEL(ch), TRUE,
|
||||||
"OLC: %s turned buildwalk off. Allowed zone %d", GET_NAME(ch), GET_OLC_ZONE(ch));
|
"OLC: %s turned buildwalk off. Allowed zone %d", GET_NAME(ch), GET_OLC_ZONE(ch));
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -688,6 +688,8 @@ ACMD(do_display)
|
||||||
ACMD(do_gen_tog)
|
ACMD(do_gen_tog)
|
||||||
{
|
{
|
||||||
long result;
|
long result;
|
||||||
|
int i;
|
||||||
|
char arg[MAX_INPUT_LENGTH];
|
||||||
|
|
||||||
const char *tog_messages[][2] = {
|
const char *tog_messages[][2] = {
|
||||||
{"You are now safe from summoning by other players.\r\n",
|
{"You are now safe from summoning by other players.\r\n",
|
||||||
|
|
@ -806,10 +808,17 @@ ACMD(do_gen_tog)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
result = PRF_TOG_CHK(ch, PRF_BUILDWALK);
|
result = PRF_TOG_CHK(ch, PRF_BUILDWALK);
|
||||||
if (PRF_FLAGGED(ch, PRF_BUILDWALK))
|
if (PRF_FLAGGED(ch, PRF_BUILDWALK)) {
|
||||||
|
one_argument(argument, arg);
|
||||||
|
for (i=0; *arg && *(sector_types[i]) != '\n'; i++)
|
||||||
|
if (is_abbrev(arg, sector_types[i]))
|
||||||
|
break;
|
||||||
|
if (*(sector_types[i]) == '\n') i=0;
|
||||||
|
GET_BUILDWALK_SECTOR(ch) = i;
|
||||||
|
send_to_char(ch, "Default sector type is %s\r\n", sector_types[i]);
|
||||||
mudlog(CMP, GET_ADMLEVEL(ch), TRUE,
|
mudlog(CMP, GET_ADMLEVEL(ch), TRUE,
|
||||||
"OLC: %s turned buildwalk on. Allowed zone %d", GET_NAME(ch), GET_OLC_ZONE(ch));
|
"OLC: %s turned buildwalk on. Allowed zone %d", GET_NAME(ch), GET_OLC_ZONE(ch));
|
||||||
else
|
} else
|
||||||
mudlog(CMP, GET_ADMLEVEL(ch), TRUE,
|
mudlog(CMP, GET_ADMLEVEL(ch), TRUE,
|
||||||
"OLC: %s turned buildwalk off. Allowed zone %d", GET_NAME(ch), GET_OLC_ZONE(ch));
|
"OLC: %s turned buildwalk off. Allowed zone %d", GET_NAME(ch), GET_OLC_ZONE(ch));
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
22
src/db.c
22
src/db.c
|
|
@ -3810,6 +3810,8 @@ void load_config( void )
|
||||||
case 'c':
|
case 'c':
|
||||||
if (!str_cmp(tag, "crash_file_timeout"))
|
if (!str_cmp(tag, "crash_file_timeout"))
|
||||||
CONFIG_CRASH_TIMEOUT = num;
|
CONFIG_CRASH_TIMEOUT = num;
|
||||||
|
else if (!str_cmp(tag, "can_mail"))
|
||||||
|
CONFIG_CAN_MAIL = num;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'd':
|
case 'd':
|
||||||
|
|
@ -3928,6 +3930,26 @@ void load_config( void )
|
||||||
CONFIG_MAP = num;
|
CONFIG_MAP = num;
|
||||||
else if (!str_cmp(tag, "medit_advanced_stats"))
|
else if (!str_cmp(tag, "medit_advanced_stats"))
|
||||||
CONFIG_MEDIT_ADVANCED = num;
|
CONFIG_MEDIT_ADVANCED = num;
|
||||||
|
else if (!str_cmp(tag, "mail_object_cost"))
|
||||||
|
CONFIG_OBJECT_COST = num;
|
||||||
|
else if (!str_cmp(tag, "mail_objects_allowed"))
|
||||||
|
CONFIG_CAN_MAIL_OBJ = num;
|
||||||
|
else if (!str_cmp(tag, "mail_gold_allowed"))
|
||||||
|
CONFIG_CAN_MAIL_GOLD = num;
|
||||||
|
else if (!str_cmp(tag, "mail_stamp_cost"))
|
||||||
|
CONFIG_STAMP_COST = num;
|
||||||
|
else if (!str_cmp(tag, "mail_min_level"))
|
||||||
|
CONFIG_MIN_MAIL_LEVEL = num;
|
||||||
|
else if (!str_cmp(tag, "mail_min_free_level"))
|
||||||
|
CONFIG_FREE_MAIL_LEVEL = num;
|
||||||
|
else if (!str_cmp(tag, "mail_drafts_allowed"))
|
||||||
|
CONFIG_DRAFTS_ALLOWED = num;
|
||||||
|
else if (!str_cmp(tag, "mail_draft_timeout"))
|
||||||
|
CONFIG_DRAFT_TIMEOUT = num;
|
||||||
|
else if (!str_cmp(tag, "mail_min_mail_anywhere"))
|
||||||
|
CONFIG_MIN_MAIL_ANYWHERE = num;
|
||||||
|
else if (!str_cmp(tag, "mail_min_send_to_all"))
|
||||||
|
CONFIG_MIN_SEND_TO_ALL = num;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'n':
|
case 'n':
|
||||||
|
|
|
||||||
|
|
@ -389,6 +389,16 @@ void find_replacement(void *go, struct script_data *sc, trig_data *trig,
|
||||||
snprintf(str, slen, "%d",((num = atoi(field)) > 0) ? trgvar_in_room(num) : 0);
|
snprintf(str, slen, "%d",((num = atoi(field)) > 0) ? trgvar_in_room(num) : 0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
else if (!str_cmp(var, "happyhour")) {
|
||||||
|
if (!str_cmp(field, "qp") && IS_HAPPYHOUR)
|
||||||
|
snprintf(str, slen, "%d", HAPPY_QP);
|
||||||
|
else if (!str_cmp(field, "exp") && IS_HAPPYHOUR)
|
||||||
|
snprintf(str, slen, "%d", HAPPY_EXP);
|
||||||
|
else if (!str_cmp(field, "gold") && IS_HAPPYHOUR)
|
||||||
|
snprintf(str, slen, "%d", HAPPY_GOLD);
|
||||||
|
else snprintf(str, slen, "%d", HAPPY_TIME);
|
||||||
|
return;
|
||||||
|
}
|
||||||
else if (!str_cmp(var, "time")) {
|
else if (!str_cmp(var, "time")) {
|
||||||
if (!str_cmp(field, "hour"))
|
if (!str_cmp(field, "hour"))
|
||||||
snprintf(str, slen, "%d", time_info.hours);
|
snprintf(str, slen, "%d", time_info.hours);
|
||||||
|
|
|
||||||
|
|
@ -342,6 +342,7 @@ int buildwalk(struct char_data *ch, int dir)
|
||||||
OLC_ROOM(d)->description = strdup(buf);
|
OLC_ROOM(d)->description = strdup(buf);
|
||||||
OLC_ROOM(d)->zone = OLC_ZNUM(d);
|
OLC_ROOM(d)->zone = OLC_ZNUM(d);
|
||||||
OLC_ROOM(d)->number = NOWHERE;
|
OLC_ROOM(d)->number = NOWHERE;
|
||||||
|
OLC_ROOM(d)->sector_type = GET_BUILDWALK_SECTOR(ch);
|
||||||
|
|
||||||
/* Save the new room to memory. redit_save_internally handles adding the
|
/* Save the new room to memory. redit_save_internally handles adding the
|
||||||
* room in the right place, etc. */
|
* room in the right place, etc. */
|
||||||
|
|
|
||||||
278
src/oasis_list.c
278
src/oasis_list.c
|
|
@ -23,6 +23,14 @@
|
||||||
#include "dg_scripts.h"
|
#include "dg_scripts.h"
|
||||||
#include "quest.h"
|
#include "quest.h"
|
||||||
#include "modify.h"
|
#include "modify.h"
|
||||||
|
#include "spells.h"
|
||||||
|
|
||||||
|
#define MAX_OBJ_LIST 100
|
||||||
|
|
||||||
|
struct obj_list_item {
|
||||||
|
obj_vnum vobj;
|
||||||
|
int val;
|
||||||
|
};
|
||||||
|
|
||||||
/* local functions */
|
/* local functions */
|
||||||
static void list_triggers(struct char_data *ch, zone_rnum rnum, trig_vnum vmin, trig_vnum vmax);
|
static void list_triggers(struct char_data *ch, zone_rnum rnum, trig_vnum vmin, trig_vnum vmax);
|
||||||
|
|
@ -34,8 +42,9 @@ static void list_zones(struct char_data *ch, zone_rnum rnum, zone_vnum vmin, zon
|
||||||
|
|
||||||
void perform_mob_flag_list(struct char_data * ch, char *arg)
|
void perform_mob_flag_list(struct char_data * ch, char *arg)
|
||||||
{
|
{
|
||||||
int num, mob_flag, found = 0;
|
int num, mob_flag, found = 0, len=0, tmp_len=0;
|
||||||
struct char_data *mob;
|
struct char_data *mob;
|
||||||
|
char buf[MAX_STRING_LENGTH];
|
||||||
|
|
||||||
mob_flag = atoi(arg);
|
mob_flag = atoi(arg);
|
||||||
|
|
||||||
|
|
@ -44,29 +53,32 @@ void perform_mob_flag_list(struct char_data * ch, char *arg)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
send_to_char(ch, "Listing mobiles with %s%s%s flag set.\r\n", QYEL, action_bits[mob_flag], QNRM);
|
len = snprintf(buf, sizeof(buf), "Listing mobiles with %s%s%s flag set.\r\n", QYEL, action_bits[mob_flag], QNRM);
|
||||||
|
|
||||||
for(num=0;num<=top_of_mobt;num++) {
|
for(num=0;num<=top_of_mobt;num++) {
|
||||||
if(IS_SET_AR((mob_proto[num].char_specials.saved.act), mob_flag)) {
|
if(IS_SET_AR((mob_proto[num].char_specials.saved.act), mob_flag)) {
|
||||||
|
|
||||||
if ((mob = read_mobile(num, REAL)) != NULL) {
|
if ((mob = read_mobile(num, REAL)) != NULL) {
|
||||||
char_to_room(mob, 0);
|
char_to_room(mob, 0);
|
||||||
send_to_char(ch,"%s%3d. %s[%s%5d%s]%s Level %s%-3d%s %s%s\r\n", CCNRM(ch, C_NRM),++found,
|
tmp_len = snprintf(buf+len, sizeof(buf)-len, "%s%3d. %s[%s%5d%s]%s Level %s%-3d%s %s%s\r\n",
|
||||||
CCCYN(ch, C_NRM), CCYEL(ch, C_NRM), GET_MOB_VNUM(mob), CCCYN(ch, C_NRM), CCNRM(ch, C_NRM),
|
QNRM, ++found, QCYN, QYEL, GET_MOB_VNUM(mob), QCYN, QNRM,
|
||||||
CCYEL(ch, C_NRM), GET_LEVEL(mob), CCNRM(ch, C_NRM), GET_NAME(mob), CCNRM(ch, C_NRM));
|
QYEL, GET_LEVEL(mob), QNRM, GET_NAME(mob), QNRM);
|
||||||
|
len += tmp_len;
|
||||||
extract_char(mob); /* Finished with the mob - remove it from the MUD */
|
extract_char(mob); /* Finished with the mob - remove it from the MUD */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!found)
|
if (!found)
|
||||||
send_to_char(ch,"None Found!\r\n");
|
send_to_char(ch,"None Found!\r\n");
|
||||||
return;
|
else
|
||||||
|
page_string(ch->desc, buf, TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void perform_mob_level_list(struct char_data * ch, char *arg)
|
void perform_mob_level_list(struct char_data * ch, char *arg)
|
||||||
{
|
{
|
||||||
int num, mob_level, found = 0;
|
int num, mob_level, found = 0, len, tmp_len;
|
||||||
struct char_data *mob;
|
struct char_data *mob;
|
||||||
|
char buf[MAX_STRING_LENGTH];
|
||||||
|
|
||||||
mob_level = atoi(arg);
|
mob_level = atoi(arg);
|
||||||
|
|
||||||
|
|
@ -75,23 +87,220 @@ void perform_mob_level_list(struct char_data * ch, char *arg)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
send_to_char(ch, "Listing mobiles of level %s%d%s\r\n", QYEL, mob_level, QNRM);
|
len = snprintf(buf, sizeof(buf), "Listing mobiles of level %s%d%s\r\n", QYEL, mob_level, QNRM);
|
||||||
for(num=0;num<=top_of_mobt;num++) {
|
for(num=0;num<=top_of_mobt;num++) {
|
||||||
if((mob_proto[num].player.level) == mob_level) {
|
if((mob_proto[num].player.level) == mob_level) {
|
||||||
|
|
||||||
if ((mob = read_mobile(num, REAL)) != NULL) {
|
if ((mob = read_mobile(num, REAL)) != NULL) {
|
||||||
char_to_room(mob, 0);
|
char_to_room(mob, 0);
|
||||||
send_to_char(ch,"%s%3d. %s[%s%5d%s]%s %s%s\r\n", CCNRM(ch, C_NRM),++found,
|
tmp_len = snprintf(buf+len, sizeof(buf)-len, "%s%3d. %s[%s%5d%s]%s %s%s\r\n",
|
||||||
CCCYN(ch, C_NRM), CCYEL(ch, C_NRM), GET_MOB_VNUM(mob), CCCYN(ch, C_NRM), CCNRM(ch, C_NRM),
|
QNRM, ++found, QCYN, QYEL, GET_MOB_VNUM(mob),
|
||||||
GET_NAME(mob), CCNRM(ch, C_NRM));
|
QCYN, QNRM, GET_NAME(mob), QNRM);
|
||||||
|
len += tmp_len;
|
||||||
extract_char(mob); /* Finished with the mob - remove it from the MUD */
|
extract_char(mob); /* Finished with the mob - remove it from the MUD */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!found)
|
if (!found)
|
||||||
send_to_char(ch,"None Found!\r\n");
|
send_to_char(ch,"None Found!\r\n");
|
||||||
|
else
|
||||||
|
page_string(ch->desc, buf, TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
|
void add_to_obj_list(struct obj_list_item *lst, int num_items, obj_vnum nvo, int nval)
|
||||||
|
{
|
||||||
|
int j, tmp_v;
|
||||||
|
obj_vnum tmp_ov;
|
||||||
|
|
||||||
|
for(j=0;j<num_items;j++) {
|
||||||
|
if(nval > lst[j].val) {
|
||||||
|
tmp_ov = lst[j].vobj;
|
||||||
|
tmp_v = lst[j].val;
|
||||||
|
|
||||||
|
lst[j].vobj = nvo;
|
||||||
|
lst[j].val = nval;
|
||||||
|
|
||||||
|
nvo = tmp_ov;
|
||||||
|
nval = tmp_v;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void perform_obj_type_list(struct char_data * ch, char *arg)
|
||||||
|
{
|
||||||
|
int num, itemtype, v1, v2, found = 0;
|
||||||
|
obj_vnum ov;
|
||||||
|
obj_rnum r_num;
|
||||||
|
|
||||||
|
itemtype = atoi(arg);
|
||||||
|
|
||||||
|
for(num=0;num<=top_of_objt;num++) {
|
||||||
|
if(obj_proto[num].obj_flags.type_flag == itemtype) {
|
||||||
|
if ((r_num = real_object(obj_index[num].vnum)) != NOTHING) { /* Seems silly? */
|
||||||
|
/* Set default vals, which may be changed below */
|
||||||
|
ov = obj_index[num].vnum;
|
||||||
|
v1 = (obj_proto[num].obj_flags.value[0]);
|
||||||
|
switch (itemtype) {
|
||||||
|
case ITEM_LIGHT:
|
||||||
|
v1 = (obj_proto[num].obj_flags.value[2]);
|
||||||
|
if (v1 == -1)
|
||||||
|
send_to_char(ch,"%s%3d. %s[%s%8d%s]%s INFINITE%s %s%s\r\n",
|
||||||
|
QNRM, ++found, QCYN, QYEL, ov, QCYN, QBRED, QNRM, obj_proto[r_num].short_description, QNRM);
|
||||||
|
else
|
||||||
|
send_to_char(ch,"%s%3d. %s[%s%8d%s]%s (%-3dhrs) %s%s\r\n",
|
||||||
|
QNRM,++found, QCYN, QYEL, ov, QCYN, QNRM, v1, obj_proto[r_num].short_description, QNRM);
|
||||||
|
break;
|
||||||
|
case ITEM_SCROLL:
|
||||||
|
case ITEM_POTION:
|
||||||
|
send_to_char(ch,"%s%3d. %s[%s%8d%s]%s %s%s\r\n",
|
||||||
|
QNRM, ++found, QCYN, QYEL, ov, QCYN, QNRM, obj_proto[r_num].short_description, QNRM);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case ITEM_WAND:
|
||||||
|
case ITEM_STAFF:
|
||||||
|
v1 = (obj_proto[num].obj_flags.value[1]);
|
||||||
|
v2 = (obj_proto[num].obj_flags.value[3]);
|
||||||
|
send_to_char(ch,"%s%3d. %s[%s%8d%s]%s (%dx%s) %s%s\r\n",
|
||||||
|
QNRM, ++found, QCYN, QYEL, ov, QCYN, QNRM, v1, skill_name(v2), obj_proto[r_num].short_description, QNRM);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case ITEM_WEAPON:
|
||||||
|
v1 = ((obj_proto[num].obj_flags.value[2]+1)*(obj_proto[r_num].obj_flags.value[1])) / 2;
|
||||||
|
send_to_char(ch,"%s%3d. %s[%s%8d%s]%s (%d Avg Dam) %s%s\r\n",
|
||||||
|
QNRM, ++found, QCYN, QYEL, ov, QCYN, QNRM, v1, obj_proto[r_num].short_description, QNRM);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case ITEM_ARMOR:
|
||||||
|
send_to_char(ch,"%s%3d. %s[%s%8d%s]%s (%dAC) %s%s\r\n",
|
||||||
|
QNRM, ++found, QCYN, QYEL, ov, QCYN, QNRM, v1, obj_proto[r_num].short_description, QNRM);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case ITEM_CONTAINER:
|
||||||
|
send_to_char(ch,"%s%3d. %s[%s%8d%s]%s (Max: %d) %s%s\r\n",
|
||||||
|
QNRM, ++found, QCYN, QYEL, ov, QCYN, QNRM, v1, obj_proto[r_num].short_description, QNRM);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case ITEM_DRINKCON:
|
||||||
|
case ITEM_FOUNTAIN:
|
||||||
|
if (v1 != -1)
|
||||||
|
send_to_char(ch,"%s%3d. %s[%s%8d%s]%s (Max: %d) %s%s\r\n",
|
||||||
|
QNRM, ++found, QCYN, QYEL, ov, QCYN, QNRM, v1, obj_proto[r_num].short_description, QNRM);
|
||||||
|
else
|
||||||
|
send_to_char(ch,"%s%3d. %s[%s%8d%s] %sINFINITE%s %s%s\r\n",
|
||||||
|
QNRM, ++found, QCYN, QYEL, ov, QCYN, QBRED, QNRM, obj_proto[r_num].short_description, QNRM);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case ITEM_FOOD:
|
||||||
|
v2 = (obj_proto[num].obj_flags.value[3]);
|
||||||
|
|
||||||
|
if (v2 != 0)
|
||||||
|
send_to_char(ch,"%s%3d. %s[%s%8d%s]%s (%dhrs) %s %sPoisoned!%s\r\n",
|
||||||
|
QNRM, ++found, QCYN, QYEL, ov, QCYN, QNRM, v1, obj_proto[r_num].short_description, QBGRN, QNRM);
|
||||||
|
else
|
||||||
|
send_to_char(ch,"%s%3d. %s[%s%8d%s]%s (%dhrs) %s%s\r\n",
|
||||||
|
QNRM, ++found, QCYN, QYEL, ov, QCYN, QNRM, v1, obj_proto[r_num].short_description, QNRM);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case ITEM_MONEY:
|
||||||
|
send_to_char(ch,"%s%3d. %s[%s%8d%s]%s %s%s (%s%d coins%s)\r\n",
|
||||||
|
QNRM, ++found, QCYN, QYEL, ov, QCYN, QNRM, obj_proto[r_num].short_description, QNRM, QYEL, v1, QNRM);
|
||||||
|
break;
|
||||||
|
|
||||||
|
/* The 'normal' items - don't provide extra info */
|
||||||
|
case ITEM_TREASURE:
|
||||||
|
case ITEM_TRASH:
|
||||||
|
case ITEM_OTHER:
|
||||||
|
case ITEM_WORN:
|
||||||
|
case ITEM_NOTE:
|
||||||
|
case ITEM_PEN:
|
||||||
|
case ITEM_BOAT:
|
||||||
|
case ITEM_KEY:
|
||||||
|
send_to_char(ch,"%s%3d. %s[%s%8d%s]%s %s%s\r\n",
|
||||||
|
QNRM, ++found, QCYN, QYEL, ov, QCYN, QNRM, obj_proto[r_num].short_description, QNRM);
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
send_to_char(ch, "Not a valid item type");
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
void perform_obj_aff_list(struct char_data * ch, char *arg)
|
||||||
|
{
|
||||||
|
int num, i, apply, v1 = 0, found = 0, len = 0, tmp_len = 0;
|
||||||
|
struct obj_list_item lst[MAX_OBJ_LIST];
|
||||||
|
obj_rnum r_num;
|
||||||
|
obj_vnum ov;
|
||||||
|
char buf[MAX_STRING_LENGTH];
|
||||||
|
|
||||||
|
for(i=0;i<MAX_OBJ_LIST;i++){
|
||||||
|
lst[i].vobj = NOTHING;
|
||||||
|
lst[i].val = 0;
|
||||||
|
}
|
||||||
|
apply = atoi(arg);
|
||||||
|
|
||||||
|
if (!(apply>0 && apply<NUM_APPLIES) ){
|
||||||
|
send_to_char(ch, "Not a valid affect");
|
||||||
|
return;
|
||||||
|
} /* Special cases below */
|
||||||
|
else if ((apply == APPLY_CLASS) || /* olist affect 7 is Weapon Damage */
|
||||||
|
(apply == APPLY_LEVEL) ) { /* olist affect 8 is AC-Apply for Armor */
|
||||||
|
for (num=0;num<=top_of_objt;num++) {
|
||||||
|
if ((apply == APPLY_CLASS && obj_proto[num].obj_flags.type_flag == ITEM_WEAPON) ||
|
||||||
|
(apply == APPLY_LEVEL && obj_proto[num].obj_flags.type_flag == ITEM_ARMOR) ) {
|
||||||
|
ov = obj_index[num].vnum;
|
||||||
|
v1 = ((obj_proto[num].obj_flags.value[2]+1)*(obj_proto[num].obj_flags.value[1])/2);
|
||||||
|
|
||||||
|
if ((r_num = real_object(ov)) != NOTHING)
|
||||||
|
add_to_obj_list(lst, MAX_OBJ_LIST, ov, v1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (apply == APPLY_CLASS)
|
||||||
|
len = snprintf(buf, sizeof(buf), "Highest average damage per hit for Weapons\r\n");
|
||||||
|
else if (apply == APPLY_LEVEL)
|
||||||
|
len = snprintf(buf, sizeof(buf), "Highest AC Apply for Armor\r\n");
|
||||||
|
|
||||||
|
for(i=0;i<MAX_OBJ_LIST;i++){
|
||||||
|
if ((r_num = real_object(lst[i].vobj)) != NOTHING) {
|
||||||
|
tmp_len = snprintf(buf+len, sizeof(buf)-len, "%s%3d. %s[%s%8d%s] %s%3d %s%s%s\r\n",
|
||||||
|
QNRM, ++found, QCYN, QYEL, lst[i].vobj, QCYN,
|
||||||
|
QYEL, lst[i].val, QNRM, obj_proto[r_num].short_description, QNRM);
|
||||||
|
len += tmp_len;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
page_string(ch->desc, buf, TRUE);
|
||||||
|
return; /* End of special-case handling */
|
||||||
|
}
|
||||||
|
/* Non-special cases, list objects by affect */
|
||||||
|
for (num = 0; num <= top_of_objt; num++){
|
||||||
|
for (i = 0; i < MAX_OBJ_AFFECT; i++){
|
||||||
|
if (obj_proto[num].affected[i].modifier) {
|
||||||
|
if (obj_proto[num].affected[i].location == apply){
|
||||||
|
ov = obj_index[num].vnum;
|
||||||
|
v1 = obj_proto[num].affected[i].modifier;
|
||||||
|
|
||||||
|
if ((r_num = real_object(ov)) != NOTHING)
|
||||||
|
add_to_obj_list(lst, MAX_OBJ_LIST, ov, v1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
len = snprintf(buf, sizeof(buf), "Objects with highest %s affect\r\n", apply_types[(apply)]);
|
||||||
|
for(i=0;i<MAX_OBJ_LIST;i++){
|
||||||
|
if ((r_num = real_object(lst[i].vobj)) != NOTHING) {
|
||||||
|
tmp_len = snprintf(buf+len, sizeof(buf)-len, "%s%3d. %s[%s%8d%s] %s%3d %s%s%s\r\n",
|
||||||
|
QNRM, ++found, QCYN, QYEL, lst[i].vobj, QCYN,
|
||||||
|
QYEL, lst[i].val, QNRM, obj_proto[r_num].short_description, QNRM);
|
||||||
|
len += tmp_len;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
page_string(ch->desc, buf, TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Ingame Commands */
|
/* Ingame Commands */
|
||||||
|
|
@ -104,6 +313,7 @@ ACMD(do_oasis_list)
|
||||||
char smax[MAX_INPUT_LENGTH];
|
char smax[MAX_INPUT_LENGTH];
|
||||||
char arg[MAX_INPUT_LENGTH], arg2[MAX_INPUT_LENGTH];
|
char arg[MAX_INPUT_LENGTH], arg2[MAX_INPUT_LENGTH];
|
||||||
bool use_name = FALSE;
|
bool use_name = FALSE;
|
||||||
|
int i;
|
||||||
|
|
||||||
two_arguments(argument, smin, smax);
|
two_arguments(argument, smin, smax);
|
||||||
|
|
||||||
|
|
@ -159,7 +369,51 @@ ACMD(do_oasis_list)
|
||||||
} else
|
} else
|
||||||
list_mobiles(ch, rzone, vmin, vmax);
|
list_mobiles(ch, rzone, vmin, vmax);
|
||||||
break;
|
break;
|
||||||
case SCMD_OASIS_OLIST: list_objects(ch, rzone, vmin, vmax); break;
|
case SCMD_OASIS_OLIST:
|
||||||
|
two_arguments(argument, arg, arg2);
|
||||||
|
|
||||||
|
if (is_abbrev(arg, "type") || is_abbrev(arg, "affect")) {
|
||||||
|
if (is_abbrev(arg, "type")) {
|
||||||
|
if (!*arg2) {
|
||||||
|
send_to_char(ch, "Which object type do you want to list?\r\n");
|
||||||
|
for (i=1; i<NUM_ITEM_TYPES; i++)
|
||||||
|
{
|
||||||
|
send_to_char(ch, "%s%2d%s-%s%-14s%s", QNRM, i, QNRM, QYEL, item_types[i], QNRM);
|
||||||
|
if (!(i%4)) send_to_char(ch, "\r\n");
|
||||||
|
}
|
||||||
|
send_to_char(ch, "\r\n");
|
||||||
|
send_to_char(ch, "Usage: %solist type <num>%s\r\n", QYEL, QNRM);
|
||||||
|
send_to_char(ch, " %solist affect <num>%s\r\n", QYEL, QNRM);
|
||||||
|
send_to_char(ch, "Displays objects of the selected type, or top 100 with the selected affect.\r\n\r\n");
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
perform_obj_type_list(ch, arg2);
|
||||||
|
} else { /* Assume arg = affect */
|
||||||
|
if (!*arg2) {
|
||||||
|
send_to_char(ch, "Which object affect do you want to list?\r\n");
|
||||||
|
for (i=0; i<NUM_APPLIES; i++)
|
||||||
|
{
|
||||||
|
if (i == APPLY_CLASS) /* Special Case 1 - Weapon Dam */
|
||||||
|
send_to_char(ch, "%s%2d-%s%-14s%s", QNRM, i, QYEL, "Weapon Dam", QNRM);
|
||||||
|
else if (i == APPLY_LEVEL) /* Special Case 2 - Armor AC Apply */
|
||||||
|
send_to_char(ch, "%s%2d-%s%-14s%s", QNRM, i, QYEL, "AC Apply", QNRM);
|
||||||
|
else
|
||||||
|
send_to_char(ch, "%s%2d-%s%-14s%s", QNRM, i, QYEL, apply_types[i], QNRM);
|
||||||
|
if (!((i+1)%4)) send_to_char(ch, "\r\n");
|
||||||
|
}
|
||||||
|
send_to_char(ch, "\r\n");
|
||||||
|
send_to_char(ch, "Usage: %solist type <num>%s\r\n", QYEL, QNRM);
|
||||||
|
send_to_char(ch, " %solist affect <num>%s\r\n", QYEL, QNRM);
|
||||||
|
send_to_char(ch, "Displays objects of the selected type, or top 100 with the selected affect.\r\n\r\n");
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
perform_obj_aff_list(ch, arg2);
|
||||||
|
}
|
||||||
|
} else
|
||||||
|
list_objects(ch, rzone, vmin, vmax);
|
||||||
|
break;
|
||||||
case SCMD_OASIS_RLIST: list_rooms(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_TLIST: list_triggers(ch, rzone, vmin, vmax); break;
|
||||||
case SCMD_OASIS_SLIST: list_shops(ch, rzone, vmin, vmax); break;
|
case SCMD_OASIS_SLIST: list_shops(ch, rzone, vmin, vmax); break;
|
||||||
|
|
|
||||||
|
|
@ -1004,6 +1004,7 @@ struct player_special_data
|
||||||
void *last_olc_targ; /**< ? Currently Unused ? */
|
void *last_olc_targ; /**< ? Currently Unused ? */
|
||||||
int last_olc_mode; /**< ? Currently Unused ? */
|
int last_olc_mode; /**< ? Currently Unused ? */
|
||||||
char *host; /**< Resolved hostname, or ip, for player. */
|
char *host; /**< Resolved hostname, or ip, for player. */
|
||||||
|
int buildwalk_sector;/**< Default sector type for buildwalk */
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Special data used by NPCs, not PCs */
|
/** Special data used by NPCs, not PCs */
|
||||||
|
|
|
||||||
|
|
@ -632,6 +632,8 @@ do \
|
||||||
#define GET_SKILL(ch, i) CHECK_PLAYER_SPECIAL((ch), ((ch)->player_specials->saved.skills[i]))
|
#define GET_SKILL(ch, i) CHECK_PLAYER_SPECIAL((ch), ((ch)->player_specials->saved.skills[i]))
|
||||||
/** Copy the current skill level i of ch to pct. */
|
/** Copy the current skill level i of ch to pct. */
|
||||||
#define SET_SKILL(ch, i, pct) do { CHECK_PLAYER_SPECIAL((ch), (ch)->player_specials->saved.skills[i]) = pct; } while(0)
|
#define SET_SKILL(ch, i, pct) do { CHECK_PLAYER_SPECIAL((ch), (ch)->player_specials->saved.skills[i]) = pct; } while(0)
|
||||||
|
/** The player's default sector type when buildwalking */
|
||||||
|
#define GET_BUILDWALK_SECTOR(ch) CHECK_PLAYER_SPECIAL((ch), ((ch)->player_specials->buildwalk_sector))
|
||||||
|
|
||||||
/** Get obj worn in position i on ch. */
|
/** Get obj worn in position i on ch. */
|
||||||
#define GET_EQ(ch, i) ((ch)->equipment[i])
|
#define GET_EQ(ch, i) ((ch)->equipment[i])
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue