zxl
/
CTT
forked from Cal/CTT
1
0
Fork 0
CTT/Server/Hotfix/Game/Common/Bag/AddSpecialGoodsEffect.cs

42 lines
1.2 KiB
C#

using Cal.DataTable;
using System;
using System.Collections.Generic;
using System.Data;
using System.Text;
namespace ET
{
public class AddSpecialGoodsEffect : GoodsEffect
{
public override string Init(Unit unit, GoodsBase goodsBase,bool isLock =false)
{
base.unit = unit;
GoodsBase = goodsBase;
return Run();
}
private string Run()
{
NumericComponent num = unit.GetComponent<NumericComponent>();
{
for (int i = 0; i < GoodsBase.GoodsArr.Length; i++)
{
GoodsBase.Goods goods = GoodsBase.GoodsArr[i];
if (goods.Goods_Id == 0) continue;
if (MathHelper.IsHit(goods.Goods_Probability))
{
int count = goods.Goods_Count;
if (count == 0)
count = 250;//RandomHelper.RandomNumber(1, 501);
BagHelper.AddItem(unit, goods.Goods_Id, count, true);
}
}
return string.Empty;
}
}
public override async ETVoid Execute()
{
await ETTask.CompletedTask;
}
}
}