atcommand_auriga.conf
適当な位置に追加
guildspy: num
numはコマンドを使用できるGMレベル
map.h
struct map_session_dataに追加
L600あたり
int guild_x,guild_y;
//------------------追加-------------by mame-------
int guildspy;
//---------------------ここまで--------------------
int friend_invite,friend_invite_char;
char friend_invite_name[24];
atcommand.c
L200あたり
ATCOMMAND_FUNC(hotkeyset);
ATCOMMAND_FUNC(callmerc);
//------------------追加-------------by mame-------
ATCOMMAND_FUNC(guildspy);
//---------------------ここまで--------------------
L400あたり
{ AtCommand_HotkeySet, "@nnehotkeyset", 0, atcommand_hotkeyset, NULL },
{ AtCommand_CallMerc, "@nnecallmerc", 0, atcommand_callmerc, NULL },
//------------------追加-------------by mame-------
{ AtCommand_Guildspy, "@guildspy", 0, atcommand_guildspy, NULL },
//---------------------ここまで--------------------
// add here
{ AtCommand_MapMove, "@nnemapmove", 0, NULL, NULL },
ファイルの最後あたり
//------------------追加-------------by mame-------
/*==========================================
*Spy Commands by Syrus22
*------------------------------------------*/
int atcommand_guildspy(const int fd, struct map_session_data* sd, AtCommandType command, const char* message)
{
char guild_name[100];
char buf[512];
struct guild *g;
if (!message || !*message)
return -1;
if (sscanf(message, "%99[^\n]", guild_name) < 1)
return -1;
if ((g = guild_searchname(guild_name)) != NULL || // name first to avoid error when name begin with a number
(g = guild_search(atoi(message))) != NULL) {
if (sd->guildspy == g->guild_id) {
sd->guildspy = 0;
snprintf(buf, sizeof(buf), "No longer spying on the %s guild", g->name);
clif_displaymessage(fd, buf);
// sprintf(atcmd_output, msg_txt(103), g->name); // No longer spying on the %s guild.
// clif_displaymessage(fd, atcmd_output);
} else {
sd->guildspy = g->guild_id;
snprintf(buf, sizeof(buf), "Spying on the %s guild", g->name);
clif_displaymessage(fd, buf);
// sprintf(atcmd_output, msg_txt(104), g->name); // Spying on the %s guild.
// clif_displaymessage(fd, atcmd_output);
}
} else {
snprintf(buf, sizeof(buf), "Incorrect name/ID, or no one from the specified guild is online");
clif_displaymessage(fd, buf);
// clif_displaymessage(fd, msg_txt(94)); // Incorrect name/ID, or no one from the specified guild is online.
return -1;
}
return 0;
}
//---------------------ここまで--------------------
clif.c
L400あたり
static void clif_send関数
memcpy(WFIFOP(sd->fd,0),buf,len);
WFIFOSET(sd->fd,len);
}
}
//------------------追加-------------by mame-------
for (i = 0; i < fd_max; i++) {
if(session[i] && (sd = (struct map_session_data *)session[i]->session_data) && sd->state.auth){
if (sd->guildspy == g->guild_id) {
memcpy(WFIFOP(sd->fd,0),buf,len);
WFIFOSET(sd->fd,len);
}
}
}
//---------------------ここまで--------------------
}
break;
atcommand.h
L200あたり
AtCommand_HotkeySet,
AtCommand_CallMerc,
//------------------追加-------------by mame-------
AtCommand_Guildspy,
//---------------------ここまで--------------------
AtCommand_Unknown,
AtCommand_MAX,
} AtCommandType;