atcommand_auriga.conf
適当な位置に追加
partyspy: num
numはコマンドを使用できるGMレベル
map.h
struct map_session_dataに追加
L600あたり(guildspyがあるときはその下あたり)
int guild_x,guild_y;
int guildspy;
//------------------追加-------------by mame-------
int partyspy;
//---------------------ここまで--------------------
int friend_invite,friend_invite_char;
char friend_invite_name[24];
atcommand.c
L200あたり(guildspyがあるときはその下あたり)
ATCOMMAND_FUNC(hotkeyset);
ATCOMMAND_FUNC(callmerc);
ATCOMMAND_FUNC(guildspy);
//------------------追加-------------by mame-------
ATCOMMAND_FUNC(partyspy);
//---------------------ここまで--------------------
L400あたり(guildspyがあるときはその下あたり)
{ AtCommand_CallMerc, "@nnecallmerc", 0, atcommand_callmerc, NULL },
{ AtCommand_Guildspy, "@guildspy", 0, atcommand_guildspy, NULL },
//------------------追加-------------by mame-------
{ AtCommand_Partyspy, "@partyspy", 0, atcommand_partyspy, NULL },
//---------------------ここまで--------------------
// add here
{ AtCommand_MapMove, "@nnemapmove", 0, NULL, NULL },
ファイルの最後あたり
//------------------追加-------------by mame-------
/*==========================================
*Spy Commands by Syrus22
*------------------------------------------*/
int atcommand_partyspy(const int fd, struct map_session_data* sd, AtCommandType command, const char* message)
{
char party_name[100];
char buf[512];
struct party *p;
nullpo_retr(-1, sd);
if (!message || !*message)
return -1;
if (sscanf(message, "%99[^\n]", party_name) < 1)
return -1;
if ((p = party_searchname(party_name)) != NULL || (p = party_search(atoi(message))) != NULL) {
if (sd->partyspy == p->party_id) {
sd->partyspy = 0;
snprintf(buf, sizeof(buf), "No longer spying on the %s party", p->name);
clif_displaymessage(fd, buf);
} else {
sd->partyspy = p->party_id;
snprintf(buf, sizeof(buf), "Spying on the %s party", p->name);
clif_displaymessage(fd, buf);
}
} else {
snprintf(buf, sizeof(buf), "Incorrect name/ID, or no one from the specified party is online");
clif_displaymessage(fd, buf);
return -1;
}
return 0;
}
//---------------------ここまで--------------------
clif.c
L350あたり
static void clif_send関数
case:PARTYのところの処理
continue;
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->partyspy == p->party_id) {
memcpy(WFIFOP(sd->fd,0),buf,len);
WFIFOSET(sd->fd,len);
}
}
}
//---------------------ここまで--------------------
}
break;
case SELF:
atcommand.h
L200あたり
AtCommand_HotkeySet,
AtCommand_CallMerc,
AtCommand_Guildspy,
//------------------追加-------------by mame-------
AtCommand_Partyspy,
//---------------------ここまで--------------------
AtCommand_Unknown,
AtCommand_MAX,
} AtCommandType;