Swij
Active Member
Hello there!
Xampy solved it! heres the working script
Rep++ to the ones who help!
Xampy solved it! heres the working script
Lua:
local spellItemID = 8981
local Cancelwords = "You need to have a vocation and be over level 250 to read this book."
local Sorcererwords = "You've learned the Energy rage spell say \"Exevo vis rage\" to test it."
local Druidwords = "You've learned the Nature rage spell say \"Exevo pox rage\" to test it."
local Paladinwords = "You've learned the Holy rage spell say \"Exevo san rage\" to test it."
local Knightwords = "You've learned the Physical rage spell say \"Exevo hur rage\" to test it."
local reqLevel = 250
function onUse(cid, item, frompos, item2, topos)
if item.itemid == spellItemID and (getPlayerVocation(cid) == 1 or getPlayerVocation(cid) == 5) and getPlayerLevel(cid) >= reqLevel then
playerLearnInstantSpell(cid, "Energy Rage")
doCreatureSay(cid, Sorcererwords, 19)
doRemoveItem(cid, item.uid, 1)
elseif item.itemid == spellItemID and (getPlayerVocation(cid) == 2 or getPlayerVocation(cid) == 6) and getPlayerLevel(cid) >= reqLevel then
playerLearnInstantSpell(cid, "Nature Rage")
doCreatureSay(cid, Druidwords, 19)
doRemoveItem(cid, item.uid, 1)
elseif item.itemid == spellItemID and (getPlayerVocation(cid) == 3 or getPlayerVocation(cid) == 7) and getPlayerLevel(cid) >= reqLevel then
playerLearnInstantSpell(cid, "Holy Rage")
doCreatureSay(cid, Paladinwords, 19)
doRemoveItem(cid, item.uid, 1)
elseif item.itemid == spellItemID and (getPlayerVocation(cid) == 4 or getPlayerVocation(cid) == 8) and getPlayerLevel(cid) >= reqLevel then
playerLearnInstantSpell(cid, "Physical Rage")
doCreatureSay(cid, Knightwords, 19)
doRemoveItem(cid, item.uid, 1)
else
doPlayerSendCancel(cid, Cancelwords)
end
return 1
end
Rep++ to the ones who help!
Last edited: