[MOD] Lookup DisplayID (modelID), new GM command menu

User Tag List

Results 1 to 7 of 7
  1. #1
    latruwski's Avatar Banned
    Reputation
    647
    Join Date
    Dec 2006
    Posts
    2,456
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [MOD] Lookup DisplayID (modelID), new GM command

    here is a nice quote from emupedia:

    Code:
    Index: game/Chat.cpp
    ===================================================================
    --- game/Chat.cpp	(revision 2714)
    +++ game/Chat.cpp	(working copy)
    @@ -540,6 +540,7 @@
     		{ "lookupitem", 'l', &ChatHandler::HandleLookupItemCommand, "Looks up item string x.", NULL, 0, 0, 0 },
     		{ "lookupquest", 'l', &ChatHandler::HandleQuestLookupCommand, "Looks up quest string x.", NULL, 0, 0, 0 },
     		{ "lookupcreature", 'l', &ChatHandler::HandleLookupCreatureCommand, "Looks up item string x.", NULL, 0, 0, 0 },
    +		{ "lookupdisplayid", 'l', &ChatHandler::HandleLookupDisplayIDCommand, "Looks up displayid x.", NULL, 0, 0, 0 },
     //		{ "reloadscripts", 'w', &ChatHandler::HandleReloadScriptsCommand, "Reloads GM Scripts", NULL, 0, 0, 0 },
     		{ "silentplayer", 't', &ChatHandler::HandleSilentPlayerCommand, "Player cannot chat for x minutes <duration> (default 5 minutes)", NULL, 0, 0, 0 },
     		{ "changepassword", 'z', &ChatHandler::HandleChangePasswordCommand, "Changes your accounts password.", NULL, 0, 0, 0 },
    Index: game/Chat.h
    ===================================================================
    --- game/Chat.h	(revision 2714)
    +++ game/Chat.h	(working copy)
    @@ -425,6 +425,7 @@
     	bool HandleSetStandingCommand(const char * args, WorldSession * m_session);
     	bool HandleGetBaseStandingCommand(const char * args, WorldSession * m_session);
     
    +	bool HandleLookupDisplayIDCommand(const char * args, WorldSession * m_session);
     	bool HandleLookupItemCommand(const char * args, WorldSession * m_session);
     	bool HandleLookupCreatureCommand(const char * args, WorldSession * m_session);
     	bool HandleLookupObjectCommand(const char * args, WorldSession * m_session);
    Index: game/Level3.cpp
    ===================================================================
    --- game/Level3.cpp	(revision 2714)
    +++ game/Level3.cpp	(working copy)
    @@ -1988,14 +1988,19 @@
     	return true;
     }
     
    -void SendHighlightedName(WorldSession * m_session, char* full_name, string& lowercase_name, string& highlight, uint32 id, bool item)
    +void SendHighlightedName(WorldSession * m_session, char* full_name, string& lowercase_name, string& highlight, uint32 id, int type)
     {
     	char message[1024];
     	char start[50];
     	start[0] = message[0] = 0;
    +	string currenttype;
    +	switch(type){
    +		case 0: currenttype = "Creature"; break;
    +		case 1: currenttype = "Item"; break;
    +		case 2: currenttype = "Display ID"; break;
    +	}
    +	snprintf(start, 50, "%s %u: %s", currenttype.c_str(), (unsigned int)id, MSG_COLOR_WHITE);
     
    -	snprintf(start, 50, "%s %u: %s", item ? "Item" : "Creature", (unsigned int)id, MSG_COLOR_WHITE);
    -
     	string::size_type hlen = highlight.length();
     	string fullname = string(full_name);
     	string::size_type offset = lowercase_name.find(highlight);
    @@ -2055,6 +2060,51 @@
     	return true;
     }
     
    +bool ChatHandler::HandleLookupDisplayIDCommand(const char * args, WorldSession * m_session)
    +{
    +		if(!*args) return false;
    +
    +	string x = string(args);
    +	ASCENT_TOLOWER(x);
    +	if(x.length() < 2)
    +	{
    +		RedSystemMessage(m_session, "Your search string must be at least 3 characters long.");
    +		return true;
    +	}
    +
    +	StorageContainerIterator<CreatureInfo> * itr = CreatureNameStorage.MakeIterator();
    +
    +	GreenSystemMessage(m_session, "Starting search of displayid `%s`...", x.c_str());
    +	uint32 t = getMSTime();
    +	CreatureInfo * i;
    +	uint32 count = 0;
    +	while(!itr->AtEnd())
    +	{
    +		i = itr->Get();
    +		if(FindXinYString(x, i->lowercase_name))
    +		{
    +			// Print out the name in a cool highlighted fashion
    +			if (i->Male_DisplayID != 0)
    +			SendHighlightedName(m_session, strcat(i->Name," (male)"), i->lowercase_name + " (male)", x, i->Male_DisplayID, 2);
    +			if (i->Female_DisplayID != 0)
    +			SendHighlightedName(m_session, strcat(i->Name," (female)"), i->lowercase_name + " (female)", x, i->Female_DisplayID, 2);
    +			++count;
    +			if(count == 25)
    +			{
    +				RedSystemMessage(m_session, "More than 25 results returned. aborting.");
    +				break;
    +			}
    +		}
    +		if(!itr->Inc())
    +			break;
    +	}
    +	itr->Destruct();
    +
    +	GreenSystemMessage(m_session, "Search completed in %u ms.", getMSTime() - t);
    +	return true;
    +
    +}
    +
     bool ChatHandler::HandleLookupCreatureCommand(const char * args, WorldSession * m_session)
     {
     	if(!*args) return false;
    I pretty much copied the lookupcreature code, hacked it to lookup display IDs instead, and added some aethetics. Thank god c++ typecasts bool to int

    Enjoy.
    i did not make this, original creator = thetoggler so credits go to him! dont give me rep for this, its not my work!

    so what did he do? he copied the lookupcreature code and instead of looking up the creatureid it looks up the modelID

    grtz

    [MOD] Lookup DisplayID (modelID), new GM command
  2. #2
    latruwski's Avatar Banned
    Reputation
    647
    Join Date
    Dec 2006
    Posts
    2,456
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    *bump*

    dam topic got on 3page OMG

  3. #3
    jokerjokes's Avatar Active Member
    Reputation
    75
    Join Date
    Apr 2007
    Posts
    902
    Thanks G/R
    3/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Lol sick, where must i place this in my ascent files lol.

  4. #4
    latruwski's Avatar Banned
    Reputation
    647
    Join Date
    Dec 2006
    Posts
    2,456
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by jokerjokes View Post
    Lol sick, where must i place this in my ascent files lol.
    you need to compile it with ascent...

    grtz

  5. #5
    bueslum's Avatar Active Member
    Reputation
    21
    Join Date
    Feb 2007
    Posts
    37
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I tried this on emupedia and I keep getting an error in the level3.cpp
    ------ Build started: Project: game, Configuration: Release Win32 ------
    Compiling...
    Level3.cpp
    ..\..\src\game\Level3.cpp(2123) : error C2562: 'SendHighlightedName' : 'void' function returning a value
    ..\..\src\game\Level3.cpp(2106) : see declaration of 'SendHighlightedName'
    Build log was saved at "file://h:\Documents and Settings\Ryan\Desktop\revs\branches\2_8_stable\win\VC90\game___Win32_Release\Bui ldLog.htm"
    game - 1 error(s), 0 warning(s)
    ------ Build started: Project: ascent, Configuration: Release Win32 ------
    Linking...
    LINK : warning LNK4224: /OPT:NOWIN98 is no longer supported; ignored
    LINK : fatal error LNK1181: cannot open input file '.\release\game.lib'
    Build log was saved at "file://h:\Documents and Settings\Ryan\Desktop\revs\branches\2_8_stable\win\VC90\Release\BuildLog.htm"
    ascent - 1 error(s), 1 warning(s)

  6. #6
    Illidan1's Avatar Banned
    Reputation
    244
    Join Date
    Jul 2007
    Posts
    2,251
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It is old to, i think, meh, i just look in Database

  7. #7
    bueslum's Avatar Active Member
    Reputation
    21
    Join Date
    Feb 2007
    Posts
    37
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Is there anyway to update it or has somebody made a new one yet? I can look in the db but for the people that I dont trust with db it is easier for them to look the display id up in the game then asking me to do it.

Similar Threads

  1. Arcemu New gm commands
    By Dmonz in forum WoW EMU Guides & Tutorials
    Replies: 13
    Last Post: 12-21-2008, 11:51 PM
  2. ArcEmu New GMs Commands
    By Fantomass in forum WoW EMU General Releases
    Replies: 5
    Last Post: 11-19-2008, 02:59 AM
  3. [Release] New GM Command List
    By Cursed in forum World of Warcraft Emulator Servers
    Replies: 5
    Last Post: 04-06-2008, 12:03 PM
  4. [Release] The most important new ascent commands with explanations
    By coldmouth in forum World of Warcraft Emulator Servers
    Replies: 3
    Last Post: 03-27-2008, 09:08 AM
  5. [Ascent]Added New GM command !! Change Gender of characters!
    By latruwski in forum World of Warcraft Emulator Servers
    Replies: 27
    Last Post: 11-07-2007, 05:37 AM
All times are GMT -5. The time now is 02:19 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search