Skip to content

Commit

Permalink
Merge pull request #1705 from Jedzkie/14-SC_ALL_RIDING
Browse files Browse the repository at this point in the history
Removed hard coded values on @cashmount and setcashmount.
  • Loading branch information
MishimaHaruna committed Apr 24, 2017
2 parents ab31b11 + e6c0203 commit bef73e4
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 16 deletions.
4 changes: 4 additions & 0 deletions conf/map/battle/items.conf
Expand Up @@ -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
14 changes: 8 additions & 6 deletions src/map/atcommand.c
Expand Up @@ -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;
}

Expand Down
3 changes: 2 additions & 1 deletion src/map/battle.c
Expand Up @@ -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
/**
Expand Down
1 change: 1 addition & 0 deletions src/map/battle.h
Expand Up @@ -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 */
Expand Down
26 changes: 17 additions & 9 deletions src/map/script.c
Expand Up @@ -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;
}

Expand All @@ -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;
}

Expand Down

0 comments on commit bef73e4

Please sign in to comment.