Browse Source

- ES magic will now put the caster on stun for 0.5 secs regardless of whether the skill-target is a mob or not.
- Added function clif_party_join_info which sends packet 0x1e9 each time a party-member joins. This packet (as redundant info as it has) should also contain the field for "adoptability", but that needs to be coded in yet.
- Added clif_ParseAdoptRequest which does the basic adoption handling. More checks and the reply packets still need to be coded in.
- Happy State and TK stances won't dispel on death now.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6521 54d463be-8e91-2dee-dedb-b68131a5f0ec

skotlex 19 years ago
parent
commit
e78ae404f9
6 changed files with 96 additions and 43 deletions
  1. 9 0
      Changelog-Trunk.txt
  2. 39 3
      src/map/clif.c
  3. 1 0
      src/map/clif.h
  4. 18 13
      src/map/party.c
  5. 23 23
      src/map/skill.c
  6. 6 4
      src/map/status.c

+ 9 - 0
Changelog-Trunk.txt

@@ -4,6 +4,15 @@ 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.
 
 2006/05/08
+	* ES magic will now put the caster on stun for 0.5 secs regardless of
+	  whether the skill-target is a mob or not. [Skotlex]
+	* Added function clif_party_join_info which sends packet 0x1e9 each time a
+	  party-member joins. This packet (as redundant info as it has) should also
+	  contain the field for "adoptability", but that needs to be coded in yet.
+	  [Skotlex]
+	* Added clif_ParseAdoptRequest which does the basic adoption handling. More
+	  checks and the reply packets still need to be coded in. [Skotlex]
+	* Happy State and TK stances won't dispel on death now. [Skotlex]
 	* Cleaned up combo-skill implementation, SC_COMBO is automatically ended in
 	  skill_check_condition now. [Skotlex]
 	* Modified TK-ranker infinite combos to behave as described by AuronX.

+ 39 - 3
src/map/clif.c

@@ -5822,6 +5822,25 @@ int clif_party_main_info(struct party *p, int fd)
 	return 1;
 }
 
