summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-02-01 18:16:09 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-02-01 18:16:09 +0000
commit2f3928c61a4b13eeb29a0a66802b7d334f319af3 (patch)
tree4ee808ecf0be9f63f81f220b34f9b1493d219c1e /src
parent78cfbc99e7ecfdc31687009fe33e551b5c852110 (diff)
downloadhercules-2f3928c61a4b13eeb29a0a66802b7d334f319af3.tar.gz
hercules-2f3928c61a4b13eeb29a0a66802b7d334f319af3.tar.bz2
hercules-2f3928c61a4b13eeb29a0a66802b7d334f319af3.tar.xz
hercules-2f3928c61a4b13eeb29a0a66802b7d334f319af3.zip
- 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. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9759 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r--src/char/int_party.c71
-rw-r--r--src/char_sql/int_party.c76
-rw-r--r--src/map/clif.c6
-rw-r--r--src/map/party.c16
-rw-r--r--src/map/party.h3
-rw-r--r--src/map/pc.c3
6 files changed, 98 insertions, 77 deletions
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;
}