DtlTraders/patterns: Difference between revisions

From Citizens Wiki
Line 120: Line 120:
</div>
</div>
<div style="display:table-cell;width:380px;background-color: #F9F9F9;border-top:solid 1px"><!-- Cell -->
<div style="display:table-cell;width:380px;background-color: #F9F9F9;border-top:solid 1px"><!-- Cell -->
<p style="margin:0px;padding:2px 10px"><code style="margin:0px;display:block;">description...</code></p>
<p style="margin:0px;padding:2px 10px"><code style="margin:0px;display:block;">Sets the amounts for that item, if specified more than one it will use the multiple items window, <b>default: 1</b></code></p>
</div>
</div>
<div style="display:table-cell;width:160px;background-color: #F9F9F9;border-top:solid 1px"><!-- Cell -->
<div style="display:table-cell;width:160px;background-color: #F9F9F9;border-top:solid 1px"><!-- Cell -->
<p style="margin:0px;padding:2px 10px"><code style="margin:0px;display:block"></code></p>
<p style="margin:0px;padding:2px 10px"><code style="margin:0px;display:block">a:1,2,4</code></p>
</div>
</div>
</div><!-- durability -->
</div><!-- durability -->
<div style="display:table;width:100%">
<div style="display:table;width:100%">
<div style="display:table-cell;width:160px;background-color: #F9F9F9;border-top:dashed 1px red"><!-- Cell -->
<div style="display:table-cell;width:160px;background-color: #F9F9F9;border-top:dashed 1px red"><!-- Cell -->
<p style="margin:0px"><code style="padding: 5px 10px;display:block">durability</code></p>
<p style="margin:0px"><code style="padding: 5px 10px;display:block">Durability</code></p>
</div>
</div>
<div style="display:table-cell;width:210px;background-color: #F9F9F9;border-top:dashed 1px red"><!-- Cell -->
<div style="display:table-cell;width:210px;background-color: #F9F9F9;border-top:dashed 1px red"><!-- Cell -->
Line 134: Line 134:
</div>
</div>
<div style="display:table-cell;width:380px;background-color: #F9F9F9;border-top:dashed 1px red"><!-- Cell -->
<div style="display:table-cell;width:380px;background-color: #F9F9F9;border-top:dashed 1px red"><!-- Cell -->
<p style="margin:0px"><code style="padding: 5px 10px;display:block">description...</code></p>
<p style="margin:0px"><code style="padding: 5px 10px;display:block">Sets the items durability, <b>default: 0</b></code></p>
</div>
</div>
<div style="display:table-cell;width:160px;background-color: #F9F9F9;border-top:dashed 1px red"><!-- Cell -->
<div style="display:table-cell;width:160px;background-color: #F9F9F9;border-top:dashed 1px red"><!-- Cell -->
<p style="margin:0px"><code style="padding: 5px 10px;display:block"></code></p>
<p style="margin:0px"><code style="padding: 5px 10px;display:block">d:22</code></p>
</div>
</div>
</div><!-- price -->
</div><!-- price -->
Line 148: Line 148:
</div>
</div>
<div style="display:table-cell;width:380px;background-color: #F9F9F9;border-top:dashed 1px red"><!-- Cell -->
<div style="display:table-cell;width:380px;background-color: #F9F9F9;border-top:dashed 1px red"><!-- Cell -->
<p style="margin:0px"><code style="padding: 5px 10px;display:block">description...</code></p>
<p style="margin:0px"><code style="padding: 5px 10px;display:block">Sets the price for the item, <b>default: pattern price</b></code></p>
</div>
</div>
<div style="display:table-cell;width:160px;background-color: #F9F9F9;border-top:dashed 1px red"><!-- Cell -->
<div style="display:table-cell;width:160px;background-color: #F9F9F9;border-top:dashed 1px red"><!-- Cell -->
<p style="margin:0px"><code style="padding: 5px 10px;display:block"></code></p>
<p style="margin:0px"><code style="padding: 5px 10px;display:block">p:12.22</code></p>
</div>
</div>
</div><!-- Slot -->
</div><!-- Slot -->
Line 162: Line 162:
</div>
</div>
<div style="display:table-cell;width:380px;background-color: #F9F9F9;border-top:dashed 1px red"><!-- Cell -->
<div style="display:table-cell;width:380px;background-color: #F9F9F9;border-top:dashed 1px red"><!-- Cell -->
<p style="margin:0px"><code style="padding: 5px 10px;display:block">description...</code></p>
<p style="margin:0px"><code style="padding: 5px 10px;display:block">Sets the slot for the item, <b>default: first empty</b></code></p>
</div>
</div>
<div style="display:table-cell;width:160px;background-color: #F9F9F9;border-top:dashed 1px red"><!-- Cell -->
<div style="display:table-cell;width:160px;background-color: #F9F9F9;border-top:dashed 1px red"><!-- Cell -->
<p style="margin:0px"><code style="padding: 5px 10px;display:block"></code></p>
<p style="margin:0px"><code style="padding: 5px 10px;display:block">s:22</code></p>
</div>
</div>
</div><!-- enchants -->
</div><!-- enchants -->
<div style="display:table;width:100%">
<div style="display:table;width:100%">
<div style="display:table-cell;width:160px;background-color: #F9F9F9;border-top:dashed 1px red"><!-- Cell -->
<div style="display:table-cell;width:160px;background-color: #F9F9F9;border-top:dashed 1px red"><!-- Cell -->
<p style="margin:0px"><code style="padding: 5px 10px;display:block">enchants</code></p>
<p style="margin:0px"><code style="padding: 5px 10px;display:block">Enchants</code></p>
</div>
</div>
<div style="display:table-cell;width:210px;background-color: #F9F9F9;border-top:dashed 1px red"><!-- Cell -->
<div style="display:table-cell;width:210px;background-color: #F9F9F9;border-top:dashed 1px red"><!-- Cell -->
Line 176: Line 176:
</div>
</div>
<div style="display:table-cell;width:380px;background-color: #F9F9F9;border-top:dashed 1px red"><!-- Cell -->
<div style="display:table-cell;width:380px;background-color: #F9F9F9;border-top:dashed 1px red"><!-- Cell -->
<p style="margin:0px"><code style="padding: 5px 10px;display:block">description...</code></p>
<p style="margin:0px"><code style="padding: 5px 10px;display:block">Sets enchantments for an item, <b>default: none</b></code></p>
</div>
</div>
<div style="display:table-cell;width:160px;background-color: #F9F9F9;border-top:dashed 1px red"><!-- Cell -->
<div style="display:table-cell;width:160px;background-color: #F9F9F9;border-top:dashed 1px red"><!-- Cell -->
<p style="margin:0px"><code style="padding: 5px 10px;display:block"></code></p>
<p style="margin:0px"><code style="padding: 5px 10px;display:block">e:16/3,17/30</code></p>
</div>
</div>
</div><!-- Global limit -->
</div><!-- Global limit -->
Line 190: Line 190:
</div>
</div>
<div style="display:table-cell;width:380px;background-color: #F9F9F9;border-top:dashed 1px red"><!-- Cell -->
<div style="display:table-cell;width:380px;background-color: #F9F9F9;border-top:dashed 1px red"><!-- Cell -->
<p style="margin:0px"><code style="padding: 5px 10px;display:block">description...</code></p>
<p style="margin:0px"><code style="padding: 5px 10px;display:block">Sets a global limit for that item, <b>default: no limit</b></code></p>
</div>
</div>
<div style="display:table-cell;width:160px;background-color: #F9F9F9;border-top:dashed 1px red"><!-- Cell -->
<div style="display:table-cell;width:160px;background-color: #F9F9F9;border-top:dashed 1px red"><!-- Cell -->
<p style="margin:0px"><code style="padding: 5px 10px;display:block"></code></p>
<p style="margin:0px"><code style="padding: 5px 10px;display:block">gl:0/30/3600</code></p>
</div>
</div>
</div><!-- Player limit -->
</div><!-- Player limit -->
Line 204: Line 204:
</div>
</div>
<div style="display:table-cell;width:380px;background-color: #F9F9F9;border-top:dashed 1px red"><!-- Cell -->
<div style="display:table-cell;width:380px;background-color: #F9F9F9;border-top:dashed 1px red"><!-- Cell -->
<p style="margin:0px"><code style="padding: 5px 10px;display:block">description...</code></p>
<p style="margin:0px"><code style="padding: 5px 10px;display:block">Sets a per player limit for that item, <b>default: no limit</b></code></p>
</div>
</div>
<div style="display:table-cell;width:160px;background-color: #F9F9F9;border-top:dashed 1px red"><!-- Cell -->
<div style="display:table-cell;width:160px;background-color: #F9F9F9;border-top:dashed 1px red"><!-- Cell -->
<p style="margin:0px"><code style="padding: 5px 10px;display:block"></code></p>
<p style="margin:0px"><code style="padding: 5px 10px;display:block">pl:0/30/3600</code></p>
</div>
</div>
</div><!-- Stored enchants -->
</div><!-- Stored enchants -->
<div style="display:table;width:100%">
<div style="display:table;width:100%">
<div style="display:table-cell;width:160px;background-color: #F9F9F9;border-top:dashed 1px red"><!-- Cell -->
<div style="display:table-cell;width:160px;background-color: #F9F9F9;border-top:dashed 1px red"><!-- Cell -->
<p style="margin:0px"><code style="padding: 5px 10px;display:block">stored enchants</code></p>
<p style="margin:0px"><code style="padding: 5px 10px;display:block">Stored enchants</code></p>
</div>
</div>
<div style="display:table-cell;width:210px;background-color: #F9F9F9;border-top:dashed 1px red"><!-- Cell -->
<div style="display:table-cell;width:210px;background-color: #F9F9F9;border-top:dashed 1px red"><!-- Cell -->
Line 218: Line 218:
</div>
</div>
<div style="display:table-cell;width:380px;background-color: #F9F9F9;border-top:dashed 1px red"><!-- Cell -->
<div style="display:table-cell;width:380px;background-color: #F9F9F9;border-top:dashed 1px red"><!-- Cell -->
<p style="margin:0px"><code style="padding: 5px 10px;display:block">description...</code></p>
<p style="margin:0px"><code style="padding: 5px 10px;display:block">Sets one one enchant for a enchanted book item, <b>default: none</b></code></p>
</div>
</div>
<div style="display:table-cell;width:160px;background-color: #F9F9F9;border-top:dashed 1px red"><!-- Cell -->
<div style="display:table-cell;width:160px;background-color: #F9F9F9;border-top:dashed 1px red"><!-- Cell -->
<p style="margin:0px"><code style="padding: 5px 10px;display:block"></code></p>
<p style="margin:0px"><code style="padding: 5px 10px;display:block">se:16/7</code></p>
</div>
</div>
</div><!-- name -->
</div><!-- name -->
Line 232: Line 232:
</div>
</div>
<div style="display:table-cell;width:380px;background-color: #F9F9F9;border-top:dashed 1px red"><!-- Cell -->
<div style="display:table-cell;width:380px;background-color: #F9F9F9;border-top:dashed 1px red"><!-- Cell -->
<p style="margin:0px"><code style="padding: 5px 10px;display:block">description...</code></p>
<p style="margin:0px"><code style="padding: 5px 10px;display:block">Sets the name for an item, (white space char is replaced with <i>[&]</i>), <b>default: none</b></code></p>
</div>
</div>
<div style="display:table-cell;width:160px;background-color: #F9F9F9;border-top:dashed 1px red"><!-- Cell -->
<div style="display:table-cell;width:160px;background-color: #F9F9F9;border-top:dashed 1px red"><!-- Cell -->
<p style="margin:0px"><code style="padding: 5px 10px;display:block"></code></p>
<p style="margin:0px"><code style="padding: 5px 10px;display:block">n:Item[&]Name</code></p>
</div>
</div>
</div><!-- Stack price -->
</div><!-- Stack price -->
<div style="display:table;width:100%">
<div style="display:table;width:100%">
<div style="display:table-cell;width:160px;background-color: #F9F9F9;border-top:dashed 1px red"><!-- Cell -->
<div style="display:table-cell;width:160px;background-color: #F9F9F9;border-top:dashed 1px red"><!-- Cell -->
<p style="margin:0px"><code style="padding: 5px 10px;display:block">Stack price</code></p>
<p style="margin:0px"><code style="padding: 5px 10px;display:block">Stack price flag</code></p>
</div>
</div>
<div style="display:table-cell;width:210px;background-color: #F9F9F9;border-top:dashed 1px red"><!-- Cell -->
<div style="display:table-cell;width:210px;background-color: #F9F9F9;border-top:dashed 1px red"><!-- Cell -->
Line 246: Line 246:
</div>
</div>
<div style="display:table-cell;width:380px;background-color: #F9F9F9;border-top:dashed 1px red"><!-- Cell -->
<div style="display:table-cell;width:380px;background-color: #F9F9F9;border-top:dashed 1px red"><!-- Cell -->
<p style="margin:0px"><code style="padding: 5px 10px;display:block">description...</code></p>
<p style="margin:0px"><code style="padding: 5px 10px;display:block">Sets a flag if the price should be set for the whole stack, when set, amounts will use only the first amount, <b>default: disabled</b></code></p>
</div>
</div>
<div style="display:table-cell;width:160px;background-color: #F9F9F9;border-top:dashed 1px red"><!-- Cell -->
<div style="display:table-cell;width:160px;background-color: #F9F9F9;border-top:dashed 1px red"><!-- Cell -->
<p style="margin:0px"><code style="padding: 5px 10px;display:block"></code></p>
<p style="margin:0px"><code style="padding: 5px 10px;display:block">sp</code></p>
</div>
</div>
</div>
</div>

