summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-09-25 17:10:07 +0300
committerAndrei Karas <akaras@inbox.ru>2014-09-25 17:10:07 +0300
commite68643a3d46e6092727c21a751b86c7f03414710 (patch)
tree786faeadb397ef5a542572bd6f5061b4d7d2b847
parent74b96285c2ad2f07af0af9f8926bcd5e253dcde9 (diff)
downloadplus-e68643a3d46e6092727c21a751b86c7f03414710.tar.gz
plus-e68643a3d46e6092727c21a751b86c7f03414710.tar.bz2
plus-e68643a3d46e6092727c21a751b86c7f03414710.tar.xz
plus-e68643a3d46e6092727c21a751b86c7f03414710.zip
eathena: add packet CMSG_HOMMERC_ATTACK 0x0233.
-rw-r--r--src/net/eathena/homunculushandler.cpp11
-rw-r--r--src/net/eathena/homunculushandler.h2
-rw-r--r--src/net/eathena/mercenaryhandler.cpp11
-rw-r--r--src/net/eathena/mercenaryhandler.h2
-rw-r--r--src/net/eathena/protocol.h1
-rw-r--r--src/net/homunculushandler.h2
-rw-r--r--src/net/mercenaryhandler.h2
-rw-r--r--src/net/tmwa/homunculushandler.cpp5
-rw-r--r--src/net/tmwa/homunculushandler.h2
-rw-r--r--src/net/tmwa/mercenaryhandler.cpp5
-rw-r--r--src/net/tmwa/mercenaryhandler.h2
11 files changed, 45 insertions, 0 deletions
diff --git a/src/net/eathena/homunculushandler.cpp b/src/net/eathena/homunculushandler.cpp
index 320af387e..bbddc4412 100644
--- a/src/net/eathena/homunculushandler.cpp
+++ b/src/net/eathena/homunculushandler.cpp
@@ -204,4 +204,15 @@ void HomunculusHandler::move(const int x, const int y) const
outMsg.writeCoordinates(x, y, 0U);
}
+void HomunculusHandler::attack(const int targetId, const bool keep) const
+{
+ const int id = PlayerInfo::getHomunculusId();
+ if (!id)
+ return;
+ createOutPacket(CMSG_HOMMERC_ATTACK);
+ outMsg.writeInt32(id);
+ outMsg.writeInt32(targetId);
+ outMsg.writeInt8(keep ? 1 : 0);
+}
+
} // namespace EAthena
diff --git a/src/net/eathena/homunculushandler.h b/src/net/eathena/homunculushandler.h
index 01cb0586f..53ad59f4a 100644
--- a/src/net/eathena/homunculushandler.h
+++ b/src/net/eathena/homunculushandler.h
@@ -45,6 +45,8 @@ class HomunculusHandler final : public MessageHandler,
void move(const int x, const int y) const override final;
+ void attack(const int targetId, const bool keep) const override final;
+
protected:
void processHomunculusSkills(Net::MessageIn &msg);
diff --git a/src/net/eathena/mercenaryhandler.cpp b/src/net/eathena/mercenaryhandler.cpp
index 1ec3628a8..6ac4072c5 100644
--- a/src/net/eathena/mercenaryhandler.cpp
+++ b/src/net/eathena/mercenaryhandler.cpp
@@ -205,4 +205,15 @@ void MercenaryHandler::move(const int x, const int y) const
outMsg.writeCoordinates(x, y, 0U);
}
+void MercenaryHandler::attack(const int targetId, const bool keep) const
+{
+ const int id = PlayerInfo::getHomunculusId();
+ if (!id)
+ return;
+ createOutPacket(CMSG_HOMMERC_ATTACK);
+ outMsg.writeInt32(id);
+ outMsg.writeInt32(targetId);
+ outMsg.writeInt8(keep ? 1 : 0);
+}
+
} // namespace EAthena
diff --git a/src/net/eathena/mercenaryhandler.h b/src/net/eathena/mercenaryhandler.h
index 06fdd7cec..6ef3c02f5 100644
--- a/src/net/eathena/mercenaryhandler.h
+++ b/src/net/eathena/mercenaryhandler.h
@@ -47,6 +47,8 @@ class MercenaryHandler final : public MessageHandler,
void move(const int x, const int y) const override final;
+ void attack(const int targetId, const bool keep) const override final;
+
protected:
void processMercenaryUpdate(Net::MessageIn &msg);
diff --git a/src/net/eathena/protocol.h b/src/net/eathena/protocol.h
index c1df2d1e6..65257b904 100644
--- a/src/net/eathena/protocol.h
+++ b/src/net/eathena/protocol.h
@@ -420,6 +420,7 @@
#define CMSG_HOMUNCULUS_SET_NAME 0x0231
#define CMSG_HOMMERC_MOVE_TO_MASTER 0x0234
#define CMSG_HOMMERC_MOVE_TO 0x0232
+#define CMSG_HOMMERC_ATTACK 0x0233
#define CMSG_DORI_DORI 0x01e7
#define CMSG_EXPLOSION_SPIRITS 0x01ed
diff --git a/src/net/homunculushandler.h b/src/net/homunculushandler.h
index 2d7bb7d0d..a5db18ba8 100644
--- a/src/net/homunculushandler.h
+++ b/src/net/homunculushandler.h
@@ -39,6 +39,8 @@ class HomunculusHandler notfinal
virtual void moveToMaster() const = 0;
virtual void move(const int x, const int y) const = 0;
+
+ virtual void attack(const int targetId, const bool keep) const = 0;
};
} // namespace Net
diff --git a/src/net/mercenaryhandler.h b/src/net/mercenaryhandler.h
index ef1f60a45..8fcc4bb3a 100644
--- a/src/net/mercenaryhandler.h
+++ b/src/net/mercenaryhandler.h
@@ -41,6 +41,8 @@ class MercenaryHandler notfinal
virtual void moveToMaster() const = 0;
virtual void move(const int x, const int y) const = 0;
+
+ virtual void attack(const int targetId, const bool keep) const = 0;
};
} // namespace Net
diff --git a/src/net/tmwa/homunculushandler.cpp b/src/net/tmwa/homunculushandler.cpp
index 598aed30e..727053e17 100644
--- a/src/net/tmwa/homunculushandler.cpp
+++ b/src/net/tmwa/homunculushandler.cpp
@@ -54,4 +54,9 @@ void HomunculusHandler::move(const int x A_UNUSED, const int y A_UNUSED) const
{
}
+void HomunculusHandler::attack(const int targetId A_UNUSED,
+ const bool keep A_UNUSED) const
+{
+}
+
} // namespace TmwAthena
diff --git a/src/net/tmwa/homunculushandler.h b/src/net/tmwa/homunculushandler.h
index 41a3e3426..2b9935325 100644
--- a/src/net/tmwa/homunculushandler.h
+++ b/src/net/tmwa/homunculushandler.h
@@ -43,6 +43,8 @@ class HomunculusHandler final : public MessageHandler,
void moveToMaster() const override final;
void move(const int x, const int y) const override final;
+
+ void attack(const int targetId, const bool keep) const override final;
};
} // namespace TmwAthena
diff --git a/src/net/tmwa/mercenaryhandler.cpp b/src/net/tmwa/mercenaryhandler.cpp
index de4ca5f7e..1497a0789 100644
--- a/src/net/tmwa/mercenaryhandler.cpp
+++ b/src/net/tmwa/mercenaryhandler.cpp
@@ -58,4 +58,9 @@ void MercenaryHandler::move(const int x A_UNUSED, const int y A_UNUSED) const
{
}
+void MercenaryHandler::attack(const int targetId A_UNUSED,
+ const bool keep A_UNUSED) const
+{
+}
+
} // namespace TmwAthena
diff --git a/src/net/tmwa/mercenaryhandler.h b/src/net/tmwa/mercenaryhandler.h
index e327247df..098f7aac3 100644
--- a/src/net/tmwa/mercenaryhandler.h
+++ b/src/net/tmwa/mercenaryhandler.h
@@ -45,6 +45,8 @@ class MercenaryHandler final : public MessageHandler,
void moveToMaster() const override final;
void move(const int x, const int y) const override final;
+
+ void attack(const int targetId, const bool keep) const override final;
};
} // namespace TmwAthena