From e78ae404f9c404a84b71b6eec8f5e8ff4ac6bab5 Mon Sep 17 00:00:00 2001 From: skotlex Date: Mon, 8 May 2006 20:53:46 +0000 Subject: [PATCH] - 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 --- Changelog-Trunk.txt | 9 +++++++++ src/map/clif.c | 42 ++++++++++++++++++++++++++++++++++++++--- src/map/clif.h | 1 + src/map/party.c | 31 +++++++++++++++++------------- src/map/skill.c | 46 ++++++++++++++++++++++----------------------- src/map/status.c | 10 ++++++---- 6 files changed, 96 insertions(+), 43 deletions(-) diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt index 44cda45c23..b7b40f8e7b 100644 --- a/Changelog-Trunk.txt +++ b/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. diff --git a/src/map/clif.c b/src/map/clif.c index 6f3cfb95a4..937cc17b90 100644 --- a/src/map/clif.c +++ b/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} }; diff --git a/src/map/clif.h b/src/map/clif.h index d96714b578..387f5f3c8f 100644 --- a/src/map/clif.h +++ b/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); diff --git a/src/map/party.c b/src/map/party.c index 601c49c188..8ee9f715d5 100644 --- a/src/map/party.c +++ b/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; } // パーティ除名要求 diff --git a/src/map/skill.c b/src/map/skill.c index 1883691a02..534b5f3051 100644 --- a/src/map/skill.c +++ b/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] diff --git a/src/map/status.c b/src/map/status.c index 74b7422d7c..3a3cf53517 100644 --- a/src/map/status.c +++ b/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);