• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

Action Obsidian Knife 100%

jpkulik

New Member
Joined
Mar 15, 2008
Messages
208
Reaction score
2
Hello all!
I was looking there in the forum, and i found 1 scripts of the obsidian Knife.
But is not perfect.
This one is working 100% for TFS(Mystic Spirit).I have tested.
Create a news File.LUA in:actions/tools with the name obsidian.lua
and in actions.xml add the following line:
Code:
<action itemid="5908" script="tools/obsidian.lua"/>

Script:

Code:
function onUse(cid, item, frompos, item2, topos)
if item2.itemid == 0 then
return 0
end
--------Behemoth--------
random = math.random(1,10)
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,"",18);
elseif item2.itemid == 2931 and random >= 2 then
doSendMagicEffect(topos, 3)
doTransformItem(item2.uid,2932)
end
end
--------Minotaur--------
random = math.random(1,10)
if getPlayerLevel(cid) >= 1 then
if item2.itemid == 2830 and random == 1 then
doSendMagicEffect(topos, 12)
doTransformItem(item2.uid,2831)
doPlayerAddItem(cid,5878,1)
doSendAnimatedText(frompos,"",18);
elseif item2.itemid == 2830 and random >= 2 then
doSendMagicEffect(topos, 3)
doTransformItem(item2.uid,2831)
end
end
--------Minotaur Archer--------
random = math.random(1,10)
if getPlayerLevel(cid) >= 1 then
if item2.itemid == 2871 and random == 1 then
doSendMagicEffect(topos, 12)
doTransformItem(item2.uid,2872)
doPlayerAddItem(cid,5878,1)
doSendAnimatedText(frompos,"",18);
elseif item2.itemid == 2871 and random >= 2 then
doSendMagicEffect(topos, 3)
doTransformItem(item2.uid,2872)
end
end
--------Minotaur Guard--------
random = math.random(1,10)
if getPlayerLevel(cid) >= 1 then
if item2.itemid == 2876 and random == 1 then
doSendMagicEffect(topos, 12)
doTransformItem(item2.uid,2877)
doPlayerAddItem(cid,5878,1)
doSendAnimatedText(frompos,"",18);
elseif item2.itemid == 2876 and random >= 2 then
doSendMagicEffect(topos, 3)
doTransformItem(item2.uid,2877)
end
end
--------Minotaur Mage--------
random = math.random(1,10)
if getPlayerLevel(cid) >= 1 then
if item2.itemid == 2866 and random == 1 then
doSendMagicEffect(topos, 12)
doTransformItem(item2.uid,2867)
doPlayerAddItem(cid,5878,1)
doSendAnimatedText(frompos,"",18);
elseif item2.itemid == 2866 and random >= 2 then
doSendMagicEffect(topos, 3)
doTransformItem(item2.uid,2867)
end
end
--------Lizard Sentinel--------
random = math.random(1,10)
if getPlayerLevel(cid) >= 1 then
if item2.itemid == 4259 and random == 1 then
doSendMagicEffect(topos, 12)
doTransformItem(item2.uid,4260)
doPlayerAddItem(cid,5876,1)
doSendAnimatedText(frompos,"",18);
elseif item2.itemid == 4259 and random >= 2 then
doSendMagicEffect(topos, 3)
doTransformItem(item2.uid,4260)
end
end
--------Lizard Templar--------
random = math.random(1,10)
if getPlayerLevel(cid) >= 1 then
if item2.itemid == 4256 and random == 1 then
doSendMagicEffect(topos, 12)
doTransformItem(item2.uid,4257)
doPlayerAddItem(cid,5876,1)
doSendAnimatedText(frompos,"",18);
elseif item2.itemid == 4256 and random >= 2 then
doSendMagicEffect(topos, 3)
doTransformItem(item2.uid,4257)
end
end
--------Lizard Snakecharmer--------
random = math.random(1,10)
if getPlayerLevel(cid) >= 1 then
if item2.itemid == 4262 and random == 1 then
doSendMagicEffect(topos, 12)
doTransformItem(item2.uid,4263)
doPlayerAddItem(cid,5876,1)
doSendAnimatedText(frompos,"",18);
elseif item2.itemid == 4262 and random >= 2 then
doSendMagicEffect(topos, 3)
doTransformItem(item2.uid,4263)
end
end
--------Dragon--------
random = math.random(1,10)
if getPlayerLevel(cid) >= 1 then
if item2.itemid == 2844 and random == 1 then
doSendMagicEffect(topos, 12)
doTransformItem(item2.uid,2845)
doPlayerAddItem(cid,5877,1)
doSendAnimatedText(frompos,"",18);
elseif item2.itemid == 2844 and random >= 2 then
doSendMagicEffect(topos, 3)
doTransformItem(item2.uid,2845)
end
end
--------Dragon Lord--------
random = math.random(1,10)
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,"",18);
elseif item2.itemid == 2881 and random >= 2 then
doSendMagicEffect(topos, 3)
doTransformItem(item2.uid,2882)
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,"",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
For change the chance of the creature itens come, change
Code:
random = math.random(1,15)
in each page..
OBS: 15 is Normal in Tibia Global.
1 is Every time.
100 is RARE!
:D
I hope you enjoy!
Cya
 
