Vendetta 0 Report post Posted May 16, 2016 Can someone help me to fix the Lv4 Gem Combiner? The problem is that when i have higher level gem or any gem that are level 2+ the NPC is getting it when im using the combiner. It is a hassle for the players to go to bank or drop the gem just to use the combiner. Can someone share their knowledge and help me with this please. I know that other people have a problem with this too. Thanks in advance, cheers! Quote Share this post Link to post Share on other sites
Andy 39 Report post Posted May 16, 2016 (edited) npc add functions scrips , instead of exchange scrips. and add requriments and so in the functions ones. Edited May 16, 2016 by Andy 1 Quote Share this post Link to post Share on other sites
Anthoni 5 Report post Posted May 16, 2016 (edited) 4 hours ago, Andy said: npc add functions scrips , instead of exchange scrips. and add requriments and so in the functions ones. Can share function here? Edited May 16, 2016 by Anthoni Quote Share this post Link to post Share on other sites
MonkeyCode 453 Report post Posted May 16, 2016 function CombineGem(role, gemId, level) local chaBag = GetKbCap(role) local gemSlot,gemLv; local t = {} for i = 0, chaBag do gemSlot = GetChaItem(role, 2, i) if GetItemID(gemSlot) == gemId then gemLv = GetItemAttr(gemSlot, ITEMATTR_VAL_BaoshiLV) if gemLv == 1 then table.insert(t, i) end end end local needqty = 2^(level-1) local giveLv = 100+level if table.getn(t) < needqty then SystemNotice(role, "Failed to combine lv"..level.." "..GetItemName(gemId)..". Unable to find x"..needqty.." "..GetItemName(gemId).."!") else for i = 1, needqty do RemoveChaItem(role, gemId, 1, 2, t[i], 2, 0) end GiveItem(role, 0, gemId, 1, giveLv) end end NpcSdk.lua: elseif item.func == CombineGem then return CombineGem(character, item.p1, item.p2) Usage: Text(1, GetItemName(0863), CombineGem, 0863, 4) -- Lv4 Gem of Rage Text(1, GetItemName(0860), CombineGem, 0860, 8) -- Lv8 Gem of Wind The code may not be too optimized, but the logic is what you seek. =P 1 Quote Share this post Link to post Share on other sites
TheSamurai 3 Report post Posted May 21, 2016 Thanks sir @xtc i'll try this out. Quote Share this post Link to post Share on other sites