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

New items in the store/house equipment

silveralol

Advanced OT User
Joined
Mar 16, 2010
Messages
1,480
Solutions
9
Reaction score
211
Hello folks, as you know, Tibia Global have added some new items in the store, house decoration, tapestrys, decorations and others, but I need to make some script to it, you know, actions to active and deactive the items in the house, BUT, how I can "save" the item in the house? these items is not pickable, i'm talking about the carpets, what change I'll need make to save these items on the ground of the house without edit the items.otb
 
Hello folks, as you know, Tibia Global have added some new items in the store, house decoration, tapestrys, decorations and others, but I need to make some script to it, you know, actions to active and deactive the items in the house, BUT, how I can "save" the item in the house? these items is not pickable, i'm talking about the carpets, what change I'll need make to save these items on the ground of the house without edit the items.otb
Save item?
Item in houses save automatically, what you mean?
 
Save item?
Item in houses save automatically, what you mean?
you know about void carpet ? when you try save it on your house, with the SS the server don't save this item in your house, then you lost it, you can test, all CARPETS are like this
 
you know about void carpet ? when you try save it on your house, with the SS the server don't save this item in your house, then you lost it, you can test, all CARPETS are like this
Same with rift carpet?

Oh I see you are right
 
I think we need to edit function in source, if we do not want to change item.otb
 
I think we need to edit function in source, if we do not want to change item.otb
well, thinking better about it, we can edit the items.otb, make these items moveable, for now, then "mask" the moveable with event onMoveItem.
 
So you added flags moveable to these carpets and make statement in onMoveItem if item id == carpets then return not possible?
 
So you added flags moveable to these carpets and make statement in onMoveItem if item id == carpets then return not possible?
yes, added the flag, and make a check...
Code:
elseif isInArray({25392, 26109, 26110, 26111, 26496, 26682, 26683, 26684, 26685, 26686, 26687}, item.itemid) then
        self:sendCancelMessage('You cannot move this object.')
        return false
 
store itemID and position in database.
load it on server startup.
Can be done only with Lua
 
store itemID and position in database.
load it on server startup.
Can be done only with Lua
I've done with edit in otb and script onMoveItem, easy and faster way to make it
 
create dadabase. Could be done better. but meh trying to give simplest example I can write right here
Code:
if db.query("SELECT * FROM `badTableName` WHERE 1") then return end
    db.query("CREATE TABLE `badTableName` ( `id` INT NOT NULL AUTO_INCREMENT , `houseID` SMALLINT NOT NULL, `itemID` SMALLINT NOT NULL , `positionX` SMALLINT NOT NULL, , `positionY` SMALLINT NOT NULL, , `positionZ` SMALLINT NOT NULL, PRIMARY KEY (`id`)) ENGINE = InnoDB;")

add lines to database
Code:
db.query("INSERT INTO `badTableName`(`houseID`, `itemID`, `positionX`, `positionY`, `positionZ`) VALUES ("..houseID.."..item:getId()..", '"..(itemPos.x).."', "..(itemPos.y)..",'"..(itemPos.z).."')")
on startUp you simply create the items
i dont remember how to get the values, but there are lots of examples on OTland

nothing special do it.
 
Back
Top