Go Back   EQEmulator Home > EQEmulator Forums > Support > Support::General Support

Support::General Support Post all topics here having to do with errors while trying to connect to an EQEMu server but not about the setup/running of the Server itself.

Reply
 
Thread Tools Display Modes
  #1  
Old 01-18-2018, 01:01 AM
caravellex
Sarnak
 
Join Date: Sep 2010
Posts: 63
Default Allowing items to be equipped for raceid 12+

Hello, Im running into a problem. Say I have a player set to a permarace of 33 (ghoul) even with an item set for ALL races it does not allow me to equip the item.
Is there a race code or a way to do this to allow me to equip the item?
Reply With Quote
  #2  
Old 01-18-2018, 01:35 AM
Darkscis
Sarnak
 
Join Date: Mar 2015
Posts: 62
Default

https://github.com/EQEmu/Server/blob..._data.cpp#L172

Code:
bool EQEmu::ItemData::IsEquipable(uint16 race_id, uint16 class_id) const
{
	if (!(Races & GetPlayerRaceBit(race_id)))
		return false;

	if (!(Classes & GetPlayerClassBit(GetPlayerClassValue(class_id))))
		return false;

	return true;
}
This looks to be your culprit. When following the code it inevitably leads to this, which checks that the race bit is in the items Races field in the database. This will return false and say it cannot be equipped by Ghoul (33) as only the actual player races are currently valid.

You can try playing with the section above, or adding other races as allowed in GetPlayerRaceBit but I have no idea what effect that will have on the client, if any.
Reply With Quote
  #3  
Old 01-18-2018, 03:37 PM
caravellex
Sarnak
 
Join Date: Sep 2010
Posts: 63
Default

Got it!

Code:
bool EQEmu::ItemData::IsEquipable(uint16 race_id, uint16 class_id) const
{
	if (!(Races & GetPlayerRaceBit(race_id)))
		return TRUE;

	if (!(Classes & GetPlayerClassBit(GetPlayerClassValue(class_id))))
		return false;

	return true;
}
by changing the return result false to true.

This makes it so you can't have race restrictions on items. But it let me equip the item onto a ghoul race character.
Reply With Quote
  #4  
Old 01-18-2018, 04:33 PM
Uleat's Avatar
Uleat
Developer
 
Join Date: Apr 2012
Location: North Carolina
Posts: 2,815
Default

Code:
race usable?

no -> return 'true'

yes -> class usable?

       no -> return 'false'

return 'true'
Forcing the 'true' return on race failure completely bypasses the class check.
__________________
Uleat of Bertoxxulous

Compilin' Dirty
Reply With Quote
  #5  
Old 01-18-2018, 05:18 PM
caravellex
Sarnak
 
Join Date: Sep 2010
Posts: 63
Default

I was hoping this change, and the base melee damage would take us one step closer to implementing some type of Project M - where PCs could play as npc characters and have matching stats.

For project M, what you would have to do is when activated, a code pulls from the database a selected value of npcs and then sets the stats, class, race, spells, and items to the player. Because the melee damage is scaled exactly like an npc. It would be almost identical to project M
Reply With Quote
  #6  
Old 01-18-2018, 07:38 PM
Darkscis
Sarnak
 
Join Date: Mar 2015
Posts: 62
Default

Quote:
Originally Posted by caravellex View Post
Got it!

by changing the return result false to true.
Well... Yes. I would have thought you would want to at least have some sort of race and class restrictions on your items though lol.
Reply With Quote
  #7  
Old 01-18-2018, 09:20 PM
caravellex
Sarnak
 
Join Date: Sep 2010
Posts: 63
Default

I think it should still allow class restrictions at least
Reply With Quote
  #8  
Old 01-18-2018, 09:31 PM
Uleat's Avatar
Uleat
Developer
 
Join Date: Apr 2012
Location: North Carolina
Posts: 2,815
Default

The easiest way to disable code (without removing it) is to just remark it out:

Code:
bool EQEmu::ItemData::IsEquipable(uint16 race_id, uint16 class_id) const
{
	//if (!(Races & GetPlayerRaceBit(race_id)))
	//	return false;

	if (!(Classes & GetPlayerClassBit(GetPlayerClassValue(class_id))))
		return false;

	return true;
}

Also, TortoiseGit is a great menu-driven git tool that saves a lot of headaches.
__________________
Uleat of Bertoxxulous

Compilin' Dirty
Reply With Quote
  #9  
Old 01-19-2018, 01:24 AM
Darkscis
Sarnak
 
Join Date: Mar 2015
Posts: 62
Default

Quote:
Originally Posted by caravellex View Post
I think it should still allow class restrictions at least
To an extent, it will work for player races. It won't check class for your other races though. The way your code currently works after you changed it looks logically like this;

If Race is NOT in player races, return true we can wear it. The code block ends right there and does not check the class restrictions because you have told it to return.

If Race IS in player races, then check classes. If the class cannot wear it, return false. Otherwise, return true we can wear the item.

As Uleat said above, if you don't want it to restrict race at all; comment out the race check but don't force an early return. If you still want the race check to work, but you just want certain extra races allowed then you will need to modify GetPlayerRaceBit and add your new race(s). Probably in a few other places as well.
Reply With Quote
  #10  
Old 01-19-2018, 05:05 PM
caravellex
Sarnak
 
Join Date: Sep 2010
Posts: 63
Default

Ahh I see! Good point, I'll try to comment it out. Thank you guys
Reply With Quote
Reply

Thread Tools
Display Modes

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 08:29 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 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3