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

Idea for human bodies..

kn4tseb

New Member
Joined
Feb 8, 2009
Messages
83
Reaction score
0
I dont know if anyone has requested or asked for this idea.. so i'd like to know if it is possible to do so. Ive been trying to make it but im not an expert scripter so if anyone can help me would be awesome. so this is what im trying to do.

i want to make that when you use an obsidian knife over a human dead body, you can actually get a skull with a description with the name of the player who died; and would be great too if the body (itemEx) transforms into a skeleton or something like that after the knife is used :)..

well i hope anyone can help me with this..

thanks!.
 
then you skin a dead human you will get 2160 (crystal coin) u can change that item what ever you wanna.

Code:
local config = {
	level = 2
}

local SKINS = {
	-- 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, 5893},

	-- Bone Beasts
	[3031] = {25000, 5925},
	
	-- dead humans
	[2317] = {25000, 2160}, -- boy
	[3058] = {25000, 2160}, -- boy
	[3128] = {25000, 2160}, -- boy
	[3129] = {25000, 2160}, -- boy
	[6022] = {25000, 2160}, -- boy
	[6080] = {25000, 2160}, -- boy
	[6560] = {25000, 2160}, -- girl
	[6083] = {25000, 2160}, -- girl
	[6081] = {25000, 2160}, -- girl
	[3065] = {25000, 2160} -- girl
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if(getPlayerLevel(cid) < config.level) then
		doPlayerSendCancel(cid, "You have to be at least Level " .. config.level .. " to use this tool.")
		return true
	end

	local skin = SKINS[itemEx.itemid]
	if(not skin) then
		doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
		return true
	end

	local random, effect = math.random(1, 100000), CONST_ME_GROUNDSHAKER
	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
 
i know but this is not what i want.. i mean that when i skin a body i get a skull with description mentioning the name of the person who that body belongs to.. for example. when you look at it.. it says.. You see apsivaflines'head... or you see the head of apsivaflines.
it would be like a reward for killers in wars or pvp..
 
Last edited:
im using 0.3.4pl2.. any idea about how to register a function that gets the name of the body? and yes.. its like a trophy ;D
 
possibly one of these

Code:
        getItemName(uid)
	getItemPluralName(uid)
	getItemArticle(uid)
	getItemText(uid)
	getItemSpecialDescription(uid)
	getItemWriter(uid)
	getItemDate(uid)
 
arj... i cant figure it out how to set the description only with the name of the player who died ....
Cykotitan you seem to know what to do :) can you give me a push with all this?
 
aaaaaaaaaaaaaa

And again I'm wrong, sorry.. 0.3.4 doesn't have getItemSpecialDescription(uid)
I can add it for you if you wish, though.

This is what my testing environment looks like:
Code:
	local ITEM_MALE_CORPSE = 6080
	local ITEM_FEMALE_CORPSE = 6081

	local s = getItemSpecialDescription(itemEx.uid)
	local b, e = s:find("You recognize ")
	if b and e then
		local s = s:sub(e + 1)
		local b, e = s:find("%s" .. (itemEx.itemid == ITEM_MALE_CORPSE and "He" or itemEx.itemid == ITEM_FEMALE_CORPSE and "She") .. " was killed by ")
		local s = s:sub(1, b-2)
		doPlayerSendTextMessage(cid, 25, s)
	end
It would get and return the name of the player which died.
 
Last edited:
nice, it worked but i have a problem, i create a new item with the name gotten from your script, and when i move it, the item name changes to the original one.. "you see a skull"..

this is part of the script (using obsidian knife)

PHP:
elseif deadmen[itemEx.itemid] or deadwomen[itemEx.itemid] then
local s = getItemSpecialDescription(itemEx.uid)
local b, e = s:find("You recognize ")
if b and e then
local s = s:sub(e + 1)
local b, e = s:find("%s" .. (deadmen[itemEx.itemid] and "He" or deadwomen[itemEx.itemid] and "She") .. " was killed by ")
local s = s:sub(1, b-2)
local reward = doCreateItemEx(2320, 1)
local bodypos = getThingPos(itemEx.uid)
doTileAddItemEx(bodypos, reward)
doSetItemSpecialDescription(reward, "This is the head of ".. s .."")
setItemName(reward, "Head of ".. s .."")
end
 
Last edited:
Back
Top