From 0fb2ce09aeec67550a41f7027db5b68a6a8b06d7 Mon Sep 17 00:00:00 2001 From: Fedja Beader Date: Wed, 10 Apr 2024 16:24:46 +0200 Subject: Split @exprate into @bexprate and @jexprate Preserve @exprate as a shortcut for both & because scripts in serverdata call it --- src/map/atcommand.cpp | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) (limited to 'src') diff --git a/src/map/atcommand.cpp b/src/map/atcommand.cpp index d9ec555..6901437 100644 --- a/src/map/atcommand.cpp +++ b/src/map/atcommand.cpp @@ -1667,6 +1667,8 @@ ATCE atcommand_pvpoff(Session *s, dumb_ptr sd, return ATCE::OKAY; } +// Command not removed during bexprate/jexprate split +// because serverdata calls it. static ATCE atcommand_exprate(Session *s, dumb_ptr, ZString message) @@ -1686,6 +1688,42 @@ ATCE atcommand_exprate(Session *s, dumb_ptr, return ATCE::OKAY; } +static +ATCE atcommand_bexprate(Session *s, dumb_ptr, + ZString message) +{ + int rate; + + if (!extract(message, &rate) || !rate) + { + clif_displaymessage(s, + "Please, enter a rate adjustement (usage: @bexprate )."_s); + return ATCE::USAGE; + } + battle_config.base_exp_rate = rate; + AString output = STRPRINTF("Base XP rate now at %d percent"_fmt, rate); + clif_displaymessage(s, output); + return ATCE::OKAY; +} + +static +ATCE atcommand_jexprate(Session *s, dumb_ptr, + ZString message) +{ + int rate; + + if (!extract(message, &rate) || !rate) + { + clif_displaymessage(s, + "Please, enter a rate adjustement (usage: @jexprate )."_s); + return ATCE::USAGE; + } + battle_config.job_exp_rate = rate; + AString output = STRPRINTF("Job XP rate now at %d percent"_fmt, rate); + clif_displaymessage(s, output); + return ATCE::OKAY; +} + static ATCE atcommand_rates(Session *s, dumb_ptr, ZString message) @@ -5600,6 +5638,12 @@ Map atcommand_info = {"exprate"_s, {""_s, 60, atcommand_exprate, "Set base and job exp rate"_s}}, + {"bexprate"_s, {""_s, + 60, atcommand_bexprate, + "Set base exp rate"_s}}, + {"jexprate"_s, {""_s, + 60, atcommand_jexprate, + "Set job exp rate"_s}}, {"rates"_s, {""_s, 0, atcommand_rates, "Show base and job exp rates"_s}}, -- cgit v1.2.3-70-g09d2