summaryrefslogtreecommitdiff
path: root/src/actions/actions.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-09-11 12:36:18 +0300
committerAndrei Karas <akaras@inbox.ru>2014-09-11 12:36:18 +0300
commit71d50c2de2cfe8c9d5b1653596eae90761c8a9d6 (patch)
tree88234658b6397123e6c3176d119d1a45df672ed4 /src/actions/actions.cpp
parent660d3b585ab50038e5b2ea3fb9cf4049a7e697d1 (diff)
downloadmv-71d50c2de2cfe8c9d5b1653596eae90761c8a9d6.tar.gz
mv-71d50c2de2cfe8c9d5b1653596eae90761c8a9d6.tar.bz2
mv-71d50c2de2cfe8c9d5b1653596eae90761c8a9d6.tar.xz
mv-71d50c2de2cfe8c9d5b1653596eae90761c8a9d6.zip
Add action and chat command for "catch pet".
New chat command: /catchpet - Try catch selected monster
Diffstat (limited to 'src/actions/actions.cpp')
-rw-r--r--src/actions/actions.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/actions/actions.cpp b/src/actions/actions.cpp
index 250e43227..e3ad3a11a 100644
--- a/src/actions/actions.cpp
+++ b/src/actions/actions.cpp
@@ -1157,4 +1157,21 @@ impHandler(uploadLog)
return true;
}
+impHandler(catchPet)
+{
+ if (!localPlayer || !actorManager)
+ return false;
+
+ Being *target = nullptr;
+ if (!event.args.empty())
+ target = actorManager->findNearestByName(event.args);
+ if (!target)
+ target = localPlayer->getTarget();
+ else
+ localPlayer->setTarget(target);
+ if (target)
+ Net::getPetHandler()->catchPet(target);
+ return true;
+}
+
} // namespace Actions