function I3110001_GiftBag(MapID, InstanceID, TypeID, TargetID) --??ID, ????TypeID,??,??,????,log??????? local r = math.random(7980) local temp = 0 local index = 1 local tbl = {} tbl[1] = {3010043,1,6,420} tbl[2] = {3010044,1,6,420} tbl[3] = {3010045,1,6,420} tbl[4] = {3010046,1,6,420} tbl[5] = {3010047,1,6,420} tbl[6] = {3010048,1,6,420} tbl[7] = {3010050,1,6,420} tbl[8] = {3010050,1,6,420} tbl[9] = {3010036,1,6,420} tbl[10] = {4500027,1,6,420} tbl[11] = {4500027,2,6,420} tbl[12] = {5700004,5,6,420} tbl[13] = {3010036,1,6,420} tbl[14] = {3010036,1,6,420} tbl[15] = {3010032,1,6,420} tbl[16] = {3010042,1,6,420} tbl[17] = {5700004,10,6,420} tbl[18] = {5700004,10,6,420} tbl[19] = {5700004,10,6,420} for i = 1,#tbl do temp = temp + tbl[i][4] if temp >= r then index = i break end end role.AddRoleItem(MapID, InstanceID, TargetID, tbl[index][1], tbl[index][2], tbl[index][3], 8, 35) end function I3110001_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(3110001, 1, "I3110001_GiftBag") function I3110002_GiftBag(MapID, InstanceID, TypeID, TargetID) --??ID, ????TypeID,??,??,????,log??????? local r = math.random(7980) local temp = 0 local index = 1 local tbl = {} tbl[1] = {3010043,1,6,420} tbl[2] = {3010044,1,6,420} tbl[3] = {3010045,1,6,420} tbl[4] = {3010046,1,6,420} tbl[5] = {3010047,1,6,420} tbl[6] = {3010048,1,6,420} tbl[7] = {3010050,1,6,420} tbl[8] = {3010050,1,6,420} tbl[9] = {3010051,1,6,420} tbl[10] = {4500027,2,6,420} tbl[11] = {3070018,10,6,420} tbl[12] = {3010036,1,6,420} tbl[13] = {4500027,2,6,420} tbl[14] = {3070018,2,6,420} tbl[15] = {3010032,1,6,420} tbl[16] = {3010042,1,6,420} tbl[17] = {5700004,10,6,420} tbl[18] = {5700004,5,6,420} tbl[19] = {5700004,10,6,420} for i = 1,#tbl do temp = temp + tbl[i][4] if temp >= r then index = i break end end role.AddRoleItem(MapID, InstanceID, TargetID, tbl[index][1], tbl[index][2], tbl[index][3], 8, 35) end function I3110002_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(3110002, 1, "I3110002_GiftBag") function I3110003_GiftBag(MapID, InstanceID, TypeID, TargetID) --??ID, ????TypeID,??,??,????,log??????? local r = math.random(7980) local temp = 0 local index = 1 local tbl = {} tbl[1] = {3010043,1,6,420} tbl[2] = {3010044,1,6,420} tbl[3] = {3010045,1,6,420} tbl[4] = {3010046,1,6,420} tbl[5] = {3010036,2,6,420} tbl[6] = {3010048,1,6,420} tbl[7] = {3010050,1,6,420} tbl[8] = {3010050,1,6,420} tbl[9] = {3010051,1,6,420} tbl[10] = {4500027,3,6,420} tbl[11] = {3070018,10,6,420} tbl[12] = {4500027,3,6,420} tbl[13] = {3070018,10,6,420} tbl[14] = {3010029,1,6,420} tbl[15] = {3010032,1,6,420} tbl[16] = {3010042,1,6,420} tbl[17] = {5700004,10,6,420} tbl[18] = {5700004,10,6,420} tbl[19] = {5700004,10,6,420} for i = 1,#tbl do temp = temp + tbl[i][4] if temp >= r then index = i break end end role.AddRoleItem(MapID, InstanceID, TargetID, tbl[index][1], tbl[index][2], tbl[index][3], 8, 35) end function I3110003_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(3110003, 1, "I3110003_GiftBag") function I3110004_GiftBag(MapID, InstanceID, TypeID, TargetID) --??ID, ????TypeID,??,??,????,log??????? local r = math.random(7980) local temp = 0 local index = 1 local tbl = {} tbl[1] = {3010043,1,6,420} tbl[2] = {3010044,1,6,420} tbl[3] = {3010045,1,6,420} tbl[4] = {3010036,3,6,420} tbl[5] = {3010047,1,6,420} tbl[6] = {3010048,1,6,420} tbl[7] = {3010050,1,6,420} tbl[8] = {3010050,1,6,420} tbl[9] = {3010051,1,6,420} tbl[10] = {3070018,10,6,420} tbl[11] = {4500027,4,6,420} tbl[12] = {3010029,1,6,420} tbl[13] = {4500027,4,6,420} tbl[14] = {3070018,10,6,420} tbl[15] = {3010032,1,6,420} tbl[16] = {3010042,1,6,420} tbl[17] = {5700004,10,6,420} tbl[18] = {5700004,10,6,420} tbl[19] = {5700004,10,6,420} for i = 1,#tbl do temp = temp + tbl[i][4] if temp >= r then index = i break end end role.AddRoleItem(MapID, InstanceID, TargetID, tbl[index][1], tbl[index][2], tbl[index][3], 8, 35) end function I3110004_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(3110004, 1, "I3110004_GiftBag") function I6601766_GiftBag(MapID, InstanceID, TypeID, TargetID) --??ID, ????TypeID,??,??,????,log??????? local r = math.random(5040) local temp = 0 local index = 1 local tbl = {} tbl[1] = {9990009,1,6,420} tbl[2] = {8099119,1,6,420} tbl[3] = {8099125,1,6,420} tbl[4] = {8099089,1,6,420} tbl[5] = {5802157,1,6,420} tbl[6] = {5802157,1,6,420} tbl[7] = {5802157,1,6,420} tbl[8] = {5802164,1,6,420} tbl[9] = {5802165,1,6,420} tbl[10] = {4810093,1,6,420} tbl[11] = {3070019,50,6,420} tbl[12] = {4810120,3,6,420} tbl[13] = {3500208,30,6,420} for i = 1,#tbl do temp = temp + tbl[i][4] if temp >= r then index = i break end end role.AddRoleItem(MapID, InstanceID, TargetID, tbl[index][1], tbl[index][2], tbl[index][3], 8, 35) end function I6601766_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(6601766, 1, "I6601766_GiftBag") function I5300053_GiftBag(MapID, InstanceID, TypeID, TargetID) --??ID, ????TypeID,??,??,????,log??????? local r = math.random(5040) local temp = 0 local index = 1 local tbl = {} tbl[1] = {6601029,1,6,420} tbl[2] = {6601038,1,6,420} tbl[3] = {6601047,1,6,420} tbl[4] = {6601056,1,6,420} tbl[5] = {6601057,1,6,420} tbl[6] = {6601058,1,6,420} tbl[7] = {6601059,1,6,420} tbl[8] = {6601060,1,6,420} tbl[9] = {6601061,1,6,420} tbl[10] = {6601062,1,6,420} tbl[11] = {6601087,1,6,420} tbl[12] = {6601088,1,6,420} tbl[13] = {6601085,1,6,420} tbl[14] = {6601086,1,6,420} for i = 1,#tbl do temp = temp + tbl[i][4] if temp >= r then index = i break end end role.AddRoleItem(MapID, InstanceID, TargetID, tbl[index][1], tbl[index][2], tbl[index][3], 8, 35) end function I5300053_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(5300053, 1, "I5300053_GiftBag") function I6600429_GiftBag(MapID, InstanceID, TypeID, TargetID) --??ID, ????TypeID,??,??,????,log??????? local r = math.random(5040) local temp = 0 local index = 1 local tbl = {} tbl[1] = {5802153,1,6,420} tbl[2] = {5802151,1,6,420} tbl[3] = {5802152,1,6,420} tbl[4] = {5802129,1,6,420} tbl[5] = {5802130,1,6,420} tbl[6] = {5802128,1,6,420} tbl[7] = {5802349,1,6,420} tbl[8] = {5802464,1,6,420} tbl[9] = {5802169,1,6,420} tbl[10] = {5802155,1,6,420} tbl[11] = {3030576,1,6,420} tbl[12] = {3030427,1,6,420} for i = 1,#tbl do temp = temp + tbl[i][12] if temp >= r then index = i break end end role.AddRoleItem(MapID, InstanceID, TargetID, tbl[index][1], tbl[index][2], tbl[index][3], 8, 35) end function I6600429_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(6600429, 1, "I6600429_GiftBag") function I5300059_GiftBag(MapID, InstanceID, TypeID, TargetID) --??ID, ????TypeID,??,??,????,log??????? local r = math.random(5040) local temp = 0 local index = 1 local tbl = {} tbl[1] = {6601069,1,6,420} tbl[2] = {6601070,1,6,420} tbl[3] = {6601071,1,6,420} tbl[4] = {6601072,1,6,420} tbl[5] = {6601073,1,6,420} tbl[6] = {6601074,1,6,420} tbl[7] = {6601075,1,6,420} tbl[8] = {6601076,1,6,420} tbl[9] = {6601077,1,6,420} tbl[10] = {6601078,1,6,420} tbl[11] = {6601079,1,6,420} tbl[12] = {6601080,1,6,420} tbl[13] = {6601081,1,6,420} tbl[14] = {6601082,1,6,420} tbl[15] = {6601083,1,6,420} tbl[16] = {6601084,1,6,420} for i = 1,#tbl do temp = temp + tbl[i][4] if temp >= r then index = i break end end role.AddRoleItem(MapID, InstanceID, TargetID, tbl[index][1], tbl[index][2], tbl[index][3], 8, 35) end function I5300059_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(5300059, 1, "I5300059_GiftBag") function I5200064_GiftBag(MapID, InstanceID, TypeID, TargetID) --??ID, ????TypeID,??,??,????,log??????? local r = math.random(4780) local temp = 0 local index = 1 local tbl = {} tbl[1] = {5802136,1,6,420} tbl[2] = {5802137,1,6,320} tbl[3] = {5802138,1,6,220} tbl[4] = {5802145,1,6,420} tbl[5] = {5802219,1,6,420} tbl[6] = {5802220,1,6,420} tbl[7] = {5802221,1,6,320} tbl[8] = {5802222,1,6,220} tbl[9] = {5802156,1,6,420} tbl[10] = {5802157,1,6,420} tbl[11] = {5802158,1,6,320} tbl[12] = {5802159,1,6,220} tbl[13] = {5802160,1,6,220} tbl[14] = {5802145,1,6,420} tbl[15] = {5802145,1,6,420} for i = 1,#tbl do temp = temp + tbl[i][4] if temp >= r then index = i break end end role.AddRoleItem(MapID, InstanceID, TargetID, tbl[index][1], tbl[index][2], tbl[index][3], 8, 35) end function I5200064_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(5200064, 1, "I5200064_GiftBag") function I6602201_GiftBag(MapID, InstanceID, TypeID, TargetID) --??ID, ????TypeID,??,??,????,log??????? local r = math.random(36) local temp = 0 local index = 1 local tbl = {} tbl[1] = {6601056,1,6,1} tbl[2] = {6601047,1,6,1} tbl[3] = {6601029,1,6,1} tbl[4] = {6601038,1,6,1} tbl[5] = {6601057,1,6,1} tbl[6] = {6601058,1,6,1} tbl[7] = {6601059,1,6,1} tbl[8] = {6601060,1,6,1} tbl[9] = {6601061,1,6,1} tbl[10] = {6601062,1,6,1} tbl[11] = {6601063,1,6,1} tbl[12] = {6601064,1,6,1} tbl[13] = {6601065,1,6,1} tbl[14] = {6601066,1,6,1} tbl[15] = {6601067,1,6,1} tbl[16] = {6601068,1,6,1} tbl[17] = {6601069,1,6,1} tbl[18] = {6601070,1,6,1} tbl[19] = {6601071,1,6,1} tbl[20] = {6601072,1,6,1} tbl[21] = {6601073,1,6,1} tbl[22] = {6601074,1,6,1} tbl[23] = {6601075,1,6,1} tbl[24] = {6601076,1,6,1} tbl[25] = {6601077,1,6,1} tbl[26] = {6601078,1,6,1} tbl[27] = {6601079,1,6,1} tbl[28] = {6601080,1,6,1} tbl[29] = {6601081,1,6,1} tbl[30] = {6601082,1,6,1} tbl[31] = {6601083,1,6,1} tbl[32] = {6601084,1,6,1} tbl[33] = {6601085,1,6,1} tbl[34] = {6601086,1,6,1} tbl[35] = {6601087,1,6,1} tbl[36] = {6601088,1,6,1} for i = 1,36 do temp = temp + tbl[i][4] if temp >= r then index = i break end end role.AddRoleItem(MapID, InstanceID, TargetID, tbl[index][1], tbl[index][2], tbl[index][3], 8, 420) end function I6602201_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(6602201, 1, "I6602201_GiftBag") function I3110011_GiftBag(MapID, InstanceID, TypeID, TargetID) --??ID, ????TypeID,??,??,????,log??????? local r = math.random(3780) local temp = 0 local index = 1 local tbl = {} tbl[1] = {3050021,5,6,420} tbl[2] = {3050023,5,6,420} tbl[3] = {3050001,30,6,420} tbl[4] = {3050003,15,6,420} tbl[5] = {3050028,20,6,420} tbl[6] = {3050029,20,6,420} tbl[7] = {3050032,1,6,420} tbl[8] = {3050033,1,6,420} tbl[9] = {3050002,10,6,420} for i = 1,#tbl do temp = temp + tbl[i][4] if temp >= r then index = i break end end role.AddRoleItem(MapID, InstanceID, TargetID, tbl[index][1], tbl[index][2], tbl[index][3], 8, 35) end function I3110011_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(3110011, 1, "I3110011_GiftBag") function I6600182_GiftBag(MapID, InstanceID, TypeID, TargetID) --??ID, ????TypeID,??,??,????,log??????? local r = math.random(1800) local temp = 0 local index = 1 local tbl = {} tbl[1] = {4810109,5,6,420} tbl[2] = {7602497,5,6,420} tbl[3] = {7602498,5,6,420} tbl[4] = {3500208,5,6,420} tbl[5] = {5802220,1,6,120} for i = 1,#tbl 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, 35) end function I6600182_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(6600182, 1, "I6600182_GiftBag") function I5300128_GiftBag(MapID, InstanceID, TypeID, TargetID) --??ID, ????TypeID,??,??,????,log??????? local r = math.random(2520) local temp = 0 local index = 1 local tbl = {} tbl[1] = {7100182,10,6,420} tbl[2] = {7100183,10,6,420} tbl[3] = {7100184,10,6,420} tbl[4] = {7100185,10,6,420} tbl[5] = {7100186,150,6,420} tbl[6] = {7100187,150,6,420} for i = 1,#tbl do temp = temp + tbl[i][4] if temp >= r then index = i break end end role.AddRoleItem(MapID, InstanceID, TargetID, tbl[index][1], tbl[index][2], tbl[index][3], 8, 420) end function I5300128_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(5300128, 1, "I5300128_GiftBag") function I6600169_GiftBag(MapID, InstanceID, TypeID, TargetID) --??ID, ????TypeID,??,??,????,log??????? local r = math.random(8450) local temp = 0 local index = 1 local tbl = {} tbl[1] = {4080097,3,6,440} tbl[2] = {7100097,5,6,430} tbl[3] = {7100098,5,6,440} tbl[4] = {7100080,5,6,440} tbl[5] = {7100081,5,6,440} tbl[6] = {7100082,5,6,440} tbl[7] = {7100083,5,6,440} tbl[8] = {7100075,5,6,440} tbl[9] = {7100076,5,6,440} tbl[10] = {7100077,5,6,440} tbl[11] = {7100078,5,6,440} tbl[12] = {7100079,5,6,420} tbl[13] = {7100093,10,6,420} tbl[14] = {7100094,10,6,420} tbl[15] = {6601304,1,6,420} tbl[16] = {6601305,1,6,420} tbl[17] = {7100102,5,6,420} tbl[18] = {7100103,5,6,420} tbl[19] = {7100104,5,6,420} tbl[20] = {6600644,1,6,50} tbl[21] = {6600643,1,6,50} tbl[22] = {6600645,1,6,50} tbl[23] = {9990004,1,6,20} tbl[24] = {9990005,1,6,20} tbl[25] = {9990006,1,6,20} tbl[26] = {6600369,1,6,50} for i = 1,#tbl do temp = temp + tbl[i][4] if temp >= r then index = i break end end role.AddRoleItem(MapID, InstanceID, TargetID, tbl[index][1], tbl[index][2], tbl[index][3], 8, 35) end function I6600169_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(6600169, 1, "I6600169_GiftBag") function I6600170_GiftBag(MapID, InstanceID, TypeID, TargetID) --??ID, ????TypeID,??,??,????,log??????? local r = math.random(3590) local temp = 0 local index = 1 local tbl = {} tbl[1] = {4080097,7,6,420} tbl[2] = {7100098,10,6,420} tbl[3] = {7100097,10,6,420} tbl[4] = {6600369,1,6,220} tbl[5] = {7100102,10,6,220} tbl[6] = {7100103,10,6,220} tbl[7] = {7100104,10,6,220} tbl[8] = {4510021,1,6,120} tbl[9] = {4530243,10,6,320} tbl[10] = {3010195,3,6,320} tbl[11] = {3010196,1,6,220} tbl[12] = {9990005,1,6,50} tbl[13] = {9990006,1,6,50} tbl[14] = {9990004,1,6,50} tbl[15] = {4500027,30,6,320} for i = 1,#tbl do temp = temp + tbl[i][4] if temp >= r then index = i break end end role.AddRoleItem(MapID, InstanceID, TargetID, tbl[index][1], tbl[index][2], tbl[index][3], 8, 35) end function I6600170_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(6600170, 1, "I6600170_GiftBag") function I6600171_GiftBag(MapID, InstanceID, TypeID, TargetID) --??ID, ????TypeID,??,??,????,log??????? local r = math.random(4162) local temp = 0 local index = 1 local tbl = {} tbl[1] = {4080097,15,6,440} tbl[2] = {7100098,15,6,440} tbl[3] = {7100097,15,6,440} tbl[4] = {6600369,1,6,220} tbl[5] = {7100102,25,6,460} tbl[6] = {7100103,25,6,460} tbl[7] = {7100104,25,6,460} tbl[8] = {4510021,1,6,300} tbl[9] = {4300008,1,6,220} tbl[10] = {3010195,5,6,320} tbl[11] = {3010196,3,6,220} tbl[12] = {9990005,1,6,20} tbl[13] = {9990006,1,6,20} tbl[14] = {9990004,1,6,20} tbl[15] = {7100096,1,6,2} tbl[16] = {4080076,1,6,120} for i = 1,#tbl do temp = temp + tbl[i][4] if temp >= r then index = i break end end role.AddRoleItem(MapID, InstanceID, TargetID, tbl[index][1], tbl[index][2], tbl[index][3], 8, 35) end function I6600171_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(6600171, 1, "I6600171_GiftBag") function I6601793_GiftBag(MapID, InstanceID, TypeID, TargetID) --??ID, ????TypeID,??,??,????,log??????? local r = math.random(3500) local temp = 0 local index = 1 local tbl = {} tbl[1] = {7100119,5,6,500} tbl[2] = {7100120,5,6,500} tbl[3] = {7100121,5,6,500} tbl[4] = {7100122,5,6,500} tbl[5] = {7100123,5,6,500} tbl[6] = {7100124,5,6,500} tbl[7] = {7100125,5,6,500} for i = 1,#tbl do temp = temp + tbl[i][4] if temp >= r then index = i break end end role.AddRoleItem(MapID, InstanceID, TargetID, tbl[index][1], tbl[index][2], tbl[index][3], 8, 35) end function I6601793_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(6601793, 1, "I6601793_GiftBag") function I6601794_GiftBag(MapID, InstanceID, TypeID, TargetID) --??ID, ????TypeID,??,??,????,log??????? local r = math.random(6000) local temp = 0 local index = 1 local tbl = {} tbl[1] = {5802606,20,6,500} tbl[2] = {5802158,2,6,500} tbl[3] = {5802607,20,6,500} tbl[4] = {5802159,2,6,500} tbl[5] = {3500208,20,6,500} tbl[6] = {7100191,5,6,500} tbl[7] = {9850310,1,6,500} tbl[8] = {5802160,1,6,500} tbl[9] = {9850310,1,6,500} tbl[10] = {7100191,5,6,500} tbl[11] = {5802219,1,6,500} tbl[12] = {9850310,1,6,500} for i = 1,#tbl do temp = temp + tbl[i][4] if temp >= r then index = i break end end role.AddRoleItem(MapID, InstanceID, TargetID, tbl[index][1], tbl[index][2], tbl[index][3], 8, 35) end function I6601794_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(6601794, 1, "I6601794_GiftBag") function I6602372_GiftBag(MapID, InstanceID, TypeID, TargetID) --??ID, ????TypeID,??,??,????,log??????? local r = math.random(21000) local temp = 0 local index = 1 local tbl = {} tbl[1] = {9999029,1,6,700} tbl[2] = {9999030,1,6,700} tbl[3] = {9999031,1,6,700} tbl[4] = {9999032,1,6,700} tbl[5] = {9999033,1,6,700} tbl[6] = {9999034,1,6,700} tbl[7] = {9999035,1,6,700} tbl[8] = {9999036,1,6,700} tbl[9] = {9999037,1,6,700} tbl[10] = {9999038,1,6,700} tbl[11] = {9999039,1,6,700} tbl[12] = {9999040,1,6,700} tbl[13] = {9999041,1,6,700} tbl[14] = {9999042,1,6,700} tbl[15] = {9999043,1,6,700} tbl[16] = {9999044,1,6,700} tbl[17] = {9999045,1,6,700} tbl[18] = {9999046,1,6,700} tbl[19] = {9999047,1,6,700} tbl[20] = {9999273,1,6,700} tbl[21] = {9999271,1,6,700} tbl[22] = {9999272,1,6,700} tbl[23] = {9999274,1,6,700} tbl[24] = {9999284,1,6,700} tbl[25] = {9999285,1,6,700} tbl[26] = {9999286,1,6,700} tbl[27] = {9999287,1,6,700} tbl[28] = {9999288,1,6,700} tbl[29] = {9999295,1,6,700} tbl[30] = {9999298,1,6,700} for i = 1,#tbl 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, 500) end function I6602372_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(6602372, 1, "I6602372_GiftBag") function I4530242_GiftBag(MapID, InstanceID, TypeID, TargetID) --??ID, ????TypeID,??,??,????,log??????? local r = math.random(3000) local temp = 0 local index = 1 local tbl = {} tbl[1] = {4400059,1,6,500} tbl[2] = {4400060,1,6,500} tbl[3] = {4400061,1,6,500} tbl[4] = {4400062,1,6,500} tbl[5] = {4400063,1,6,500} tbl[6] = {4400064,1,6,500} for i = 1,#tbl do temp = temp + tbl[i][4] if temp >= r then index = i break end end role.AddRoleItem(MapID, InstanceID, TargetID, tbl[index][1], tbl[index][2], tbl[index][3], 8, 35) end function I4530242_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(4530242, 1, "I4530242_GiftBag") aux.RegisterItemEvent(4530243, 1, "I4530242_GiftBag") function I7100154_GiftBag(MapID, InstanceID, TypeID, TargetID) --??ID, ????TypeID,??,??,????,log??????? local r = math.random(5000) local temp = 0 local index = 1 local tbl = {} tbl[1] = {7100152,5,6,500} -- барти ботс tbl[2] = {7100155,2,6,500} -- водка tbl[3] = {7100156,2,6,500} -- Пиво tbl[4] = {7100157,2,6,500} -- Шампанское tbl[5] = {7100158,2,6,500} -- горилка tbl[6] = {7100159,2,6,500} -- Виски tbl[7] = {7100191,1,6,500} -- гвг моонета tbl[8] = {6600100,5,6,500} -- серафимка tbl[9] = {7100193,2,6,500} -- дух монета tbl[10] = {3500208,5,6,500} -- ядро 140 for i = 1,#tbl do temp = temp + tbl[i][4] if temp >= r then index = i break end end role.AddRoleItem(MapID, InstanceID, TargetID, tbl[index][1], tbl[index][2], tbl[index][3], 8, 35) end function I7100154_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(7100154, 1, "I7100154_GiftBag") function I7100153_GiftBag(MapID, InstanceID, TypeID, TargetID) --??ID, ????TypeID,??,??,????,log??????? local r = math.random(4500) local temp = 0 local index = 1 local tbl = {} tbl[1] = {7100152,5,6,500} -- барти ботс tbl[2] = {7100155,2,6,500} -- водка tbl[3] = {7100156,2,6,500} -- Пиво tbl[4] = {7100157,2,6,500} -- Шампанское tbl[5] = {7100158,2,6,500} -- горилка tbl[6] = {7100159,2,6,500} -- Виски tbl[7] = {7100191,2,6,500} -- гвг моонета tbl[8] = {6600100,10,6,500} -- серафимка tbl[9] = {8170149,1,6,500} -- панда ню for i = 1,#tbl do temp = temp + tbl[i][4] if temp >= r then index = i break end end role.AddRoleItem(MapID, InstanceID, TargetID, tbl[index][1], tbl[index][2], tbl[index][3], 8, 35) end function I7100153_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(7100153, 1, "I7100153_GiftBag") function guallyiyaoshui_onUse(MapID, InstanceID, TypeID, RoleID) local buff_ID = {3924301,3924401,3924501,3924601,3924701,3924801,3924901,3925001,395101} unit.AddBuff(MapID, InstanceID,RoleID,buff_ID[math.random(#buff_ID)],RoleID) end aux.RegisterItemEvent(7100152, 1, "guallyiyaoshui_onUse") function I3010149_GiftBag(MapID, InstanceID, TypeID, TargetID) --??ID, ????TypeID,??,??,????,log??????? local r = math.random(1950) local temp = 0 local index = 1 local tbl = {} tbl[1] = {3070090,1,6,500} -- барти ботс tbl[2] = {3070091,1,6,450} -- водка tbl[3] = {3070092,1,6,400} -- Пиво tbl[4] = {3070093,1,6,300} -- Шампанское tbl[5] = {3070094,1,6,200} -- горилка tbl[6] = {3070095,1,6,100} -- Виски for i = 1,#tbl do temp = temp + tbl[i][4] if temp >= r then index = i break end end role.AddRoleItem(MapID, InstanceID, TargetID, tbl[index][1], tbl[index][2], tbl[index][3], 8, 35) end function I3010149_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(3010149, 1, "I3010149_GiftBag") function I3010150_GiftBag(MapID, InstanceID, TypeID, TargetID) --??ID, ????TypeID,??,??,????,log??????? local r = math.random(3000) local temp = 0 local index = 1 local tbl = {} tbl[1] = {6601175,5,6,500} -- барти ботс tbl[2] = {6601181,5,6,500} -- водка tbl[3] = {6601190,5,6,500} -- Пиво tbl[4] = {6601193,5,6,500} -- Шампанское tbl[5] = {6601196,5,6,500} -- горилка tbl[6] = {6601199,5,6,500} -- Виски for i = 1,#tbl do temp = temp + tbl[i][4] if temp >= r then index = i break end end role.AddRoleItem(MapID, InstanceID, TargetID, tbl[index][1], tbl[index][2], tbl[index][3], 8, 35) end function I3010150_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(3010150, 1, "I3010150_GiftBag") function I5303031_GiftBag(MapID, InstanceID, TypeID, TargetID) --??ID, ????TypeID,??,??,????,log??????? local r = math.random(17000) local temp = 0 local index = 1 local tbl = {} tbl[1] = {4900390,50,6,500} -- барти ботс tbl[2] = {4900391,50,6,500} -- водка tbl[3] = {4900392,50,6,500} -- Пиво tbl[4] = {4900393,50,6,500} -- Шампанское tbl[5] = {4900394,50,6,500} -- горилка tbl[6] = {4900398,50,6,500} -- Виски tbl[7] = {4900399,50,6,500} -- Виски tbl[8] = {4900400,50,6,500} -- Виски tbl[9] = {4900401,50,6,500} -- Виски tbl[10] = {4900402,50,6,500} -- Виски tbl[11] = {4900403,50,6,500} -- Виски tbl[12] = {6900477,50,6,500} -- Виски tbl[13] = {6900478,50,6,500} -- Виски tbl[14] = {6900589,50,6,500} -- Виски tbl[15] = {6900590,50,6,500} -- Виски tbl[16] = {6900591,50,6,500} -- Виски tbl[17] = {6900592,50,6,500} -- Виски tbl[18] = {6900593,50,6,500} -- Виски tbl[19] = {6900594,50,6,500} -- Виски tbl[20] = {6900595,50,6,500} -- Виски tbl[21] = {6900596,50,6,500} -- Виски tbl[22] = {6900597,50,6,500} -- Виски tbl[23] = {6900598,50,6,500} -- Виски tbl[24] = {6900599,50,6,500} -- Виски tbl[25] = {6900480,50,6,500} -- Виски tbl[26] = {2610021,50,6,500} -- Виски tbl[27] = {2610022,50,6,500} -- Виски tbl[28] = {2610023,50,6,500} -- Виски tbl[29] = {2610024,50,6,500} -- Виски tbl[30] = {2610025,50,6,500} -- Виски tbl[31] = {6900412,50,6,500} -- Виски tbl[32] = {6900413,50,6,500} -- Виски tbl[33] = {6900414,50,6,500} -- Виски tbl[34] = {6900415,50,6,500} -- Виски for i = 1,#tbl do temp = temp + tbl[i][4] if temp >= r then index = i break end end role.AddRoleItem(MapID, InstanceID, TargetID, tbl[index][1], tbl[index][2], tbl[index][3], 8, 35) end function I5303031_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(5303031, 1, "I5303031_GiftBag")