From a5e3d86efb85bb2a65e160972cc56e89cd764453 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 28 Dec 2014 19:36:50 +0300 Subject: Add chat command for stop and start pet ai. --- src/net/tmwa/pethandler.cpp | 6 ++++++ src/net/tmwa/pethandler.h | 2 ++ 2 files changed, 8 insertions(+) (limited to 'src/net/tmwa') diff --git a/src/net/tmwa/pethandler.cpp b/src/net/tmwa/pethandler.cpp index 787b288b5..33bd2cb3c 100644 --- a/src/net/tmwa/pethandler.cpp +++ b/src/net/tmwa/pethandler.cpp @@ -113,4 +113,10 @@ void PetHandler::setDirection(const BeingDirection::Type type) const static_cast(type), tick_time), GENERAL_CHANNEL); } +void PetHandler::startAi(const bool start) const +{ + chatHandler->talk(strprintf("\302\202\302a%dg%d", + start ? 1 : 0, tick_time), GENERAL_CHANNEL); +} + } // namespace TmwAthena diff --git a/src/net/tmwa/pethandler.h b/src/net/tmwa/pethandler.h index 49f32e84d..7b7f40cd0 100644 --- a/src/net/tmwa/pethandler.h +++ b/src/net/tmwa/pethandler.h @@ -66,6 +66,8 @@ class PetHandler final : public MessageHandler, public Net::PetHandler void setDirection(const BeingDirection::Type type) const override final; + void startAi(const bool start) const override final; + protected: int mRandCounter; }; -- cgit v1.2.3-70-g09d2