There was script to add items to website Shop offer using talkaction for TFS 0.4 ( [GESIOR2012] Items Shop Installation/Administration (https://otland.net/threads/gesior2012-items-shop-installation-administration.170654/) ).
I made version for TFS 1.4+.
How to use:
1. Stand in front of item dropped on floor
2. Type
- if it's normal item or empty container (BP/bag), it will add it with it's count as 'item offer'


- if it's container and there is some item inside, script will add 'container offer' with container filled with first item found in BP


In
Create file
I made version for TFS 1.4+.
How to use:
1. Stand in front of item dropped on floor
2. Type
/addshop 50
to add item with price 50 premium points- if it's normal item or empty container (BP/bag), it will add it with it's count as 'item offer'


- if it's container and there is some item inside, script will add 'container offer' with container filled with first item found in BP


In
data/talkactions/talkactions.xml
add:
XML:
<talkaction words="/addshop" separator=" " script="add_shop_offer.lua" />
data/talkactions/scripts/add_shop_offer.lua
:
Lua:
function onSay(player, words, param)
if not player:getGroup():getAccess() then
return true
end
if player:getAccountType() < ACCOUNT_TYPE_GOD then
return false
end
local price = tonumber(param)
if not price or price <= 0 then
player:sendTextMessage(MESSAGE_STATUS_WARNING, "Price must be higher than 0. Command use ex.: /addshop 50")
return false
end
local lookPosition = player:getPosition()
lookPosition:getNextPosition(player:getDirection())
if not Tile(lookPosition) then
player:sendTextMessage(MESSAGE_STATUS_WARNING, "There is no tile in front of you.")
return false
end
local topThing = Tile(lookPosition):getTopVisibleThing(player)
if not topThing:isItem() then
player:sendTextMessage(MESSAGE_STATUS_WARNING, "There is no item in front of you.")
return false
end
local itemType = ItemType(topThing:getId())
if not itemType:isMovable() then
player:sendTextMessage(MESSAGE_STATUS_WARNING, "Item in front of you is not movable.")
return false
end
if itemType:isContainer() and topThing:getItem(0) then
local containerId = itemType:getId()
local containerItemCount = topThing:getCapacity()
local firstItemInContainer = topThing:getItem(0)
local itemId = firstItemInContainer:getId()
local itemCount = firstItemInContainer:getCount()
local offerName = (containerItemCount * itemCount) .. 'x ' .. firstItemInContainer:getName()
local offerDescription = containerItemCount .. 'x You see ' .. firstItemInContainer:getDescription()
db.query(
'INSERT INTO `z_shop_offer` (`id`, `points`, `itemid1`, `count1`, `itemid2`, `count2`, ' ..
'`offer_type`, `offer_name`,`offer_description`) VALUES ' ..
'(NULL , ' .. price .. ', ' .. containerId .. ', ' .. containerItemCount .. ', ' ..
itemId .. ', ' .. itemCount .. ', \'container\', ' .. db.escapeString(offerName) ..
', ' .. db.escapeString(offerDescription) .. ')'
)
player:sendTextMessage(
MESSAGE_STATUS_WARNING,
"Container >> " .. offerName .. " << added to SMS shop. Price set to " .. price .. " premium points."
)
player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN)
else
local itemId = itemType:getId()
local itemCount = topThing:getCount()
local offerName = itemCount .. 'x ' .. topThing:getName()
local offerDescription = 'You see ' .. topThing:getDescription()
db.query(
'INSERT INTO `z_shop_offer` (`id`, `points`, `itemid1`, `count1`, `itemid2`, `count2`, ' ..
'`offer_type`, `offer_name`,`offer_description`) VALUES ' ..
'(NULL , ' .. price .. ', ' .. itemId .. ', ' .. itemCount .. ', ' ..
'0, 0, \'item\', ' .. db.escapeString(offerName) ..
', ' .. db.escapeString(offerDescription) .. ')'
)
player:sendTextMessage(
MESSAGE_STATUS_WARNING,
"Item >> " .. offerName .. " << added to SMS shop. Price set to " .. price .. " premium points."
)
player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN)
end
return true
end