summaryrefslogtreecommitdiff
path: root/src/account-server
diff options
context:
space:
mode:
authorPhilipp Sehmisch <tmw@crushnet.org>2007-03-20 18:41:24 +0000
committerPhilipp Sehmisch <tmw@crushnet.org>2007-03-20 18:41:24 +0000
commitddb92024dd6851a0565f1f06ed4ac8ea2abf1dd3 (patch)
tree9158b552770d02a71217562dc3e18ef5180f5252 /src/account-server
parented0e4fd21544d2c3e0a8494c6f48fc905afda04f (diff)
downloadmanaserv-ddb92024dd6851a0565f1f06ed4ac8ea2abf1dd3.tar.gz
manaserv-ddb92024dd6851a0565f1f06ed4ac8ea2abf1dd3.tar.bz2
manaserv-ddb92024dd6851a0565f1f06ed4ac8ea2abf1dd3.tar.xz
manaserv-ddb92024dd6851a0565f1f06ed4ac8ea2abf1dd3.zip
Removed check for difference between lowest and highest attribute at char creation. Unified order of basic attributes.
Diffstat (limited to 'src/account-server')
-rw-r--r--src/account-server/accounthandler.cpp11
-rw-r--r--src/account-server/dalstorage.cpp8
-rw-r--r--src/account-server/dalstoragesql.hpp6
3 files changed, 8 insertions, 17 deletions
diff --git a/src/account-server/accounthandler.cpp b/src/account-server/accounthandler.cpp
index 48a72548..fc61ca72 100644
--- a/src/account-server/accounthandler.cpp
+++ b/src/account-server/accounthandler.cpp
@@ -565,8 +565,6 @@ AccountHandler::handleCharacterCreateMessage(AccountClient &computer,
// We see if the difference between the lowest stat and the highest
// isn't too big.
- unsigned short lowestAttribute = POINTS_TO_DISTRIBUTES_AT_LVL1;
- unsigned short highestAttribute = 0; // start value
unsigned int totalAttributes = 0;
bool validNonZeroAttributes = true;
for (int i = 0; i < NB_BASE_ATTRIBUTES; ++i)
@@ -576,10 +574,6 @@ AccountHandler::handleCharacterCreateMessage(AccountClient &computer,
// For checking if all stats are at least > 0
if (attributes[i] <= 0) validNonZeroAttributes = false;
- if (lowestAttribute > attributes[i])
- lowestAttribute = attributes[i];
- if (highestAttribute < attributes[i])
- highestAttribute = attributes[i];
}
if (totalAttributes > POINTS_TO_DISTRIBUTES_AT_LVL1)
@@ -590,11 +584,6 @@ AccountHandler::handleCharacterCreateMessage(AccountClient &computer,
{
reply.writeByte(CREATE_ATTRIBUTES_TOO_LOW);
}
- else if ((highestAttribute - lowestAttribute) >
- (signed) MAX_DIFF_BETWEEN_ATTRIBUTES)
- {
- reply.writeByte(CREATE_ATTRIBUTES_INVALID_DIFF);
- }
else if (!validNonZeroAttributes)
{
reply.writeByte(CREATE_ATTRIBUTES_EQUAL_TO_ZERO);
diff --git a/src/account-server/dalstorage.cpp b/src/account-server/dalstorage.cpp
index 4898ed1c..721bb55f 100644
--- a/src/account-server/dalstorage.cpp
+++ b/src/account-server/dalstorage.cpp
@@ -554,6 +554,8 @@ DALStorage::updateCharacter(CharacterPtr character)
<< "', "
<< "agi = '" << character->getBaseAttribute(BASE_ATTR_AGILITY)
<< "', "
+ << "dex = '" << character->getBaseAttribute(BASE_ATTR_DEXTERITY)
+ << "', "
<< "vit = '" << character->getBaseAttribute(BASE_ATTR_VITALITY)
<< "', "
#if defined(MYSQL_SUPPORT) || defined(POSTGRESQL_SUPPORT)
@@ -563,8 +565,7 @@ DALStorage::updateCharacter(CharacterPtr character)
#endif
<< character->getBaseAttribute(BASE_ATTR_INTELLIGENCE)
<< "', "
- << "dex = '" << character->getBaseAttribute(BASE_ATTR_DEXTERITY)
- << "', "
+
<< "will = '" << character->getBaseAttribute(BASE_ATTR_WILLPOWER)
<< "', "
<< "charisma = '" << character->getBaseAttribute(BASE_ATTR_CHARISMA)
@@ -878,9 +879,9 @@ void DALStorage::flush(AccountPtr const &account)
<< (*it)->getMapId() << ", "
<< (*it)->getBaseAttribute(BASE_ATTR_STRENGTH) << ", "
<< (*it)->getBaseAttribute(BASE_ATTR_AGILITY) << ", "
+ << (*it)->getBaseAttribute(BASE_ATTR_DEXTERITY) << ", "
<< (*it)->getBaseAttribute(BASE_ATTR_VITALITY) << ", "
<< (*it)->getBaseAttribute(BASE_ATTR_INTELLIGENCE) << ", "
- << (*it)->getBaseAttribute(BASE_ATTR_DEXTERITY) << ", "
<< (*it)->getBaseAttribute(BASE_ATTR_WILLPOWER) << ", "
<< (*it)->getBaseAttribute(BASE_ATTR_CHARISMA) << ");";
@@ -900,6 +901,7 @@ void DALStorage::flush(AccountPtr const &account)
<< " map_id = " << (*it)->getMapId() << ", "
<< " str = " << (*it)->getBaseAttribute(BASE_ATTR_STRENGTH) << ", "
<< " agi = " << (*it)->getBaseAttribute(BASE_ATTR_AGILITY) << ", "
+ << " dex = " << (*it)->getBaseAttribute(BASE_ATTR_DEXTERITY) << ", "
<< " vit = " << (*it)->getBaseAttribute(BASE_ATTR_VITALITY) << ", "
#if defined(MYSQL_SUPPORT) || defined(POSTGRESQL_SUPPORT)
<< " `int` = "
diff --git a/src/account-server/dalstoragesql.hpp b/src/account-server/dalstoragesql.hpp
index 1d42467d..c4a433af 100644
--- a/src/account-server/dalstoragesql.hpp
+++ b/src/account-server/dalstoragesql.hpp
@@ -132,10 +132,10 @@ const std::string SQL_CHARACTERS_TABLE(
// attributes
"str SMALLINT UNSIGNED NOT NULL,"
"agi SMALLINT UNSIGNED NOT NULL,"
+ "dex SMALLINT UNSIGNED NOT NULL,"
"vit SMALLINT UNSIGNED NOT NULL,"
// note: int must be backquoted as it's a MySQL keyword
"`int` SMALLINT UNSIGNED NOT NULL,"
- "dex SMALLINT UNSIGNED NOT NULL,"
"will SMALLINT UNSIGNED NOT NULL,"
"charisma SMALLINT UNSIGNED NOT NULL,"
"FOREIGN KEY (user_id) REFERENCES tmw_accounts(id),"
@@ -158,9 +158,9 @@ const std::string SQL_CHARACTERS_TABLE(
// attributes
"str INTEGER NOT NULL,"
"agi INTEGER NOT NULL,"
+ "dex INTEGER NOT NULL,"
"vit INTEGER NOT NULL,"
"int INTEGER NOT NULL,"
- "dex INTEGER NOT NULL,"
"will INTEGER NOT NULL,"
"charisma INTEGER NOT NULL,"
"FOREIGN KEY (user_id) REFERENCES tmw_accounts(id),"
@@ -182,9 +182,9 @@ const std::string SQL_CHARACTERS_TABLE(
// attributes
"str INTEGER NOT NULL,"
"agi INTEGER NOT NULL,"
+ "dex INTEGER NOT NULL,"
"vit INTEGER NOT NULL,"
"int INTEGER NOT NULL,"
- "dex INTEGER NOT NULL,"
"will INTEGER NOT NULL,"
"charisma INTEGER NOT NULL,"
"FOREIGN KEY (user_id) REFERENCES tmw_accounts(id),"