Companion Attributes
I. Prerequisite Configuration
Attributes are provided by an external attribute plugin. First select the attribute type in config.yml:
buffType: "attribute_plus"Supported types:
attribute_plussx_attributeAttributeSystemMythicLibSagaLoreStats
Attribute names may differ between attribute plugins; use the attribute names supported by the corresponding plugin.
II. Fixed Attributes
Configure attribute under the companion node in companions.yml:
companions:
reaper:
attribute:
- "Physical Attack: ${level * 1}"
- "Max Health: ${level * 2}"Notes:
attributeis the fixed attribute list.${level}is the companion's current level.${discountRate}is the attribute discount variable.- One attribute per line, in the format
attribute name: value.
Example:
attribute:
- "Physical Attack: ${level * 2 * discountRate}"The global discount is configured in the main config.yml:
discountRate: 1When isAllBuff: false, only the currently used companion provides attributes; when set to true, the fixed attributes, random attributes and bound equipment attributes of all owned instances are aggregated, but a companion still needs to be selected first.
The currently used instance's discount is always 1, while other instances are calculated using their own discountRate, and the formula must use that variable. In 3.0.0, this defaults to 1 when not configured; to read the main config value, set discountRate: "" in that companion node.
III. Random Attributes
Configure randomAttribute under the companion node in companions.yml:
companions:
reaper:
randomAttribute:
- "Physical Attack: ${10~50}"
- "Magic Attack: ${5~30}"Notes:
randomAttributeis the random attribute pool.- When a companion is obtained, the quality is rolled first, then the number of attributes is drawn according to the quality.
- The rolled result is saved to the companion instance and is not re-rolled every time the GUI is opened.
- Range values are rolled only once;
levelanddiscountRatein the formula are preserved and evaluated with the current level and discount when attributes are calculated. - If the attribute pool is too small, all attributes in the current pool are taken.
Random ranges support two formats:
randomAttribute:
- "Physical Attack: 10~50"
- "Magic Attack: ${5~30 * discountRate}"IV. Random Attribute Quality
Qualities and the number of attributes drawn per quality are configured under quality in the main config.yml:
quality:
normal:
amount: 1
weight: 45
advanced:
amount: 2
weight: 18
rare:
amount: 3
weight: 18
rarer:
amount: 4
weight: 9
epic:
amount: 5
weight: 9
mythical:
amount: 6
weight: 1amount: how many random attributes this quality draws.weight: the weight for rolling this quality; the higher the value, the more likely it is.- Quality names can be added or modified freely, but existing quality identifiers and their language mappings should be kept when upgrading.
- Quality refinement in the management screen re-rolls the quality and random attributes, requiring the
companions.upgrade.refineQualitypermission; the button and cost are configured underquality.enableandquality.priceingui/upgrade.yml.
Quality display names are configured under quality in languages/zh_CN.yml:
quality:
normal: "&fNormal"
advanced: "&9Advanced"
rare: "&5Rare"
rarer: "&dRarer"
epic: "&6Epic"
mythical: "Mythical"V. Attribute Name Display
The actual attribute name is recognized by the attribute plugin. To change only the display name in the GUI, configure attributeNames in languages/zh_CN.yml:
attributeNames:
attack_damage: "Attack Damage"This only changes the display text, not the actual attribute name in effect.
VI. Displaying Attributes in the GUI
Use variables in the companion's GUI.shop or GUI.open description:
GUI:
shop:
description:
- "&6Fixed Attributes"
- "&7${attribute}"
- "&6Random Attribute Range"
- "&7${randomAttribute}"
open:
description:
- "&7Level: ${level}"
- "&7Quality: ${quality}"
- "&7Attributes: ${attribute}"
- "&7Random Attributes: ${randomAttribute}"Supported variables:
${attribute}: fixed attributes.${randomAttribute}: random attributes; the shop shows the attribute range, while the warehouse shows the rolled result.${level}: companion level.${quality}: companion quality.
VII. MythicLib Format
When using MythicLib, fill in the attribute ID from MMOItems/Language/stats.yml:
attribute:
- "MAX_HEALTH: 5"Attribute names are case-insensitive; refer to the MythicLib configuration for the available names.