shanggusuipian = {} shanggusuipian[1]={lastDate = 0,num = 0} --��¼ÿ���Ϲ���װ��Ƭ�IJ��� shanggusuipian[2]={lastDate = 0,num = 0} --��¼ÿ���Ϲ�������Ƭ�IJ��� --������ħ������ function I4800172_GiftBag(MapID, InstanceID, TypeID, TargetID) --���ID�� ������ƷTypeID��������Ʒ�ʣ�����ģʽ��log��������Ϣö�� local temp = TypeID - 4800172 if(temp == 0) then role.AddRoleItem(MapID, InstanceID, TargetID, 4820028, math.random(3,4), -1, 8, 420) elseif(temp == 5) then role.AddRoleItem(MapID, InstanceID, TargetID, 4820024, math.random(1,3), -1, 8, 420) elseif(temp == 10) then role.AddRoleItem(MapID, InstanceID, TargetID, 4820029, math.random(1,3), -1, 8, 420) end role.AddRoleItem(MapID, InstanceID, TargetID, 4820081, math.random(5,10), -1, 8, 420) role.AddRoleItem(MapID, InstanceID, TargetID, 4820044, math.random(20,25), -1, 8, 420) role.AddRoleItem(MapID, InstanceID, TargetID, 4800246, 1, -1, 8, 420) role.AddRoleItem(MapID, InstanceID, TargetID, 3510002, 1, -1, 8, 420) end function I4800172_CanUseGiftBag(MapID, InstanceID, TypeID, TargetID) local bRet, bIgnore = 0, false --�жϱ������пռ��Ƿ��㹻 local FreeSize = role.GetBagFreeSize(TargetID) if(FreeSize < 5) then --��ʾ��ұ����ռ䲻�� bRet = 40 end return bRet, bIgnore end aux.RegisterItemEvent(4800172, 1, "I4800172_GiftBag") aux.RegisterItemEvent(4800172, 0, "I4800172_CanUseGiftBag") aux.RegisterItemEvent(4800177, 1, "I4800172_GiftBag") aux.RegisterItemEvent(4800177, 0, "I4800172_CanUseGiftBag") aux.RegisterItemEvent(4800182, 1, "I4800172_GiftBag") aux.RegisterItemEvent(4800182, 0, "I4800172_CanUseGiftBag") --ħ������ function I4800173_GiftBag(MapID, InstanceID, TypeID, TargetID) --���ID�� ������ƷTypeID��������Ʒ�ʣ�����ģʽ��log��������Ϣö�� local totalNum = 3 local FreeSize = role.GetBagFreeSize(TargetID) local tbal = {} tbal[1] = {} tbal[2] = {} tbal[3] = {} tbal[1][1] = {8010014,8020014,8030014,8040014,8050014,8051014,8060014,8061014,8070014,8071014,8080014,8081014,8090014,8091014,8100014,8110014,8111014,8121014,8122014,8130014} tbal[1][2] = {8012007,8022007,8032007,8042007,8050207,8051207,8060207,8061207,8070207,8071207,8080207,8081207,8090207,8091207,8100207,8110207,8111207,8121207,8122207,8130207} tbal[2][1] = {8010015,8020015,8030015,8040015,8050015,8051015,8060015,8061015,8070015,8071015,8080015,8081015,8090015,8091015,8100015,8110015,8111015,8121015,8122015,8130015} tbal[2][2] = {8012008,8022008,8032008,8042008,8050208,8051208,8060208,8061208,8070208,8071208,8080208,8081208,8090208,8091208,8100208,8110208,8111208,8121208,8122208,8130208} tbal[3][1] = {8010016,8020016,8030016,8040016,8050016,8051016,8060016,8061016,8070016,8071016,8080016,8081016,8090016,8091016,8100016,8110016,8111016,8121016,8122016,8130016} tbal[3][2] = {8010017,8020017,8030017,8040017,8050017,8051017,8060017,8061017,8070017,8071017,8080017,8081017,8090017,8091017,8100017,8110017,8111017,8121017,8122017,8130017} tbal[3][3] = {8012009,8022009,8032009,8042009,8050209,8051209,8060209,8061209,8070209,8071209,8080209,8081209,8090209,8091209,8100209,8110209,8111209,8121209,8122209,8130209} local theDays = tonumber(os.date("%j")) local temp = TypeID - 4800173 if(temp == 0) then role.AddRoleItem(MapID, InstanceID, TargetID, 4820028, math.random(4,5), -1, 8, 420) elseif(temp == 5) then role.AddRoleItem(MapID, InstanceID, TargetID, 4820024, math.random(4,5), -1, 8, 420) elseif(temp == 10) then role.AddRoleItem(MapID, InstanceID, TargetID, 4820029, math.random(4,5), -1, 8, 420) end role.AddRoleItem(MapID, InstanceID, TargetID, 4820081, math.random(10,15), -1, 8, 420) role.AddRoleItem(MapID, InstanceID, TargetID, 4820044, math.random(25,30), -1, 8, 420) role.AddRoleItem(MapID, InstanceID, TargetID, 4800246, math.random(2), -1, 8, 420) role.AddRoleItem(MapID, InstanceID, TargetID, 3510002, 1, -1, 8, 420) local chance = {} for i = 1,15 do chance[i] = math.random(100) end if(FreeSize > 1 and totalNum < 12 and chance[1] <= 1) then if(theDays ~= shanggusuipian[1].lastDate) then role.AddRoleItem(MapID, InstanceID, TargetID, 4820120, 1, -1, 8, 420) shanggusuipian[1].lastDate = theDays shanggusuipian[1].num = 1 totalNum = totalNum + 1 FreeSize = FreeSize - 1 elseif(theDays == shanggusuipian[1].lastDate and shanggusuipian[1].num < 3) then role.AddRoleItem(MapID, InstanceID, TargetID, 4820120, 1, -1, 8, 420) shanggusuipian[1].num = shanggusuipian[1].num + 1 totalNum = totalNum + 1 FreeSize = FreeSize - 1 end end if(FreeSize > 1 and totalNum < 12 and chance[2] <= 1) then if(theDays ~= shanggusuipian[2].lastDate) then role.AddRoleItem(MapID, InstanceID, TargetID, 4820121, 1, -1, 8, 420) shanggusuipian[2].lastDate = theDays shanggusuipian[2].num = 1 totalNum = totalNum + 1 FreeSize = FreeSize - 1 elseif(theDays == shanggusuipian[2].lastDate and shanggusuipian[2].num < 3) then role.AddRoleItem(MapID, InstanceID, TargetID, 4820121, 1, -1, 8, 420) shanggusuipian[2].num = shanggusuipian[2].num + 1 totalNum = totalNum + 1 FreeSize = FreeSize - 1 end end if(FreeSize > 1 and totalNum < 12 and chance[3] <= 10) then role.AddRoleItem(MapID, InstanceID, TargetID, 4820175, 1, -1, 8, 420) --�dz�֮�� totalNum = totalNum + 1 FreeSize = FreeSize - 1 end if(FreeSize > 1 and totalNum < 12 and chance[4] <= 50) then role.AddRoleItem(MapID, InstanceID, TargetID, 3010038+temp*0.2, 1, -1, 8, 420) --����ҩˮ totalNum = totalNum + 1 FreeSize = FreeSize - 1 end if( FreeSize > 1 and totalNum < 12 and chance[5] <= 30) then role.AddRoleItem(MapID, InstanceID, TargetID, tbal[temp*0.2+1][1][math.random(#tbal[temp*0.2+1][1])], 1, 3, 8, 420) --�ɳ�װ�� totalNum = totalNum + 1 FreeSize = FreeSize - 1 end if(FreeSize > 1 and totalNum < 12 and chance[6] <= 30) then role.AddRoleItem(MapID, InstanceID, TargetID, tbal[temp*0.2+1][2][math.random(#tbal[temp*0.2+1][2])], 1, math.random(3,4), 8, 420) --����װ�� totalNum = totalNum + 1 FreeSize = FreeSize - 1 end if(FreeSize > 1 and totalNum < 12 and chance[7] <= 30) then role.AddRoleItem(MapID, InstanceID, TargetID, tbal[temp*0.2+1][2][math.random(#tbal[temp*0.2+1][2])], 1, math.random(3,4), 8, 420) --����װ�� totalNum = totalNum + 1 FreeSize = FreeSize - 1 end if(temp == 10 and FreeSize > 1 and totalNum < 12 and chance[8] <= 4 ) then role.AddRoleItem(MapID, InstanceID, TargetID, tbal[temp*0.2+1][2][math.random(#tbal[3][3])], 1, 4, 8, 420) --����װ�� totalNum = totalNum + 1 FreeSize = FreeSize - 1 end end function I4800173_CanUseGiftBag(MapID, InstanceID, TypeID, TargetID) local bRet, bIgnore = 0, false --�жϱ������пռ��Ƿ��㹻 local FreeSize = role.GetBagFreeSize(TargetID) if(FreeSize < 8) then --��ʾ��ұ����ռ䲻�� bRet = 40 end return bRet, bIgnore end aux.RegisterItemEvent(4800173, 1, "I4800173_GiftBag") aux.RegisterItemEvent(4800173, 0, "I4800173_CanUseGiftBag") aux.RegisterItemEvent(4800178, 1, "I4800173_GiftBag") aux.RegisterItemEvent(4800178, 0, "I4800173_CanUseGiftBag") aux.RegisterItemEvent(4800183, 1, "I4800173_GiftBag") aux.RegisterItemEvent(4800183, 0, "I4800173_CanUseGiftBag") --���µ�ħ������ function I4800174_GiftBag(MapID, InstanceID, TypeID, TargetID) --���ID�� ������ƷTypeID��������Ʒ�ʣ�����ģʽ��log��������Ϣö�� local totalNum = 3 local FreeSize = role.GetBagFreeSize(TargetID) local tbal = {} tbal[1] = {} tbal[2] = {} tbal[3] = {} tbal[1][1] = {8010014,8020014,8030014,8040014,8050014,8051014,8060014,8061014,8070014,8071014,8080014,8081014,8090014,8091014,8100014,8110014,8111014,8121014,8122014,8130014} tbal[1][2] = {8012007,8022007,8032007,8042007,8050207,8051207,8060207,8061207,8070207,8071207,8080207,8081207,8090207,8091207,8100207,8110207,8111207,8121207,8122207,8130207} tbal[2][1] = {8010015,8020015,8030015,8040015,8050015,8051015,8060015,8061015,8070015,8071015,8080015,8081015,8090015,8091015,8100015,8110015,8111015,8121015,8122015,8130015} tbal[2][2] = {8012008,8022008,8032008,8042008,8050208,8051208,8060208,8061208,8070208,8071208,8080208,8081208,8090208,8091208,8100208,8110208,8111208,8121208,8122208,8130208} tbal[3][1] = {8010016,8020016,8030016,8040016,8050016,8051016,8060016,8061016,8070016,8071016,8080016,8081016,8090016,8091016,8100016,8110016,8111016,8121016,8122016,8130016} tbal[3][2] = {8010017,8020017,8030017,8040017,8050017,8051017,8060017,8061017,8070017,8071017,8080017,8081017,8090017,8091017,8100017,8110017,8111017,8121017,8122017,8130017} tbal[3][3] = {8012009,8022009,8032009,8042009,8050209,8051209,8060209,8061209,8070209,8071209,8080209,8081209,8090209,8091209,8100209,8110209,8111209,8121209,8122209,8130209} local theDays = tonumber(os.date("%j")) local temp = TypeID - 4800174 if(temp == 0) then role.AddRoleItem(MapID, InstanceID, TargetID, 4820028, math.random(5,6), -1, 8, 420) elseif(temp == 5) then role.AddRoleItem(MapID, InstanceID, TargetID, 4820024, math.random(5,6), -1, 8, 420) elseif(temp == 10) then role.AddRoleItem(MapID, InstanceID, TargetID, 4820029, math.random(5,6), -1, 8, 420) end role.AddRoleItem(MapID, InstanceID, TargetID, 4820081, math.random(15,20), -1, 8, 420) role.AddRoleItem(MapID, InstanceID, TargetID, 4820044, math.random(30,35), -1, 8, 420) role.AddRoleItem(MapID, InstanceID, TargetID, 4800246, math.random(2), -1, 8, 420) role.AddRoleItem(MapID, InstanceID, TargetID, 3510002, 1, -1, 8, 420) local chance = {} for i = 1,15 do chance[i] = math.random(100) end if(FreeSize > 1 and totalNum < 12 and chance[1] <= 1) then if(theDays ~= shanggusuipian[1].lastDate) then role.AddRoleItem(MapID, InstanceID, TargetID, 4820120, 1, -1, 8, 420) shanggusuipian[1].lastDate = theDays shanggusuipian[1].num = 1 totalNum = totalNum + 1 FreeSize = FreeSize - 1 elseif(theDays == shanggusuipian[1].lastDate and shanggusuipian[1].num < 3) then role.AddRoleItem(MapID, InstanceID, TargetID, 4820120, 1, -1, 8, 420) shanggusuipian[1].num = shanggusuipian[1].num + 1 totalNum = totalNum + 1 FreeSize = FreeSize - 1 end end if(FreeSize > 1 and totalNum < 12 and chance[2] <= 1) then if(theDays ~= shanggusuipian[2].lastDate) then role.AddRoleItem(MapID, InstanceID, TargetID, 4820121, 1, -1, 8, 420) shanggusuipian[2].lastDate = theDays shanggusuipian[2].num = 1 totalNum = totalNum + 1 FreeSize = FreeSize - 1 elseif(theDays == shanggusuipian[2].lastDate and shanggusuipian[2].num < 3) then role.AddRoleItem(MapID, InstanceID, TargetID, 4820121, 1, -1, 8, 420) shanggusuipian[2].num = shanggusuipian[2].num + 1 totalNum = totalNum + 1 FreeSize = FreeSize - 1 end end if(FreeSize > 1 and totalNum < 12 and chance[3] <= 20) then role.AddRoleItem(MapID, InstanceID, TargetID, 4820175, 1, -1, 8, 420) --�dz�֮�� totalNum = totalNum + 1 FreeSize = FreeSize - 1 end if(FreeSize > 1 and totalNum < 12 and chance[4] <= 100) then role.AddRoleItem(MapID, InstanceID, TargetID, 3010038+temp*0.2, 1, -1, 8, 420) --����ҩˮ totalNum = totalNum + 1 FreeSize = FreeSize - 1 end if(FreeSize > 1 and totalNum < 12 and chance[5] <= 30) then role.AddRoleItem(MapID, InstanceID, TargetID, tbal[temp*0.2+1][1][math.random(#tbal[temp*0.2+1][1])], 1, 3, 8, 420) --�ɳ�װ�� totalNum = totalNum + 1 FreeSize = FreeSize - 1 end if( FreeSize > 1 and totalNum < 12 and chance[6] <= 30) then role.AddRoleItem(MapID, InstanceID, TargetID, tbal[temp*0.2+1][1][math.random(#tbal[temp*0.2+1][1])], 1, 3, 8, 420) --�ɳ�װ�� totalNum = totalNum + 1 FreeSize = FreeSize - 1 end if(FreeSize > 1 and totalNum < 12 and chance[7] <= 30) then role.AddRoleItem(MapID, InstanceID, TargetID, tbal[temp*0.2+1][2][math.random(#tbal[temp*0.2+1][2])], 1, math.random(3,4), 8, 420) --����װ�� totalNum = totalNum + 1 FreeSize = FreeSize - 1 end if( FreeSize > 1 and totalNum < 12 and chance[8] <= 30) then role.AddRoleItem(MapID, InstanceID, TargetID, tbal[temp*0.2+1][2][math.random(#tbal[temp*0.2+1][2])], 1, math.random(3,4), 8, 420) --����װ�� totalNum = totalNum + 1 FreeSize = FreeSize - 1 end if( FreeSize > 1 and totalNum < 12 and chance[9] <= 30) then role.AddRoleItem(MapID, InstanceID, TargetID, tbal[temp*0.2+1][2][math.random(#tbal[temp*0.2+1][2])], 1, math.random(3,4), 8, 420) --����װ�� totalNum = totalNum + 1 FreeSize = FreeSize - 1 end if(temp == 10 and FreeSize > 1 and totalNum < 12 and chance[10] <= 4 ) then role.AddRoleItem(MapID, InstanceID, TargetID, tbal[3][3][math.random(#tbal[3][3])], 1, 4, 8, 420) --��ɫ�ɳ� totalNum = totalNum + 1 FreeSize = FreeSize - 1 end end function I4800174_CanUseGiftBag(MapID, InstanceID, TypeID, TargetID) local bRet, bIgnore = 0, false --�жϱ������пռ��Ƿ��㹻 local FreeSize = role.GetBagFreeSize(TargetID) if(FreeSize < 8) then --��ʾ��ұ����ռ䲻�� bRet = 40 end return bRet, bIgnore end aux.RegisterItemEvent(4800174, 1, "I4800174_GiftBag") aux.RegisterItemEvent(4800174, 0, "I4800174_CanUseGiftBag") aux.RegisterItemEvent(4800179, 1, "I4800174_GiftBag") aux.RegisterItemEvent(4800179, 0, "I4800174_CanUseGiftBag") aux.RegisterItemEvent(4800184, 1, "I4800174_GiftBag") aux.RegisterItemEvent(4800184, 0, "I4800174_CanUseGiftBag") --������ħ������ function I4800175_GiftBag(MapID, InstanceID, TypeID, TargetID) --���ID�� ������ƷTypeID��������Ʒ�ʣ�����ģʽ��log��������Ϣö�� local totalNum = 3 local FreeSize = role.GetBagFreeSize(TargetID) local tbal = {} tbal[1] = {} tbal[2] = {} tbal[3] = {} tbal[1][1] = {8010014,8020014,8030014,8040014,8050014,8051014,8060014,8061014,8070014,8071014,8080014,8081014,8090014,8091014,8100014,8110014,8111014,8121014,8122014,8130014} tbal[1][2] = {8012007,8022007,8032007,8042007,8050207,8051207,8060207,8061207,8070207,8071207,8080207,8081207,8090207,8091207,8100207,8110207,8111207,8121207,8122207,8130207} tbal[2][1] = {8010015,8020015,8030015,8040015,8050015,8051015,8060015,8061015,8070015,8071015,8080015,8081015,8090015,8091015,8100015,8110015,8111015,8121015,8122015,8130015} tbal[2][2] = {8012008,8022008,8032008,8042008,8050208,8051208,8060208,8061208,8070208,8071208,8080208,8081208,8090208,8091208,8100208,8110208,8111208,8121208,8122208,8130208} tbal[3][1] = {8010016,8020016,8030016,8040016,8050016,8051016,8060016,8061016,8070016,8071016,8080016,8081016,8090016,8091016,8100016,8110016,8111016,8121016,8122016,8130016} tbal[3][2] = {8010017,8020017,8030017,8040017,8050017,8051017,8060017,8061017,8070017,8071017,8080017,8081017,8090017,8091017,8100017,8110017,8111017,8121017,8122017,8130017} tbal[3][3] = {8012009,8022009,8032009,8042009,8050209,8051209,8060209,8061209,8070209,8071209,8080209,8081209,8090209,8091209,8100209,8110209,8111209,8121209,8122209,8130209} local theDays = tonumber(os.date("%j")) local temp = TypeID - 4800175 if(temp == 0) then role.AddRoleItem(MapID, InstanceID, TargetID, 4820028, math.random(6,7), -1, 8, 420) elseif(temp == 5) then role.AddRoleItem(MapID, InstanceID, TargetID, 4820024, math.random(6,7), -1, 8, 420) elseif(temp == 10) then role.AddRoleItem(MapID, InstanceID, TargetID, 4820029, math.random(6,7), -1, 8, 420) end role.AddRoleItem(MapID, InstanceID, TargetID, 4820081, math.random(20,25), -1, 8, 420) role.AddRoleItem(MapID, InstanceID, TargetID, 4820044, math.random(35,40), -1, 8, 420) role.AddRoleItem(MapID, InstanceID, TargetID, 4800246, math.random(2), -1, 8, 420) role.AddRoleItem(MapID, InstanceID, TargetID, 3510002, 1, -1, 8, 420) local chance = {} for i = 1,15 do chance[i] = math.random(100) end if(FreeSize > 1 and totalNum < 12 and chance[1] <= 1) then if(theDays ~= shanggusuipian[1].lastDate) then role.AddRoleItem(MapID, InstanceID, TargetID, 4820120, 1, -1, 8, 420) shanggusuipian[1].lastDate = theDays shanggusuipian[1].num = 1 totalNum = totalNum + 1 FreeSize = FreeSize - 1 elseif(theDays == shanggusuipian[1].lastDate and shanggusuipian[1].num < 3) then role.AddRoleItem(MapID, InstanceID, TargetID, 4820120, 1, -1, 8, 420) shanggusuipian[1].num = shanggusuipian[1].num + 1 totalNum = totalNum + 1 FreeSize = FreeSize - 1 end end if(FreeSize > 1 and totalNum < 12 and chance[2] <= 1) then if(theDays ~= shanggusuipian[2].lastDate) then role.AddRoleItem(MapID, InstanceID, TargetID, 4820121, 1, -1, 8, 420) shanggusuipian[2].lastDate = theDays shanggusuipian[2].num = 1 totalNum = totalNum + 1 FreeSize = FreeSize - 1 elseif(theDays == shanggusuipian[2].lastDate and shanggusuipian[2].num < 3) then role.AddRoleItem(MapID, InstanceID, TargetID, 4820121, 1, -1, 8, 420) shanggusuipian[2].num = shanggusuipian[2].num + 1 totalNum = totalNum + 1 FreeSize = FreeSize - 1 end end if(FreeSize > 1 and totalNum < 12 and chance[3] <= 50) then role.AddRoleItem(MapID, InstanceID, TargetID, 4820175, 1, -1, 8, 420) --�dz�֮�� totalNum = totalNum + 1 FreeSize = FreeSize - 1 end if(FreeSize > 1 and totalNum < 12 and chance[4] <= 100) then role.AddRoleItem(MapID, InstanceID, TargetID, 3010038+temp*0.2, 1, -1, 8, 420) --����ҩˮ totalNum = totalNum + 1 FreeSize = FreeSize - 1 end if(FreeSize > 1 and totalNum < 12 and chance[5] <= 30) then role.AddRoleItem(MapID, InstanceID, TargetID, tbal[temp*0.2+1][1][math.random(#tbal[temp*0.2+1][1])], 1, 3, 8, 420) --�ɳ�װ�� totalNum = totalNum + 1 FreeSize = FreeSize - 1 end if(FreeSize > 1 and totalNum < 12 and chance[6] <= 30) then role.AddRoleItem(MapID, InstanceID, TargetID, tbal[temp*0.2+1][1][math.random(#tbal[temp*0.2+1][1])], 1, 3, 8, 420) --�ɳ�װ�� totalNum = totalNum + 1 FreeSize = FreeSize - 1 end if(FreeSize > 1 and totalNum < 12 and chance[7] <= 30) then role.AddRoleItem(MapID, InstanceID, TargetID, tbal[temp*0.2+1][1][math.random(#tbal[temp*0.2+1][1])], 1, 3, 8, 420) --�ɳ�װ�� totalNum = totalNum + 1 FreeSize = FreeSize - 1 end if(FreeSize > 1 and totalNum < 12 and chance[8] <= 30) then role.AddRoleItem(MapID, InstanceID, TargetID, tbal[temp*0.2+1][2][math.random(#tbal[temp*0.2+1][2])], 1, math.random(3,4), 8, 420) --����װ�� totalNum = totalNum + 1 FreeSize = FreeSize - 1 end if(FreeSize > 1 and totalNum < 12 and chance[9] <= 30) then role.AddRoleItem(MapID, InstanceID, TargetID, tbal[temp*0.2+1][2][math.random(#tbal[temp*0.2+1][2])], 1, math.random(3,4), 8, 420) --����װ�� totalNum = totalNum + 1 FreeSize = FreeSize - 1 end if(FreeSize > 1 and totalNum < 12 and chance[10] <= 30) then role.AddRoleItem(MapID, InstanceID, TargetID, tbal[temp*0.2+1][2][math.random(#tbal[temp*0.2+1][2])], 1, math.random(3,4), 8, 420) --����װ�� totalNum = totalNum + 1 FreeSize = FreeSize - 1 end if(temp == 10 and FreeSize > 1 and totalNum < 12 and chance[11] <= 4 ) then role.AddRoleItem(MapID, InstanceID, TargetID, tbal[3][3][math.random(#tbal[3][3])], 1, 4, 8, 420) --��ɫ�ɳ� totalNum = totalNum + 1 FreeSize = FreeSize - 1 end end function I4800175_CanUseGiftBag(MapID, InstanceID, TypeID, TargetID) local bRet, bIgnore = 0, false --�жϱ������пռ��Ƿ��㹻 local FreeSize = role.GetBagFreeSize(TargetID) if(FreeSize < 8) then --��ʾ��ұ����ռ䲻�� bRet = 40 end return bRet, bIgnore end aux.RegisterItemEvent(4800175, 1, "I4800175_GiftBag") aux.RegisterItemEvent(4800175, 0, "I4800175_CanUseGiftBag") aux.RegisterItemEvent(4800180, 1, "I4800175_GiftBag") aux.RegisterItemEvent(4800180, 0, "I4800175_CanUseGiftBag") aux.RegisterItemEvent(4800185, 1, "I4800175_GiftBag") aux.RegisterItemEvent(4800185, 0, "I4800175_CanUseGiftBag") --��ҫ��ħ������ function I4800176_GiftBag(MapID, InstanceID, TypeID, TargetID) --���ID�� ������ƷTypeID��������Ʒ�ʣ�����ģʽ��log��������Ϣö�� local totalNum = 3 local FreeSize = role.GetBagFreeSize(TargetID) local tbal = {} tbal[1] = {} tbal[2] = {} tbal[3] = {} tbal[1][1] = {8010014,8020014,8030014,8040014,8050014,8051014,8060014,8061014,8070014,8071014,8080014,8081014,8090014,8091014,8100014,8110014,8111014,8121014,8122014,8130014} tbal[1][2] = {8012007,8022007,8032007,8042007,8050207,8051207,8060207,8061207,8070207,8071207,8080207,8081207,8090207,8091207,8100207,8110207,8111207,8121207,8122207,8130207} tbal[2][1] = {8010015,8020015,8030015,8040015,8050015,8051015,8060015,8061015,8070015,8071015,8080015,8081015,8090015,8091015,8100015,8110015,8111015,8121015,8122015,8130015} tbal[2][2] = {8012008,8022008,8032008,8042008,8050208,8051208,8060208,8061208,8070208,8071208,8080208,8081208,8090208,8091208,8100208,8110208,8111208,8121208,8122208,8130208} tbal[3][1] = {8010016,8020016,8030016,8040016,8050016,8051016,8060016,8061016,8070016,8071016,8080016,8081016,8090016,8091016,8100016,8110016,8111016,8121016,8122016,8130016} tbal[3][2] = {8010017,8020017,8030017,8040017,8050017,8051017,8060017,8061017,8070017,8071017,8080017,8081017,8090017,8091017,8100017,8110017,8111017,8121017,8122017,8130017} tbal[3][3] = {8012009,8022009,8032009,8042009,8050209,8051209,8060209,8061209,8070209,8071209,8080209,8081209,8090209,8091209,8100209,8110209,8111209,8121209,8122209,8130209} local theDays = tonumber(os.date("%j")) local temp = TypeID - 4800176 if(temp == 0) then role.AddRoleItem(MapID, InstanceID, TargetID, 4820028, math.random(7,8), -1, 8, 420) elseif(temp == 5) then role.AddRoleItem(MapID, InstanceID, TargetID, 4820024, math.random(7,8), -1, 8, 420) elseif(temp == 10) then role.AddRoleItem(MapID, InstanceID, TargetID, 4820029, math.random(7,8), -1, 8, 420) end role.AddRoleItem(MapID, InstanceID, TargetID, 4820081, math.random(25,30), -1, 8, 420) role.AddRoleItem(MapID, InstanceID, TargetID, 4820044, math.random(40,45), -1, 8, 420) role.AddRoleItem(MapID, InstanceID, TargetID, 4800246, math.random(2), -1, 8, 420) role.AddRoleItem(MapID, InstanceID, TargetID, 3510002, 1, -1, 8, 420) local chance = {} for i = 1,15 do chance[i] = math.random(100) end if(FreeSize > 1 and totalNum < 12 and chance[1] <= 1) then if(theDays ~= shanggusuipian[1].lastDate) then role.AddRoleItem(MapID, InstanceID, TargetID, 4820120, 1, -1, 8, 420) shanggusuipian[1].lastDate = theDays shanggusuipian[1].num = 1 totalNum = totalNum + 1 FreeSize = FreeSize - 1 elseif(theDays == shanggusuipian[1].lastDate and shanggusuipian[1].num < 3) then role.AddRoleItem(MapID, InstanceID, TargetID, 4820120, 1, -1, 8, 420) shanggusuipian[1].num = shanggusuipian[1].num + 1 totalNum = totalNum + 1 FreeSize = FreeSize - 1 end end if(FreeSize > 1 and totalNum < 12 and chance[2] <= 1) then if(theDays ~= shanggusuipian[2].lastDate) then role.AddRoleItem(MapID, InstanceID, TargetID, 4820121, 1, -1, 8, 420) shanggusuipian[2].lastDate = theDays shanggusuipian[2].num = 1 totalNum = totalNum + 1 FreeSize = FreeSize - 1 elseif(theDays == shanggusuipian[2].lastDate and shanggusuipian[2].num < 3) then role.AddRoleItem(MapID, InstanceID, TargetID, 4820121, 1, -1, 8, 420) shanggusuipian[2].num = shanggusuipian[2].num + 1 totalNum = totalNum + 1 FreeSize = FreeSize - 1 end end if(FreeSize > 1 and totalNum < 12 and chance[3] <= 100) then role.AddRoleItem(MapID, InstanceID, TargetID, 4820175, 1, -1, 8, 420) --�dz�֮�� totalNum = totalNum + 1 FreeSize = FreeSize - 1 end if(FreeSize > 1 and totalNum < 12 and chance[4] <= 100) then role.AddRoleItem(MapID, InstanceID, TargetID, 3010038+temp*0.2, 2, -1, 8, 420) --����ҩˮ totalNum = totalNum + 1 FreeSize = FreeSize - 1 end if(FreeSize > 1 and totalNum < 12 and chance[5] <= 30) then role.AddRoleItem(MapID, InstanceID, TargetID, tbal[temp*0.2+1][1][math.random(#tbal[temp*0.2+1][1])], 1, 3, 8, 420) --�ɳ�װ�� totalNum = totalNum + 1 FreeSize = FreeSize - 1 end if(FreeSize > 1 and totalNum < 12 and chance[6] <= 30) then role.AddRoleItem(MapID, InstanceID, TargetID, tbal[temp*0.2+1][1][math.random(#tbal[temp*0.2+1][1])], 1, 3, 8, 420) --�ɳ�װ�� totalNum = totalNum + 1 FreeSize = FreeSize - 1 end if(FreeSize > 1 and totalNum < 12 and chance[7] <= 30) then role.AddRoleItem(MapID, InstanceID, TargetID, tbal[temp*0.2+1][1][math.random(#tbal[temp*0.2+1][1])], 1, 3, 8, 420) --�ɳ�װ�� totalNum = totalNum + 1 FreeSize = FreeSize - 1 end if(FreeSize > 1 and totalNum < 12 and chance[8] <= 30) then role.AddRoleItem(MapID, InstanceID, TargetID, tbal[temp*0.2+1][2][math.random(#tbal[temp*0.2+1][2])], 1, math.random(3,4), 8, 420) --����װ�� totalNum = totalNum + 1 FreeSize = FreeSize - 1 end if(FreeSize > 1 and totalNum < 12 and chance[9] <= 30) then role.AddRoleItem(MapID, InstanceID, TargetID, tbal[temp*0.2+1][2][math.random(#tbal[temp*0.2+1][2])], 1, math.random(3,4), 8, 420) --����װ�� totalNum = totalNum + 1 FreeSize = FreeSize - 1 end if(FreeSize > 1 and totalNum < 12 and chance[10] <= 30) then role.AddRoleItem(MapID, InstanceID, TargetID, tbal[temp*0.2+1][2][math.random(#tbal[temp*0.2+1][2])], 1, math.random(3,4), 8, 420) --����װ�� totalNum = totalNum + 1 FreeSize = FreeSize - 1 end if(FreeSize > 1 and totalNum < 12 and chance[11] <= 30) then role.AddRoleItem(MapID, InstanceID, TargetID, tbal[temp*0.2+1][2][math.random(#tbal[temp*0.2+1][2])], 1, math.random(3,4), 8, 420) --����װ�� totalNum = totalNum + 1 FreeSize = FreeSize - 1 end if(temp == 10 and FreeSize > 1 and totalNum < 12 and chance[12] <= 8 ) then role.AddRoleItem(MapID, InstanceID, TargetID, tbal[3][3][math.random(#tbal[3][3])], 1, 4, 8, 420) --��ɫ�ɳ� totalNum = totalNum + 1 FreeSize = FreeSize - 1 end end function I4800176_CanUseGiftBag(MapID, InstanceID, TypeID, TargetID) local bRet, bIgnore = 0, false --�жϱ������пռ��Ƿ��㹻 local FreeSize = role.GetBagFreeSize(TargetID) if(FreeSize < 8) then --��ʾ��ұ����ռ䲻�� bRet = 40 end return bRet, bIgnore end aux.RegisterItemEvent(4800176, 1, "I4800176_GiftBag") aux.RegisterItemEvent(4800176, 0, "I4800176_CanUseGiftBag") aux.RegisterItemEvent(4800181, 1, "I4800176_GiftBag") aux.RegisterItemEvent(4800181, 0, "I4800176_CanUseGiftBag") aux.RegisterItemEvent(4800186, 1, "I4800176_GiftBag") aux.RegisterItemEvent(4800186, 0, "I4800176_CanUseGiftBag") --ħ�񱦺� function I4800246_CanUseGiftBag(MapID, InstanceID, TypeID, TargetID) local bRet, bIgnore = 0, false --�жϱ������пռ��Ƿ��㹻 local FreeSize = role.GetBagFreeSize(TargetID) local b = role.GetRoleItemNum(TargetID,4800239) if(FreeSize < 1) then --��ʾ��ұ����ռ䲻�� bRet = 40 end if(b < 1) then --��ʾ��ұ����ռ䲻�� bRet = 103 end return bRet, bIgnore end function I4800246_GiftBag(MapID, InstanceID, TypeID, TargetID) role.RemoveFromRole(MapID, InstanceID, TargetID, 4800239, 1, 101) local k = math.random(800) if k == 800 then role.AddRoleSilver(MapID, InstanceID, TargetID, 10000000, 420) elseif k == 799 then local tbl = {8050310,8050410,8051310,8051410,8060310,8060410,8061310,8061410,8070310,8070410,8071310,8071410,8080310,8080410,8081310,8081410,8090310,8090410,8091310,8091410,8100310,8100410,8100510,8100610,8110310,8111310,8121310,8122310,8130310,8130410} role.AddRoleItem(MapID, InstanceID, TargetID, tbl[math.random(#tbl)], 1, 5, 8, 420) elseif k == 798 then local tbl = {8050309,8050409,8051309,8051409,8060309,8060409,8061309,8061409,8070309,8070409,8071309,8071409,8080309,8080409,8081309,8081409,8090309,8090409,8091309,8091409,8100309,8100409,8100509,8100609,8110309,8111309,8121309,8122309,8130309,8130409} role.AddRoleItem(MapID, InstanceID, TargetID, tbl[math.random(#tbl)], 1, 5, 8, 420) elseif k >= 796 then local tbl = {8050307,8050407,8051307,8051407,8060307,8060407,8061307,8061407,8070307,8070407,8071307,8071407,8080307,8080407,8081307,8081407,8090307,8090407,8091307,8091407,8100307,8100407,8100507,8100607,8110307,8111307,8121307,8122307,8130307,8130407} role.AddRoleItem(MapID, InstanceID, TargetID, tbl[math.random(#tbl)], 1, 5, 8, 420) else local q = math.random(100) if q <= 20 then role.AddRoleSilver(MapID, InstanceID, TargetID, 10000, 420) elseif q <= 28 then role.AddRoleSilver(MapID, InstanceID, TargetID, 100000, 420) elseif q <= 53 then role.AddRoleItem(MapID, InstanceID, TargetID, 4820028, 2, -1, 8, 420) elseif q <= 77 then role.AddRoleItem(MapID, InstanceID, TargetID, 4820024, math.random(1, 3), -1, 8, 420) elseif q <= 100 then role.AddRoleItem(MapID, InstanceID, TargetID, 4820029, math.random(1, 3), -1, 8, 420) end end end aux.RegisterItemEvent(4800246, 1, "I4800246_GiftBag") aux.RegisterItemEvent(4800246, 0, "I4800246_CanUseGiftBag") function I4700260_GiftBag(MapID, InstanceID, TypeID, TargetID) --���ID�� ������ƷTypeID��������Ʒ�ʣ�����ģʽ��log��������Ϣö�� local r = math.random(987400) local temp = 0 local index = 1 local tbl = {} tbl[1]={3020030,1,-1,20000} tbl[2]={4820109,15,-1,40000} tbl[3]={4820120,1,-1,20000} tbl[4]={4820121,1,-1,20000} tbl[5]={4090027,1,-1,20000} tbl[6]={4090011,8,-1,25000} tbl[7]={4700229,1,-1,55000} tbl[8]={4700230,1,-1,55000} tbl[9]={4700231,1,-1,13000} tbl[10]={4820239,1,-1,40000} tbl[11]={3020011,1,-1,35000} tbl[12]={4400031,1,-1,55000} tbl[13]={3070023,2,-1,55000} tbl[14]={4820087,1,-1,25000} tbl[15]={4090010,8,-1,25000} tbl[16]={4090030,1,-1,17000} tbl[17]={4090028,1,-1,17000} tbl[18]={4090031,1,-1,17000} tbl[19]={4090029,1,-1,17000} tbl[20]={9990025,1,6,250} tbl[21]={4820047,2,-1,40000} tbl[22]={4820046,2,-1,45000} tbl[23]={4500002,8,-1,55000} tbl[24]={3070051,8,-1,55000} tbl[25]={5600003,1,-1,40000} tbl[26]={4800154,1,-1,50000} tbl[27]={4800155,1,-1,45500} tbl[28]={4800156,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]={3020089,1,-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} tbl[46]={3030005,1,-1,1300} tbl[47]={3030013,1,-1,1300} tbl[48]={3030019,1,-1,1300} tbl[49]={3030025,1,-1,1300} tbl[50]={3030033,1,-1,1300} tbl[51]={3030041,1,-1,1300} tbl[52]={3030047,1,-1,1300} tbl[53]={3030053,1,-1,1300} tbl[54]={3030058,1,-1,1300} tbl[55]={3030063,1,-1,1300} tbl[56]={3030068,1,-1,1300} tbl[57]={3030076,1,-1,1300} tbl[58]={3030084,1,-1,1300} tbl[59]={3030006,1,-1,900} tbl[60]={3030014,1,-1,900} tbl[61]={3030020,1,-1,900} tbl[62]={3030026,1,-1,900} tbl[63]={3030034,1,-1,900} tbl[64]={3030042,1,-1,900} tbl[65]={3030048,1,-1,900} tbl[66]={3030054,1,-1,900} tbl[67]={3030059,1,-1,900} tbl[68]={3030064,1,-1,900} tbl[69]={3030069,1,-1,900} tbl[70]={3030077,1,-1,900} tbl[71]={3030085,1,-1,900} tbl[72]={3030090,1,-1,900} tbl[73]={3030007,1,-1,450} tbl[74]={3030015,1,-1,450} tbl[75]={3030021,1,-1,450} tbl[76]={3030027,1,-1,450} tbl[77]={3030035,1,-1,450} tbl[78]={3030043,1,-1,450} tbl[79]={3030049,1,-1,450} tbl[80]={3030055,1,-1,450} tbl[81]={3030060,1,-1,450} tbl[82]={3030065,1,-1,450} tbl[83]={3030070,1,-1,450} tbl[84]={3030078,1,-1,450} tbl[85]={3030086,1,-1,450} tbl[86]={3030091,1,-1,450} for i = 1,86 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 I6601126_GiftBag(MapID, InstanceID, TypeID, TargetID) local r = math.random(987400) local temp = 0 local index = 1 local tbl = {} -- Изображение 1: Основные предметы (20 предметов) tbl[1]={4810157,1,-1,20000} -- Демон Микал tbl[2]={4810156,1,-1,40000} -- Дух божественного света Микаэла tbl[3]={5802148,1,-1,20000} -- Камень души +33 tbl[4]={5802147,1,-1,20000} -- Камень души +32 tbl[5]={5802146,1,-1,20000} -- Камень души +31 tbl[6]={5802124,1,-1,25000} -- Магическое ожерелье +33 tbl[7]={5802123,1,-1,20000} -- Магическое ожерелье +32 tbl[8]={5802122,1,-1,20000} -- Магическое ожерелье +31 tbl[9]={6600127,1,-1,20000} -- Набор оружия 95 ур. [часть 1] tbl[10]={6600128,1,-1,20000} -- Набор оружия 95 ур. [часть 2] tbl[11]={6600129,1,-1,20000} -- Набор ожерелий 95 ур. tbl[12]={6600130,1,-1,20000} -- Набор поясов 95 ур. tbl[13]={6600131,1,-1,20000} -- Набор колец 95 ур. [часть 1] tbl[14]={6600132,1,-1,20000} -- Набор колец 95 ур. [часть 2] tbl[15]={6600138,1,-1,20000} -- Набор шлемов 95 ур. tbl[16]={6600134,1,-1,20000} -- Набор плащей 95 ур. tbl[17]={6600135,1,-1,20000} -- Набор перчаток 95 ур. tbl[18]={6600136,1,-1,20000} -- Набор поножей 95 ур. tbl[19]={6600137,1,-1,20000} -- Набор доспехов 95 ур. tbl[20]={6600138,1,-1,20000} -- Набор шлемов 95 ур. (дубль) -- Изображение 2: Драгоценные камни уровня 10 (20 камней) tbl[21]={5802168,1,-1,20000} -- Солнцевик[Ур. 10] tbl[22]={5802240,1,-1,20000} -- Лунник[Ур. 10] tbl[23]={5802463,1,-1,20000} -- Рубин[Ур. 10] tbl[24]={5802528,1,-1,20000} -- Сапфир[Ур. 10] tbl[25]={5802304,1,-1,20000} -- Ляпис[Ур. 10] tbl[26]={5802326,1,-1,20000} -- Гранат[Ур. 10] tbl[27]={5802460,1,-1,20000} -- Диамант[Ур. 10] tbl[28]={5802444,1,-1,20000} -- Бриллиант[Ур. 10] tbl[29]={5802540,1,-1,20000} -- Кровавый сапфир[Ур. 10] tbl[30]={5802348,1,-1,20000} -- Яркий сапфир[Ур. 10] tbl[31]={5802390,1,-1,20000} -- Топаз[Ур. 10] tbl[32]={5802292,1,-1,20000} -- Александрит[Ур. 10] tbl[33]={5802298,1,-1,20000} -- Большой шаровик[Ур. 10] tbl[34]={5802432,1,-1,20000} -- Циркон[Ур. 10] tbl[35]={5802438,1,-1,20000} -- Янтарь[Ур. 10] tbl[36]={5802323,1,-1,20000} -- Лазурит[Ур. 10] tbl[37]={5802454,1,-1,20000} -- Аметист[Ур. 10] tbl[38]={5802259,1,-1,20000} -- Малахит[Ур. 10] tbl[39]={5802181,1,-1,20000} -- Жемчуг[Ур. 10] tbl[40]={6601002,1,-1,20000} -- Берилл[Ур. 10] -- Изображение 3: Драгоценные камни уровня 9 (20 камней) tbl[41]={3030154,1,-1,20000} -- Солнцевик[Ур. 9] tbl[42]={3030155,1,-1,20000} -- Лунник[Ур. 9] tbl[43]={3030165,1,-1,20000} -- Рубин[Ур. 9] tbl[44]={3030166,1,-1,20000} -- Сапфир[Ур. 9] tbl[45]={3030158,1,-1,20000} -- Ляпис[Ур. 9] tbl[46]={3030159,1,-1,20000} -- Гранат[Ур. 9] tbl[47]={3030435,1,-1,20000} -- Диамант[Ур. 9] tbl[48]={3030164,1,-1,20000} -- Бриллиант[Ур. 9] tbl[49]={3030167,1,-1,20000} -- Кровавый сапфир[Ур. 9] tbl[50]={3030160,1,-1,20000} -- Яркий сапфир[Ур. 9] tbl[51]={3030161,1,-1,20000} -- Топаз[Ур. 9] tbl[52]={3030156,1,-1,20000} -- Александрит[Ур. 9] tbl[53]={3030157,1,-1,20000} -- Большой шаровик[Ур. 9] tbl[54]={3030162,1,-1,20000} -- Циркон[Ур. 9] tbl[55]={3030163,1,-1,20000} -- Янтарь[Ур. 9] tbl[56]={3030475,1,-1,20000} -- Лазурит[Ур. 9] tbl[57]={3030482,1,-1,20000} -- Аметист[Ур. 9] tbl[58]={3030489,1,-1,20000} -- Малахит[Ур. 9] tbl[59]={3030468,1,-1,20000} -- Жемчуг[Ур. 9] tbl[60]={6601001,1,-1,20000} -- Берилл[Ур. 9] -- Изображение 3: Остальные предметы (14 предметов) tbl[61]={3500208,1,-1,20000} -- Ядро души эльфа [110] tbl[62]={4810109,1,-1,20000} -- Плейона tbl[63]={3020013,1,-1,20000} -- Божественная руна удачи tbl[64]={3500023,1,-1,20000} -- Особая руна способностей tbl[65]={4820256,1,-1,20000} -- Книга Астролога tbl[66]={4999004,1,-1,20000} -- Улучшенный рунный камень tbl[67]={3500207,1,-1,20000} -- Ядро души эльфа [100] tbl[68]={4820274,1,-1,20000} -- Дух элементалей tbl[69]={4820273,1,-1,20000} -- Осколок элементалей tbl[70]={4820238,1,-1,20000} -- Мощный экстракт кристалла tbl[71]={4820084,1,-1,20000} -- Руна Кристалла tbl[72]={4820047,1,-1,20000} -- Черная дыра tbl[73]={3070056,1,-1,20000} -- Заказ [перс.] tbl[74]={3070018,1,-1,20000} -- Свиток воскрешения local totalItems = 74 -- Цикл по всем элементам for i = 1, totalItems do if tbl[i] and tbl[i][4] then temp = temp + tbl[i][4] if temp >= r then index = i break end end end -- Если r больше суммы всех весов, используем последний элемент if temp < r then index = totalItems 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 if tbl[index] and tbl[index][1] and tbl[index][1] ~= 0 then role.AddRoleItem(MapID, InstanceID, TargetID, tbl[index][1], tbl[index][2], tbl[index][3], 8, 420) end end function I6601126_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(6601126, 1, "I6601126_GiftBag") aux.RegisterItemEvent(6601126, 0, "I6601126_CanUseGiftBag")