Last edited by a moderator:
Nice! I will add this to my server. Giving the players more optional gameplay will make it a bit funnier :)

@Note
If your serv ain't using the ingredients recieved by this obsidian knife, you can change the items to whatever you want ;) Also you could make npc's that trades the ingredeints for special items.
 
Yeah, that is good.
Im my server i use addon system like in global. For each addon 1 Npc, and then i need the itens what i collect with obsidian in mosters :D
O hope everybody Enjoy.
Im whating comments; Cyao
 
i made it on my own..
i found some obs knife script here.. but it was changing lizard templar into elephant corpses..
so i made it on my own.. but thanks for releasing for guys who cant script or are just tooooooooo LAZY!!!!!!! :D
 
What about...
Cronos said:
Ok. My version of the obsidian knife and Blessed Wooden Stake.
This Script contains all Fresh Corpse, No-Fresh Corpse, and Items who give the skin.

PHP:
--[[
    |----------------------------------|       
    |--.___ .___..___.._.__..___..___. |       
    |--|.__||| |||._.|| \\ ||._.||.__| |       
    |--||__.| - \|| |||  \|||| |||__.| |         
    |--|___||_|_||_-_||_|\_||_-_||___| |         
    |----------------------------------|         
        Name:                   
                   Skin Monster V. 0.2.1
]]--
--[[ Library ]]--
local skinMonster = {}

skinMonster.Random = function(val) rand = math.random(1,val) -- Return 'skined' If get true random
	if rand == val then
		return 'skined'
	end 
end  
skinMonster.Action = function(cid, item2, corpse, transf, item, magic, topos, random) -- All Action of skin Monster is here
    for x=1, table.maxn(corpse) do 
        if item2.itemid == corpse[x] then
			if skinMonster.Random(random) == 'skined' then
				-- Getting Sentences
				doPlayerAddItem(cid, item[x], 1)
				doSendMagicEffect(topos, magic[1])
				doTransformItem(item2.uid,transf[x])
				-- If skined its true
        else 
            doSendMagicEffect(topos, magic[2])
			doTransformItem(item2.uid,transf[x])
			-- If skined its false
		end
	end
end
end
--[[ /Library ]] --
--[[ Config ]] --
skinMonster.OKSkinedNot =  {2830,2871,2876,2866,4259,4262,4256,3104,2844,2881,3031,2931,3031}
skinMonster.OKSkinedTrue = {2831,2872,2877,2867,4260,4263,4257,3105,2845,2882,3032,2932,3032}
skinMonster.OKItem =       {5878,5878,5878,5878,5876,5876,5876,5877,5877,5948,5925,5893,5925}

skinMonster.WSSkinedNot =  {2916,2956}
skinMonster.WSSkinedTrue = {2917,2957}
skinMonster.WSItem =       {5906,5905}
--[[ /Config ]]--


function onUse(cid, item, frompos, item2, topos)
	if item.itemid == 5908 then
		skinMonster.Action(cid, item2, skinMonster.OKSkinedNot, skinMonster.OKSkinedTrue, skinMonster.OKItem, {12, 2}, topos, 2) 
	else
		skinMonster.Action(cid, item2, skinMonster.WSSkinedNot, skinMonster.WSSkinedTrue, skinMonster.WSItem, {12, 2}, topos, 2)
	end
end

The action you can modifiy
PHP:
skinMonster.Action(cid, item2, corpse, transf, item, magic, topos, random)
 
Heh, on the floor lol? Not really, it's a nice skin function, that saves ALOT of scripting.
 
Heh, on the floor lol? Not really, it's a nice skin function, that saves ALOT of scripting.
I hope so, becouse another tahy i´ve get on Script in this forum, and then, when i use the obsidian knife on ground, the ground desapier, and add player item ,ahaha
ok, tankyou, byebye
 
