From cb1d2d92afbf8d9ebec4c9290a180835ad5dae78 Mon Sep 17 00:00:00 2001 From: skotlex Date: Thu, 3 Aug 2006 14:39:38 +0000 Subject: - Cleaned up the last NJ update code. - Added @ command `charspeed` - Fixed @jailfor using MAP_PRONTERA as jail instead of MAP_JAIL - Removed case for GS_SPREADATTACK on damage packets to see if the skill displays correctly now. - Corrected Deluge/Volcano/V. Gale overlaps so that the placing tiles are removed, NOT the ones who were already placed. - Made SC_SPEEDUP0 and SC_SPEEDUP1 use different icon IDs, to fix icon-confusion when both are enabled at a time. - Mob rude-attacked count is not reset now on picking a new char (gotta investigate this further) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@8096 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/atcommand.c | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 51 insertions(+), 2 deletions(-) (limited to 'src/map/atcommand.c') diff --git a/src/map/atcommand.c b/src/map/atcommand.c index 640fcba90..7fac911d9 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -63,6 +63,7 @@ ACMD_FUNC(happyhappyjoyjoy); // [Valaris] ACMD_FUNC(save); ACMD_FUNC(load); ACMD_FUNC(speed); +ACMD_FUNC(charspeed); ACMD_FUNC(storage); ACMD_FUNC(guildstorage); ACMD_FUNC(option); @@ -338,6 +339,7 @@ static AtCommandInfo atcommand_info[] = { { AtCommand_Load, "@return", 40, atcommand_load }, { AtCommand_Load, "@load", 40, atcommand_load }, { AtCommand_Speed, "@speed", 40, atcommand_speed }, + { AtCommand_CharSpeed, "@charspeed", 40, atcommand_charspeed }, { AtCommand_Storage, "@storage", 1, atcommand_storage }, { AtCommand_GuildStorage, "@gstorage", 50, atcommand_guildstorage }, { AtCommand_Option, "@option", 40, atcommand_option }, @@ -2136,6 +2138,53 @@ int atcommand_speed( return 0; } +/*========================================== + * + *------------------------------------------ + */ +int atcommand_charspeed( + const int fd, struct map_session_data* sd, + const char* command, const char* message) +{ + struct map_session_data *pl_sd; + int speed; + + nullpo_retr(-1, sd); + + memset(atcmd_output, '\0', sizeof(atcmd_output)); + memset(atcmd_player_name, '\0', sizeof(atcmd_player_name)); + + if (!message || !*message || sscanf(message, "%d %23[^\n]", speed, atcmd_player_name) < 2) { + sprintf(atcmd_output, "Please, enter a speed and a player name (usage: @charspeed > ).", MIN_WALK_SPEED, MAX_WALK_SPEED); + clif_displaymessage(fd, atcmd_output); + return -1; + } + + if ((pl_sd = map_nick2sd(atcmd_player_name)) == NULL) { + clif_displaymessage(fd, msg_table[3]); // Character not found. + return -1; + } + + if (pc_isGM(sd) < pc_isGM(pl_sd)) + { //GM level check + clif_displaymessage(fd, msg_table[81]); // Your GM level don't authorise you to do this action on this player. + return -1; + } + + if (speed >= MIN_WALK_SPEED && speed <= MAX_WALK_SPEED) { + pl_sd->base_status.speed = speed; + status_calc_bl(&pl_sd->bl, SCB_SPEED); + clif_displaymessage(fd, msg_table[8]); // Speed changed. + if(pl_sd->fd) + clif_displaymessage(pl_sd->fd, msg_table[8]); // Speed changed. + } else { + sprintf(atcmd_output, "Please, enter a valid speed value (usage: @speed <%d-%d>).", MIN_WALK_SPEED, MAX_WALK_SPEED); + clif_displaymessage(fd, atcmd_output); + return -1; + } + return 0; +} + /*========================================== * *------------------------------------------ @@ -6607,11 +6656,11 @@ int atcommand_jailfor( switch(rand()%2) { case 1: //Jail #1 - m_index = mapindex_name2id(MAP_PRONTERA); + m_index = mapindex_name2id(MAP_JAIL); x = 49; y = 75; break; default: //Default Jail - m_index = mapindex_name2id(MAP_PRONTERA); + m_index = mapindex_name2id(MAP_JAIL); x = 24; y = 75; break; } -- cgit v1.2.3-70-g09d2