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

Action Osbian Knife & Blessed Wooden stake

Mokerhamer

Retired Global Mod
Senator
Joined
Aug 6, 2007
Messages
1,767
Reaction score
35
This is one of my first released script long time ago, i dotn even know if it works for TFS if it dosen't just tell me and i'll fix it up :p

Begin=============
Data>Actions>Script and make a file named "obsidian knife"
and past this inside:
NOTE TO MAKE IT HARDER TO GET DUST OR LEATHERS CHANGE THIS
random = math.random(1,15)
it's 15 at the moment how hier it is how harder it is to get it!

Osbian Knife


Code:
function onUse(cid, item, frompos, item2, topos)
if item2.itemid == 0 then
return 0
end
---------------------------------All the minotaurs--------------
random = math.random(1,15)
if getPlayerLevel(cid) >= 1 then
if item2.itemid == 2830 or item2.itemid == 2871 or item2.itemid == 2866 or item2.itemid == 2876 and random == 1 then
doSendMagicEffect(topos, 12)
doTransformItem(item2.uid,item2.itemid+1)
doPlayerAddItem(cid,5878,1)
doSendAnimatedText(frompos,"~success~",18);
elseif item2.itemid == 2830 or item2.itemid == 2871 or item2.itemid == 2866 or item2.itemid == 2876 and random >= 2 then
doSendMagicEffect(topos, 3)
doTransformItem(item2.uid,item2.itemid+1)
end
end
---------------------------------All the Lizards--------------
random = math.random(1,15)
if getPlayerLevel(cid) >= 1 then
if item2.itemid == 4259 or item2.itemid == 4262 or item2.itemid == 4251 and random == 1 then
doSendMagicEffect(topos, 12)
doTransformItem(item2.uid,itemid+1)
doPlayerAddItem(cid,5876,1)
doSendAnimatedText(frompos,"~success~",18);
elseif item2.itemid == 4259 or item2.itemid == 4262 or item2.itemid == 4251 and random >= 2 then
doSendMagicEffect(topos, 3)
doTransformItem(item2.uid,itemid+1)
end
end
----------------------Dragon---------------------------
random = math.random(1,15)
if getPlayerLevel(cid) >= 1 then
if item2.itemid == 3104 and random == 1 then
doSendMagicEffect(topos, 12)
doTransformItem(item2.uid,3105)
doPlayerAddItem(cid,5877,1)
doSendAnimatedText(frompos,"~success~",18);
elseif item2.itemid == 3104 and random >= 2 then
doSendMagicEffect(topos, 3)
doTransformItem(item2.uid,3105)
end
end
----------------------Dragon with other corpse--------------------------
random = math.random(1,15)
if getPlayerLevel(cid) >= 1 then
if item2.itemid == 2844 and random == 1 then
doSendMagicEffect(topos, 12)
doTransformItem(item2.uid,3105)
doPlayerAddItem(cid,5877,1)
doSendAnimatedText(frompos,"~success~",18);
elseif item2.itemid == 2844 and random >= 2 then
doSendMagicEffect(topos, 3)
doTransformItem(item2.uid,3105)
end
end
----------------------Dragon lord------------------------
random = math.random(1,15)
if getPlayerLevel(cid) >= 1 then
if item2.itemid == 2881 and random == 1 then
doSendMagicEffect(topos, 12)
doTransformItem(item2.uid,2882)
doPlayerAddItem(cid,5948,1)
doSendAnimatedText(frompos,"~success~",18);
elseif item2.itemid == 2881 and random >= 2 then
doSendMagicEffect(topos, 3)
doTransformItem(item2.uid,2882)
end
end
----------------------behemoth------------------------
random = math.random(1,15)
if getPlayerLevel(cid) >= 1 then
if item2.itemid == 2931 and random == 1 then
doSendMagicEffect(topos, 12)
doTransformItem(item2.uid,2932)
doPlayerAddItem(cid,5893,1)
doSendAnimatedText(frompos,"~success~",18);
elseif item2.itemid == 2931 and random >= 2 then
doSendMagicEffect(topos, 3)
doTransformItem(item2.uid,2932)
end
end
-------------------------Bone Beast---------------------
random = math.random(1,15)
if getPlayerLevel(cid) >= 1 then
if item2.itemid == 3031 and random == 1 then
doSendMagicEffect(topos, 12)
doTransformItem(item2.uid,3032)
doPlayerAddItem(cid,5925,1)
doSendAnimatedText(frompos,"~success~",18);
elseif item2.itemid == 3031 and random >= 2 then
doSendMagicEffect(topos, 3)
doTransformItem(item2.uid,3032)
end
end
doPlayerSendCancel(cid,"You cant skin this.")
return 1
end

