718 Adding Item Level Requirements

Anyone know how to add level requirements to items? Not sure where to add or find the code. I’ve check in ItemDefinitions.java & ItemConstants.java tried adding a few different methods in but never got it to compile and then work. Any suggestions or help is appreciated, unfortunately google has been extremely limited on information about this… and so have most websites.

It’s the Rune Evo V3 server base…

Tried this in ItemConstants.java only

if ((item.getId() == #####)) {
if (player.getSkills().getLevel(Skills.ATTACK) < 99) {
player.getPackets().sendGameMessage(
“You don’t have the requeriments to equip this item.”);
return false;

Looking to add 2 skill reqs per item for a couple weapons and then attempt to do reqs for armor sets.

[quote=“Gromic, post:1, topic:555516”]Anyone know how to add level requirements to items? Not sure where to add or find the code. I’ve check in ItemDefinitions.java & ItemConstants.java tried adding a few different methods in but never got it to compile and then work. Any suggestions or help is appreciated, unfortunately google has been extremely limited on information about this… and so have most websites.

Tried this in ItemConstants.java only

if ((item.getId() == #####)) {
if (player.getSkills().getLevel(Skills.ATTACK) < 99) {
player.getPackets().sendGameMessage(
“You don’t have the requeriments to equip this item.”);
return false;

Looking to add 2 skill reqs per item for a couple weapons and then attempt to do reqs for armor sets.[/quote]

Depends on your server base. But typically in a PI it’d be in ItemAssistant, under the wearItem method.

To find out what method it is for you specifically, you’d check the wear item packet (packet 41) in your code.

Updated the post with the based used.

Is that the packet 41, on the client?

Sorry to ask more nub questions still mid learning process.

[quote=“Gromic, post:3, topic:555516”]Updated the post with the based used.

Is that the packet 41, on the client?

Sorry to ask more nub questions still mid learning process.[/quote]
It’s set from the client to the server.

As you say it’s a 718, there should be a method in an item class named “canWear” or similar. Should be in ItemConstants or ItemDefinitions or similar.
That’s where you’d add the code you have above

[size=16pt]Highly preferred[/size]

ItemDefinitions class, method getWearingSkillRequiriments()

if(getId() == ####) {
itemRequiriments.put(Skills.ATTACK, 99);
}

Most level requirements are loaded within the cache, so, at its best you’d modify the level requirements in the cache.

Its easy, I can help you, add me on Skype: [HIDDEN]