ID:1293842
 
(See the best response by Kaiochao.)
Code:
    sword
name = "Sword"
icon_state = "sword"
description = "+5 Power"
overlay_state = "sword"
overlay_layer = 2
map_state = "sword-map"

slot = MAIN_HAND
// make the sword actually give you +5 power

equipped(mob/m)
m.overlay(src)
m.power += 5

unequipped(mob/m)
m.remove(src)
m.power -= 5


Problem description:
Possible to make it so that items cant be equipped unless Said class or a certain level?

I.e :
say I am a Mage and I want to equip this bow, or chain-mail armour. It wouldn't let me because I am not the right class. Or if I wanted to equip a level 80 wand but I am only level 79, It wouldn't let me.


PS : Above is the code for a basic default sword code that is given with Action-Rpg-FrameWork



Put if(src.level >= (level you want)) on top of m.overlay(src)
Best response
I haven't used this framework at all, but here's what I gather from less than a minute of looking for a quick solution for you.

It's clear that there is a proc that determine whether an item can be equipped:
item
proc
can_equip(mob/m)
return 1


You simply need to override that proc and return a value depending on whether the player should be able to equip that item. When it returns true, or 1, the item can be equipped.

For example,
//  The level 80 wand can only be equipped by players
// whose level is equal to or greater than 80.

item/level_80_wand
can_equip(mob/m)
return m.level >= 80
Alright I will try that Kaiochao Thanks for giving it a look.
I will post back, if I need more tips, or if something didn't quite work.

--edit--

    sword

name = "Sword"
icon_state = "sword"
description = "+5 Power"
overlay_state = "sword"
overlay_layer = 2
map_state = "sword-map"

slot = MAIN_HAND
// make the sword actually give you +5 power

equipped(mob/m)

can_equip(mob/m)
return m.level >= 80
return m.class >= "Knight"
m.overlay(src)
m.power += 5

unequipped(mob/m)
m.remove(src)
m.power -= 5



Works quite swell thank! also is there a way I could add a message for when a player cant equip it?

I am not quite sure where to put it..

       cant_equip(mob/m)
m << "You can't equip this"
return
Your code will never reach the second line under can_equip()
In response to HavenDev
can_equip(mob/m)
if(m.level < 80 || m.class != "Knight")
m << "You can not equip this"
return 0
else
return m.level >= 80
return m.class >= "Knight"
m.overlay(src)
m.power += 5