summaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
authorPhilipp Sehmisch <tmw@crushnet.org>2008-11-01 19:03:01 +0000
committerPhilipp Sehmisch <tmw@crushnet.org>2008-11-01 19:03:01 +0000
commit14ef52c7c3413f8c61b50147dcd22f4ed7238078 (patch)
tree82888985eeae2f3e21ce5e414d6ae9ac72e37d36 /src/net
parentbabaec33e51991475ba2ab9ec06c95bbe5f220c0 (diff)
downloadmana-14ef52c7c3413f8c61b50147dcd22f4ed7238078.tar.gz
mana-14ef52c7c3413f8c61b50147dcd22f4ed7238078.tar.bz2
mana-14ef52c7c3413f8c61b50147dcd22f4ed7238078.tar.xz
mana-14ef52c7c3413f8c61b50147dcd22f4ed7238078.zip
Magic implementation phase 1 and 2 (added netcode and a very crude gui for using special actions like magic)
Diffstat (limited to 'src/net')
-rw-r--r--src/net/gameserver/player.cpp7
-rw-r--r--src/net/gameserver/player.h1
-rw-r--r--src/net/protocol.h1
3 files changed, 9 insertions, 0 deletions
diff --git a/src/net/gameserver/player.cpp b/src/net/gameserver/player.cpp
index 28fd954a..79ada480 100644
--- a/src/net/gameserver/player.cpp
+++ b/src/net/gameserver/player.cpp
@@ -102,6 +102,13 @@ void Net::GameServer::Player::attack(int direction)
Net::GameServer::connection->send(msg);
}
+void Net::GameServer::Player::useSpecial(int special)
+{
+ MessageOut msg(PGMSG_USE_SPECIAL);
+ msg.writeInt8(special);
+ Net::GameServer::connection->send(msg);
+}
+
void Net::GameServer::Player::changeAction(Being::Action action)
{
MessageOut msg(PGMSG_ACTION_CHANGE);
diff --git a/src/net/gameserver/player.h b/src/net/gameserver/player.h
index fa8c1376..3eba8a13 100644
--- a/src/net/gameserver/player.h
+++ b/src/net/gameserver/player.h
@@ -51,6 +51,7 @@ namespace Net
void unequip(int slot);
void useItem(int slot);
void attack(int direction);
+ void useSpecial(int special);
void changeAction(Being::Action action);
void talkToNPC(int id, bool restart);
void selectFromNPC(int id, int choice);
diff --git a/src/net/protocol.h b/src/net/protocol.h
index abbad442..bbc7d2d2 100644
--- a/src/net/protocol.h
+++ b/src/net/protocol.h
@@ -104,6 +104,7 @@ enum {
GPMSG_BEINGS_MOVE = 0x0280, // { W being id, B flags [, C position, B speed] [, W*2 destination] }*
GPMSG_ITEMS = 0x0281, // { W item id, W*2 position }*
PGMSG_ATTACK = 0x0290, // B direction
+ PGMSG_USE_SPECIAL = 0x0292, // B specialID
GPMSG_BEING_ATTACK = 0x0291, // W being id
PGMSG_SAY = 0x02A0, // S text
GPMSG_SAY = 0x02A1, // W being id, S text