diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-03-08 20:51:37 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-03-08 20:51:37 +0300 |
commit | d8d84315013a24730c5b9d08122a954d713521c7 (patch) | |
tree | 4fc54086d0843f32707aa06c7c7eed3e092220fc /src | |
parent | 850c4e74f8c5daf218beaa4f948df2c9c8ded42e (diff) | |
download | plus-d8d84315013a24730c5b9d08122a954d713521c7.tar.gz plus-d8d84315013a24730c5b9d08122a954d713521c7.tar.bz2 plus-d8d84315013a24730c5b9d08122a954d713521c7.tar.xz plus-d8d84315013a24730c5b9d08122a954d713521c7.zip |
Move setStat from ea namespace into eathena and tmwa.
Diffstat (limited to 'src')
-rw-r--r-- | src/CMakeLists.txt | 1 | ||||
-rw-r--r-- | src/Makefile.am | 1 | ||||
-rw-r--r-- | src/const/net/nostat.h | 26 | ||||
-rw-r--r-- | src/net/ea/playerhandler.cpp | 204 | ||||
-rw-r--r-- | src/net/ea/playerhandler.h | 6 | ||||
-rw-r--r-- | src/net/ea/playerrecv.cpp | 2 | ||||
-rw-r--r-- | src/net/ea/playerrecv.h | 1 | ||||
-rw-r--r-- | src/net/eathena/playerhandler.cpp | 213 | ||||
-rw-r--r-- | src/net/tmwa/playerhandler.cpp | 217 |
9 files changed, 455 insertions, 216 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 5ff6c39ac..16ba850e8 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -565,6 +565,7 @@ SET(SRCS net/net.h const/net/inventory.h const/net/net.h + const/net/nostat.h net/partyhandler.h enums/net/partyshare.h enums/net/servertype.h diff --git a/src/Makefile.am b/src/Makefile.am index f8ea7be19..81b411c60 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1272,6 +1272,7 @@ manaplus_SOURCES += main.cpp \ net/net.h \ const/net/inventory.h \ const/net/net.h \ + const/net/nostat.h \ net/npchandler.h \ net/partyhandler.h \ net/pethandler.h \ diff --git a/src/const/net/nostat.h b/src/const/net/nostat.h new file mode 100644 index 000000000..f56ce5925 --- /dev/null +++ b/src/const/net/nostat.h @@ -0,0 +1,26 @@ +/* + * The ManaPlus Client + * Copyright (C) 2011-2016 The ManaPlus Developers + * + * This file is part of The ManaPlus Client. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#ifndef CONST_NET_NOSTAT_H +#define CONST_NET_NOSTAT_H + +static const int NoStat = INT_MAX; + +#endif // CONST_NET_NOSTAT_H diff --git a/src/net/ea/playerhandler.cpp b/src/net/ea/playerhandler.cpp index 9ee783af4..aeec03c7b 100644 --- a/src/net/ea/playerhandler.cpp +++ b/src/net/ea/playerhandler.cpp @@ -65,208 +65,4 @@ bool PlayerHandler::canUseMagic() const return PlayerInfo::getStatEffective(Attributes::MATK) > 0; } -#define setStatComplex(stat) \ - PlayerInfo::setStatBase(stat, base, notify); \ - if (mod != NoStat) \ - PlayerInfo::setStatMod(stat, mod) - -void PlayerHandler::setStat(Net::MessageIn &msg, - const int type, - const int base, - const int mod, - const Notify notify) const -{ - switch (type) - { - case Ea::WALK_SPEED: - localPlayer->setWalkSpeed(base); - PlayerInfo::setStatBase(Attributes::WALK_SPEED, base); - PlayerInfo::setStatMod(Attributes::WALK_SPEED, 0); - break; - case Ea::EXP: - PlayerInfo::setAttribute(Attributes::EXP, base); - break; - case Ea::JOB_EXP: - PlayerInfo::setStatExperience(Attributes::JOB, base, - PlayerInfo::getStatExperience(Attributes::JOB).second); - break; - case Ea::KARMA: - PlayerInfo::setStatBase(Attributes::KARMA, base); - PlayerInfo::setStatMod(Attributes::KARMA, 0); - break; - case Ea::MANNER: - PlayerInfo::setStatBase(Attributes::MANNER, base); - PlayerInfo::setStatMod(Attributes::MANNER, 0); - break; - case Ea::HP: - PlayerInfo::setAttribute(Attributes::HP, base); - if (localPlayer->isInParty() && Party::getParty(1)) - { - PartyMember *const m = Party::getParty(1) - ->getMember(localPlayer->getId()); - if (m) - { - m->setHp(base); - m->setMaxHp(PlayerInfo::getAttribute(Attributes::MAX_HP)); - } - } - break; - case Ea::MAX_HP: - PlayerInfo::setAttribute(Attributes::MAX_HP, base); - - if (localPlayer->isInParty() && Party::getParty(1)) - { - PartyMember *const m = Party::getParty(1)->getMember( - localPlayer->getId()); - if (m) - { - m->setHp(PlayerInfo::getAttribute(Attributes::HP)); - m->setMaxHp(base); - } - } - break; - case Ea::MP: - PlayerInfo::setAttribute(Attributes::MP, base); - break; - case Ea::MAX_MP: - PlayerInfo::setAttribute(Attributes::MAX_MP, base); - break; - case Ea::CHAR_POINTS: - PlayerInfo::setAttribute(Attributes::CHAR_POINTS, base); - break; - case Ea::LEVEL: - PlayerInfo::setAttribute(Attributes::LEVEL, base); - if (localPlayer) - { - localPlayer->setLevel(base); - localPlayer->updateName(); - } - break; - case Ea::SKILL_POINTS: - PlayerInfo::setAttribute(Attributes::SKILL_POINTS, base); - if (skillDialog) - skillDialog->update(); - break; - case Ea::STR: - setStatComplex(Attributes::STR); - break; - case Ea::AGI: - setStatComplex(Attributes::AGI); - break; - case Ea::VIT: - setStatComplex(Attributes::VIT); - break; - case Ea::INT: - setStatComplex(Attributes::INT); - break; - case Ea::DEX: - setStatComplex(Attributes::DEX); - break; - case Ea::LUK: - setStatComplex(Attributes::LUK); - break; - case Ea::MONEY: - { - const int oldMoney = PlayerInfo::getAttribute(Attributes::MONEY); - const int newMoney = base; - if (newMoney > oldMoney) - { - NotifyManager::notify(NotifyTypes::MONEY_GET, - Units::formatCurrency(newMoney - oldMoney)); - } - else if (newMoney < oldMoney) - { - NotifyManager::notify(NotifyTypes::MONEY_SPENT, - Units::formatCurrency(oldMoney - newMoney).c_str()); - } - - PlayerInfo::setAttribute(Attributes::MONEY, newMoney); - break; - } - case Ea::EXP_NEEDED: - PlayerInfo::setAttribute(Attributes::EXP_NEEDED, base); - break; - case Ea::JOB_MOD: - PlayerInfo::setStatExperience(Attributes::JOB, - PlayerInfo::getStatExperience(Attributes::JOB).first, base); - break; - case Ea::TOTAL_WEIGHT: - PlayerInfo::setAttribute(Attributes::TOTAL_WEIGHT, base); - break; - case Ea::MAX_WEIGHT: - PlayerInfo::setAttribute(Attributes::MAX_WEIGHT, base); - break; - case Ea::STR_NEEDED: - statusWindow->setPointsNeeded(Attributes::STR, base); - break; - case Ea::AGI_NEEDED: - statusWindow->setPointsNeeded(Attributes::AGI, base); - break; - case Ea::VIT_NEEDED: - statusWindow->setPointsNeeded(Attributes::VIT, base); - break; - case Ea::INT_NEEDED: - statusWindow->setPointsNeeded(Attributes::INT, base); - break; - case Ea::DEX_NEEDED: - statusWindow->setPointsNeeded(Attributes::DEX, base); - break; - case Ea::LUK_NEEDED: - statusWindow->setPointsNeeded(Attributes::LUK, base); - break; - - case Ea::ATK: - PlayerInfo::setStatBase(Attributes::ATK, base); - PlayerInfo::updateAttrs(); - break; - case Ea::ATK_MOD: - PlayerInfo::setStatMod(Attributes::ATK, base); - PlayerInfo::updateAttrs(); - break; - case Ea::MATK: - PlayerInfo::setStatBase(Attributes::MATK, base); - break; - case Ea::MATK_MOD: - PlayerInfo::setStatMod(Attributes::MATK, base); - break; - case Ea::DEF: - PlayerInfo::setStatBase(Attributes::DEF, base); - break; - case Ea::DEF_MOD: - PlayerInfo::setStatMod(Attributes::DEF, base); - break; - case Ea::MDEF: - PlayerInfo::setStatBase(Attributes::MDEF, base); - break; - case Ea::MDEF_MOD: - PlayerInfo::setStatMod(Attributes::MDEF, base); - break; - case Ea::HIT: - PlayerInfo::setStatBase(Attributes::HIT, base); - break; - case Ea::FLEE: - PlayerInfo::setStatBase(Attributes::FLEE, base); - break; - case Ea::FLEE_MOD: - PlayerInfo::setStatMod(Attributes::FLEE, base); - break; - case Ea::CRIT: - PlayerInfo::setStatBase(Attributes::CRIT, base); - break; - case Ea::ATTACK_DELAY: - localPlayer->setAttackSpeed(base); - PlayerInfo::setStatBase(Attributes::ATTACK_DELAY, base); - PlayerInfo::setStatMod(Attributes::ATTACK_DELAY, 0); - PlayerInfo::updateAttrs(); - break; - case Ea::JOB: - PlayerInfo::setStatBase(Attributes::JOB, base); - break; - - default: - UNIMPLIMENTEDPACKET; - break; - } -} - } // namespace Ea diff --git a/src/net/ea/playerhandler.h b/src/net/ea/playerhandler.h index 7883ed342..d19fdd28a 100644 --- a/src/net/ea/playerhandler.h +++ b/src/net/ea/playerhandler.h @@ -50,12 +50,6 @@ class PlayerHandler notfinal : public Net::PlayerHandler bool canUseMagic() const override final; int getDefaultWalkSpeed() const override final A_WARN_UNUSED; - - void setStat(Net::MessageIn &msg, - const int type, - const int base, - const int mod, - const Notify notify) const override; }; } // namespace Ea diff --git a/src/net/ea/playerrecv.cpp b/src/net/ea/playerrecv.cpp index 0f55e32b9..a739ece3a 100644 --- a/src/net/ea/playerrecv.cpp +++ b/src/net/ea/playerrecv.cpp @@ -29,6 +29,8 @@ #include "being/localplayer.h" #include "being/playerinfo.h" +#include "const/net/nostat.h" + #include "enums/resources/notifytypes.h" #include "gui/viewport.h" diff --git a/src/net/ea/playerrecv.h b/src/net/ea/playerrecv.h index bf2c4b705..715c8e16f 100644 --- a/src/net/ea/playerrecv.h +++ b/src/net/ea/playerrecv.h @@ -45,7 +45,6 @@ namespace Ea void processMapMask(Net::MessageIn &msg); } // namespace PlayerRecv - static const int NoStat = INT_MAX; } // namespace Ea #endif // NET_EA_PLAYERRECV_H diff --git a/src/net/eathena/playerhandler.cpp b/src/net/eathena/playerhandler.cpp index 470a1530a..d20348a2d 100644 --- a/src/net/eathena/playerhandler.cpp +++ b/src/net/eathena/playerhandler.cpp @@ -22,8 +22,22 @@ #include "net/eathena/playerhandler.h" +#include "units.h" +#include "notifymanager.h" +#include "party.h" + +#include "being/localplayer.h" #include "being/playerinfo.h" +#include "const/net/nostat.h" + +#include "enums/resources/notifytypes.h" + +#include "gui/windows/skilldialog.h" +#include "gui/windows/statuswindow.h" + +#include "net/ea/eaprotocol.h" + #include "net/eathena/messageout.h" #include "net/eathena/protocolout.h" #include "net/eathena/inventoryhandler.h" @@ -225,13 +239,210 @@ void PlayerHandler::setViewEquipment(const bool allow) const outMsg.writeInt32(allow ? 1 : 0, "allow"); } +#define setStatComplex(stat) \ + PlayerInfo::setStatBase(stat, base, notify); \ + if (mod != NoStat) \ + PlayerInfo::setStatMod(stat, mod) + void PlayerHandler::setStat(Net::MessageIn &msg, const int type, const int base, const int mod, const Notify notify) const { - Ea::PlayerHandler::setStat(msg, type, base, mod, notify); + switch (type) + { + case Ea::WALK_SPEED: + localPlayer->setWalkSpeed(base); + PlayerInfo::setStatBase(Attributes::WALK_SPEED, base); + PlayerInfo::setStatMod(Attributes::WALK_SPEED, 0); + break; + case Ea::EXP: + PlayerInfo::setAttribute(Attributes::EXP, base); + break; + case Ea::JOB_EXP: + PlayerInfo::setStatExperience(Attributes::JOB, base, + PlayerInfo::getStatExperience(Attributes::JOB).second); + break; + case Ea::KARMA: + PlayerInfo::setStatBase(Attributes::KARMA, base); + PlayerInfo::setStatMod(Attributes::KARMA, 0); + break; + case Ea::MANNER: + PlayerInfo::setStatBase(Attributes::MANNER, base); + PlayerInfo::setStatMod(Attributes::MANNER, 0); + break; + case Ea::HP: + PlayerInfo::setAttribute(Attributes::HP, base); + if (localPlayer->isInParty() && Party::getParty(1)) + { + PartyMember *const m = Party::getParty(1) + ->getMember(localPlayer->getId()); + if (m) + { + m->setHp(base); + m->setMaxHp(PlayerInfo::getAttribute(Attributes::MAX_HP)); + } + } + break; + case Ea::MAX_HP: + PlayerInfo::setAttribute(Attributes::MAX_HP, base); + + if (localPlayer->isInParty() && Party::getParty(1)) + { + PartyMember *const m = Party::getParty(1)->getMember( + localPlayer->getId()); + if (m) + { + m->setHp(PlayerInfo::getAttribute(Attributes::HP)); + m->setMaxHp(base); + } + } + break; + case Ea::MP: + PlayerInfo::setAttribute(Attributes::MP, base); + break; + case Ea::MAX_MP: + PlayerInfo::setAttribute(Attributes::MAX_MP, base); + break; + case Ea::CHAR_POINTS: + PlayerInfo::setAttribute(Attributes::CHAR_POINTS, base); + break; + case Ea::LEVEL: + PlayerInfo::setAttribute(Attributes::LEVEL, base); + if (localPlayer) + { + localPlayer->setLevel(base); + localPlayer->updateName(); + } + break; + case Ea::SKILL_POINTS: + PlayerInfo::setAttribute(Attributes::SKILL_POINTS, base); + if (skillDialog) + skillDialog->update(); + break; + case Ea::STR: + setStatComplex(Attributes::STR); + break; + case Ea::AGI: + setStatComplex(Attributes::AGI); + break; + case Ea::VIT: + setStatComplex(Attributes::VIT); + break; + case Ea::INT: + setStatComplex(Attributes::INT); + break; + case Ea::DEX: + setStatComplex(Attributes::DEX); + break; + case Ea::LUK: + setStatComplex(Attributes::LUK); + break; + case Ea::MONEY: + { + const int oldMoney = PlayerInfo::getAttribute(Attributes::MONEY); + const int newMoney = base; + if (newMoney > oldMoney) + { + NotifyManager::notify(NotifyTypes::MONEY_GET, + Units::formatCurrency(newMoney - oldMoney)); + } + else if (newMoney < oldMoney) + { + NotifyManager::notify(NotifyTypes::MONEY_SPENT, + Units::formatCurrency(oldMoney - newMoney).c_str()); + } + + PlayerInfo::setAttribute(Attributes::MONEY, newMoney); + break; + } + case Ea::EXP_NEEDED: + PlayerInfo::setAttribute(Attributes::EXP_NEEDED, base); + break; + case Ea::JOB_MOD: + PlayerInfo::setStatExperience(Attributes::JOB, + PlayerInfo::getStatExperience(Attributes::JOB).first, base); + break; + case Ea::TOTAL_WEIGHT: + PlayerInfo::setAttribute(Attributes::TOTAL_WEIGHT, base); + break; + case Ea::MAX_WEIGHT: + PlayerInfo::setAttribute(Attributes::MAX_WEIGHT, base); + break; + case Ea::STR_NEEDED: + statusWindow->setPointsNeeded(Attributes::STR, base); + break; + case Ea::AGI_NEEDED: + statusWindow->setPointsNeeded(Attributes::AGI, base); + break; + case Ea::VIT_NEEDED: + statusWindow->setPointsNeeded(Attributes::VIT, base); + break; + case Ea::INT_NEEDED: + statusWindow->setPointsNeeded(Attributes::INT, base); + break; + case Ea::DEX_NEEDED: + statusWindow->setPointsNeeded(Attributes::DEX, base); + break; + case Ea::LUK_NEEDED: + statusWindow->setPointsNeeded(Attributes::LUK, base); + break; + + case Ea::ATK: + PlayerInfo::setStatBase(Attributes::ATK, base); + PlayerInfo::updateAttrs(); + break; + case Ea::ATK_MOD: + PlayerInfo::setStatMod(Attributes::ATK, base); + PlayerInfo::updateAttrs(); + break; + case Ea::MATK: + PlayerInfo::setStatBase(Attributes::MATK, base); + break; + case Ea::MATK_MOD: + PlayerInfo::setStatMod(Attributes::MATK, base); + break; + case Ea::DEF: + PlayerInfo::setStatBase(Attributes::DEF, base); + break; + case Ea::DEF_MOD: + PlayerInfo::setStatMod(Attributes::DEF, base); + break; + case Ea::MDEF: + PlayerInfo::setStatBase(Attributes::MDEF, base); + break; + case Ea::MDEF_MOD: + PlayerInfo::setStatMod(Attributes::MDEF, base); + break; + case Ea::HIT: + PlayerInfo::setStatBase(Attributes::HIT, base); + break; + case Ea::FLEE: + PlayerInfo::setStatBase(Attributes::FLEE, base); + break; + case Ea::FLEE_MOD: + PlayerInfo::setStatMod(Attributes::FLEE, base); + break; + case Ea::CRIT: + PlayerInfo::setStatBase(Attributes::CRIT, base); + break; + case Ea::ATTACK_DELAY: + localPlayer->setAttackSpeed(base); + PlayerInfo::setStatBase(Attributes::ATTACK_DELAY, base); + PlayerInfo::setStatMod(Attributes::ATTACK_DELAY, 0); + PlayerInfo::updateAttrs(); + break; + case Ea::JOB: + PlayerInfo::setStatBase(Attributes::JOB, base); + break; + + default: + UNIMPLIMENTEDPACKET; + break; + } } +#undef setStatComplex + } // namespace EAthena diff --git a/src/net/tmwa/playerhandler.cpp b/src/net/tmwa/playerhandler.cpp index a4512489a..ed2bc6c9f 100644 --- a/src/net/tmwa/playerhandler.cpp +++ b/src/net/tmwa/playerhandler.cpp @@ -22,9 +22,22 @@ #include "net/tmwa/playerhandler.h" +#include "units.h" +#include "notifymanager.h" +#include "party.h" + #include "being/localplayer.h" #include "being/playerinfo.h" +#include "const/net/nostat.h" + +#include "enums/resources/notifytypes.h" + +#include "gui/windows/skilldialog.h" +#include "gui/windows/statuswindow.h" + +#include "net/ea/eaprotocol.h" + #include "net/tmwa/inventoryhandler.h" #include "net/tmwa/messageout.h" #include "net/tmwa/protocolout.h" @@ -197,18 +210,214 @@ void PlayerHandler::setViewEquipment(const bool allow A_UNUSED) const { } +#define setStatComplex(stat) \ + PlayerInfo::setStatBase(stat, base, notify); \ + if (mod != NoStat) \ + PlayerInfo::setStatMod(stat, mod) + void PlayerHandler::setStat(Net::MessageIn &msg, const int type, const int base, const int mod, const Notify notify) const { - if (type == 500) + switch (type) { - localPlayer->setGMLevel(base); - return; + case Ea::WALK_SPEED: + localPlayer->setWalkSpeed(base); + PlayerInfo::setStatBase(Attributes::WALK_SPEED, base); + PlayerInfo::setStatMod(Attributes::WALK_SPEED, 0); + break; + case Ea::EXP: + PlayerInfo::setAttribute(Attributes::EXP, base); + break; + case Ea::JOB_EXP: + PlayerInfo::setStatExperience(Attributes::JOB, base, + PlayerInfo::getStatExperience(Attributes::JOB).second); + break; + case Ea::KARMA: + PlayerInfo::setStatBase(Attributes::KARMA, base); + PlayerInfo::setStatMod(Attributes::KARMA, 0); + break; + case Ea::MANNER: + PlayerInfo::setStatBase(Attributes::MANNER, base); + PlayerInfo::setStatMod(Attributes::MANNER, 0); + break; + case Ea::HP: + PlayerInfo::setAttribute(Attributes::HP, base); + if (localPlayer->isInParty() && Party::getParty(1)) + { + PartyMember *const m = Party::getParty(1) + ->getMember(localPlayer->getId()); + if (m) + { + m->setHp(base); + m->setMaxHp(PlayerInfo::getAttribute(Attributes::MAX_HP)); + } + } + break; + case Ea::MAX_HP: + PlayerInfo::setAttribute(Attributes::MAX_HP, base); + + if (localPlayer->isInParty() && Party::getParty(1)) + { + PartyMember *const m = Party::getParty(1)->getMember( + localPlayer->getId()); + if (m) + { + m->setHp(PlayerInfo::getAttribute(Attributes::HP)); + m->setMaxHp(base); + } + } + break; + case Ea::MP: + PlayerInfo::setAttribute(Attributes::MP, base); + break; + case Ea::MAX_MP: + PlayerInfo::setAttribute(Attributes::MAX_MP, base); + break; + case Ea::CHAR_POINTS: + PlayerInfo::setAttribute(Attributes::CHAR_POINTS, base); + break; + case Ea::LEVEL: + PlayerInfo::setAttribute(Attributes::LEVEL, base); + if (localPlayer) + { + localPlayer->setLevel(base); + localPlayer->updateName(); + } + break; + case Ea::SKILL_POINTS: + PlayerInfo::setAttribute(Attributes::SKILL_POINTS, base); + if (skillDialog) + skillDialog->update(); + break; + case Ea::STR: + setStatComplex(Attributes::STR); + break; + case Ea::AGI: + setStatComplex(Attributes::AGI); + break; + case Ea::VIT: + setStatComplex(Attributes::VIT); + break; + case Ea::INT: + setStatComplex(Attributes::INT); + break; + case Ea::DEX: + setStatComplex(Attributes::DEX); + break; + case Ea::LUK: + setStatComplex(Attributes::LUK); + break; + case Ea::MONEY: + { + const int oldMoney = PlayerInfo::getAttribute(Attributes::MONEY); + const int newMoney = base; + if (newMoney > oldMoney) + { + NotifyManager::notify(NotifyTypes::MONEY_GET, + Units::formatCurrency(newMoney - oldMoney)); + } + else if (newMoney < oldMoney) + { + NotifyManager::notify(NotifyTypes::MONEY_SPENT, + Units::formatCurrency(oldMoney - newMoney).c_str()); + } + + PlayerInfo::setAttribute(Attributes::MONEY, newMoney); + break; + } + case Ea::EXP_NEEDED: + PlayerInfo::setAttribute(Attributes::EXP_NEEDED, base); + break; + case Ea::JOB_MOD: + PlayerInfo::setStatExperience(Attributes::JOB, + PlayerInfo::getStatExperience(Attributes::JOB).first, base); + break; + case Ea::TOTAL_WEIGHT: + PlayerInfo::setAttribute(Attributes::TOTAL_WEIGHT, base); + break; + case Ea::MAX_WEIGHT: + PlayerInfo::setAttribute(Attributes::MAX_WEIGHT, base); + break; + case Ea::STR_NEEDED: + statusWindow->setPointsNeeded(Attributes::STR, base); + break; + case Ea::AGI_NEEDED: + statusWindow->setPointsNeeded(Attributes::AGI, base); + break; + case Ea::VIT_NEEDED: + statusWindow->setPointsNeeded(Attributes::VIT, base); + break; + case Ea::INT_NEEDED: + statusWindow->setPointsNeeded(Attributes::INT, base); + break; + case Ea::DEX_NEEDED: + statusWindow->setPointsNeeded(Attributes::DEX, base); + break; + case Ea::LUK_NEEDED: + statusWindow->setPointsNeeded(Attributes::LUK, base); + break; + + case Ea::ATK: + PlayerInfo::setStatBase(Attributes::ATK, base); + PlayerInfo::updateAttrs(); + break; + case Ea::ATK_MOD: + PlayerInfo::setStatMod(Attributes::ATK, base); + PlayerInfo::updateAttrs(); + break; + case Ea::MATK: + PlayerInfo::setStatBase(Attributes::MATK, base); + break; + case Ea::MATK_MOD: + PlayerInfo::setStatMod(Attributes::MATK, base); + break; + case Ea::DEF: + PlayerInfo::setStatBase(Attributes::DEF, base); + break; + case Ea::DEF_MOD: + PlayerInfo::setStatMod(Attributes::DEF, base); + break; + case Ea::MDEF: + PlayerInfo::setStatBase(Attributes::MDEF, base); + break; + case Ea::MDEF_MOD: + PlayerInfo::setStatMod(Attributes::MDEF, base); + break; + case Ea::HIT: + PlayerInfo::setStatBase(Attributes::HIT, base); + break; + case Ea::FLEE: + PlayerInfo::setStatBase(Attributes::FLEE, base); + break; + case Ea::FLEE_MOD: + PlayerInfo::setStatMod(Attributes::FLEE, base); + break; + case Ea::CRIT: + PlayerInfo::setStatBase(Attributes::CRIT, base); + break; + case Ea::ATTACK_DELAY: + localPlayer->setAttackSpeed(base); + PlayerInfo::setStatBase(Attributes::ATTACK_DELAY, base); + PlayerInfo::setStatMod(Attributes::ATTACK_DELAY, 0); + PlayerInfo::updateAttrs(); + break; + case Ea::JOB: + PlayerInfo::setStatBase(Attributes::JOB, base); + break; + case 500: + localPlayer->setGMLevel(base); + break; + + default: + UNIMPLIMENTEDPACKET; + break; } - Ea::PlayerHandler::setStat(msg, type, base, mod, notify); + } +#undef setStatComplex + } // namespace TmwAthena |