summaryrefslogtreecommitdiff
path: root/src/map/clif.c
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/map/clif.c
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/map/clif.c')
-rw-r--r--src/map/clif.c42
1 files changed, 39 insertions, 3 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}
};