Jump to content

Lookup Displayid


Recommended Posts

I'm new to ManGOS and this is my first attempt editing the code. I planned to make a lookup command to display the four model IDs associated with the matching creature template names (similar to lookup creature command which I used as the base for this attempt). I have guessed that the PSendSysMessage function is what is used to relay the information to the player.

I'm having a hard time understanding exactly how the PSendSysMessage function works and the convention used for the character string.

I essentially copied the creature lookup code and tried making modifications to get what I wanted with the new command with little success. So far changes I made have been adding a new language code in language.h

LANG_CREATURE_MODEL_LIST = 328, (I'm using this as a level2 command due to the morph being level 2 also).

In the database I added a line to the mangos_string table with entry = 328 and content_default = %d - |cffffffff|Hcreature_modelid_A:%d|h[%s]|h|r

This was mostly a copy of the orifinal except changing the Hcreature_entry to Hcreature_modelid_A in case that'd make a difference.

The original call for the PSendSysMessage was:

PSendSysMessage(LANG_CREATURE_ENTRY_LIST, id, id, cl->Name[loc_idx].c_str());

I changed the first LANG_CREATURE_ENTRY_LIST to my new database entry (which I eventuallty plan to change to display all 4 model ID numbers once I unerstand how to make this work). I've tried changing the id variales and the cl->Name[loc_idx].c_str() to the modelID number obtained from the creatureInfo reference in the function, yet the only results I seem to get is no change at all, or the server crashed.

I may be trying more then I can handle, but any help would be appreciated.

Link to comment
Share on other sites

 Share

×
×
  • 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