summaryrefslogtreecommitdiff
path: root/src/net/eathena/charserverhandler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/eathena/charserverhandler.cpp')
-rw-r--r--src/net/eathena/charserverhandler.cpp40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/net/eathena/charserverhandler.cpp b/src/net/eathena/charserverhandler.cpp
index d7d7be582..e353d970e 100644
--- a/src/net/eathena/charserverhandler.cpp
+++ b/src/net/eathena/charserverhandler.cpp
@@ -44,9 +44,11 @@
#include "resources/iteminfo.h"
+#include "resources/db/chardb.h"
#include "resources/db/itemdb.h"
#include "utils/dtor.h"
+#include "utils/gettext.h"
#include "debug.h"
@@ -291,6 +293,44 @@ void CharServerHandler::connect()
mNetwork->skip(4);
}
+void CharServerHandler::setCharCreateDialog(CharCreateDialog *const window)
+{
+ mCharCreateDialog = window;
+
+ if (!mCharCreateDialog)
+ return;
+
+ StringVect attributes;
+ // TRANSLATORS: playe stat
+ attributes.push_back(_("Strength:"));
+ // TRANSLATORS: playe stat
+ attributes.push_back(_("Agility:"));
+ // TRANSLATORS: playe stat
+ attributes.push_back(_("Vitality:"));
+ // TRANSLATORS: playe stat
+ attributes.push_back(_("Intelligence:"));
+ // TRANSLATORS: playe stat
+ attributes.push_back(_("Dexterity:"));
+ // TRANSLATORS: playe stat
+ attributes.push_back(_("Luck:"));
+
+ const Token &token =
+ static_cast<LoginHandler*>(Net::getLoginHandler())->getToken();
+
+ int minStat = CharDB::getMinStat();
+ if (!minStat)
+ minStat = 1;
+ int maxStat = CharDB::getMaxStat();
+ if (!maxStat)
+ maxStat = 9;
+ int sumStat = CharDB::getSumStat();
+ if (!sumStat)
+ sumStat = 30;
+
+ mCharCreateDialog->setAttributes(attributes, sumStat, minStat, maxStat);
+ mCharCreateDialog->setFixedGender(true, token.sex);
+}
+
void CharServerHandler::processCharLogin(Net::MessageIn &msg)
{
msg.skip(2, "packet len");