diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-11-10 14:03:04 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-11-10 14:03:04 +0300 |
commit | 97ba09b2b8ce7896e98318faa536b67e0c164fdf (patch) | |
tree | be337f44eb93dcf0fdb4045d0f18389ed07daf09 /src | |
parent | 02a9ff284ebc4c096f98ad8b23259ea67f82f8e1 (diff) | |
download | manaverse-97ba09b2b8ce7896e98318faa536b67e0c164fdf.tar.gz manaverse-97ba09b2b8ce7896e98318faa536b67e0c164fdf.tar.bz2 manaverse-97ba09b2b8ce7896e98318faa536b67e0c164fdf.tar.xz manaverse-97ba09b2b8ce7896e98318faa536b67e0c164fdf.zip |
Decode some more skill errors.
Diffstat (limited to 'src')
-rw-r--r-- | src/net/ea/skillrecv.h | 3 | ||||
-rw-r--r-- | src/net/eathena/skillrecv.cpp | 41 |
2 files changed, 44 insertions, 0 deletions
diff --git a/src/net/ea/skillrecv.h b/src/net/ea/skillrecv.h index f968f0f36..9ef7d511c 100644 --- a/src/net/ea/skillrecv.h +++ b/src/net/ea/skillrecv.h @@ -56,6 +56,9 @@ static const unsigned int RFAIL_REDGEM = 0x07; static const unsigned int RFAIL_BLUEGEM = 0x08; static const unsigned int RFAIL_OVERWEIGHT = 0x09; +static const unsigned int RFAIL_NEED_ITEM = 71; +static const unsigned int RFAIL_NEED_EQUIPMENT = 72; + /** should always be zero if failed */ static const unsigned int SKILL_FAILED = 0x00; diff --git a/src/net/eathena/skillrecv.cpp b/src/net/eathena/skillrecv.cpp index faf72c478..dbd8f7166 100644 --- a/src/net/eathena/skillrecv.cpp +++ b/src/net/eathena/skillrecv.cpp @@ -39,6 +39,10 @@ #include "net/eathena/menu.h" +#include "resources/iteminfo.h" + +#include "resources/db/itemdb.h" + #include "utils/gettext.h" #include "utils/stringutils.h" @@ -264,6 +268,43 @@ void SkillRecv::processSkillFailed(Net::MessageIn &msg) // TRANSLATORS: error message txt.append(_("You're carrying to much to do this!")); break; + case RFAIL_NEED_EQUIPMENT: + { + const int itemId = bskill >> 16; + const int amount = bskill & 0xFFFFU; + const ItemInfo &info = ItemDB::get(itemId); + if (amount == 1) + { + txt.append(strprintf(_("Need equipment %s."), + info.getLink().c_str())); + } + else + { + txt.append(strprintf(_("Need equipment %s and amount %d"), + info.getLink().c_str(), + amount)); + } + break; + } + case RFAIL_NEED_ITEM: + { + const int itemId = bskill >> 16; + const int amount = bskill & 0xFFFFU; + const ItemInfo &info = ItemDB::get(itemId); + if (amount == 1) + { + txt.append(strprintf(_("Need item %s."), + info.getLink().c_str())); + } + else + { + txt.append(strprintf(_("Need item %s and amount %d"), + info.getLink().c_str(), + amount)); + } + break; + } + default: UNIMPLIMENTEDPACKET; break; |