[6812] Implement localization of creature/gameobject name that say/yell.

Original patch deeply rewrited.
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
evilstar 2008-11-09 13:12:16 +03:00 committed by VladimirMangos
parent 89612654da
commit 1da8ff0043
7 changed files with 42 additions and 2 deletions

View file

@ -2028,3 +2028,19 @@ TrainerSpellData const* Creature::GetTrainerSpells() const
{
return objmgr.GetNpcTrainerSpells(GetEntry());
}
// overwrite WorldObject function for proper name localization
const char* Creature::GetNameForLocaleIdx(int32 loc_idx) const
{
if (loc_idx >= 0)
{
CreatureLocale const *cl = objmgr.GetCreatureLocale(GetEntry());
if (cl)
{
if (cl->Name.size() > loc_idx && !cl->Name[loc_idx].empty())
return cl->Name[loc_idx].c_str();
}
}
return GetName();
}