From 8e8876474eddefe474528c73851b3af2c6d9327f Mon Sep 17 00:00:00 2001 From: mekolat Date: Fri, 3 Apr 2015 14:27:37 -0400 Subject: add charpvp atcommand --- 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 7c165ef..f226706 100644 --- a/src/map/atcommand.cpp +++ b/src/map/atcommand.cpp @@ -4049,6 +4049,25 @@ ATCE atcommand_pvp(Session *s, dumb_ptr sd, return ATCE::OKAY; } +static +ATCE atcommand_charpvp(Session *, dumb_ptr, + ZString message) +{ + CharName character; + int channel; + + if (!extract(message, record<' '>(&character, &channel))) + return ATCE::USAGE; + + dumb_ptr 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, ZString message) @@ -5182,6 +5201,9 @@ Map atcommand_info = {"npcmove"_s, {" "_s, 80, atcommand_npcmove, "Force an NPC to move on the map"_s}}, + {"charpvp"_s, {" "_s, + 40, atcommand_charpvp, + "Set the pvp channel of another player"_s}}, {"chareffect"_s, {" "_s, 40, atcommand_chareffect, "Apply effect type with arg 0 to a player"_s}}, -- cgit v1.2.3-70-g09d2