diff options
author | mekolat <mekolat@users.noreply.github.com> | 2015-05-07 19:35:44 -0400 |
---|---|---|
committer | mekolat <mekolat@users.noreply.github.com> | 2015-05-19 16:00:59 -0400 |
commit | 6fd7eab6ba5d836c47847aca618ee02a50967072 (patch) | |
tree | 5b9f700da587944b915ba5b6b28cfdeeee4a9c25 /src/map/atcommand.cpp | |
parent | 20cbf97dbaded8c2bead5b4f1a4838528c63a2a5 (diff) | |
download | tmwa-6fd7eab6ba5d836c47847aca618ee02a50967072.tar.gz tmwa-6fd7eab6ba5d836c47847aca618ee02a50967072.tar.bz2 tmwa-6fd7eab6ba5d836c47847aca618ee02a50967072.tar.xz tmwa-6fd7eab6ba5d836c47847aca618ee02a50967072.zip |
allow to make npcs sit
Diffstat (limited to 'src/map/atcommand.cpp')
-rw-r--r-- | src/map/atcommand.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/map/atcommand.cpp b/src/map/atcommand.cpp index 63a1159..d587bde 100644 --- a/src/map/atcommand.cpp +++ b/src/map/atcommand.cpp @@ -4157,6 +4157,30 @@ ATCE atcommand_npcmove(Session *, dumb_ptr<map_session_data>, } static +ATCE atcommand_npcsit(Session *, dumb_ptr<map_session_data> sd, + ZString message) +{ + NpcName character; + dumb_ptr<npc_data> nd = nullptr; + + if (!asplit(message, &character)) + return ATCE::USAGE; + + nd = npc_name2id(character); + if (nd == nullptr) + return ATCE::EXIST; + + if(nd->sit == DamageType::SIT) + nd->sit = DamageType::STAND; + else + nd->sit = DamageType::SIT; + + clif_sitnpc(sd, nd, true); + + return ATCE::OKAY; +} + +static ATCE atcommand_addwarp(Session *s, dumb_ptr<map_session_data> sd, ZString message) { @@ -5267,6 +5291,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}}, + {"npcsit"_s, {"<npc-name>"_s, + 80, atcommand_npcsit, + "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}}, |