Blessed Wooden stake


Code:
function onUse(cid, item, frompos, item2, topos)
if item2.itemid == 0 then
return 0
end
random = math.random(1,15)
if getPlayerLevel(cid) >= 1 then
if item2.itemid == 2916 and random == 1 then
doTransformItem(item2.uid,2917)
doSendMagicEffect(topos, 12)
doPlayerAddItem(cid,5906,1)
doSendAnimatedText(frompos,"~success~",18);
elseif item2.itemid == 2916 and random >= 2 then
doSendMagicEffect(topos, 3)
doTransformItem(item2.uid,2917)
end
end
random = math.random(1,15)
if getPlayerLevel(cid) >= 1 then
if item2.itemid == 2956 and random == 1 then
doSendMagicEffect(topos, 12)
doTransformItem(item2.uid,2957)
doPlayerAddItem(cid,5905,1)
doSendAnimatedText(frompos,"~success~",18);
elseif item2.itemid == 2956 and random >= 2 then
doSendMagicEffect(topos, 3)
doTransformItem(item2.uid,2957)
end
end
doPlayerSendCancel(cid,"You cant make dust of this.")
return 1
end
 
Last edited:
Code:
function skinMonster(cid,item,skin)
	local random = math.random(1,15)
	if(random == 1) then
		doPlayerAddItem(cid,skin,1)
		doSendMagicEffect(getThingPos(item.uid), CONST_ME_MAGIC_RED)
	else
		doSendMagicEffect(getThingPos(item.uid), CONST_ME_POFF)
	end
	doTransformItem(item.uid,item.itemid+1)
end

function onUse(cid, item, frompos, item2, topos)
	if isInArray({2830, 2871, 2866, 2876}, item2.itemid) then
		skinMonster(cid, item2, 5878)
	elseif isInArray({4259, 4262, 4251}, item2.itemid) then
		skinMonster(cid, item2, 5876)
	elseif isInArray({3104}, item2.itemid) then
		skinMonster(cid, item2, 5877)
	elseif isInArray({2881}, item2.itemid) then
		skinMonster(cid, item2, 5948)
	elseif isInArray({2931}, item2.itemid) then
		skinMonster(cid, item2, 5893)
	elseif isInArray({3031}, item2.itemid) then
		skinMonster(cid, item2, 5925)
	else
		doPlayerSendCancel(cid,"Sorry, not possible.")
		return 0
	end
end

Abit optimized.
 
Code:
function skinMonster(cid,item,skin)
	local random = math.random(1,15)
	if(random == 1) then
		doPlayerAddItem(cid,skin,1)
		doSendMagicEffect(getThingPos(item.uid), CONST_ME_MAGIC_RED)
	else
		doSendMagicEffect(getThingPos(item.uid), CONST_ME_POFF)
	end
	doTransformItem(item.uid,item.itemid+1)
end

function onUse(cid, item, frompos, item2, topos)
	if isInArray({2830, 2871, 2866, 2876}, item2.itemid) then
		skinMonster(cid, item2, 5878)
	elseif isInArray({4259, 4262, 4251}, item2.itemid) then
		skinMonster(cid, item2, 5876)
	elseif isInArray({3104}, item2.itemid) then
		skinMonster(cid, item2, 5877)
	elseif isInArray({2881}, item2.itemid) then
		skinMonster(cid, item2, 5948)
	elseif isInArray({2931}, item2.itemid) then
		skinMonster(cid, item2, 5893)
	elseif isInArray({3031}, item2.itemid) then
		skinMonster(cid, item2, 5925)
	else
		doPlayerSendCancel(cid,"Sorry, not possible.")
		return 0
	end
end

Abit optimized.

Omfg damn, Kiper you just teached me some new things thank you =) i'm just an simple starting lua scripter but i learn fast :p
 
Why are you actually using
Code:
if isInArray({3031}, item2.itemid) then
isn't it better to just do this
Code:
if item2.itemid == 3031 then
 
I've been out of tibia since 7.6 so i'm just wondering what do these do? cause if it's cool then i'll add it to my project.
 
Edit - I figured it out, thanks for the scripts guys.
 
Last edited:
Both versions haven't worked for me...

I've fixed it :)
Why everytime check random_chace? We can do it just once and lower cpu work.

function onUse(cid, item, frompos, item2, topos)
if item2.itemid == 0 then
return 0
end

