Converted ZC_ACK_REQ_HOSTILE_GUILD to struct (#8639)
Co-authored-by: Lemongrass3110 <lemongrass@kstp.at>
This commit is contained in:
parent
06e2fc95a1
commit
d2809156bc
@ -9217,24 +9217,21 @@ void clif_guild_delalliance(map_session_data *sd,int guild_id,int flag)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// Notifies the client about the result of a opposition request (ZC_ACK_REQ_HOSTILE_GUILD).
|
/// Notifies the client about the result of a opposition request.
|
||||||
/// 0181 <result>.B
|
/// 0181 <result>.B (ZC_ACK_REQ_HOSTILE_GUILD)
|
||||||
/// result:
|
/// result:
|
||||||
/// 0 = Antagonist has been set.
|
/// 0 = Antagonist has been set.
|
||||||
/// 1 = Guild has too many Antagonists.
|
/// 1 = Guild has too many Antagonists.
|
||||||
/// 2 = Already set as an Antagonist.
|
/// 2 = Already set as an Antagonist.
|
||||||
/// 3 = Antagonists are disabled.
|
/// 3 = Antagonists are disabled.
|
||||||
void clif_guild_oppositionack(map_session_data *sd,int flag)
|
void clif_guild_oppositionack(map_session_data& sd,uint8 flag){
|
||||||
{
|
|
||||||
int fd;
|
|
||||||
|
|
||||||
nullpo_retv(sd);
|
PACKET_ZC_ACK_REQ_HOSTILE_GUILD p{};
|
||||||
|
|
||||||
fd=sd->fd;
|
p.packetType = HEADER_ZC_ACK_REQ_HOSTILE_GUILD;
|
||||||
WFIFOHEAD(fd,packet_len(0x181));
|
p.flag = flag;
|
||||||
WFIFOW(fd,0)=0x181;
|
|
||||||
WFIFOB(fd,2)=flag;
|
clif_send(&p,sizeof(p),&sd.bl,SELF);
|
||||||
WFIFOSET(fd,packet_len(0x181));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -1061,7 +1061,7 @@ void clif_guild_message( const struct mmo_guild& g, uint32 account_id, const cha
|
|||||||
void clif_guild_reqalliance(map_session_data& sd,uint32 account_id,const char *name);
|
void clif_guild_reqalliance(map_session_data& sd,uint32 account_id,const char *name);
|
||||||
void clif_guild_allianceack(map_session_data *sd,int flag);
|
void clif_guild_allianceack(map_session_data *sd,int flag);
|
||||||
void clif_guild_delalliance(map_session_data *sd,int guild_id,int flag);
|
void clif_guild_delalliance(map_session_data *sd,int guild_id,int flag);
|
||||||
void clif_guild_oppositionack(map_session_data *sd,int flag);
|
void clif_guild_oppositionack(map_session_data& sd,uint8 flag);
|
||||||
void clif_guild_broken( map_session_data& sd, int flag );
|
void clif_guild_broken( map_session_data& sd, int flag );
|
||||||
void clif_guild_xy( map_session_data& sd );
|
void clif_guild_xy( map_session_data& sd );
|
||||||
void clif_guild_xy_single( map_session_data& sd, map_session_data& tsd );
|
void clif_guild_xy_single( map_session_data& sd, map_session_data& tsd );
|
||||||
|
|||||||
@ -204,7 +204,6 @@
|
|||||||
parseable_packet(0x017e,-1,clif_parse_GuildMessage,2,4);
|
parseable_packet(0x017e,-1,clif_parse_GuildMessage,2,4);
|
||||||
packet(0x017f,-1);
|
packet(0x017f,-1);
|
||||||
parseable_packet(0x0180,6,clif_parse_GuildOpposition,2);
|
parseable_packet(0x0180,6,clif_parse_GuildOpposition,2);
|
||||||
packet(0x0181,3);
|
|
||||||
packet(0x0182,106);
|
packet(0x0182,106);
|
||||||
parseable_packet(0x0183,10,clif_parse_GuildDelAlliance,2,6);
|
parseable_packet(0x0183,10,clif_parse_GuildDelAlliance,2,6);
|
||||||
packet(0x0184,10);
|
packet(0x0184,10);
|
||||||
|
|||||||
@ -1996,14 +1996,14 @@ int guild_opposition(map_session_data *sd,map_session_data *tsd) {
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if( guild_get_alliance_count(g->guild,1) >= battle_config.max_guild_alliance ) {
|
if( guild_get_alliance_count(g->guild,1) >= battle_config.max_guild_alliance ) {
|
||||||
clif_guild_oppositionack(sd,1);
|
clif_guild_oppositionack(*sd,1);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < MAX_GUILDALLIANCE; i++) { // checking relations
|
for (i = 0; i < MAX_GUILDALLIANCE; i++) { // checking relations
|
||||||
if(g->guild.alliance[i].guild_id==tsd->status.guild_id){
|
if(g->guild.alliance[i].guild_id==tsd->status.guild_id){
|
||||||
if (g->guild.alliance[i].opposition == 1) { // check if not already hostile
|
if (g->guild.alliance[i].opposition == 1) { // check if not already hostile
|
||||||
clif_guild_oppositionack(sd,2);
|
clif_guild_oppositionack(*sd,2);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if(is_agit_start()) // Prevent the changing of alliances to oppositions during WoE.
|
if(is_agit_start()) // Prevent the changing of alliances to oppositions during WoE.
|
||||||
@ -2082,7 +2082,7 @@ int guild_allianceack(int guild_id1,int guild_id2,uint32 account_id1,uint32 acco
|
|||||||
clif_guild_allianceack(sd[1],2);
|
clif_guild_allianceack(sd[1],2);
|
||||||
} else if ((flag & 0x0f) == 1) { // enemy notification
|
} else if ((flag & 0x0f) == 1) { // enemy notification
|
||||||
if( sd[0]!=nullptr )
|
if( sd[0]!=nullptr )
|
||||||
clif_guild_oppositionack(sd[0],0);
|
clif_guild_oppositionack(*sd[0],0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -767,6 +767,12 @@ struct PACKET_ZC_REQ_ALLY_GUILD {
|
|||||||
} __attribute__((packed));
|
} __attribute__((packed));
|
||||||
DEFINE_PACKET_HEADER(ZC_REQ_ALLY_GUILD, 0x171)
|
DEFINE_PACKET_HEADER(ZC_REQ_ALLY_GUILD, 0x171)
|
||||||
|
|
||||||
|
struct PACKET_ZC_ACK_REQ_HOSTILE_GUILD {
|
||||||
|
int16 packetType;
|
||||||
|
uint8 flag;
|
||||||
|
} __attribute__((packed));
|
||||||
|
DEFINE_PACKET_HEADER(ZC_ACK_REQ_HOSTILE_GUILD, 0x181)
|
||||||
|
|
||||||
struct PACKET_ZC_COMPASS {
|
struct PACKET_ZC_COMPASS {
|
||||||
int16 packetType;
|
int16 packetType;
|
||||||
uint32 npcId;
|
uint32 npcId;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user