Mana
Loading...
Searching...
No Matches
abilityhandler.cpp
Go to the documentation of this file.
1/*
2 * The Mana Client
3 * Copyright (C) 2004-2009 The Mana World Development Team
4 * Copyright (C) 2009-2012 The Mana Developers
5 *
6 * This file is part of The Mana Client.
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 */
21
23
28
30
31namespace ManaServ {
32
34
39
41{
42 // TODO
43}
44
46{
48 msg.writeInt8(id);
49 msg.writeInt16(0);
51}
52
53void AbilityHandler::useOn(int id, int beingId)
54{
56 msg.writeInt8(id);
57 msg.writeInt16(beingId);
59}
60
61void AbilityHandler::useAt(int id, int x, int y)
62{
64 msg.writeInt8(id);
65 msg.writeInt16(x);
66 msg.writeInt16(y);
68}
69
70void AbilityHandler::useInDirection(int id, int direction)
71{
73 msg.writeInt8(id);
74 msg.writeInt8(direction);
76}
77
78} // namespace ManaServ
void handleMessage(MessageIn &msg) override
void useAt(int id, int x, int y) override
void useInDirection(int id, int direction) override
void useOn(int id, int beingId) override
void use(int id) override
void send(const ManaServ::MessageOut &msg)
Sends a message.
Used for parsing an incoming message from manaserv.
Definition messagein.h:37
Used for building an outgoing message to manaserv.
Definition messageout.h:37
void writeInt16(uint16_t value)
Writes an unsigned 16-bit integer to the message.
void writeInt8(uint8_t value)
Writes an unsigned 8-bit integer to the message.
Net::AbilityHandler * abilityHandler
Definition net.cpp:57
Connection * gameServerConnection
@ PGMSG_USE_ABILITY_ON_DIRECTION