Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .vs/ProjectEvaluation/shop.metadata.v6.1
Binary file not shown.
Binary file added .vs/ProjectEvaluation/shop.projects.v6.1
Binary file not shown.
Binary file added .vs/Shop/DesignTimeBuild/.dtbcache.v2
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Empty file.
Binary file added .vs/Shop/v17/.futdcache.v2
Binary file not shown.
Binary file added .vs/Shop/v17/.suo
Binary file not shown.
2 changes: 2 additions & 0 deletions Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ public class ItemInfo
public string Name = "";
public bool Infinity = false;
public int Amount = 0;
public byte modifierId = 0;

/// <summary>Цена купли у игрока</summary>
public string SelPrice = "0";
Expand All @@ -18,6 +19,7 @@ public class ItemInfo
public class Config
{
public string BuyCommand = "";
public string ListShopItemsCommand = "";
public string BuyItemPermission = "";
public string SellCommand = "";
public string SellItemPermission = "";
Expand Down
Binary file removed Dependencies/OTAPI.dll
Binary file not shown.
Binary file removed Dependencies/TShockAPI.dll
Binary file not shown.
Binary file removed Dependencies/TerrariaServer.exe
Binary file not shown.
Binary file removed Dependencies/Wolfje.Plugins.SEconomy.dll
Binary file not shown.
43 changes: 24 additions & 19 deletions Lang.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ namespace ShopPlugin
class Lang
{
private static string _buyCommand = "buy";
private static string _listItemCommand = "list";
private static string _buyItemPermission = "shop.buy";
private static string _sellCommand = "sell";
private static string _sellItemPermission = "shop.sell";
Expand All @@ -17,22 +18,23 @@ class Lang
private static Dictionary<string, string> _message = new Dictionary<string, string>
{
{"Load", "[Shop] Loaded {0} items in shop"},
{"NoPerms", "[Shop] Вы не можете использовать эту команду."},
{"BuyInfo", "[Shop] /{0} {1} (Id предмета) [Кол-во]"},
{"SellInfo", "[Shop] /{0} {1}"},
{"SearchInfo", "[Shop] /{0} {1} (Id предмета)"},
{"NoSlot", "[Shop] В вашем рюкзаке нет места!" },
{"TooMany", "[Shop] У нас есть только {0} {1}"},
{"OnBuy", "[Shop] Вы купили {0} {1} за {2}"},
{"OnSell", "[Shop] Вы продали {0} {1} за {2}"},
{"EmptyHand", "[Shop] Возьмите предмет в руку, затем напишите /{0} {1}"},
{"WrongSellItem", "[Shop] Мы не покупаем данный предмет" },
{"Error", "[Shop] Что-то пошло не так!" },
{"NoMatch", "[Shop] У нас нет такого в ассортименте!" },
{"SearchItem", "[Shop] {0} | Цена продажи: {1} | Цена покупки: {2} | Кол-во на складе: {3}" },
{"NotInShop", "[Shop] Чтобы пользоваться магазином вы должны находится на территории прилавка." },
{"ShopCommands", "[Shop] Комманды магазина:" },
{"NoMoney", "У вас недостаточно виты! Нужно {0}"}
{"NoPerms", "[Shop] You cannot use this command."},
{"BuyInfo", "[Shop] /{0} {1} (Item index/name) [Quantity] - buy an item depending on its index/name"},
{"SellInfo", "[Shop] /{0} {1} - sell whats in your selected slot in the hotbar."},
{"ListItems", "[Shop] /{0} {1} - list items presently in the shop."},
{"SearchInfo", "[Shop] /{0} {1} Optional:(Item ID/name) - searches if an item from either its id/name or from what you have selected in your hotbar is in the shop and gives you its prices/index."},
{"NoSlot", "[Shop] There is no room in your inventory!" },
{"TooMany", "[Shop] We only have [c/{0}:{1}] [i:{2}]."},
{"OnBuy", "[Shop] [c/{0}:Purchase was successfull!] You bought [c/{1}:{2}] [i/p{3}:{4}] for {5}, you have {6} left in your bank."},
{"OnSell", "[Shop] [c/{0}:Sale was successfull!] You sold [c/{1}:{2}] [i/p{3}:{4}] for {5}, you now have {6} in your bank."},
{"EmptyHand", "[Shop] Select an item in your hotbar, then type /{0} {1}"},
{"WrongSellItem", "[Shop] We can't buy this item" },
{"Error", "[Shop] Something went wrong!" },
{"NoMatch", "[Shop] We don't have that in stock!" },
{"SearchItem", "[Shop] - {0} [{1}] - [c/{2}:{3}]([c/{4}:{5}]) [c/{6}:B:] {7} {8}" },
{"NotInShop", "[Shop] You must be in the area of the counter to use the shop." },
{"ShopCommands", "[Shop] Shop Commands:" },
{"NoMoney", "You don't have enough money! You are missing: {0}"}
};

public static Config DefaultConfig()
Expand All @@ -41,6 +43,7 @@ public static Config DefaultConfig()
{
BuyCommand = _buyCommand,
BuyItemPermission = _buyItemPermission,
ListShopItemsCommand = _listItemCommand,
SellCommand = _sellCommand,
SellItemPermission = _sellItemPermission,
ShopCommand = _shopCommand,
Expand All @@ -60,16 +63,18 @@ public static Config DefaultConfig()
Name = Terraria.Lang.GetItemNameValue(19),
Infinity = false,
Amount = 500,

SelPrice = "1000",
BuyPrice = "2000"
},
new ItemInfo
{
Id = 20,
Name = Terraria.Lang.GetItemNameValue(20),
Id = 46,
Name = Terraria.Lang.GetItemNameValue(46),
modifierId = 40,
Infinity = false,
Amount = 500,
SelPrice = "500",
SelPrice = "0",
BuyPrice = "1000"
},
new ItemInfo
Expand Down
23 changes: 0 additions & 23 deletions Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Shop")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Shop")]
[assembly: AssemblyCopyright("Copyright © 2013")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

Expand All @@ -21,16 +11,3 @@

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("e1d99b54-627a-4b0b-a3b5-f635562b4a44")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
55 changes: 55 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Shop-plugin
Shop plugin to sell/buy items from a global shop with SEconomy.

- Originally made by [bokmako](https://github.com/bokmako).
- Updated to **TShock** `5.2` for `1.4.4.9` and translated to English by Maxthegreat99.

## How to Install
1. Put the .dll into the `\ServerPlugins\` folder.
2. Restart the server.
3. Give your desired group the the permissions defined in the configs folder.

## How to Use
#### NOTE: you can modify most commands / permissions / messages in the configs.
### User instructions
- define a region with the same name as the `ShopRegionName` field defined in the configs, `Shop` being the default assigned value. You are needed to be within the shop region to use most commands.
- give your desired groups the different permissions depending on the commands you want the group to be able to use, `shop.shop` being the default permission to use the base command.
- add items to the shop using the configs and do `/Shop list` within the shop to see if they were added properly.

### Commands and Usage
- `shop` - base commands, gives you a list a commands if in the shop region.
- `shop list` - list items presently in the shop in an index, this command can be used anywhere in the world.
- `shop buy (Item index/name) [Quantity]` - buy an item depending on its index/name.
- `shop sell` - sell whats in your selected slot in the hotbar(If you give a group this permission, it is recommended that the world has SSC on).
- `shop search Optional:(Item ID/name)` - searches if an item from either its id/name or from what you have selected in your hotbar is in the shop and gives you its prices/index.

### Config Options
#### Configs not stated are configs to change commands / permissions or messages.
- `ShopRegionName` - Name of the Shop region where the commands will be available for players to use.
- `Items` - List of items available in the global shop
- `Id` - ID of an item in global shop.
- `Name` - the name of an item in the global shop.
- `Infinity` - wheather or not this item should be in infinite supply.
- `Amount` - the amount of that item that is presently in the shop, may be changed no matter what.
- `modifierId` - the modifier of the item in the shop, of course wont work with some items.
- `SelPrice` - the price which the shop buys the item, players cant sell if the selling price is below 1.
- `BuyPrice` - the price which the shop sells the item, players cant buy buy items with a price below 0.

### Important
- you of course need SEconomy to use this plugin, if you dont have it you can get it [here](https://github.com/Maxthegreat99/SEconomy).

## How to Build
1. Download the source code.
2. Open the `.sln` file.
3. Check to make sure the references are all correct and up to date.
4. Build.

## Notes
- As of right now the plugin is still in pre-release so all the features are not added yet and there might be some bugs or unusual things, if you do find them you can report them to this [discord](https://discord.gg/e465y7Xeba) where I(Maxthegreat) will be notified and try to fix them.
- I did not keep the russian version of the plugin and i am sorry for that, i shall add an option to use the plugin in russian in the configs in the release as well as make a russian readme.
- Note that [bokmako](https://github.com/bokmako) did an amazing work with this plugin and that it would have been hard for me to make what he did from scratch, most of the credits goes to them.

## Original repository
https://github.com/bokmako/Shop-plugin


74 changes: 16 additions & 58 deletions Shop.csproj
Original file line number Diff line number Diff line change
@@ -1,66 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{71536203-48D3-4682-8E66-E9AFB2817585}</ProjectGuid>
<TargetFramework>net6.0</TargetFramework>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Shop</RootNamespace>
<AssemblyName>Shop</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<AssemblyTitle>Shop</AssemblyTitle>
<Product>Shop</Product>
<Copyright>Copyright © 2013</Copyright>
<AssemblyVersion>1.0.0.0</AssemblyVersion>
<FileVersion>1.0.0.0</FileVersion>
<PlatformTarget>x64</PlatformTarget>
<Platforms>AnyCPU;x64</Platforms>
</PropertyGroup>
<ItemGroup>
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\терка плагины\Plugin\SeRanking\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="OTAPI">
<HintPath>..\..\терка плагины\Plugin\черновик\Тшок\OTAPI.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="TerrariaServer">
<HintPath>..\..\терка плагины\Plugin\черновик\Тшок\TerrariaServer.exe</HintPath>
</Reference>
<Reference Include="TShockAPI">
<HintPath>..\..\терка плагины\Plugin\черновик\Тшок\ServerPlugins\TShockAPI.dll</HintPath>
</Reference>
<Reference Include="Wolfje.Plugins.SEconomy">
<HintPath>..\..\терка плагины\Plugin\SeRanking\ServerPlugins\Wolfje.Plugins.SEconomy.dll</HintPath>
</Reference>
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="System.Drawing.Common" Version="7.0.0" />
<PackageReference Include="TShock" Version="5.2.0" />
</ItemGroup>
<ItemGroup>
<Compile Include="Config.cs" />
<Compile Include="Lang.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="ShopPlugin.cs" />
<Reference Include="Wolfje.Plugins.SEconomy">
<HintPath>..\Dependencies\Wolfje.Plugins.SEconomy.dll</HintPath>
</Reference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
13 changes: 9 additions & 4 deletions Shop.sln
Original file line number Diff line number Diff line change
@@ -1,20 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.31729.503
# Visual Studio Version 17
VisualStudioVersion = 17.5.33424.131
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Shop", "Shop.csproj", "{71536203-48D3-4682-8E66-E9AFB2817585}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Shop", "Shop.csproj", "{71536203-48D3-4682-8E66-E9AFB2817585}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{71536203-48D3-4682-8E66-E9AFB2817585}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{71536203-48D3-4682-8E66-E9AFB2817585}.Debug|Any CPU.Build.0 = Debug|Any CPU
{71536203-48D3-4682-8E66-E9AFB2817585}.Debug|x64.ActiveCfg = Debug|x64
{71536203-48D3-4682-8E66-E9AFB2817585}.Debug|x64.Build.0 = Debug|x64
{71536203-48D3-4682-8E66-E9AFB2817585}.Release|Any CPU.ActiveCfg = Release|Any CPU
{71536203-48D3-4682-8E66-E9AFB2817585}.Release|Any CPU.Build.0 = Release|Any CPU
{71536203-48D3-4682-8E66-E9AFB2817585}.Release|x64.ActiveCfg = Release|x64
{71536203-48D3-4682-8E66-E9AFB2817585}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
Loading