summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFedja Beader <fedja@protonmail.ch>2024-04-10 16:24:46 +0200
committerFedja Beader <fedja@protonmail.ch>2024-04-10 16:26:05 +0200
commit0fb2ce09aeec67550a41f7027db5b68a6a8b06d7 (patch)
treebd019804ddccf441cef433427d82d4bf9ba6d126 /src
parent01a27d4af7e54736a7922aec23f6f4e3e21f0965 (diff)
downloadtmwa-0fb2ce09aeec67550a41f7027db5b68a6a8b06d7.tar.gz
tmwa-0fb2ce09aeec67550a41f7027db5b68a6a8b06d7.tar.bz2
tmwa-0fb2ce09aeec67550a41f7027db5b68a6a8b06d7.tar.xz
tmwa-0fb2ce09aeec67550a41f7027db5b68a6a8b06d7.zip
Split @exprate into @bexprate and @jexprate
Preserve @exprate as a shortcut for both & because scripts in serverdata call it
Diffstat (limited to 'src')
-rw-r--r--src/map/atcommand.cpp44
1 files changed, 44 insertions, 0 deletions
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<map_session_data> sd,
return ATCE::OKAY;
}
+// Command not removed during bexprate/jexprate split
+// because serverdata calls it.
static
ATCE atcommand_exprate(Session *s, dumb_ptr<map_session_data>,
ZString message)
@@ -1687,6 +1689,42 @@ ATCE atcommand_exprate(Session *s, dumb_ptr<map_session_data>,
}
static
+ATCE atcommand_bexprate(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: @bexprate <percent>)."_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<map_session_data>,
+ ZString message)
+{
+ int rate;
+
+ if (!extract(message, &rate) || !rate)
+ {
+ clif_displaymessage(s,
+ "Please, enter a rate adjustement (usage: @jexprate <percent>)."_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<map_session_data>,
ZString message)
{
@@ -5600,6 +5638,12 @@ Map<XString, AtCommandInfo> atcommand_info =
{"exprate"_s, {"<percent>"_s,
60, atcommand_exprate,
"Set base and job exp rate"_s}},
+ {"bexprate"_s, {"<percent>"_s,
+ 60, atcommand_bexprate,
+ "Set base exp rate"_s}},
+ {"jexprate"_s, {"<percent>"_s,
+ 60, atcommand_jexprate,
+ "Set job exp rate"_s}},
{"rates"_s, {""_s,
0, atcommand_rates,
"Show base and job exp rates"_s}},