How do I make an item you have to be a certain level to use/equip?
There is no support built into the engine for this type of requirement (although, see Bug #230). However, you can fake it like this:
- Firstly, this technique will only work if only one person can equip the item anyway.
- Next, you need an on step script. If you don't already have one, now's a good time to make one! It needs to, at minimum, be set on any map where the hero is in the party and has the item.
- You need two copies of the item. The first one is unequipable, while the second is equipable.
- The script you need looks like this:
plotscript,check item levels,begin if (get hero level (find hero(hero:Bob))>>20, and, inventory(item:uberswd) >> 0) then, begin variable (i) i:= inventory(item:uberswd) delete item(item:uberswd, i) get item(item:uberswd2, i) end end
What this does is check, every step, to see if you have any "Uberswd"s, and if you're supposed to be able to equip them. If so, then it removes all your "Uberswd"s, and gives you an equivalent number of "Uberswd2"s. This does not work in reverse (i.e., if the hero subsequently loses a level for some reason, he can still equip the item)