EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Support::General Support (https://www.eqemulator.org/forums/forumdisplay.php?f=598)
-   -   Allowing items to be equipped for raceid 12+ (https://www.eqemulator.org/forums/showthread.php?t=41699)

caravellex 01-18-2018 01:01 AM

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?

Darkscis 01-18-2018 01:35 AM

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.

caravellex 01-18-2018 03:37 PM

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.

Uleat 01-18-2018 04:33 PM

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.

caravellex 01-18-2018 05:18 PM

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

Darkscis 01-18-2018 07:38 PM

Quote:

Originally Posted by caravellex (Post 257051)
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.

caravellex 01-18-2018 09:20 PM

I think it should still allow class restrictions at least

Uleat 01-18-2018 09:31 PM

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.

Darkscis 01-19-2018 01:24 AM

Quote:

Originally Posted by caravellex (Post 257078)
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.

caravellex 01-19-2018 05:05 PM

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


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

Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.