summaryrefslogtreecommitdiff
path: root/src/map/clif.c
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2013-05-15 21:56:21 -0300
committershennetsind <ind@henn.et>2013-05-15 21:56:21 -0300
commitc7f3f6c2ceae862866a019d0a438d8f965b042c2 (patch)
tree1da2a986123b23a05c8722ccc68a949473d84fb9 /src/map/clif.c
parentc811ddb181a15eae8a6d01a6956ae7c654f424b2 (diff)
downloadhercules-c7f3f6c2ceae862866a019d0a438d8f965b042c2.tar.gz
hercules-c7f3f6c2ceae862866a019d0a438d8f965b042c2.tar.bz2
hercules-c7f3f6c2ceae862866a019d0a438d8f965b042c2.tar.xz
hercules-c7f3f6c2ceae862866a019d0a438d8f965b042c2.zip
Hercules Renewal Phase One: guild.c started
http://hercules.ws/board/topic/237-hercules-renewal/ Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src/map/clif.c')
-rw-r--r--src/map/clif.c68
1 files changed, 33 insertions, 35 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index 5b32be54a..15d6aeb9d 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -7317,7 +7317,7 @@ void clif_guild_belonginfo(struct map_session_data *sd, struct guild *g)
nullpo_retv(g);
fd=sd->fd;
- ps=guild_getposition(g,sd);
+ ps=guild->getposition(g,sd);
WFIFOHEAD(fd,packet_len(0x16c));
WFIFOW(fd,0)=0x16c;
WFIFOL(fd,2)=g->guild_id;
@@ -7355,7 +7355,7 @@ void clif_guild_memberlogin_notice(struct guild *g,int idx,int flag)
WBUFW(buf,18) = sd->status.hair_color;
clif->send(buf,packet_len(0x1f2),&sd->bl,GUILD_WOS);
}
- else if( ( sd = guild_getavailablesd(g) ) != NULL )
+ else if( ( sd = guild->getavailablesd(g) ) != NULL )
{
WBUFW(buf,14) = 0;
WBUFW(buf,16) = 0;
@@ -7456,7 +7456,7 @@ void clif_guild_basicinfo(struct map_session_data *sd) {
memcpy(WFIFOP(fd,46),g->name, NAME_LENGTH);
memcpy(WFIFOP(fd,70),g->master, NAME_LENGTH);
- safestrncpy((char*)WFIFOP(fd,94),msg_txt(300+guild_checkcastles(g)),16); // "'N' castles"
+ safestrncpy((char*)WFIFOP(fd,94),msg_txt(300+guild->checkcastles(g)),16); // "'N' castles"
WFIFOL(fd,110) = 0; // zeny
WFIFOSET(fd,packet_len(0x1b6));
@@ -7613,7 +7613,7 @@ void clif_guild_positionchanged(struct guild *g,int idx)
WBUFL(buf,16)=g->position[idx].exp_mode;
memcpy(WBUFP(buf,20),g->position[idx].name,NAME_LENGTH);
// }*
- if( (sd=guild_getavailablesd(g))!=NULL )
+ if( (sd=guild->getavailablesd(g))!=NULL )
clif->send(buf,WBUFW(buf,2),&sd->bl,GUILD);
}
@@ -7637,7 +7637,7 @@ void clif_guild_memberpositionchanged(struct guild *g,int idx)
WBUFL(buf, 8)=g->member[idx].char_id;
WBUFL(buf,12)=g->member[idx].position;
// }*
- if( (sd=guild_getavailablesd(g))!=NULL )
+ if( (sd=guild->getavailablesd(g))!=NULL )
clif->send(buf,WBUFW(buf,2),&sd->bl,GUILD);
}
@@ -7698,10 +7698,8 @@ void clif_guild_skillinfo(struct map_session_data* sd)
WFIFOHEAD(fd, 6 + MAX_GUILDSKILL*37);
WFIFOW(fd,0) = 0x0162;
WFIFOW(fd,4) = g->skill_point;
- for(i = 0, c = 0; i < MAX_GUILDSKILL; i++)
- {
- if(g->skill[i].id > 0 && guild_check_skill_require(g, g->skill[i].id))
- {
+ for(i = 0, c = 0; i < MAX_GUILDSKILL; i++) {
+ if(g->skill[i].id > 0 && guild->check_skill_require(g, g->skill[i].id)) {
int id = g->skill[i].id;
int p = 6 + c*37;
WFIFOW(fd,p+0) = id;
@@ -7710,7 +7708,7 @@ void clif_guild_skillinfo(struct map_session_data* sd)
WFIFOW(fd,p+8) = skill->get_sp(id, g->skill[i].lv);
WFIFOW(fd,p+10) = skill->get_range(id, g->skill[i].lv);
safestrncpy((char*)WFIFOP(fd,p+12), skill->get_name(id), NAME_LENGTH);
- WFIFOB(fd,p+36)= (g->skill[i].lv < guild_skill_get_max(id) && sd == g->member[0].sd) ? 1 : 0;
+ WFIFOB(fd,p+36)= (g->skill[i].lv < guild->skill_get_max(id) && sd == g->member[0].sd) ? 1 : 0;
c++;
}
}
@@ -7886,7 +7884,7 @@ void clif_guild_message(struct guild *g,int account_id,const char *mes,int len)
WBUFW(buf, 2) = len + 5;
safestrncpy((char*)WBUFP(buf,4), mes, len+1);
- if ((sd = guild_getavailablesd(g)) != NULL)
+ if ((sd = guild->getavailablesd(g)) != NULL)
clif->send(buf, WBUFW(buf,2), &sd->bl, GUILD_NOBG);
}
@@ -8006,7 +8004,7 @@ void clif_guild_allianceadded(struct guild *g,int idx)
WBUFL(buf,2)=g->alliance[idx].opposition;
WBUFL(buf,6)=g->alliance[idx].guild_id;
memcpy(WBUFP(buf,10),g->alliance[idx].name,NAME_LENGTH);
- clif->send(buf,packet_len(0x185),guild_getavailablesd(g),GUILD);
+ clif->send(buf,packet_len(0x185),guild->getavailablesd(g),GUILD);
}
*/
@@ -9362,7 +9360,7 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd)
// guild
// (needs to go before clif_spawn() to show guild emblems correctly)
if(sd->status.guild_id)
- guild_send_memberinfoshort(sd,1);
+ guild->send_memberinfoshort(sd,1);
if(battle_config.pc_invincible_time > 0) {
pc_setinvincibletimer(sd,battle_config.pc_invincible_time);
@@ -9575,10 +9573,10 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd)
/* Guild Aura Init */
if( sd->state.gmaster_flag ) {
- guild_guildaura_refresh(sd,GD_LEADERSHIP,guild_checkskill(sd->state.gmaster_flag,GD_LEADERSHIP));
- guild_guildaura_refresh(sd,GD_GLORYWOUNDS,guild_checkskill(sd->state.gmaster_flag,GD_GLORYWOUNDS));
- guild_guildaura_refresh(sd,GD_SOULCOLD,guild_checkskill(sd->state.gmaster_flag,GD_SOULCOLD));
- guild_guildaura_refresh(sd,GD_HAWKEYES,guild_checkskill(sd->state.gmaster_flag,GD_HAWKEYES));
+ guild->aura_refresh(sd,GD_LEADERSHIP,guild->checkskill(sd->state.gmaster_flag,GD_LEADERSHIP));
+ guild->aura_refresh(sd,GD_GLORYWOUNDS,guild->checkskill(sd->state.gmaster_flag,GD_GLORYWOUNDS));
+ guild->aura_refresh(sd,GD_SOULCOLD,guild->checkskill(sd->state.gmaster_flag,GD_SOULCOLD));
+ guild->aura_refresh(sd,GD_HAWKEYES,guild->checkskill(sd->state.gmaster_flag,GD_HAWKEYES));
}
if( sd->state.vending ) { /* show we have a vending */
@@ -10402,7 +10400,7 @@ void clif_parse_WisMessage(int fd, struct map_session_data* sd)
struct guild *g = sd->guild, *sg = NULL;
int k;
for (k = 0; k < MAX_GUILDALLIANCE; k++) {
- if( g->alliance[k].opposition == 0 && g->alliance[k].guild_id && (sg = guild_search(g->alliance[k].guild_id) ) ) {
+ if( g->alliance[k].opposition == 0 && g->alliance[k].guild_id && (sg = guild->search(g->alliance[k].guild_id) ) ) {
if( !(((struct hChSysCh*)sg->channel)->banned && idb_exists(((struct hChSysCh*)sg->channel)->banned, sd->status.account_id)))
clif->chsys_join((struct hChSysCh *)sg->channel,sd);
}
@@ -11324,7 +11322,7 @@ void clif_parse_UseSkillToId(int fd, struct map_session_data *sd)
if( skill_id >= GD_SKILLBASE ) {
if( sd->state.gmaster_flag )
- skill_lv = guild_checkskill(sd->state.gmaster_flag, skill_id);
+ skill_lv = guild->checkskill(sd->state.gmaster_flag, skill_id);
else
skill_lv = 0;
} else {
@@ -12384,7 +12382,7 @@ void clif_parse_CreateGuild(int fd,struct map_session_data *sd)
return;
}
- guild_create(sd, name);
+ guild->create(sd, name);
}
@@ -12447,7 +12445,7 @@ void clif_parse_GuildChangePositionInfo(int fd, struct map_session_data *sd)
return;
for(i = 4; i < RFIFOW(fd,2); i += 40 ){
- guild_change_position(sd->status.guild_id, RFIFOL(fd,i), RFIFOL(fd,i+4), RFIFOL(fd,i+12), (char*)RFIFOP(fd,i+16));
+ guild->change_position(sd->status.guild_id, RFIFOL(fd,i), RFIFOL(fd,i+4), RFIFOL(fd,i+12), (char*)RFIFOP(fd,i+16));
}
}
@@ -12462,7 +12460,7 @@ void clif_parse_GuildChangeMemberPosition(int fd, struct map_session_data *sd)
return;
for(i=4;i<RFIFOW(fd,2);i+=12){
- guild_change_memberposition(sd->status.guild_id,
+ guild->change_memberposition(sd->status.guild_id,
RFIFOL(fd,i),RFIFOL(fd,i+4),RFIFOL(fd,i+8));
}
}
@@ -12475,7 +12473,7 @@ void clif_parse_GuildRequestEmblem(int fd,struct map_session_data *sd)
struct guild* g;
int guild_id = RFIFOL(fd,2);
- if( (g = guild_search(guild_id)) != NULL )
+ if( (g = guild->search(guild_id)) != NULL )
clif->guild_emblem(sd,g);
}
@@ -12511,7 +12509,7 @@ void clif_parse_GuildChangeEmblem(int fd,struct map_session_data *sd)
return;
}
- guild_change_emblem(sd, emblem_len, (const char*)emblem);
+ guild->change_emblem(sd, emblem_len, (const char*)emblem);
}
@@ -12531,7 +12529,7 @@ void clif_parse_GuildChangeNotice(int fd, struct map_session_data* sd)
if (msg2[0] == '|' && msg2[3] == '|') msg2+= 3; // skip duplicate marker
if (msg2[0] == '|') msg2[strnlen(msg2, MAX_GUILDMES2)-1] = '\0'; // delete extra space at the end of string
- guild_change_notice(sd, guild_id, msg1, msg2);
+ guild->change_notice(sd, guild_id, msg1, msg2);
}
// Helper function for guild invite functions
@@ -12551,7 +12549,7 @@ clif_sub_guild_invite(int fd, struct map_session_data *sd, struct map_session_da
return 1;
}
- guild_invite(sd,t_sd);
+ guild->invite(sd,t_sd);
return 0;
}
@@ -12582,7 +12580,7 @@ void clif_parse_GuildInvite2(int fd, struct map_session_data *sd)
/// 1 = accept
void clif_parse_GuildReplyInvite(int fd,struct map_session_data *sd)
{
- guild_reply_invite(sd,RFIFOL(fd,2),RFIFOL(fd,6));
+ guild->reply_invite(sd,RFIFOL(fd,2),RFIFOL(fd,6));
}
@@ -12599,7 +12597,7 @@ void clif_parse_GuildLeave(int fd,struct map_session_data *sd)
return;
}
- guild_leave(sd,RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10),(char*)RFIFOP(fd,14));
+ guild->leave(sd,RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10),(char*)RFIFOP(fd,14));
}
@@ -12611,7 +12609,7 @@ void clif_parse_GuildExpulsion(int fd,struct map_session_data *sd)
clif->message(fd, msg_txt(228));
return;
}
- guild_expulsion(sd,RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10),(char*)RFIFOP(fd,14));
+ guild->expulsion(sd,RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10),(char*)RFIFOP(fd,14));
}
@@ -12645,7 +12643,7 @@ void clif_parse_GuildMessage(int fd, struct map_session_data* sd)
if( sd->bg_id )
bg_send_message(sd, text, textlen);
else
- guild_send_message(sd, text, textlen);
+ guild->send_message(sd, text, textlen);
}
@@ -12671,7 +12669,7 @@ void clif_parse_GuildRequestAlliance(int fd, struct map_session_data *sd)
return;
}
- guild_reqalliance(sd,t_sd);
+ guild->reqalliance(sd,t_sd);
}
@@ -12682,7 +12680,7 @@ void clif_parse_GuildRequestAlliance(int fd, struct map_session_data *sd)
/// 1 = accept
void clif_parse_GuildReplyAlliance(int fd, struct map_session_data *sd)
{
- guild_reply_reqalliance(sd,RFIFOL(fd,2),RFIFOL(fd,6));
+ guild->reply_reqalliance(sd,RFIFOL(fd,2),RFIFOL(fd,6));
}
@@ -12700,7 +12698,7 @@ void clif_parse_GuildDelAlliance(int fd, struct map_session_data *sd)
clif->message(fd, msg_txt(228));
return;
}
- guild_delalliance(sd,RFIFOL(fd,2),RFIFOL(fd,6));
+ guild->delalliance(sd,RFIFOL(fd,2),RFIFOL(fd,6));
}
@@ -12726,7 +12724,7 @@ void clif_parse_GuildOpposition(int fd, struct map_session_data *sd)
return;
}
- guild_opposition(sd,t_sd);
+ guild->opposition(sd,t_sd);
}
@@ -12741,7 +12739,7 @@ void clif_parse_GuildBreak(int fd, struct map_session_data *sd)
clif->message(fd, msg_txt(228));
return;
}
- guild_break(sd,(char*)RFIFOP(fd,2));
+ guild->dobreak(sd,(char*)RFIFOP(fd,2));
}