物品掉落模板表定义了从容器类物品(如宝箱、包裹、礼品盒等)中可以获得的物品及其概率。这个表是掉落系统的核心组成部分,控制着玩家打开各种容器时能够获得什么物品。
字段名 | 类型 | 描述 |
---|---|---|
Entry | mediumint unsigned | 容器物品ID |
详细说明:指定容器物品的ID,对应item_template表中的entry字段。只有设置了正确掉落ID的容器物品才会使用此表的掉落配置。
取值范围:1 - 16777215 (mediumint unsigned的范围) 常见容器类型:
注意:Entry必须对应item_template表中存在的容器类物品 |
||
Item | mediumint unsigned | 掉落物品ID |
详细说明:指定从容器中可以获得的物品ID,对应item_template表中的entry字段。
物品类型:
注意:Item和Reference字段互斥,只能设置其中一个 |
||
Reference | mediumint unsigned | 引用模板ID |
详细说明:引用其他掉落模板的ID。当设置此字段时,Item字段被忽略,系统会使用reference_loot_template表中对应ID的掉落配置。
使用场景:
|
||
Chance | float | 掉落概率 |
详细说明:指定物品的掉落概率,以百分比表示。
取值范围:0.0 - 100.0 概率设置建议:
|
||
QuestRequired | tinyint | 是否需要任务 |
详细说明:指定是否只有在接受特定任务时才能获得此物品。
取值:
|
||
LootMode | smallint unsigned | 掉落模式 |
详细说明:指定掉落的模式标志,用于控制在什么情况下此物品会掉落。
常用值:
|
||
GroupId | tinyint unsigned | 掉落组ID |
详细说明:将物品分组,同一组内的物品遵循特定的掉落规则。
分组用途:
|
||
MinCount | tinyint unsigned | 最小数量 |
详细说明:指定物品掉落的最小数量。
取值范围:1 - 255 |
||
MaxCount | tinyint unsigned | 最大数量 |
详细说明:指定物品掉落的最大数量。实际掉落数量在MinCount和MaxCount之间随机。
取值范围:1 - 255 注意:MaxCount必须大于等于MinCount |
||
Comment | varchar(255) | 备注说明 |
详细说明:可选的备注字段,用于记录这个掉落配置的说明或特殊注意事项。 |
-- 新手礼品包掉落 (假设物品ID为50001)
INSERT INTO item_loot_template (Entry, Item, Reference, Chance, QuestRequired, LootMode, GroupId, MinCount, MaxCount, Comment) VALUES
(50001, 2589, 0, 100.0, 0, 1, 0, 5, 10, '亚麻布 - 必掉'),
(50001, 117, 0, 80.0, 0, 1, 0, 2, 5, '干硬的面包 - 常掉'),
(50001, 6948, 0, 100.0, 0, 1, 0, 1, 1, '炉石 - 必掉'),
(50001, 25, 0, 30.0, 0, 1, 1, 1, 1, '破旧的短剑 - 稀有'),
(50001, 2362, 0, 20.0, 0, 1, 1, 1, 1, '破损的皮甲 - 稀有');
-- 高级宝箱掉落 (假设物品ID为50002)
INSERT INTO item_loot_template (Entry, Item, Reference, Chance, QuestRequired, LootMode, GroupId, MinCount, MaxCount, Comment) VALUES
(50002, 0, 11000, 100.0, 0, 1, 0, 1, 1, '引用高级装备掉落表'),
(50002, 0, 11001, 50.0, 0, 1, 0, 1, 1, '引用宝石掉落表'),
(50002, 6265, 0, 80.0, 0, 1, 0, 50, 200, '金币 - 大量'),
(50002, 13444, 0, 10.0, 0, 1, 0, 1, 1, '大型光亮碎片 - 稀有'),
(50002, 20725, 0, 1.0, 0, 1, 0, 1, 1, '水晶雕像 - 极稀有');
SELECT ilt.*, it.name as item_name, it.Quality
FROM item_loot_template ilt
LEFT JOIN item_template it ON ilt.Item = it.entry
WHERE ilt.Entry = 50001 -- 指定容器ID
ORDER BY ilt.Chance DESC;
SELECT ilt.Entry, ct.name as container_name, ilt.Chance
FROM item_loot_template ilt
JOIN item_template ct ON ilt.Entry = ct.entry
WHERE ilt.Item = 6948 -- 炉石
ORDER BY ilt.Chance DESC;
item_loot_template表经常与以下表格配合使用: