- Joined
- Jun 19, 2009
- Messages
- 1,852
- Reaction score
- 5
Hello!
I tried to add this:
in this script:
But it doesn't work. Could someone fix it for me? I want if you click on X item, you get +1 magic level, however, only druids or sorceres BELOW mag lvl 150 can use it.
I tried to add this:
Code:
[7720] = {SKILL__MAGLEVEL, 150}
in this script:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="Skill scroll" enabled="yes">
<action itemid="9004;5958;5956;7696" event="script"><![CDATA[
local t = {
[9004] = {SKILL_CLUB, 150},
[5958] = {SKILL_SWORD, 150},
[5956] = {SKILL_AXE, 150},
[7696] = {SKILL_DISTANCE, 150}
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
local v = t[item.itemid]
if getPlayerSkillLevel(cid, v[1]) < v[2] then
doPlayerAddSkill(cid, v[1], 1, true)
doRemoveItem(item.uid, 1)
else
doCreatureSay(cid, "You can only use this if your " .. SKILL_NAMES[v[1]] .. " skill is lower than " .. v[2], TALKTYPE_ORANGE_1, false, cid)
end
return true
end
]]></action>
</mod>
But it doesn't work. Could someone fix it for me? I want if you click on X item, you get +1 magic level, however, only druids or sorceres BELOW mag lvl 150 can use it.