• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

Skillscroll, Magicscroll, Levelscroll [Rep++]

Axelor

Member
Joined
Sep 2, 2010
Messages
505
Reaction score
9
Someone have

-TRAIN skillscroll script?
-TRAIN magicscroll script?
-exp scroll script?


repp+ for the person who helps me with this ;)
thx for ur time !
peace ;)
 
LUA:
local t ={
	[7844] = { -- donate exp
		limit = 450,
		exp = 75000000,
	},
	[7845] = { -- donate ml
		mana = 6000000,
		limit = {
			[isSorcerer] = 130,
			[isDruid] = 130,
			[isPaladin] = 50,
			[isKnight] = 15
		}
	},
	[7846] = { -- donate skill
		skill = 250000,
		limit = {
			[isPaladin] = 130,
			[isKnight] = 130
		}
	}
}

local c=getConfigInfo('rateSkill')

function onUse(cid, item, fromPosition, itemEx, toPosition)
	local v = t[item.itemid]
	if v then
		if v.exp then
			if getPlayerLevel(cid) < v.limit then
				doPlayerAddExp(cid, math.min(getExperienceForLevel(v.limit) - getPlayerExperience(cid), math.min(v.exp, getExperienceForLevel(v.limit))))
				doSendMagicEffect(getThingPos(cid), 27)
				doRemoveItem(item.uid)
			else
				doPlayerSendCancel(cid, 'You can only use this under level ' .. v.limit .. '.')
			end
		elseif v.mana then
			for f, limit in pairs(v.limit) do
				if f(cid) then
					if getPlayerMagLevel(cid, true) < limit then
						doPlayerAddSpentMana(cid, math.ceil(math.min((getPlayerRequiredMana(cid, limit) - getPlayerSpentMana(cid)), v.mana)))
						doSendMagicEffect(getThingPos(cid), 27)
						doRemoveItem(item.uid)
					else
						doPlayerSendCancel(cid, 'You can only use this under magic level ' .. limit .. '.')
					end
					break
				end
			end
		elseif v.skill then
			local skill, n
			for f, limit in pairs(v.limit) do
				if f(cid) then
					if f == isKnight then
						skill = {}
						for i = 1, 3 do
							 skill[i] = {i, getPlayerSkillLevel(cid, i, true)}
						end
						table.sort(skill, function(a,b) return a[2]>b[2] end)
						skill, n = skill[1][1], skill[1][2]
					else
						skill, n = 4, getPlayerSkillLevel(cid, 4, true)
					end
					if n < limit then
						doPlayerAddSkillTry(cid, skill, math.ceil(math.min((getPlayerRequiredSkillTries(cid, skill, limit) - getPlayerSkillTries(cid, skill)) / c, v.skill / c)))
						doSendMagicEffect(getThingPos(cid), 27)
						doRemoveItem(item.uid)
					else
						doPlayerSendCancel(cid, 'You can only use this with ' .. SKILL_NAMES[skill] .. ' under ' .. limit .. '.')
					end
					return true
				end
			end
			doPlayerSendCancel(cid, 'Your vocation cannot use this scroll.')
		end
		return true
	end
end
 
LUA:
local t ={
	[7844] = { -- donate exp
		limit = 450,
		exp = 75000000,
	},
	[7845] = { -- donate ml
		mana = 6000000,
		limit = {
			[isSorcerer] = 130,
			[isDruid] = 130,
			[isPaladin] = 50,
			[isKnight] = 15
		}
	},
	[7846] = { -- donate skill
		skill = 250000,
		limit = {
			[isPaladin] = 130,
			[isKnight] = 130
		}
	}
}

local c=getConfigInfo('rateSkill')

function onUse(cid, item, fromPosition, itemEx, toPosition)
	local v = t[item.itemid]
	if v then
		if v.exp then
			if getPlayerLevel(cid) < v.limit then
				doPlayerAddExp(cid, math.min(getExperienceForLevel(v.limit) - getPlayerExperience(cid), math.min(v.exp, getExperienceForLevel(v.limit))))
				doSendMagicEffect(getThingPos(cid), 27)
				doRemoveItem(item.uid)
			else
				doPlayerSendCancel(cid, 'You can only use this under level ' .. v.limit .. '.')
			end
		elseif v.mana then
			for f, limit in pairs(v.limit) do
				if f(cid) then
					if getPlayerMagLevel(cid, true) < limit then
						doPlayerAddSpentMana(cid, math.ceil(math.min((getPlayerRequiredMana(cid, limit) - getPlayerSpentMana(cid)), v.mana)))
						doSendMagicEffect(getThingPos(cid), 27)
						doRemoveItem(item.uid)
					else
						doPlayerSendCancel(cid, 'You can only use this under magic level ' .. limit .. '.')
					end
					break
				end
			end
		elseif v.skill then
			local skill, n
			for f, limit in pairs(v.limit) do
				if f(cid) then
					if f == isKnight then
						skill = {}
						for i = 1, 3 do
							 skill[i] = {i, getPlayerSkillLevel(cid, i, true)}
						end
						table.sort(skill, function(a,b) return a[2]>b[2] end)
						skill, n = skill[1][1], skill[1][2]
					else
						skill, n = 4, getPlayerSkillLevel(cid, 4, true)
					end
					if n < limit then
						doPlayerAddSkillTry(cid, skill, math.ceil(math.min((getPlayerRequiredSkillTries(cid, skill, limit) - getPlayerSkillTries(cid, skill)) / c, v.skill / c)))
						doSendMagicEffect(getThingPos(cid), 27)
						doRemoveItem(item.uid)
					else
						doPlayerSendCancel(cid, 'You can only use this with ' .. SKILL_NAMES[skill] .. ' under ' .. limit .. '.')
					end
					return true
				end
			end
			doPlayerSendCancel(cid, 'Your vocation cannot use this scroll.')
		end
		return true
	end
end


dont works
 
Back
Top