random = math.random(1,4)
if getPlayerLevel(cid) >= 1 then
---------------------------------All the minotaurs--------------
if item2.itemid == 2830 or item2.itemid == 2871 or item2.itemid == 2866 or item2.itemid == 2876 then
if random == 1 then
doSendMagicEffect(topos, 12)
doTransformItem(item2.uid,item2.itemid+1)
doPlayerAddItem(cid,5878,1)
doSendAnimatedText(frompos,"~success~",18);
else
doSendMagicEffect(topos, 3)
doTransformItem(item2.uid,item2.itemid+1)
end
end
---------------------------------All the Lizards--------------
if item2.itemid == 4259 or item2.itemid == 4262 or item2.itemid == 4251 then
if random == 1 then
doSendMagicEffect(topos, 12)
doTransformItem(item2.uid,itemid+1)
doPlayerAddItem(cid,5876,1)
doSendAnimatedText(frompos,"~success~",18);
else
doSendMagicEffect(topos, 3)
doTransformItem(item2.uid,itemid+1)
end
end
----------------------Dragon---------------------------
if item2.itemid == 3104 then
if random == 1 then
doSendMagicEffect(topos, 12)
doTransformItem(item2.uid,3105)
doPlayerAddItem(cid,5877,1)
doSendAnimatedText(frompos,"~success~",18);
else
doSendMagicEffect(topos, 3)
doTransformItem(item2.uid,3105)
end
end

----------------------Dragon with other corpse--------------------------
if item2.itemid == 2844 then
if random == 1 then
doSendMagicEffect(topos, 12)
doTransformItem(item2.uid,3105)
doPlayerAddItem(cid,5877,1)
doSendAnimatedText(frompos,"~success~",18);
else
doSendMagicEffect(topos, 3)
doTransformItem(item2.uid,3105)
end
end
----------------------Dragon lord------------------------
if item2.itemid == 2881 then
if random == 1 then
doSendMagicEffect(topos, 12)
doTransformItem(item2.uid,2882)
doPlayerAddItem(cid,5948,1)
doSendAnimatedText(frompos,"~success~",18);
else
doSendMagicEffect(topos, 3)
doTransformItem(item2.uid,3105)
end
end
----------------------behemoth------------------------
if item2.itemid == 2931 then
if random == 1 then
doSendMagicEffect(topos, 12)
doTransformItem(item2.uid,2932)
doPlayerAddItem(cid,5893,1)
doSendAnimatedText(frompos,"~success~",18);
else
doSendMagicEffect(topos, 3)
doTransformItem(item2.uid,2932)
end
end
-------------------------Bone Beast---------------------
if item2.itemid == 3031 then
if random == 1 then
doSendMagicEffect(topos, 12)
doTransformItem(item2.uid,3032)
doPlayerAddItem(cid,5925,1)
doSendAnimatedText(frompos,"~success~",18);
else
doSendMagicEffect(topos, 3)
doTransformItem(item2.uid,3032)
end
end
doPlayerSendCancel(cid,"You may not skin this, or you have failed to skin this.")
return 1
end
end
function onUse(cid, item, frompos, item2, topos)
if item2.itemid == 0 then
return 0
end
random = math.random(1,4)
if getPlayerLevel(cid) >= 1 then
if item2.itemid == 2916 then
if random == 1 then
doTransformItem(item2.uid,2917)
doSendMagicEffect(topos, 12)
doPlayerAddItem(cid,5906,1)
doSendAnimatedText(frompos,"~success~",18);
else
doSendMagicEffect(topos, 3)
doTransformItem(item2.uid,2917)
end
end
if item2.itemid == 2956 then
if random == 1 then
doSendMagicEffect(topos, 12)
doTransformItem(item2.uid,2957)
doPlayerAddItem(cid,5905,1)
doSendAnimatedText(frompos,"~success~",18);
else
doSendMagicEffect(topos, 3)
doTransformItem(item2.uid,2957)
end
end
end
doPlayerSendCancel(cid,"It is not a Vampire, Or You have failed to get his Dust.")
return 1
end


Full credits and rep ++++ for Mokerhamer, I've just optimized and edited it :)
 
Last edited:
Both versions haven't worked for me...

I've fixed it :)
Why everytime check random_chace? We can do it just once and lower cpu work.

ty for fixing it anywais as i said, that was one of my first scripts and i dident know how to random mise them and some skins are harder to get then others
 
i think this may work cool, only some problem, the lizards xD, they don't work, it only appears a magiceffect on lizards and say you may not skin this, and nothing happend!, help plz =P
 
i think this may work cool, only some problem, the lizards xD, they don't work, it only appears a magiceffect on lizards and say you may not skin this, and nothing happend!, help plz =P


i'll check it out.. i'm even thinking about remaiking it..
 
