Teddy
SweStream.se
I have a xp scroll .. now iam looking for a skill scroll that add 5 skills to all skills
local itemID = 7723 ---- Item ID you use.
local xp = 10000000 ---- How much exp it will give.
local level = 250 -------From this level and less he can use this item.
function onUse(cid, item, frompos, item2, topos)
if item.itemid == itemID and getPlayerLevel(cid) <= level then
doPlayerAddExp(cid, xp)
doCreatureSay(cid, words, 1)
doRemoveItem(cid, item.uid, 1)
doCreatureSay(cid, "CONGRATULATIONS! You gained 10,000,000 EXP from the EXP SCROLL!. ", TALKTYPE_ORANGE_1)
else
doPlayerSendCancel(cid, "Sorry but you are to high lvl to use this scroll")
end
return 1
end
doPlayerAddExp(cid, xp)
doPlayerAddSkill(cid, sword)
local config = {maxlvl = 250, trys = 50, skilltype = 2}
-- SKILLTYPE == FIST = 0, CLUB = 1, SWORD = 2, AXE = 3, DISTANCE = 4, SHIELD = 5
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerLevel(cid) <= config.maxlvl then
doPlayerAddSkillTry(cid, config.skilltype, config.trys)
doRemoveItem(item.uid, 1)
doPlayerSendTextMessage(cid,TALKTYPE_BROADCAST, "CONGRATULATIONS! You gained ".. config.trys .." SKILL TRYS from the SKILL SCROLL!.")
else
doPlayerSendCancel(cid, "Your level is too high.")
end
return TRUE
end