Jump to content
OldHero

Extract gems[ring,neck]

Recommended Posts

Hello guys i install extract func from lucky arhive and i have weird prob i put gemed ring in 4rd slot and when i click extract i get this bug can help me to solve ???

16.png

Edited by OldHero

Share this post


Link to post
Share on other sites

Hello this is script

this in function 

function CheckEquipHasGem(role)                                                                       
    local Item_CanGet = GetChaFreeBagGridNum(role)       
        if Item_CanGet < 1 then
        SystemNotice(role,"You need at least 1 slot in your inventory")
        UseItemFailed(role)
        return 0
    end
  
    local MainEquip = GetChaItem ( role , 2 , 3 )
    local Item_Stone = {}
    local Item_StoneLv = {}
    local Param = GetItemForgeParam ( MainEquip , 1 )
    Param = TansferNum ( Param )
    Item_Stone[0] = GetNum_Part2 ( Param )
    Item_Stone[1] = GetNum_Part4 ( Param )
    Item_Stone[2] = GetNum_Part6 ( Param )
    Item_StoneLv[0] = GetNum_Part3 ( Param )
    Item_StoneLv[1] = GetNum_Part5 ( Param )
    Item_StoneLv[2] = GetNum_Part7 ( Param )
    local ItemType = CheckItem_CanJinglian(Item_mainitem)
    
    if MainEquip == nil then
        HelpInfo(role,0,"You must put a equipment on your 4th Inventory Slot.")
        return 0
    end
    
    if ItemType == 0 then
        HelpInfo(role,0,"Item type mismatch.")
        return 0        
    end
    
    if Item_Stone[0] == 0 and Item_Stone[1] == 0 and Item_Stone[2] == 0 then
        HelpInfo(role,0,"Your equipment is not forged with gem.")
        return 0                
    end
    return 1
end

function GiveGemExtracted(role)
    if CheckEquipHasGem(role) == 0 then
        return
    end
 
    local MainEquip = GetChaItem ( role , 2 , 3 )    
    local Num = GetItemForgeParam ( MainEquip , 1 )
    Num = TansferNum ( Num )
    local lg_Num = Num
    local Item_Stone = {}
    local Item_StoneLv = {}
    local Item_StoneID = {}      
    Item_Stone[0] = GetNum_Part2 ( Num )
    Item_Stone[1] = GetNum_Part4 ( Num )
    Item_Stone[2] = GetNum_Part6 ( Num )
    Item_StoneLv[0] = GetNum_Part3 ( Num )
    Item_StoneLv[1] = GetNum_Part5 ( Num )
    Item_StoneLv[2] = GetNum_Part7 ( Num )
    Item_StoneID[0] = StoneTpye_ID[Item_Stone[0]]
    Item_StoneID[1] = StoneTpye_ID[Item_Stone[1]]
    Item_StoneID[2] = StoneTpye_ID[Item_Stone[2]]

    local r1 = 0
    local r2 = 0
    local Item_Lv = 0
    local item_tureID = 0 
        if Item_StoneID[0] ~= 0 then
            item_tureID = Item_StoneID[0]
            Item_Lv = Item_StoneLv[0]
            Item_StoneLv[0] = Item_StoneLv[0]-1
                if Item_StoneLv[0] == 0 then
                    Item_Stone[0] = 0
                end
        elseif Item_StoneID[0] == 0 and Item_StoneID[1] ~= 0 then
            item_tureID = Item_StoneID[1]
            Item_Lv = Item_StoneLv[1]
                Item_StoneLv[1] = Item_StoneLv[1]-1
                if Item_StoneLv[1] == 0 then
                        Item_Stone[1] = 0
                end
        elseif Item_StoneID[0] == 0 and Item_StoneID[1] == 0 and Item_StoneID[2] ~= 0 then
                item_tureID = Item_StoneID[2]
                Item_Lv = Item_StoneLv[2]
                Item_StoneLv[2] = Item_StoneLv[2]-1
                if Item_StoneLv[2] == 0 then
                    Item_Stone[2] = 0
                end
    else 
        HelpInfo(role,0,"Gem extraction ID error")
            return          
    end
    r1,r2 = MakeItem ( role , item_tureID , 1 , 2 )  
    local Item_ture = GetChaItem ( role , 2 , r2 ) 
    SetItemAttr ( Item_ture , ITEMATTR_VAL_BaoshiLV , Item_Lv )
        
    Num = SetNum_Part2 ( Num , Item_Stone[0] )
    Num = SetNum_Part3 ( Num , Item_StoneLv[0] )
    Num = SetNum_Part4 ( Num , Item_Stone[1] )
    Num = SetNum_Part5 ( Num , Item_StoneLv[1] )
    Num = SetNum_Part6 ( Num , Item_Stone[2] )
    Num = SetNum_Part7 ( Num , Item_StoneLv[2] )
    SetItemForgeParam ( MainEquip , 1 , Num )
    local cha_name = GetChaDefaultName ( role )
    LG( "Extract Gem Sucessfull" ,cha_name, item_tureID , Item_Lv , lg_Num , Num )
    RefreshCha(role)    
end

 

 

 

 

 

and In npc sdk i added this

elseif item.func == GiveGemExtracted then
            return GiveGemExtracted(character)

 

hmm?

 

 

Share this post


Link to post
Share on other sites
3 hours ago, KONG said:

Hello. There is a better method that requires 2 byte to be changed at client side, then it can be extracted with the native ui. Also the lua in variable.lua

And you were completely ignored, hahah. Mind sharing a guide on how to do that? 

  • Like 3

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