function I4810066_GiftBag(MapID, InstanceID, TypeID, TargetID) local tab = {} tab[4810066] = {9999067} tab[4810067] = {9999068} tab[4810068] = {9999069} tab[4810069] = {9999070} tab[4810070] = {9999071} tab[4810071] = {9999072} tab[4810072] = {9999073} tab[4810073] = {9999074} tab[4810074] = {9999075} tab[7100223] = {9850319} tab[7100224] = {9850314} tab[7100225] = {9850315} tab[7100226] = {9850316} role.AddRoleItem(MapID, InstanceID, TargetID, tab[TypeID][1], 1, 6, 8, 420) end aux.RegisterItemEvent(4810066, 1, "I4810066_GiftBag") aux.RegisterItemEvent(4810067, 1, "I4810066_GiftBag") aux.RegisterItemEvent(4810068, 1, "I4810066_GiftBag") aux.RegisterItemEvent(4810069, 1, "I4810066_GiftBag") aux.RegisterItemEvent(4810070, 1, "I4810066_GiftBag") aux.RegisterItemEvent(4810071, 1, "I4810066_GiftBag") aux.RegisterItemEvent(4810072, 1, "I4810066_GiftBag") aux.RegisterItemEvent(4810073, 1, "I4810066_GiftBag") aux.RegisterItemEvent(4810074, 1, "I4810066_GiftBag") aux.RegisterItemEvent(7100223, 1, "I4810066_GiftBag") aux.RegisterItemEvent(7100224, 1, "I4810066_GiftBag") aux.RegisterItemEvent(7100225, 1, "I4810066_GiftBag") aux.RegisterItemEvent(7100226, 1, "I4810066_GiftBag") function I4810066_CanUseGiftBag(MapID, InstanceID, TypeID, TargetID) local bRet, bIgnore = 0, false --判断背包空闲空间是否足够 local FreeSize = role.GetBagFreeSize(TargetID) if(FreeSize < 1) then --提示玩家背包空间不足 local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 26, 100003) msg.AddMsgEvent(MsgID, 13, 1) msg.DispatchRoleMsgEvent(RoleID, MsgID) bRet = 40 end return bRet, bIgnore end aux.RegisterItemEvent(4810066, 0, "I4810066_CanUseGiftBag") aux.RegisterItemEvent(4810067, 0, "I4810066_CanUseGiftBag") aux.RegisterItemEvent(4810068, 0, "I4810066_CanUseGiftBag") aux.RegisterItemEvent(4810069, 0, "I4810066_CanUseGiftBag") aux.RegisterItemEvent(4810070, 0, "I4810066_CanUseGiftBag") aux.RegisterItemEvent(4810071, 0, "I4810066_CanUseGiftBag") aux.RegisterItemEvent(4810072, 0, "I4810066_CanUseGiftBag") aux.RegisterItemEvent(4810073, 0, "I4810066_CanUseGiftBag") aux.RegisterItemEvent(4810074, 0, "I4810066_CanUseGiftBag") aux.RegisterItemEvent(7100223, 0, "I4810066_CanUseGiftBag") aux.RegisterItemEvent(7100224, 0, "I4810066_CanUseGiftBag") aux.RegisterItemEvent(7100225, 0, "I4810066_CanUseGiftBag") aux.RegisterItemEvent(7100226, 0, "I4810066_CanUseGiftBag") function I7100256_GiftBag(MapID, InstanceID, TypeID, TargetID) local tab = {} tab[7100256] = {7100255} tab[7100257] = {7100253} tab[7100258] = {7100254} role.AddRoleItem(MapID, InstanceID, TargetID, tab[TypeID][1], 5, 6, 8, 420) end aux.RegisterItemEvent(7100256, 1, "I7100256_GiftBag") aux.RegisterItemEvent(7100257, 1, "I7100256_GiftBag") aux.RegisterItemEvent(7100258, 1, "I7100256_GiftBag") function I7100256_CanUseGiftBag(MapID, InstanceID, TypeID, TargetID) local bRet, bIgnore = 0, false --判断背包空闲空间是否足够 local FreeSize = role.GetBagFreeSize(TargetID) if(FreeSize < 1) then --提示玩家背包空间不足 local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 26, 100003) msg.AddMsgEvent(MsgID, 9, 1) msg.DispatchRoleMsgEvent(RoleID, MsgID) bRet = 40 end return bRet, bIgnore end aux.RegisterItemEvent(7100256, 0, "I7100256_CanUseGiftBag") aux.RegisterItemEvent(7100257, 0, "I7100256_CanUseGiftBag") aux.RegisterItemEvent(7100258, 0, "I7100256_CanUseGiftBag")