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

[REQUEST] Task Quest In Actions

szakir

New Member
Joined
Mar 15, 2009
Messages
8
Reaction score
0
Hello

Please help me i do not know how to do

I mean:
When I use dead demons that send me message “You kill xxxx of 6666 demons”
And when I kill (use dead demons) that give me StorangeValue

Please help :)
 
Hello

Please help me i do not know how to do

I mean:
When I use dead demons that send me message “You kill xxxx of 6666 demons”
And when I kill (use dead demons) that give me StorangeValue

Please help :)

When you "Use" the demon, or when you kill the demon? If you do launch it onUse then that would make looting rather annoying.
 
When i use body dead demon id 2916 and after transform to id 2917.

If possible first need write to npc Hi -> Task -> Yes

After can use body demon and start countdown demons.

I would like to Use body Demon because that is tibia 8.10
 
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)

		local storage = XXXX
		
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have killed " .. getPlayerStorageValue(cid,storage) .. "/6666 demons.")
			setPlayerStorageValue(cid, storage, getPlayerStorageValue(cid, storage)+1)
			doTransformItem(item.uid, 2917)
return FALSE
end
I don't know the functions in 8.10 though but maybe this will work
 
Last edited:
You need to use "return FALSE" or the corpse won't be openable.
And don't check if item.itemid == .... then
 
#Slaktaren
it does not work :(

I tried to convert with function onkill

Code:
function onUse(cid, item, frompos, item2, topos)
	local monster = 2916
	if(isPlayer(target) == FALSE and monster and getPlayerStorageValue(cid, 76669) == 2) then
		if getPlayerStorageValue(cid, monster) < 6666 then 
			local killedMonsters = getPlayerStorageValue(cid, monster)
            if(killedMonsters == -1) then
                killedMonsters = 1
			end
			setPlayerStorageValue(cid, monster, killedMonsters + 1)
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have killed " .. killedMonsters .. " of 6666 demons.")
		else
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have killed enough demons.")
			setPlayerStorageValue(cid, 76669, 3)
		end
	end
	return TRUE
end

But I cant open the body and has no function doTransformItem Maybe it possible to edit
 
Last edited:
I found an error

You have killed -1/6666 demons.
You have killed 0/6666 demons.
You have killed 1/6666 demons.
You have killed 2/6666 demons.
and
You have killed 7000/6666 demons.

To get StorageValue enough use 2x body demon

You have killed -1/6666 demons.
You have killed 0/6666 demons.

and the task is already done

You can use indefinitely

You have killed 7000/6666 demons.
You have killed 7001/6666 demons.

and so on

#Edit

I managed to do

function onUse(cid, item, fromPosition, itemEx, toPosition)

local monster = 13333


if getPlayerStorageValue(cid, monster) < 6 then
local killedMonsters = getPlayerStorageValue(cid, monster)
if(killedMonsters == -1) then
killedMonsters = 1
end
setPlayerStorageValue(cid, monster, killedMonsters + 1)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have killed " .. killedMonsters .. " of 6 demons.")
doTransformItem(item.uid, 2917)
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have killed enough demons.")
setPlayerStorageValue(cid, 13334, 1)
doTransformItem(item.uid, 2917)
end

return TRUE
end

Where do I add line to check for StorageValue and TextMessage "No have mission" ?
 
Last edited:
Code:
local t = {
	required = 6666,
	storage = XXXX
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local v = math.max(1, getPlayerStorageValue(cid, t.storage) + 1)
	if v <= t.required then
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have killed " .. v .. "/" .. t.required .. " demons.")
		setPlayerStorageValue(cid, t.storage, v)
		doTransformItem(item.uid, 2917)
	end
end
 
Thank you

Sorry for the confusion

One more thing
Where do I add line to check for StorageValue and TextMessage "No have mission" ?
 
Back
Top