Postado Novembro 11, 2017 7 anos HiIs it possible to consult the special attributes in all the items?Depot, Players, Houses, Tiles Etc.I USE TFS 1.2I want to transform items with a certain attribute.Example:If Allitems(itemid):getSpecialAttribute <= 12345 thentransformto()endto place it in a globalevent
Postado Novembro 11, 2017 7 anos Please describe your question better ... what kind of attribute? What do you intend to do?
Postado Novembro 11, 2017 7 anos Autor Em 11/11/2017 em 03:13, luanluciano93 disse: Please describe your question better ... what kind of attribute? What do you intend to do? functions: setSpecialAttribute and getSpecialAttribute() Example: i put SpecialAttrubute with: local new_item = player:addItem(itemId, 1) new_item:setSpecialAttribute("timerOnExp", os.time()+60*60) ---------------------------------------------------------------------------------- and call with: item:getSpecialAttribute("timerOnExp") this return valor "os.time()+60*60" ---------------------------------------------------------------------------------- need call all items in globalevents: If Allitems:getSpecialAttribute("timerOnExp") <= os.time() then transformto(itemId) end
Postado Novembro 12, 2017 7 anos Sorry for the delay ... I'd like to know the purpose of your script, so I could help you better ... • To do this sort of fetch you I think you want, you would need to use sql commands in table 'player_items': CREATE TABLE IF NOT EXISTS `player_items` ( `player_id` int(11) NOT NULL DEFAULT '0', `pid` int(11) NOT NULL DEFAULT '0', `sid` int(11) NOT NULL DEFAULT '0', `itemtype` smallint(6) NOT NULL DEFAULT '0', `count` smallint(5) NOT NULL DEFAULT '0', `attributes` blob NOT NULL, FOREIGN KEY (`player_id`) REFERENCES `players`(`id`) ON DELETE CASCADE, KEY `sid` (`sid`) ) ENGINE=InnoDB; • I'll assume that you want to turn the item over after your time runs out ... this exists in items.xml, an example is soft boots, keys: durations e decayTo. ... <item id="2640" article="a" name="pair of soft boots (faster regeneration)"> <attribute key="weight" value="800" /> <attribute key="slotType" value="feet" /> <attribute key="decayTo" value="10021" /> <attribute key="transformDeEquipTo" value="6132" /> <attribute key="duration" value="14400" /> <attribute key="healthGain" value="1" /> <attribute key="healthTicks" value="2000" /> <attribute key="manaGain" value="2" /> <attribute key="manaTicks" value="1000" /> <attribute key="showduration" value="1" /> <attribute key="showattributes" value="1" /> </item> • Or you can also have the server do this automatically by putting a duration and a decayTo on the item you create ... use these functions and keys: functions: item:getAttribute(key) item:setAttribute(key, value) item:removeAttribute(key) item:hasAttribute(key) keys: ITEM_ATTRIBUTE_OWNER ITEM_ATTRIBUTE_DESCRIPTION ITEM_ATTRIBUTE_DURATION ITEM_ATTRIBUTE_DECAYSTATE I hope I have helped. Hugs!
Postado Novembro 12, 2017 7 anos Autor Em 12/11/2017 em 15:43, luanluciano93 disse: Sorry for the delay ... I'd like to know the purpose of your script, so I could help you better ... • To do this sort of fetch you I think you want, you would need to use sql commands in table 'player_items': CREATE TABLE IF NOT EXISTS `player_items` ( `player_id` int(11) NOT NULL DEFAULT '0', `pid` int(11) NOT NULL DEFAULT '0', `sid` int(11) NOT NULL DEFAULT '0', `itemtype` smallint(6) NOT NULL DEFAULT '0', `count` smallint(5) NOT NULL DEFAULT '0', `attributes` blob NOT NULL, FOREIGN KEY (`player_id`) REFERENCES `players`(`id`) ON DELETE CASCADE, KEY `sid` (`sid`) ) ENGINE=InnoDB; • I'll assume that you want to turn the item over after your time runs out ... this exists in items.xml, an example is soft boots, keys: durations e decayTo. ... <item id="2640" article="a" name="pair of soft boots (faster regeneration)"> <attribute key="weight" value="800" /> <attribute key="slotType" value="feet" /> <attribute key="decayTo" value="10021" /> <attribute key="transformDeEquipTo" value="6132" /> <attribute key="duration" value="14400" /> <attribute key="healthGain" value="1" /> <attribute key="healthTicks" value="2000" /> <attribute key="manaGain" value="2" /> <attribute key="manaTicks" value="1000" /> <attribute key="showduration" value="1" /> <attribute key="showattributes" value="1" /> </item> • Or you can also have the server do this automatically by putting a duration and a decayTo on the item you create ... use these functions and keys: functions: item:getAttribute(key) item:setAttribute(key, value) item:removeAttribute(key) item:hasAttribute(key) keys: ITEM_ATTRIBUTE_OWNER ITEM_ATTRIBUTE_DESCRIPTION ITEM_ATTRIBUTE_DURATION ITEM_ATTRIBUTE_DECAYSTATE I hope I have helped. Hugs! if I know those functions, the problem that the decay stops when the character logout, or when they put it in the depot, then I'm trying to make a system where certain items expire in a certain time. as in tibia rl 11:53 You see a temple teleport scroll that will expire in 7 days. It weighs 1.20 oz. If you do not use the item in 7 days, it disappears.
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.