+int clif_party_join_info(struct party *p, struct map_session_data *sd)
+{
+	unsigned char buf[96];
+	WBUFW(buf,0)=0x1e9;
+	WBUFL(buf,2)= sd->status.account_id;
+	WBUFL(buf,6)= 0; //Apparently setting this to 1 makes you adoptable.
+	WBUFW(buf,10)=sd->bl.x;
+	WBUFW(buf,12)=sd->bl.y;
+	WBUFB(buf,14)=0; //Uncomfirmed byte.
+	memcpy(WBUFP(buf,15), p->name, NAME_LENGTH);
+	memcpy(WBUFP(buf,39), sd->status.name, NAME_LENGTH);
+	memcpy(WBUFP(buf,63), mapindex_id2name(sd->mapindex), MAP_NAME_LENGTH);
+	WBUFB(buf,79) = (p->item&1)?1:0;
+	WBUFB(buf,80) = (p->item&2)?1:0;
+	clif_send(buf,packet_len_table[0x1e9],&sd->bl,PARTY_WOS);
+	return 1;
+}
+
+
 /*==========================================
  * パーティ情報送信
  *------------------------------------------
@@ -6041,8 +6060,8 @@ int clif_party_hp(struct map_session_data *sd)
 
 	WBUFW(buf,0)=0x106;
 	WBUFL(buf,2)=sd->status.account_id;
-	WBUFW(buf,6)=(sd->status.hp > 0x7fff)? 0x7fff:sd->status.hp;
-	WBUFW(buf,8)=(sd->status.max_hp > 0x7fff)? 0x7fff:sd->status.max_hp;
+	WBUFW(buf,6)=(sd->status.hp > SHRT_MAX)?SHRT_MAX:sd->status.hp;
+	WBUFW(buf,8)=(sd->status.max_hp > SHRT_MAX)?SHRT_MAX:sd->status.max_hp;
 	clif_send(buf,packet_len_table[0x106],&sd->bl,PARTY_AREA_WOS);
 	return 0;
 }
@@ -11269,6 +11288,23 @@ void clif_parse_ReqFeel(int fd, struct map_session_data *sd, int skilllv) {
 	sd->menuskill_lv=skilllv;
 }
 
+void clif_parse_AdoptRequest(int fd,struct map_session_data *sd) {
+	//TODO: add somewhere the adopt code, checks for exploits, etc, etc.
+	//Missing packets are the client's reply packets to the adopt request one. 
+	//[Skotlex]
+	int account_id;
+	struct map_session_data *sd2;
+	RFIFOHEAD(fd);
+	
+	account_id = RFIFOL(fd,2);
+	sd2 = map_id2sd(account_id);
+	if(sd2 && sd2->fd && sd2 != sd && sd2->status.party_id == sd->status.party_id) {	//FIXME: No checks whatsoever are in place yet!
+		fd = sd2->fd;
+		WFIFOHEAD(fd,packet_len_table[0x1f9]);
+		WFIFOW(fd,0)=0x1f9;
+		WFIFOSET(fd, packet_len_table[0x1f9]);
+	}
+}
 /*==========================================
  * パケットデバッグ
  *------------------------------------------
@@ -11645,8 +11681,8 @@ static int packetdb_readdb(void)
 		{clif_parse_Taekwon,"taekwon"},
 		{clif_parse_RankingPk,"rankingpk"},
 		{clif_parse_FeelSaveOk,"feelsaveok"},
+		{clif_parse_AdoptRequest,"adopt"},
 		{clif_parse_debug,"debug"},
-
 		{NULL,NULL}
 	};
 

+ 1 - 0
src/map/clif.h

@@ -234,6 +234,7 @@ int clif_movetoattack(struct map_session_data *sd,struct block_list *bl);
 // party
 int clif_party_created(struct map_session_data *sd,int flag);
 int clif_party_main_info(struct party *p, int fd);
+int clif_party_join_info(struct party *p, struct map_session_data *sd);
 int clif_party_info(struct party *p,int fd);
 int clif_party_invite(struct map_session_data *sd,struct map_session_data *tsd);
 int clif_party_inviteack(struct map_session_data *sd,char *nick,int flag);

+ 18 - 13
src/map/party.c

@@ -278,7 +278,7 @@ int party_reply_invite(struct map_session_data *sd,int account_id,int flag)
 int party_member_added(int party_id,int account_id,int char_id, int flag)
 {
 	struct map_session_data *sd = map_id2sd(account_id),*sd2;
-	
+	struct party *p = party_search(party_id);
 	if(sd == NULL || sd->status.char_id != char_id){
 		if (flag == 0) {
 			if(battle_config.error_log)
@@ -287,23 +287,28 @@ int party_member_added(int party_id,int account_id,int char_id, int flag)
 		}
 		return 0;
 	}
-	
 	sd->party_invite=0;
 	sd->party_invite_account=0;
-	
+
+	if (!p) {
+		if(battle_config.error_log)
+			ShowError("party_member_added: party %d not found.\n",party_id);
+		intif_party_leave(party_id,account_id,char_id);
+		return 0;
+	}
+
 	sd2=map_id2sd(sd->party_invite_account);
+	if(!flag) {
+		sd->state.party_sent=0;
+		sd->status.party_id=party_id;
+		party_check_conflict(sd);
+		clif_party_join_info(p,sd);
+		clif_charnameupdate(sd); //Update char name's display [Skotlex]
+		clif_party_hp(sd);
+		clif_party_xy(sd);
+	}
 	if (sd2)
 		clif_party_inviteack(sd2,sd->status.name,flag?2:0);
-	if(flag)
-		return 0;
-	
-	sd->state.party_sent=0;
-	sd->status.party_id=party_id;
-
-	party_check_conflict(sd);
-	clif_charnameupdate(sd); //Update char name's display [Skotlex]
-	clif_party_hp(sd);
-	clif_party_xy(sd);
 	return 0;
 }
 // ƒp�[ƒeƒB�œ–¼—v‹�

+ 23 - 23
src/map/skill.c

@@ -2924,12 +2924,12 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl,int s
 	case SL_STIN:
 	case SL_STUN:
 	case SL_SMA:
-		if (sd && !battle_config.allow_es_magic_pc && bl->type != BL_MOB) {
-			status_change_start(src,SC_STUN,10000,skilllv,0,0,0,500,10);
+		if (sd && !battle_config.allow_es_magic_pc && bl->type != BL_MOB)
 			clif_skill_fail(sd,skillid,0,0);
-			break;
-		}
-		skill_attack(BF_MAGIC,src,src,bl,skillid,skilllv,tick,flag);
+		else
+			skill_attack(BF_MAGIC,src,src,bl,skillid,skilllv,tick,flag);
+				status_change_start(src,SC_STUN,10000,skilllv,0,0,0,500,10);
+		status_change_start(src,SC_STUN,10000,skilllv,0,0,0,500,10);
 		break;
 		
 	/* ‚»‚Ì‘¼ */
