位于背包中的"开启/关闭"物品(例如雕像、护符):玩家右键点击开启(ON),再次右键点击关闭(OFF)。开启期间,角色显示 buff 图标(BuffIndex),并获得 <Option> 中声明的属性加成。无需在 BuffTemplate.xml 中声明。
要求
- 已购买
PluginPlus,且Data\Plugin\Plugin.ini中有PluginPlus = 1(见 PluginPlus)。 Data\Plugin\UseInventoryItem.xml中Enabled="1"。- 物品必须存在于
Data\Item\ItemList.xml(不存在则该行被忽略并记录错误日志),并且存在于客户端的物品列表中且KindB = 47(背包物品),否则客户端不允许右键点击。 - 客户端使用新版
Main.dll(提示框由服务器发送,无需修改客户端的提示文件)。
工作方式
- 多个不同种类的物品可以同时开启,最多
MaxConcurrentUse个。超出上限:提示 Lang ID 0,且物品不会开启。 - 同一物品编号(Cat/Index)只能开启一个;开启第二个时提示 Lang ID 1。
- 物品开启时 buff 是永久的,关闭时(或物品离开背包时)被移除。
- 同一个 buff ID 在角色身上只会生效一次:
- 正在穿着的时装(
Data\Plugin\Fashion\Fashion.xml中的BuffIndex)优先,其次是按背包格子顺序开启的物品。buff ID 已被占用的物品仍保持 ON 状态,但不提供 buff,也不增加属性。 - 如果角色已经从其他来源获得相同 ID 的 buff(例如药水 / 卷轴的限时 buff),则在该 buff 结束之前,物品不提供 buff 和属性;之后永久 buff 和属性才会生效。
- 正在穿着的时装(
BuffIndex="0":没有 buff 图标,只增加属性。多个物品共用同一BuffIndex时,按上述规则互相争夺。- 已开启的物品也被视为固定选项系统的"装备",见 固定选项(ItemOptionSystem_Exc)。
配置
文件:Data\Plugin\UseInventoryItem.xml。根元素 <UseItemSystem>:
| 键 | 值 | 默认值 | 含义 |
|---|---|---|---|
Enabled | 0 / 1 | 0(缺少时) | 关闭 / 开启系统。 |
MaxConcurrentUse | 整数 >= 1 | 1 | 可同时开启的不同种类物品数量。小于 1 的值会被改为 1。 |
ErrorMessage, ErrorMessage2 | 字符串 | - | 不使用。实际内容取自 Lang UseInventoryItem ID 0 和 1。 |
子元素 <Item>:
| 键 | 值 | 默认值 | 含义 |
|---|---|---|---|
Cat | 整数 | 0 | 物品组。 |
Index | 整数 | 0 | 物品在组内的序号。 |
BuffIndex | 整数 >= 0 | 0 | 开启时显示在角色身上的 buff ID(依据客户端的 buff 列表);0 = 无图标。 |
每个 <Item> 最多有 8 行 <Option>(第 9 行起被忽略):
| 键 | 值 | 默认值 | 含义 |
|---|---|---|---|
Type | 1 - 23(见下表) | 0 | 属性类型。1-23 以外的值(包括 24)会被忽略并记录错误日志。 |
Value | 整数 | 0 | 增加的数值。 |
Name | 字符串 | - | 仅作注释,永远不会被读取。 |
Type 表(与时装 Fashion.xml 共用;提示框中的文字取自 Lang 的 Fashion 段 ID 20-42):
| Type | 名称 | 作用 | Type | 名称 | 作用 |
|---|---|---|---|---|---|
| 1 | HP | 最大 HP +Value | 13 | AttackSpeed | 普通 + 魔法攻击速度 +Value |
| 2 | MP | 最大 MP +Value | 14 | CriticalRate | 致命伤害几率 +Value % |
| 3 | SD | 最大 SD +Value | 15 | ExcellentRate | 完美伤害几率 +Value % |
| 4 | AG | 最大 AG +Value | 16 | DoubleDamageRate | 双倍伤害几率 +Value % |
| 5 | STR | 力量 +Value | 17 | IgnoreDefenseRate | 无视防御几率 +Value % |
| 6 | AGI | 敏捷 +Value | 18 | DamageReduction | 伤害减免 +Value % |
| 7 | VIT | 体力 +Value | 19 | ElementalDamage | 元素伤害(min + max)+Value |
| 8 | ENE | 智力 +Value | 20 | ElementalDefense | 元素防御 +Value |
| 9 | CMD | 统率 +Value | 21 | SkillDamage | 技能伤害 +Value |
| 10 | Damage | 物理伤害(min + max)+Value | 22 | CriticalDamage | 致命伤害 +Value |
| 11 | MagicDamage | 魔法伤害 + 诅咒 +Value | 23 | ExcellentDamage | 完美伤害 +Value |
| 12 | Defense | 防御 +Value |
示例
<UseItemSystem Enabled="1" MaxConcurrentUse="1" ErrorMessage="..." ErrorMessage2="...">
<Item Cat="19" Index="190" BuffIndex="122">
<Option Type="14" Name="CriticalRate" Value="10" />
</Item>
<Item Cat="19" Index="194" BuffIndex="122">
<Option Type="10" Name="Damage" Value="100" />
<Option Type="11" Name="MagicDamage" Value="100" />
</Item>
</UseItemSystem>
上例中两个物品共用
BuffIndex="122":如果同时开启两个(需要 MaxConcurrentUse >= 2),在背包中位置靠后的物品仍为 ON,但不提供 buff,也不提供属性。建议为每个物品分配各自独立的 BuffIndex。提示信息和提示框(Lang)
| 段 / ID | 内容(英文版) | 何时出现 |
|---|---|---|
UseInventoryItem 0 | Max allowed to use at the same time: %d | 达到 MaxConcurrentUse 上限。 |
UseInventoryItem 1 | You already have this item active | 已开启同一编号的物品。 |
UseInventoryItem 2 | Right click in the inventory to use / stop using | 提示框的最后一行(灰色)。 |
Fashion 20-42 | 各选项行的名称(例如 Max HP +%d) | 提示框中的各属性行(浅蓝色)。 |
重新加载
点击 GameServer 控制面板上的 Reload plugin:服务器重新加载文件,并向正在游戏的玩家重新发送提示框。每次进入游戏时,服务器也会重新发送该列表。