diff options
author | Shauren <shauren.trinity@gmail.com> | 2016-04-25 22:03:34 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2016-05-20 23:49:53 +0200 |
commit | 70102f32fe38ae7d49acbd5ddee0239602d3cb94 (patch) | |
tree | 22dcecc33942c7f60e2edb5402f6f7feaf559ece /src/server/scripts/Commands | |
parent | 885d9b53c38662e00e3b4977b82e9cf36d197f94 (diff) |
Core/DataStores: Updated opcodes and db2 to 7.0.3.21414
Diffstat (limited to 'src/server/scripts/Commands')
-rw-r--r-- | src/server/scripts/Commands/cs_character.cpp | 2 | ||||
-rw-r--r-- | src/server/scripts/Commands/cs_debug.cpp | 6 | ||||
-rw-r--r-- | src/server/scripts/Commands/cs_go.cpp | 2 | ||||
-rw-r--r-- | src/server/scripts/Commands/cs_lookup.cpp | 97 | ||||
-rw-r--r-- | src/server/scripts/Commands/cs_misc.cpp | 10 | ||||
-rw-r--r-- | src/server/scripts/Commands/cs_modify.cpp | 4 |
6 files changed, 70 insertions, 51 deletions
diff --git a/src/server/scripts/Commands/cs_character.cpp b/src/server/scripts/Commands/cs_character.cpp index f9aca4b607b..b482716e059 100644 --- a/src/server/scripts/Commands/cs_character.cpp +++ b/src/server/scripts/Commands/cs_character.cpp @@ -559,7 +559,7 @@ public: { FactionState const& faction = itr->second; FactionEntry const* factionEntry = sFactionStore.LookupEntry(faction.ID); - char const* factionName = factionEntry ? factionEntry->Name_lang : "#Not found#"; + char const* factionName = factionEntry ? factionEntry->Name->Str[loc] : "#Not found#"; ReputationRank rank = target->GetReputationMgr().GetRank(factionEntry); std::string rankName = handler->GetTrinityString(ReputationRankStrIndex[rank]); std::ostringstream ss; diff --git a/src/server/scripts/Commands/cs_debug.cpp b/src/server/scripts/Commands/cs_debug.cpp index 59eb97d1476..245aa60b846 100644 --- a/src/server/scripts/Commands/cs_debug.cpp +++ b/src/server/scripts/Commands/cs_debug.cpp @@ -1540,11 +1540,11 @@ public: if (difficulty == -1) for (uint8 diff = 0; diff < MAX_DIFFICULTY; ++diff) { - if (GetMapDifficultyData(mEntry->ID, Difficulty(diff))) - sInstanceSaveMgr->ForceGlobalReset(mEntry->ID, Difficulty(diff)); + if (sDB2Manager.GetMapDifficultyData(map, Difficulty(diff))) + sInstanceSaveMgr->ForceGlobalReset(map, Difficulty(diff)); } else - sInstanceSaveMgr->ForceGlobalReset(mEntry->ID, Difficulty(difficulty)); + sInstanceSaveMgr->ForceGlobalReset(map, Difficulty(difficulty)); return true; } }; diff --git a/src/server/scripts/Commands/cs_go.cpp b/src/server/scripts/Commands/cs_go.cpp index dd048ce3c57..05b6a5c9713 100644 --- a/src/server/scripts/Commands/cs_go.cpp +++ b/src/server/scripts/Commands/cs_go.cpp @@ -509,7 +509,7 @@ public: return false; } - Zone2MapCoordinates(x, y, areaEntry->ParentAreaID ? uint32(areaEntry->ParentAreaID) : areaId); + sDB2Manager.Zone2MapCoordinates(areaEntry->ParentAreaID ? uint32(areaEntry->ParentAreaID) : areaId, x, y); if (!MapManager::IsValidMapCoord(zoneEntry->MapID, x, y)) { diff --git a/src/server/scripts/Commands/cs_lookup.cpp b/src/server/scripts/Commands/cs_lookup.cpp index 2b3752c00be..01844aa937e 100644 --- a/src/server/scripts/Commands/cs_lookup.cpp +++ b/src/server/scripts/Commands/cs_lookup.cpp @@ -309,58 +309,77 @@ public: for (uint32 id = 0; id < sFactionStore.GetNumRows(); ++id) { - if (FactionEntry const* factionEntry = sFactionStore.LookupEntry(id)) + FactionEntry const* factionEntry = sFactionStore.LookupEntry(id); + if (factionEntry) { FactionState const* factionState = target ? target->GetReputationMgr().GetState(factionEntry) : NULL; - std::string name = factionEntry->Name_lang; + int locale = handler->GetSessionDbcLocale(); + std::string name = factionEntry->Name->Str[locale]; if (name.empty()) continue; if (!Utf8FitTo(name, wNamePart)) - continue; - - if (maxResults && count++ == maxResults) { - handler->PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults); - return true; - } + locale = 0; + for (; locale < TOTAL_LOCALES; ++locale) + { + if (locale == handler->GetSessionDbcLocale()) + continue; - // send faction in "id - [faction] rank reputation [visible] [at war] [own team] [unknown] [invisible] [inactive]" format - // or "id - [faction] [no reputation]" format - std::ostringstream ss; - if (handler->GetSession()) - ss << id << " - |cffffffff|Hfaction:" << id << "|h[" << name << "]|h|r"; - else - ss << id << " - " << name; + name = factionEntry->Name->Str[locale]; + if (name.empty()) + continue; - if (factionState) // and then target != NULL also - { - uint32 index = target->GetReputationMgr().GetReputationRankStrIndex(factionEntry); - std::string rankName = handler->GetTrinityString(index); - - ss << ' ' << rankName << "|h|r (" << target->GetReputationMgr().GetReputation(factionEntry) << ')'; - - if (factionState->Flags & FACTION_FLAG_VISIBLE) - ss << handler->GetTrinityString(LANG_FACTION_VISIBLE); - if (factionState->Flags & FACTION_FLAG_AT_WAR) - ss << handler->GetTrinityString(LANG_FACTION_ATWAR); - if (factionState->Flags & FACTION_FLAG_PEACE_FORCED) - ss << handler->GetTrinityString(LANG_FACTION_PEACE_FORCED); - if (factionState->Flags & FACTION_FLAG_HIDDEN) - ss << handler->GetTrinityString(LANG_FACTION_HIDDEN); - if (factionState->Flags & FACTION_FLAG_INVISIBLE_FORCED) - ss << handler->GetTrinityString(LANG_FACTION_INVISIBLE_FORCED); - if (factionState->Flags & FACTION_FLAG_INACTIVE) - ss << handler->GetTrinityString(LANG_FACTION_INACTIVE); + if (Utf8FitTo(name, wNamePart)) + break; + } } - else - ss << handler->GetTrinityString(LANG_FACTION_NOREPUTATION); - handler->SendSysMessage(ss.str().c_str()); + if (locale < TOTAL_LOCALES) + { + if (maxResults && count++ == maxResults) + { + handler->PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults); + return true; + } - if (!found) - found = true; + // send faction in "id - [faction] rank reputation [visible] [at war] [own team] [unknown] [invisible] [inactive]" format + // or "id - [faction] [no reputation]" format + std::ostringstream ss; + if (handler->GetSession()) + ss << id << " - |cffffffff|Hfaction:" << id << "|h[" << name << ' ' << localeNames[locale] << "]|h|r"; + else + ss << id << " - " << name << ' ' << localeNames[locale]; + + if (factionState) // and then target != NULL also + { + uint32 index = target->GetReputationMgr().GetReputationRankStrIndex(factionEntry); + std::string rankName = handler->GetTrinityString(index); + + ss << ' ' << rankName << "|h|r (" << target->GetReputationMgr().GetReputation(factionEntry) << ')'; + + if (factionState->Flags & FACTION_FLAG_VISIBLE) + ss << handler->GetTrinityString(LANG_FACTION_VISIBLE); + if (factionState->Flags & FACTION_FLAG_AT_WAR) + ss << handler->GetTrinityString(LANG_FACTION_ATWAR); + if (factionState->Flags & FACTION_FLAG_PEACE_FORCED) + ss << handler->GetTrinityString(LANG_FACTION_PEACE_FORCED); + if (factionState->Flags & FACTION_FLAG_HIDDEN) + ss << handler->GetTrinityString(LANG_FACTION_HIDDEN); + if (factionState->Flags & FACTION_FLAG_INVISIBLE_FORCED) + ss << handler->GetTrinityString(LANG_FACTION_INVISIBLE_FORCED); + if (factionState->Flags & FACTION_FLAG_INACTIVE) + ss << handler->GetTrinityString(LANG_FACTION_INACTIVE); + } + else + ss << handler->GetTrinityString(LANG_FACTION_NOREPUTATION); + + handler->SendSysMessage(ss.str().c_str()); + + if (!found) + found = true; + } } } diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp index d66a6d24cc2..236197b84c9 100644 --- a/src/server/scripts/Commands/cs_misc.cpp +++ b/src/server/scripts/Commands/cs_misc.cpp @@ -207,7 +207,7 @@ public: float zoneX = object->GetPositionX(); float zoneY = object->GetPositionY(); - Map2ZoneCoordinates(zoneX, zoneY, zoneId); + sDB2Manager.Map2ZoneCoordinates(zoneId, zoneX, zoneY); Map const* map = object->GetMap(); float groundZ = map->GetHeight(object->GetPhaseMask(), object->GetPositionX(), object->GetPositionY(), MAX_HEIGHT); @@ -1168,10 +1168,10 @@ public: if (itemNameStr && itemNameStr[0]) { std::string itemName = itemNameStr+1; - auto itr = std::find_if(sItemSparseStore.begin(), sItemSparseStore.end(), [&itemName](std::pair<uint32, ItemSparseEntry const*> kv) + auto itr = std::find_if(sItemSparseStore.begin(), sItemSparseStore.end(), [&itemName](ItemSparseEntry const* sparse) { for (uint32 i = 0; i < MAX_LOCALES; ++i) - if (itemName == kv.second->Name->Str[i]) + if (itemName == sparse->Name->Str[i]) return true; return false; }); @@ -1183,7 +1183,7 @@ public: return false; } - itemId = itr->first; + itemId = itr->ID; } else return false; @@ -1795,7 +1795,7 @@ public: // Output XI. LANG_PINFO_CHR_RACE raceStr = DB2Manager::GetChrRaceName(raceid, locale); - classStr = GetClassName(classid, locale); + classStr = DB2Manager::GetClassName(classid, locale); handler->PSendSysMessage(LANG_PINFO_CHR_RACE, (gender == 0 ? handler->GetTrinityString(LANG_CHARACTER_GENDER_MALE) : handler->GetTrinityString(LANG_CHARACTER_GENDER_FEMALE)), raceStr.c_str(), classStr.c_str()); // Output XII. LANG_PINFO_CHR_ALIVE diff --git a/src/server/scripts/Commands/cs_modify.cpp b/src/server/scripts/Commands/cs_modify.cpp index 47f1212f80a..435c3c74231 100644 --- a/src/server/scripts/Commands/cs_modify.cpp +++ b/src/server/scripts/Commands/cs_modify.cpp @@ -1008,14 +1008,14 @@ public: if (factionEntry->ReputationIndex < 0) { - handler->PSendSysMessage(LANG_COMMAND_FACTION_NOREP_ERROR, factionEntry->Name_lang, factionId); + handler->PSendSysMessage(LANG_COMMAND_FACTION_NOREP_ERROR, factionEntry->Name->Str[handler->GetSessionDbcLocale()], factionId); handler->SetSentErrorMessage(true); return false; } target->GetReputationMgr().SetOneFactionReputation(factionEntry, amount, false); target->GetReputationMgr().SendState(target->GetReputationMgr().GetState(factionEntry)); - handler->PSendSysMessage(LANG_COMMAND_MODIFY_REP, factionEntry->Name_lang, factionId, + handler->PSendSysMessage(LANG_COMMAND_MODIFY_REP, factionEntry->Name->Str[handler->GetSessionDbcLocale()], factionId, handler->GetNameLink(target).c_str(), target->GetReputationMgr().GetReputation(factionEntry)); return true; } |