• 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][MODULE]Store_module

margoh

{{ user.title }}
Joined
Apr 1, 2013
Messages
806
Solutions
18
Reaction score
350
Author: @margoh.
Description: New improved Shop for Tibia/Custom servers.
It allows player to purchase items with premium points/tokens.
Screens:
rdyiwhdteuzbdeuxgnlxpszhnpxtkicirwedcfwcucwuowlamkfjefyjlbesfyxczxejqxlgaargoujddvpsddlowhytoyrobvci

cvhzixmvkjwhzeyssxdvralorcttxbzzyxfmdaxjybluczbaeyxoclndwjtwumyakuwebyrrseycyzbofjabhnbynlpzyyshjgwa

udhkrglcmcgyuarvomocaxldtsolkandbqwvfvrxofefozyzdyhfhfbrcqnvaplpnbtomswoipvuqgcbqxypzysldvbrjzaawoku

How to use:
1. Drag & drop content of the zip file to main folder of OTC.
2. Go to folder store_module and open file configs.lua
3. Change COMMAND_BUYITEM to command for purchasing item.
4. Change COMMAND_TRANSFER to command to transfer points.
5. Change WEBSITE_GETCOINS to page where you can purchase points.
6. Change COINS_OPCODE to whatever opcode number you will use.
7. Save. You are done.

How to add category:
Code:
storeIndex = {
    [1] = {
        id = '1',
        name = 'Premium Time',
        description = 'Buy low-priced Premium Time to add it to your own account.',
        image = "/images/shop/premium_time",
        imageList = '/images/shop/premium_time_small'
    },
}
id - Id of the category (used to command).
name - Name of category.
description - Description of the category.
image - Image of the category on the Description Panel (size 64x64px).
imageList - Image of the category on the List Panel (size 32x32px).

How to add product to category:
Code:
storeProducts = {
    {
        name = "30 days",
        id = '1',
        category_id = "1",
        description = 'Do you really want to buy "30 days" of premium time?\n\nNote: Once you have purchased Premium Time, your account\ninstantly receives premium status - no relog necessary!',
        tooltip = "",
        price = 250,
        image = "/images/shop/offer/30days"
    },
}
name - Name of the item player will be able to purchase.
id - Id of the item (used to command).
category_id - Id of the category in which item will be displayed.
description - Description of the item player wants to purchase, displayed in popup window.
tooltip - If the name is longer than 12-13 character, enter the name of item here. It will be displayed on hover.
price - Price of the item.
image - Icon of the item player wants to purchase (size 88x70px).

How to send Tibia Coins value to client:
Open in your TFS (I'm using TFS 1.2) data/creaturescripts/scripts/extendedopcode.lua
And add this (I have done it through storage):
Code:
    local tibiaCoins = getPlayerStorageValue(player, 999999999)
    player:sendExtendedOpcode(52, tibiaCoins)
Whole file should be similar to this:
Code:
function onExtendedOpcode(player, opcode, buffer)
    local tibiaCoins = getPlayerStorageValue(player, 999999999)
    player:sendExtendedOpcode(52, tibiaCoins)
    return true
end

Note: Command for purchasing item should follow template:
Code:
!storebuy CATEGORYID, ITEMID
Command for coin transfer should follow template:
Code:
!transferpoints PLAYERNAME, VALUE


Note: The style of store is independent, no matter what skin you are using. The shop will looks like on the screens.

Cheers,
margoh.
 

Attachments

  • store_module.zip
    154.8 KB · Views: 711 · VirusTotal
Last edited:
instead of using a image for every single outfit, I guess is better create a Creature on otui and fill the informations (body,legs,feet,addons..), so you just configure the outfit like you configure an NPC outfit on TFS :p (just a suggestion, but your system is good)
 
Very nice release, I think I'll look into adapting to this one instead of your previous one. I will probably make a different skin for it though. I'll see if I can release any assets/changes here.
Good to see more OTC contributors!
 
I've installed it on my client, and now I can open it with Ctrl+U, but can I set up a button ont topbar to open it?

Also, can I somehow use the market to sell Tibia Coin to other players?
 
Last edited:
Because in my client I have removed client_topmenu and after moving to fresh client I didn't add it :d You can add it simply following the way it's added in other module, f.ex. game_battle.
 
Because in my client I have removed client_topmenu and after moving to fresh client I didn't add it :d You can add it simply following the way it's added in other module, f.ex. game_battle.
Yeah, I've done this hahaha But I still couldn't get the number of coins :/ I did the exect same as the post, set storage 21116 to 80 anda changed
local tibiaCoins = getPlayerStorageValue(player, 999999999)
to
local tibiaCoins = getPlayerStorageValue(player, 21116)
Could you help me? I'm using TFS 1.2

EDIT:
Shouldn't it be getPlayerStorageValue(cid, 21116) ?

EDIT2:
Still doesn't work :(
13:08 Storage key '21116' was set to '80' for player 'GOD Sala'.
13:08 Storage key '21116' is currently set to '80' for player 'GOD Sala'.
 
Last edited:
I have done it on TFS 1.2, so I don't know why it's not working xd
 
EDIT:
I don't know what I've done, but I got it ahahhaha. Sorry for the inconvenience. Great module!
 
Last edited:
First post updated.
Fixed bug, when you had lower TC than price it was removing TC from balance (command was returning false). Now when our TC is lower than price, Buy button acts as redirection to page where we can buy TC.
 
I'm trying to use the protocol 10.92 but when I click on the offer character logs out. It has no error in TFS only logs out the character, but it works normal in version 10.90 and 10.91 someone could help me resolve to adapt to 10.92 too?
 
I want to use in a server client 8:54 that already has opcode , how do I use ?
 
Make function that will send opcode, change opcode number in config (to yours) and that should do the trick.
 
Everything is in first post. If you are using TFS where there is no exopcodes by default, I cannot help you, sorry.
 
help please, I'm not getting the amount of coins I have on the client, I already added in the database the storage.

function onExtendedOpcode(player, opcode, buffer)
print("OPCODS1") local tibiaCoins = getPlayerStorageValue(cid, 21116)
print("OPCODS2") player:sendExtendedOpcode(52, tibiaCoins)
return true
end
 

Attachments

Back
Top