summaryrefslogtreecommitdiff
path: root/src/localplayer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/localplayer.cpp')
-rw-r--r--src/localplayer.cpp28
1 files changed, 27 insertions, 1 deletions
diff --git a/src/localplayer.cpp b/src/localplayer.cpp
index 57dc8981..1cc0ae34 100644
--- a/src/localplayer.cpp
+++ b/src/localplayer.cpp
@@ -28,6 +28,7 @@
#include "graphics.h"
#include "inventory.h"
#include "item.h"
+#include "log.h"
#include "map.h"
#include "monster.h"
#include "particle.h"
@@ -167,6 +168,22 @@ void LocalPlayer::logic()
mMessageTime--;
}
+ if ((mSpecialRechargeUpdateNeeded%11) == 0)
+ {
+ mSpecialRechargeUpdateNeeded = 0;
+ for (std::map<int, Special>::iterator i = mSpecials.begin();
+ i != mSpecials.end();
+ i++)
+ {
+ i->second.currentMana += i->second.recharge;
+ if (i->second.currentMana > i->second.neededMana)
+ {
+ i->second.currentMana = i->second.neededMana;
+ }
+ }
+ }
+ mSpecialRechargeUpdateNeeded++;
+
#ifdef EATHENA_SUPPORT
// Targeting allowed 4 times a second
if (get_elapsed_time(mLastTarget) >= 250)
@@ -633,13 +650,22 @@ void LocalPlayer::attack()
Net::GameServer::Player::attack(getSpriteDirection());
}
*/
-#endif
void LocalPlayer::useSpecial(int special)
{
Net::getSpecialHandler()->use(special);
}
+void LocalPlayer::setSpecialStatus(int id, int current, int max, int recharge)
+{
+ logger->log("SpecialUpdate Skill #%d -- (%d/%d) -> %d", id, current, max, recharge);
+ mSpecials[id].currentMana = current;
+ mSpecials[id].neededMana = max;
+ mSpecials[id].recharge = recharge;
+}
+
+#endif
+
void LocalPlayer::attack(Being *target, bool keep)
{
#ifdef TMWSERV_SUPPORT