Jump to content
Elazul

Furnace of Immortality issue

Recommended Posts

Hello

 

I am having an issue with the Furnace of Immortality, it doesn't let me upgrade equipment. Be it Black Dragon, Kylin or Lv 70 Boss Stones. I just get a System Notice saying "Request was rejected", when I go into lua.err.text I see...

[12-25 18:14:17]DoString can_tichun_item
[12-25 18:14:17]./resource/script\calculate\forge.lua:3593: `for' limit must be a number

If I open forge.lua and look for the line 3593 I get "for i = 1, Upgrade.Items do"

 

The function is: 

function can_tichun_item_main(Table)
    local role = 0
    local ItemBag = {}                                   
    local ItemCount = {}                                   
    local ItemBagCount = {}                                   
    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)
    if ItemCount[0] ~= 1 or ItemCount[1] ~= 1 or ItemBagCount[0] ~= 1 or ItemBagCount[1] ~= 1 then
        SystemNotice(role,"Equipment quantity illegal.")
        return 0
    end
    local ItemMain = GetChaItem(role, 2, ItemBag[0])
    local ItemCatalyst = GetChaItem(role, 2, ItemBag[1])
    local ItemType_mainitem = GetItemType(ItemMain)
    local ItemType_otheritem = GetItemType(ItemCatalyst)
        local ItemMainID = GetItemID(ItemMain)
        local ItemCatalystID = GetItemID(ItemCatalyst)
    local ItemMainID_Lv = GetItemLv(ItemMain)
    local ItemCatalystID_Lv = GetItemLv(ItemCatalyst)
    local MainID = ItemMainID   
        local CatalystID=ItemCatalystID
    if MainID > 5000 then
        MainID = GetItemAttr(ItemMain, ITEMATTR_VAL_FUSIONID)
    end
    local Check = 0
    for i = 1, Upgrade.Items do
        if ItemMainID == Upgrade[i].ID then
            if ItemCatalystID == Upgrade[i].Catalyst then
                Check = 1
            end
        end
    end
    if Check == 0 then
        SystemNotice(role ,"Please use the correct equipment and upgrade stone.")
        return 0   
    end
    local Money_Need = gettichun_money_main(Table)
    local Money_Have = GetChaAttr(role, ATTR_GD)
    if Money_Need > Money_Have then
        SystemNotice(role,"Insufficient Gold, unable to upgrade equipment.")
        return 0
    end
    return 1
end

What could be the issue? All other interactions with the Furnace work as they should (I can extract gems, recharge corals and repair lifeskill tools).

Special set upgrade allow me to select any item in the inventory, while the other options don't.

I am using version 1.36.

 

Thank you

Share this post


Link to post
Share on other sites

Hello @Elazul!

First we talk about the "for" loop which you having problem.

 

https://www.tutorialspoint.com/lua/lua_for_loop.htm

 

The line error from log in code:

 for i = 1, Upgrade.Items do

It trying to get size of the table for upgrade items, the correct way should be like that:

 

 for i = 1, table.getn(Upgrade) do

replace to the following above in codes and it work.

  • Thanks 1

lelouch_signature_by_vahntheknight-d4uafwj.png

Share this post


Link to post
Share on other sites
On 12/25/2020 at 11:35 PM, Eviles said:

Hello @Elazul!

First we talk about the "for" loop which you having problem.

 

https://www.tutorialspoint.com/lua/lua_for_loop.htm

 

The line error from log in code:


 for i = 1, Upgrade.Items do

It trying to get size of the table for upgrade items, the correct way should be like that:

 


 for i = 1, table.getn(Upgrade) do

replace to the following above in codes and it work.

or simply:

 for i = 1, #Upgrade do

 

Share this post


Link to post
Share on other sites
7 hours ago, Snowfall said:

or simply:


 for i = 1, #Upgrade do

 

This lenght operator introducted only after Lua v5.1, gameserver 1.x uses Lua v5.0.


lelouch_signature_by_vahntheknight-d4uafwj.png

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...