diff options
author | shennetsind <ind@henn.et> | 2013-03-29 19:40:25 -0300 |
---|---|---|
committer | shennetsind <ind@henn.et> | 2013-03-29 19:40:25 -0300 |
commit | a89d501fc60b12a997a262429cb4515af9dad69e (patch) | |
tree | 39e2a5153a99d46dc40cb461eb3ecdb9ded73275 /src/map/party.c | |
parent | cfd2bdb06048c17decaafd0f5a3c04e3f0ac6a3b (diff) | |
download | hercules-a89d501fc60b12a997a262429cb4515af9dad69e.tar.gz hercules-a89d501fc60b12a997a262429cb4515af9dad69e.tar.bz2 hercules-a89d501fc60b12a997a262429cb4515af9dad69e.tar.xz hercules-a89d501fc60b12a997a262429cb4515af9dad69e.zip |
Hercules Renewal: clif.c
1st Phase Complete.
http://hercules.ws/board/topic/237-hercules-renewal/
Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src/map/party.c')
-rw-r--r-- | src/map/party.c | 110 |
1 files changed, 55 insertions, 55 deletions
diff --git a/src/map/party.c b/src/map/party.c index e4d34bb1c..baf680df3 100644 --- a/src/map/party.c +++ b/src/map/party.c @@ -159,7 +159,7 @@ int party_create(struct map_session_data *sd,char *name,int item,int item2) if( sd->status.party_id > 0 || sd->party_joining || sd->party_creating ) {// already associated with a party - clif_party_created(sd,2); + clif->party_created(sd,2); return 0; } @@ -188,10 +188,10 @@ void party_created(int account_id,int char_id,int fail,int party_id,char *name) if( !fail ) { sd->status.party_id = party_id; - clif_party_created(sd,0); //Success message + clif->party_created(sd,0); //Success message //We don't do any further work here because the char-server sends a party info packet right after creating the party. } else { - clif_party_created(sd,1); // "party name already exists" + clif->party_created(sd,1); // "party name already exists" } } @@ -315,12 +315,12 @@ int party_recv_info(struct party* sp, int char_id) sd = p->data[member_id].sd; if( sd == NULL ) continue;// not online - clif_charnameupdate(sd); //Update other people's display. [Skotlex] - clif_party_member_info(p,sd); - clif_party_option(p,sd,0x100); - clif_party_info(p,NULL); + clif->charnameupdate(sd); //Update other people's display. [Skotlex] + clif->party_member_info(p,sd); + clif->party_option(p,sd,0x100); + clif->party_info(p,NULL); if( p->instance_id != 0 ) - clif_instance_join(sd->fd, p->instance_id); + clif->instance_join(sd->fd, p->instance_id); } if( char_id != 0 )// requester { @@ -345,7 +345,7 @@ int party_invite(struct map_session_data *sd,struct map_session_data *tsd) ARR_FIND(0, MAX_PARTY, i, p->data[i].sd == sd); if( i == MAX_PARTY || !p->party.member[i].leader ) { - clif_displaymessage(sd->fd, msg_txt(282)); + clif->displaymessage(sd->fd, msg_txt(282)); return 0; } @@ -353,43 +353,43 @@ int party_invite(struct map_session_data *sd,struct map_session_data *tsd) ARR_FIND(0, MAX_PARTY, i, p->party.member[i].account_id == 0); if( i == MAX_PARTY ) { - clif_party_inviteack(sd, (tsd?tsd->status.name:""), 3); + clif->party_inviteack(sd, (tsd?tsd->status.name:""), 3); return 0; } // confirm whether the account has the ability to invite before checking the player if( !pc_has_permission(sd, PC_PERM_PARTY) || (tsd && !pc_has_permission(tsd, PC_PERM_PARTY)) ) { - clif_displaymessage(sd->fd, msg_txt(81)); // "Your GM level doesn't authorize you to preform this action on the specified player." + clif->displaymessage(sd->fd, msg_txt(81)); // "Your GM level doesn't authorize you to preform this action on the specified player." return 0; } if( tsd == NULL) { - clif_party_inviteack(sd, "", 7); + clif->party_inviteack(sd, "", 7); return 0; } if(!battle_config.invite_request_check) { if (tsd->guild_invite>0 || tsd->trade_partner || tsd->adopt_invite) { - clif_party_inviteack(sd,tsd->status.name,0); + clif->party_inviteack(sd,tsd->status.name,0); return 0; } } if (!tsd->fd) { //You can't invite someone who has already disconnected. - clif_party_inviteack(sd,tsd->status.name,1); + clif->party_inviteack(sd,tsd->status.name,1); return 0; } if( tsd->status.party_id > 0 || tsd->party_invite > 0 ) {// already associated with a party - clif_party_inviteack(sd,tsd->status.name,0); + clif->party_inviteack(sd,tsd->status.name,0); return 0; } tsd->party_invite=sd->status.party_id; tsd->party_invite_account=sd->status.account_id; - clif_party_invite(sd,tsd); + clif->party_invite(sd,tsd); return 1; } @@ -417,7 +417,7 @@ void party_reply_invite(struct map_session_data *sd,int party_id,int flag) sd->party_invite = 0; sd->party_invite_account = 0; if( tsd != NULL ) - clif_party_inviteack(tsd,sd->status.name,1); + clif->party_inviteack(tsd,sd->status.name,1); } } @@ -439,7 +439,7 @@ void party_member_joined(struct map_session_data *sd) { p->data[i].sd = sd; if( p->instance_id ) - clif_instance_join(sd->fd,p->instance_id); + clif->instance_join(sd->fd,p->instance_id); } else sd->status.party_id = 0; //He does not belongs to the party really? @@ -474,31 +474,31 @@ int party_member_added(int party_id,int account_id,int char_id, int flag) if( flag ) {// failed if( sd2 != NULL ) - clif_party_inviteack(sd2,sd->status.name,3); + clif->party_inviteack(sd2,sd->status.name,3); return 0; } sd->status.party_id = party_id; - clif_party_member_info(p,sd); - clif_party_option(p,sd,0x100); - clif_party_info(p,sd); + clif->party_member_info(p,sd); + clif->party_option(p,sd,0x100); + clif->party_info(p,sd); if( sd2 != NULL ) - clif_party_inviteack(sd2,sd->status.name,2); + clif->party_inviteack(sd2,sd->status.name,2); for( i = 0; i < ARRAYLENGTH(p->data); ++i ) {// hp of the other party members sd2 = p->data[i].sd; if( sd2 && sd2->status.account_id != account_id && sd2->status.char_id != char_id ) - clif_hpmeter_single(sd->fd, sd2->bl.id, sd2->battle_status.hp, sd2->battle_status.max_hp); + clif->hpmeter_single(sd->fd, sd2->bl.id, sd2->battle_status.hp, sd2->battle_status.max_hp); } - clif_party_hp(sd); - clif_party_xy(sd); - clif_charnameupdate(sd); //Update char name's display [Skotlex] + clif->party_hp(sd); + clif->party_xy(sd); + clif->charnameupdate(sd); //Update char name's display [Skotlex] if( p->instance_id ) - clif_instance_join(sd->fd, p->instance_id); + clif->instance_join(sd->fd, p->instance_id); return 0; } @@ -558,7 +558,7 @@ int party_member_withdraw(int party_id, int account_id, int char_id) ARR_FIND( 0, MAX_PARTY, i, p->party.member[i].account_id == account_id && p->party.member[i].char_id == char_id ); if( i < MAX_PARTY ) { - clif_party_withdraw(p,sd,account_id,p->party.member[i].name,0x0); + clif->party_withdraw(p,sd,account_id,p->party.member[i].name,0x0); memset(&p->party.member[i], 0, sizeof(p->party.member[0])); memset(&p->data[i], 0, sizeof(p->data[0])); p->party.count--; @@ -569,7 +569,7 @@ int party_member_withdraw(int party_id, int account_id, int char_id) if( sd && sd->status.party_id == party_id && sd->status.char_id == char_id ) { sd->status.party_id = 0; - clif_charnameupdate(sd); //Update name display [Skotlex] + clif->charnameupdate(sd); //Update name display [Skotlex] //TODO: hp bars should be cleared too if( p->instance_id ) instance_check_kick(sd); @@ -598,7 +598,7 @@ int party_broken(int party_id) { if( p->data[i].sd!=NULL ) { - clif_party_withdraw(p,p->data[i].sd,p->party.member[i].account_id,p->party.member[i].name,0x10); + clif->party_withdraw(p,p->data[i].sd,p->party.member[i].account_id,p->party.member[i].name,0x10); p->data[i].sd->status.party_id=0; } } @@ -631,7 +631,7 @@ int party_optionchanged(int party_id,int account_id,int exp,int item,int flag) p->party.item=item; } - clif_party_option(p,sd,flag); + clif->party_option(p,sd,flag); return 0; } @@ -644,13 +644,13 @@ bool party_changeleader(struct map_session_data *sd, struct map_session_data *ts return false; if (!tsd || tsd->status.party_id != sd->status.party_id) { - clif_displaymessage(sd->fd, msg_txt(283)); + clif->displaymessage(sd->fd, msg_txt(283)); return false; } if( map[sd->bl.m].flag.partylock ) { - clif_displaymessage(sd->fd, msg_txt(287)); + clif->displaymessage(sd->fd, msg_txt(287)); return false; } @@ -663,7 +663,7 @@ bool party_changeleader(struct map_session_data *sd, struct map_session_data *ts if (!p->party.member[mi].leader) { //Need to be a party leader. - clif_displaymessage(sd->fd, msg_txt(282)); + clif->displaymessage(sd->fd, msg_txt(282)); return false; } @@ -674,15 +674,15 @@ bool party_changeleader(struct map_session_data *sd, struct map_session_data *ts //Change leadership. p->party.member[mi].leader = 0; if (p->data[mi].sd->fd) - clif_displaymessage(p->data[mi].sd->fd, msg_txt(284)); + clif->displaymessage(p->data[mi].sd->fd, msg_txt(284)); p->party.member[tmi].leader = 1; if (p->data[tmi].sd->fd) - clif_displaymessage(p->data[tmi].sd->fd, msg_txt(285)); + clif->displaymessage(p->data[tmi].sd->fd, msg_txt(285)); //Update info. intif_party_leaderchange(p->party.party_id,p->party.member[tmi].account_id,p->party.member[tmi].char_id); - clif_party_info(p,NULL); + clif->party_info(p,NULL); return true; } @@ -714,7 +714,7 @@ int party_recv_movemap(int party_id,int account_id,int char_id, unsigned short m //Check if they still exist on this map server p->data[i].sd = party_sd_check(party_id, account_id, char_id); - clif_party_info(p,NULL); + clif->party_info(p,NULL); return 0; } @@ -732,9 +732,9 @@ void party_send_movemap(struct map_session_data *sd) if(sd->state.connect_new) { //Note that this works because this function is invoked before connect_new is cleared. - clif_party_option(p,sd,0x100); - clif_party_info(p,sd); - clif_party_member_info(p,sd); + clif->party_option(p,sd,0x100); + clif->party_info(p,sd); + clif->party_member_info(p,sd); } if (sd->fd) { // synchronize minimap positions with the rest of the party @@ -744,8 +744,8 @@ void party_send_movemap(struct map_session_data *sd) p->data[i].sd != sd && p->data[i].sd->bl.m == sd->bl.m) { - clif_party_xy_single(sd->fd, p->data[i].sd); - clif_party_xy_single(p->data[i].sd->fd, sd); + clif->party_xy_single(sd->fd, p->data[i].sd); + clif->party_xy_single(p->data[i].sd->fd, sd); } } } @@ -796,7 +796,7 @@ int party_recv_message(int party_id,int account_id,const char *mes,int len) struct party_data *p; if( (p=party_search(party_id))==NULL) return 0; - clif_party_message(p,account_id,mes,len); + clif->party_message(p,account_id,mes,len); return 0; } @@ -874,13 +874,13 @@ int party_send_xy_timer(int tid, unsigned int tick, int id, intptr_t data) if( p->data[i].x != sd->bl.x || p->data[i].y != sd->bl.y ) {// perform position update - clif_party_xy(sd); + clif->party_xy(sd); p->data[i].x = sd->bl.x; p->data[i].y = sd->bl.y; } if (battle_config.party_hp_mode && p->data[i].hp != sd->battle_status.hp) {// perform hp update - clif_party_hp(sd); + clif->party_hp(sd); p->data[i].hp = sd->battle_status.hp; } } @@ -1014,7 +1014,7 @@ int party_share_loot(struct party_data* p, struct map_session_data* sd, struct i } if( p && battle_config.party_show_share_picker && battle_config.show_picker_item_type&(1<<itemdb_type(item_data->nameid)) ) - clif_party_show_picker(target, item_data); + clif->party_show_picker(target, item_data); return 0; } @@ -1022,7 +1022,7 @@ int party_share_loot(struct party_data* p, struct map_session_data* sd, struct i int party_send_dot_remove(struct map_session_data *sd) { if (sd->status.party_id) - clif_party_xy_remove(sd); + clif->party_xy_remove(sd); return 0; } @@ -1116,7 +1116,7 @@ void party_booking_register(struct map_session_data *sd, short level, short mapi } else {// already registered - clif_PartyBookingRegisterAck(sd, 2); + clif->PartyBookingRegisterAck(sd, 2); return; } @@ -1130,8 +1130,8 @@ void party_booking_register(struct map_session_data *sd, short level, short mapi pb_ad->p_detail.job[i] = job[i]; else pb_ad->p_detail.job[i] = -1; - clif_PartyBookingRegisterAck(sd, 0); - clif_PartyBookingInsertNotify(sd, pb_ad); // Notice + clif->PartyBookingRegisterAck(sd, 0); + clif->PartyBookingInsertNotify(sd, pb_ad); // Notice } void party_booking_update(struct map_session_data *sd, short* job) @@ -1151,7 +1151,7 @@ void party_booking_update(struct map_session_data *sd, short* job) pb_ad->p_detail.job[i] = job[i]; else pb_ad->p_detail.job[i] = -1; - clif_PartyBookingUpdateNotify(sd, pb_ad); + clif->PartyBookingUpdateNotify(sd, pb_ad); } void party_booking_search(struct map_session_data *sd, short level, short mapid, short job, unsigned long lastindex, short resultcount) @@ -1188,7 +1188,7 @@ void party_booking_search(struct map_session_data *sd, short level, short mapid, } } dbi_destroy(iter); - clif_PartyBookingSearchAck(sd->fd, result_list, count, more_result); + clif->PartyBookingSearchAck(sd->fd, result_list, count, more_result); } bool party_booking_delete(struct map_session_data *sd) @@ -1197,7 +1197,7 @@ bool party_booking_delete(struct map_session_data *sd) if((pb_ad = (struct party_booking_ad_info*)idb_get(party_booking_db, sd->status.char_id))!=NULL) { - clif_PartyBookingDeleteNotify(sd, pb_ad->index); + clif->PartyBookingDeleteNotify(sd, pb_ad->index); idb_remove(party_booking_db,sd->status.char_id); } return true; |