Jump to content

Names


Guest darkjoy2k2

Recommended Posts

Can someone show me where the point is, where the name of gameobjects are given to the client?

Looking for it but cant figure it out...

guess it goes with GetNameForLocaleIdx!?

tried for fun

gameobject.cpp line 142

/    SetUInt32Value(GAMEOBJECT_DISPLAYID, goinfo->displayId);
   SetUInt32Value(GAMEOBJECT_DISPLAYID, 499);

now every gameobject looks like a grave...

but how should it look for the displayed name?

target: i added data to gameobject who shows the one that created it... i have a dead player that drops a chest with the image of a gravestone and the Name "Grave". i want to bring in checks, that adds the creators name to the displayed name when the special gameobject is at hand... (e.g. PLAYERNAME+"´s "+GAMEOBJECT_NAME" / Peter´s Grave

Link to comment
Share on other sites

displayid is not the name :-)

i found only this lines about names:

// overwrite WorldObject function for proper name localization
const char* GameObject::GetNameForLocaleIdx(int32 loc_idx) const
{
   if (loc_idx >= 0)
   {
       GameObjectLocale const *cl = sObjectMgr.GetGameObjectLocale(GetEntry());
       if (cl)
       {
           if (cl->Name.size() > (size_t)loc_idx && !cl->Name[loc_idx].empty())
               return cl->Name[loc_idx].c_str();
       }
   }

   return GetName();
}

but i dont know how it works :-)

Link to comment
Share on other sites

the thing with the displayid was an example...

modiefied the code but dont get any effect in the client...

// overwrite WorldObject function for proper name localization
const char* GameObject::GetNameForLocaleIdx(int32 loc_idx) const
{
   if (loc_idx >= 0)
   {
       GameObjectLocale const *cl = sObjectMgr.GetGameObjectLocale(GetEntry());
       if (cl)
       {
           if (cl->Name.size() > (size_t)loc_idx && !cl->Name[loc_idx].empty())
               return "schwanz";
     //         return cl->Name[loc_idx].c_str();

       }
   }
                   return "schwanz";
 //  return GetName();
}

same goes for Creature:GetNameForLocaleIdx

but i dont see any effect ingame...

thats the only 2 funcs where GetNameForLocaleIdx is used

Link to comment
Share on other sites

what you want to do is not possible. name is cached on clientside.

well, sorry but i must disagree... the MANGOS loads the DATABASE... if i name a item in the database a "Stupid faggot" the game item is displayed as it! the client not directly accesse´s the database... so there must be a possible way, but i already realize that its easier to simply write a new gameobject_template where i can set the name as i want!

Link to comment
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use