summaryrefslogtreecommitdiff
path: root/src/game-server
diff options
context:
space:
mode:
authorPhilipp Sehmisch <tmw@crushnet.org>2008-03-09 19:57:36 +0000
committerPhilipp Sehmisch <tmw@crushnet.org>2008-03-09 19:57:36 +0000
commit5187bc6624b36e7e02e11299eb6cbdf4f8f21a56 (patch)
treec695ee6dcb0c2ea647f1f33f90bc2d64dad9f4bb /src/game-server
parent13a48effdbd44a3811f9bcbb0115776ec46c3dfa (diff)
downloadmanaserv-5187bc6624b36e7e02e11299eb6cbdf4f8f21a56.tar.gz
manaserv-5187bc6624b36e7e02e11299eb6cbdf4f8f21a56.tar.bz2
manaserv-5187bc6624b36e7e02e11299eb6cbdf4f8f21a56.tar.xz
manaserv-5187bc6624b36e7e02e11299eb6cbdf4f8f21a56.zip
Sending the attack type with attack messages so that the client can visualize the different attacks monsters are using.
Diffstat (limited to 'src/game-server')
-rw-r--r--src/game-server/being.hpp6
-rw-r--r--src/game-server/monster.hpp6
-rw-r--r--src/game-server/state.cpp1
3 files changed, 13 insertions, 0 deletions
diff --git a/src/game-server/being.hpp b/src/game-server/being.hpp
index 27da220a..b725bfee 100644
--- a/src/game-server/being.hpp
+++ b/src/game-server/being.hpp
@@ -172,6 +172,12 @@ class Being : public MovingObject
{ return mAction; }
/**
+ * Gets the type of the attack the being is currently performing.
+ */
+ virtual int getAttackType() const
+ { return 0; }
+
+ /**
* Moves the being toward its destination.
*/
void move();
diff --git a/src/game-server/monster.hpp b/src/game-server/monster.hpp
index 3f6db5c1..05fedd6b 100644
--- a/src/game-server/monster.hpp
+++ b/src/game-server/monster.hpp
@@ -204,6 +204,12 @@ class Monster : public Being
void perform();
/**
+ *
+ */
+ virtual int getAttackType()
+ { return mCurrentAttack->id; }
+
+ /**
* Kills the being.
*/
void died();
diff --git a/src/game-server/state.cpp b/src/game-server/state.cpp
index 2c7a3633..21305c01 100644
--- a/src/game-server/state.cpp
+++ b/src/game-server/state.cpp
@@ -194,6 +194,7 @@ static void informPlayer(MapComposite *map, Character *p)
MessageOut AttackMsg(GPMSG_BEING_ATTACK);
AttackMsg.writeShort(oid);
AttackMsg.writeByte(o->getDirection());
+ AttackMsg.writeByte(static_cast< Being * >(o)->getAttackType());
gameHandler->sendTo(p, AttackMsg);
}