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

A little different "task"

Sherlok

Active Member
Joined
Aug 29, 2008
Messages
2,116
Reaction score
44
Location
Poland, Wrocław.
Hiho.
I need "task" script, but little diffrent as in real tibia.

If you click on Item (8327) you'll see:
You have killed XXX/1000 demons.
If you kill all 1000 demons and you click on Item you'll get 1000 exp points + 1cc reward.

You can repeat this action (task) all times if you have this Item.


Thanks ;)
 
there you go:

LUA:
function onUse(cid, item, frompos, itemEx, topos)
local storageValue = xxxx -- the storagevalue which is used to store how much demons are killed
	if getPlayerStorageValue(cid, storageValue) == -1 then
		setPlayerStorageValue(cid, storageValue, 0)
	end
	if getPlayerStorageValue(cid, storageValue) < 1000 then
		doPlayerSendTextMessage(cid,22,"You have killed ".. getPlayerStorageValue(cid, storageValue) .."/1000 demons.")
	else
		doPlayerAddItem(cid, 2160, 1)
		doPlayerAddExperience(cid, 1000)
		setPlayerStorageValue(cid, storageValue, 0)
	end
	return true
end

Incase you don't have the onKill part already:
LUA:
function onKill(cid, target)
local storageValue = xxxx -- use the same as in the onUse script
	if getPlayerStorageValue(cid, storageValue) == -1 then
		setPlayerStorageValue(cid, storageValue, 0)
	end
	if isPlayer(cid) and not isPlayer(target) and getCreatureName(target) == "demon" then
		setPlayerStorageValue(cid, getPlayerStorageValue(cid, storageValue) + 1)
	end
	return true
end


kind regards, Evil Hero
 
Back
Top