From 6de4da6e4aaf636b0047bc462628917ebeb344f3 Mon Sep 17 00:00:00 2001 From: wushin Date: Sun, 19 Apr 2015 11:03:31 -0500 Subject: Dynamic Xp percentage command @exprate --- src/map/atcommand.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src/map/atcommand.cpp') 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 @@ -1585,6 +1585,25 @@ ATCE atcommand_pvpoff(Session *s, dumb_ptr sd, return ATCE::OKAY; } +static +ATCE atcommand_exprate(Session *s, dumb_ptr, + ZString message) +{ + int rate; + + if (!extract(message, &rate) || !rate) + { + clif_displaymessage(s, + "Please, enter a rate adjustement (usage: @exprate )."_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 sd, ZString) @@ -4982,6 +5001,9 @@ Map atcommand_info = {"pvpoff"_s, {""_s, 60, atcommand_pvpoff, "Enable PvP on your map"_s}}, + {"exprate"_s, {""_s, + 60, atcommand_exprate, + "Set base job/exp rate"_s}}, {"pvpon"_s, {""_s, 60, atcommand_pvpon, "Disable PvP on your map"_s}}, -- cgit v1.2.3-60-g2f50