diff options
-rw-r--r-- | Changelog-Trunk.txt | 2 | ||||
-rw-r--r-- | conf/Changelog.txt | 2 | ||||
-rw-r--r-- | conf/battle/gm.conf | 4 | ||||
-rw-r--r-- | src/map/battle.c | 1 | ||||
-rw-r--r-- | src/map/battle.h | 1 | ||||
-rw-r--r-- | src/map/clif.c | 67 |
6 files changed, 71 insertions, 6 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt index a45a41649..0824bc005 100644 --- a/Changelog-Trunk.txt +++ b/Changelog-Trunk.txt @@ -1,5 +1,7 @@ Date Added +2011/02/15 + * Added support for client GM command /check (related r12076). [Ai4rei] 2011/02/14 * Fixed drop list of map flag 'pvp_nightmaredrop' not getting cleared upon @reloadscript (bugreport:4282, follow up to r14668). [Ai4rei] * Fixed GMs with GM level equal to 'lowest_gm_level' being treated as normal players in 'gm_can_party' check (bugreport:4162, since r13143). [Ai4rei] diff --git a/conf/Changelog.txt b/conf/Changelog.txt index 219621ce6..78b261c0f 100644 --- a/conf/Changelog.txt +++ b/conf/Changelog.txt @@ -1,5 +1,7 @@ Date Added +2011/02/15 + * Rev. 14707 Added map-server battle setting 'gm_check_minlevel'. [Ai4rei] 2011/02/06 * Rev. 14700 Added char-server setting 'char_del_delay'. [Ai4rei] 2011/01/13 diff --git a/conf/battle/gm.conf b/conf/battle/gm.conf index 5f15d2321..21b54f386 100644 --- a/conf/battle/gm.conf +++ b/conf/battle/gm.conf @@ -116,3 +116,7 @@ title_lvl5: 50 title_lvl6: 60 title_lvl7: 80 title_lvl8: 99 + +// Minimum GM level required for client command /check (display character status) to work. +// Default: 60 +gm_check_minlevel: 60 diff --git a/src/map/battle.c b/src/map/battle.c index 3e58c1209..fd9bc90d6 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -4006,6 +4006,7 @@ static const struct _battle_data { { "autospell_check_range", &battle_config.autospell_check_range, 0, 0, 1, }, { "client_reshuffle_dice", &battle_config.client_reshuffle_dice, 0, 0, 1, }, { "client_sort_storage", &battle_config.client_sort_storage, 0, 0, 1, }, + { "gm_check_minlevel", &battle_config.gm_check_minlevel, 60, 0, 100, }, // BattleGround Settings { "bg_update_interval", &battle_config.bg_update_interval, 1000, 100, INT_MAX, }, { "bg_short_attack_damage_rate", &battle_config.bg_short_damage_rate, 80, 0, INT_MAX, }, diff --git a/src/map/battle.h b/src/map/battle.h index 3abc6b0a4..a3e35bcee 100644 --- a/src/map/battle.h +++ b/src/map/battle.h @@ -480,6 +480,7 @@ extern struct Battle_Config int autospell_check_range; //Enable range check for autospell bonus. [L0ne_W0lf] int client_reshuffle_dice; // Reshuffle /dice int client_sort_storage; + int gm_check_minlevel; // min GM level for /check // [BattleGround Settings] int bg_update_interval; 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 |