|
|
@@ -1,17 +1,16 @@
|
|
|
# 生成随机品质的物品
|
|
|
|
|
|
-# 品质 = d100
|
|
|
-scoreboard players set $random_min mem 1
|
|
|
-scoreboard players set $random_max mem 100
|
|
|
-function lib:random
|
|
|
-scoreboard players operation #quality mem = $random mem
|
|
|
+# 品质:生成一个 1~10 的 randomarray,每次从其中取下一个数
|
|
|
+execute unless data storage ltw:mini qualities[0] run function item:bonus_item/newarray
|
|
|
+execute store result score #quality mem run data get storage ltw:mini qualities[0]
|
|
|
+data remove storage ltw:mini qualities[0]
|
|
|
|
|
|
# 根据品质生成不同的物品
|
|
|
# 白色:40%
|
|
|
-execute if score #quality mem matches ..39 run function item:bonus_item/gameparty/mixed/white
|
|
|
+execute if score #quality mem matches ..4 run function item:bonus_item/gameparty/mixed/white
|
|
|
# 绿色:30%
|
|
|
-execute if score #quality mem matches 40..69 run function item:bonus_item/gameparty/mixed/green
|
|
|
+execute if score #quality mem matches 5..7 run function item:bonus_item/gameparty/mixed/green
|
|
|
# 蓝色:20%
|
|
|
-execute if score #quality mem matches 70..89 run function item:bonus_item/gameparty/mixed/blue
|
|
|
+execute if score #quality mem matches 8..9 run function item:bonus_item/gameparty/mixed/blue
|
|
|
# 紫色:10%
|
|
|
-execute if score #quality mem matches 90.. run function item:bonus_item/gameparty/mixed/purple
|
|
|
+execute if score #quality mem matches 10.. run function item:bonus_item/gameparty/mixed/purple
|