function I4700260_GiftBag(MapID, InstanceID, TypeID, TargetID) --玩家ID, 生成物品TypeID,数量,品质,生成模式,log用网络消息枚举 local r = math.random(1000000) local temp = 0 local index = 1 local tbl = {} tbl[1]={4902009, 1, -1, 20000} tbl[2]={4820109, 15, -1, 40000} tbl[3]={4820121, 1, -1, 20000} tbl[4]={4820121, 1, -1, 20000} tbl[5]={3010032, 1, -1, 20000} tbl[6]={3010029, 1, -1, 25000} tbl[7]={3010032, 1, -1, 50000} tbl[8]={3010029, 1, -1, 51000} tbl[9]={5802571, 1, -1, 13000} tbl[10]={5802582, 1, -1, 40000} tbl[11]={5802522, 1, -1, 35000} tbl[12]={5802426, 1, -1, 55000} tbl[13]={5802384, 1, -1, 55000} tbl[14]={5802286, 1, -1, 25000} tbl[15]={5802234, 1, -1, 25000} tbl[16]={5802511, 1, -1, 17000} tbl[17]={5802577, 1, -1, 17000} tbl[18]={5802379, 1, -1, 17000} tbl[19]={3051703, 1, -1, 17000} tbl[20]={3010032, 1, -1, 50000} tbl[21]={3010029, 1, -1, 40000} tbl[22]={3010028, 2, -1, 55000} tbl[23]={3070056, 30, -1, 55000} tbl[24]={3070056, 10, -1, 55000} tbl[25]={3010032, 1, -1, 40000} tbl[26]={3010029, 1, -1, 50000} tbl[27]={3010031, 1, -1, 45500} tbl[28]={3051635, 1, -1, 15500} tbl[29]={4820256, 1, -1, 10000} tbl[30]={3020012, 1, -1, 8000} tbl[31]={3020008, 1, -1, 5500} tbl[32]={4820179, 1, -1, 2000} tbl[33]={4820180, 1, -1, 1500} tbl[34]={4820252, 1, -1, 1000} tbl[35]={3070056, 10, -1, 1000} tbl[36]={3090035, 1, -1, 1000} tbl[37]={3090036, 1, -1, 1000} tbl[38]={4212008, 1, -1, 400} tbl[39]={4222104, 1, -1, 400} tbl[40]={3020092, 1, -1, 300} tbl[41]={3020091, 1, -1, 400} tbl[42]={3020035, 1, -1, 400} tbl[43]={3020047, 1, -1, 1} tbl[44]={3020042, 1, -1, 2} tbl[45]={3020037, 1, -1, 97} for i = 1,45 do temp = temp + tbl[i][4] if temp >= r then index = i break end end if index >= 29 then local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 100, 280) --开启了获得了 msg.AddMsgEvent(MsgID, 2, TargetID) msg.AddMsgEvent(MsgID, 4, TypeID) msg.AddMsgEvent(MsgID, 4, tbl[index][1]) msg.DispatchWorldMsgEvent(MsgID) end role.AddRoleItem(MapID, InstanceID, TargetID, tbl[index][1], tbl[index][2], tbl[index][3], 8, 420) end function I4700260_CanUseGiftBag(MapID, InstanceID, TypeID, TargetID) local bRet, bIgnore = 0, false --判断背包空闲空间是否足够 local FreeSize = role.GetBagFreeSize(TargetID) if(FreeSize < 1) then --提示玩家背包空间不足 bRet = 40 end return bRet, bIgnore end aux.RegisterItemEvent(4700260, 1, "I4700260_GiftBag") aux.RegisterItemEvent(4700260, 0, "I4700260_CanUseGiftBag") function I4810198_GiftBag(MapID, InstanceID, TypeID, TargetID) --玩家ID, 生成物品TypeID,数量,品质,生成模式,log用网络消息枚举 local r = math.random(3000) local temp = 0 local index = 1 local tbl = {} tbl[1]={5802227, 1, -1, 120} tbl[2]={5802226, 1, -1, 220} tbl[3]={5802225, 1, -1, 320} tbl[4]={5802224, 1, -1, 420} tbl[5]={5802162, 1, -1, 420} tbl[6]={5802165, 1, -1, 120} tbl[7]={5802164, 1, -1, 220} tbl[8]={5802163, 1, -1, 320} tbl[9]={5802162, 1, -1, 420} tbl[10]={5802224, 1, -1, 420} for i = 1,10 do temp = temp + tbl[i][4] if temp >= r then index = i break end end if index >= 1 then local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 100, 280) --开启了获得了 msg.AddMsgEvent(MsgID, 2, TargetID) msg.AddMsgEvent(MsgID, 4, TypeID) msg.AddMsgEvent(MsgID, 4, tbl[index][1]) msg.DispatchWorldMsgEvent(MsgID) end role.AddRoleItem(MapID, InstanceID, TargetID, tbl[index][1], tbl[index][2], tbl[index][3], 8, 420) end function I4810198_CanUseGiftBag(MapID, InstanceID, TypeID, TargetID) local bRet, bIgnore = 0, false --判断背包空闲空间是否足够 local FreeSize = role.GetBagFreeSize(TargetID) if(FreeSize < 1) then --提示玩家背包空间不足 bRet = 40 end return bRet, bIgnore end aux.RegisterItemEvent(4810198, 1, "I4810198_GiftBag") aux.RegisterItemEvent(4810198, 0, "I4810198_CanUseGiftBag") function I4810199_GiftBag(MapID, InstanceID, TypeID, TargetID) --玩家ID, 生成物品TypeID,数量,品质,生成模式,log用网络消息枚举 local r = math.random(5040) local temp = 0 local index = 1 local tbl = {} tbl[1]={7100155, 5, 6, 420} tbl[2]={7100156, 5, 6, 420} tbl[3]={7100157, 5, 6, 420} tbl[4]={7100158, 5, 6, 420} tbl[5]={7100159, 5, 6, 420} tbl[6]={7100152, 10, 6, 420} tbl[7]={7100155, 5, -1, 420} tbl[8]={7100156, 5, -1, 420} tbl[9]={7100157, 5, -1, 420} tbl[10]={7100158, 5, -1, 420} tbl[11]={7100159, 5, -1, 420} tbl[12]={7100152, 10, -1, 420} for i = 1,12 do temp = temp + tbl[i][4] if temp >= r then index = i break end end if index >= 1 then local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 100, 280) --开启了获得了 msg.AddMsgEvent(MsgID, 2, TargetID) msg.AddMsgEvent(MsgID, 4, TypeID) msg.AddMsgEvent(MsgID, 4, tbl[index][1]) msg.DispatchWorldMsgEvent(MsgID) end role.AddRoleItem(MapID, InstanceID, TargetID, tbl[index][1], tbl[index][2], tbl[index][3], 8, 420) end function I4810199_CanUseGiftBag(MapID, InstanceID, TypeID, TargetID) local bRet, bIgnore = 0, false --判断背包空闲空间是否足够 local FreeSize = role.GetBagFreeSize(TargetID) if(FreeSize < 1) then --提示玩家背包空间不足 bRet = 40 end return bRet, bIgnore end aux.RegisterItemEvent(4810199, 1, "I4810199_GiftBag") aux.RegisterItemEvent(4810199, 0, "I4810199_CanUseGiftBag") function I4810200_GiftBag(MapID, InstanceID, TypeID, TargetID) --玩家ID, 生成物品TypeID,数量,品质,生成模式,log用网络消息枚举 local r = math.random(5040) local temp = 0 local index = 1 local tbl = {} tbl[1]={5802223, 1, -1, 420} tbl[2]={5802222, 1, -1, 420} tbl[3]={5802221, 1, -1, 420} tbl[4]={5802220, 1, -1, 420} tbl[5]={5802219, 1, -1, 420} tbl[6]={5802218, 1, -1, 420} tbl[7]={5802161, 1, -1, 420} tbl[8]={5802160, 1, -1, 420} tbl[9]={5802159, 1, -1, 420} tbl[10]={5802158, 1, -1, 420} tbl[11]={5802157, 1, -1, 420} tbl[12]={5802156, 1, -1, 420} for i = 1,12 do temp = temp + tbl[i][4] if temp >= r then index = i break end end if index >= 1 then local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 100, 280) --开启了获得了 msg.AddMsgEvent(MsgID, 2, TargetID) msg.AddMsgEvent(MsgID, 4, TypeID) msg.AddMsgEvent(MsgID, 4, tbl[index][1]) msg.DispatchWorldMsgEvent(MsgID) end role.AddRoleItem(MapID, InstanceID, TargetID, tbl[index][1], tbl[index][2], tbl[index][3], 8, 420) end function I4810200_CanUseGiftBag(MapID, InstanceID, TypeID, TargetID) local bRet, bIgnore = 0, false --判断背包空闲空间是否足够 local FreeSize = role.GetBagFreeSize(TargetID) if(FreeSize < 1) then --提示玩家背包空间不足 bRet = 40 end return bRet, bIgnore end aux.RegisterItemEvent(4810200, 1, "I4810200_GiftBag") aux.RegisterItemEvent(4810200, 0, "I4810200_CanUseGiftBag") function I4810201_GiftBag(MapID, InstanceID, TypeID, TargetID) --玩家ID, 生成物品TypeID,数量,品质,生成模式,log用网络消息枚举 local r = math.random(3000) local temp = 0 local index = 1 local tbl = {} tbl[1]={5802141, 1, -1, 120} tbl[2]={5802140, 1, -1, 220} tbl[3]={5802139, 1, -1, 320} tbl[4]={5802138, 1, -1, 420} tbl[5]={5802137, 1, -1, 420} tbl[6]={5802141, 1, -1, 120} tbl[7]={5802140, 1, -1, 220} tbl[8]={5802139, 1, -1, 320} tbl[9]={5802138, 1, -1, 420} tbl[10]={5802137, 1, -1, 420} for i = 1,10 do temp = temp + tbl[i][4] if temp >= r then index = i break end end if index >= 1 then local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 100, 280) --开启了获得了 msg.AddMsgEvent(MsgID, 2, TargetID) msg.AddMsgEvent(MsgID, 4, TypeID) msg.AddMsgEvent(MsgID, 4, tbl[index][1]) msg.DispatchWorldMsgEvent(MsgID) end role.AddRoleItem(MapID, InstanceID, TargetID, tbl[index][1], tbl[index][2], tbl[index][3], 8, 420) end function I4810201_CanUseGiftBag(MapID, InstanceID, TypeID, TargetID) local bRet, bIgnore = 0, false --判断背包空闲空间是否足够 local FreeSize = role.GetBagFreeSize(TargetID) if(FreeSize < 1) then --提示玩家背包空间不足 bRet = 40 end return bRet, bIgnore end aux.RegisterItemEvent(4810201, 1, "I4810201_GiftBag") aux.RegisterItemEvent(4810201, 0, "I4810201_CanUseGiftBag") function I4810202_GiftBag(MapID, InstanceID, TypeID, TargetID) --玩家ID, 生成物品TypeID,数量,品质,生成模式,log用网络消息枚举 local r = math.random(4620) local temp = 0 local index = 1 local tbl = {} tbl[1]={4821004, 2, -1, 420} tbl[2]={5802606, 30, -1, 420} tbl[3]={5802607, 30, -1, 420} tbl[4]={3500208, 30, -1, 420} tbl[5]={4821002, 2, -1, 420} tbl[6]={4810109, 5, -1, 420} tbl[7]={3051616, 5, -1, 420} tbl[8]={6015217, 1, -1, 420} tbl[9]={6015219, 1, -1, 420} tbl[10]={6015221, 1, -1, 420} tbl[11]={6015223, 1, -1, 420} for i = 1,45 do temp = temp + tbl[i][4] if temp >= r then index = i break end end if index >= 1 then local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 100, 280) --开启了获得了 msg.AddMsgEvent(MsgID, 2, TargetID) msg.AddMsgEvent(MsgID, 4, TypeID) msg.AddMsgEvent(MsgID, 4, tbl[index][1]) msg.DispatchWorldMsgEvent(MsgID) end role.AddRoleItem(MapID, InstanceID, TargetID, tbl[index][1], tbl[index][2], tbl[index][3], 8, 420) end function I4810202_CanUseGiftBag(MapID, InstanceID, TypeID, TargetID) local bRet, bIgnore = 0, false --判断背包空闲空间是否足够 local FreeSize = role.GetBagFreeSize(TargetID) if(FreeSize < 1) then --提示玩家背包空间不足 bRet = 40 end return bRet, bIgnore end aux.RegisterItemEvent(4810202, 1, "I4810202_GiftBag") aux.RegisterItemEvent(4810202, 0, "I4810202_CanUseGiftBag") function I4810203_GiftBag(MapID, InstanceID, TypeID, TargetID) --玩家ID, 生成物品TypeID,数量,品质,生成模式,log用网络消息枚举 local r = math.random(6000) local temp = 0 local index = 1 local tbl = {} tbl[1]={5802160, 1, -1, 420} tbl[2]={9990008, 1, 6, 420} tbl[3]={9990007, 1, 6, 420} tbl[4]={9990005, 1, 6, 420} tbl[5]={9990017, 1, 6, 420} tbl[6]={7100149, 1, -1, 420} tbl[7]={7100145, 1, -1, 420} tbl[8]={5000054, 1, -1, 420} tbl[9]={6601795, 1, -1, 420} tbl[10]={3070018, 1, -1, 460} tbl[11]={4810109, 5, -1, 420} tbl[12]={3500208, 50, -1, 420} tbl[13]={3100272, 1, 6, 80} tbl[14]={3100274, 5, -1, 420} tbl[15]={6601792, 1, -1, 420} for i = 1,45 do temp = temp + tbl[i][4] if temp >= r then index = i break end end if index >= 1 then local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 100, 280) --开启了获得了 msg.AddMsgEvent(MsgID, 2, TargetID) msg.AddMsgEvent(MsgID, 4, TypeID) msg.AddMsgEvent(MsgID, 4, tbl[index][1]) msg.DispatchWorldMsgEvent(MsgID) end role.AddRoleItem(MapID, InstanceID, TargetID, tbl[index][1], tbl[index][2], tbl[index][3], 8, 420) end function I4810203_CanUseGiftBag(MapID, InstanceID, TypeID, TargetID) local bRet, bIgnore = 0, false --判断背包空闲空间是否足够 local FreeSize = role.GetBagFreeSize(TargetID) if(FreeSize < 1) then --提示玩家背包空间不足 bRet = 40 end return bRet, bIgnore end aux.RegisterItemEvent(4810203, 1, "I4810203_GiftBag") aux.RegisterItemEvent(4810203, 0, "I4810203_CanUseGiftBag") function I4810205_GiftBag(MapID, InstanceID, TypeID, TargetID) --玩家ID, 生成物品TypeID,数量,品质,生成模式,log用网络消息枚举 local r = math.random(3360) local temp = 0 local index = 1 local tbl = {} tbl[1]={2610021,5,-1,840} tbl[2]={2610024,5,-1,840} tbl[3]={2610025,5,-1,840} tbl[4]={2610026,5,-1,840} for i = 1,45 do temp = temp + tbl[i][4] if temp >= r then index = i break end end if index >= 1 then local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 100, 280) --开启了获得了 msg.AddMsgEvent(MsgID, 2, TargetID) msg.AddMsgEvent(MsgID, 4, TypeID) msg.AddMsgEvent(MsgID, 4, tbl[index][1]) msg.DispatchWorldMsgEvent(MsgID) end role.AddRoleItem(MapID, InstanceID, TargetID, tbl[index][1], tbl[index][2], tbl[index][3], 8, 420) end function I4810205_CanUseGiftBag(MapID, InstanceID, TypeID, TargetID) local bRet, bIgnore = 0, false --判断背包空闲空间是否足够 local FreeSize = role.GetBagFreeSize(TargetID) if(FreeSize < 1) then --提示玩家背包空间不足 bRet = 40 end return bRet, bIgnore end aux.RegisterItemEvent(4810205, 1, "I4810205_GiftBag") aux.RegisterItemEvent(4810205, 0, "I4810205_CanUseGiftBag") function I3010152_GiftBag(MapID, InstanceID, TypeID, TargetID) --玩家ID, 生成物品TypeID,数量,品质,生成模式,log用网络消息枚举 local r = math.random(4200) local temp = 0 local index = 1 local tbl = {} tbl[1]={8170149,1,6,840} tbl[2]={8170149,1,6,840} tbl[3]={8170149,1,6,840} tbl[4]={8170149,1,6,840} tbl[5]={8170149,1,6,840} for i = 1,45 do temp = temp + tbl[i][4] if temp >= r then index = i break end end if index >= 1 then local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 100, 280) --开启了获得了 msg.AddMsgEvent(MsgID, 2, TargetID) msg.AddMsgEvent(MsgID, 4, TypeID) msg.AddMsgEvent(MsgID, 4, tbl[index][1]) msg.DispatchWorldMsgEvent(MsgID) end role.AddRoleItem(MapID, InstanceID, TargetID, tbl[index][1], tbl[index][2], tbl[index][3], 8, 420) end function I3010152_CanUseGiftBag(MapID, InstanceID, TypeID, TargetID) local bRet, bIgnore = 0, false --判断背包空闲空间是否足够 local FreeSize = role.GetBagFreeSize(TargetID) if(FreeSize < 1) then --提示玩家背包空间不足 bRet = 40 end return bRet, bIgnore end aux.RegisterItemEvent(3010152, 1, "I3010152_GiftBag") aux.RegisterItemEvent(3010152, 0, "I3010152_CanUseGiftBag") function I4900002_GiftBag(MapID, InstanceID, TypeID, TargetID) --玩家ID, 生成物品TypeID,数量,品质,生成模式,log用网络消息枚举 local r = math.random(10080) local temp = 0 local index = 1 local tbl = {} tbl[1]={6303206,5,-1,840} tbl[2]={6303207,5,-1,840} tbl[3]={6303208,5,-1,840} tbl[4]={6303209,5,-1,840} tbl[5]={6303210,1,-1,840} tbl[6]={3010153,1,-1,840} tbl[7]={6303206,10,-1,840} tbl[8]={6303207,10,-1,840} tbl[9]={6303208,10,-1,840} tbl[10]={6303209,10,-1,840} tbl[11]={6303210,2,-1,840} tbl[12]={3010153,2,-1,840} for i = 1,45 do temp = temp + tbl[i][4] if temp >= r then index = i break end end if index >= 1 then local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 100, 280) --开启了获得了 msg.AddMsgEvent(MsgID, 2, TargetID) msg.AddMsgEvent(MsgID, 4, TypeID) msg.AddMsgEvent(MsgID, 4, tbl[index][1]) msg.DispatchWorldMsgEvent(MsgID) end role.AddRoleItem(MapID, InstanceID, TargetID, tbl[index][1], tbl[index][2], tbl[index][3], 8, 420) end function I4900002_CanUseGiftBag(MapID, InstanceID, TypeID, TargetID) local bRet, bIgnore = 0, false --判断背包空闲空间是否足够 local FreeSize = role.GetBagFreeSize(TargetID) if(FreeSize < 1) then --提示玩家背包空间不足 bRet = 40 end return bRet, bIgnore end aux.RegisterItemEvent(4900002, 1, "I4900002_GiftBag") aux.RegisterItemEvent(4900002, 0, "I4900002_CanUseGiftBag")