summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJedzkie <jedzkie13@rocketmail.com>2017-04-23 11:12:36 +0800
committerHaru <haru@dotalux.com>2017-04-24 12:59:02 +0200
commite6c0203a6da6930d9c4a2b762190cd0428e106ca (patch)
treeb870735968c8898b614fca5339e12a375465a973
parentab31b1129b0015559137509e0c3099386f1a69ee (diff)
downloadhercules-e6c0203a6da6930d9c4a2b762190cd0428e106ca.tar.gz
hercules-e6c0203a6da6930d9c4a2b762190cd0428e106ca.tar.bz2
hercules-e6c0203a6da6930d9c4a2b762190cd0428e106ca.tar.xz
hercules-e6c0203a6da6930d9c4a2b762190cd0428e106ca.zip
Removed hard coded values on @cashmount and setcashmount.
-rw-r--r--conf/map/battle/items.conf4
-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
5 files changed, 32 insertions, 16 deletions
diff --git a/conf/map/battle/items.conf b/conf/map/battle/items.conf
index 3c9ba71e9..c7aa99245 100644
--- a/conf/map/battle/items.conf
+++ b/conf/map/battle/items.conf
@@ -118,3 +118,7 @@ unequip_restricted_equipment: 0
// When unequip a bow with arrow equipped, it also unequip the arrow?
// Default: true (Official behavior, applies only in Renewal)
bow_unequip_arrow: true
+
+// How much should rental mounts increase a player's movement speed? (Note 2)
+// Official: 25 (Default)
+boarding_halter_speed: 25
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;
}