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

TFS 1.0+, Gesior 2015, new SHOP (with admin)

Gesior.pl

Mega Noob&LOL 2012
Senator
Joined
Sep 18, 2007
Messages
2,965
Solutions
99
Reaction score
3,375
Location
Poland
GitHub
gesior
I'm planning new www shop script (not compatible with old shop script) and update for Gesior2012.

Acc. maker update plans:
- no more support for TFSes older then 1.1
- small fixes for 1.0/1.1 compability [vocations, passwords hashing ['encryptionKey' problem])
- cache for all statistics sites [ configurable on/off and refresh time in seconds ]
- 'my highscores' where you can check your [or any other player] place in highscores for each skill/level/mlvl [show highscores.php page on which is your character Y [highlighted], you don't have to click 'next page' 20 times to find your character]
- configurable server statistics [top level, newest player, empty houses etc.] at top of Latest News [cached]

Shop update plans:
- rewrite all [PHP and LUA]

- fixed CSRF code
- custom categories of shop editable on site (not related to things in category, so you can create category 'Sorcerer' with addons,items and containers in it)
- shop admin (interactive - jQuery)
- easy config of offer images (default image for items/containers/addons or URL to images typed in admin panel)

- a lot of things you can buy:
items
containers
outfit [gives outfit or outfit + addon]
mount
premium days [adds in game by LUA, premium days for account, not player]
learn spell
soul (add to current value - can't go over max.)
stamina minutes (add to current value - can't go over max.)
player group (give some special player group, maybe someone will use it in some script - sell GM? :) )
account type (give some special account type, maybe someone will use it in some script)
bank_balance (add to current value)
storage (set value of one storage ID)
sex (set to male/female)
town (set temple town id for player)
magic level (add to current value)
level (add to current value)
skull remove (someone will have to test this feature, I'm not sure how it works in TFS 1.0 [if it works])
skill (add 'tries' to skill with ID x)
changename (in PHP you can configure new name requirements, so someone can change name to 'Other Name' for 50 points.. but for 100 points he can use name 'otHER N4me', you just config in shopadmin that X changename option cost Y points and must pass Z complete of name requirements)

- thing REQUIREMENTS:
player that receive thing must have...
minimum level
maximum level
vocation [list like: 1,3,4,5,7,8 - vocations 2 and 6 cannot buy this item]
minimum magic level
maximum magic level
sex (male/female)
'must be from logged account [buyer account]' (you don't want someone to change sex of player X without his knowledge!) = you can't buy this item for someone else

Shop LUA script will execute faster then old script - it will be 100% TFS 1.0 code.

I'M WAITING FOR SHOP THING TYPES/REQUIREMENTS AND ACC. MAKER CHANGES PROPOSITIONS.
 
I'm planning new www shop script (not compatible with old shop script) and update for Gesior2012.

Acc. maker update plans:
- no more support for TFSes older then 1.1
- small fixes for 1.0/1.1 compability [vocations, passwords hashing ['encryptionKey' problem])
- cache for all statistics sites [ configurable on/off and refresh time in seconds ]
- 'my highscores' where you can check your [or any other player] place in highscores for each skill/level/mlvl [show highscores.php page on which is your character Y [highlighted], you don't have to click 'next page' 20 times to find your character]
- configurable server statistics [top level, newest player, empty houses etc.] at top of Latest News [cached]

Shop update plans:
- rewrite all [PHP and LUA]

- fixed CSRF code
- custom categories of shop editable on site (not related to things in category, so you can create category 'Sorcerer' with addons,items and containers in it)
- shop admin (interactive - jQuery)
- easy config of offer images (default image for items/containers/addons or URL to images typed in admin panel)

- a lot of things you can buy:
items
containers
outfit [gives outfit or outfit + addon]
mount
premium days [adds in game by LUA, premium days for account, not player]
learn spell
soul (add to current value - can't go over max.)
stamina minutes (add to current value - can't go over max.)
player group (give some special player group, maybe someone will use it in some script - sell GM? :) )
account type (give some special account type, maybe someone will use it in some script)
bank_balance (add to current value)
storage (set value of one storage ID)
sex (set to male/female)
town (set temple town id for player)
magic level (add to current value)
level (add to current value)
skull remove (someone will have to test this feature, I'm not sure how it works in TFS 1.0 [if it works])
skill (add 'tries' to skill with ID x)
changename (in PHP you can configure new name requirements, so someone can change name to 'Other Name' for 50 points.. but for 100 points he can use name 'otHER N4me', you just config in shopadmin that X changename option cost Y points and must pass Z complete of name requirements)

- thing REQUIREMENTS:
player that receive thing must have...
minimum level
maximum level
vocation [list like: 1,3,4,5,7,8 - vocations 2 and 6 cannot buy this item]
minimum magic level
maximum magic level
sex (male/female)
'must be from logged account [buyer account]' (you don't want someone to change sex of player X without his knowledge!) = you can't buy this item for someone else

Shop LUA script will execute faster then old script - it will be 100% TFS 1.0 code.

I'M WAITING FOR SHOP THING TYPES/REQUIREMENTS AND ACC. MAKER CHANGES PROPOSITIONS.
Sorry im retard. But what do you mean with this post? Will you create a new shopsystem for Gesior 2015? (TFS 1.0+) or a new acc? for TFS 1.0+?
 
Sorry im retard. But what do you mean with this post? Will you create a new shopsystem for Gesior 2015? (TFS 1.0+) or a new acc? for TFS 1.0+?

Seems like that.
I wish that he uses bootstrap if he makes a new one, the tibiacom layout just makes the code look extremely ugly and makes it feel well crappy.

@Gesior.pl send me a pm if you want help with the lua parts :)
 
Seems like that.
I wish that he uses bootstrap if he makes a new one, the tibiacom layout just makes the code look extremely ugly and makes it feel well crappy.

@Gesior.pl send me a pm if you want help with the lua parts :)
LUA part is almost done. I wrote script for TFS 1.1 [with only TFS 1.1 functions] for items/containers. Now I just need to add there all other offers and new table/column names.
PHP:
-- ### CONFIG ###
-- message send to player by script "type" (types you can check in "global.lua")
SHOP_MSG_TYPE = 36
-- ### END OF CONFIG ###
function onThink(interval)
    local deliveryInterval = interval / 1000
    local resultId = db.storeQuery("SELECT * FROM z_ots_comunication")
    if(resultId) then
        repeat
            local id = result.getNumber(resultId, "id")
            local player = Player(result.getString(resultId, "name"))
            if(player) then
                local addItemType = result.getString(resultId, "param5")

                if(addItemType == 'item' or addItemType == 'container') then
                    local itemId = result.getNumber(resultId, "param1")
                    local itemCount = result.getNumber(resultId, "param2")
                    local containerId = result.getNumber(resultId, "param3")
                    local containerCount = result.getNumber(resultId, "param4")
                    local addItemName = result.getString(resultId, "param6")

                    local itemReceivedStatus = 0
                    local itemItemType = ItemType(itemId)
                    local containerItemType = ItemType(containerId)
                    local itemsWeight = 0
                    if(itemItemType:isRune() or itemItemType:isFluidContainer() or itemItemType:getCharges() > 0) then
                        itemsWeight = itemItemType:getWeight(1)
                    else
                        itemsWeight = itemItemType:getWeight(itemCount)
                    end
                    if(addItemType == 'container') then
                        itemsWeight = itemsWeight * containerCount + containerItemType:getWeight(1)
                    end
                    local freeCapacity = player:getFreeCapacity()
                    if(itemsWeight <= freeCapacity) then
                        local itemForPlayer = 0
                        if(addItemType == 'container') then
                            itemForPlayer = Container(doCreateItemEx(containerId, 1))
                            itemForPlayer:setAttribute("description", containerItemType:getDescription() .. "\nBought by " .. player:getName() .. ".")
                            local innerContainerItem = 0
                            for i = 1, containerCount do
                                innerContainerItem = Item(doCreateItemEx(itemId, itemCount))
                                if(not itemItemType:isRune() and not itemItemType:isFluidContainer() and not itemItemType:isStackable()) then
                                    innerContainerItem:setAttribute("description", itemItemType:getDescription() .. "\nBought by " .. player:getName() .. ".")
                                end
                                itemForPlayer:addItemEx(innerContainerItem)
                            end
                        else
                            itemForPlayer = Item(doCreateItemEx(itemId, itemCount))
                            if(not itemItemType:isRune() and not itemItemType:isFluidContainer() and not itemItemType:isStackable()) then
                                itemForPlayer:setAttribute("description", itemItemType:getDescription() .. "\nBought by " .. player:getName() .. ".")
                            end
                        end
                        itemReceivedStatus = player:addItemEx(itemForPlayer, false)
                        if(type(itemReceivedStatus) == "number" and itemReceivedStatus == 0) then
                            player:sendTextMessage(SHOP_MSG_TYPE, 'You received >> '.. addItemName ..' << from OTS shop.')
                            db.query("DELETE FROM `z_ots_comunication` WHERE `id` = " .. id .. ";")
                            db.query("UPDATE `z_shop_history_item` SET `trans_state`='realized', `trans_real`=" .. os.time() .. " WHERE id = " .. id .. ";")
                        else
                            player:sendTextMessage(SHOP_MSG_TYPE, '>> '.. addItemName ..' << from OTS shop is waiting for you. Please make place for this item in your backpack/hands and wait about '.. deliveryInterval ..' seconds to get it.')
                        end
                    else
                        player:sendTextMessage(SHOP_MSG_TYPE, '>> '.. addItemName ..' << from OTS shop is waiting for you. It weight is '.. (itemsWeight / 100) ..' oz., you have only '.. (freeCapacity / 100) ..' oz. free capacity. Put some items in depot and wait about '.. deliveryInterval ..' seconds to get it.')
                    end
                elseif(addItemType == 'addon') then
                    local outfitOneId = result.getNumber(resultId, "param1")
                    local outfitOneAddon = result.getNumber(resultId, "param2")
                    local outfitTwoId = result.getNumber(resultId, "param3")
                    local outfitTwoAddon = result.getNumber(resultId, "param4")
                    local outfitName = result.getString(resultId, "param6")
                end
            end
        until not result.next(resultId)
        result.free(resultId)
    end
    return true
end

------------
About acc. maker changes:
I don't have time to rewrite all PHP in acc. maker. There are many other acc. makers for people that want some Bootstrap/AngularJS/any new technology.
I will only add few new features, rewrite shop [I don't want to make new LUA script to add items to shop offer every TFS release, so I make it all on www], add cache and change name to Gesior2015, because new shop will not be compatible with 2012.
 
help me please i have a problem on step 4

STEP 4
Add samples to DB:

and step 5 when i add the pass
STEP 5
Set Admin Account
Faast :\
 
help me please i have a problem on step 4

STEP 4
Add samples to DB:

and step 5 when i add the pass
STEP 5
Set Admin Account
Faast :\
If all steps go without error (check step2) you can remove file 'install.txt' after you set password to admin account (some systems/filesystems configurations don't let acc. maker remove that file).
 
I'm planning new www shop script (not compatible with old shop script) and update for Gesior2012.

Acc. maker update plans:
- no more support for TFSes older then 1.1
- small fixes for 1.0/1.1 compability [vocations, passwords hashing ['encryptionKey' problem])
- cache for all statistics sites [ configurable on/off and refresh time in seconds ]
- 'my highscores' where you can check your [or any other player] place in highscores for each skill/level/mlvl [show highscores.php page on which is your character Y [highlighted], you don't have to click 'next page' 20 times to find your character]
- configurable server statistics [top level, newest player, empty houses etc.] at top of Latest News [cached]

Shop update plans:
- rewrite all [PHP and LUA]

- fixed CSRF code
- custom categories of shop editable on site (not related to things in category, so you can create category 'Sorcerer' with addons,items and containers in it)
- shop admin (interactive - jQuery)
- easy config of offer images (default image for items/containers/addons or URL to images typed in admin panel)

- a lot of things you can buy:
items
containers
outfit [gives outfit or outfit + addon]
mount
premium days [adds in game by LUA, premium days for account, not player]
learn spell
soul (add to current value - can't go over max.)
stamina minutes (add to current value - can't go over max.)
player group (give some special player group, maybe someone will use it in some script - sell GM? :) )
account type (give some special account type, maybe someone will use it in some script)
bank_balance (add to current value)
storage (set value of one storage ID)
sex (set to male/female)
town (set temple town id for player)
magic level (add to current value)
level (add to current value)
skull remove (someone will have to test this feature, I'm not sure how it works in TFS 1.0 [if it works])
skill (add 'tries' to skill with ID x)
changename (in PHP you can configure new name requirements, so someone can change name to 'Other Name' for 50 points.. but for 100 points he can use name 'otHER N4me', you just config in shopadmin that X changename option cost Y points and must pass Z complete of name requirements)

- thing REQUIREMENTS:
player that receive thing must have...
minimum level
maximum level
vocation [list like: 1,3,4,5,7,8 - vocations 2 and 6 cannot buy this item]
minimum magic level
maximum magic level
sex (male/female)
'must be from logged account [buyer account]' (you don't want someone to change sex of player X without his knowledge!) = you can't buy this item for someone else

Shop LUA script will execute faster then old script - it will be 100% TFS 1.0 code.

I'M WAITING FOR SHOP THING TYPES/REQUIREMENTS AND ACC. MAKER CHANGES PROPOSITIONS.
This sunda awsome.
 
@Gesior.pl was last seen: Today at 12:56 AM

Do you think you could make an open repo for this version so people can start using it/helping you finish it? Possibly open a trello with a list of things that need to be finished/tested before final release so that way people aren't walking into a mine field if it isn't fully ready. Just a suggestion!
 
@Gesior.pl was last seen: Today at 12:56 AM

Do you think you could make an open repo for this version so people can start using it/helping you finish it? Possibly open a trello with a list of things that need to be finished/tested before final release so that way people aren't walking into a mine field if it isn't fully ready. Just a suggestion!
It's not ready. It's just started. I will make it, when I lose job again :p (tommorow I will talk with my boss about pay rise around 50%, we will see how it ends.. :) )
 
It's not ready. It's just started. I will make it, when I lose job again :p (tommorow I will talk with my boss about pay rise around 50%, we will see how it ends.. :) )
Hahaha good luck mate :)!
 
Back
Top