summaryrefslogtreecommitdiff
path: root/src/map/atcommand.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-08-03 14:39:38 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-08-03 14:39:38 +0000
commitcb1d2d92afbf8d9ebec4c9290a180835ad5dae78 (patch)
tree0a25e15fd6687a6f99764e794a49e97c04524cba /src/map/atcommand.c
parent4d34cd6ca7f80bf298c9837b27d1b5cc7d294098 (diff)
downloadhercules-cb1d2d92afbf8d9ebec4c9290a180835ad5dae78.tar.gz
hercules-cb1d2d92afbf8d9ebec4c9290a180835ad5dae78.tar.bz2
hercules-cb1d2d92afbf8d9ebec4c9290a180835ad5dae78.tar.xz
hercules-cb1d2d92afbf8d9ebec4c9290a180835ad5dae78.zip
- 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
Diffstat (limited to 'src/map/atcommand.c')
-rw-r--r--src/map/atcommand.c53
1 files changed, 51 insertions, 2 deletions
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 },
@@ -2140,6 +2142,53 @@ int atcommand_speed(
*
*------------------------------------------
*/
+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 <speed <%d-%d>> <char name>).", 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;
+}
+
+/*==========================================
+ *
+ *------------------------------------------
+ */
int atcommand_storage(
const int fd, struct map_session_data* sd,
const char* command, const char* message)
@@ -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;
}