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

Lua [TFS 1.0] Making sugar oat

SaintSeiya

New Member
Joined
Jan 3, 2015
Messages
27
Reaction score
0
Hi, I want to know how can I make sugar oat from a combination of bunch of sugar cane with bunch of wheat since it's needed for tamming.

Bunch of wheat ID = 2694
Bunch of sugar cane ID = 5467
Sugar Oat ID = 13939

Thanks in advance :)
 
Some people aren't familiar with Tibia today, so please provide all information required. Please remember, this is OpenTibia, not OpenRealTibia.
Not everyone knows how to make sugar oats, even me, so how do you expect people like me to help you if you're not gonna describe everything you want?

Anyways, I went out of my way to look up what you want and took a picture of the instructions:

S3lPQeL.png


Assuming you only want to do the bunches part, not everything (like the firebug part).
According to the instruction, specifically #5, we have to use the bunch of wheat (2694) on bunch of sugar cane (5467), then both will disappear (I assume) and create a sugar oat (13939), right?

Simple, when you're "using" an item, you want to use the onUse() script event. When you use the item on another item, onUse will still be called, but this time, the target item of the use will be itemEx.

So, this is simple actually.
Code:
function onUse()
local player = Player(cid)
local useItem = Item(item)
local targetItem = Item(itemEx)
if targetItem:getId() == 5467 then
    useItem:remove()
    targetItem:remove()
    player:addItem(13939, 1)
end

The above code should get you started somewhere, I gave you pretty much everything you need.
I'm not gonna write the full code correctly since this is not the Request board. If you want the full working code, you need to go to the Request board.
 
Back
Top