summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec>2010-12-25 01:40:35 +0000
committerai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec>2010-12-25 01:40:35 +0000
commitc8ff72c09f9c763912d7c1d953638b5f32cb40aa (patch)
tree1fdd119d878b1c62ac050b6472b51e72abc3fb88
parent75e1895d3ffa6dfbd29c16d613995af7d6917385 (diff)
downloadhercules-c8ff72c09f9c763912d7c1d953638b5f32cb40aa.tar.gz
hercules-c8ff72c09f9c763912d7c1d953638b5f32cb40aa.tar.bz2
hercules-c8ff72c09f9c763912d7c1d953638b5f32cb40aa.tar.xz
hercules-c8ff72c09f9c763912d7c1d953638b5f32cb40aa.zip
* Added support for new /remove and /recall packets for 2010-08-03aRagexeRE and newer.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14620 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--Changelog-Trunk.txt1
-rw-r--r--db/packet_db.txt4
-rw-r--r--src/map/clif.c82
-rw-r--r--src/map/pc.c39
-rw-r--r--src/map/pc.h2
5 files changed, 124 insertions, 4 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index 284117e1a..c8c737c0c 100644
--- a/Changelog-Trunk.txt
+++ b/Changelog-Trunk.txt
@@ -1,6 +1,7 @@
Date Added
2010/12/24
+ * Added support for new /remove and /recall packets for 2010-08-03aRagexeRE and newer. [Ai4rei]
* Synchronized TXT/SQL char-server code a bit. [Ai4rei]
* Fixes to char-server. [Ai4rei]
- Removed unnecessary #includes from TXT and synchronized them with SQL.
diff --git a/db/packet_db.txt b/db/packet_db.txt
index 722ccc646..f18eed246 100644
--- a/db/packet_db.txt
+++ b/db/packet_db.txt
@@ -1582,5 +1582,9 @@ packet_ver: 25
//2010-07-14aRagexeRE
//0x841,4
+//2010-08-03aRagexeRE
+0x0842,6,recall2,2
+0x0843,6,remove2,2
+
//Add new packets here
//packet_ver: 26
diff --git a/src/map/clif.c b/src/map/clif.c
index 0765b8665..14b7aa16e 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -11391,10 +11391,11 @@ void clif_parse_GMKickAll(int fd, struct map_session_data* sd)
}
/*==========================================
- * /shift <name>
+ * /remove <account name>
+ * /shift <char name>
*------------------------------------------*/
void clif_parse_GMShift(int fd, struct map_session_data *sd)
-{
+{// FIXME: remove is supposed to receive account name for clients prior 20100803RE
char *player_name;
int lv;
@@ -11413,11 +11414,47 @@ void clif_parse_GMShift(int fd, struct map_session_data *sd)
}
}
+
+/// Warps oneself to the location of the character given by account id ( /remove <account id> ).
+/// R 0843 <account id>.L
+void clif_parse_GMRemove2(int fd, struct map_session_data* sd)
+{
+ int account_id, lv;
+ struct map_session_data* pl_sd;
+
+ if( battle_config.atc_gmonly && !pc_isGM(sd) )
+ {
+ return;
+ }
+
+ if( pc_isGM(sd) < ( lv = get_atcommand_level(atcommand_jumpto) ) )
+ {
+ return;
+ }
+
+ account_id = RFIFOL(fd,packet_db[sd->packet_ver][RFIFOW(fd,0)].pos[0]);
+
+ if( ( pl_sd = map_id2sd(account_id) ) != NULL && pc_isGM(sd) >= pc_isGM(pl_sd) )
+ {
+ pc_warpto(sd, pl_sd);
+ }
+
+ if( log_config.gm && lv >= log_config.gm )
+ {
+ char message[32];
+
+ sprintf(message, "/remove %d", account_id);
+ log_atcommand(sd, message);
+ }
+}
+
+
/*==========================================
- * /recall <name>
+ * /recall <account name>
+ * /summon <char name>
*------------------------------------------*/
void clif_parse_GMRecall(int fd, struct map_session_data *sd)
-{
+{// FIXME: recall is supposed to receive account name for clients prior 20100803RE
char *player_name;
int lv;
@@ -11437,6 +11474,41 @@ void clif_parse_GMRecall(int fd, struct map_session_data *sd)
}
}
+
+/// Summons a character given by account id to one's own position ( /recall <account id> )
+/// R 0842 <account id>.L
+void clif_parse_GMRecall2(int fd, struct map_session_data* sd)
+{
+ int account_id, lv;
+ struct map_session_data* pl_sd;
+
+ if( battle_config.atc_gmonly && !pc_isGM(sd) )
+ {
+ return;
+ }
+
+ if( pc_isGM(sd) < ( lv = get_atcommand_level(atcommand_recall) ) )
+ {
+ return;
+ }
+
+ account_id = RFIFOL(fd,packet_db[sd->packet_ver][RFIFOW(fd,0)].pos[0]);
+
+ if( ( pl_sd = map_id2sd(account_id) ) != NULL && pc_isGM(sd) >= pc_isGM(pl_sd) )
+ {
+ pc_recall(sd, pl_sd);
+ }
+
+ if( log_config.gm && lv >= log_config.gm )
+ {
+ char message[32];
+
+ sprintf(message, "/recall %d", account_id);
+ log_atcommand(sd, message);
+ }
+}
+
+
/*==========================================
* /monster /item
* R 01F3 <name>.24B
@@ -14444,6 +14516,8 @@ static int packetdb_readdb(void)
{clif_parse_GMShift,"shift"},
{clif_parse_GMChangeMapType,"changemaptype"},
{clif_parse_GMRc,"rc"},
+ {clif_parse_GMRecall2,"recall2"},
+ {clif_parse_GMRemove2,"remove2"},
{clif_parse_NoviceDoriDori,"sndoridori"},
{clif_parse_NoviceExplosionSpirits,"snexplosionspirits"},
diff --git a/src/map/pc.c b/src/map/pc.c
index 45064794b..b22a365e0 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -4239,6 +4239,45 @@ int pc_randomwarp(struct map_session_data *sd, clr_type type)
return 0;
}
+
+/// Warps one player to another.
+/// @param sd player to warp.
+/// @param pl_sd player to warp to.
+int pc_warpto(struct map_session_data* sd, struct map_session_data* pl_sd)
+{
+ if( map[sd->bl.m].flag.nowarp && battle_config.any_warp_GM_min_level > pc_isGM(sd) )
+ {
+ return -2;
+ }
+
+ if( map[pl_sd->bl.m].flag.nowarpto && battle_config.any_warp_GM_min_level > pc_isGM(sd) )
+ {
+ return -3;
+ }
+
+ return pc_setpos(sd, pl_sd->mapindex, pl_sd->bl.x, pl_sd->bl.y, CLR_TELEPORT);
+}
+
+
+/// Recalls one player to another.
+/// @param sd player to warp to.
+/// @param pl_sd player to warp.
+int pc_recall(struct map_session_data* sd, struct map_session_data* pl_sd)
+{
+ if( map[pl_sd->bl.m].flag.nowarp && battle_config.any_warp_GM_min_level > pc_isGM(sd) )
+ {
+ return -2;
+ }
+
+ if( map[sd->bl.m].flag.nowarpto && battle_config.any_warp_GM_min_level > pc_isGM(sd) )
+ {
+ return -3;
+ }
+
+ return pc_setpos(pl_sd, sd->mapindex, sd->bl.x, sd->bl.y, CLR_RESPAWN);
+}
+
+
/*==========================================
* Records a memo point at sd's current position
* pos - entry to replace, (-1: shift oldest entry out)
diff --git a/src/map/pc.h b/src/map/pc.h
index 9a28a30ee..2921b4527 100644
--- a/src/map/pc.h
+++ b/src/map/pc.h
@@ -572,6 +572,8 @@ int pc_clean_skilltree(struct map_session_data *sd);
int pc_setpos(struct map_session_data* sd, unsigned short mapindex, int x, int y, clr_type clrtype);
int pc_setsavepoint(struct map_session_data*,short,int,int);
int pc_randomwarp(struct map_session_data *sd,clr_type type);
+int pc_warpto(struct map_session_data* sd, struct map_session_data* pl_sd);
+int pc_recall(struct map_session_data* sd, struct map_session_data* pl_sd);
int pc_memo(struct map_session_data* sd, int pos);
int pc_checkadditem(struct map_session_data*,int,int);