Add support for localized item names (#136)

* Add support for localized item names

* Add support for localized item names
This commit is contained in:
Paul Lee
2023-10-27 05:49:38 +08:00
committed by GitHub
parent 97eb89bc73
commit cd8989155e

View File

@@ -878,6 +878,12 @@ private:
uint32 itemId = itemTemplate->ItemId;
uint32 accountId = player->GetSession()->GetAccountId();
std::string itemName = itemTemplate -> Name1;
// get locale item name
int loc_idex = player->GetSession()->GetSessionDbLocaleIndex();
if (ItemLocale const* il = sObjectMgr->GetItemLocale(itemId))
ObjectMgr::GetLocaleString(il->Name, loc_idex, itemName);
std::stringstream tempStream;
tempStream << std::hex << ItemQualityColors[itemTemplate->Quality];
std::string itemQuality = tempStream.str();