You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
718 B
21 lines
718 B
namespace ET |
|
{ |
|
public static class DropOperate |
|
{ |
|
public static (int, int) DropItem(Unit unit, int dropId) |
|
{ |
|
DropGroupConfig dropConfig = DropGroupConfigCategory.Instance.Get(dropId); |
|
|
|
int index = 0; |
|
if (dropConfig.ItemId.Length > 1) |
|
{ |
|
index = RandomHelper.RandomByWeight(dropConfig.Weight); |
|
} |
|
|
|
//掉落数量 |
|
int dropAmount = RandomHelper.RandomNumber(dropConfig.DropAmount[index * 2], dropConfig.DropAmount[index * 2 + 1]); |
|
StoreOperate.AddItem(unit, dropConfig.ItemId[index], dropAmount); |
|
return (dropConfig.ItemId[index], dropAmount); |
|
} |
|
} |
|
} |