summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/map/atcommand.c14
-rw-r--r--src/map/battle.c3
-rw-r--r--src/map/battle.h1
-rw-r--r--src/map/script.c26
4 files changed, 28 insertions, 16 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index 881e50497..bf816faa7 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -8420,22 +8420,24 @@ ACMD(charcommands)
return true;
}
-/* for new mounts */
+/* For new mounts */
ACMD(cashmount)
{
if (pc_hasmount(sd)) {
- clif->message(fd, msg_fd(fd,1476)); // You are already mounting something else
+ clif->message(fd, msg_fd(fd, 1476)); // You are already mounting something else
return false;
}
- clif->message(sd->fd,msg_fd(fd,1362)); // NOTICE: If you crash with mount your LUA is outdated.
+ clif->message(sd->fd, msg_fd(fd, 1362)); // NOTICE: If you crash with mount your LUA is outdated.
+
if (!sd->sc.data[SC_ALL_RIDING]) {
- clif->message(sd->fd,msg_fd(fd,1363)); // You have mounted.
- sc_start(NULL, &sd->bl, SC_ALL_RIDING, 100, 25, INFINITE_DURATION);
+ clif->message(sd->fd, msg_fd(fd, 1363)); // You have mounted.
+ sc_start(NULL, &sd->bl, SC_ALL_RIDING, 100, battle_config.boarding_halter_speed, INFINITE_DURATION);
} else {
- clif->message(sd->fd,msg_fd(fd,1364)); // You have released your mount.
+ clif->message(sd->fd, msg_fd(fd, 1364)); // You have released your mount.
status_change_end(&sd->bl, SC_ALL_RIDING, INVALID_TIMER);
}
+
return true;
}
diff --git a/src/map/battle.c b/src/map/battle.c
index fdea849fb..a4e6d8dd1 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -7333,7 +7333,8 @@ static const struct battle_data {
{ "max_summoner_parameter", &battle_config.max_summoner_parameter, 120, 10, 10000, },
{ "mvp_exp_reward_message", &battle_config.mvp_exp_reward_message, 0, 0, 1, },
{ "monster_eye_range_bonus", &battle_config.mob_eye_range_bonus, 0, 0, 10, },
- { "prevent_logout_trigger", &battle_config.prevent_logout_trigger, 0xE, 0, 0xF, }
+ { "prevent_logout_trigger", &battle_config.prevent_logout_trigger, 0xE, 0, 0xF, },
+ { "boarding_halter_speed", &battle_config.boarding_halter_speed, 25, 0, 100, },
};
#ifndef STATS_OPT_OUT
/**
diff --git a/src/map/battle.h b/src/map/battle.h
index b5846e457..d582f3c92 100644
--- a/src/map/battle.h
+++ b/src/map/battle.h
@@ -554,6 +554,7 @@ struct Battle_Config {
int mob_eye_range_bonus; //Vulture's Eye and Snake's Eye range bonus
int prevent_logout_trigger;
+ int boarding_halter_speed;
};
/* criteria for battle_config.idletime_critera */
diff --git a/src/map/script.c b/src/map/script.c
index c9c51afbc..a6d3ac852 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -21268,12 +21268,16 @@ BUILDIN(makerune)
BUILDIN(hascashmount)
{
struct map_session_data *sd = script->rid2sd(st);
+
if (sd == NULL)
return true;
- if( sd->sc.data[SC_ALL_RIDING] )
- script_pushint(st,1);
- else
- script_pushint(st,0);
+
+ if (sd->sc.data[SC_ALL_RIDING]) {
+ script_pushint(st, 1);
+ } else {
+ script_pushint(st, 0);
+ }
+
return true;
}
@@ -21287,18 +21291,22 @@ BUILDIN(hascashmount)
BUILDIN(setcashmount)
{
struct map_session_data *sd = script->rid2sd(st);
+
if (sd == NULL)
return true;
+
if (pc_hasmount(sd)) {
clif->msgtable(sd, MSG_REINS_CANT_USE_MOUNTED);
- script_pushint(st,0);//can't mount with one of these
+ script_pushint(st, 0); // Can't mount with one of these
} else {
- if (sd->sc.data[SC_ALL_RIDING])
+ if (sd->sc.data[SC_ALL_RIDING]) {
status_change_end(&sd->bl, SC_ALL_RIDING, INVALID_TIMER);
- else
- sc_start(NULL, &sd->bl, SC_ALL_RIDING, 100, 25, INFINITE_DURATION);
- script_pushint(st,1);//in both cases, return 1.
+ } else {
+ sc_start(NULL, &sd->bl, SC_ALL_RIDING, 100, battle_config.boarding_halter_speed, INFINITE_DURATION);
+ }
+ script_pushint(st, 1); // In both cases, return 1.
}
+
return true;
}