公会增益
公会用 公会资金 升级增益,所有在线成员都会得到效果。增益写在 plugins/CloudGuild/buffs.yml,玩家用 /cg buff 或主页的「公会增益」查看与升级。
增益只使用原版的药水效果与原版属性,不需要 AttributePlus、MythicLib 之类的属性插件。
写法
buffs:
speed:
name: '&b迅捷'
icon: SUGAR
type: potion
effect: speed
min-level: 2
costs: [20000, 80000]
lore: ['&7所有在線成員獲得 迅捷 {level}']
strength:
name: '&6攻擊強化'
icon: IRON_SWORD
type: attribute
attribute: attack_damage
amount: 0.05
operation: multiply
min-level: 5
costs: [100000, 300000, 800000]
lore: ['&7攻擊傷害 +{percent}%']
| 键 | 默认 | 说明 |
|---|---|---|
增益 id(例如 speed) | — | 增益代号,用在 /cg buff <id>、levels.<等级>.buffs 与 /cg admin buff |
name | id | 显示名称 |
icon | POTION | 菜单里的图示材质 |
type | potion | potion 药水效果 / attribute 原版属性 |
effect | id | type: potion 时的药水效果名称:speed、haste、strength、resistance、luck、regeneration、night_vision……(原版 ID) |
attribute | max_health | type: attribute 时的属性:max_health、attack_damage、movement_speed、armor、luck……(写不写 generic. 都可以) |
amount | 1 | type: attribute 时每级增加的数值 |
operation | add | add 加数值 / multiply 乘倍数(0.05 = 每级 +5%) |
min-level | 1 | 公会至少几级才能升级这个增益 |
costs | — | 升到第 1、2、3……级的公会资金。列表长度 = 最高等级;没有 costs 的增益会被跳过 |
lore | 无 | 说明,显示在菜单的 {buff_lore};可用 {level} 等级、{value} 数值(amount × 等级)、{percent} 百分比(amount × 等级 × 100) |
药水效果等级 1 = 效果 I。属性增益在玩家身上的数值是 amount × 等级。
升级
/cg buff <增益id>
需要 buff 职位权限,或在增益菜单点一下。每次升一级,「目前等级没变 + 资金够」与扣款在同一个数据库操作里,两个人同时点也只会升一级、扣一次钱。
公会等级赠送的增益
config.yml 的 levels.<等级>.buffs 可以让某个公会等级免费得到增益(默认 4 级起送「幸运」):
levels:
4: {members: 25, …, buffs: {luck: 1}}
- 实际等级 = 购买的等级与赠送的等级取较高者。赠送的等级可以超过
costs的长度。 - 赠送的等级不算进购买进度:例如 4 级公会免费有幸运 1,想用资金升级幸运时,还是从第 1 级开始付费,买到第 2 级才会比赠送的高。
默认增益
| id | 名称 | 类型 | 效果 | 最低公会等级 | 每级花费 |
|---|---|---|---|---|---|
speed | 迅捷 | 药水 speed | 迅捷 I / II | 2 | 20000、80000 |
haste | 挖掘加速 | 药水 haste | 急迫 I / II | 2 | 20000、80000 |
luck | 幸運 | 药水 luck | 幸运 I ~ IV | 3 | 30000、90000、200000、500000 |
health | 生命強化 |