diff --git a/conf/map/battle/items.conf b/conf/map/battle/items.conf index 3c9ba71e95f..c7aa9924595 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 881e50497f0..bf816faa710 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 fdea849fbe2..a4e6d8dd10a 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 b5846e457ad..d582f3c92d6 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 c9c51afbc45..a6d3ac8528e 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; }