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

Obsidian knife that dont work in summons ?

you could make it like this,
on the preperation of the death of a killed creature it checks wether it's a summon or not, and it creates seperate corpse id's, as alot of corpses are double added by cipsoft.

LUA:
local config = {
		summonscorpse = { -- summon corpses
			['wolf'] = 1111, -- corpse of wolf
			['bug'] = 2222, -- corpse of bug, etc..
		},
		normalcorpse = { -- corpse when it is a creature
			['wolf'] = 1112, --corpse of wolf for creature
			['bug'] = 2223, -- corpse of bug for creature
		}
	}

function onPrepareDeath(cid, deathList)
	if getCreatureMaster(cid) ~= cid then
		local sv = getThingPos(cid)
			doSendMagicEffect(sv,0)
			doCreateItem(config.summonscorpse[getCreatureName(cid)],sv)
			return addEvent(doRemoveCreature(cid),1*60*1000)
		end
	elseif isCreature(cid) then
	local cv = getThingPos(cid)
		doCreateItem(config.normalcorpse[getCreatureName(cid)],sv)
		return addEvent(doRemoveCreature(cid),1*60*1000)
	end
end
 
Make a script that adds an action id to the corpse, then in the skin script, first check if the corpse have that action id, if not - Skin, if it has the action id - Can't skin.
Then you don't need different corpse id's :D

I dunno if it works to check if it's a players summon though ;p
 
there you go

LUA:
local SKINS = {
	[5908] = {
		-- Minotaurs
		[2830] = {25000, 5878},
		[2871] = {25000, 5878},
		[2866] = {25000, 5878},
		[2876] = {25000, 5878},
		[3090] = {25000, 5878},

		-- Lizards
		[4259] = {25000, 5876},
		[4262] = {25000, 5876},
		[4256] = {25000, 5876},

		-- Dragons
		[3104] = {25000, 5877},
		[2844] = {25000, 5877},

		-- Dragon Lords
		[2881] = {25000, 5948},

		-- Behemoths
		[2931] = {25000, 5930, 90000, 5893},

		-- Bone Beasts
		[3031] = {25000, 5925}
	},
	[5942] = {
		-- Demon
		[2956] = {25000, 5905},

		-- Vampire
		[2916] = {25000, 5906}
	}
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
	local skin = SKINS[item.itemid][itemEx.itemid]
	if itemEx.actionid == 9999 then
		doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
		return true
	end
	if(skin == nil) then
		doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
		return true
	end

	local random, effect = math.random(1, 100000), CONST_ME_MAGIC_GREEN
	if(random <= skin[1]) then
		doPlayerAddItem(cid, skin[2], 1)
	elseif(skin[3] and random >= skin[3]) then
		doPlayerAddItem(cid, skin[4], 1)
	else
		effect = CONST_ME_POFF
	end

	doSendMagicEffect(toPosition, effect)
	doTransformItem(itemEx.uid, itemEx.itemid + 1)
	return true
end

LUA:
function onDeath(cid, corpse, killer) 
	if not isPlayer(cid) and getCreatureMaster(cid) ~= nil then
		setItemAttribute(corpse, "aid", 9999)
	end
	return true
end


kind regards, Evil Hero.
 
Back
Top