margoh
{{ user.title }}
- Joined
- Apr 1, 2013
- Messages
- 806
- Solutions
- 18
- Reaction score
- 353
Author: @margoh.
Description: New improved Shop for Tibia/Custom servers.
It allows player to purchase items with premium points/tokens.
Screens:
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:
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:
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):
Whole file should be similar to this:
Note: Command for purchasing item should follow template:
Command for coin transfer should follow template:
Note: The style of store is independent, no matter what skin you are using. The shop will looks like on the screens.
Cheers,
margoh.
Description: New improved Shop for Tibia/Custom servers.
It allows player to purchase items with premium points/tokens.
Screens:
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'
},
}
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"
},
}
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)
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
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.zip154.8 KB · Views: 788 · VirusTotal
Last edited: