MMOItems - Advanced Systems - Historical

Applied By Indyuce: Nov 27, 2018 at 11:05 PM

MMOItems - Advanced Systems


Elements
You can bind elements to your weapons to make them deal extra damage.
The system is pretty simple and relies on two operations:

  • Elemental damage defines the percentage of the weapon damage that is dealt as elemental.
  • Elemental defense decreases the elemental damage dealt by a weapon to an armor set.
    • Example: a player attacks another player with a 10% Fire Damage - 15% Ice Damage - 10 Attack Damage sword. The target has a 40% Fire Defense chestplate.
    • Since the sword has 10% Fire Damage, 10% of the weapon damage will be dealt as Fire Damage, which represents 1 damage (10% x 10 = 1).
    • Since the target has 40% Fire Defense given by that chestplate, 40% of the Fire Damage will be negated, which represents 0.4 damage (40% x 1 = 0.4).
    • Since the target does not have Ice Defense, the totality of the Ice Damage will be dealt.
    • It means the final amount of damage is 10 - 0.4 = 9.6.
  • Any elemental defense stat can only decrease the damage dealt by its own element (Fire Defense decreases Fire Damage, Ice Defense decreases Ice Damage).



Item Identification
Blocks or monsters may sometimes drop unidentified items. These items have their data completely hidden and will require the player to identify it in order to be used. The only actual data players can see on unidentified items is the item type.

Players can identify their items by drag & dropping a certain consumable onto their item. They should hear a level up sound and should be sent a chat message saying their item was successfully identified.

Only consumables with the 'Can Identify' item option toggled on can identify other items. Admins can also use /mi identify which identifies the item they are holding. Similarly, /mi unidentify unidentifies the item they are holding.

[​IMG]



Item Deconstruction
Items that have a tier (common, rare, legendary...) can be deconstructed.
Deconstructing an item transforms the item into another item, usually a material players can then use at the advanced workbench to craft other items.
The item players get from deconstructing another item entirely depends on the initial item tier.

Players can deconstruct an item by drag & dropping a specific consumable onto their item.They should hear a level up sound and should be sent a chat message saying their item was successfully deconstructed.

Only consumables with the 'Can Deconstruct' item option toggled on can deconstruct items.

By default, tiers are Trash, Common, Uncommon, Rare, Very Rare, Legendary, Mythical, Epic, Magical and Unique. You can edit the tiers in the tiers.yml config file located in the main plugin folder. You can change the tier name and the deconstructed item drop table. This drop table behaves exactly like a monster/block drop table, so please refer to this wiki page to know how to setup them.

Code (Text):
# 'name' is used to display the tier in the item lore.
#
# 'deconstruct-item' is the drop table for the item
# that drops when deconstructing an item.
#
# Tier IDs (TRASH,COMMON...) are case sensitive.

TRASH:
    name: '&8Trash'
    deconstruct-item: {}

COMMON:
    name: '&7Common'
    deconstruct-item: {}
UNCOMMON:
    name: '&8Uncommon'
    deconstruct-item:
        sucess:
            coef: 1
            items:
                MATERIAL:
                    UNCOMMON_WEAPON_ESSENCE: 100,1-1,0
        lose:
            coef: 2
            items:
                MATERIAL:
                    WEAPON_POWDER: 100,1-1,0
RARE:
    name: '&6Rare'
    deconstruct-item:
        sucess:
            coef: 1
            items:
                MATERIAL:
                    RARE_WEAPON_ESSENCE: 100,1-1,0
        lose:
            coef: 3
            items:
                MATERIAL:
                    WEAPON_POWDER: 100,1-1,0
VERY_RARE:
    name: '&eVery Rare'
    deconstruct-item:
        sucess:
            coef: 1
            items:
                MATERIAL:
                    VERY_RARE_WEAPON_ESSENCE: 100,1-1,0
        lose:
            coef: 3
            items:
                MATERIAL:
                    WEAPON_POWDER: 100,1-1,0
LEGENDARY:
    name: '&bLegendary'
    deconstruct-item:
        sucess:
            coef: 1
            items:
                MATERIAL:
                    LEGENDARY_WEAPON_ESSENCE: 100,1-1,0
        lose:
            coef: 4
            items:
                MATERIAL:
                    WEAPON_POWDER: 100,1-1,0