I've shorten your script if you don't mind, hope it works tho ^^
PHP:
function skinCreature(cid, body, itemid, rand, reward)
	if (type(itemid) == "number" and body.itemid == itemid) or isInArray(itemid, body.itemid) then
		if math.random(rand) == 1 then
			doSendMagicEffect(getThingPos(body.uid), 12)
			doPlayerAddItem(cid, reward, 1)
		else
			doSendMagicEffect(getThingPos(body.uid), 3)
		end
		doTransformItem(item2.uid, itemid+1)
		return true
	end
	return false
end

function onUse(cid, item, frompos, item2, topos)
	-- Behemoth
	if not(skinCreature(cid, item2, 2931, 10, 5893)
	-- Minotaur's
	or skinCreature(cid, item2, {2830, 2866, 2871, 2876}, 10, 5878)
	-- Lizard's
	or skinCreature(cid, item2, {4256, 4259, 4262}, 10, 5876)
	-- Dragon
	or skinCreature(cid, item2, 2844, 10, 5877)
	-- Dragon Lord
	or skinCreature(cid, item2, 2881, 10, 5948)
	-- Bone Beast
	or skinCreature(cid, item2, 3031, 15, 5925)) then
		doPlayerSendCancel(cid,"You cant skin this.")
	end
	return 1
end
 
I've shorten your script if you don't mind, hope it works tho ^^
PHP:
function skinCreature(cid, body, itemid, rand, reward)
	if (type(itemid) == "number" and body.itemid == itemid) or isInArray(itemid, body.itemid) then
		if math.random(rand) == 1 then
			doSendMagicEffect(getThingPos(body.uid), 12)
			doPlayerAddItem(cid, reward, 1)
		else
			doSendMagicEffect(getThingPos(body.uid), 3)
		end
		doTransformItem(item2.uid, itemid+1)
		return true
	end
	return false
end

function onUse(cid, item, frompos, item2, topos)
	-- Behemoth
	if not(skinCreature(cid, item2, 2931, 10, 5893)
	-- Minotaur's
	or skinCreature(cid, item2, {2830, 2866, 2871, 2876}, 10, 5878)
	-- Lizard's
	or skinCreature(cid, item2, {4256, 4259, 4262}, 10, 5876)
	-- Dragon
	or skinCreature(cid, item2, 2844, 10, 5877)
	-- Dragon Lord
	or skinCreature(cid, item2, 2881, 10, 5948)
	-- Bone Beast
	or skinCreature(cid, item2, 3031, 15, 5925)) then
		doPlayerSendCancel(cid,"You cant skin this.")
	end
	return 1
end

Great!
I hope its works.
Now we have the obsidian :P
Byebye
 
I've shorten your script if you don't mind, hope it works tho ^^
PHP:
function skinCreature(cid, body, itemid, rand, reward)
	if (type(itemid) == "number" and body.itemid == itemid) or isInArray(itemid, body.itemid) then
		if math.random(rand) == 1 then
			doSendMagicEffect(getThingPos(body.uid), 12)
			doPlayerAddItem(cid, reward, 1)
		else
			doSendMagicEffect(getThingPos(body.uid), 3)
		end
		doTransformItem(item2.uid, itemid+1)
		return true
	end
	return false
end

function onUse(cid, item, frompos, item2, topos)
	-- Behemoth
	if not(skinCreature(cid, item2, 2931, 10, 5893)
	-- Minotaur's
	or skinCreature(cid, item2, {2830, 2866, 2871, 2876}, 10, 5878)
	-- Lizard's
	or skinCreature(cid, item2, {4256, 4259, 4262}, 10, 5876)
	-- Dragon
	or skinCreature(cid, item2, 2844, 10, 5877)
	-- Dragon Lord
	or skinCreature(cid, item2, 2881, 10, 5948)
	-- Bone Beast
	or skinCreature(cid, item2, 3031, 15, 5925)) then
		doPlayerSendCancel(cid,"You cant skin this.")
	end
	return 1
end

Error 0.2.5:
PHP:
Lua Script Error: [Action Interface]
data/actions/scripts/tools/Obsidian.lua:onUse

data/actions/scripts/tools/Obsidian.lua:9: attempt to index global '
item' (a nil value)
stack traceback:
        data/actions/scripts/tools/Obsidian.lua:9: in function 'skin
Creature'
        data/actions/scripts/tools/Obsidian.lua:17: in function <dat
a/actions/scripts/tools/Obsidian.lua:15>
 
Back
Top