diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/actions/actions.cpp | 4 | ||||
-rw-r--r-- | src/actormanager.cpp | 20 | ||||
-rw-r--r-- | src/being/being.cpp | 4 | ||||
-rw-r--r-- | src/being/localplayer.cpp | 16 | ||||
-rw-r--r-- | src/being/playerinfo.cpp | 18 | ||||
-rw-r--r-- | src/enums/being/attributes.h | 60 | ||||
-rw-r--r-- | src/gui/widgets/characterdisplay.cpp | 2 | ||||
-rw-r--r-- | src/gui/windows/charselectdialog.cpp | 12 | ||||
-rw-r--r-- | src/gui/windows/chatwindow.cpp | 6 | ||||
-rw-r--r-- | src/gui/windows/killstats.cpp | 39 | ||||
-rw-r--r-- | src/gui/windows/ministatuswindow.cpp | 32 | ||||
-rw-r--r-- | src/gui/windows/skilldialog.cpp | 2 | ||||
-rw-r--r-- | src/gui/windows/statuswindow.cpp | 59 | ||||
-rw-r--r-- | src/net/ea/inventoryrecv.cpp | 4 | ||||
-rw-r--r-- | src/net/ea/playerhandler.cpp | 2 | ||||
-rw-r--r-- | src/net/ea/playerrecv.cpp | 6 | ||||
-rw-r--r-- | src/net/eathena/charserverrecv.cpp | 32 | ||||
-rw-r--r-- | src/net/eathena/playerhandler.cpp | 100 | ||||
-rw-r--r-- | src/net/eathena/playerrecv.cpp | 60 | ||||
-rw-r--r-- | src/net/tmwa/charserverrecv.cpp | 26 | ||||
-rw-r--r-- | src/net/tmwa/playerhandler.cpp | 100 | ||||
-rw-r--r-- | src/net/tmwa/playerrecv.cpp | 53 | ||||
-rw-r--r-- | src/resources/db/statdb.cpp | 12 | ||||
-rw-r--r-- | src/spellmanager.cpp | 2 |
24 files changed, 340 insertions, 331 deletions
diff --git a/src/actions/actions.cpp b/src/actions/actions.cpp index 1bb65fbed..615c081b3 100644 --- a/src/actions/actions.cpp +++ b/src/actions/actions.cpp @@ -566,7 +566,7 @@ impHandler0(healmd) #endif if (actorManager) { - const int matk = PlayerInfo::getStatEffective(Attributes::MATK); + const int matk = PlayerInfo::getStatEffective(Attributes::PLAYER_MATK); int maxHealingRadius; // magic levels < 2 @@ -601,7 +601,7 @@ impHandler0(itenplz) { if (playerHandler && playerHandler->canUseMagic() && - PlayerInfo::getAttribute(Attributes::MP) >= 3) + PlayerInfo::getAttribute(Attributes::PLAYER_MP) >= 3) { actorManager->itenplz(); } diff --git a/src/actormanager.cpp b/src/actormanager.cpp index bee73cd05..4edd23476 100644 --- a/src/actormanager.cpp +++ b/src/actormanager.cpp @@ -1407,9 +1407,9 @@ void ActorManager::heal(const Being *const target) const // self if (target && localPlayer->getName() == target->getName()) { - if (PlayerInfo::getAttribute(Attributes::MP) >= 6 - && PlayerInfo::getAttribute(Attributes::HP) - != PlayerInfo::getAttribute(Attributes::MAX_HP)) + if (PlayerInfo::getAttribute(Attributes::PLAYER_MP) >= 6 + && PlayerInfo::getAttribute(Attributes::PLAYER_HP) + != PlayerInfo::getAttribute(Attributes::PLAYER_MAX_HP)) { if (!PacketLimiter::limitPackets(PacketType::PACKET_CHAT)) return; @@ -1420,7 +1420,7 @@ void ActorManager::heal(const Being *const target) const else if (PlayerInfo::getSkillLevel(340) < 2 || PlayerInfo::getSkillLevel(341) < 2) { - if (PlayerInfo::getAttribute(Attributes::MP) >= 6) + if (PlayerInfo::getAttribute(Attributes::PLAYER_MP) >= 6) { if (target && target->getType() != ActorType::Monster) { @@ -1429,8 +1429,8 @@ void ActorManager::heal(const Being *const target) const chatWindow->localChatInput(mSpellHeal1 + " " + target->getName()); } - else if (PlayerInfo::getAttribute(Attributes::HP) - != PlayerInfo::getAttribute(Attributes::MAX_HP)) + else if (PlayerInfo::getAttribute(Attributes::PLAYER_HP) + != PlayerInfo::getAttribute(Attributes::PLAYER_MAX_HP)) { if (!PacketLimiter::limitPackets(PacketType::PACKET_CHAT)) return; @@ -1442,7 +1442,7 @@ void ActorManager::heal(const Being *const target) const else { // mp > 10 and target not monster - if (PlayerInfo::getAttribute(Attributes::MP) >= 10 && target + if (PlayerInfo::getAttribute(Attributes::PLAYER_MP) >= 10 && target && target->getType() != ActorType::Monster) { // target not enemy @@ -1464,9 +1464,9 @@ void ActorManager::heal(const Being *const target) const } // heal self if selected monster or selection empty else if ((!target || target->getType() == ActorType::Monster) - && PlayerInfo::getAttribute(Attributes::MP) >= 6 - && PlayerInfo::getAttribute(Attributes::HP) - != PlayerInfo::getAttribute(Attributes::MAX_HP)) + && PlayerInfo::getAttribute(Attributes::PLAYER_MP) >= 6 + && PlayerInfo::getAttribute(Attributes::PLAYER_HP) + != PlayerInfo::getAttribute(Attributes::PLAYER_MAX_HP)) { if (!PacketLimiter::limitPackets(PacketType::PACKET_CHAT)) return; diff --git a/src/being/being.cpp b/src/being/being.cpp index 935c2112c..b91b40844 100644 --- a/src/being/being.cpp +++ b/src/being/being.cpp @@ -3725,8 +3725,8 @@ void Being::drawPlayerSpriteAt(Graphics *restrict const graphics, mAction != BeingAction::DEAD) { drawHpBar(graphics, - PlayerInfo::getAttribute(Attributes::MAX_HP), - PlayerInfo::getAttribute(Attributes::HP), + PlayerInfo::getAttribute(Attributes::PLAYER_MAX_HP), + PlayerInfo::getAttribute(Attributes::PLAYER_HP), 0, UserColorId::PLAYER_HP, UserColorId::PLAYER_HP2, diff --git a/src/being/localplayer.cpp b/src/being/localplayer.cpp index e065fafe4..3ae1cd90b 100644 --- a/src/being/localplayer.cpp +++ b/src/being/localplayer.cpp @@ -194,9 +194,9 @@ LocalPlayer::LocalPlayer(const BeingId id, else mNameColor = nullptr; - PlayerInfo::setStatBase(Attributes::WALK_SPEED, + PlayerInfo::setStatBase(Attributes::PLAYER_WALK_SPEED, getWalkSpeed()); - PlayerInfo::setStatMod(Attributes::WALK_SPEED, 0); + PlayerInfo::setStatMod(Attributes::PLAYER_WALK_SPEED, 0); loadHomes(); @@ -1167,7 +1167,7 @@ void LocalPlayer::statChanged(const AttributesT id, const int oldVal2) { if (!mShowJobExp || - id != Attributes::JOB || + id != Attributes::PLAYER_JOB || serverFeatures->haveExpPacket()) { return; @@ -1189,7 +1189,7 @@ void LocalPlayer::attributeChanged(const AttributesT id, PRAGMA45(GCC diagnostic ignored "-Wswitch-enum") switch (id) { - case Attributes::EXP: + case Attributes::PLAYER_EXP: { if (serverFeatures->haveExpPacket()) break; @@ -1200,10 +1200,10 @@ void LocalPlayer::attributeChanged(const AttributesT id, addXpMessage(change); break; } - case Attributes::LEVEL: + case Attributes::PLAYER_LEVEL: mLevel = newVal; break; - case Attributes::HP: + case Attributes::PLAYER_HP: if (oldVal != 0 && newVal == 0) PlayerDeathListener::distributeEvent(); break; @@ -1677,7 +1677,7 @@ void LocalPlayer::tryMagic(const std::string &spell, const int baseMagic, if (PlayerInfo::getSkillLevel(340) >= baseMagic && PlayerInfo::getSkillLevel(342) >= schoolMagic) { - if (PlayerInfo::getAttribute(Attributes::MP) >= mana) + if (PlayerInfo::getAttribute(Attributes::PLAYER_MP) >= mana) { if (!PacketLimiter::limitPackets(PacketType::PACKET_CHAT)) return; @@ -2562,7 +2562,7 @@ void LocalPlayer::respawn() int LocalPlayer::getLevel() const { - return PlayerInfo::getAttribute(Attributes::LEVEL); + return PlayerInfo::getAttribute(Attributes::PLAYER_LEVEL); } void LocalPlayer::updateNavigateList() diff --git a/src/being/playerinfo.cpp b/src/being/playerinfo.cpp index 68b3ee8e1..6ed4fceba 100644 --- a/src/being/playerinfo.cpp +++ b/src/being/playerinfo.cpp @@ -398,18 +398,22 @@ void setTrading(const Trading trading) void updateAttrs() { - const int attackDelay = getStatBase(Attributes::ATTACK_DELAY); + const int attackDelay = getStatBase(Attributes::PLAYER_ATTACK_DELAY); if (attackDelay) { - setStatBase(Attributes::ATTACK_SPEED, - getStatBase(Attributes::ATK) * 1000 / attackDelay, Notify_false); - setStatMod(Attributes::ATTACK_SPEED, - getStatMod(Attributes::ATK) * 1000 / attackDelay, Notify_true); + setStatBase(Attributes::PLAYER_ATTACK_SPEED, + getStatBase(Attributes::PLAYER_ATK) * 1000 / attackDelay, + Notify_false); + setStatMod(Attributes::PLAYER_ATTACK_SPEED, + getStatMod(Attributes::PLAYER_ATK) * 1000 / attackDelay, + Notify_true); } else { - setStatBase(Attributes::ATTACK_SPEED, 0, Notify_false); - setStatMod(Attributes::ATTACK_SPEED, 0, Notify_true); + setStatBase(Attributes::PLAYER_ATTACK_SPEED, 0, + Notify_false); + setStatMod(Attributes::PLAYER_ATTACK_SPEED, 0, + Notify_true); } } diff --git a/src/enums/being/attributes.h b/src/enums/being/attributes.h index d5198be79..ca4f0289b 100644 --- a/src/enums/being/attributes.h +++ b/src/enums/being/attributes.h @@ -26,39 +26,39 @@ enumStart(Attributes) { - LEVEL = 0, - HP, - MAX_HP, - MP, - MAX_MP, - EXP, - EXP_NEEDED, + PLAYER_LEVEL = 0, + PLAYER_HP, + PLAYER_MAX_HP, + PLAYER_MP, + PLAYER_MAX_MP, + PLAYER_EXP, + PLAYER_EXP_NEEDED, MONEY, TOTAL_WEIGHT, MAX_WEIGHT, - JOB = 10, - STR = 13, - AGI = 14, - VIT = 15, - INT = 16, - DEX = 17, - LUK = 18, - SKILL_POINTS, - CHAR_POINTS, - CORR_POINTS, - ATTACK_DELAY = 100, - ATTACK_RANGE = 101, - WALK_SPEED = 102, - ATTACK_SPEED = 103, - KARMA, - MANNER, - CRIT, - FLEE, - HIT, - MDEF, - MATK, - DEF, - ATK, + PLAYER_JOB = 10, + PLAYER_STR = 13, + PLAYER_AGI = 14, + PLAYER_VIT = 15, + PLAYER_INT = 16, + PLAYER_DEX = 17, + PLAYER_LUK = 18, + PLAYER_SKILL_POINTS, + PLAYER_CHAR_POINTS, + PLAYER_CORR_POINTS, + PLAYER_ATTACK_DELAY = 100, + PLAYER_ATTACK_RANGE = 101, + PLAYER_WALK_SPEED = 102, + PLAYER_ATTACK_SPEED = 103, + PLAYER_KARMA, + PLAYER_MANNER, + PLAYER_CRIT, + PLAYER_FLEE, + PLAYER_HIT, + PLAYER_MDEF, + PLAYER_MATK, + PLAYER_DEF, + PLAYER_ATK, CART_TOTAL_WEIGHT = 1000, CART_MAX_WEIGHT, MAX_ATTRIBUTE diff --git a/src/gui/widgets/characterdisplay.cpp b/src/gui/widgets/characterdisplay.cpp index 560e1cb54..7aa9fe795 100644 --- a/src/gui/widgets/characterdisplay.cpp +++ b/src/gui/widgets/characterdisplay.cpp @@ -135,7 +135,7 @@ void CharacterDisplay::mouseMoved(MouseEvent &event A_UNUSED) // TRANSLATORS: character level strprintf(_("Level: %u"), CAST_U32( - mCharacter->data.mAttributes[Attributes::LEVEL])), + mCharacter->data.mAttributes[Attributes::PLAYER_LEVEL])), // TRANSLATORS: character money strprintf(_("Money: %s"), Units::formatCurrency( mCharacter->data.mAttributes[Attributes::MONEY]).c_str())); diff --git a/src/gui/windows/charselectdialog.cpp b/src/gui/windows/charselectdialog.cpp index c71d0eb52..4f62ac9ba 100644 --- a/src/gui/windows/charselectdialog.cpp +++ b/src/gui/windows/charselectdialog.cpp @@ -244,17 +244,17 @@ void CharSelectDialog::action(const ActionEvent &event) _("Hp: %u/%u\nMp: %u/%u\nLevel: %u\n" "Experience: %u\nMoney: %s"), CAST_U32( - character->data.mAttributes[Attributes::HP]), + character->data.mAttributes[Attributes::PLAYER_HP]), CAST_U32( - character->data.mAttributes[Attributes::MAX_HP]), + character->data.mAttributes[Attributes::PLAYER_MAX_HP]), CAST_U32( - character->data.mAttributes[Attributes::MP]), + character->data.mAttributes[Attributes::PLAYER_MP]), CAST_U32( - character->data.mAttributes[Attributes::MAX_MP]), + character->data.mAttributes[Attributes::PLAYER_MAX_MP]), CAST_U32( - character->data.mAttributes[Attributes::LEVEL]), + character->data.mAttributes[Attributes::PLAYER_LEVEL]), CAST_U32( - character->data.mAttributes[Attributes::EXP]), + character->data.mAttributes[Attributes::PLAYER_EXP]), Units::formatCurrency( character->data.mAttributes[Attributes::MONEY]).c_str()); CREATEWIDGET(OkDialog, data->getName(), msg, diff --git a/src/gui/windows/chatwindow.cpp b/src/gui/windows/chatwindow.cpp index d6081f5c6..c9107b151 100644 --- a/src/gui/windows/chatwindow.cpp +++ b/src/gui/windows/chatwindow.cpp @@ -974,7 +974,7 @@ void ChatWindow::statChanged(const AttributesT id, if (!mShowBattleEvents || !config.getBoolValue("showJobExp")) return; - if (id != Attributes::JOB) + if (id != Attributes::PLAYER_JOB) return; const std::pair<int, int> exp = PlayerInfo::getStatExperience(id); @@ -1000,7 +1000,7 @@ void ChatWindow::attributeChanged(const AttributesT id, PRAGMA45(GCC diagnostic ignored "-Wswitch-enum") switch (id) { - case Attributes::EXP: + case Attributes::PLAYER_EXP: { if (oldVal > newVal) break; @@ -1013,7 +1013,7 @@ void ChatWindow::attributeChanged(const AttributesT id, } break; } - case Attributes::LEVEL: + case Attributes::PLAYER_LEVEL: battleChatLog(std::string("Level: ").append(toString(newVal)), ChatMsgType::BY_SERVER); break; diff --git a/src/gui/windows/killstats.cpp b/src/gui/windows/killstats.cpp index 0be2044ae..c745bc151 100644 --- a/src/gui/windows/killstats.cpp +++ b/src/gui/windows/killstats.cpp @@ -111,8 +111,8 @@ KillStats::KillStats() : if (setupWindow) setupWindow->registerWindowForReset(this); - const int xp(PlayerInfo::getAttribute(Attributes::EXP)); - int xpNextLevel(PlayerInfo::getAttribute(Attributes::EXP_NEEDED)); + const int xp(PlayerInfo::getAttribute(Attributes::PLAYER_EXP)); + int xpNextLevel(PlayerInfo::getAttribute(Attributes::PLAYER_EXP_NEEDED)); if (!xpNextLevel) xpNextLevel = 1; @@ -161,7 +161,7 @@ void KillStats::action(const ActionEvent &event) mKillCounter = 0; mExpCounter = 0; mLine3->setCaption(strprintf("1%% = %d exp, avg mob for 1%%: %s", - PlayerInfo::getAttribute(Attributes::EXP_NEEDED) / 100, "?")); + PlayerInfo::getAttribute(Attributes::PLAYER_EXP_NEEDED) / 100, "?")); // TRANSLATORS: kill stats window label mLine4->setCaption(strprintf(_("Kills: %s, total exp: %s"), "?", "?")); // TRANSLATORS: kill stats window label @@ -200,7 +200,7 @@ void KillStats::resetTimes() void KillStats::gainXp(int xp) { - const int expNeed = PlayerInfo::getAttribute(Attributes::EXP_NEEDED); + const int expNeed = PlayerInfo::getAttribute(Attributes::PLAYER_EXP_NEEDED); if (xp == expNeed) xp = 0; else if (!xp) @@ -229,7 +229,7 @@ void KillStats::gainXp(int xp) if (timeDiff <= 0.001) timeDiff = 1; - const int exp = PlayerInfo::getAttribute(Attributes::EXP); + const int exp = PlayerInfo::getAttribute(Attributes::PLAYER_EXP); // TRANSLATORS: kill stats window label mLine1->setCaption(strprintf(_("Level: %d at %f%%"), localPlayer->getLevel(), static_cast<double>(exp) @@ -292,7 +292,7 @@ void KillStats::recalcStats() // Need Update Exp Counter if (curTime - m1minExpTime > 60) { - const int newExp = PlayerInfo::getAttribute(Attributes::EXP); + const int newExp = PlayerInfo::getAttribute(Attributes::PLAYER_EXP); if (m1minExpTime != 0) m1minSpeed = newExp - m1minExpNum; else @@ -303,7 +303,7 @@ void KillStats::recalcStats() if (curTime != 0 && mLastHost == 0xFF6B66 && cur_time > 1) { - const int newExp = PlayerInfo::getAttribute(Attributes::EXP_NEEDED); + const int newExp = PlayerInfo::getAttribute(Attributes::PLAYER_EXP_NEEDED); if (m1minExpTime != 0) m1minSpeed = newExp - m1minExpNum; mStatsReUpdated = true; @@ -312,7 +312,7 @@ void KillStats::recalcStats() if (curTime - m5minExpTime > 60*5) { - const int newExp = PlayerInfo::getAttribute(Attributes::EXP); + const int newExp = PlayerInfo::getAttribute(Attributes::PLAYER_EXP); if (m5minExpTime != 0) m5minSpeed = newExp - m5minExpNum; else @@ -323,7 +323,7 @@ void KillStats::recalcStats() if (curTime - m15minExpTime > 60*15) { - const int newExp = PlayerInfo::getAttribute(Attributes::EXP); + const int newExp = PlayerInfo::getAttribute(Attributes::PLAYER_EXP); if (m15minExpTime != 0) m15minSpeed = newExp - m15minExpNum; else @@ -346,8 +346,8 @@ void KillStats::update() // TRANSLATORS: kill stats window label mExpTime1Label->setCaption(strprintf(_(" Time for next level: %s"), toString(static_cast<float>((PlayerInfo::getAttribute( - Attributes::EXP_NEEDED) - PlayerInfo::getAttribute( - Attributes::EXP)) / static_cast<float>(m1minSpeed))).c_str())); + Attributes::PLAYER_EXP_NEEDED) - PlayerInfo::getAttribute( + Attributes::PLAYER_EXP)) / static_cast<float>(m1minSpeed))).c_str())); } else { @@ -366,8 +366,8 @@ void KillStats::update() // TRANSLATORS: kill stats window label mExpTime5Label->setCaption(strprintf(_(" Time for next level: %s"), toString(static_cast<float>((PlayerInfo::getAttribute( - Attributes::EXP_NEEDED) - PlayerInfo::getAttribute( - Attributes::EXP)) / m5minSpeed * 5)).c_str())); + Attributes::PLAYER_EXP_NEEDED) - PlayerInfo::getAttribute( + Attributes::PLAYER_EXP)) / m5minSpeed * 5)).c_str())); } else { @@ -388,8 +388,8 @@ void KillStats::update() // TRANSLATORS: kill stats window label mExpTime15Label->setCaption(strprintf(_(" Time for next level: %s"), toString(static_cast<float>((PlayerInfo::getAttribute( - Attributes::EXP_NEEDED) - PlayerInfo::getAttribute( - Attributes::EXP)) / m15minSpeed * 15)).c_str())); + Attributes::PLAYER_EXP_NEEDED) - PlayerInfo::getAttribute( + Attributes::PLAYER_EXP)) / m15minSpeed * 15)).c_str())); } else { @@ -409,17 +409,18 @@ void KillStats::attributeChanged(const AttributesT id, PRAGMA45(GCC diagnostic ignored "-Wswitch-enum") switch (id) { - case Attributes::EXP: - case Attributes::EXP_NEEDED: + case Attributes::PLAYER_EXP: + case Attributes::PLAYER_EXP_NEEDED: gainXp(newVal - oldVal); break; - case Attributes::LEVEL: + case Attributes::PLAYER_LEVEL: mKillCounter = 0; mKillTCounter = 0; mExpCounter = 0; mExpTCounter = 0; mLine3->setCaption(strprintf("1%% = %d exp, avg mob for 1%%: %s", - PlayerInfo::getAttribute(Attributes::EXP_NEEDED) / 100, "?")); + PlayerInfo::getAttribute(Attributes::PLAYER_EXP_NEEDED) / 100, + "?")); mLine4->setCaption(strprintf( // TRANSLATORS: kill stats window label _("Kills: %s, total exp: %s"), "?", "?")); diff --git a/src/gui/windows/ministatuswindow.cpp b/src/gui/windows/ministatuswindow.cpp index 6bf43d216..b2d89adef 100644 --- a/src/gui/windows/ministatuswindow.cpp +++ b/src/gui/windows/ministatuswindow.cpp @@ -274,16 +274,16 @@ void MiniStatusWindow::attributeChanged(const AttributesT id, PRAGMA45(GCC diagnostic ignored "-Wswitch-enum") switch (id) { - case Attributes::HP: - case Attributes::MAX_HP: + case Attributes::PLAYER_HP: + case Attributes::PLAYER_MAX_HP: StatusWindow::updateHPBar(mHpBar); break; - case Attributes::MP: - case Attributes::MAX_MP: + case Attributes::PLAYER_MP: + case Attributes::PLAYER_MAX_MP: statusWindow->updateMPBar(mMpBar); break; - case Attributes::EXP: - case Attributes::EXP_NEEDED: + case Attributes::PLAYER_EXP: + case Attributes::PLAYER_EXP_NEEDED: StatusWindow::updateXPBar(mXpBar); break; case Attributes::TOTAL_WEIGHT: @@ -354,18 +354,18 @@ void MiniStatusWindow::mouseMoved(MouseEvent &event) { // TRANSLATORS: status bar label level = strprintf(_("Level: %d (GM %d)"), - PlayerInfo::getAttribute(Attributes::LEVEL), + PlayerInfo::getAttribute(Attributes::PLAYER_LEVEL), localPlayer->getGMLevel()); } else { // TRANSLATORS: status bar label level = strprintf(_("Level: %d"), - PlayerInfo::getAttribute(Attributes::LEVEL)); + PlayerInfo::getAttribute(Attributes::PLAYER_LEVEL)); } - const int exp = PlayerInfo::getAttribute(Attributes::EXP); - const int expNeed = PlayerInfo::getAttribute(Attributes::EXP_NEEDED); + const int exp = PlayerInfo::getAttribute(Attributes::PLAYER_EXP); + const int expNeed = PlayerInfo::getAttribute(Attributes::PLAYER_EXP_NEEDED); if (exp > expNeed) { textPopup->show(x + rect.x, y + rect.y, level, strprintf("%d/%d", @@ -383,25 +383,25 @@ void MiniStatusWindow::mouseMoved(MouseEvent &event) else if (event.getSource() == mHpBar) { textPopup->show(x + rect.x, y + rect.y, event.getSource()->getId(), - strprintf("%d/%d", PlayerInfo::getAttribute(Attributes::HP), - PlayerInfo::getAttribute(Attributes::MAX_HP))); + strprintf("%d/%d", PlayerInfo::getAttribute(Attributes::PLAYER_HP), + PlayerInfo::getAttribute(Attributes::PLAYER_MAX_HP))); mStatusPopup->hide(); } else if (event.getSource() == mMpBar) { textPopup->show(x + rect.x, y + rect.y, event.getSource()->getId(), - strprintf("%d/%d", PlayerInfo::getAttribute(Attributes::MP), - PlayerInfo::getAttribute(Attributes::MAX_MP))); + strprintf("%d/%d", PlayerInfo::getAttribute(Attributes::PLAYER_MP), + PlayerInfo::getAttribute(Attributes::PLAYER_MAX_MP))); mStatusPopup->hide(); } else if (event.getSource() == mJobBar) { const std::pair<int, int> exp = PlayerInfo::getStatExperience( - Attributes::JOB); + Attributes::PLAYER_JOB); // TRANSLATORS: job bar label const std::string level = strprintf(_("Job level: %d"), - PlayerInfo::getStatBase(Attributes::JOB)); + PlayerInfo::getStatBase(Attributes::PLAYER_JOB)); if (exp.first > exp.second) { diff --git a/src/gui/windows/skilldialog.cpp b/src/gui/windows/skilldialog.cpp index 562b8471d..eed99542c 100644 --- a/src/gui/windows/skilldialog.cpp +++ b/src/gui/windows/skilldialog.cpp @@ -206,7 +206,7 @@ void SkillDialog::update() { // TRANSLATORS: skills dialog label mPointsLabel->setCaption(strprintf(_("Skill points available: %d"), - PlayerInfo::getAttribute(Attributes::SKILL_POINTS))); + PlayerInfo::getAttribute(Attributes::PLAYER_SKILL_POINTS))); mPointsLabel->adjustSize(); FOR_EACH (SkillMap::const_iterator, it, mSkills) diff --git a/src/gui/windows/statuswindow.cpp b/src/gui/windows/statuswindow.cpp index 60aab8ca3..b37896476 100644 --- a/src/gui/windows/statuswindow.cpp +++ b/src/gui/windows/statuswindow.cpp @@ -106,12 +106,12 @@ StatusWindow::StatusWindow() : localPlayer->getRaceName().c_str())); } - int max = PlayerInfo::getAttribute(Attributes::MAX_HP); + int max = PlayerInfo::getAttribute(Attributes::PLAYER_MAX_HP); if (!max) max = 1; mHpBar = new ProgressBar(this, - static_cast<float>(PlayerInfo::getAttribute(Attributes::HP)) + static_cast<float>(PlayerInfo::getAttribute(Attributes::PLAYER_HP)) / static_cast<float>(max), 80, 0, @@ -120,9 +120,9 @@ StatusWindow::StatusWindow() : mHpBar->setColor(getThemeColor(ThemeColorId::HP_BAR), getThemeColor(ThemeColorId::HP_BAR_OUTLINE)); - max = PlayerInfo::getAttribute(Attributes::EXP_NEEDED); + max = PlayerInfo::getAttribute(Attributes::PLAYER_EXP_NEEDED); mXpBar = new ProgressBar(this, - max ? static_cast<float>(PlayerInfo::getAttribute(Attributes::EXP)) + max ? static_cast<float>(PlayerInfo::getAttribute(Attributes::PLAYER_EXP)) / static_cast<float>(max) : static_cast<float>(0), 80, 0, @@ -133,13 +133,13 @@ StatusWindow::StatusWindow() : const bool job = serverConfig.getValueBool("showJob", true); - max = PlayerInfo::getAttribute(Attributes::MAX_MP); + max = PlayerInfo::getAttribute(Attributes::PLAYER_MAX_MP); // TRANSLATORS: status window label mMpLabel = new Label(this, _("MP:")); const bool useMagic = playerHandler->canUseMagic(); mMpBar = new ProgressBar(this, max ? static_cast<float>(PlayerInfo::getAttribute( - Attributes::MAX_MP)) / static_cast<float>(max) + Attributes::PLAYER_MAX_MP)) / static_cast<float>(max) : static_cast<float>(0), 80, 0, @@ -224,7 +224,7 @@ StatusWindow::StatusWindow() : mMoneyLabel->adjustSize(); // TRANSLATORS: status window label mCharacterPointsLabel->setCaption(strprintf(_("Character points: %d"), - PlayerInfo::getAttribute(Attributes::CHAR_POINTS))); + PlayerInfo::getAttribute(Attributes::PLAYER_CHAR_POINTS))); mCharacterPointsLabel->adjustSize(); updateLevelLabel(); @@ -259,14 +259,14 @@ void StatusWindow::updateLevelLabel() { // TRANSLATORS: status window label mLvlLabel->setCaption(strprintf(_("Level: %d (GM %d)"), - PlayerInfo::getAttribute(Attributes::LEVEL), + PlayerInfo::getAttribute(Attributes::PLAYER_LEVEL), localPlayer->getGMLevel())); } else { // TRANSLATORS: status window label mLvlLabel->setCaption(strprintf(_("Level: %d"), - PlayerInfo::getAttribute(Attributes::LEVEL))); + PlayerInfo::getAttribute(Attributes::PLAYER_LEVEL))); } mLvlLabel->adjustSize(); } @@ -279,7 +279,7 @@ void StatusWindow::statChanged(const AttributesT id, if (blocked) return; - if (id == Attributes::JOB) + if (id == Attributes::PLAYER_JOB) { if (mJobLvlLabel) { @@ -339,18 +339,18 @@ void StatusWindow::attributeChanged(const AttributesT id, PRAGMA45(GCC diagnostic ignored "-Wswitch-enum") switch (id) { - case Attributes::HP: - case Attributes::MAX_HP: + case Attributes::PLAYER_HP: + case Attributes::PLAYER_MAX_HP: updateHPBar(mHpBar, true); break; - case Attributes::MP: - case Attributes::MAX_MP: + case Attributes::PLAYER_MP: + case Attributes::PLAYER_MAX_MP: updateMPBar(mMpBar, true); break; - case Attributes::EXP: - case Attributes::EXP_NEEDED: + case Attributes::PLAYER_EXP: + case Attributes::PLAYER_EXP_NEEDED: updateXPBar(mXpBar, false); break; @@ -361,7 +361,7 @@ void StatusWindow::attributeChanged(const AttributesT id, mMoneyLabel->adjustSize(); break; - case Attributes::CHAR_POINTS: + case Attributes::PLAYER_CHAR_POINTS: mCharacterPointsLabel->setCaption(strprintf( // TRANSLATORS: status window label _("Character points: %d"), newVal)); @@ -377,7 +377,7 @@ void StatusWindow::attributeChanged(const AttributesT id, break; // ?? - case Attributes::CORR_POINTS: + case Attributes::PLAYER_CORR_POINTS: // Update all attributes for (Attrs::const_iterator it = mAttrs.begin(); it != mAttrs.end(); ++it) @@ -387,7 +387,7 @@ void StatusWindow::attributeChanged(const AttributesT id, } break; - case Attributes::LEVEL: + case Attributes::PLAYER_LEVEL: // TRANSLATORS: status window label mLvlLabel->setCaption(strprintf(_("Level: %d"), newVal)); mLvlLabel->adjustSize(); @@ -448,8 +448,8 @@ void StatusWindow::updateHPBar(ProgressBar *const bar, const bool showMax) if (!bar) return; - const int hp = PlayerInfo::getAttribute(Attributes::HP); - const int maxHp = PlayerInfo::getAttribute(Attributes::MAX_HP); + const int hp = PlayerInfo::getAttribute(Attributes::PLAYER_HP); + const int maxHp = PlayerInfo::getAttribute(Attributes::PLAYER_MAX_HP); if (showMax) bar->setText(toString(hp).append("/").append(toString(maxHp))); else @@ -467,8 +467,8 @@ void StatusWindow::updateMPBar(ProgressBar *const bar, if (!bar) return; - const int mp = PlayerInfo::getAttribute(Attributes::MP); - const int maxMp = PlayerInfo::getAttribute(Attributes::MAX_MP); + const int mp = PlayerInfo::getAttribute(Attributes::PLAYER_MP); + const int maxMp = PlayerInfo::getAttribute(Attributes::PLAYER_MAX_MP); if (showMax) bar->setText(toString(mp).append("/").append(toString(maxMp))); else @@ -531,8 +531,8 @@ void StatusWindow::updateXPBar(ProgressBar *const bar, const bool percent) if (!bar) return; - updateProgressBar(bar, PlayerInfo::getAttribute(Attributes::EXP), - PlayerInfo::getAttribute(Attributes::EXP_NEEDED), percent); + updateProgressBar(bar, PlayerInfo::getAttribute(Attributes::PLAYER_EXP), + PlayerInfo::getAttribute(Attributes::PLAYER_EXP_NEEDED), percent); } void StatusWindow::updateJobBar(ProgressBar *const bar, const bool percent) @@ -541,7 +541,7 @@ void StatusWindow::updateJobBar(ProgressBar *const bar, const bool percent) return; const std::pair<int, int> exp = PlayerInfo::getStatExperience( - Attributes::JOB); + Attributes::PLAYER_JOB); updateProgressBar(bar, exp.first, exp.second, percent); } @@ -791,7 +791,7 @@ std::string ChangeDisplay::update() mPoints->setCaption(_("Max")); } - mInc->setEnabled(PlayerInfo::getAttribute(Attributes::CHAR_POINTS) + mInc->setEnabled(PlayerInfo::getAttribute(Attributes::PLAYER_CHAR_POINTS) >= mNeeded && mNeeded > 0); return AttrDisplay::update(); @@ -816,8 +816,9 @@ void ChangeDisplay::action(const ActionEvent &event) } const int newpoints = PlayerInfo::getAttribute( - Attributes::CHAR_POINTS) - cnt; - PlayerInfo::setAttribute(Attributes::CHAR_POINTS, newpoints); + Attributes::PLAYER_CHAR_POINTS) - cnt; + PlayerInfo::setAttribute(Attributes::PLAYER_CHAR_POINTS, + newpoints); const int newbase = PlayerInfo::getStatBase(mId) + cnt; PlayerInfo::setStatBase(mId, newbase); diff --git a/src/net/ea/inventoryrecv.cpp b/src/net/ea/inventoryrecv.cpp index 3910011d4..dbbe38c75 100644 --- a/src/net/ea/inventoryrecv.cpp +++ b/src/net/ea/inventoryrecv.cpp @@ -171,8 +171,8 @@ void InventoryRecv::processPlayerAttackRange(Net::MessageIn &msg) const int range = msg.readInt16("range"); if (localPlayer) localPlayer->setAttackRange(range); - PlayerInfo::setStatBase(Attributes::ATTACK_RANGE, range); - PlayerInfo::setStatMod(Attributes::ATTACK_RANGE, 0); + PlayerInfo::setStatBase(Attributes::PLAYER_ATTACK_RANGE, range); + PlayerInfo::setStatMod(Attributes::PLAYER_ATTACK_RANGE, 0); BLOCK_END("InventoryRecv::processPlayerAttackRange") } diff --git a/src/net/ea/playerhandler.cpp b/src/net/ea/playerhandler.cpp index 0c57ab0ef..5a231c25c 100644 --- a/src/net/ea/playerhandler.cpp +++ b/src/net/ea/playerhandler.cpp @@ -49,7 +49,7 @@ int PlayerHandler::getDefaultWalkSpeed() const bool PlayerHandler::canUseMagic() const { - return PlayerInfo::getStatEffective(Attributes::MATK) > 0; + return PlayerInfo::getStatEffective(Attributes::PLAYER_MATK) > 0; } } // namespace Ea diff --git a/src/net/ea/playerrecv.cpp b/src/net/ea/playerrecv.cpp index 8035b9612..7a3b448f7 100644 --- a/src/net/ea/playerrecv.cpp +++ b/src/net/ea/playerrecv.cpp @@ -181,9 +181,9 @@ void PlayerRecv::processPlayerStatUpdate4(Net::MessageIn &msg) { const int oldValue = PlayerInfo::getStatBase( static_cast<AttributesT>(type)); - const int points = PlayerInfo::getAttribute(Attributes::CHAR_POINTS) - + oldValue - value; - PlayerInfo::setAttribute(Attributes::CHAR_POINTS, points); + const int points = PlayerInfo::getAttribute( + Attributes::PLAYER_CHAR_POINTS) + oldValue - value; + PlayerInfo::setAttribute(Attributes::PLAYER_CHAR_POINTS, points); NotifyManager::notify(NotifyTypes::SKILL_RAISE_ERROR); } diff --git a/src/net/eathena/charserverrecv.cpp b/src/net/eathena/charserverrecv.cpp index 38cca2208..5341e16da 100644 --- a/src/net/eathena/charserverrecv.cpp +++ b/src/net/eathena/charserverrecv.cpp @@ -88,9 +88,9 @@ void CharServerRecv::readPlayerData(Net::MessageIn &msg, tempPlayer->setGender(token.sex); PlayerInfoBackend &data = character->data; - data.mAttributes[Attributes::EXP] = msg.readInt32("exp"); + data.mAttributes[Attributes::PLAYER_EXP] = msg.readInt32("exp"); data.mAttributes[Attributes::MONEY] = msg.readInt32("money"); - Stat &jobStat = data.mStats[Attributes::JOB]; + Stat &jobStat = data.mStats[Attributes::PLAYER_JOB]; jobStat.exp = msg.readInt32("job"); const int temp = msg.readInt32("job level"); @@ -109,16 +109,16 @@ void CharServerRecv::readPlayerData(Net::MessageIn &msg, if (packetVersion >= 20081217) { - data.mAttributes[Attributes::HP] = msg.readInt32("hp"); - data.mAttributes[Attributes::MAX_HP] = msg.readInt32("max hp"); + data.mAttributes[Attributes::PLAYER_HP] = msg.readInt32("hp"); + data.mAttributes[Attributes::PLAYER_MAX_HP] = msg.readInt32("max hp"); } else { - data.mAttributes[Attributes::HP] = msg.readInt16("hp"); - data.mAttributes[Attributes::MAX_HP] = msg.readInt16("max hp"); + data.mAttributes[Attributes::PLAYER_HP] = msg.readInt16("hp"); + data.mAttributes[Attributes::PLAYER_MAX_HP] = msg.readInt16("max hp"); } - data.mAttributes[Attributes::MP] = msg.readInt16("mp/sp"); - data.mAttributes[Attributes::MAX_MP] = msg.readInt16("max mp/sp"); + data.mAttributes[Attributes::PLAYER_MP] = msg.readInt16("mp/sp"); + data.mAttributes[Attributes::PLAYER_MAX_MP] = msg.readInt16("max mp/sp"); msg.readInt16("speed"); const uint16_t race = msg.readInt16("class"); @@ -133,7 +133,7 @@ void CharServerRecv::readPlayerData(Net::MessageIn &msg, weapon); tempPlayer->setWeaponId(weapon); - data.mAttributes[Attributes::LEVEL] = msg.readInt16("level"); + data.mAttributes[Attributes::PLAYER_LEVEL] = msg.readInt16("level"); msg.readInt16("skill points"); const int bottomClothes = msg.readInt16("head bottom"); @@ -161,12 +161,12 @@ void CharServerRecv::readPlayerData(Net::MessageIn &msg, character->dummy = tempPlayer; - character->data.mStats[Attributes::STR].base = msg.readUInt8("str"); - character->data.mStats[Attributes::AGI].base = msg.readUInt8("agi"); - character->data.mStats[Attributes::VIT].base = msg.readUInt8("vit"); - character->data.mStats[Attributes::INT].base = msg.readUInt8("int"); - character->data.mStats[Attributes::DEX].base = msg.readUInt8("dex"); - character->data.mStats[Attributes::LUK].base = msg.readUInt8("luk"); + character->data.mStats[Attributes::PLAYER_STR].base = msg.readUInt8("str"); + character->data.mStats[Attributes::PLAYER_AGI].base = msg.readUInt8("agi"); + character->data.mStats[Attributes::PLAYER_VIT].base = msg.readUInt8("vit"); + character->data.mStats[Attributes::PLAYER_INT].base = msg.readUInt8("int"); + character->data.mStats[Attributes::PLAYER_DEX].base = msg.readUInt8("dex"); + character->data.mStats[Attributes::PLAYER_LUK].base = msg.readUInt8("luk"); character->slot = msg.readInt16("character slot id"); if (packetVersion >= 20061023) @@ -282,7 +282,7 @@ void CharServerRecv::processCharMapInfo(Net::MessageIn &restrict msg) // Prevent the selected local player from being deleted localPlayer = charServerHandler->mSelectedCharacter->dummy; PlayerInfo::setBackend(charServerHandler->mSelectedCharacter->data); - PlayerInfo::setStatBase(Attributes::WALK_SPEED, + PlayerInfo::setStatBase(Attributes::PLAYER_WALK_SPEED, playerHandler->getDefaultWalkSpeed()); charServerHandler->mSelectedCharacter->dummy = nullptr; diff --git a/src/net/eathena/playerhandler.cpp b/src/net/eathena/playerhandler.cpp index b21e9d64d..5b7b8baf5 100644 --- a/src/net/eathena/playerhandler.cpp +++ b/src/net/eathena/playerhandler.cpp @@ -81,7 +81,7 @@ void PlayerHandler::emote(const uint8_t emoteId) const void PlayerHandler::increaseAttribute(const AttributesT attr, const int amount) const { - if (attr >= Attributes::STR && attr <= Attributes::LUK) + if (attr >= Attributes::PLAYER_STR && attr <= Attributes::PLAYER_LUK) { createOutPacket(CMSG_STAT_UPDATE_REQUEST); outMsg.writeInt16(CAST_S16(attr), "attribute id"); @@ -91,7 +91,7 @@ void PlayerHandler::increaseAttribute(const AttributesT attr, void PlayerHandler::increaseSkill(const uint16_t skillId) const { - if (PlayerInfo::getAttribute(Attributes::SKILL_POINTS) <= 0) + if (PlayerInfo::getAttribute(Attributes::PLAYER_SKILL_POINTS) <= 0) return; createOutPacket(CMSG_SKILL_LEVELUP_REQUEST); @@ -520,26 +520,26 @@ void PlayerHandler::setStat(Net::MessageIn &msg, { case Sp::SPEED: localPlayer->setWalkSpeed(base); - PlayerInfo::setStatBase(Attributes::WALK_SPEED, base); - PlayerInfo::setStatMod(Attributes::WALK_SPEED, 0); + PlayerInfo::setStatBase(Attributes::PLAYER_WALK_SPEED, base); + PlayerInfo::setStatMod(Attributes::PLAYER_WALK_SPEED, 0); break; case Sp::BASEEXP: - PlayerInfo::setAttribute(Attributes::EXP, base); + PlayerInfo::setAttribute(Attributes::PLAYER_EXP, base); break; case Sp::JOBEXP: - PlayerInfo::setStatExperience(Attributes::JOB, base, - PlayerInfo::getStatExperience(Attributes::JOB).second); + PlayerInfo::setStatExperience(Attributes::PLAYER_JOB, base, + PlayerInfo::getStatExperience(Attributes::PLAYER_JOB).second); break; case Sp::KARMA: - PlayerInfo::setStatBase(Attributes::KARMA, base); - PlayerInfo::setStatMod(Attributes::KARMA, 0); + PlayerInfo::setStatBase(Attributes::PLAYER_KARMA, base); + PlayerInfo::setStatMod(Attributes::PLAYER_KARMA, 0); break; case Sp::MANNER: - PlayerInfo::setStatBase(Attributes::MANNER, base); - PlayerInfo::setStatMod(Attributes::MANNER, 0); + PlayerInfo::setStatBase(Attributes::PLAYER_MANNER, base); + PlayerInfo::setStatMod(Attributes::PLAYER_MANNER, 0); break; case Sp::HP: - PlayerInfo::setAttribute(Attributes::HP, base); + PlayerInfo::setAttribute(Attributes::PLAYER_HP, base); if (localPlayer->isInParty() && Party::getParty(1)) { PartyMember *const m = Party::getParty(1) @@ -547,12 +547,12 @@ void PlayerHandler::setStat(Net::MessageIn &msg, if (m) { m->setHp(base); - m->setMaxHp(PlayerInfo::getAttribute(Attributes::MAX_HP)); + m->setMaxHp(PlayerInfo::getAttribute(Attributes::PLAYER_MAX_HP)); } } break; case Sp::MAXHP: - PlayerInfo::setAttribute(Attributes::MAX_HP, base); + PlayerInfo::setAttribute(Attributes::PLAYER_MAX_HP, base); if (localPlayer->isInParty() && Party::getParty(1)) { @@ -560,22 +560,22 @@ void PlayerHandler::setStat(Net::MessageIn &msg, localPlayer->getId()); if (m) { - m->setHp(PlayerInfo::getAttribute(Attributes::HP)); + m->setHp(PlayerInfo::getAttribute(Attributes::PLAYER_HP)); m->setMaxHp(base); } } break; case Sp::SP: - PlayerInfo::setAttribute(Attributes::MP, base); + PlayerInfo::setAttribute(Attributes::PLAYER_MP, base); break; case Sp::MAXSP: - PlayerInfo::setAttribute(Attributes::MAX_MP, base); + PlayerInfo::setAttribute(Attributes::PLAYER_MAX_MP, base); break; case Sp::STATUSPOINT: - PlayerInfo::setAttribute(Attributes::CHAR_POINTS, base); + PlayerInfo::setAttribute(Attributes::PLAYER_CHAR_POINTS, base); break; case Sp::BASELEVEL: - PlayerInfo::setAttribute(Attributes::LEVEL, base); + PlayerInfo::setAttribute(Attributes::PLAYER_LEVEL, base); if (localPlayer) { localPlayer->setLevel(base); @@ -583,27 +583,27 @@ void PlayerHandler::setStat(Net::MessageIn &msg, } break; case Sp::SKILLPOINT: - PlayerInfo::setAttribute(Attributes::SKILL_POINTS, base); + PlayerInfo::setAttribute(Attributes::PLAYER_SKILL_POINTS, base); if (skillDialog) skillDialog->update(); break; case Sp::STR: - setStatComplex(Attributes::STR); + setStatComplex(Attributes::PLAYER_STR); break; case Sp::AGI: - setStatComplex(Attributes::AGI); + setStatComplex(Attributes::PLAYER_AGI); break; case Sp::VIT: - setStatComplex(Attributes::VIT); + setStatComplex(Attributes::PLAYER_VIT); break; case Sp::INT: - setStatComplex(Attributes::INT); + setStatComplex(Attributes::PLAYER_INT); break; case Sp::DEX: - setStatComplex(Attributes::DEX); + setStatComplex(Attributes::PLAYER_DEX); break; case Sp::LUK: - setStatComplex(Attributes::LUK); + setStatComplex(Attributes::PLAYER_LUK); break; case Sp::ZENY: { @@ -624,12 +624,12 @@ void PlayerHandler::setStat(Net::MessageIn &msg, break; } case Sp::NEXTBASEEXP: - PlayerInfo::setAttribute(Attributes::EXP_NEEDED, base); + PlayerInfo::setAttribute(Attributes::PLAYER_EXP_NEEDED, base); break; // ++ here used in wrong way. Need like Sp::NEXTBASEEXP? case Sp::NEXTJOBEXP: - PlayerInfo::setStatExperience(Attributes::JOB, - PlayerInfo::getStatExperience(Attributes::JOB).first, base); + PlayerInfo::setStatExperience(Attributes::PLAYER_JOB, + PlayerInfo::getStatExperience(Attributes::PLAYER_JOB).first, base); break; case Sp::WEIGHT: PlayerInfo::setAttribute(Attributes::TOTAL_WEIGHT, base); @@ -638,70 +638,70 @@ void PlayerHandler::setStat(Net::MessageIn &msg, PlayerInfo::setAttribute(Attributes::MAX_WEIGHT, base); break; case Sp::USTR: - statusWindow->setPointsNeeded(Attributes::STR, base); + statusWindow->setPointsNeeded(Attributes::PLAYER_STR, base); break; case Sp::UAGI: - statusWindow->setPointsNeeded(Attributes::AGI, base); + statusWindow->setPointsNeeded(Attributes::PLAYER_AGI, base); break; case Sp::UVIT: - statusWindow->setPointsNeeded(Attributes::VIT, base); + statusWindow->setPointsNeeded(Attributes::PLAYER_VIT, base); break; case Sp::UINT: - statusWindow->setPointsNeeded(Attributes::INT, base); + statusWindow->setPointsNeeded(Attributes::PLAYER_INT, base); break; case Sp::UDEX: - statusWindow->setPointsNeeded(Attributes::DEX, base); + statusWindow->setPointsNeeded(Attributes::PLAYER_DEX, base); break; case Sp::ULUK: - statusWindow->setPointsNeeded(Attributes::LUK, base); + statusWindow->setPointsNeeded(Attributes::PLAYER_LUK, base); break; case Sp::ATK1: - PlayerInfo::setStatBase(Attributes::ATK, base); + PlayerInfo::setStatBase(Attributes::PLAYER_ATK, base); PlayerInfo::updateAttrs(); break; case Sp::ATK2: - PlayerInfo::setStatMod(Attributes::ATK, base); + PlayerInfo::setStatMod(Attributes::PLAYER_ATK, base); PlayerInfo::updateAttrs(); break; case Sp::MATK1: - PlayerInfo::setStatBase(Attributes::MATK, base); + PlayerInfo::setStatBase(Attributes::PLAYER_MATK, base); break; case Sp::MATK2: - PlayerInfo::setStatMod(Attributes::MATK, base); + PlayerInfo::setStatMod(Attributes::PLAYER_MATK, base); break; case Sp::DEF1: - PlayerInfo::setStatBase(Attributes::DEF, base); + PlayerInfo::setStatBase(Attributes::PLAYER_DEF, base); break; case Sp::DEF2: - PlayerInfo::setStatMod(Attributes::DEF, base); + PlayerInfo::setStatMod(Attributes::PLAYER_DEF, base); break; case Sp::MDEF1: - PlayerInfo::setStatBase(Attributes::MDEF, base); + PlayerInfo::setStatBase(Attributes::PLAYER_MDEF, base); break; case Sp::MDEF2: - PlayerInfo::setStatMod(Attributes::MDEF, base); + PlayerInfo::setStatMod(Attributes::PLAYER_MDEF, base); break; case Sp::HIT: - PlayerInfo::setStatBase(Attributes::HIT, base); + PlayerInfo::setStatBase(Attributes::PLAYER_HIT, base); break; case Sp::FLEE1: - PlayerInfo::setStatBase(Attributes::FLEE, base); + PlayerInfo::setStatBase(Attributes::PLAYER_FLEE, base); break; case Sp::FLEE2: - PlayerInfo::setStatMod(Attributes::FLEE, base); + PlayerInfo::setStatMod(Attributes::PLAYER_FLEE, base); break; case Sp::CRITICAL: - PlayerInfo::setStatBase(Attributes::CRIT, base); + PlayerInfo::setStatBase(Attributes::PLAYER_CRIT, base); break; case Sp::ASPD: localPlayer->setAttackSpeed(base); - PlayerInfo::setStatBase(Attributes::ATTACK_DELAY, base); - PlayerInfo::setStatMod(Attributes::ATTACK_DELAY, 0); + PlayerInfo::setStatBase(Attributes::PLAYER_ATTACK_DELAY, base); + PlayerInfo::setStatMod(Attributes::PLAYER_ATTACK_DELAY, 0); PlayerInfo::updateAttrs(); break; case Sp::JOBLEVEL: - PlayerInfo::setStatBase(Attributes::JOB, base); + PlayerInfo::setStatBase(Attributes::PLAYER_JOB, base); break; default: diff --git a/src/net/eathena/playerrecv.cpp b/src/net/eathena/playerrecv.cpp index 6f9f5a43c..3c32be745 100644 --- a/src/net/eathena/playerrecv.cpp +++ b/src/net/eathena/playerrecv.cpp @@ -74,14 +74,14 @@ void PlayerRecv::processPlayerShowEquip(Net::MessageIn &msg) void PlayerRecv::processPlayerStatUpdate5(Net::MessageIn &msg) { BLOCK_START("PlayerRecv::processPlayerStatUpdate5") - PlayerInfo::setAttribute(Attributes::CHAR_POINTS, + PlayerInfo::setAttribute(Attributes::PLAYER_CHAR_POINTS, msg.readInt16("char points")); unsigned int val = msg.readUInt8("str"); - PlayerInfo::setStatBase(Attributes::STR, val); + PlayerInfo::setStatBase(Attributes::PLAYER_STR, val); if (statusWindow) { - statusWindow->setPointsNeeded(Attributes::STR, + statusWindow->setPointsNeeded(Attributes::PLAYER_STR, msg.readUInt8("str cost")); } else @@ -90,10 +90,10 @@ void PlayerRecv::processPlayerStatUpdate5(Net::MessageIn &msg) } val = msg.readUInt8("agi"); - PlayerInfo::setStatBase(Attributes::AGI, val); + PlayerInfo::setStatBase(Attributes::PLAYER_AGI, val); if (statusWindow) { - statusWindow->setPointsNeeded(Attributes::AGI, + statusWindow->setPointsNeeded(Attributes::PLAYER_AGI, msg.readUInt8("agi cost")); } else @@ -102,10 +102,10 @@ void PlayerRecv::processPlayerStatUpdate5(Net::MessageIn &msg) } val = msg.readUInt8("vit"); - PlayerInfo::setStatBase(Attributes::VIT, val); + PlayerInfo::setStatBase(Attributes::PLAYER_VIT, val); if (statusWindow) { - statusWindow->setPointsNeeded(Attributes::VIT, + statusWindow->setPointsNeeded(Attributes::PLAYER_VIT, msg.readUInt8("vit cost")); } else @@ -114,10 +114,10 @@ void PlayerRecv::processPlayerStatUpdate5(Net::MessageIn &msg) } val = msg.readUInt8("int"); - PlayerInfo::setStatBase(Attributes::INT, val); + PlayerInfo::setStatBase(Attributes::PLAYER_INT, val); if (statusWindow) { - statusWindow->setPointsNeeded(Attributes::INT, + statusWindow->setPointsNeeded(Attributes::PLAYER_INT, msg.readUInt8("int cost")); } else @@ -126,10 +126,10 @@ void PlayerRecv::processPlayerStatUpdate5(Net::MessageIn &msg) } val = msg.readUInt8("dex"); - PlayerInfo::setStatBase(Attributes::DEX, val); + PlayerInfo::setStatBase(Attributes::PLAYER_DEX, val); if (statusWindow) { - statusWindow->setPointsNeeded(Attributes::DEX, + statusWindow->setPointsNeeded(Attributes::PLAYER_DEX, msg.readUInt8("dex cost")); } else @@ -138,10 +138,10 @@ void PlayerRecv::processPlayerStatUpdate5(Net::MessageIn &msg) } val = msg.readUInt8("luk"); - PlayerInfo::setStatBase(Attributes::LUK, val); + PlayerInfo::setStatBase(Attributes::PLAYER_LUK, val); if (statusWindow) { - statusWindow->setPointsNeeded(Attributes::LUK, + statusWindow->setPointsNeeded(Attributes::PLAYER_LUK, msg.readUInt8("luk cost")); } else @@ -149,34 +149,34 @@ void PlayerRecv::processPlayerStatUpdate5(Net::MessageIn &msg) msg.readUInt8("luk cost"); } - PlayerInfo::setStatBase(Attributes::ATK, + PlayerInfo::setStatBase(Attributes::PLAYER_ATK, msg.readInt16("left atk"), Notify_false); - PlayerInfo::setStatMod(Attributes::ATK, msg.readInt16("right atk")); + PlayerInfo::setStatMod(Attributes::PLAYER_ATK, msg.readInt16("right atk")); PlayerInfo::updateAttrs(); val = msg.readInt16("right matk"); - PlayerInfo::setStatBase(Attributes::MATK, val, Notify_false); + PlayerInfo::setStatBase(Attributes::PLAYER_MATK, val, Notify_false); val = msg.readInt16("left matk"); - PlayerInfo::setStatMod(Attributes::MATK, val); + PlayerInfo::setStatMod(Attributes::PLAYER_MATK, val); - PlayerInfo::setStatBase(Attributes::DEF, + PlayerInfo::setStatBase(Attributes::PLAYER_DEF, msg.readInt16("left def"), Notify_false); - PlayerInfo::setStatMod(Attributes::DEF, msg.readInt16("right def")); + PlayerInfo::setStatMod(Attributes::PLAYER_DEF, msg.readInt16("right def")); - PlayerInfo::setStatBase(Attributes::MDEF, + PlayerInfo::setStatBase(Attributes::PLAYER_MDEF, msg.readInt16("left mdef"), Notify_false); - PlayerInfo::setStatMod(Attributes::MDEF, msg.readInt16("right mdef")); + PlayerInfo::setStatMod(Attributes::PLAYER_MDEF, msg.readInt16("right mdef")); - PlayerInfo::setStatBase(Attributes::HIT, msg.readInt16("hit")); + PlayerInfo::setStatBase(Attributes::PLAYER_HIT, msg.readInt16("hit")); - PlayerInfo::setStatBase(Attributes::FLEE, + PlayerInfo::setStatBase(Attributes::PLAYER_FLEE, msg.readInt16("flee"), Notify_false); - PlayerInfo::setStatMod(Attributes::FLEE, msg.readInt16("flee2/10")); + PlayerInfo::setStatMod(Attributes::PLAYER_FLEE, msg.readInt16("flee2/10")); - PlayerInfo::setStatBase(Attributes::CRIT, msg.readInt16("crit/10")); + PlayerInfo::setStatBase(Attributes::PLAYER_CRIT, msg.readInt16("crit/10")); - PlayerInfo::setAttribute(Attributes::ATTACK_DELAY, + PlayerInfo::setAttribute(Attributes::PLAYER_ATTACK_DELAY, msg.readInt16("attack speed")); msg.readInt16("plus speed = 0"); @@ -248,8 +248,9 @@ void PlayerRecv::processPlayerHeal(Net::MessageIn &msg) const int amount = msg.readInt16("value"); if (type == Sp::HP) { - const int base = PlayerInfo::getAttribute(Attributes::HP) + amount; - PlayerInfo::setAttribute(Attributes::HP, base); + const int base = PlayerInfo::getAttribute(Attributes::PLAYER_HP) + + amount; + PlayerInfo::setAttribute(Attributes::PLAYER_HP, base); if (localPlayer->isInParty() && Party::getParty(1)) { PartyMember *const m = Party::getParty(1) @@ -257,7 +258,8 @@ void PlayerRecv::processPlayerHeal(Net::MessageIn &msg) if (m) { m->setHp(base); - m->setMaxHp(PlayerInfo::getAttribute(Attributes::MAX_HP)); + m->setMaxHp(PlayerInfo::getAttribute( + Attributes::PLAYER_MAX_HP)); } } localPlayer->addHpMessage(amount); diff --git a/src/net/tmwa/charserverrecv.cpp b/src/net/tmwa/charserverrecv.cpp index 9728303ff..31a5afe64 100644 --- a/src/net/tmwa/charserverrecv.cpp +++ b/src/net/tmwa/charserverrecv.cpp @@ -74,9 +74,9 @@ void CharServerRecv::readPlayerData(Net::MessageIn &msg, msg.readBeingId("account id"), BeingTypeId_zero); PlayerInfoBackend &data = character->data; - data.mAttributes[Attributes::EXP] = msg.readInt32("exp"); + data.mAttributes[Attributes::PLAYER_EXP] = msg.readInt32("exp"); data.mAttributes[Attributes::MONEY] = msg.readInt32("money"); - Stat &jobStat = data.mStats[Attributes::JOB]; + Stat &jobStat = data.mStats[Attributes::PLAYER_JOB]; jobStat.exp = msg.readInt32("job"); const int temp = msg.readInt32("job level"); @@ -93,10 +93,10 @@ void CharServerRecv::readPlayerData(Net::MessageIn &msg, tempPlayer->setManner(msg.readInt32("manner")); msg.readInt16("character points left"); - data.mAttributes[Attributes::HP] = msg.readInt16("hp"); - data.mAttributes[Attributes::MAX_HP] = msg.readInt16("max hp"); - data.mAttributes[Attributes::MP] = msg.readInt16("mp"); - data.mAttributes[Attributes::MAX_MP] = msg.readInt16("max mp"); + data.mAttributes[Attributes::PLAYER_HP] = msg.readInt16("hp"); + data.mAttributes[Attributes::PLAYER_MAX_HP] = msg.readInt16("max hp"); + data.mAttributes[Attributes::PLAYER_MP] = msg.readInt16("mp"); + data.mAttributes[Attributes::PLAYER_MAX_MP] = msg.readInt16("max mp"); msg.readInt16("speed"); const uint16_t race = msg.readInt16("class"); @@ -108,7 +108,7 @@ void CharServerRecv::readPlayerData(Net::MessageIn &msg, weapon); tempPlayer->setWeaponId(weapon); - data.mAttributes[Attributes::LEVEL] = msg.readInt16("level"); + data.mAttributes[Attributes::PLAYER_LEVEL] = msg.readInt16("level"); msg.readInt16("skill point"); const int bottomClothes = msg.readInt16("bottom clothes"); @@ -137,12 +137,12 @@ void CharServerRecv::readPlayerData(Net::MessageIn &msg, character->dummy = tempPlayer; - character->data.mStats[Attributes::STR].base = msg.readUInt8("str"); - character->data.mStats[Attributes::AGI].base = msg.readUInt8("agi"); - character->data.mStats[Attributes::VIT].base = msg.readUInt8("vit"); - character->data.mStats[Attributes::INT].base = msg.readUInt8("int"); - character->data.mStats[Attributes::DEX].base = msg.readUInt8("dex"); - character->data.mStats[Attributes::LUK].base = msg.readUInt8("luk"); + character->data.mStats[Attributes::PLAYER_STR].base = msg.readUInt8("str"); + character->data.mStats[Attributes::PLAYER_AGI].base = msg.readUInt8("agi"); + character->data.mStats[Attributes::PLAYER_VIT].base = msg.readUInt8("vit"); + character->data.mStats[Attributes::PLAYER_INT].base = msg.readUInt8("int"); + character->data.mStats[Attributes::PLAYER_DEX].base = msg.readUInt8("dex"); + character->data.mStats[Attributes::PLAYER_LUK].base = msg.readUInt8("luk"); tempPlayer->setSpriteId(SPRITE_HAIR, shoes); diff --git a/src/net/tmwa/playerhandler.cpp b/src/net/tmwa/playerhandler.cpp index eb9665af9..5058e1d39 100644 --- a/src/net/tmwa/playerhandler.cpp +++ b/src/net/tmwa/playerhandler.cpp @@ -79,7 +79,7 @@ void PlayerHandler::emote(const uint8_t emoteId) const void PlayerHandler::increaseAttribute(const AttributesT attr, const int amount A_UNUSED) const { - if (attr >= Attributes::STR && attr <= Attributes::LUK) + if (attr >= Attributes::PLAYER_STR && attr <= Attributes::PLAYER_LUK) { createOutPacket(CMSG_STAT_UPDATE_REQUEST); outMsg.writeInt16(CAST_S16(attr), "attribute id"); @@ -89,7 +89,7 @@ void PlayerHandler::increaseAttribute(const AttributesT attr, void PlayerHandler::increaseSkill(const uint16_t skillId) const { - if (PlayerInfo::getAttribute(Attributes::SKILL_POINTS) <= 0) + if (PlayerInfo::getAttribute(Attributes::PLAYER_SKILL_POINTS) <= 0) return; createOutPacket(CMSG_SKILL_LEVELUP_REQUEST); @@ -224,26 +224,26 @@ void PlayerHandler::setStat(Net::MessageIn &msg, { case Sp::SPEED: localPlayer->setWalkSpeed(base); - PlayerInfo::setStatBase(Attributes::WALK_SPEED, base); - PlayerInfo::setStatMod(Attributes::WALK_SPEED, 0); + PlayerInfo::setStatBase(Attributes::PLAYER_WALK_SPEED, base); + PlayerInfo::setStatMod(Attributes::PLAYER_WALK_SPEED, 0); break; case Sp::BASEEXP: - PlayerInfo::setAttribute(Attributes::EXP, base); + PlayerInfo::setAttribute(Attributes::PLAYER_EXP, base); break; case Sp::JOBEXP: - PlayerInfo::setStatExperience(Attributes::JOB, base, - PlayerInfo::getStatExperience(Attributes::JOB).second); + PlayerInfo::setStatExperience(Attributes::PLAYER_JOB, base, + PlayerInfo::getStatExperience(Attributes::PLAYER_JOB).second); break; case Sp::KARMA: - PlayerInfo::setStatBase(Attributes::KARMA, base); - PlayerInfo::setStatMod(Attributes::KARMA, 0); + PlayerInfo::setStatBase(Attributes::PLAYER_KARMA, base); + PlayerInfo::setStatMod(Attributes::PLAYER_KARMA, 0); break; case Sp::MANNER: - PlayerInfo::setStatBase(Attributes::MANNER, base); - PlayerInfo::setStatMod(Attributes::MANNER, 0); + PlayerInfo::setStatBase(Attributes::PLAYER_MANNER, base); + PlayerInfo::setStatMod(Attributes::PLAYER_MANNER, 0); break; case Sp::HP: - PlayerInfo::setAttribute(Attributes::HP, base); + PlayerInfo::setAttribute(Attributes::PLAYER_HP, base); if (localPlayer->isInParty() && Party::getParty(1)) { PartyMember *const m = Party::getParty(1) @@ -251,12 +251,12 @@ void PlayerHandler::setStat(Net::MessageIn &msg, if (m) { m->setHp(base); - m->setMaxHp(PlayerInfo::getAttribute(Attributes::MAX_HP)); + m->setMaxHp(PlayerInfo::getAttribute(Attributes::PLAYER_MAX_HP)); } } break; case Sp::MAXHP: - PlayerInfo::setAttribute(Attributes::MAX_HP, base); + PlayerInfo::setAttribute(Attributes::PLAYER_MAX_HP, base); if (localPlayer->isInParty() && Party::getParty(1)) { @@ -264,22 +264,22 @@ void PlayerHandler::setStat(Net::MessageIn &msg, localPlayer->getId()); if (m) { - m->setHp(PlayerInfo::getAttribute(Attributes::HP)); + m->setHp(PlayerInfo::getAttribute(Attributes::PLAYER_HP)); m->setMaxHp(base); } } break; case Sp::SP: - PlayerInfo::setAttribute(Attributes::MP, base); + PlayerInfo::setAttribute(Attributes::PLAYER_MP, base); break; case Sp::MAXSP: - PlayerInfo::setAttribute(Attributes::MAX_MP, base); + PlayerInfo::setAttribute(Attributes::PLAYER_MAX_MP, base); break; case Sp::STATUSPOINT: - PlayerInfo::setAttribute(Attributes::CHAR_POINTS, base); + PlayerInfo::setAttribute(Attributes::PLAYER_CHAR_POINTS, base); break; case Sp::BASELEVEL: - PlayerInfo::setAttribute(Attributes::LEVEL, base); + PlayerInfo::setAttribute(Attributes::PLAYER_LEVEL, base); if (localPlayer) { localPlayer->setLevel(base); @@ -287,27 +287,27 @@ void PlayerHandler::setStat(Net::MessageIn &msg, } break; case Sp::SKILLPOINT: - PlayerInfo::setAttribute(Attributes::SKILL_POINTS, base); + PlayerInfo::setAttribute(Attributes::PLAYER_SKILL_POINTS, base); if (skillDialog) skillDialog->update(); break; case Sp::STR: - setStatComplex(Attributes::STR); + setStatComplex(Attributes::PLAYER_STR); break; case Sp::AGI: - setStatComplex(Attributes::AGI); + setStatComplex(Attributes::PLAYER_AGI); break; case Sp::VIT: - setStatComplex(Attributes::VIT); + setStatComplex(Attributes::PLAYER_VIT); break; case Sp::INT: - setStatComplex(Attributes::INT); + setStatComplex(Attributes::PLAYER_INT); break; case Sp::DEX: - setStatComplex(Attributes::DEX); + setStatComplex(Attributes::PLAYER_DEX); break; case Sp::LUK: - setStatComplex(Attributes::LUK); + setStatComplex(Attributes::PLAYER_LUK); break; case Sp::ZENY: { @@ -328,11 +328,11 @@ void PlayerHandler::setStat(Net::MessageIn &msg, break; } case Sp::NEXTBASEEXP: - PlayerInfo::setAttribute(Attributes::EXP_NEEDED, base); + PlayerInfo::setAttribute(Attributes::PLAYER_EXP_NEEDED, base); break; case Sp::JOB_MOD: - PlayerInfo::setStatExperience(Attributes::JOB, - PlayerInfo::getStatExperience(Attributes::JOB).first, base); + PlayerInfo::setStatExperience(Attributes::PLAYER_JOB, + PlayerInfo::getStatExperience(Attributes::PLAYER_JOB).first, base); break; case Sp::WEIGHT: PlayerInfo::setAttribute(Attributes::TOTAL_WEIGHT, base); @@ -341,70 +341,70 @@ void PlayerHandler::setStat(Net::MessageIn &msg, PlayerInfo::setAttribute(Attributes::MAX_WEIGHT, base); break; case Sp::USTR: - statusWindow->setPointsNeeded(Attributes::STR, base); + statusWindow->setPointsNeeded(Attributes::PLAYER_STR, base); break; case Sp::UAGI: - statusWindow->setPointsNeeded(Attributes::AGI, base); + statusWindow->setPointsNeeded(Attributes::PLAYER_AGI, base); break; case Sp::UVIT: - statusWindow->setPointsNeeded(Attributes::VIT, base); + statusWindow->setPointsNeeded(Attributes::PLAYER_VIT, base); break; case Sp::UINT: - statusWindow->setPointsNeeded(Attributes::INT, base); + statusWindow->setPointsNeeded(Attributes::PLAYER_INT, base); break; case Sp::UDEX: - statusWindow->setPointsNeeded(Attributes::DEX, base); + statusWindow->setPointsNeeded(Attributes::PLAYER_DEX, base); break; case Sp::ULUK: - statusWindow->setPointsNeeded(Attributes::LUK, base); + statusWindow->setPointsNeeded(Attributes::PLAYER_LUK, base); break; case Sp::ATK1: - PlayerInfo::setStatBase(Attributes::ATK, base); + PlayerInfo::setStatBase(Attributes::PLAYER_ATK, base); PlayerInfo::updateAttrs(); break; case Sp::ATK2: - PlayerInfo::setStatMod(Attributes::ATK, base); + PlayerInfo::setStatMod(Attributes::PLAYER_ATK, base); PlayerInfo::updateAttrs(); break; case Sp::MATK1: - PlayerInfo::setStatBase(Attributes::MATK, base); + PlayerInfo::setStatBase(Attributes::PLAYER_MATK, base); break; case Sp::MATK2: - PlayerInfo::setStatMod(Attributes::MATK, base); + PlayerInfo::setStatMod(Attributes::PLAYER_MATK, base); break; case Sp::DEF1: - PlayerInfo::setStatBase(Attributes::DEF, base); + PlayerInfo::setStatBase(Attributes::PLAYER_DEF, base); break; case Sp::DEF2: - PlayerInfo::setStatMod(Attributes::DEF, base); + PlayerInfo::setStatMod(Attributes::PLAYER_DEF, base); break; case Sp::MDEF1: - PlayerInfo::setStatBase(Attributes::MDEF, base); + PlayerInfo::setStatBase(Attributes::PLAYER_MDEF, base); break; case Sp::MDEF2: - PlayerInfo::setStatMod(Attributes::MDEF, base); + PlayerInfo::setStatMod(Attributes::PLAYER_MDEF, base); break; case Sp::HIT: - PlayerInfo::setStatBase(Attributes::HIT, base); + PlayerInfo::setStatBase(Attributes::PLAYER_HIT, base); break; case Sp::FLEE1: - PlayerInfo::setStatBase(Attributes::FLEE, base); + PlayerInfo::setStatBase(Attributes::PLAYER_FLEE, base); break; case Sp::FLEE2: - PlayerInfo::setStatMod(Attributes::FLEE, base); + PlayerInfo::setStatMod(Attributes::PLAYER_FLEE, base); break; case Sp::CRITICAL: - PlayerInfo::setStatBase(Attributes::CRIT, base); + PlayerInfo::setStatBase(Attributes::PLAYER_CRIT, base); break; case Sp::ASPD: localPlayer->setAttackSpeed(base); - PlayerInfo::setStatBase(Attributes::ATTACK_DELAY, base); - PlayerInfo::setStatMod(Attributes::ATTACK_DELAY, 0); + PlayerInfo::setStatBase(Attributes::PLAYER_ATTACK_DELAY, base); + PlayerInfo::setStatMod(Attributes::PLAYER_ATTACK_DELAY, 0); PlayerInfo::updateAttrs(); break; case Sp::JOBLEVEL: - PlayerInfo::setStatBase(Attributes::JOB, base); + PlayerInfo::setStatBase(Attributes::PLAYER_JOB, base); break; case Sp::GM_LEVEL: localPlayer->setGMLevel(base); diff --git a/src/net/tmwa/playerrecv.cpp b/src/net/tmwa/playerrecv.cpp index 6d2eefb86..0c15fff57 100644 --- a/src/net/tmwa/playerrecv.cpp +++ b/src/net/tmwa/playerrecv.cpp @@ -37,14 +37,14 @@ namespace TmwAthena void PlayerRecv::processPlayerStatUpdate5(Net::MessageIn &msg) { BLOCK_START("PlayerRecv::processPlayerStatUpdate5") - PlayerInfo::setAttribute(Attributes::CHAR_POINTS, + PlayerInfo::setAttribute(Attributes::PLAYER_CHAR_POINTS, msg.readInt16("char points")); unsigned int val = msg.readUInt8("str"); - PlayerInfo::setStatBase(Attributes::STR, val); + PlayerInfo::setStatBase(Attributes::PLAYER_STR, val); if (statusWindow) { - statusWindow->setPointsNeeded(Attributes::STR, + statusWindow->setPointsNeeded(Attributes::PLAYER_STR, msg.readUInt8("str cost")); } else @@ -53,10 +53,10 @@ void PlayerRecv::processPlayerStatUpdate5(Net::MessageIn &msg) } val = msg.readUInt8("agi"); - PlayerInfo::setStatBase(Attributes::AGI, val); + PlayerInfo::setStatBase(Attributes::PLAYER_AGI, val); if (statusWindow) { - statusWindow->setPointsNeeded(Attributes::AGI, + statusWindow->setPointsNeeded(Attributes::PLAYER_AGI, msg.readUInt8("agi cost")); } else @@ -65,10 +65,10 @@ void PlayerRecv::processPlayerStatUpdate5(Net::MessageIn &msg) } val = msg.readUInt8("vit"); - PlayerInfo::setStatBase(Attributes::VIT, val); + PlayerInfo::setStatBase(Attributes::PLAYER_VIT, val); if (statusWindow) { - statusWindow->setPointsNeeded(Attributes::VIT, + statusWindow->setPointsNeeded(Attributes::PLAYER_VIT, msg.readUInt8("vit cost")); } else @@ -77,10 +77,10 @@ void PlayerRecv::processPlayerStatUpdate5(Net::MessageIn &msg) } val = msg.readUInt8("int"); - PlayerInfo::setStatBase(Attributes::INT, val); + PlayerInfo::setStatBase(Attributes::PLAYER_INT, val); if (statusWindow) { - statusWindow->setPointsNeeded(Attributes::INT, + statusWindow->setPointsNeeded(Attributes::PLAYER_INT, msg.readUInt8("int cost")); } else @@ -89,10 +89,10 @@ void PlayerRecv::processPlayerStatUpdate5(Net::MessageIn &msg) } val = msg.readUInt8("dex"); - PlayerInfo::setStatBase(Attributes::DEX, val); + PlayerInfo::setStatBase(Attributes::PLAYER_DEX, val); if (statusWindow) { - statusWindow->setPointsNeeded(Attributes::DEX, + statusWindow->setPointsNeeded(Attributes::PLAYER_DEX, msg.readUInt8("dex cost")); } else @@ -101,10 +101,10 @@ void PlayerRecv::processPlayerStatUpdate5(Net::MessageIn &msg) } val = msg.readUInt8("luk"); - PlayerInfo::setStatBase(Attributes::LUK, val); + PlayerInfo::setStatBase(Attributes::PLAYER_LUK, val); if (statusWindow) { - statusWindow->setPointsNeeded(Attributes::LUK, + statusWindow->setPointsNeeded(Attributes::PLAYER_LUK, msg.readUInt8("luk cost")); } else @@ -112,34 +112,35 @@ void PlayerRecv::processPlayerStatUpdate5(Net::MessageIn &msg) msg.readUInt8("luk cost"); } - PlayerInfo::setStatBase(Attributes::ATK, + PlayerInfo::setStatBase(Attributes::PLAYER_ATK, msg.readInt16("atk"), Notify_false); - PlayerInfo::setStatMod(Attributes::ATK, msg.readInt16("atk+")); + PlayerInfo::setStatMod(Attributes::PLAYER_ATK, msg.readInt16("atk+")); PlayerInfo::updateAttrs(); val = msg.readInt16("matk"); - PlayerInfo::setStatBase(Attributes::MATK, val, Notify_false); + PlayerInfo::setStatBase(Attributes::PLAYER_MATK, val, Notify_false); val = msg.readInt16("matk+"); - PlayerInfo::setStatMod(Attributes::MATK, val); + PlayerInfo::setStatMod(Attributes::PLAYER_MATK, val); - PlayerInfo::setStatBase(Attributes::DEF, + PlayerInfo::setStatBase(Attributes::PLAYER_DEF, msg.readInt16("def"), Notify_false); - PlayerInfo::setStatMod(Attributes::DEF, msg.readInt16("def+")); + PlayerInfo::setStatMod(Attributes::PLAYER_DEF, msg.readInt16("def+")); - PlayerInfo::setStatBase(Attributes::MDEF, + PlayerInfo::setStatBase(Attributes::PLAYER_MDEF, msg.readInt16("mdef"), Notify_false); - PlayerInfo::setStatMod(Attributes::MDEF, msg.readInt16("mdef+")); + PlayerInfo::setStatMod(Attributes::PLAYER_MDEF, msg.readInt16("mdef+")); - PlayerInfo::setStatBase(Attributes::HIT, msg.readInt16("hit")); + PlayerInfo::setStatBase(Attributes::PLAYER_HIT, msg.readInt16("hit")); - PlayerInfo::setStatBase(Attributes::FLEE, + PlayerInfo::setStatBase(Attributes::PLAYER_FLEE, msg.readInt16("flee"), Notify_false); - PlayerInfo::setStatMod(Attributes::FLEE, msg.readInt16("flee+")); + PlayerInfo::setStatMod(Attributes::PLAYER_FLEE, msg.readInt16("flee+")); - PlayerInfo::setStatBase(Attributes::CRIT, msg.readInt16("crit")); + PlayerInfo::setStatBase(Attributes::PLAYER_CRIT, msg.readInt16("crit")); - PlayerInfo::setStatBase(Attributes::MANNER, msg.readInt16("manner")); + PlayerInfo::setStatBase(Attributes::PLAYER_MANNER, + msg.readInt16("manner")); msg.readInt16("unused?"); BLOCK_END("PlayerRecv::processPlayerStatUpdate5") } diff --git a/src/resources/db/statdb.cpp b/src/resources/db/statdb.cpp index 0c1cd7e93..5c7f5a288 100644 --- a/src/resources/db/statdb.cpp +++ b/src/resources/db/statdb.cpp @@ -39,27 +39,27 @@ namespace void StatDb::addDefaultStats() { - mBasicStats.push_back(BasicStat(Attributes::STR, + mBasicStats.push_back(BasicStat(Attributes::PLAYER_STR, "str", // TRANSLATORS: player stat _("Strength"))); - mBasicStats.push_back(BasicStat(Attributes::AGI, + mBasicStats.push_back(BasicStat(Attributes::PLAYER_AGI, "agi", // TRANSLATORS: player stat _("Agility"))); - mBasicStats.push_back(BasicStat(Attributes::VIT, + mBasicStats.push_back(BasicStat(Attributes::PLAYER_VIT, "vit", // TRANSLATORS: player stat _("Vitality"))); - mBasicStats.push_back(BasicStat(Attributes::INT, + mBasicStats.push_back(BasicStat(Attributes::PLAYER_INT, "int", // TRANSLATORS: player stat _("Intelligence"))); - mBasicStats.push_back(BasicStat(Attributes::DEX, + mBasicStats.push_back(BasicStat(Attributes::PLAYER_DEX, "dex", // TRANSLATORS: player stat _("Dexterity"))); - mBasicStats.push_back(BasicStat(Attributes::LUK, + mBasicStats.push_back(BasicStat(Attributes::PLAYER_LUK, "luk", // TRANSLATORS: player stat _("Luck"))); diff --git a/src/spellmanager.cpp b/src/spellmanager.cpp index e894ff6df..8a87fe521 100644 --- a/src/spellmanager.cpp +++ b/src/spellmanager.cpp @@ -143,7 +143,7 @@ void SpellManager::invoke(const int spellId) const >= CAST_S32(spell->getBaseLvl()) && PlayerInfo::getSkillLevel(CAST_S32( spell->getSchool())) >= CAST_S32(spell->getSchoolLvl()) - && PlayerInfo::getAttribute(Attributes::MP) + && PlayerInfo::getAttribute(Attributes::PLAYER_MP) >= CAST_S32(spell->getMana())) ) #endif |