Jump to content
space

Max gem lvl

Recommended Posts

@space  abre você  forge.lua

 

**  procurar por ->   função can_unite_item_main (Tabela)

 

** então dentro desta função você encontrará isto.

 

      local Item2_Lv = Get_StoneLv (Item2)
      local Item3_Lv = Get_StoneLv (Item3)

 

** adicione abaixo.

 

se ItemID2> = 864 e ItemID2 <= 865 e ItemID2 <= 866 ENTÃO 
        SE Item2_Lv> = 7 OU Item3_Lv> = 7 ENTÃO -
            Altere o valor máximo lv gem SystemNotice (Função "Voltado para o Nível 7 não máximo")
            Retornar 0
        end
    end

 

** 864, 865 e 866 IDS GEMS.

** se Item2_Lv> = 7 ou Item3_Lv> = 7 então - Trocador você max lv gem

 

*** seria assim

 

Citar

função can_unite_item_main (Tabela)
    função local = 0
    ItemBag locais = {}                                        
    ItemCount locais = {}                                    
    ItemBagCount = {} locais                                    
    get_Count = 4 locais
    ItemReadCount locais = 0
    ItemReadNow locais = 1
    ItemReadNext locais = 0
    ItemBag_Now locais = 0
    ItemCount_Now locais = 0
    ItemBagCount_Num locais = 0


    
    papel, ItemBag, ItemCount, ItemBagCount, ItemBag_Now, ItemCount_Now, ItemBagCount_Num = Leitura_Tabela (Tabela)


    i local = 0
    para i = 0, 2, 1 fazer                            
        se ItemBagCount ~ = 1 ItemCount ou ~ = 1, então
            SystemNotice (papel, "unidade de Item e unidade alvo item de ilegal")
            0 retorno
        final
    final

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

    local Item1 = GetChaItem (papel, 2, BagItem1)        
    local Item2 = GetChaItem (papel, 2, BagItem2)
    local Item3 = GetChaItem (função, 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 (função, "Isto não é uma rolagem combinada")         return 0     end
        

 

    if ItemType2 ~= 49 or ItemType3 ~= 49 then        
        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 )

    Se ItemID2> = 864 e ItemID2 <= 865 e ItemID2 <= 866, então, 
        se Item2_Lv> = 7 ou Item3_Lv> = 7, então 
            SystemNotice (função, "Geometria aprimorada para o nível 7 no máximo.")
            retornará 0
        end
    end

    se ItemType2 == 49 e ItemType3 == 49 então
        se Item2_Lv> = 9 ou Item3_Lv> = 9 então
            SystemNotice (função, "Gem Lv max")
            retornará 0
        end
    end     se Item2_Lv ~ = Item3_Lv então          SystemNotice (role, "Level of 2 gemas não corresponde a ")         return 0     end
    


 

    local Money_Need = getunite_money_main (Tabela)
    local Money_Have = GetChaAttr (função, ATTR_GD)
    se Money_Need> Money_Have em seguida,
        SystemNotice (função, "Ouro insuficiente. Impossível combinar")
        return 0
    end
    return 1
end

desculpe pelo meu inglês.

Edited by 1g0rS1lv4

Being better than others is for those who are weak; what matters is to be true to yourself.         

 

Share this post


Link to post
Share on other sites

@space  open you  forge.lua

 

**  search for:  function can_unite_item_main ( Table )

 

** then within this function you will find this.

 

    local Item2_Lv = Get_StoneLv ( Item2 )
    local Item3_Lv = Get_StoneLv ( Item3 )

 

** add this below the function

 

if ItemID2 <= 860 and ItemID2 <= 861 and ItemID2 <= 862 and ItemID2 <= 863 then 
        if Item2_Lv>=7 or Item3_Lv >= 7 then 
            SystemNotice ( role , "Gem can improved to level 7 at most.")
            return 0
        end
    end

 
** Gems IDS
** if ItemID2 <= 860 and ItemID2 <= 861 and ItemID2 <= 862 and ItemID2 <= 863 then 
** Level Max Gem Is Lv7 - you can switch to the desired max level
**  if Item2_Lv>=7 or Item3_Lv >= 7 then 

 

