diff options
author | ai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2011-02-15 11:47:31 +0000 |
---|---|---|
committer | ai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2011-02-15 11:47:31 +0000 |
commit | 4f038aab87c99e34322e7cff82757bfd6c1a4b93 (patch) | |
tree | 314e1f0b04c3807b1af7bb7a4378a892c39b2ef2 /src/map/clif.c | |
parent | 80261bf3feceb87f5725dc93c838930d3eb2f407 (diff) | |
download | hercules-4f038aab87c99e34322e7cff82757bfd6c1a4b93.tar.gz hercules-4f038aab87c99e34322e7cff82757bfd6c1a4b93.tar.bz2 hercules-4f038aab87c99e34322e7cff82757bfd6c1a4b93.tar.xz hercules-4f038aab87c99e34322e7cff82757bfd6c1a4b93.zip |
* Added support for client GM command /check (related r12076).
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14707 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/clif.c')
-rw-r--r-- | src/map/clif.c | 67 |
1 files changed, 61 insertions, 6 deletions
diff --git a/src/map/clif.c b/src/map/clif.c index c8d0ad32d..59693d235 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -11842,9 +11842,6 @@ void clif_parse_NoviceExplosionSpirits(int fd, struct map_session_data *sd) return; } -// random notes: -// 0x214: monster/player info ? - /*========================================== * Friends List *------------------------------------------*/ @@ -12353,11 +12350,69 @@ void clif_parse_AutoRevive(int fd, struct map_session_data *sd) pc_delitem(sd, item_position, 1, 0, 1); } -/// /check <string> -/// S 0213 <string>.24B + +/// Information about character's status values (ZC_ACK_STATUS_GM) +/// 0214 <str>.B <standardStr>.B <agi>.B <standardAgi>.B <vit>.B <standardVit>.B +/// <int>.B <standardInt>.B <dex>.B <standardDex>.B <luk>.B <standardLuk>.B +/// <attPower>.W <refiningPower>.W <max_mattPower>.W <min_mattPower>.W +/// <itemdefPower>.W <plusdefPower>.W <mdefPower>.W <plusmdefPower>.W +/// <hitSuccessValue>.W <avoidSuccessValue>.W <plusAvoidSuccessValue>.W +/// <criticalSuccessValue>.W <ASPD>.W <plusASPD>.W +void clif_check(int fd, struct map_session_data* pl_sd) +{ + WFIFOHEAD(fd,packet_len(0x214)); + WFIFOW(fd, 0) = 0x214; + WFIFOB(fd, 2) = min(pl_sd->status.str, UCHAR_MAX); + WFIFOB(fd, 3) = pc_need_status_point(pl_sd, SP_STR); + WFIFOB(fd, 4) = min(pl_sd->status.agi, UCHAR_MAX); + WFIFOB(fd, 5) = pc_need_status_point(pl_sd, SP_AGI); + WFIFOB(fd, 6) = min(pl_sd->status.vit, UCHAR_MAX); + WFIFOB(fd, 7) = pc_need_status_point(pl_sd, SP_VIT); + WFIFOB(fd, 8) = min(pl_sd->status.int_, UCHAR_MAX); + WFIFOB(fd, 9) = pc_need_status_point(pl_sd, SP_INT); + WFIFOB(fd,10) = min(pl_sd->status.dex, UCHAR_MAX); + WFIFOB(fd,11) = pc_need_status_point(pl_sd, SP_DEX); + WFIFOB(fd,12) = min(pl_sd->status.luk, UCHAR_MAX); + WFIFOB(fd,13) = pc_need_status_point(pl_sd, SP_LUK); + WFIFOW(fd,14) = pl_sd->battle_status.batk+pl_sd->battle_status.rhw.atk+pl_sd->battle_status.lhw.atk; + WFIFOW(fd,16) = pl_sd->battle_status.rhw.atk2+pl_sd->battle_status.lhw.atk2; + WFIFOW(fd,18) = pl_sd->battle_status.matk_max; + WFIFOW(fd,20) = pl_sd->battle_status.matk_min; + WFIFOW(fd,22) = pl_sd->battle_status.def; + WFIFOW(fd,24) = pl_sd->battle_status.def2; + WFIFOW(fd,26) = pl_sd->battle_status.mdef; + WFIFOW(fd,28) = pl_sd->battle_status.mdef2; + WFIFOW(fd,30) = pl_sd->battle_status.hit; + WFIFOW(fd,32) = pl_sd->battle_status.flee; + WFIFOW(fd,34) = pl_sd->battle_status.flee2/10; + WFIFOW(fd,36) = pl_sd->battle_status.cri/10; + WFIFOW(fd,38) = (2000-pl_sd->battle_status.amotion)/10; // aspd + WFIFOW(fd,40) = 0; // FIXME: What is 'plusASPD' supposed to be? + WFIFOSET(fd,packet_len(0x214)); +} + + +/// Request character's status values (CZ_REQ_STATUS_GM) +/// /check <char name> +/// 0213 <char name>.24B void clif_parse_Check(int fd, struct map_session_data *sd) { - // no info + char charname[NAME_LENGTH]; + struct map_session_data* pl_sd; + + if( pc_isGM(sd) < battle_config.gm_check_minlevel ) + { + return; + } + + safestrncpy(charname, (const char*)RFIFOP(fd,packet_db[sd->packet_ver][RFIFOW(fd,0)].pos[0]), sizeof(charname)); + + if( ( pl_sd = map_nick2sd(charname) ) == NULL || pc_isGM(sd) < pc_isGM(pl_sd) ) + { + return; + } + + clif_check(fd, pl_sd); } #ifndef TXT_ONLY |