Changing the level-based class prefixes in /who
My goal is to change this part of classes.cpp:
Code:
const char* GetEQClassName(uint8 class_, uint8 level) { |
The client decides what text to print based on a class number in the who response. Name and Guild name are the only server-side changeable fields I am aware of. You could try messing with the rankmessage field (Gives GM/Trader additional text in who results). Worth playing around with for sure!
|
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); Code:
if ((level >= 70) |
I just tested this quickly, you can use strings from eqstr_us.txt for rank.
My level 1 cleric was listed as; High Priest[1 Cleric] Daaxodush (Human). Pretty neat. |
Quote:
Did you use the method written out by jdoran to do this or did you simply edit something in eqstr_us.txt? I tried adding this code Code:
if ((level >= 70) Looking for just a little more hand holding here, as I think it seems like this is possible based on what you guys are saying, but just not exactly sure how to execute it yet. Edit: These are the three errors I get when trying to compile: Code:
Error 1 error C2065: 'client' : undeclared identifier C:\EQ\Source\common\classes.cpp 24 1 common |
Quote:
Code:
if (ClientEntry->IsTrader()) 12315 TRADER 6056 BUYER 12312 * GM * Based on my limited tests you can use any valid string ID. Note that this only applies to local zone who, not who all which happens in different place. |
Awesome, drajor! I've got this working in its natural form. Now, I just need to find the condition to check if a player has an item. I could actually really use an example of that if you don't mind helping me out just a bit more. I've searched around but everything I've found deals with checking items in quest scripts but not in the source code
|
Quick and nasty;
Code:
if (ClientEntry->IsTrader()) Lyricist[1 Bard] Drajor (Barbarian) |
Code:
Error 10 error C2819: type 'Inventory' does not have an overloaded member 'operator ->' C:\EQ\Source\zone\entity.cpp 4076 1 zone Edit: Code:
else if (ClientEntry->GetInv().HasItem(17181, 0, 0xff)) Edit: Everything compiles successfully, the server runs without error, but having the specified item doesn't return any sort of string before the level and class in /who ... experimenting more with this |
Writing it as such
Code:
else if (ClientEntry->GetInv().HasItem(17181) > -1) |
What client are you using?
|
Quote:
I'm on the Titanium client... only client I have atm |
I am fairly certain that anything below SoF handles /who client side :( I recommend Underfoot for everything except P99.
|
Ok, I will get a copy of Underfoot and report back in this thread with my findings.
|
Update: I can confirm now with the Underfoot client that this method works for the intended purpose. Thanks for the help!
|
All times are GMT -4. The time now is 12:26 AM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.