diff options
-rw-r--r-- | Changelog-Trunk.txt | 4 | ||||
-rw-r--r-- | src/char/int_party.c | 71 | ||||
-rw-r--r-- | src/char_sql/int_party.c | 76 | ||||
-rw-r--r-- | src/map/clif.c | 6 | ||||
-rw-r--r-- | src/map/party.c | 16 | ||||
-rw-r--r-- | src/map/party.h | 3 | ||||
-rw-r--r-- | src/map/pc.c | 3 |
7 files changed, 102 insertions, 77 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt index 5abcc407a..418084b77 100644 --- a/Changelog-Trunk.txt +++ b/Changelog-Trunk.txt @@ -4,6 +4,10 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK. 2007/01/31 + * When when a party-member levels up, the level change is sent to the + char-server to update the even-share range values. + * When joining a gvg_dungeon, the pvp packet will be sent to signal + versus. With this gvg dungeons should be working correctly now. [Skotlex] * Changes in the VS8 project files: [FlavioJS] - synchronized the settings between the projects - joined all .h and .cpp files and grouped them based on the src subfolder diff --git a/src/char/int_party.c b/src/char/int_party.c index 8f8e22583..5b04467b2 100644 --- a/src/char/int_party.c +++ b/src/char/int_party.c @@ -637,43 +637,46 @@ int mapif_parse_PartyChangeMap(int fd, int party_id, int account_id, int char_id if (p == NULL) return 0; - for(i = 0; i < MAX_PARTY; i++) { - if(p->party.member[i].account_id == account_id && - p->party.member[i].char_id == char_id) + for(i = 0; i < MAX_PARTY && + (p->party.member[i].account_id != account_id || + p->party.member[i].char_id != char_id); i++); + + if (i == MAX_PARTY) return 0; + + if (p->party.member[i].online != online) + { + p->party.member[i].online = online; + if (online) + p->party.count++; + else + p->party.count--; + // Even share check situations: Family state (always breaks) + // character logging on/off is max/min level (update level range) + // or character logging on/off has a different level (update level range using new level) + if (p->family || + (p->party.member[i].lv <= p->min_lv || p->party.member[i].lv >= p->max_lv) || + (p->party.member[i].lv != lv && (lv <= p->min_lv || lv >= p->max_lv)) + ) { - p->party.member[i].map = map; - if (p->party.member[i].online != online) - { - p->party.member[i].online = online; - if (online) - p->party.count++; - else - p->party.count--; - // Even share check situations: Family state (always breaks) - // character logging on/off is max/min level (update level range) - // or character logging on/off has a different level (update level range using new level) - if (p->family || - (p->party.member[i].lv <= p->min_lv || p->party.member[i].lv >= p->max_lv) || - (p->party.member[i].lv != lv && (lv <= p->min_lv || lv >= p->max_lv)) - ) - { - p->party.member[i].lv = lv; - int_party_check_lv(p); - } - } - if (p->party.member[i].lv != lv) { - if(p->party.member[i].lv == p->min_lv || - p->party.member[i].lv == p->max_lv) - { - p->party.member[i].lv = lv; - int_party_check_lv(p); - } else - p->party.member[i].lv = lv; - } - mapif_party_membermoved(&p->party, i); - break; + p->party.member[i].lv = lv; + int_party_check_lv(p); } } + if (p->party.member[i].lv != lv) { + if(p->party.member[i].lv == p->min_lv || + p->party.member[i].lv == p->max_lv) + { + p->party.member[i].lv = lv; + int_party_check_lv(p); + } else + p->party.member[i].lv = lv; + //There is no need to send level update to map servers + //since they do nothing with it. + } + if (p->party.member[i].map != map) { + p->party.member[i].map = map; + mapif_party_membermoved(&p->party, i); + } return 0; } diff --git a/src/char_sql/int_party.c b/src/char_sql/int_party.c index 025c14e31..7b6b41b23 100644 --- a/src/char_sql/int_party.c +++ b/src/char_sql/int_party.c @@ -716,7 +716,7 @@ int mapif_parse_PartyLeave(int fd, int party_id, int account_id, int char_id) mapif_party_info(-1,&p->party); return 0; } -// When member goes to other map +// When member goes to other map or levels up. int mapif_parse_PartyChangeMap(int fd, int party_id, int account_id, int char_id, unsigned short map, int online, unsigned int lv) { struct party_data *p; @@ -726,45 +726,51 @@ int mapif_parse_PartyChangeMap(int fd, int party_id, int account_id, int char_id if (p == NULL) return 0; - for(i = 0; i < MAX_PARTY; i++) { - if(p->party.member[i].account_id == account_id && - p->party.member[i].char_id == char_id) + for(i = 0; i < MAX_PARTY && + (p->party.member[i].account_id != account_id || + p->party.member[i].char_id != char_id); i++); + + if (i == MAX_PARTY) return 0; + + if (p->party.member[i].online != online) + { + p->party.member[i].online = online; + if (online) + p->party.count++; + else + p->party.count--; + // Even share check situations: Family state (always breaks) + // character logging on/off is max/min level (update level range) + // or character logging on/off has a different level (update level range using new level) + if (p->family || + (p->party.member[i].lv <= p->min_lv || p->party.member[i].lv >= p->max_lv) || + (p->party.member[i].lv != lv && (lv <= p->min_lv || lv >= p->max_lv)) + ) { - p->party.member[i].map = map; - if (p->party.member[i].online != online) - { - p->party.member[i].online = online; - if (online) - p->party.count++; - else - p->party.count--; - // Even share check situations: Family state (always breaks) - // character logging on/off is max/min level (update level range) - // or character logging on/off has a different level (update level range using new level) - if (p->family || - (p->party.member[i].lv <= p->min_lv || p->party.member[i].lv >= p->max_lv) || - (p->party.member[i].lv != lv && (lv <= p->min_lv || lv >= p->max_lv)) - ) - { - p->party.member[i].lv = lv; - int_party_check_lv(p); - } - } - if (p->party.member[i].lv != lv) { - if(p->party.member[i].lv == p->min_lv || - p->party.member[i].lv == p->max_lv) - { - p->party.member[i].lv = lv; - int_party_check_lv(p); - } else - p->party.member[i].lv = lv; - } - mapif_party_membermoved(&p->party, i); - break; + p->party.member[i].lv = lv; + int_party_check_lv(p); } } + + if (p->party.member[i].lv != lv) { + if(p->party.member[i].lv == p->min_lv || + p->party.member[i].lv == p->max_lv) + { + p->party.member[i].lv = lv; + int_party_check_lv(p); + } else + p->party.member[i].lv = lv; + //There is no need to send level update to map servers + //since they do nothing with it. + } + + if (p->party.member[i].map != map) { + p->party.member[i].map = map; + mapif_party_membermoved(&p->party, i); + } return 0; } + // パーティ解散要求 int mapif_parse_BreakParty(int fd,int party_id) { diff --git a/src/map/clif.c b/src/map/clif.c index 32a0843d2..4aa9f5b56 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -8175,9 +8175,13 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd) if (map[sd->bl.m].flag.gvg_dungeon) { - clif_set0199(fd,2); //TODO: Figure out the real thing to do here. + clif_set0199(fd, 1); //TODO: Figure out the real packet to send here. if (!sd->pvp_point) + { sd->pvp_point=5; //Need to die twice to be warped out. + sd->pvp_won=0; + sd->pvp_lost=0; + } } if(map_flag_gvg(sd->bl.m)) diff --git a/src/map/party.c b/src/map/party.c index 558615e9c..4ac60a65a 100644 --- a/src/map/party.c +++ b/src/map/party.c @@ -508,15 +508,14 @@ int party_recv_movemap(int party_id,int account_id,int char_id, unsigned short m return 0; } -int party_send_movemap(struct map_session_data *sd) +void party_send_movemap(struct map_session_data *sd) { int i; struct party_data *p; - nullpo_retr(0, sd); - if( sd->status.party_id==0 ) - return 0; + return; + intif_party_changemap(sd,1); p=party_search(sd->status.party_id); @@ -532,7 +531,7 @@ int party_send_movemap(struct map_session_data *sd) } if( sd->state.party_sent ) - return 0; + return; party_check_conflict(sd); @@ -546,7 +545,12 @@ int party_send_movemap(struct map_session_data *sd) } } - return 0; + return; +} + +void party_send_levelup(struct map_session_data *sd) +{ + intif_party_changemap(sd,1); } int party_send_logout(struct map_session_data *sd) diff --git a/src/map/party.h b/src/map/party.h index 92d78a4b6..0b7c9a858 100644 --- a/src/map/party.h +++ b/src/map/party.h @@ -32,7 +32,8 @@ int party_recv_movemap(int party_id,int account_id,int char_id, unsigned short m int party_broken(int party_id); int party_optionchanged(int party_id,int account_id,int exp,int item,int flag); int party_changeoption(struct map_session_data *sd,int exp,int item); -int party_send_movemap(struct map_session_data *sd); +void party_send_movemap(struct map_session_data *sd); +void party_send_levelup(struct map_session_data *sd); int party_send_logout(struct map_session_data *sd); int party_send_message(struct map_session_data *sd,char *mes,int len); int party_recv_message(int party_id,int account_id,char *mes,int len); diff --git a/src/map/pc.c b/src/map/pc.c index 5d97b4587..9b4b9698d 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -4100,6 +4100,9 @@ int pc_checkbaselevelup(struct map_session_data *sd) //LORDALFA - LVLUPEVENT if(sd->state.event_baselvup) npc_script_event(sd, NPCE_BASELVUP); + + if(sd->status.party_id) + party_send_levelup(sd); return 1; } |