Added AutoLoot and AutoDrain functionality
This commit is contained in:
parent
9c8a3e2255
commit
a8bca76fe1
@ -1611,10 +1611,12 @@ ACMD(do_toggle)
|
|||||||
" Deaf: %-3s "
|
" Deaf: %-3s "
|
||||||
" Wimp Level: %-3s\r\n"
|
" Wimp Level: %-3s\r\n"
|
||||||
|
|
||||||
" Gossip Channel: %-3s "
|
" Auto Loot: %-3s "
|
||||||
"Auction Channel: %-3s "
|
" Auto Drain: %-3s "
|
||||||
" Grats Channel: %-3s\r\n"
|
" Gossip Channel: %-3s\r\n"
|
||||||
|
|
||||||
|
"Auction Channel: %-3s "
|
||||||
|
" Grats Channel: %-3s "
|
||||||
" Color Level: %s\r\n",
|
" Color Level: %s\r\n",
|
||||||
|
|
||||||
ONOFF(PRF_FLAGGED(ch, PRF_DISPHP)),
|
ONOFF(PRF_FLAGGED(ch, PRF_DISPHP)),
|
||||||
@ -1632,6 +1634,8 @@ ACMD(do_toggle)
|
|||||||
ONOFF(PRF_FLAGGED(ch, PRF_AUTOEXIT)),
|
ONOFF(PRF_FLAGGED(ch, PRF_AUTOEXIT)),
|
||||||
YESNO(PRF_FLAGGED(ch, PRF_DEAF)),
|
YESNO(PRF_FLAGGED(ch, PRF_DEAF)),
|
||||||
buf2,
|
buf2,
|
||||||
|
ONOFF(PRF_FLAGGED(ch, PRF_AUTOLOOT)),
|
||||||
|
ONOFF(PRF_FLAGGED(ch, PRF_AUTODRAIN)),
|
||||||
|
|
||||||
ONOFF(!PRF_FLAGGED(ch, PRF_NOGOSS)),
|
ONOFF(!PRF_FLAGGED(ch, PRF_NOGOSS)),
|
||||||
ONOFF(!PRF_FLAGGED(ch, PRF_NOAUCT)),
|
ONOFF(!PRF_FLAGGED(ch, PRF_NOAUCT)),
|
||||||
|
@ -913,7 +913,11 @@ ACMD(do_gen_tog)
|
|||||||
{"Autoexits disabled.\r\n",
|
{"Autoexits disabled.\r\n",
|
||||||
"Autoexits enabled.\r\n"},
|
"Autoexits enabled.\r\n"},
|
||||||
{"Will no longer track through doors.\r\n",
|
{"Will no longer track through doors.\r\n",
|
||||||
"Will now track through doors.\r\n"}
|
"Will now track through doors.\r\n"},
|
||||||
|
{"AutoLoot disabled.\r\n",
|
||||||
|
"AutoLoot enabled.\r\n"},
|
||||||
|
{"AutoDrain disabled.\r\n",
|
||||||
|
"AutoDrain enabled.\r\n"}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -969,6 +973,12 @@ ACMD(do_gen_tog)
|
|||||||
case SCMD_AUTOEXIT:
|
case SCMD_AUTOEXIT:
|
||||||
result = PRF_TOG_CHK(ch, PRF_AUTOEXIT);
|
result = PRF_TOG_CHK(ch, PRF_AUTOEXIT);
|
||||||
break;
|
break;
|
||||||
|
case SCMD_AUTOLOOT:
|
||||||
|
result = PRF_TOG_CHK(ch, PRF_AUTOLOOT);
|
||||||
|
break;
|
||||||
|
case SCMD_AUTODRAIN:
|
||||||
|
result = PRF_TOG_CHK(ch, PRF_AUTODRAIN);
|
||||||
|
break;
|
||||||
case SCMD_TRACK:
|
case SCMD_TRACK:
|
||||||
result = (track_through_doors = !track_through_doors);
|
result = (track_through_doors = !track_through_doors);
|
||||||
break;
|
break;
|
||||||
|
@ -184,6 +184,8 @@ const char *preference_bits[] = {
|
|||||||
"NO_GOS",
|
"NO_GOS",
|
||||||
"NO_GTZ",
|
"NO_GTZ",
|
||||||
"RMFLG",
|
"RMFLG",
|
||||||
|
"AUTOLOOT",
|
||||||
|
"AUTODRAIN",
|
||||||
"\n"
|
"\n"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
11
src/fight.c
11
src/fight.c
@ -36,6 +36,8 @@ extern int max_npc_corpse_time, max_pc_corpse_time;
|
|||||||
/* External procedures */
|
/* External procedures */
|
||||||
char *fread_action(FILE *fl, int nr);
|
char *fread_action(FILE *fl, int nr);
|
||||||
ACMD(do_flee);
|
ACMD(do_flee);
|
||||||
|
ACMD(do_get);
|
||||||
|
ACMD(do_drain);
|
||||||
int backstab_mult(int level);
|
int backstab_mult(int level);
|
||||||
int thaco(int ch_class, int level);
|
int thaco(int ch_class, int level);
|
||||||
int ok_damage_shopkeeper(struct char_data *ch, struct char_data *victim);
|
int ok_damage_shopkeeper(struct char_data *ch, struct char_data *victim);
|
||||||
@ -832,6 +834,15 @@ int damage(struct char_data *ch, struct char_data *victim, int dam, int attackty
|
|||||||
forget(ch, victim);
|
forget(ch, victim);
|
||||||
}
|
}
|
||||||
die(victim);
|
die(victim);
|
||||||
|
|
||||||
|
/* If AUTOLOOT is enabled, loot everything from corpse */
|
||||||
|
if (IS_NPC(victim) && !IS_NPC(ch) && PRF_FLAGGED(ch, PRF_AUTOLOOT))
|
||||||
|
do_get(ch, "all corpse", 0, 0);
|
||||||
|
|
||||||
|
/* IF AUTODRAIN is enabled, drain corpse */
|
||||||
|
if (IS_NPC(victim) && !IS_NPC(ch) && PRF_FLAGGED(ch, PRF_AUTODRAIN))
|
||||||
|
do_drain(ch, "corpse", 0, 0);
|
||||||
|
|
||||||
return (-1);
|
return (-1);
|
||||||
}
|
}
|
||||||
return (dam);
|
return (dam);
|
||||||
|
@ -223,6 +223,8 @@ cpp_extern const struct command_info cmd_info[] = {
|
|||||||
{ "ask" , POS_RESTING , do_spec_comm, 0, SCMD_ASK },
|
{ "ask" , POS_RESTING , do_spec_comm, 0, SCMD_ASK },
|
||||||
{ "auction" , POS_SLEEPING, do_gen_comm , 0, SCMD_AUCTION },
|
{ "auction" , POS_SLEEPING, do_gen_comm , 0, SCMD_AUCTION },
|
||||||
{ "autoexit" , POS_DEAD , do_gen_tog , 0, SCMD_AUTOEXIT },
|
{ "autoexit" , POS_DEAD , do_gen_tog , 0, SCMD_AUTOEXIT },
|
||||||
|
{ "autoloot" , POS_DEAD , do_gen_tog , 0, SCMD_AUTOLOOT },
|
||||||
|
{ "autodrain", POS_DEAD , do_gen_tog , 0, SCMD_AUTODRAIN },
|
||||||
|
|
||||||
{ "bounce" , POS_STANDING, do_action , 0, 0 },
|
{ "bounce" , POS_STANDING, do_action , 0, 0 },
|
||||||
{ "backstab" , POS_STANDING, do_backstab , 1, 0 },
|
{ "backstab" , POS_STANDING, do_backstab , 1, 0 },
|
||||||
|
@ -119,6 +119,8 @@ struct alias_data {
|
|||||||
#define SCMD_SLOWNS 14
|
#define SCMD_SLOWNS 14
|
||||||
#define SCMD_AUTOEXIT 15
|
#define SCMD_AUTOEXIT 15
|
||||||
#define SCMD_TRACK 16
|
#define SCMD_TRACK 16
|
||||||
|
#define SCMD_AUTOLOOT 17
|
||||||
|
#define SCMD_AUTODRAIN 18
|
||||||
|
|
||||||
/* do_wizutil */
|
/* do_wizutil */
|
||||||
#define SCMD_REROLL 0
|
#define SCMD_REROLL 0
|
||||||
|
@ -215,6 +215,8 @@
|
|||||||
#define PRF_NOGRATZ (1 << 20) /* Can't hear grats channel */
|
#define PRF_NOGRATZ (1 << 20) /* Can't hear grats channel */
|
||||||
#define PRF_ROOMFLAGS (1 << 21) /* Can see room flags (ROOM_x) */
|
#define PRF_ROOMFLAGS (1 << 21) /* Can see room flags (ROOM_x) */
|
||||||
#define PRF_DISPAUTO (1 << 22) /* Show prompt HP, MP, MV when < 30%. */
|
#define PRF_DISPAUTO (1 << 22) /* Show prompt HP, MP, MV when < 30%. */
|
||||||
|
#define PRF_AUTOLOOT (1 << 23) /* Automatically loot corpses */
|
||||||
|
#define PRF_AUTODRAIN (1 << 24) /* Automatically drain corpses */
|
||||||
|
|
||||||
/* Affect bits: used in char_data.char_specials.saved.affected_by */
|
/* Affect bits: used in char_data.char_specials.saved.affected_by */
|
||||||
/* WARNING: In the world files, NEVER set the bits marked "R" ("Reserved") */
|
/* WARNING: In the world files, NEVER set the bits marked "R" ("Reserved") */
|
||||||
|
Loading…
Reference in New Issue
Block a user