MYTHICAL:
    name: '&5Mythical'
    deconstruct-item:
        sucess:
            coef: 1
            items:
                MATERIAL:
                    MYTHICAL_WEAPON_ESSENCE: 100,1-1,0
        lose:
            coef: 5
            items:
                MATERIAL:
                    WEAPON_POWDER: 100,1-1,0
EPIC:
    name: '&4Epic'
    deconstruct-item:
        sucess:
            coef: 1
            items:
                MATERIAL:
                    EPIC_WEAPON_ESSENCE: 100,1-1,0
        lose:
            coef: 6
            items:
                MATERIAL:
                    WEAPON_POWDER: 100,1-1,0

MAGICAL:
    name: '&2Magical'
    deconstruct-item:
        sucess:
            coef: 1
            items:
                MATERIAL:
                    MAGICAL_WEAPON_ESSENCE: 100,1-1,0
        lose:
            coef: 3
            items:
                MATERIAL:
                    WEAPON_POWDER: 100,1-1,0
UNIQUE:
    name: '&cUnique'
    deconstruct-item:
        sucess:
            coef: 1
            items:
                MATERIAL:
                    UNIQUE_WEAPON_ESSENCE: 100,1-1,0
        lose:
            coef: 9
            items:
                MATERIAL:
                    WEAPON_POWDER: 100,1-1,0

As seen on the GIF, deconstructing an item can actually give different drops from time to time which means that you can have, for instance, items harder to get than other items when deconstructing a tiered item.
[​IMG]


Gem Stones
You can create gem stones using the GEM_STONE item type. Gem stones are special items that you can drag & drop onto other items to give them extra stats. The item you're applying the gem on has to have at least one empty gem socket. Item restrictions (perms/class/level) apply on gem stone application like a regular item.

Moreover you can set restricted item types to a gem stone in order to define on what types of items your gem can be bound onto. You can configurate your gem to only work on armor, weapons, specific item types or even specific item sets (slashing/piercing/blunt/extra/offhand).

Gems have a chance to success. If they are not successfully applied onto the item, the gem stone will be lost and the item will have no extra stat. The gem socket will not be used either.
[​IMG]

Custom Durability
Custom durability is a really powerful system that allows you to create items with a set amount of uses unlike the vanilla durability system which forces you to always have the same amount of uses for a type of item, unless you use the Unbreaking enchant which may just look unclean.
All items can have a Max Durability stat, which defines how many times the item can be used before either breaking or becoming unusable. The Will Break item option defines whether or not the item will break when it is finally out of uses.

Since that durability system is not based on the vanilla MC durability system, it allows you to create both items with different amount of uses and items with custom textures which are not unbreakable.
If you make your item unbreakable using the corresponding item option, the custom durability system will still work - the Unbreakable item option only impacts the vanilla durability system.

The items do not directly display how many uses they have left. You have two ways of knowing how damaged your item is. Either by checking the item lore which will display the item durability state, or by using PlaceholderAPI to get the item's durability as a durability 'progress bar' as a simpler numeric value.

  • Via Placeholders
    • %mmoitems_durability% returns the amount of uses left of the item the player is holding.
    • %mmoitems_durability_max% returns the item max durability.
      papi parse @p &7Current Durability: &6&l%mmoitems_durability%&7/&6&l%mmoitems_durability_max%

      [​IMG]
    • %mmoitems_durability_ratio% returns the item's durability ratio (from 0% to 100%).[​IMG]
    • %mmoitems_durability_bar_square% returns the item durability as a progress bar.[​IMG]
    • %mmoitems_durability_bar_diamond% returns the durability bar, but the char used is a diamond.[​IMG]
    • %mmoitems_durability_bar_thin% returns a much thiner durability bar.[​IMG]

  • Via Durability States
Durability states are displayed in the item lore. As the item gets more and more damaged, the durability state displayed in the item lore will change and indicate a worse and worse state.
The item is not used at all.

[​IMG]

The item gets slightly used...

[​IMG]

Durability states can be edited in the use-states.yml config file. You can edit their 'use ratios' and their 'lore tag'. e.g
Code (Text):
NOT_VERY_USED:
    use-ratio:
        max: 90
        min: 80
    lore-tag: '&eNot Very Used'
This means that any item which still has between 80% and 90% of its durability (so any item which has lost 10% to 20% of its uses) will be in that durability state. Moreover, the item will display Not Very Used in its lore.