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

Problem with obsidian knife.

Status
Not open for further replies.

christiandb

Member
Joined
Feb 5, 2008
Messages
2,469
Reaction score
5
Location
010
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if(itemEx.itemid == FALSE) then
		return FALSE
	end

	if(getPlayerLevel(cid) >= 2) then
		local found = FALSE
		local skin = 0

		if(isInArray({2830, 2871, 2866, 2876, 3090}, itemEx.itemid) == TRUE) then
			found = TRUE
			if(math.random(1,5) == 1) then
				skin = 5878
			end
		elseif(isInArray({4259, 4262, 4256}, itemEx.itemid) == TRUE) then
			found = TRUE
			if(math.random(1,5) == 1) then
				skin = 5876
			end
		elseif(isInArray({3104, 2844}, itemEx.itemid) == TRUE) then
			found = TRUE
			if(math.random(1,5) == 1) then
				skin = 5877
			end
		elseif(isInArray({2881}, itemEx.itemid) == TRUE) then
			found = TRUE
			if(math.random(1,5) == 1) then
				skin = 5948
			end
		elseif(isInArray({2931}, itemEx.itemid) == TRUE) then
			found = TRUE
			local rand = math.random(1,10)
			if(rand > 8) then
				skin = 5893
			elseif(rand == 4) then
				skin = 5930
			end
		elseif(isInArray({3031}, itemEx.itemid) == TRUE) then
			found = TRUE
			if(math.random(1,5) == 1) then
				skin = 5925
			end
		end

		if(found == TRUE) then
			if(skin == 0) then
				doSendMagicEffect(toPosition, CONST_ME_POFF)
			else
				doSendMagicEffect(toPosition, CONST_ME_GROUNDSHAKER)
				doPlayerAddItem(cid, skin, 1)
				doSendAnimatedText(fromPosition, 'Success!', TEXTCOLOR_WHITE_EXP);
			end
			doTransformItem(itemEx.uid, itemEx.itemid + 1)
		else
			doPlayerSendCancel(cid, "Sorry, not possible.")
		end
	else
		doPlayerSendCancel(cid, "You have to be at least Level 2 to use this tool.")
	end

	return TRUE
end

When I try to skin a dead behemoth [id 5999 or 2931] it either transforms into a dead pig or a skinned behemoth and when I succeed skinning it, I get a minotaur leather [ItemID: 5878].

Does anyone know a solution for this?

This is the same with a dragon lord, when I try to skin this it turns into a dead fire devil.

This is the same with a demon, when I try to skin it it turns into a dead spearman and when I succeed skinning it I get a minotaur leather.
 
Since it looks like no one is really helping you, I'll post the one I made for myself...

Code:
-- Advanced Obsidian Knife made by Evil Hero --
function onUse(cid, item, fromPosition, itemEx, toPosition)
local skinMonsters = {[3104] = {reward=5877, chance=5}, -- Dragon
					  [2881] = {reward=5948, chance=5}, -- Dragon Lord
					  [3090] = {reward=5878, chance=5}, -- Minotaur
					  [2876] = {reward=5878, chance=5}, -- Minotaur Guard
					  [2866] = {reward=5878, chance=5}, -- Minotaur Mage
					  [2931] = {reward=5893, chance=5}, -- Behemoth
					  [4259] = {reward=5876, chance=5}, -- Lizard Sentinel
					  [4262] = {reward=5876, chance=5}, -- Lizard Snakecharmer
					  [4256] = {reward=5876, chance=5} -- Lizard Templar
}
	if skinMonsters[itemEx.itemid] then
		skin = skinMonsters[itemEx.itemid]
		if math.random(1,skin.chance) == 1 then
			doTransformItem(itemEx.uid, itemEx.itemid + 1)
			doSendMagicEffect(toPosition,14)
			doPlayerAddItem(cid,skin.reward,1)
			doPlayerSendTextMessage(cid,21,"You have found a ".. getItemNameById(skin.reward) ..".")
		else
			doPlayerSendTextMessage(cid,21,"You didn't had luck this time.")
			doTransformItem(itemEx.uid, itemEx.itemid + 1)
			doSendMagicEffect(toPosition,3)
		end
	else
		doPlayerSendCancel(cid,"You cannot skin this.")
	end
	return TRUE
end

kind regards, Evil Hero
 
Status
Not open for further replies.
Back
Top