summaryrefslogtreecommitdiff
path: root/src/map/atcommand.cpp
diff options
context:
space:
mode:
authormekolat <mekolat@gmail.com>2015-04-03 14:27:37 -0400
committerwushin <pasekei@gmail.com>2015-04-04 00:57:40 -0500
commit8e8876474eddefe474528c73851b3af2c6d9327f (patch)
tree23e0f87468daf256f8c26e0859cc1b2dc75bb2d5 /src/map/atcommand.cpp
parentee8dff7687f120cbe55dccc56c1ae1f711bb68b5 (diff)
downloadtmwa-8e8876474eddefe474528c73851b3af2c6d9327f.tar.gz
tmwa-8e8876474eddefe474528c73851b3af2c6d9327f.tar.bz2
tmwa-8e8876474eddefe474528c73851b3af2c6d9327f.tar.xz
tmwa-8e8876474eddefe474528c73851b3af2c6d9327f.zip
add charpvp atcommand
Diffstat (limited to 'src/map/atcommand.cpp')
-rw-r--r--src/map/atcommand.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/map/atcommand.cpp b/src/map/atcommand.cpp
index 7c165ef..f226706 100644
--- a/src/map/atcommand.cpp
+++ b/src/map/atcommand.cpp
@@ -4050,6 +4050,25 @@ ATCE atcommand_pvp(Session *s, dumb_ptr<map_session_data> sd,
}
static
+ATCE atcommand_charpvp(Session *, dumb_ptr<map_session_data>,
+ ZString message)
+{
+ CharName character;
+ int channel;
+
+ if (!extract(message, record<' '>(&character, &channel)))
+ return ATCE::USAGE;
+
+ dumb_ptr<map_session_data> pl_sd = map_nick2sd(character);
+ if (pl_sd == nullptr)
+ return ATCE::EXIST;
+
+ pl_sd->state.pvpchannel = channel;
+
+ return ATCE::OKAY;
+}
+
+static
ATCE atcommand_npcmove(Session *, dumb_ptr<map_session_data>,
ZString message)
{
@@ -5182,6 +5201,9 @@ Map<XString, AtCommandInfo> atcommand_info =
{"npcmove"_s, {"<x> <y> <npc-name>"_s,
80, atcommand_npcmove,
"Force an NPC to move on the map"_s}},
+ {"charpvp"_s, {"<charname> <channel>"_s,
+ 40, atcommand_charpvp,
+ "Set the pvp channel of another player"_s}},
{"chareffect"_s, {"<type> <target>"_s,
40, atcommand_chareffect,
"Apply effect type with arg 0 to a player"_s}},