summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-05-08 20:53:46 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-05-08 20:53:46 +0000
commitf673ec583e417b7df360edd69baf51add58aa36b (patch)
tree6a9d75451962d3189da7233cfc17f116dc2b2ed4 /src
parentbeed8d2c43cd2d0c9426bfd0a7fa4bfbcffe47e2 (diff)
downloadhercules-f673ec583e417b7df360edd69baf51add58aa36b.tar.gz
hercules-f673ec583e417b7df360edd69baf51add58aa36b.tar.bz2
hercules-f673ec583e417b7df360edd69baf51add58aa36b.tar.xz
hercules-f673ec583e417b7df360edd69baf51add58aa36b.zip
- 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://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6521 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r--src/map/clif.c42
-rw-r--r--src/map/clif.h1
-rw-r--r--src/map/party.c31
-rw-r--r--src/map/skill.c46
-rw-r--r--src/map/status.c10
5 files changed, 87 insertions, 43 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index 6f3cfb95a..937cc17b9 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 d96714b57..387f5f3c8 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 601c49c18..8ee9f715d 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 1883691a0..534b5f305 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 74b7422d7..3a3cf5351 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);