*** the function would look this way.

Цитата

function can_unite_item_main ( Table )
    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

    
    role , ItemBag , ItemCount , ItemBagCount , ItemBag_Now , ItemCount_Now , ItemBagCount_Num = Read_Table ( Table )
    local i = 0
    for i = 0 , 2 , 1 do                            
        if ItemBagCount ~= 1 or ItemCount ~= 1 then    
            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        
        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 ItemID2 <= 860 and ItemID2 <= 861 and ItemID2 <= 862 and ItemID2 <= 863 then 
        if Item2_Lv>=7 or Item3_Lv >= 7 then 
            SystemNotice ( role , "Gem can improved to level 7 at most.")
            return 0
        end
    end

    
    if Item2_Lv ~= Item3_Lv then 
        SystemNotice(role ,"Level of 2 gems does not match")
        return 0
    end
    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
 

sorry for my bad English.


Being better than others is for those who are weak; what matters is to be true to yourself.         

 

Share this post


Link to post
Share on other sites
Только что, 1g0rS1lv4 сказал:

@space  open you  forge.lua

 

**  search for:  function can_unite_item_main ( Table )

 

** then within this function you will find this.

 

    local Item2_Lv = Get_StoneLv ( Item2 )
    local Item3_Lv = Get_StoneLv ( Item3 )

 

** add this below the function

 

if ItemID2 <= 860 and ItemID2 <= 861 and ItemID2 <= 862 and ItemID2 <= 863 then 
        if Item2_Lv>=7 or Item3_Lv >= 7 then 
            SystemNotice ( role , "Gem can improved to level 7 at most.")
            return 0
        end
    end

 
** Gems IDS
** if ItemID2 <= 860 and ItemID2 <= 861 and ItemID2 <= 862 and ItemID2 <= 863 then 
** Level Max Gem Is Lv7 - you can switch to the desired max level
**  if Item2_Lv>=7 or Item3_Lv >= 7 then 

 

*** the function would look this way.

 

Цитата

function can_unite_item_main ( Table )
    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

    
    role , ItemBag , ItemCount , ItemBagCount , ItemBag_Now , ItemCount_Now , ItemBagCount_Num = Read_Table ( Table )
    local i = 0
    for i = 0 , 2 , 1 do                            
        if ItemBagCount ~= 1 or ItemCount ~= 1 then    
            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        
        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 ItemID2 <= 860 and ItemID2 <= 861 and ItemID2 <= 862 and ItemID2 <= 863 then 
        if Item2_Lv>=7 or Item3_Lv >= 7 then 
            SystemNotice ( role , "Gem can improved to level 7 at most.")
            return 0
        end
    end

    
    se Item2_Lv ~ = Item3_Lv então 
        SystemNotice (função, "Nível de 2 gemas não corresponde")
        return 0
    end
    local Money_Need = getunite_money_main (Tabela)
    local Money_Have = GetChaAttr (função, ATTR_GD)
    se Money_Need> Money_Have então
        SystemNotice (função, "Insuficiente Não é possível combinar ")
        return 0
    end
    return 1
end

desculpe pelo meu mau inglês.

 

Edited by 1g0rS1lv4

Being better than others is for those who are weak; what matters is to be true to yourself.         

 

Share this post


Link to post
Share on other sites
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
 

Share this post


Link to post
Share on other sites

Replace:

    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

For this:

	local MAX_LEVEL_GEM = 4
	if ItemType2 == 49 and ItemType3 == 49 then
		if Item2_Lv ~= Item3_Lv or Item2_Lv >= math.min(MAX_LEVEL_GEM, 9) then
			SystemNotice(role, "The level of both gems do not match or have reached maximum level.")
			return 0
		end
	end

 

This will prohibit players from combining gems above the maximum level (that will be the one you place or at most level 9). This will prevent players from having gems above the said max level and therefor from forging higher gems onto equipment.

Edited by Angelix
  • Thanks 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...