Jump to content
FapFap

110% apparel effect

Recommended Posts

wondering is anyone had this problem before, when trying to make 110%, when i fail the system removes 2x Strenghening Crystals instead of 1 , how to fix this bug?

Share this post


Link to post
Share on other sites

@FapFap, do you see any messages in the system chat after you perform apparel strengthening? Look for them in file forge.lua and you will find code that removes Strengthening Crystals.


Share this post


Link to post
Share on other sites
19 minutes ago, V3ct0r said:

@FapFap, do you see any messages in the system chat after you perform apparel strengthening? Look for them in file forge.lua and you will find code that removes Strengthening Crystals.

the message in system says it failed but it takes 2 crystal instead of 1 when it fails, if success its taking just one, i tried to use clean function's from pko1.38 files and pko 1.36 but still takes 2 crystals when fails

Share this post


Link to post
Share on other sites

@Inuarashi 

function can_beuplv_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 ItemBagCount_beuplv = ItemBagCount [1]
	local ItemBag_beuplv = ItemBag [1]
	local ItemNum_beuplv = ItemCount [1]
	local Item_beuplv = GetChaItem ( role , 2 , ItemBag_beuplv )
	local Item_beuplv_Type = GetItemType ( Item_beuplv )
	local Item_beuplv_ID = GetItemID ( Item_beuplv )
	local Item_ScItem = GetChaItem ( role , 2 , ItemBag [0] )
	local Item_YxItem = GetChaItem ( role , 2 , ItemBag [2] )
	local Item_ScItem_ID = GetItemID ( Item_ScItem )
	local Item_YxItem_ID = GetItemID ( Item_YxItem )
	local Item_ScItem_Type = GetItemType ( Item_ScItem )
	local Item_YxItem_Type = GetItemType ( Item_YxItem )
	local Item_beuplv_Lv =  Get_Itembeuplv_Lv ( Item_beuplv )
	local ItemAttr_Val_Fusionid = GetItemAttr ( Item_beuplv , ITEMATTR_VAL_FUSIONID )
	local ItemID_Waiguan = GetItemAttr ( Item_beuplv , ITEMATTR_MAXURE )
	if Item_beuplv_ID < 5001 or Item_beuplv_ID > 7000 then
		SystemNotice( role ,"non fusion item ")
		return 0
	end
	if  ItemAttr_Val_Fusionid == 0 then
		SystemNotice( role , "Item cannot be upgraded as item has not undergo fusion")
		return 0
	end
	local oldcrystal = 456;
	local newcrystal = 7597;
	if Item_beuplv_Lv >= MaxLv_Eff then		-- Apparel Upgrade		
		SystemNotice( role ,"Item level limit max. Unable to level again")
		return 0
	end
	if ItemBagCount_beuplv ~= 1 then
		SystemNotice( role , "Strengthening item level slot illegal ")
		return 0
	end
	if Item_ScItem_Type ~= 62 then
		SystemNotice( role , "Invalid Strengthening scroll type ")
		return 0
	end
	if Item_YxItem_Type ~= 63 then
		SystemNotice( role , "Strengthening gem type illegal ")
		return 0
	end
	if ItemNum_beuplv ~= 1 then
		SystemNotice( role , "Illegal force item upgrade number")
		return 0
	end
	if ItemCount [0] ~= 1 or ItemCount [2] ~= 1 or ItemBagCount [0] ~= 1 or ItemBagCount [2] ~= 1 then
		SystemNotice ( role ,"Item mall items or game items error")
		return 0
	end

	local Money_Need = getupgrade_money_main ( Table )
	local Money_Have = GetChaAttr ( role , ATTR_GD )
	if Money_Need > Money_Have then
		SystemNotice( role ,"Insufficient gold. Unable to level up equipment")
		return 0
	end
	return 1
end