Revision as of 16:22, 4 January 2013

Overview

Every pattern is saved in the patterns.yml file located in the plugin's main folder. (plugins/DtlCitizensTrader)
You can change the directory in the configuration file.


There are 3 types of patterns:

- Pricing patterns
Sets item prices and pricing tiers.

- Item patterns
Will add certain items to the trader's stock.

By using item patterns you can also set two items in the same slot and each can have a different function. An example of this can be found below.

- Market traders
A special pattern used by market traders. It has a different construction so care has to be taken to set it up properly.


Basics

An example of a basic pricing pattern:

default:

prices: all: multiplier: 1.0 35: 1.5 '35:2': 2.0 sell: 1: 0.33 2: 0.66 3: 0.99 buy: multiplier: 0.9 1: 0.33 2: 0.66 3: 0.99

In the all section you can set item price for both buying and selling. To change the item's value depending on the transaction type you can use the sell and buy sections.

The multiplier is used to quickly change prices. By using this setting you can adjust prices on the server scale just by setting a single number. You could for example lower the value of any offered item by setting multiplier to 0.9 - every price would then be reduced by 10%. When no multiplier is set the value defaults to 1.0.

Multipliers set in the sell or buy sections have higher priority than those set in the all section. In the above example 0.9 set in the buy block overrides 1.0 set in the all section.

