Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/alchemy.c
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,7 @@ int mixer_use(int cn, int in) {
}

if (!(fre = may_add_spell(cn, IDR_POTION_SP))) {
log_char(cn, LOG_SYSTEM, 0, "Another potion is still active.");
log_char(cn, LOG_SYSTEM, 0, "Another potion is still active. Use /killpotion to remove it.");
return 0;
}

Expand Down Expand Up @@ -810,6 +810,11 @@ void flask_driver(int in, int cn) {
if (!(in2 = ch[cn].citem)) {
if (shaken) { // potion is ready
if (!mixer_use(cn, in)) return;
if (ch[cn].flags & CF_NOFLASK) {
remove_item_char(in);
free_item(in);
return;
}
strcpy(it[in].name, "Empty Potion");
switch (size) {
case 1:
Expand Down
2 changes: 1 addition & 1 deletion src/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ void potion_driver(int in, int cn) {
it[in].drdata[3] * POWERSCALE,
it[in].drdata[2] * POWERSCALE);

if (empty) replace_item_char(in, in2);
if (empty && (!(ch[cn].flags & CF_NOFLASK))) replace_item_char(in, in2);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in2 gets lost here.

A much cleaner way would be to not create the empty bottle in the first place.

else remove_item_char(in);

free_item(in);
Expand Down
43 changes: 42 additions & 1 deletion src/command.c
Original file line number Diff line number Diff line change
Expand Up @@ -937,14 +937,17 @@ static void cmd_help(int cn) {
log_char(cn, LOG_SYSTEM, 0, "/emote <text> - express yourself (also /me, /wave, /bow, /eg)");
log_char(cn, LOG_SYSTEM, 0, "/gold <amount> - move gold to cursor");
log_char(cn, LOG_SYSTEM, 0, "/holler <text> - like say, but with vastly increased range");
log_char(cn, LOG_SYSTEM, 0, "/hints <cmd> - turn the tutorial 'off', 'on' or 'reset' it.");
log_char(cn, LOG_SYSTEM, 0, "/hints <cmd> - turn the tutorial 'off', 'on' or 'reset' it");
log_char(cn, LOG_SYSTEM, 0, "/ignore <name> - ignore a player in chat and tells");
log_char(cn, LOG_SYSTEM, 0, "/join <nr> - joins chat channel <nr>");
log_char(cn, LOG_SYSTEM, 0, "/killbless - removes bless");
log_char(cn, LOG_SYSTEM, 0, "/killpotion - removes stat potion");
log_char(cn, LOG_SYSTEM, 0, "/lastseen <player> - last time player logged into the game");
log_char(cn, LOG_SYSTEM, 0, "/leave <nr> - leaves chat channel <nr>");
log_char(cn, LOG_SYSTEM, 0, "/logout - logout when on blue square");
log_char(cn, LOG_SYSTEM, 0, "/maxlag <seconds> - set delay for lag control");
log_char(cn, LOG_SYSTEM, 0, "/murmur <text> - like say, but only within close range");
log_char(cn, LOG_SYSTEM, 0, "/noflask - prevents empty flasks when using potions");
log_char(cn, LOG_SYSTEM, 0, "/notells - do not receive any tells (toggle)");
log_char(cn, LOG_SYSTEM, 0, "/relation <nr> - show clan <nr>'s relations");
log_char(cn, LOG_SYSTEM, 0, "/say <text> - makes your character say <text>");
Expand Down Expand Up @@ -2351,6 +2354,44 @@ int command(int cn, char *ptr) // 1=ok, 0=repeat
return 1;
}

if (cmdcmp(ptr, "killbless", 5)) {
int n, in;
for (n = 12; n < 30; n++) {
if ((in = ch[cn].item[n]) && it[in].driver == IDR_BLESS) {
destroy_effect_type(cn, EF_BLESS);
destroy_item(in);
ch[cn].item[n] = 0;
update_char(cn);
log_char(cn, LOG_SYSTEM, 0, "Done.");
return 1;
}
}
log_char(cn, LOG_SYSTEM, 0, "No Bless found.");
return 1;
}

if (cmdcmp(ptr, "killpotion", 5)) {
int n, in;
for (n = 12; n < 30; n++) {
if ((in = ch[cn].item[n]) && it[in].driver == IDR_POTION_SP) {
destroy_effect_type(cn, EF_POTION);
destroy_item(in);
ch[cn].item[n] = 0;
update_char(cn);
log_char(cn, LOG_SYSTEM, 0, "Done.");
return 1;
}
}
log_char(cn, LOG_SYSTEM, 0, "No stat potion found.");
return 1;
}

if (cmdcmp(ptr, "noflask", 7)) {
ch[cn].flags ^= CF_NOFLASK;
log_char(cn, LOG_SYSTEM, 0, "NoFlask %s.", (ch[cn].flags & CF_NOFLASK) ? "enabled" : "disabled");
return 1;
}

if (cmdcmp(ptr, "status", 0)) {
struct depot_ppd *depot_ppd;

Expand Down
4 changes: 3 additions & 1 deletion src/create.c
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,9 @@ static char *CF_tab[] = {
"CF_SMALLUPDATE", //43
"CF_NOWHO", //44
"CF_WON", //45
"CF_NOMOVE" //46
"CF_NOMOVE", //46
"CF_TUTOR", //47
"CF_NOFLASK" //48
};

static int lookup_CF(char *name) {
Expand Down
1 change: 1 addition & 0 deletions src/server.h
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ extern struct item *it;
#define CF_WON (1ull << 45) // character won the game (ie killed islena)
#define CF_NOMOVE (1ull << 46) // fightback doesn't move the player
#define CF_TUTOR (1ull << 47) // member of the tutor group
#define CF_NOFLASK (1ull << 48) // stops empty potions replacing used potions

// VALUES
#define V_HP 0
Expand Down