summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-02-24 01:42:03 +0300
committerAndrei Karas <akaras@inbox.ru>2016-02-24 01:42:41 +0300
commit5b03a091589806dd2250db646b7739f09e55d424 (patch)
treeda7d5f0f281560c7ef31bff779a35c1bbd296dc2 /src
parent398e7e04c6232d2076a44040548cbc88497a155b (diff)
downloadmv-5b03a091589806dd2250db646b7739f09e55d424.tar.gz
mv-5b03a091589806dd2250db646b7739f09e55d424.tar.bz2
mv-5b03a091589806dd2250db646b7739f09e55d424.tar.xz
mv-5b03a091589806dd2250db646b7739f09e55d424.zip
Add chat command for gm /mobsearch
Diffstat (limited to 'src')
-rw-r--r--src/actions/commands.cpp9
-rw-r--r--src/actions/commands.h1
-rw-r--r--src/dyetool/actions/commands.cpp1
-rw-r--r--src/enums/input/inputaction.h1
-rw-r--r--src/input/inputactionmap.h6
-rw-r--r--src/net/adminhandler.h2
-rw-r--r--src/net/eathena/adminhandler.cpp5
-rw-r--r--src/net/eathena/adminhandler.h2
-rw-r--r--src/net/tmwa/adminhandler.cpp4
-rw-r--r--src/net/tmwa/adminhandler.h2
10 files changed, 33 insertions, 0 deletions
diff --git a/src/actions/commands.cpp b/src/actions/commands.cpp
index 2eec5c392..2adef54ca 100644
--- a/src/actions/commands.cpp
+++ b/src/actions/commands.cpp
@@ -1245,4 +1245,13 @@ impHandler(whoDrops)
return true;
}
+impHandler(mobSearch)
+{
+ const std::string args = event.args;
+ if (args.empty())
+ return false;
+ adminHandler->mobSearch(args);
+ return true;
+}
+
} // namespace Actions
diff --git a/src/actions/commands.h b/src/actions/commands.h
index 4378e2127..07b5dda2e 100644
--- a/src/actions/commands.h
+++ b/src/actions/commands.h
@@ -100,6 +100,7 @@ namespace Actions
decHandler(monsterInfo);
decHandler(itemInfo);
decHandler(whoDrops);
+ decHandler(mobSearch);
} // namespace Actions
#undef decHandler
diff --git a/src/dyetool/actions/commands.cpp b/src/dyetool/actions/commands.cpp
index a515e8b05..18278f6a1 100644
--- a/src/dyetool/actions/commands.cpp
+++ b/src/dyetool/actions/commands.cpp
@@ -100,5 +100,6 @@ impHandlerVoid(ignorePickup)
impHandlerVoid(monsterInfo)
impHandlerVoid(itemInfo)
impHandlerVoid(whoDrops)
+impHandlerVoid(mobSearch)
} // namespace Actions
diff --git a/src/enums/input/inputaction.h b/src/enums/input/inputaction.h
index 7437ee44e..019df826a 100644
--- a/src/enums/input/inputaction.h
+++ b/src/enums/input/inputaction.h
@@ -629,6 +629,7 @@ enumStart(InputAction)
MONSTER_INFO,
ITEM_INFO,
WHO_DROPS,
+ MOB_SEARCH,
TOTAL
}
enumEnd(InputAction);
diff --git a/src/input/inputactionmap.h b/src/input/inputactionmap.h
index d52701cec..e7322d456 100644
--- a/src/input/inputactionmap.h
+++ b/src/input/inputactionmap.h
@@ -5263,6 +5263,12 @@ static const InputActionData inputActionData
"whodrops|whodrop",
UseArgs_true,
Protected_true},
+ {"keyMobSearch",
+ defaultAction(&Actions::mobSearch),
+ InputCondition::INGAME,
+ "mobsearch|monstersearch",
+ UseArgs_true,
+ Protected_true},
};
#undef defaultAction
diff --git a/src/net/adminhandler.h b/src/net/adminhandler.h
index d6e1ba11e..caa5098b9 100644
--- a/src/net/adminhandler.h
+++ b/src/net/adminhandler.h
@@ -102,6 +102,8 @@ class AdminHandler notfinal
virtual void itemInfo(const std::string &name) const = 0;
virtual void whoDrops(const std::string &name) const = 0;
+
+ virtual void mobSearch(const std::string &name) const = 0;
};
} // namespace Net
diff --git a/src/net/eathena/adminhandler.cpp b/src/net/eathena/adminhandler.cpp
index 3064a9ca2..d13c29a31 100644
--- a/src/net/eathena/adminhandler.cpp
+++ b/src/net/eathena/adminhandler.cpp
@@ -177,4 +177,9 @@ void AdminHandler::whoDrops(const std::string &name) const
chatHandler->talk("@whodrops " + name, GENERAL_CHANNEL);
}
+void AdminHandler::mobSearch(const std::string &name) const
+{
+ chatHandler->talk("@mobsearch " + name, GENERAL_CHANNEL);
+}
+
} // namespace EAthena
diff --git a/src/net/eathena/adminhandler.h b/src/net/eathena/adminhandler.h
index e7a5a1473..79ce6cf23 100644
--- a/src/net/eathena/adminhandler.h
+++ b/src/net/eathena/adminhandler.h
@@ -77,6 +77,8 @@ class AdminHandler final : public Ea::AdminHandler
void whoDrops(const std::string &name) const override final;
+ void mobSearch(const std::string &name) const override final;
+
protected:
static std::string mStatsName;
};
diff --git a/src/net/tmwa/adminhandler.cpp b/src/net/tmwa/adminhandler.cpp
index 0e1c8ef79..e26806c8d 100644
--- a/src/net/tmwa/adminhandler.cpp
+++ b/src/net/tmwa/adminhandler.cpp
@@ -138,4 +138,8 @@ void AdminHandler::whoDrops(const std::string &name A_UNUSED) const
{
}
+void AdminHandler::mobSearch(const std::string &name A_UNUSED) const
+{
+}
+
} // namespace TmwAthena
diff --git a/src/net/tmwa/adminhandler.h b/src/net/tmwa/adminhandler.h
index 5c0e2558d..94ec3b7be 100644
--- a/src/net/tmwa/adminhandler.h
+++ b/src/net/tmwa/adminhandler.h
@@ -78,6 +78,8 @@ class AdminHandler final : public Ea::AdminHandler
void itemInfo(const std::string &name) const override final A_CONST;
void whoDrops(const std::string &name) const override final A_CONST;
+
+ void mobSearch(const std::string &name) const override final A_CONST;
};
} // namespace TmwAthena