PDA

View Full Version : A way to unequip a weapon if your race isn't valid?


Fadedspirit
10-26-2013, 04:29 PM
Making a server with custom races, and all items are all races allowed due to this. However, I want to make a special set of weapons specific to a certain race, but that isn't really possible given the current system since races are pre-defined (I assume by the client?) since I cannot find where ANY of those race values are used in the entirety of the source itself.

ie: I searched the entire source for 4096, which is iksar, but it isn't being used anywhere to check if an item can be equipped by an iksar using 4096? It only asks (if race = IKSAR) which then just checks the raceid which is 128 for iksar.


But, whether or not an item can physically be moved into a slot is based on the db which uses the aforementioned 4096 values, etc etc.


So, my question: Is there a way to unequip an item using PERL if I do a simple race check and find that they're not the intended race? I remember seeing something like this awhile ago but can't seem to find it now.



Thanks,
Faded :D

bad_captain
10-27-2013, 12:47 AM
Check Item_Struct::IsEquipable(uint16 Race, uint16 Class_), which takes in the actual race value (128 for Iksar), and compares that to the Races field for the item in question (the value from the database that determines by what races a particular item is equipable). How you would use this is up to you, but this should help you out.

This is used to check for valid items being traded to bots, as well as other places, just do a search.