diff options
Diffstat (limited to 'src/net')
-rw-r--r-- | src/net/ea/playerhandler.cpp | 15 | ||||
-rw-r--r-- | src/net/ea/playerhandler.h | 2 | ||||
-rw-r--r-- | src/net/playerhandler.h | 2 | ||||
-rw-r--r-- | src/net/tmwserv/playerhandler.cpp | 5 | ||||
-rw-r--r-- | src/net/tmwserv/playerhandler.h | 2 |
5 files changed, 22 insertions, 4 deletions
diff --git a/src/net/ea/playerhandler.cpp b/src/net/ea/playerhandler.cpp index ea3f40d5..3528eeee 100644 --- a/src/net/ea/playerhandler.cpp +++ b/src/net/ea/playerhandler.cpp @@ -260,10 +260,11 @@ void PlayerHandler::handleMessage(MessageIn &msg) case 0x002b: player_node->setAttributeEffective(MATK, value + ATTR_BONUS(MATK)); - player_node->setAttributeBase(MATK, value); break; + player_node->setAttributeBase(MATK, value); + statusWindow->update(StatusWindow::MP); break; case 0x002c: value += player_node->getAttributeBase(MATK); - player_node->setAttributeEffective(MATK, value); break; - + player_node->setAttributeEffective(MATK, value); + statusWindow->update(StatusWindow::MP); break; case 0x002d: player_node->setAttributeEffective(DEF, value + ATTR_BONUS(DEF)); player_node->setAttributeBase(DEF, value); break; @@ -333,7 +334,7 @@ void PlayerHandler::handleMessage(MessageIn &msg) } break; - case SMSG_PLAYER_STAT_UPDATE_3: + case SMSG_PLAYER_STAT_UPDATE_3: // Update a base attribute { int type = msg.readInt32(); int base = msg.readInt32(); @@ -404,6 +405,7 @@ void PlayerHandler::handleMessage(MessageIn &msg) player_node->setAttributeBase(MATK, val); val += msg.readInt16(); // MATK bonus player_node->setAttributeEffective(MATK, val); + statusWindow->update(StatusWindow::MP); val = msg.readInt16(); // DEF player_node->setAttributeBase(DEF, val); @@ -560,4 +562,9 @@ void PlayerHandler::ignoreAll(bool ignore) // TODO } +bool PlayerHandler::canUseMagic() +{ + return player_node->getAttributeEffective(MATK) > 0; +} + } // namespace EAthena diff --git a/src/net/ea/playerhandler.h b/src/net/ea/playerhandler.h index 7312dacf..78e64a88 100644 --- a/src/net/ea/playerhandler.h +++ b/src/net/ea/playerhandler.h @@ -58,6 +58,8 @@ class PlayerHandler : public MessageHandler, public Net::PlayerHandler void ignorePlayer(const std::string &player, bool ignore); void ignoreAll(bool ignore); + + bool canUseMagic(); }; } // namespace EAthena diff --git a/src/net/playerhandler.h b/src/net/playerhandler.h index 910424b3..a0fd8bac 100644 --- a/src/net/playerhandler.h +++ b/src/net/playerhandler.h @@ -54,6 +54,8 @@ class PlayerHandler virtual void ignorePlayer(const std::string &player, bool ignore) = 0; virtual void ignoreAll(bool ignore) = 0; + + virtual bool canUseMagic() = 0; }; } // namespace Net diff --git a/src/net/tmwserv/playerhandler.cpp b/src/net/tmwserv/playerhandler.cpp index 91b6dd8a..656befdf 100644 --- a/src/net/tmwserv/playerhandler.cpp +++ b/src/net/tmwserv/playerhandler.cpp @@ -390,4 +390,9 @@ void PlayerHandler::ignoreAll(bool ignore) // TODO } +bool PlayerHandler::canUseMagic() +{ + return true; +} + } // namespace TmwServ diff --git a/src/net/tmwserv/playerhandler.h b/src/net/tmwserv/playerhandler.h index 1c94b4e4..287baa3d 100644 --- a/src/net/tmwserv/playerhandler.h +++ b/src/net/tmwserv/playerhandler.h @@ -58,6 +58,8 @@ class PlayerHandler : public MessageHandler, public Net::PlayerHandler void ignoreAll(bool ignore); + bool canUseMagic(); + private: void handleMapChangeMessage(MessageIn &msg); }; |