Skip to content

Commit

Permalink
EcoShop + Consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
Exanthiax committed Mar 14, 2024
1 parent 4327e83 commit 4993948
Show file tree
Hide file tree
Showing 14 changed files with 448 additions and 113 deletions.
2 changes: 1 addition & 1 deletion docs/boosters/how-to-make-a-custom-booster.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ Check out [Configuring an Effect](https://plugins.auxilor.io/effects/configuring

For more advanced users or setups, you can configure chains in this section to string together different effects under one trigger. Check out [Configuring an Effect Chain](https://plugins.auxilor.io/effects/configuring-a-chain) for more info.

### Internal Placeholders
## Internal Placeholders

| Placeholder | Value |
| ----------- | ---------------------------------------- |
Expand Down
8 changes: 7 additions & 1 deletion docs/ecoarmor/how-to-make-a-custom-set.md
Original file line number Diff line number Diff line change
Expand Up @@ -437,4 +437,10 @@ The effects section is the core functionality of the Armor Set. You can configur

Check out [Configuring an Effect](https://plugins.auxilor.io/effects/configuring-an-effect) to understand how to configure this section correctly.

For more advanced users or setups, you can configure chains in this section to string together different effects under one trigger. Check out [Configuring an Effect Chain](https://plugins.auxilor.io/effects/configuring-a-chain) for more info.
For more advanced users or setups, you can configure chains in this section to string together different effects under one trigger. Check out [Configuring an Effect Chain](https://plugins.auxilor.io/effects/configuring-a-chain) for more info.

## Internal Placeholders

| Placeholder | Value |
| ----------- | -------------------------- |
| `%tier%` | The tier of the armor set. |
2 changes: 1 addition & 1 deletion docs/ecoenchants/how-to-make-a-custom-enchant.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ Check out [Configuring an Effect](https://plugins.auxilor.io/effects/configuring
For more advanced users or setups, you can configure chains in this section to string together different effects under one trigger. Check out [Configuring an Effect Chain](https://plugins.auxilor.io/effects/configuring-a-chain) for more info.
### Internal Placeholders
## Internal Placeholders
| Placeholder | Value |
| ----------- | ----------------------------------------------------------------------------------------------------------------------- |
Expand Down
2 changes: 1 addition & 1 deletion docs/ecojobs/how-to-make-a-custom-job.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ Check out [Configuring an Effect](https://plugins.auxilor.io/effects/configuring
For more advanced users or setups, you can configure chains in this section to string together different effects under one trigger. Check out [Configuring an Effect Chain](https://plugins.auxilor.io/effects/configuring-a-chain) for more info.
### Internal Placeholders
## Internal Placeholders
| Placeholder | Value |
| ----------- | ----------------------------------------------------------- |
Expand Down
10 changes: 8 additions & 2 deletions docs/ecopets/how-to-make-a-custom-pet.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,17 @@ xp-requirements:
### Spawn Egg

**enabled:** If the skill should show in /pets.

**icon:** The item to show in /pets, read here for more: [Item Lookup System](https://plugins.auxilor.io/all-plugins/the-item-lookup-system).

**name:** The name of the spawn egg in-game.

**lore:** The lore to show in /pets when hovering the icon.

**craftable:** If the item should be craftable (true/false).
**recipe:** The recipe, read here for more info: [Crafting Recipes](https://plugins.auxilor.io/all-plugins/the-item-lookup-system#crafting-recipes)

**recipe:** The recipe, read here for more info: [Crafting Recipes](https://plugins.auxilor.io/all-plugins/the-item-lookup-system#crafting-recipes).

**recipe-permission:** (Optional) The permission required to craft the recipe.

### Effects & Conditions
Expand All @@ -165,7 +171,7 @@ Check out [Configuring an Effect](https://plugins.auxilor.io/effects/configuring

For more advanced users or setups, you can configure chains in this section to string together different effects under one trigger. Check out [Configuring an Effect Chain](https://plugins.auxilor.io/effects/configuring-a-chain) for more info.

### Internal Placeholders
## Internal Placeholders

| Placeholder | Value |
| ----------- | ----------------------------------------------------------- |
Expand Down
2 changes: 1 addition & 1 deletion docs/ecoquests/how-to-make-a-quest.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ tasks:

**item:** The item to show in /quests, read here for more: [Item Lookup System](https://plugins.auxilor.io/all-plugins/the-item-lookup-system)

### Effects
### Effects & Conditions

The quest rewards uses the effects system. You can configure effects, conditions, filters, and mutators in this section to run when the quest is started or as rewards.

Expand Down
4 changes: 2 additions & 2 deletions docs/ecoquests/how-to-make-a-task.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@ on-complete:
**on-complete:** Effects to be run when the task is completed (Supports triggered effects). See [Configuring an Effect](https://plugins.auxilor.io/effects/configuring-an-effect)
### Effects
### Effects & Conditions
The task rewards uses the effects system. You can configure effects, conditions, filters, and mutators in this section to run when the quest is started or as rewards.
Check out [Configuring an Effect](https://plugins.auxilor.io/effects/configuring-an-effect) to understand how to configure this section correctly.
For more advanced users or setups, you can configure chains in this section to string together different effects under one trigger. Check out [Configuring an Effect Chain](https://plugins.auxilor.io/effects/configuring-a-chain) for more info.
### Internal Placeholders
## Internal Placeholders
| Placeholder | Value |
| --------------- | ---------------------------------------------- |
Expand Down
13 changes: 13 additions & 0 deletions docs/ecoshop/ecoshop-effects/filters/shop_item.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# `shop_item`

Require a certain shop item

**Requires EcoShop**

# Example Config
```yaml
filters:
shop_item:
- iron_rank
- gold_rank
```
6 changes: 6 additions & 0 deletions docs/ecoshop/ecoshop-effects/triggers/triggers.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# EcoShop Triggers

| ID | Description | Value Provided |
| ----------- | ------------------------------------------------------------- | -------------- |
| `buy_item` | Triggered when buying an item in a shop **Requires EcoShop** | The price |
| `sell_item` | Triggered when selling an item in a shop **Requires EcoShop** | The price |
110 changes: 95 additions & 15 deletions docs/ecoshop/how-to-make-a-category.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,108 @@ title: "How to make a category"
sidebar_position: 3
---

## What's a category?
## Categories

Categories are how shops are organized. Items are sold / bought in categories, they're
the actual 'shop' part. In the example config, you will have seen how shops can either
be a portal to a bunch of categories, or alternatively just directly link to a category.
Categories are how shops are organised. Items are sold / bought in categories, they're the actual 'shop' part. In the [[how-to-make-a-shop|How to make a Shop]] section, you will have seen how shops can either be a portal to a bunch of categories, or alternatively just directly link to a category.

## Default config
The default configs can be found [here](https://github.com/Auxilor/EcoShop/blob/main/eco-core/core-plugin/src/main/resources/categories).

The default configs can be found here:
## How to add shops
Each category is its own config file, placed in the `/categories/` folder, and you can add or remove them as you please. There's an example config called `_example.yml` to help you out!

[GitHub](https://github.com/Auxilor/EcoShop/blob/master/eco-core/core-plugin/src/main/resources/categories/)
The ID of the category is the file name. This is what you use in commands, effects and placeholders.
ID's must be lowercase letters, numbers, and underscores only.

## How to add categories
One category can be in as many shops as you want! EcoShop is smart, it knows what shop you opened the category from, so any sounds / broadcasts from the shop you came from will work even if 2 shops share the same category.

This works just the same as adding or removing shops. Just make or remove .yml files in
the `/categories/` directory, and then reference them in the shop you want them to be in.
## Example Category Config

One category can be in as many shops as you want! EcoShop is smart, it knows what shop
you opened the category from, so any sounds / broadcasts from the shop you came from
will work even if 2 shops share the same category.
```yaml
item: diamond_sword name:"&fExample Category" # The item shown in the shop.
lore: [ ] # The lore of the item shown in the shop.
# permission: ecoshop.category.permission1 # (Optional) The permission required to access/use the category.

## Example Category Config
# Options for the category GUI.
gui:
rows: 6 # The amount of rows to have (1-6).
title: "Demo Category" # The title of the GUI.

# Navigation options, hidden if on the first/last page.
forwards-arrow:
item: arrow name:"&fNext Page"
row: 6
column: 6
backwards-arrow:
item: arrow name:"&fPrevious Page"
row: 6
column: 4

# Add as many pages as you want by appending to this list
pages:
- page: 1
mask:
items: # The background material
- gray_stained_glass_pane
- black_stained_glass_pane
pattern: # 0 for empty, 1 for the first item, 2 for the second item, etc
- "222222222"
- "211111112"
- "211111112"
- "211111112"
- "211111112"
- "222222222"

# Custom GUI slots; see here for a how-to: https://plugins.auxilor.io/all-plugins/custom-gui-slots
custom-slots: [ ]

items:
- id: iron_rank
commands: # The commands to execute. You can use %player% and %amount% as placeholders.q
- lp user %player% parent set iron
buy:
value: "%ecomc_iron_price%"
type: crystals
display: "&b%value% Crystals ❖"
limit: 1 # (Optional) The max amount of times each player can buy this item, defaults to infinite.
gui:
display: # This item is shown in the GUI. If you're selling an item, this defaults to the item itself.
item: diamond_chestplate
lore:
- "&fBuy &7&lIRON&r&f rank to get"
- "&fthe following benefits:"
- " &8»&f &eExample Perk"
column: 5 # The column.
row: 3 # The row.
page: 2 # The page.
```
## Understanding all the sections
### Basic Options
**item:** The item that is displayed in your shop GUI, read here for more info: [Item Lookup System](https://plugins.auxilor.io/all-plugins/the-item-lookup-system). Use `name:<name>` to set a custom name for the category.

**lore:** The lore/description to be shown in your shop GUI.

**permission:** (Optional) The permission required to open this category.

### GUI

**rows:** The amount of rows the category GUI will have (1-6).

**title:** The name shown at the top of the GUI.

**forwards/backwards-arrow:** The item and location of the navigation arrows.

##### Pages

To configure a pattern and mask, read here for more info:

**custom-slots:** Any non-shop items for the GUI (eg. info items), read here for more info: [[custom-gui-slots|Custom GUI Slots]].

### Items

This section is where you put any items that you are buying and/or selling in this category.

EcoShop comes with an example category config that explains everything,
[read it here](https://github.com/Auxilor/EcoShop/blob/main/eco-core/core-plugin/src/main/resources/categories/_example.yml)
Read here for more info on creating your shop items: [[how-to-make-an-item|How to make an Item]].
130 changes: 121 additions & 9 deletions docs/ecoshop/how-to-make-a-shop.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,132 @@
title: "How to make a shop"
sidebar_position: 2
---
## Shops
Creating shops is easy if you follow the the basic rules: A shop requires [[how-to-make-a-category|categories]], and categories require [[how-to-make-an-item|items]].

## Default config

The default configs can be found here:

[GitHub](https://github.com/Auxilor/EcoShop/blob/master/eco-core/core-plugin/src/main/resources/shops/)
The default configs can be found [here](https://github.com/Auxilor/EcoShop/blob/main/eco-core/core-plugin/src/main/resources/shops).

## How to add shops
Each shop is its own config file, placed in the `/shops/` folder, and you can add or remove them as you please. There's an example config called `_example.yml` to help you out!

EcoShop lets you make as many shops as you want, and you make each one by making a new
.yml file in the `/shops/` directory. Simply add and remove configs as you want to add and
remove shops.
The ID of the shop is the file name. This is what you use in commands, effects and placeholders.
ID's must be lowercase letters, numbers, and underscores only.

## Example Shop Config

EcoShop comes with an example shop config that explains everything,
[read it here](https://github.com/Auxilor/EcoShop/blob/main/eco-core/core-plugin/src/main/resources/shops/_example.yml)
```yaml
title: Demo Shop # The GUI title.
command: demoshop # The command to open the shop.

forwards-arrow: # The arrow for switching between pages. If on the last page, this will not show up.
item: arrow name:"&fNext Page"
row: 6
column: 6

backwards-arrow: # The arrow for switching between pages. If on the first page, this will not show up.
item: arrow name:"&fPrevious Page"
row: 6
column: 4

buy-broadcasts: # Options for buy broadcasts
enabled: true # If purchases in this shop should be broadcast to the server, good for /buy menus.
message: "&b&lCrystal Shop&r &8»&r %player%&r&f has bought &r%item%&r&ffrom the &bCrystal Shop ❖&f!" # Use %player%, %item%, and %amount%
sound: # Broadcast sound, remove this section if you don't want a sound.
sound: ui_toast_challenge_complete
pitch: 1.5
volume: 2

click-sound: # A sound to be played when clicking an icon in this shop, remove this section if you don't want a sound.
sound: block_stone_button_click_on # The sound https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Sound.html
pitch: 1 # The pitch (0.5 - 2)
volume: 1

buy-sound: # A sound to be played when buying something in this shop, remove this section if you don't want a sound.
sound: entity_player_levelup
pitch: 2
volume: 1

sell-sound: # A sound to be played when selling something in this shop, remove this section if you don't want a sound.
sound: block_amethyst_block_place
pitch: 1.5
volume: 1

# Shops can work in two ways.

# You can either have a shop contain a list of categories, or you can make a shop be one
# category that you're instantly sent to (for single page shops, e.g. a boss spawn egg shop)

# If you want a single-page shop, use direct-category to link it straight to a category
# direct-category: example_category

# If you want a regular shop that contains multiple categories, use these options here
rows: 3
pages: # All the pages in the preview GUI. You can add as many pages as you want.
- page: 1
mask: # Filler items for decoration
items: # Add as many items as you want
- gray_stained_glass_pane # Item 1
- black_stained_glass_pane # Item 2
pattern:
- "222222222"
- "211111112"
- "211000112"
- "211000112"
- "211111112"
- "222222222"
categories: # Where to put categories in the GUI
- id: example # The category ID
row: 3 # The row
column: 3 # The column
- id: example_2
row: 4
column: 6

# Custom GUI slots; see here for a how-to: https://plugins.auxilor.io/all-plugins/custom-gui-slots
custom-slots: [ ]
```
## Understanding all the sections
**title:** The name shown at the top of the GUI.
**forwards/backwards-arrow:** The item and location of the navigation arrows.
#### Buy Broadcasts
**enabled:** If a broadcast should be sent when a player buys from this shop.
**message:** The broadcast message to be sent
**sound:** (Optional) The sound to play when an item is bought.
#### Sounds (Optional)
**click-sound:** The sound to play when buttons in this shop are pressed.
**buy-sound:** The sound to play when an item is bought from this shop.
**sell-sound:** The sound to play when an item is sold from this shop.
*You can find all the sounds here: [Sounds](https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Sound.html)*
### Configuring Categories
There are two methods to add [[how-to-make-a-category|categories]], first is a direct and second is a list.
#### Direct Category
**direct-category:** The ID of the category, this will open the category directly instead of the shop GUI - for single page shops.
#### List of Categories
**rows:** How many rows are in the shop GUI.
##### Pages
To configure a pattern and mask, read here for more info:
##### Categories
**id:** The ID of the category (eg. `example.yml` has an ID of `example`)

**row/column:** The location of this category in the shop
Loading

0 comments on commit 4993948

Please sign in to comment.