When dealing with blocks that use additional data value such as colored wool keep in mind that you can, for example, set the price of any wool by using 35: <price>. Changing that line to '35:0': <price> would only apply to white wool. Moreover if you set the general price for wool (35: <price1>) and then assign a different price to the white wool ('35:0': <price2>) then the more specific assignment has priority. In this case every wool block would cost <price1> with the exception of white wool which would be set to <price2>.

Tiers

Tiers allow you to define multiple patterns and apply them automatically depending on the user's permissions. Each tier can have a different multiplier and/or item prices. Tiers cannot be set for item patterns!

For example creating two tiers - tier1 with sell multiplier set to 0.9, and tier2 with sell multiplier set to 0.8 will have the following effect:


  • players without any permission would see all prices by default with default multipliers
  • players with the permission dtl.trader.tiers.tier1 will have overridden only those prices you got in tier 1
  • players with the permission dtl.trader.tiers.tier2 will have overridden only those prices you got in tier 2
  • players with both permissions will have overridden first all prices from tier 1 and the from tier 2
  • multipliers are always overridden, so when the default multiplier is set to 1.2 and non is set for a tier the multiplier will be set to 1.0 because it's default always for each tier/pattern


Tiers are defined after the pattern and have exactly the same structure.

default: prices: all: multiplier: 1.0 35: 1.5 '35:2': 2.0 sell: 1: 0.33 2: 0.66 3: 0.99 buy: multiplier: 0.9 1: 0.33 2: 0.66 3: 0.99 tier1: all: multiplier: 0.9 sell: 2: 0.11 buy: multiplier: 1.1

