diff options
author | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2007-09-07 07:31:58 +0000 |
---|---|---|
committer | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2007-09-07 07:31:58 +0000 |
commit | bbedfd67468dc5105169fc114a54d30ae1a36f23 (patch) | |
tree | 7dd6639299a0a4ec315b2e40db2c0a59989fb415 | |
parent | b713afa8b0b482ff4a4f13cef138b430dee1767b (diff) | |
download | hercules-bbedfd67468dc5105169fc114a54d30ae1a36f23.tar.gz hercules-bbedfd67468dc5105169fc114a54d30ae1a36f23.tar.bz2 hercules-bbedfd67468dc5105169fc114a54d30ae1a36f23.tar.xz hercules-bbedfd67468dc5105169fc114a54d30ae1a36f23.zip |
- Added support for the new party invite/reply packets from the latest client version.
- Cleared up some TODO's
- Added auto-rejecting party/guild invites when the target is disconnected from the server.
- Added a correction in the walking code to abort it when map_moveblock cancels the player's walking (by warping/knocking back),the default code would fail because unit_stopwalking would do nothing since the walk timer was already -1 in that moment.
- Corrected mob_randomwalk to use unsigned int for the tick variable.
- Changed the default @Main format to prevent crashes in the newer clients.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11134 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r-- | Changelog-Trunk.txt | 7 | ||||
-rw-r--r-- | conf-tmpl/msg_athena.conf | 2 | ||||
-rw-r--r-- | db/packet_db.txt | 2 | ||||
-rw-r--r-- | src/map/clif.c | 34 | ||||
-rw-r--r-- | src/map/guild.c | 6 | ||||
-rw-r--r-- | src/map/mob.c | 2 | ||||
-rw-r--r-- | src/map/mob.h | 2 | ||||
-rw-r--r-- | src/map/party.c | 5 | ||||
-rw-r--r-- | src/map/script.c | 6 | ||||
-rw-r--r-- | src/map/unit.c | 3 |
10 files changed, 63 insertions, 6 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt index 0859dc6ae..fa646f2da 100644 --- a/Changelog-Trunk.txt +++ b/Changelog-Trunk.txt @@ -3,6 +3,13 @@ Date Added AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO INTO TRUNK. IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK. +2007/09/07 + * Added support for the new party invite/reply packets from the latest + client version. + * Added auto-rejecting party/guild invites when the target is disconnected + from the server. + * Changed the default @Main format to prevent crashes in the newer + clients. 2007/09/04 * bonus3 autospell (and autospell when hit) will now select for spell target self when the skill is tagged a support skill. diff --git a/conf-tmpl/msg_athena.conf b/conf-tmpl/msg_athena.conf index 99197d6c9..88967c26a 100644 --- a/conf-tmpl/msg_athena.conf +++ b/conf-tmpl/msg_athena.conf @@ -390,7 +390,7 @@ 383: Main chat already disabled. 384: Main chat is currently enabled. Usage: @main <on|off>, @main <message>. 385: Main chat is currently disabled. Usage: @main <on|off>, @main <message>. -386: Main@%s: %s +386: Main@%s : %s 387: You cannot use Main chat while muted. 388: You should enable main chat with "@main on" command. //NoAsk diff --git a/db/packet_db.txt b/db/packet_db.txt index 9a06f6806..e4753e551 100644 --- a/db/packet_db.txt +++ b/db/packet_db.txt @@ -1017,6 +1017,8 @@ packet_ver: 22 0x02ba,11,hotkey,2:4:5:9 0x02bb,8 0x02bc,6 +0x02c4,26,partyinvite2,2 +0x02c7,7,replypartyinvite2,2,6 //Add new packets here //packet_ver: 23 diff --git a/src/map/clif.c b/src/map/clif.c index 8af8de5d8..16b6f19f0 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -10105,6 +10105,28 @@ void clif_parse_PartyInvite(int fd, struct map_session_data *sd) party_invite(sd, t_sd); } +void clif_parse_PartyInvite2(int fd, struct map_session_data *sd) +{ + struct map_session_data *t_sd; + char *name = RFIFOP(fd,2); + name[NAME_LENGTH]='\0'; + + if(map[sd->bl.m].flag.partylock) + { //Guild locked. + clif_displaymessage(fd, msg_txt(227)); + return; + } + + t_sd = map_nick2sd(name); + + // @noask [LuzZza] + if(t_sd && t_sd->state.noask) { + clif_noask_sub(sd, t_sd, 1); + return; + } + + party_invite(sd, t_sd); +} /*========================================== * パーティ勧誘返答 *------------------------------------------*/ @@ -10118,6 +10140,16 @@ void clif_parse_ReplyPartyInvite(int fd,struct map_session_data *sd) } } +void clif_parse_ReplyPartyInvite2(int fd,struct map_session_data *sd) +{ + if(battle_config.basic_skill_check == 0 || pc_checkskill(sd,NV_BASIC) >= 5){ + party_reply_invite(sd,RFIFOL(fd,2),RFIFOB(fd,6)); + } else { + party_reply_invite(sd,RFIFOL(fd,2),-1); + clif_skill_fail(sd,1,0,4); + } +} + /*========================================== * パーティ脱退要求 *------------------------------------------*/ @@ -11820,7 +11852,9 @@ static int packetdb_readdb(void) {clif_parse_CreateParty,"createparty"}, {clif_parse_CreateParty2,"createparty2"}, {clif_parse_PartyInvite,"partyinvite"}, + {clif_parse_PartyInvite2,"partyinvite2"}, {clif_parse_ReplyPartyInvite,"replypartyinvite"}, + {clif_parse_ReplyPartyInvite2,"replypartyinvite2"}, {clif_parse_LeaveParty,"leaveparty"}, {clif_parse_RemovePartyMember,"removepartymember"}, {clif_parse_PartyChangeOption,"partychangeoption"}, diff --git a/src/map/guild.c b/src/map/guild.c index 462f2cd76..a0f894f18 100644 --- a/src/map/guild.c +++ b/src/map/guild.c @@ -648,6 +648,12 @@ int guild_invite(struct map_session_data *sd,struct map_session_data *tsd) return 0; } } + + if (!tsd->fd) { //You can't invite someone who has already disconnected. + clif_guild_inviteack(sd,1); + return 0; + } + if(tsd->status.guild_id>0 || tsd->guild_invite>0 || (agit_flag && map[tsd->bl.m].flag.gvg_castle)) diff --git a/src/map/mob.c b/src/map/mob.c index cd1fe1cc7..c6ab7418e 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -1023,7 +1023,7 @@ int mob_unlocktarget(struct mob_data *md,int tick) /*========================================== * Random walk *------------------------------------------*/ -int mob_randomwalk(struct mob_data *md,int tick) +int mob_randomwalk(struct mob_data *md,unsigned int tick) { const int retrycount=20; int i,x,y,c,d; diff --git a/src/map/mob.h b/src/map/mob.h index e75de3912..93fe8225e 100644 --- a/src/map/mob.h +++ b/src/map/mob.h @@ -162,7 +162,7 @@ int mob_once_spawn_area(struct map_session_data *sd,const char *mapname, int mob_spawn_guardian(const char* mapname, short x, short y, const char* mobname, int class_, const char* event, int guardian); // Spawning Guardians [Valaris] int mob_guardian_guildchange(struct block_list *bl,va_list ap); //Change Guardian's ownership. [Skotlex] -int mob_randomwalk(struct mob_data *md,int tick); +int mob_randomwalk(struct mob_data *md,unsigned int tick); int mob_target(struct mob_data *md,struct block_list *bl,int dist); int mob_unlocktarget(struct mob_data *md,int tick); diff --git a/src/map/party.c b/src/map/party.c index eeb3d5b9a..6ae42a9f1 100644 --- a/src/map/party.c +++ b/src/map/party.c @@ -268,6 +268,11 @@ int party_invite(struct map_session_data *sd,struct map_session_data *tsd) return 0; } } + if (!tsd->fd) { //You can't invite someone who has already disconnected. + clif_party_inviteack(sd,tsd->status.name,1); + return 0; + } + if( tsd->status.party_id>0 || tsd->party_invite>0 ){ clif_party_inviteack(sd,tsd->status.name,0); return 0; diff --git a/src/map/script.c b/src/map/script.c index a98dffe5c..7e36818e9 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -8563,7 +8563,7 @@ BUILDIN_FUNC(sc_start) } if( potion_flag == 1 && potion_target ) - {//##TODO how does this work [FlavioJS] + { //skill.c set the flags before running the script, this must be a potion-pitched effect. bl = map_id2bl(potion_target); tick /= 2;// Thrown potions only last half. val4 = 1;// Mark that this was a thrown sc_effect @@ -8601,7 +8601,7 @@ BUILDIN_FUNC(sc_start2) } if( potion_flag == 1 && potion_target ) - {//##TODO how does this work [FlavioJS] + { //skill.c set the flags before running the script, this must be a potion-pitched effect. bl = map_id2bl(potion_target); tick /= 2;// Thrown potions only last half. val4 = 1;// Mark that this was a thrown sc_effect @@ -8643,7 +8643,7 @@ BUILDIN_FUNC(sc_start4) } if( potion_flag == 1 && potion_target ) - {//##TODO how does this work [FlavioJS] + { //skill.c set the flags before running the script, this must be a potion-pitched effect. bl = map_id2bl(potion_target); tick /= 2;// Thrown potions only last half. } diff --git a/src/map/unit.c b/src/map/unit.c index 05175a991..dc57dfd38 100644 --- a/src/map/unit.c +++ b/src/map/unit.c @@ -156,6 +156,9 @@ static int unit_walktoxy_timer(int tid,unsigned int tick,int id,int data) map_moveblock(bl, x, y, tick); ud->walk_count++; //walked cell counter, to be used for walk-triggered skills. [Skotlex] + if (bl->x != x || bl->y != y || ud->walktimer != -1) + return 0; //map_moveblock has altered the object beyond what we expected (moved/warped it) + ud->walktimer = 1; map_foreachinmovearea(clif_insight, bl, AREA_SIZE, -dx, -dy, sd?BL_ALL:BL_PC, bl); |