• 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!

Need a Script? Then I'm here to help!

Evil Mark

Active Member
Joined
Nov 23, 2008
Messages
1,707
Reaction score
32
Well, I'm going to support you as much as I can, request Lua scripts below and I will make them for you whenever I got time. I am on OTland daily and will keep checking this thread everyday. This is just to sharpen my Lua skills.

1#Don't request something to big, it's to time consuming.
2#Don't ask me to join your "projects" I am already in one.
3#What I don't do is (NPCS/spells <-- Lame) everything else is okey :)

Also, it must be 0.3+ TFS Distribution.
 
Last edited:
can you make this? if you shoot a FF onto a hydra egg it as a 5% chance of hatching into a hydra
 
Add woodcutting to that :) Levels your fist skill when you cut one down like the mining part and requires a hatchet :)

Thanks! :D

Code:
local recipes = {
	--herbalism (big mushrooms)
	[4167] = {tool = 2550, skill = 0, loot = {{2801, 1}}, effect = CONST_ME_MAGIC_RED, profession = "herbalism"},
	[4168] = {tool = 2550, skill = 0, loot = {{2801, 1}}, effect = CONST_ME_MAGIC_RED, profession = "herbalism"},
	[4169] = {tool = 2550, skill = 0, loot = {{2801, 1}}, effect = CONST_ME_MAGIC_RED, profession = "herbalism"},
	[4174] = {tool = 2550, skill = 0, loot = {{2801, 1}}, effect = CONST_ME_MAGIC_RED, profession = "herbalism"},
	[4175] = {tool = 2550, skill = 0, loot = {{2801, 1}}, effect = CONST_ME_MAGIC_RED, profession = "herbalism"},
	[4172] = {tool = 2550, skill = 0, loot = {{2801, 1}}, effect = CONST_ME_MAGIC_RED, profession = "herbalism"},
	[4173] = {tool = 2550, skill = 0, loot = {{2801, 1}}, effect = CONST_ME_MAGIC_RED, profession = "herbalism"},
	--mining (minerals, metals)
	[5753] = {tool = 2553, skill = 0, loot = {{7762, 1}}, effect = CONST_ME_HITAREA, profession = "mining", skillpoints = 10},
	[5868] = {tool = 2553, skill = 20, loot = {{7760, 1}}, effect = CONST_ME_HITAREA, profession = "mining", skillpoints = 15},
	[5866] = {tool = 2553, skill = 30, loot = {{7761, 1}}, effect = CONST_ME_HITAREA, profession = "mining", skillpoints = 25},
	[5751] = {tool = 2553, skill = 50, loot = {{7759, 1}}, effect = CONST_ME_HITAREA, profession = "mining", skillpoints = 35}
}
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
 local profession = {
 ["mining"] = {skill = SKILL_CLUB}
 }
	if recipes[itemEx.itemid] then
		if itemEx.actionid > 0  then
			doCreatureSay(cid, "You can't do that.", TALKTYPE_ORANGE_1)
			doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
			return true
		end
		lootTable = {}
		lootName = "You recive: "
		if recipes[itemEx.itemid].profession == "mining" then
		professionSkill = getPlayerSkillLevel(cid, profession[recipes[itemEx.itemid].profession].skill)
		else
		professionSkill = 0
		end
		itemPos = getThingPos(itemEx.uid)
		if item.itemid == recipes[itemEx.itemid].tool then
			if professionSkill >= recipes[itemEx.itemid].skill then
				if item.actionid ~= 5001 then				
					if math.random(1, 3) < 2 then
						doRemoveItem(itemEx.uid, 1)
						doSendMagicEffect(itemPos, recipes[itemEx.itemid].effect)
						if recipes[itemEx.itemid].profession ~= "skinning" then
							addEvent(doCreateItem, 30000, itemEx.itemid, 1, itemPos)
							addEvent(doSendMagicEffect, 30000, itemPos, recipes[itemEx.itemid].effect)
						end
						repeat
							if #recipes[itemEx.itemid].loot == 0 then
								break
							end
							for i = 1, #recipes[itemEx.itemid].loot do
								if math.random(1, 2) < 2 then
									table.insert(lootTable, (recipes[itemEx.itemid].loot)[i])
								end
							end
						until lootTable ~= {}
						for i = 1, #lootTable do
							lootCount = math.random(1, lootTable[i][2])	
							doPlayerAddItem(cid, lootTable[i][1], lootCount)
							if i == #lootTable then
								lootName = lootName..""..lootCount.."x ".. getItemNameById(lootTable[i][1]) .."."
							else
								lootName = lootName..""..lootCount.."x ".. getItemNameById(lootTable[i][1]) ..", "
							end
						end
						if lootName == "You recive: " then
							lootName = "You don't recive any loot."
						end
						if recipes[itemEx.itemid].profession == "mining" then
						doPlayerAddSkillTry(cid, profession[recipes[itemEx.itemid].profession].skill, recipes[itemEx.itemid].skillpoints)
						end
						doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, lootName)
					else
						doSendMagicEffect(itemPos, CONST_ME_BLOCKHIT)
						doCreatureSay(cid, "Keep trying, this plant or rock is tough!", TALKTYPE_ORANGE_1)
					end
				else
					doSendMagicEffect(itemPos, CONST_ME_BLOCKHIT)
					doCreatureSay(cid, "This tree was cut recenlty by someone else!", TALKTYPE_ORANGE_1)
				end
			else
				doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
				doCreatureSay(cid, "You don't have required skill to do that!", TALKTYPE_ORANGE_1)
		end
		else
			doSendMagicEffect(getPlayerPosition(cid), CONST_ME_BLOCKHIT)
			doCreatureSay(cid, "This tool doesn't match!", TALKTYPE_ORANGE_1)
		end
	end
	return true
