I'm working on a 8.54 Open Tibia Server using The Forgotten Server - Version 0.2.7 (Mystic Spirit).
I am making it so that you can collect fruits from trees; example: coconut tree.
But now that I want to script my banana trees i just found out that there are 2 different kinds of banana trees with bananas on and 2 different kind of banana trees without bananas on.
And the difference between these 2 is that the ones without bananas on are a static sprite of either the smaller or the bigger banana tree. As the ones with bananas on are a changing between the bigger and smaller sprite depending on which sqm they are on. This kind of makes my script impossible to use since it can't check which sprite the tree is using, it can only check which tree id it is using.
So if anyone has any knowledge about this and cares to help me out, I would appreciate it a lot.
Thanks in advance.
I am making it so that you can collect fruits from trees; example: coconut tree.
Code:
elseif itemEx.itemid == 5096 then
local rand = math.random(1, 10)
if rand == 1 then
doTransformItem(itemEx.uid, 2726)
doPlayerAddItem(cid, 2678, 2)
doCreatureSay(cid, "You collected 2 coconuts.", TALKTYPE_ORANGE_1)
addEvent(doTransformBack, 120000, toPosition, itemEx.itemid, 2726)
elseif rand < 8 then
doTransformItem(itemEx.uid, 2726)
doPlayerAddItem(cid, 2678, 1)
doCreatureSay(cid, "You collected a coconut.", TALKTYPE_ORANGE_1)
addEvent(doTransformBack, 90000, toPosition, itemEx.itemid, 2726)
else
doTransformItem(itemEx.uid, 2726)
doCreatureSay(cid, "You failed to collect any coconuts.", TALKTYPE_ORANGE_1)
addEvent(doTransformBack, 40000, toPosition, itemEx.itemid, 2726)
end
But now that I want to script my banana trees i just found out that there are 2 different kinds of banana trees with bananas on and 2 different kind of banana trees without bananas on.
And the difference between these 2 is that the ones without bananas on are a static sprite of either the smaller or the bigger banana tree. As the ones with bananas on are a changing between the bigger and smaller sprite depending on which sqm they are on. This kind of makes my script impossible to use since it can't check which sprite the tree is using, it can only check which tree id it is using.
So if anyone has any knowledge about this and cares to help me out, I would appreciate it a lot.
Thanks in advance.