aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChazy Chaz <ChazyTheBest@hotmail.es>2017-04-24 01:54:21 +0200
committerAokromes <Aokromes@users.noreply.github.com>2017-04-24 01:54:21 +0200
commit460e2c5dc5eae49f62a9193fb58f1bab42028bd2 (patch)
tree72a9ddeeb30378af56c695e6658829103596034d /src
parent3739d8444b1d5683bdac29f4a91df567dc19fd79 (diff)
Core/Misc: Update locales_item and locales_item_set_names to simple system
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Globals/ObjectMgr.cpp32
1 files changed, 18 insertions, 14 deletions
diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp
index 89521fda4a9..15ee1f7e5cd 100644
--- a/src/server/game/Globals/ObjectMgr.cpp
+++ b/src/server/game/Globals/ObjectMgr.cpp
@@ -2239,7 +2239,8 @@ void ObjectMgr::LoadItemLocales()
_itemLocaleStore.clear(); // need for reload case
- QueryResult result = WorldDatabase.Query("SELECT entry, name_loc1, description_loc1, name_loc2, description_loc2, name_loc3, description_loc3, name_loc4, description_loc4, name_loc5, description_loc5, name_loc6, description_loc6, name_loc7, description_loc7, name_loc8, description_loc8 FROM locales_item");
+ // 0 1 2 3
+ QueryResult result = WorldDatabase.Query("SELECT ID, locale, Name, Description FROM item_template_locale");
if (!result)
return;
@@ -2248,16 +2249,16 @@ void ObjectMgr::LoadItemLocales()
{
Field* fields = result->Fetch();
- uint32 entry = fields[0].GetUInt32();
+ uint32 id = fields[0].GetUInt32();
+ std::string localeName = fields[1].GetString();
+ std::string Name = fields[2].GetString();
+ std::string Description = fields[3].GetString();
- ItemLocale& data = _itemLocaleStore[entry];
+ ItemLocale& data = _itemLocaleStore[id];
+ LocaleConstant locale = GetLocaleByName(localeName);
- for (uint8 i = TOTAL_LOCALES - 1; i > 0; --i)
- {
- LocaleConstant locale = (LocaleConstant) i;
- AddLocaleString(fields[1 + 2 * (i - 1)].GetString(), locale, data.Name);
- AddLocaleString(fields[1 + 2 * (i - 1) + 1].GetString(), locale, data.Description);
- }
+ AddLocaleString(Name, locale, data.Name);
+ AddLocaleString(Description, locale, data.Description);
} while (result->NextRow());
TC_LOG_INFO("server.loading", ">> Loaded %u Item locale strings in %u ms", uint32(_itemLocaleStore.size()), GetMSTimeDiffToNow(oldMSTime));
@@ -2884,7 +2885,8 @@ void ObjectMgr::LoadItemSetNameLocales()
_itemSetNameLocaleStore.clear(); // need for reload case
- QueryResult result = WorldDatabase.Query("SELECT `entry`, `name_loc1`, `name_loc2`, `name_loc3`, `name_loc4`, `name_loc5`, `name_loc6`, `name_loc7`, `name_loc8` FROM `locales_item_set_names`");
+ // 0 1 2
+ QueryResult result = WorldDatabase.Query("SELECT ID, locale, Name FROM item_set_names_locale");
if (!result)
return;
@@ -2893,12 +2895,14 @@ void ObjectMgr::LoadItemSetNameLocales()
{
Field* fields = result->Fetch();
- uint32 entry = fields[0].GetUInt32();
+ uint32 id = fields[0].GetUInt32();
+ std::string localeName = fields[1].GetString();
+ std::string Name = fields[2].GetString();
- ItemSetNameLocale& data = _itemSetNameLocaleStore[entry];
+ ItemSetNameLocale& data = _itemSetNameLocaleStore[id];
+ LocaleConstant locale = GetLocaleByName(localeName);
- for (uint8 i = TOTAL_LOCALES - 1; i > 0; --i)
- AddLocaleString(fields[i].GetString(), LocaleConstant(i), data.Name);
+ AddLocaleString(Name, locale, data.Name);
} while (result->NextRow());
TC_LOG_INFO("server.loading", ">> Loaded " UI64FMTD " Item set name locale strings in %u ms", uint64(_itemSetNameLocaleStore.size()), GetMSTimeDiffToNow(oldMSTime));