Jump to content

space

Members
  • Content Count

    4
  • Joined

  • Last visited

Posts posted by space


  1. 9 hours ago, Angelix said:

    Can you please post can_unite_item_main function so we can help you.

    function can_unite_item_main ( Table )
    --    SystemNotice ( Table[1] , "Entering combining main function")
        local role = 0
        local ItemBag = {}                                        --µÀ¾ß±³°üλÖÃ
        local ItemCount = {}                                        --µÀ¾ßÊýÁ¿
        local ItemBagCount = {}                                        --µÀ¾ß¶ÔÏóÊýÁ¿
        local Get_Count = 4
        local ItemReadCount = 0
        local ItemReadNow = 1
        local ItemReadNext = 0
        local ItemBag_Now = 0
        local ItemCount_Now = 0
        local ItemBagCount_Num = 0

    --    SystemNotice( arg[1] , "start transfer parameter analysis")

        
        role , ItemBag , ItemCount , ItemBagCount , ItemBag_Now , ItemCount_Now , ItemBagCount_Num = Read_Table ( Table )

    --    for kkk = 0 , 2 , 1 do
    --        SystemNotice ( role , ItemBagCount[kkk])
    --        SystemNotice ( role , ItemBag[kkk])
    --        SystemNotice ( role , ItemCount[kkk])
    --    end
        
    --    Notice(role , "11111")
        local i = 0
        for i = 0 , 2 , 1 do                            --ÅжϵÀ¾ß¶ÔÏó¸öÊýºÍµÀ¾ß¸öÊýÊÇ·ñºÍ·¨
            if ItemBagCount ~= 1 or ItemCount ~= 1 then
    --            SystemNotice( role , "ItemBagCount = "..ItemBagCount)
    --            SystemNotice( role , "ItemCount = "..ItemCount)
                SystemNotice( role , "Item target unit and item unit illegal")
                return 0
            end
        end

        
        
        local BagItem1 = ItemBag [0]
        local BagItem2 = ItemBag [1]
        local BagItem3 = ItemBag [2]

        local Item1 = GetChaItem ( role , 2 , BagItem1 )            --È¡µÀ¾ßÖ¸Õë
        local Item2 = GetChaItem ( role , 2 , BagItem2 )
        local Item3 = GetChaItem ( role , 2 , BagItem3 )
        
        local ItemID1 = GetItemID ( Item1 )                    --È¡µÀ¾ß±àºÅ
        local ItemID2 = GetItemID ( Item2 )
        local ItemID3 = GetItemID ( Item3 )

        local ItemType1 = GetItemType ( Item1 )
        local ItemType2 = GetItemType ( Item2 )
        local ItemType3 = GetItemType ( Item3 )

        if ItemType1 ~= 47 then                    --ÅжϾíÖáÊÇ·ñÕýÈ·
            
            SystemNotice( role ,"This is not a combining scroll")
            return 0
        end

        if ItemType2 ~= 49 or ItemType3 ~= 49 then            --ÅжÏÊÇ·ñÊDZ¦Ê¯
            if ItemType2 ~= 50 or ItemType3 ~= 50 then
                SystemNotice( role , "This is not a Gem")
                return 0
            end
        end

        if ItemID2 ~= ItemID3 then                        --ÅжÏÁ½¸ö±¦Ê¯ÊÇ·ñͬÀà
            SystemNotice(role ,"Gem mismatch")

            return 0
        end

        local Item2_Lv = Get_StoneLv ( Item2 )                    --È¡±¦Ê¯µÈ¼¶
        local Item3_Lv = Get_StoneLv ( Item3 )

        
        if ItemType2 == 49 and ItemType3 == 49 then
            if Item2_Lv >= 9 or Item3_Lv >= 9 then
                SystemNotice ( role , "Gem Lv max")
                return 0
            end
        end

        if Item2_Lv ~= Item3_Lv then 
            
            SystemNotice(role ,"Level of 2 gems does not match")
            return 0
        end
    --    SystemNotice ( role , "determination successful")
        local Money_Need = getunite_money_main ( Table )
        local Money_Have = GetChaAttr ( role , ATTR_GD )
        if Money_Need > Money_Have then
            SystemNotice( role ,"Insufficient gold. Unable to combine")
            return 0
        end
        

        return 1
    end
     

×
×
  • Create New...