Again,
Code:
on=@EquipTest
if (<src.skillclass> == <whatever_class>) && (<src.npc> == 0)
src.smsg You can't equip this armor.
return 1
endif
You missed my point. @Equip is fired AFTER @EquipTest, which @EquipTest is used to see if an item can be equipped or not. @Equip says it is already equipped and now we are processing what we are going to do now it is equipped.
No point in saying sorry if you didn't understand the point I was trying to make. Triggers parse in a specified order. Each trigger has its own functionality. Which I outlined what @EquipTest and @Equip do and the order they go in.
This could be handled on the skillclass itself:
Code:
[skillclass 42]
....
on=@ItemEquipTest
if (<act.type> == t_armor||t_leather_armor) && (<act.tdata3> == 3) // Just using the example above of the person who set the armor type in the tdata3.
src.smsg You can't equip this armor.
return 1
endif
Anyone who has this skillclass won't be able to use said item that way.
Edited this a few times. The original code I redid now checks for brain_player and skillclass. The second one is fired from the player on their skillclass.
The first is fired on every item using that trigger if it is equipped (player and npc). The second only fires on players equipping items (though it will check every armor they equip). The first is OPTIMAL if you don't have your Mobiles equipping a lot of armor. If you have mobiles equipping armor on your server, you might just want to parse it on the player instead.