diff options
author | shennetsind <ind@henn.et> | 2013-06-08 22:43:11 -0300 |
---|---|---|
committer | shennetsind <ind@henn.et> | 2013-06-08 22:43:11 -0300 |
commit | 4a51fc7e5eec9a464c754d3d1e0ee44da1ca6f72 (patch) | |
tree | 73fe91762e3115e2a8a01675c0235fb2567225b8 /src/map/party.c | |
parent | cab0a3a6bfb0c7c7e4d108beb18050854af98753 (diff) | |
download | hercules-4a51fc7e5eec9a464c754d3d1e0ee44da1ca6f72.tar.gz hercules-4a51fc7e5eec9a464c754d3d1e0ee44da1ca6f72.tar.bz2 hercules-4a51fc7e5eec9a464c754d3d1e0ee44da1ca6f72.tar.xz hercules-4a51fc7e5eec9a464c754d3d1e0ee44da1ca6f72.zip |
mkbu95's Party Recruit Update
There are still some features as blocklist and volunteer that were not worked on due to some lack of information.
Special Thanks to mkbu95, Spira and Yommy
Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src/map/party.c')
-rw-r--r-- | src/map/party.c | 48 |
1 files changed, 43 insertions, 5 deletions
diff --git a/src/map/party.c b/src/map/party.c index 91d6188a9..e30d16c07 100644 --- a/src/map/party.c +++ b/src/map/party.c @@ -1110,10 +1110,16 @@ static struct party_booking_ad_info* create_party_booking_data(void) return pb_ad; } +#ifndef PARTY_RECRUIT void party_booking_register(struct map_session_data *sd, short level, short mapid, short* job) +#else +void party_booking_register(struct map_session_data *sd, short level, const char *notice) +#endif { struct party_booking_ad_info *pb_ad; - int i; +#ifndef PARTY_RECRUIT + int i; +#endif pb_ad = (struct party_booking_ad_info*)idb_get(party_booking_db, sd->status.char_id); @@ -1129,22 +1135,32 @@ void party_booking_register(struct map_session_data *sd, short level, short mapi } memcpy(pb_ad->charname,sd->status.name,NAME_LENGTH); - pb_ad->starttime = (int)time(NULL); - pb_ad->p_detail.level = level; + pb_ad->expiretime = (int)time(NULL); + pb_ad->p_detail.level = level; +#ifndef PARTY_RECRUIT pb_ad->p_detail.mapid = mapid; for(i=0;i<PARTY_BOOKING_JOBS;i++) if(job[i] != 0xFF) pb_ad->p_detail.job[i] = job[i]; else pb_ad->p_detail.job[i] = -1; +#else + safestrncpy(pb_ad->p_detail.notice, notice, PB_NOTICE_LENGTH); +#endif clif->PartyBookingRegisterAck(sd, 0); clif->PartyBookingInsertNotify(sd, pb_ad); // Notice } +#ifndef PARTY_RECRUIT void party_booking_update(struct map_session_data *sd, short* job) +#else +void party_booking_update(struct map_session_data *sd, const char *notice) +#endif { +#ifndef PARTY_RECRUIT int i; +#endif struct party_booking_ad_info *pb_ad; pb_ad = (struct party_booking_ad_info*)idb_get(party_booking_db, sd->status.char_id); @@ -1152,20 +1168,33 @@ void party_booking_update(struct map_session_data *sd, short* job) if( pb_ad == NULL ) return; - pb_ad->starttime = (int)time(NULL);// Update time. + pb_ad->expiretime = (int)time(NULL);// Update time. +#ifndef PARTY_RECRUIT for(i=0;i<PARTY_BOOKING_JOBS;i++) if(job[i] != 0xFF) pb_ad->p_detail.job[i] = job[i]; else pb_ad->p_detail.job[i] = -1; +#else + if (notice != NULL) { + safestrncpy(pb_ad->p_detail.notice, notice, PB_NOTICE_LENGTH); + } +#endif clif->PartyBookingUpdateNotify(sd, pb_ad); } +#ifndef PARTY_RECRUIT void party_booking_search(struct map_session_data *sd, short level, short mapid, short job, unsigned long lastindex, short resultcount) +#else +void party_booking_search(struct map_session_data *sd, short level, short mapid, unsigned long lastindex, short resultcount) +#endif { struct party_booking_ad_info *pb_ad; - int i, count=0; +#ifndef PARTY_RECRUIT + int i; +#endif + int count = 0; struct party_booking_ad_info* result_list[PARTY_BOOKING_RESULTS]; bool more_result = false; DBIterator* iter = db_iterator(party_booking_db); @@ -1174,12 +1203,18 @@ void party_booking_search(struct map_session_data *sd, short level, short mapid, for( pb_ad = dbi_first(iter); dbi_exists(iter); pb_ad = dbi_next(iter) ) { +#ifndef PARTY_RECRUIT if (pb_ad->index < lastindex || (level && (pb_ad->p_detail.level < level-15 || pb_ad->p_detail.level > level))) continue; +#else + if ((level && (pb_ad->p_detail.level < level-15 || pb_ad->p_detail.level > level))) + continue; +#endif if (count >= PARTY_BOOKING_RESULTS){ more_result = true; break; } +#ifndef PARTY_RECRUIT if (mapid == 0 && job == -1) result_list[count] = pb_ad; else if (mapid == 0) { @@ -1190,6 +1225,9 @@ void party_booking_search(struct map_session_data *sd, short level, short mapid, if (pb_ad->p_detail.mapid == mapid) result_list[count] = pb_ad; } +#else + result_list[count] = pb_ad; +#endif if( result_list[count] ) { count++; |