Skip to content

Commit

Permalink
Adds @who4 command (excludes vendors from @who list).
Browse files Browse the repository at this point in the history
  • Loading branch information
bWolfie committed Oct 16, 2018
1 parent baeb7a1 commit 8025b4e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions conf/groups.conf
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,11 @@ groups: (
who: true
who2: true
who3: true
who4: true
whomap: true
whomap2: true
whomap3: true
whomap4: true
users: true
broadcast: true
localbroadcast: true
Expand Down
1 change: 1 addition & 0 deletions conf/map/help.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ mobsearch: "Params: <monster name|ID>\n" "Shows the location of a certain mob on
who: "Params: [<name>]\n" "Shows a list of online players and their party and guild."
who2: "Params: [<name>]\n" "Shows a list of online players and their job."
who3: "Params: [<name>]\n" "Shows a list of online players and their location."
who4: "Params: [<name>]\n" "Shows a list of online players (excluding vendor characters) and their location."
whomap: "@whomap/@whomap2/@whomap3 [map] - like @who/@who2/@who3 but only for specified map."
whogm: "Params: [match_text] - Like @who+@who2+who3, but only for GM."
guildspy: "Params: <guild name|id> - You will receive all messages of the guild channel (Chat logging must be enabled)"
Expand Down
2 changes: 2 additions & 0 deletions doc/atcommands.txt
Original file line number Diff line number Diff line change
Expand Up @@ -472,11 +472,13 @@ Displays inventory contents of the attached player.
@who
@who2
@who3
@who4

Returns a list of online characters.
@who will also return character positions.
@who2 will also return job classes.
@who3 will also return parties/guilds.
@who4 will also return character positions, excluding vendor characters from being listed.

---------------------------------------

Expand Down
9 changes: 9 additions & 0 deletions src/map/atcommand.c
Original file line number Diff line number Diff line change
Expand Up @@ -620,6 +620,7 @@ ACMD(who)
* 1 = @who : Player name, [Title], [Party name], [Guild name]
* 2 = @who2 : Player name, [Title], BLvl, JLvl, Job
* 3 = @who3 : [CID/AID] Player name [Title], Map, X, Y
* 4 = @who4 : Player name, [Title], [Party name], [Guild name]
*/
int display_type = 1;
int map_id = -1;
Expand All @@ -636,6 +637,8 @@ ACMD(who)
display_type = 2;
else if (stristr(info->command, "3") != NULL)
display_type = 3;
else if (stristr(info->command, "4") != NULL)
display_type = 4;

level = pc_get_group_level(sd);
StrBuf->Init(&buf);
Expand Down Expand Up @@ -664,6 +667,10 @@ ACMD(who)
StrBuf->Printf(&buf, msg_fd(fd,348), mapindex_id2name(pl_sd->mapindex), pl_sd->bl.x, pl_sd->bl.y); // "| Location: %s %d %d"
break;
}
case 4:
if (pl_sd->state.autotrade == 1 || pl_sd->state.vending || pl_sd->state.buyingstore)
continue;
FALLTHROUGH
default: {
struct party_data *p = party->search(pl_sd->status.party_id);
struct guild *g = pl_sd->guild;
Expand Down Expand Up @@ -9846,9 +9853,11 @@ static void atcommand_basecommands(void)
ACMD_DEF(who),
ACMD_DEF2("who2", who),
ACMD_DEF2("who3", who),
ACMD_DEF2("who4", who),
ACMD_DEF2("whomap", who),
ACMD_DEF2("whomap2", who),
ACMD_DEF2("whomap3", who),
ACMD_DEF2("whomap4", who),
ACMD_DEF(whogm),
ACMD_DEF(save),
ACMD_DEF(load),
Expand Down

0 comments on commit 8025b4e

Please sign in to comment.