Here is working a bit optimized obsidian knife by Kiper, edited by me - to work for newest TFS.

Code:
function skinMonster(cid,item,skin)
	local random = math.random(1,15)
	if(random < 1) then
		doPlayerAddItem(cid,skin,1)
		doSendMagicEffect(getThingPos(item.uid), CONST_ME_MAGIC_RED)
	else
		doSendMagicEffect(getThingPos(item.uid), CONST_ME_POFF)
	end
	doTransformItem(item.uid,item.itemid+1)
end
minotaurs = {2830, 2871, 2866, 2876}
lizards = {4259, 4262, 4251}
greendragons = {3104, 2844}
reddragons = {2881}
behemoth = {2931}
bonebeast = {3031}
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if isInArray(minotaurs, itemEx.itemid) == TRUE then
		skinMonster(cid, itemEx, 5878)
	elseif isInArray(lizards, itemEx.itemid) == TRUE then
		skinMonster(cid, itemEx, 5876)
	elseif isInArray(greendragons, itemEx.itemid) == TRUE then
		skinMonster(cid, itemEx, 5877)
	elseif isInArray(reddragons, itemEx.itemid) == TRUE then
		skinMonster(cid, itemEx, 5948)
	elseif isInArray(behemoth, itemEx.itemid) == TRUE then
		skinMonster(cid, itemEx, 5893)
	elseif isInArray(bonebeast, itemEx.itemid) == TRUE then
		skinMonster(cid, itemEx, 5925)
	else
		doPlayerSendCancel(cid,"Sorry, not possible.")
		return TRUE
	end
end
 
when i use on a lizard give me this error, plz fix(i am using tfs 0.26 golden warrior):
Code:
Lua Script Error: [Action Interface] 
data/actions/scripts/tools/obsidian.lua:onUse

data/actions/scripts/tools/obsidian.lua:29: attempt to perform arithmetic on global 'itemid' (a nil value)
 
A little *bump*.

Added ice cube to script.

PHP:
function skinMonster(cid,item,skin)
	local random = math.random(1,15)
	if(random < 4) then
		doPlayerAddItem(cid,skin,1)
		doSendMagicEffect(getThingPos(item.uid), CONST_ME_MAGIC_GREEN)
	else
		doSendMagicEffect(getThingPos(item.uid), CONST_ME_BLOCKHIT)
	end
	doTransformItem(item.uid,item.itemid+1)
end
minotaurs = {2830, 2871, 2866, 2876}
lizards = {4259, 4262, 4251}
greendragons = {3104, 2844}
reddragons = {2881}
behemoth = {2931}
bonebeast = {3031}
cube = {7441, 7444, 7445}
cube2 = {7442}
function onUse(cid, item, fromPosition, itemEx, toPosition)
local random = math.random(1,10)
	if isInArray(minotaurs, itemEx.itemid) == TRUE then
		skinMonster(cid, itemEx, 5878)
	elseif isInArray(lizards, itemEx.itemid) == TRUE then
		skinMonster(cid, itemEx, 5876)
	elseif isInArray(greendragons, itemEx.itemid) == TRUE then
		skinMonster(cid, itemEx, 5877)
	elseif isInArray(reddragons, itemEx.itemid) == TRUE then
		skinMonster(cid, itemEx, 5948)
	elseif isInArray(behemoth, itemEx.itemid) == TRUE then
		skinMonster(cid, itemEx, 5893)
	elseif isInArray(bonebeast, itemEx.itemid) == TRUE then
		skinMonster(cid, itemEx, 5925)
	elseif isInArray(cube, itemEx.itemid) == TRUE and random < 4 then
		doSendMagicEffect(getThingPos(itemEx.uid), CONST_ME_HITAREA)
		doTransformItem(itemEx.uid, itemEx.itemid + 1)
	elseif isInArray(cube2, itemEx.itemid) == TRUE and random < 4 then
		doSendMagicEffect(getThingPos(itemEx.uid), CONST_ME_HITAREA)
		doTransformItem(itemEx.uid, itemEx.itemid + 2)
	elseif (isInArray(cube, itemEx.itemid) == TRUE or isInArray(cube2, itemEx.itemid) == TRUE) and random > 4 then
		doSendMagicEffect(getThingPos(itemEx.uid), CONST_ME_HITAREA)
		doRemoveItem(itemEx.uid)
	else
		doPlayerSendCancel(cid,"Sorry, not possible.")
		return TRUE
	end
end
 
i fixed this changing this "isInArray bla bla bla" for this "itemEx.itemid == xxxx or itemEx.itemid == xxxx"
 
Back
Top