Go Back   EQEmulator Home > EQEmulator Forums > Development > Development: Custom Code

Development: Custom Code This is for code thatdoes not emulate live and wont be added to the official code.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #3  
Old 09-24-2014, 02:05 AM
jdoran
Hill Giant
 
Join Date: Jul 2012
Posts: 212
Default

Edit: Drajor posted while I was writing the following. I didn't know that /who was done client-side. But perhaps zerjz3 wanted to change that function for some other reason? I'm reaching.

You would need to change the if statements to something more complicated. The problem is that GetEQClassName() currently depends only on class and level. You would need to add another parameter to the function.

Now the easiest way to do this is place the new parameter at the end, and assign a default value. However... GetEQClassName already has an optional parameter: level. You could require a level be passed everywhere you want the new titles, or for about the same amount of work you could just pass in a new parameter. A pointer to a Client would seem a reasonable choice.

That isn't such a tough problem. We can (under Linux) use find and grep to search for usage. Visual Studio can do the same thing under Windows. Now while there are advanced regular expressions in grep, I'm lazy and like to stick with the simple stuff. So, in your eqemu directory:

find . -exec grep GetEQClassName {} /dev/null \; 2> /dev/null | grep -v Binary

give us:

Code:
./common/classes.h:const char* GetEQClassName(uint8 class_, uint8 level = 0);
./common/classes.cpp:const char* GetEQClassName(uint8 class_, uint8 level) {
./zone/embparser.cpp:           ExportVar(package_name.c_str(), "class", GetEQClassName(mob->GetClass()));
./zone/client.cpp:      Message(0,"Your target is a level %i %s. It appears %s and %s for its level. It seems %s",who->GetLevel(),GetEQClassName(who->GetClass(),1),dmg,hitpoints,resists);
./zone/bot.cpp:         GetBotOwner()->Message(15, "A %s - %s bot was detected. Is this Race/Class combination allowed?.", GetRaceName(GetRace()), GetEQClassName(GetClass(), GetLevel()));
./world/client.cpp:     clog(WORLD__CLIENT,"Name approval request. Name=%s, race=%s, class=%s",char_name,GetRaceName(race),GetEQClassName(clas));
./world/clientlist.cpp:                                 sprintf(line, "  %s[RolePlay %i %s] %s (%s)%s zone: %s%s%s", tmpgm, cle->level(), GetEQClassName(cle->class_(),cle->level()), cle->name(), GetRaceName(cle->race()), tmpguild, tmpZone, LFG, accinfo);
./world/clientlist.cpp:                                 sprintf(line, "  %s[ANON %i %s] %s (%s)%s zone: %s%s%s", tmpgm, cle->level(), GetEQClassName(cle->class_(),cle->level()), cle->name(), GetRaceName(cle->race()), tmpguild, tmpZone, LFG, accinfo);
./world/clientlist.cpp:                         sprintf(line, "  %s[%i %s] %s (%s)%s zone: %s%s%s", tmpgm, cle->level(), GetEQClassName(cle->class_(),cle->level()), cle->name(), GetRaceName(cle->race()), tmpguild, tmpZone, LFG, accinfo);
./world/eqw.cpp:        res["class"] = GetEQClassName(cle->class_());
There are 7 calls to this function. Easily fixed. If you don't have a pointer to the Client handy, pass in a NULL and revert to the default behavior. It is late, and this is off the top of my head:

Code:
if ((level >= 70) 
{
    if ((client) && (client -> GetInv().HasItem(itemID, 0, 0xff)))
    {
            return "UberWarlord";
    }
    else
    {
            return "Warlord";
    }
}
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 06:03 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3