@@ -5389,36 +5389,36 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
 		break;
 
 	case SL_SKA: // [marquis007]
-		if (sd && !battle_config.allow_es_magic_pc && bl->type != BL_MOB) {
-			status_change_start(src,SC_STUN,10000,skilllv,0,0,0,500,10);
+		if (sd && !battle_config.allow_es_magic_pc && bl->type != BL_MOB)
 			clif_skill_fail(sd,skillid,0,0);
-			break;
-		}
-		clif_skill_nodamage(src,bl,skillid,skilllv,
-			sc_start(bl,type,100,skilllv,skill_get_time(skillid,skilllv)));
+		else
+			clif_skill_nodamage(src,bl,skillid,skilllv,
+				sc_start(bl,type,100,skilllv,skill_get_time(skillid,skilllv)));
+		//Stun happens regardless.
+		status_change_start(src,SC_STUN,10000,skilllv,0,0,0,500,10);
 		break;
+		
 	case SL_SWOO:
 		if (sd && (
 			(!battle_config.allow_es_magic_pc && bl->type != BL_MOB) ||
 			(tsc && tsc->data[type].timer != -1)
-		)) {
-			status_change_start(src,SC_STUN,10000,skilllv,0,0,0,500,10);
+		))
 			clif_skill_fail(sd,skillid,0,0);
-			break;
-		}
-		clif_skill_nodamage(src,bl,skillid,skilllv,
-			sc_start(bl,type,100,skilllv,skill_get_time(skillid,skilllv)));
+		else
+			clif_skill_nodamage(src,bl,skillid,skilllv,
+				sc_start(bl,type,100,skilllv,skill_get_time(skillid,skilllv)));
+			status_change_start(src,SC_STUN,10000,skilllv,0,0,0,500,10);
 		break;
 
 	case SL_SKE:
-		if (sd && !battle_config.allow_es_magic_pc && bl->type != BL_MOB) {
-			status_change_start(src,SC_STUN,10000,skilllv,0,0,0,500,10);
+		if (sd && !battle_config.allow_es_magic_pc && bl->type != BL_MOB)
 			clif_skill_fail(sd,skillid,0,0);
-			break;
+		else {
+			clif_skill_nodamage(src,bl,skillid,skilllv,
+				sc_start(bl,type,100,skilllv,skill_get_time(skillid,skilllv)));
+			sc_start(src,SC_SMA,100,skilllv,skill_get_time(SL_SMA,skilllv));
 		}
-		clif_skill_nodamage(src,bl,skillid,skilllv,
-			sc_start(bl,type,100,skilllv,skill_get_time(skillid,skilllv)));
-		sc_start(src,SC_SMA,100,skilllv,skill_get_time(SL_SMA,skilllv));
+		status_change_start(src,SC_STUN,10000,skilllv,0,0,0,500,10);
 		break;
 		
 	// New guild skills [Celest]

+ 6 - 4
src/map/status.c

@@ -4851,11 +4851,13 @@ int status_change_clear(struct block_list *bl,int type)
 		return 0;
 	for(i = 0; i < SC_MAX; i++)
 	{
-		//Type 0: PC killed -> EDP and Meltdown must not be dispelled. [Skotlex]
-		// Do not reset Xmas status when killed. [Valaris]
+		//Type 0: PC killed -> Place here stats that do not dispel on death.
 		if(sc->data[i].timer == -1 ||
-			(type == 0 &&
-			(i == SC_EDP || i == SC_MELTDOWN || i == SC_XMAS || i == SC_NOCHAT || i == SC_FUSION || i == SC_TKREST)))
+			(type == 0 && (
+				i == SC_EDP || i == SC_MELTDOWN || i == SC_XMAS || i == SC_NOCHAT ||
+				i == SC_FUSION || i == SC_TKREST || i == SC_READYSTORM ||
+			  	i == SC_READYDOWN || i == SC_READYCOUNTER || i == SC_READYTURN
+			)))
 			continue;
 
 		status_change_end(bl, i, -1);