end
 
can you make this? if you shoot a FF onto a hydra egg it as a 5% chance of hatching into a hydra

Lua:
local t = 5 -- % for hydra to be summoned
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if  getTileItemById(variantToPosition(var),4850).uid > 0 and math.random(1,100) <= 5 then
                doSummonCreature("hydra", pos)
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Hydra has been summoned")
	else
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Summoning the hydra has failed.")
	end
end
 
Last edited:
Add woodcutting to that :) Levels your fist skill when you cut one down like the mining part and requires a hatchet :)

You didn't gimme any Tree ID's so I just added 3 ID's random, you can add more yourself later on. Also who made this code? It's kinda messy :p

Lua:
local recipes = {
	--herbalism (big mushrooms)
	[4167] = {tool = 2550, skill = 0, loot = {{2801, 1}}, effect = CONST_ME_MAGIC_RED, profession = "herbalism"},
	[4168] = {tool = 2550, skill = 0, loot = {{2801, 1}}, effect = CONST_ME_MAGIC_RED, profession = "herbalism"},
	[4169] = {tool = 2550, skill = 0, loot = {{2801, 1}}, effect = CONST_ME_MAGIC_RED, profession = "herbalism"},
	[4174] = {tool = 2550, skill = 0, loot = {{2801, 1}}, effect = CONST_ME_MAGIC_RED, profession = "herbalism"},
	[4175] = {tool = 2550, skill = 0, loot = {{2801, 1}}, effect = CONST_ME_MAGIC_RED, profession = "herbalism"},
	[4172] = {tool = 2550, skill = 0, loot = {{2801, 1}}, effect = CONST_ME_MAGIC_RED, profession = "herbalism"},
	[4173] = {tool = 2550, skill = 0, loot = {{2801, 1}}, effect = CONST_ME_MAGIC_RED, profession = "herbalism"},
	--mining (minerals, metals)
	[5753] = {tool = 2553, skill = 0, loot = {{7762, 1}}, effect = CONST_ME_HITAREA, profession = "mining", skillpoints = 10},
	[5868] = {tool = 2553, skill = 20, loot = {{7760, 1}}, effect = CONST_ME_HITAREA, profession = "mining", skillpoints = 15},
	[5866] = {tool = 2553, skill = 30, loot = {{7761, 1}}, effect = CONST_ME_HITAREA, profession = "mining", skillpoints = 25},
	[5751] = {tool = 2553, skill = 50, loot = {{7759, 1}}, effect = CONST_ME_HITAREA, profession = "mining", skillpoints = 35}
    --woodcutting (wood)
	[2786] = {tool = 2388, skill = 10, loot = {{5901, 1}}, effect = CONST_ME_HITAREA, profession = "woodcutting", skillpoints = 10},
	[2768] = {tool = 2388, skill = 10, loot = {{5901, 1}}, effect = CONST_ME_HITAREA, profession = "woodcutting", skillpoints = 10},
	[2767] = {tool = 2388, skill = 10, loot = {{5901, 1}}, effect = CONST_ME_HITAREA, profession = "woodcutting", skillpoints = 10}
}
	

 
function onUse(cid, item, fromPosition, itemEx, toPosition)
 local profession = {
 ["mining"] = {skill = SKILL_CLUB}
 ["woodcutting"] = {skill = SKILL_FIST}
 }
	if recipes[itemEx.itemid] then
		if itemEx.actionid > 0  then
			doCreatureSay(cid, "You can't do that.", TALKTYPE_ORANGE_1)
			doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
			return true
		end
		lootTable = {}
		lootName = "You recive: "
		if recipes[itemEx.itemid].profession == "mining" or recipes[itemEx.itemid].profession == "woodcutting" then
		professionSkill = getPlayerSkillLevel(cid, profession[recipes[itemEx.itemid].profession].skill)
		else
		professionSkill = 0
		end
		itemPos = getThingPos(itemEx.uid)
		if item.itemid == recipes[itemEx.itemid].tool then
			if professionSkill >= recipes[itemEx.itemid].skill then
				if item.actionid ~= 5001 then				
					if math.random(1, 3) < 2 then
						doRemoveItem(itemEx.uid, 1)
						doSendMagicEffect(itemPos, recipes[itemEx.itemid].effect)
						if recipes[itemEx.itemid].profession ~= "skinning" then
							addEvent(doCreateItem, 30000, itemEx.itemid, 1, itemPos)
							addEvent(doSendMagicEffect, 30000, itemPos, recipes[itemEx.itemid].effect)
						end
						repeat
							if #recipes[itemEx.itemid].loot == 0 then
								break
							end
							for i = 1, #recipes[itemEx.itemid].loot do
								if math.random(1, 2) < 2 then
									table.insert(lootTable, (recipes[itemEx.itemid].loot)[i])
								end
							end
						until lootTable ~= {}
						for i = 1, #lootTable do
							lootCount = math.random(1, lootTable[i][2])	
							doPlayerAddItem(cid, lootTable[i][1], lootCount)
							if i == #lootTable then
								lootName = lootName..""..lootCount.."x ".. getItemNameById(lootTable[i][1]) .."."
							else
								lootName = lootName..""..lootCount.."x ".. getItemNameById(lootTable[i][1]) ..", "
							end
						end
						if lootName == "You recive: " then
							lootName = "You don't recive any loot."
						end
						if recipes[itemEx.itemid].profession == "mining" then
						doPlayerAddSkillTry(cid, profession[recipes[itemEx.itemid].profession].skill, recipes[itemEx.itemid].skillpoints)
						end
						doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, lootName)
					else
						doSendMagicEffect(itemPos, CONST_ME_BLOCKHIT)
						doCreatureSay(cid, "Keep trying! This plant, tree or rock is tough!", TALKTYPE_ORANGE_1)
					end
				else
					doSendMagicEffect(itemPos, CONST_ME_BLOCKHIT)
					doCreatureSay(cid, "This tree was cut recenlty by someone else!", TALKTYPE_ORANGE_1)
				end
			else
				doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
				doCreatureSay(cid, "You don't have required skill to do that!", TALKTYPE_ORANGE_1)
		end
		else
			doSendMagicEffect(getPlayerPosition(cid), CONST_ME_BLOCKHIT)
			doCreatureSay(cid, "This tool doesn't match!", TALKTYPE_ORANGE_1)
		end
	end
	return true
