It's tutorial for Gesior 2012 account maker, not old one.
UPDATE:
Scripts for TFS 1.4+ available in threads:
1. What will you need?
Tutorial:
1. INSTALLATION OF SHOP [to make it deliver items]
Shop show images of items. It will not work, if you don't install item images! [there is tutorial how to do it]
It adds in description of all items (also in containers) name of player that bought item and unique ID of shop system transaction ^_^
2. Find in it line:
and change it value to true
3. Now open folder data of your ots
4. Open file globalevents.xml in folder globalevents
5. Add there line (don't break XML structure, ask someone to help you if you got no idea about XML files format):
or:
(if in that file is event 'save' with interval 3600/7200 then add 30 [it's time in seconds], if interval is very high like 3600000/7200000 then add line with interval 30000 [it's time in miliseconds - ms])
6. Create file shop.lua in folder globalevents/scripts and paste in it:
That script should work on 0.3.6 and 0.4 without problems (made for my 0.3.6pl1 OTS and tests on 0.4 client 9.6).
Script only for OTSes that use MySQL database!
2. INSTALLATION OF 'ADD SHOP ITEMS' TALKACTION
1. Now open folder data of your ots
2. Open file talkactions.xml in folder talkactions
3. Add there line (don't break XML structure, ask someone to help you if you got no idea about XML files format):
[this line is from TFS 0.4 client 9.6, it may look a bit different on old distributions, make it like other talkactions for GOD]
4. Create file add_shop_talkaction.lua in folder talkactions/scripts and paste in it [tested on TFS 0.4 client 9.6, should works good with all 0.4]:
http://paste.ots.me/560784/text
If script above doesn't work for you (error in console) try SECOND script:
http://paste.ots.me/560783/text
3. SHOP ADMINISTRATION
1. Add offer
1.1 Add with first LUA 'add shop' script [first script works good on 0.4 client 9.6, but I'm not sure if it works on 0.3.6]
Login on GOD character and put item/backpack [it will add full backpack of first item in backpack when player buy] that you want add IN FRONT OF YOU:
Say /addshop price or /addshop price, D e( ee'e') sc,ri p, tio n:
Then in SMS shop it shows:
1.2 Add with second LUA 'add shop' script [works on all TFSes 0.3.6/0.4, BUT on 9.6 you can't put all items in right hand!]
Login on GOD character and put item/backpack [it will add full backpack of first item in backpack when player buy] that you want add in your right hand:
Say /addshop price or /addshop price, D e( ee'e') sc,ri p, tio n:
Then in SMS shop it shows [old shop images, not it shows images]:
2. Remove offer
You can remove offers in 'phpmyadmin' [database]. Remove rows from table
3. Edit offer
You can edit offers in 'phpmyadmin' [database]. Edit rows in table
UPDATE:
Scripts for TFS 1.4+ available in threads:
GlobalEvent - [Gesior2012] TFS 1.4+ Shop delivery script
There is Shop delivery script for TFS 1.1+ that delivers to 'Store Inbox' ( GlobalEvent - Shop System delivery for TFS 1.1+ with Store Inbox (https://otland.net/threads/shop-system-delivery-for-tfs-1-1-with-store-inbox.245603/) ) If you are running some downgrade, you may not have 'Store Inbox'...
otland.net
TalkAction - [Gesior2012] TFS 1.4+ Add offers to Shop using talkaction
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...
otland.net
GlobalEvent - Shop System delivery for TFS 1.1+ with Store Inbox
If you use one of TFS 1.1+ based engines that got Store Inbox, you can use new LUA script for delivery from website shop. New code delivers items and containers with items to Store Inbox of players. There is also full error reporting. If anything is wrong with shop offer on website or server...
otland.net
1. What will you need?
- installed account maker
- working ots based on TFS 0.3.6/0.4
Tutorial:
1. INSTALLATION OF SHOP [to make it deliver items]
Shop show images of items. It will not work, if you don't install item images! [there is tutorial how to do it]
It adds in description of all items (also in containers) name of player that bought item and unique ID of shop system transaction ^_^
1. Open account maker folder and go to folder config and edit file config.phpexample said:22:13 You see an earthborn titan armor (Arm:15, axe fighting +2, protection physical +5%, earth +3%).
It can only be wielded properly by knights of level 90 or higher.
It weighs 120.00 oz.
Bought by GOD Gesior [ID:334].
2. Find in it line:
PHP:
$config['site']['shop_system'] = false; // show server shop page? use only if you installed LUA scripts of shop
3. Now open folder data of your ots
4. Open file globalevents.xml in folder globalevents
5. Add there line (don't break XML structure, ask someone to help you if you got no idea about XML files format):
XML:
<globalevent name="website_shop_item_delivery" interval="30" event="script" value="shop.lua"/>
XML:
<globalevent name="website_shop_item_delivery" interval="30000" event="script" value="shop.lua"/>
6. Create file shop.lua in folder globalevents/scripts and paste in it:
Lua:
-- ### CONFIG ###
-- message send to player by script "type" (types you can check in "data/lib/000-constants.lua")
SHOP_MSG_TYPE = MESSAGE_STATUS_CONSOLE_BLUE
-- time (in seconds) between queries to MySQL database by shop script
SQL_interval = 30
-- ### END OF CONFIG ###
function onThink(interval, lastExecution)
local result_plr = db.getResult("SELECT * FROM `z_ots_comunication` WHERE `type` = 'login';")
if(result_plr:getID() ~= -1) then
while(true) do
id = tonumber(result_plr:getDataInt("id"))
action = tostring(result_plr:getDataString("action"))
delete = tonumber(result_plr:getDataInt("delete_it"))
cid = getCreatureByName(tostring(result_plr:getDataString("name")))
if isPlayer(cid) == TRUE then
local itemtogive_id = tonumber(result_plr:getDataInt("param1"))
local itemtogive_count = tonumber(result_plr:getDataInt("param2"))
local container_id = tonumber(result_plr:getDataInt("param3"))
local container_count = tonumber(result_plr:getDataInt("param4"))
local add_item_type = tostring(result_plr:getDataString("param5"))
local add_item_name = tostring(result_plr:getDataString("param6"))
local received_item = 0
local full_weight = 0
if add_item_type == 'container' then
container_weight = getItemWeightById(container_id, 1)
if isItemRune(itemtogive_id) == TRUE then
items_weight = container_count * getItemWeightById(itemtogive_id, 1)
else
items_weight = container_count * getItemWeightById(itemtogive_id, itemtogive_count)
end
full_weight = items_weight + container_weight
else
full_weight = getItemWeightById(itemtogive_id, itemtogive_count)
if isItemRune(itemtogive_id) == TRUE then
full_weight = getItemWeightById(itemtogive_id, 1)
else
full_weight = getItemWeightById(itemtogive_id, itemtogive_count)
end
end
local free_cap = getPlayerFreeCap(cid)
if full_weight <= free_cap then
if add_item_type == 'container' then
local new_container = doCreateItemEx(container_id, 1)
doItemSetAttribute(new_container, "description", 'Bought by ' .. getCreatureName(cid) .. ' [ID:' .. id .. '].')
doItemSetAttribute(new_container, "tid", id)
local iter = 0
while iter ~= container_count do
local new_item = doCreateItemEx(itemtogive_id, itemtogive_count)
doItemSetAttribute(new_item, "description", 'Bought by ' .. getCreatureName(cid) .. ' [ID:' .. id .. '].')
doItemSetAttribute(new_item, "tid", id)
doAddContainerItemEx(new_container, new_item)
iter = iter + 1
end
received_item = doPlayerAddItemEx(cid, new_container)
else
local new_item = doCreateItemEx(itemtogive_id, itemtogive_count)
doItemSetAttribute(new_item, "description", 'Bought by ' .. getCreatureName(cid) .. ' [ID:' .. id .. '].')
doItemSetAttribute(new_item, "tid", id)
received_item = doPlayerAddItemEx(cid, new_item)
end
if received_item == RETURNVALUE_NOERROR then
doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, 'You received >> '.. add_item_name ..' << from OTS shop.')
doPlayerSave(cid)
db.executeQuery("DELETE FROM `z_ots_comunication` WHERE `id` = " .. id .. ";")
db.executeQuery("UPDATE `z_shop_history_item` SET `trans_state`='realized', `trans_real`=" .. os.time() .. " WHERE id = " .. id .. ";")
else
doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, '>> '.. add_item_name ..' << from OTS shop is waiting for you. Please make place for this item in your backpack/hands and wait about '.. SQL_interval ..' seconds to get it.')
end
else
doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, '>> '.. add_item_name ..' << from OTS shop is waiting for you. It weight is '.. full_weight ..' oz., you have only '.. free_cap ..' oz. free capacity. Put some items in depot and wait about '.. SQL_interval ..' seconds to get it.')
end
end
if not(result_plr:next()) then
break
end
end
result_plr:free()
end
return true
end
Script only for OTSes that use MySQL database!
2. INSTALLATION OF 'ADD SHOP ITEMS' TALKACTION
1. Now open folder data of your ots
2. Open file talkactions.xml in folder talkactions
3. Add there line (don't break XML structure, ask someone to help you if you got no idea about XML files format):
[this line is from TFS 0.4 client 9.6, it may look a bit different on old distributions, make it like other talkactions for GOD]
XML:
<talkaction log="yes" words="/addshop" access="5" event="script" value="add_shop_talkaction.lua"/>
http://paste.ots.me/560784/text
If script above doesn't work for you (error in console) try SECOND script:
http://paste.ots.me/560783/text
3. SHOP ADMINISTRATION
1. Add offer
1.1 Add with first LUA 'add shop' script [first script works good on 0.4 client 9.6, but I'm not sure if it works on 0.3.6]
Login on GOD character and put item/backpack [it will add full backpack of first item in backpack when player buy] that you want add IN FRONT OF YOU:
Say /addshop price or /addshop price, D e( ee'e') sc,ri p, tio n:
Then in SMS shop it shows:
1.2 Add with second LUA 'add shop' script [works on all TFSes 0.3.6/0.4, BUT on 9.6 you can't put all items in right hand!]
Login on GOD character and put item/backpack [it will add full backpack of first item in backpack when player buy] that you want add in your right hand:
Say /addshop price or /addshop price, D e( ee'e') sc,ri p, tio n:
Then in SMS shop it shows [old shop images, not it shows images]:
2. Remove offer
You can remove offers in 'phpmyadmin' [database]. Remove rows from table
z_shop_offer
.3. Edit offer
You can edit offers in 'phpmyadmin' [database]. Edit rows in table
z_shop_offer
, but it's not easy to understand, so better remove and add again.
Last edited: