diff options
author | wushin <pasekei@gmail.com> | 2015-04-19 11:03:31 -0500 |
---|---|---|
committer | wushin <pasekei@gmail.com> | 2015-04-19 11:14:55 -0500 |
commit | 6de4da6e4aaf636b0047bc462628917ebeb344f3 (patch) | |
tree | 151238b7a32bb2f0d488ab109c29eefadeec157c /src/map/atcommand.cpp | |
parent | 0b04c49460a2e0c894c818ae190465fc2607bca8 (diff) | |
download | tmwa-6de4da6e4aaf636b0047bc462628917ebeb344f3.tar.gz tmwa-6de4da6e4aaf636b0047bc462628917ebeb344f3.tar.bz2 tmwa-6de4da6e4aaf636b0047bc462628917ebeb344f3.tar.xz tmwa-6de4da6e4aaf636b0047bc462628917ebeb344f3.zip |
Dynamic Xp percentage command @exprate
Diffstat (limited to 'src/map/atcommand.cpp')
-rw-r--r-- | src/map/atcommand.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/map/atcommand.cpp b/src/map/atcommand.cpp index f226706..9a35d30 100644 --- a/src/map/atcommand.cpp +++ b/src/map/atcommand.cpp @@ -1586,6 +1586,25 @@ ATCE atcommand_pvpoff(Session *s, dumb_ptr<map_session_data> sd, } static +ATCE atcommand_exprate(Session *s, dumb_ptr<map_session_data>, + ZString message) +{ + int rate; + + if (!extract(message, &rate) || !rate) + { + clif_displaymessage(s, + "Please, enter a rate adjustement (usage: @exprate <percent>)."_s); + return ATCE::USAGE; + } + battle_config.base_exp_rate = rate; + battle_config.job_exp_rate = rate; + AString output = STRPRINTF("All Xp at %d percent"_fmt, rate); + clif_displaymessage(s, output); + return ATCE::OKAY; +} + +static ATCE atcommand_pvpon(Session *s, dumb_ptr<map_session_data> sd, ZString) { @@ -4982,6 +5001,9 @@ Map<XString, AtCommandInfo> atcommand_info = {"pvpoff"_s, {""_s, 60, atcommand_pvpoff, "Enable PvP on your map"_s}}, + {"exprate"_s, {"<percent>"_s, + 60, atcommand_exprate, + "Set base job/exp rate"_s}}, {"pvpon"_s, {""_s, 60, atcommand_pvpon, "Disable PvP on your map"_s}}, |