end
 
Last edited:
hello can u make war system for me so i can buy om du kan skriv till mig pm
 
PHP:
function onUse(cid, item, frompos, item2, topos) 
        if item2.itemid == 8895 then
                if math.random(100) <= 25 then
                        doPlayerAddItem(cid, 2160, 1)
                        doPlayerSendTextMessage(cid, 9, "Congratulations!")
                else
                        doPlayerSendTextMessage(cid,9,"Try again!") 
                end
		doRemoveItem(item.uid, 1)
        end
end


why this script only removes the item 8895 and never gives 2160 ( casino script )

can you fix that? thanks
 
This:
Lua:
local t = 5 -- % for hydra to be summoned
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if  getTileItemById(variantToPosition(var),4850).uid > 0 then
		doSummonCreature("Hydra") math.random(1,100) <=t)
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Hydra has been summoned")
	else
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Summoning the hydra has failed.")
	end
end
Not works, because what is this: ?????
Code:
doSummonCreature("Hydra") math.random(1,100) <=t)

lol...
 
Tibiamakers:
Lua:
function onUse(cid, item, frompos, item2, topos)  
        if item2.itemid == 8895 then 
                if math.random(100) <= 25 then
                        doRemoveItem(item.uid, 1)  
                        doPlayerAddItem(cid, 2160, 1) 
                        doPlayerSendTextMessage(cid, 9, "Congratulations!") 
                else 
                        doPlayerSendTextMessage(cid,9,"Try again!")  
                end  
        end 
end

Try & comment. ;)
 
Tibiamakers:
Lua:
function onUse(cid, item, frompos, item2, topos)  
        if item2.itemid == 8895 then 
                if math.random(100) <= 25 then
                        doRemoveItem(item.uid, 1)  
                        doPlayerAddItem(cid, 2160, 1) 
                        doPlayerSendTextMessage(cid, 9, "Congratulations!") 
                else 
                        doPlayerSendTextMessage(cid,9,"Try again!")  
                end  
        end 
end

Try & comment. ;)
egg,
Guys the guy is saying that he want when he use fire filed rune on a egg it will do somthng , so if you make a function onuse you will disable the spell part [ though you can make the spell part in the action] But it is better to change in the fire field rune file

Lua:
if  getTileItemById(variantToPosition(var),4850).uid > 0 then
And that is wat will be used to check for the pos he clicked at in the oncast function in fire filed file.
 
doggy my post to tibiamakers it is not referrer of the egg script :S
 
hello can you make a sup counter so when i have 200 manas its say useing one of 200 mana potion and when i have 199 its say useing one of 199 mana potion.becuse my is bugged i hope you understand sorry for my eng
 
hello can you make a sup counter so when i have 200 manas its say useing one of 200 mana potion and when i have 199 its say useing one of 199 mana potion.becuse my is bugged i hope you understand sorry for my eng

Use another .EXE, last time I checked it was the exe file that had that piece of code.
 
Back
Top