nwPlugin | NN
  • Introduction
    • Community & Support
  • My Plugins
    • nwMMOUpgrade
      • English
        • Config & Command
        • Feature
          • Upgrade
          • Add Socket
          • Repair
      • Chinese
        • 配置與指令
        • 功能介紹
          • 升級
          • 增加插槽
          • 修復
    • nwFurnitureShow
      • English
        • Supported Plugins
        • Config & Command
        • Feature
          • Preview
          • Search
          • Price
          • Dye (HMCColor Integration)
Powered by GitBook
On this page
  • Upgrade
  • How Upgrading Works
  • Features
  1. My Plugins
  2. nwMMOUpgrade
  3. English
  4. Feature

Upgrade

PreviousFeatureNextAdd Socket

Last updated 2 days ago

Upgrade

The Upgrade feature allows you to enhance your items, making them significantly more effective by improving their stats. You have full control to customize the upgrade mechanics, including success rates, material requirements, and stat increases, through the plugin's configuration file to perfectly suit your server's design.

How Upgrading Works

For an item to be eligible for an upgrade using nwMMOUpgrade, it must first be assigned an Upgrade-Template. This template dictates the specific upgrade path and potential stat progressions for that particular item.

The plugin will reference the stats and upgrade rules defined within the Upgrade-Template that the item possesses. If an item does not have an Upgrade-Template applied to it, it cannot be processed by the upgrade system.


Features

1. Material Item

Define the material items used for upgrading, and specify their quantities.

materials:
  upgrade: #this
    type: MATERIAL # Item type (MATERIAL, MMOITEM)
    id: STEEL_INGOT # Item ID
    amount: 1
  protection:
    type: MATERIAL
    id: SILVER_INGOT
    amount: 1

2. Protection Item

Define protection items that prevent upgrade failure (optional for upgrades). Specify their quantities.

materials:
  upgrade:
    type: MATERIAL # Item type (MATERIAL, MMOITEM)
    id: STEEL_INGOT # Item ID
    amount: 1
  protection: #this
    type: MATERIAL
    id: SILVER_INGOT
    amount: 1

3. Success Item

Success items increase the chance of successful upgrades (you can define more than one item).

# Success rate boost settings
success:
  enabled: true # Enable/disable success rate boost system
  stones:
    - type: MATERIAL # Item type (MATERIAL, MMOITEM)
      id: RARE_DIAMOND # Item ID
      bonus: 5 # Success rate bonus (percentage)
    - type: MATERIAL
      id: GEM
      bonus: 50

4. Upgrade Case

Upgrade operations are divided into two types:

4.1 Decay-Level-Upgrade

This mode reduces the success chance as the item's level increases. You can customize settings such as the base success chance, minimum success chance, and the percentage reduction in success chance per level.

decay-level-upgrade:
  enabled: true # Enable/disable decay success rates per item level
  keep-level-on-failure: true # Enable/disable keeping item level on failure
  base-success: 35.0 # Base success rate
  decay-per-level: 5.0 # Success rate decay per item level
  min-success: 10.0 # Minimum success rate
  min-downgrade-level:
      enabled: False
      amount: 1

4.2 Custom-Level-Upgrade

This mode allows you to dynamically define the success chance for each item level. You can set a custom success chance for every individual level.

custom-level-upgrade:
    enabled: false # Enable/disable custom success rates per item level
    allow-downgrade: false # Enable/disable item level downgrade on failure
    min-downgrade-level: 1 # Minimum downgrade level
    rates:
      1: 100 # Success rate at level 1
      2: 95 # Success rate at level 2
      "3-20": 25 # Success rate at levels 3 to 20

5. Custom Formula

The Custom Formula feature provides a highly flexible way to dynamically calculate the cost and material requirements for item upgrades, allowing them to scale with the item's level.

Cost & Material Increase

When this feature is enabled (enabled: true), both the monetary cost (if cost-level is also enabled) and the quantity of material items required for an upgrade will increase as the item's level rises. This ensures that higher-level upgrades demand a greater investment from players, providing a more balanced progression.

The increase is determined by a custom formula you define, giving you precise control over the scaling.

In Short:

  • Level Up = Higher Cost & Material Requirements.

Formula Configuration

The core of this feature lies in the formula field, where you can define a mathematical expression.

  • Syntax: You can use standard mathematical operators: + (addition), - (subtraction), * (multiplication), and / (division).

  • Placeholders: The formula supports specific placeholders that will be replaced with dynamic values during calculation:

    • {chance}: Represents the base success chance (as defined elsewhere in your configuration).

    • {material}: Represents the base quantity of material items required (as defined elsewhere).

    • {level}: Represents the current level of the item being upgraded.

custom-formula:
  enabled: true
  formula: "{level} * {material} + 1"
  cost-level: false

6. Random Stat Upgrade

When an upgrade is successful, a random stat from the item's template will be upgraded, rather than all stats present in the template.

random-stat:
  enabled: false # Enable/disable
  amount: 1 #Amount Stat

7. Destroy Item When Fail

If an item upgrade fails, the item will be replaced with a predefined material. Important: If a Protection Item is used, the item will not be destroyed upon failure.

destroy-item-when-fail:
  enabled: false
  item-return:
    type: MATERIAL # Item type (MATERIAL, MMOITEM)
    id: STEEL_INGOT # Item ID
    amount: 1

8. Action When Success

When an upgrade is successful, you can define actions to be performed based on the item's level.

#placeholder {player_name} / {player} / {player_uuid} / {level} / {item_name}
#syntax [sound], [broadcast], [message], [console], [player]
action-when-success:
  enabled: false
  level:
    1:
      - '[sound] BLOCK_ANVIL_USE'
      - '[broadcast] &7{player} กำลังทำให้ &f{item_name}&7 แข็งแกร่งขึ้น!'
      - '[message] &bพลังของ {item_name} เพิ่มขึ้นอีกระดับ! &e{level}'
    2-15:
      - '[sound] ENTITY_DRAGON_FIREBALL_EXPLODE'
      - '[console] execute console command "crate givekey %player_name% epic_upgrade_key 1"' # ตัวอย่างการให้ crate key
      - '[message] &6{player} ได้ปลดปล่อยพลังอันยิ่งใหญ่ของ &a{item_name}&6!'

9. Cost Upgrade

This feature allows you to use Vault (Money) for each Upgrade addition.

cost-upgrade:
    enabled: false #Cost
    amount: 5000

10. Applies To

You can specify more than one MMOItem type that this configuration applies to.

applies-to:
  - SWORD
  - PICKAXE
Upgrade GUI