Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds @who4 command (excludes vendors from @who list). #2288

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
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
3 changes: 2 additions & 1 deletion conf/map/help.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ 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."
whomap: "@whomap/@whomap2/@whomap3 [map] - like @who/@who2/@who3 but only for specified map."
who4: "Params: [<name>]\n" "Shows a list of online players (excluding vendor characters) and their location."
whomap: "@whomap/@whomap2/@whomap3/@whomap4 [map] - like @who/@who2/@who3/@who4 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)"
partyspy: "@partyspy <party name|id> - You will receive all messages of the party channel (Chat logging must be enabled)"
Expand Down
4 changes: 4 additions & 0 deletions doc/atcommands.txt
Original file line number Diff line number Diff line change
Expand Up @@ -472,22 +472,26 @@ 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.

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

@whomap
@whomap2
@whomap3
@whomap4

Returns a list of online characters in a specific map.
@whomap will also return character positions.
@whomap2 will also return job classes.
@whomap3 will also return parties/guilds.
@whomap4 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