--开始强化升级
function begin_upgrade_item (...)
	local Check_Canbeuplv = 0
	Check_Canbeuplv = can_beuplv_item_main ( arg )
	if Check_Canbeuplv == 0 then
		return 0
	end
	local role = 0
	local ItemBag = {}
	local ItemCount = {}
	local ItemBagCount = {}
	local Get_Count = 4
	local ItemReadCount = 0
	local ItemReadNow = 1
	local ItemReadNext = 0
	local ItemBag_Num = 0
	local ItemCount_Num = 0
	local ItemBagCount_Num = 0
	role , ItemBag , ItemCount , ItemBagCount , ItemBag_Num , ItemCount_Num , ItemBagCount_Num = Read_Table ( arg )
	local ItemBag_beuplv = ItemBag [1]
	local Item_beuplv = GetChaItem ( role , 2 , ItemBag_beuplv )
	local Item_ScItem = GetChaItem ( role , 2 , ItemBag [0] )
	local Item_YxItem = GetChaItem ( role , 2 , ItemBag [2] )
	local Item_ScItem_ID = GetItemID ( Item_ScItem )
	local Item_YxItem_ID = GetItemID ( Item_YxItem )
	local Item_beuplv_Lv =  Get_Itembeuplv_Lv ( Item_beuplv )
	local R1 = 0
	local R2 = 0
	R1 = RemoveChaItem ( role , Item_ScItem_ID , 1 , 2 , ItemBag [0] , 2 , 1 , 0 )
	R2 = RemoveChaItem ( role , Item_YxItem_ID , 1 , 2 , ItemBag [2] , 2 , 1 , 0 )
	if R1 == 0 or R2 == 0 then LG( "beuplv" , "Delete item failed" ) end

	local Money_Need = getupgrade_money_main ( arg )
	local Money_Have = GetChaAttr ( role , ATTR_GD )
	Money_Have = Money_Have - Money_Need
	SetCharaAttr ( Money_Have , role , ATTR_GD )
	ALLExAttrSet( role )

	local a = Check_CG_beuplv ( Item_beuplv_Lv )
	if a == 0 then
		R1 = RemoveChaItem ( role , Item_ScItem_ID , 1 , 2 , ItemBag [0] , 2 , 1 , 0 )
		R2 = RemoveChaItem ( role , Item_YxItem_ID , 1 , 2 , ItemBag [2] , 2 , 1 , 0 )
		if R1 == 0 or R2 == 0 then
			LG( "beuplv" , "Delete item failed" )
		end
		local cha_name = GetChaDefaultName ( role )
		LG( "JingLian_ShiBai" , "Player "..cha_name.." Strengthening has failed" )
		SystemNotice( role , "Sorry, Strengthening has failed. Some items have disappeared!")
		return 
	end
	local LvUpgrade = 1
	if Item_YxItem_ID == 7596 then LvUpgrade = MaxLv_Eff - Item_beuplv_Lv;
	else
		if Instant110Eff ~= nil and
			Instant110Eff == true then
			LvUpgrade = MaxLv_Eff - Item_beuplv_Lv;
		end
	end
	Item_beuplv_Lv = Item_beuplv_Lv + LvUpgrade;
	SetChaKitbagChange( role , 1 )
	Set_Itembeuplv_Lv ( Item_beuplv , Item_beuplv_Lv )
	SynChaKitbag( role, 4 )
	local LvD = GetItemAttr( Item_beuplv , ITEMATTR_VAL_LEVEL )
	SynChaKitbag(role,13)
	SystemNotice( role , "Level up successful")
	local cha_name = GetChaDefaultName ( role )
	LG( "JingLian_ShiBai" , "Player ["..cha_name.."] Strengthening successful" )
	return 1
end

 

Share this post


Link to post
Share on other sites

BUMP, i tried using Clean files and the problem is that it still takes 2x Crystals when you fail upgrade, "It only takes 2 crystals when crystals are stackedable" if not stacked it only takes 1 on fail..
Is there a way to fix it so it can take 1 Strengthening Crystal when you fail, even if crystals are stacked?

Share this post


Link to post
Share on other sites

The code takes 2 crystals when it fails, get this piece of code:
 

	local a = Check_CG_beuplv ( Item_beuplv_Lv )
	if a == 0 then
		R1 = RemoveChaItem ( role , Item_ScItem_ID , 1 , 2 , ItemBag [0] , 2 , 1 , 0 )
		R2 = RemoveChaItem ( role , Item_YxItem_ID , 1 , 2 , ItemBag [2] , 2 , 1 , 0 )
		if R1 == 0 or R2 == 0 then
			LG( "beuplv" , "Delete item failed" )
		end
		local cha_name = GetChaDefaultName ( role )
		LG( "JingLian_ShiBai" , "Player "..cha_name.." Strengthening has failed" )
		SystemNotice( role , "Sorry, Strengthening has failed. Some items have disappeared!")
		return 
	end

And remove this:

		R1 = RemoveChaItem ( role , Item_ScItem_ID , 1 , 2 , ItemBag [0] , 2 , 1 , 0 )
		R2 = RemoveChaItem ( role , Item_YxItem_ID , 1 , 2 , ItemBag [2] , 2 , 1 , 0 )

 

Share this post


Link to post
Share on other sites
Quote

and remove this:

this too:

if R1 == 0 or R2 == 0 then
	LG( "beuplv" , "Delete item failed" )
end

 


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