diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-09-11 12:36:18 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-09-11 12:36:18 +0300 |
commit | 71d50c2de2cfe8c9d5b1653596eae90761c8a9d6 (patch) | |
tree | 88234658b6397123e6c3176d119d1a45df672ed4 /src/actions/actions.cpp | |
parent | 660d3b585ab50038e5b2ea3fb9cf4049a7e697d1 (diff) | |
download | manaverse-71d50c2de2cfe8c9d5b1653596eae90761c8a9d6.tar.gz manaverse-71d50c2de2cfe8c9d5b1653596eae90761c8a9d6.tar.bz2 manaverse-71d50c2de2cfe8c9d5b1653596eae90761c8a9d6.tar.xz manaverse-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.cpp | 17 |
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 |