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

Solved banana tree, ingame sprite problem

Exoltes

Novia OTserv Developer
Joined
Jul 2, 2009
Messages
563
Reaction score
47
Location
Belgium
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.
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.
 
Nvm, I can just always use the one id for big trees and the other for smalls, its a kind of lame solve but it will do it :p
 
Back
Top