summaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-02-28 22:10:30 +0300
committerAndrei Karas <akaras@inbox.ru>2016-02-28 22:10:30 +0300
commit15b9391da7ba4c307311d7dae6abc81a4b2bf25c (patch)
tree22abbcd556824073008de3493a42839848cef969 /src/net
parentcd0883a1704c1b514b8b7317358949d43e230644 (diff)
downloadmanaverse-15b9391da7ba4c307311d7dae6abc81a4b2bf25c.tar.gz
manaverse-15b9391da7ba4c307311d7dae6abc81a4b2bf25c.tar.bz2
manaverse-15b9391da7ba4c307311d7dae6abc81a4b2bf25c.tar.xz
manaverse-15b9391da7ba4c307311d7dae6abc81a4b2bf25c.zip
Add chat command /npcmove. Also add it to npc context menu.
Diffstat (limited to 'src/net')
-rw-r--r--src/net/adminhandler.h4
-rw-r--r--src/net/eathena/adminhandler.cpp12
-rw-r--r--src/net/eathena/adminhandler.h4
-rw-r--r--src/net/tmwa/adminhandler.cpp6
-rw-r--r--src/net/tmwa/adminhandler.h16
5 files changed, 36 insertions, 6 deletions
diff --git a/src/net/adminhandler.h b/src/net/adminhandler.h
index 000938240..8674a341d 100644
--- a/src/net/adminhandler.h
+++ b/src/net/adminhandler.h
@@ -162,6 +162,10 @@ class AdminHandler notfinal
virtual void jail(const std::string &name) const = 0;
virtual void unjail(const std::string &name) const = 0;
+
+ virtual void npcMove(const std::string &name,
+ const int x,
+ const int y) const = 0;
};
} // namespace Net
diff --git a/src/net/eathena/adminhandler.cpp b/src/net/eathena/adminhandler.cpp
index 1ee373043..cc1465ee0 100644
--- a/src/net/eathena/adminhandler.cpp
+++ b/src/net/eathena/adminhandler.cpp
@@ -28,6 +28,7 @@
#include "net/eathena/protocolout.h"
#include "utils/gmfunctions.h"
+#include "utils/stringutils.h"
#include "debug.h"
@@ -325,4 +326,15 @@ void AdminHandler::unjail(const std::string &name) const
Gm::runCommand("unjail", name);
}
+void AdminHandler::npcMove(const std::string &name,
+ const int x,
+ const int y) const
+{
+ Gm::runCommand("npcmove",
+ strprintf("%d %d %s",
+ x,
+ y,
+ name.c_str()));
+}
+
} // namespace EAthena
diff --git a/src/net/eathena/adminhandler.h b/src/net/eathena/adminhandler.h
index 995669f76..60103ea24 100644
--- a/src/net/eathena/adminhandler.h
+++ b/src/net/eathena/adminhandler.h
@@ -138,6 +138,10 @@ class AdminHandler final : public Ea::AdminHandler
void unjail(const std::string &name) const override final;
+ void npcMove(const std::string &name,
+ const int x,
+ const int y) const override final;
+
protected:
static std::string mStatsName;
};
diff --git a/src/net/tmwa/adminhandler.cpp b/src/net/tmwa/adminhandler.cpp
index 7de0cb247..2dd1464c5 100644
--- a/src/net/tmwa/adminhandler.cpp
+++ b/src/net/tmwa/adminhandler.cpp
@@ -257,4 +257,10 @@ void AdminHandler::unjail(const std::string &name A_UNUSED) const
{
}
+void AdminHandler::npcMove(const std::string &name A_UNUSED,
+ const int x A_UNUSED,
+ const int y A_UNUSED) const
+{
+}
+
} // namespace TmwAthena
diff --git a/src/net/tmwa/adminhandler.h b/src/net/tmwa/adminhandler.h
index c45437113..3bed8949c 100644
--- a/src/net/tmwa/adminhandler.h
+++ b/src/net/tmwa/adminhandler.h
@@ -137,19 +137,23 @@ class AdminHandler final : public Ea::AdminHandler
void alive(const std::string &name) const override final;
- void disguise(const std::string &name) const override final;
+ void disguise(const std::string &name) const override final A_CONST;
- void immortal(const std::string &name) const override final;
+ void immortal(const std::string &name) const override final A_CONST;
void hide(const std::string &name) const override final;
- void nuke(const std::string &name) const override final;
+ void nuke(const std::string &name) const override final A_CONST;
- void kill(const std::string &name) const override final;
+ void kill(const std::string &name) const override final A_CONST;
- void jail(const std::string &name) const override final;
+ void jail(const std::string &name) const override final A_CONST;
- void unjail(const std::string &name) const override final;
+ void unjail(const std::string &name) const override final A_CONST;
+
+ void npcMove(const std::string &name,
+ const int x,
+ const int y) const override final A_CONST;
};
} // namespace TmwAthena