From 75dd1d62bb3b48d45fd61090ad7c74dc67d5296c Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Sun, 24 Jun 2012 17:36:34 -0700 Subject: Add @doomspot command. --- src/map/atcommand.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'src/map/atcommand.c') diff --git a/src/map/atcommand.c b/src/map/atcommand.c index 3c54d5e..3106244 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -211,6 +211,7 @@ ATCOMMAND_FUNC (skillpool_unfocus); // [Fate] ATCOMMAND_FUNC (skill_learn); // [Fate] ATCOMMAND_FUNC (wgm); ATCOMMAND_FUNC (ipcheck); +ATCOMMAND_FUNC (doomspot); /*========================================== *AtCommandInfo atcommand_info[]構造体の定義 @@ -409,6 +410,7 @@ static AtCommandInfo atcommand_info[] = { {AtCommand_IterateBackward, "@skill-learn", 80, atcommand_skill_learn}, // [Fate] {AtCommand_Wgm, "@wgm", 0, atcommand_wgm}, {AtCommand_IpCheck, "@ipcheck", 60, atcommand_ipcheck}, + {AtCommand_DoomSpot, "@doomspot", 60, atcommand_doomspot}, // add new commands before this line {AtCommand_Unknown, NULL, 1, NULL} @@ -8700,3 +8702,25 @@ int atcommand_ipcheck (const int fd, struct map_session_data *sd, clif_displaymessage (fd, "End of list"); return 0; } + +int atcommand_doomspot(const int fd, struct map_session_data *sd, + const char *command, const char *message) +{ + struct map_session_data *pl_sd; + int i; + + for (i = 0; i < fd_max; i++) + { + if (session[i] && (pl_sd = (struct map_session_data *)session[i]->session_data) + && pl_sd->state.auth && i != fd && sd->bl.m == pl_sd->bl.m + && sd->bl.x == pl_sd->bl.x && sd->bl.y == pl_sd->bl.y + && pc_isGM (sd) >= pc_isGM (pl_sd)) + { // you can doom only lower or same gm level + pc_damage (NULL, pl_sd, pl_sd->status.hp + 1); + clif_displaymessage (pl_sd->fd, msg_table[61]); // The holy messenger has given judgement. + } + } + clif_displaymessage (fd, msg_table[62]); // Judgement was made. + + return 0; +} -- cgit v1.2.3-60-g2f50