Item patterns

Item patterns are used to set up really fast and easily traders, they might be mixed with pricing patterns allowing to create a really nice system, also working now on setting multiple patterns to one trader, so you can set prices within one pattern and items for many traders within another :)

Item syntax

This sound horrible, I know, but it's best way to explain it in two words :D

Every item within a pattern is build up by some keywords and flags you may use, many options you can't achieve with a basic trader setup are here allowed, but you need to be carefully.

Keywords

Item setting

Keyword

Description

Example

Item amounts

a

Sets the amounts for that item, if specified more than one it will use the multiple items window, default: 1

a:1,2,4

Durability

d

Sets the items durability, default: 0

d:22

Price

p

Sets the price for the item, default: pattern price

p:12.22

Slot

s

Sets the slot for the item, default: first empty

s:22

Enchants

e

Sets enchantments for an item, default: none

e:16/3,17/30

Global limits

gl

Sets a global limit for that item, default: no limit

gl:0/30/3600

Player limits

pl

Sets a per player limit for that item, default: no limit

pl:0/30/3600

Stored enchants

se

Sets one one enchant for a enchanted book item, default: none

se:16/7

Name

n

Sets the name for an item, (white space char is replaced with [&]), default: none

n:Item[&]Name

Stack price flag

sp

Sets a flag if the price should be set for the whole stack, when set, amounts will use only the first amount, default: disabled

sp

More coming soon!


Navigation

DtlTraders
Configuration Commands | Permissions
Usage
Types