Jump to content
habs8024

Forge rate

Recommended Posts

Is there a gentlemen amoung us that is kind enough to explain to me what is going on in this function? 

im used to the old fashion script lol xD

 

How do i make it 100% success? 


	local Sklv = 1
	local StateLv = GetChaStateLv ( role , STATE_JLGLJB )
	local State100 = GetChaStateLv ( role , STATE_JLBYS )
	
	Sklv = Sklv + StateLv
	local ZBforgeXG=ZBforge(role )

	local Check_A = math.max ( 0.02 , math.min ( 1 , ( 1.1 - Baoshi_NeedLv * 0.1 + Sklv * 0.15 +ZBforgeXG ) ) )
		--Notice("Check_A"..Check_A)
		if Baoshi_NeedLv == 3 or Baoshi_NeedLv == 4 or Baoshi_NeedLv == 5 or Baoshi_NeedLv == 6 or Baoshi_NeedLv ==7 or Baoshi_NeedLv == 8 or Baoshi_NeedLv== 9 then  ---------¾«Á¶½µµÍ°Ù·Ö֮ʮ
	
			Check_A=Check_A - 0.33
		end
		--Notice("Check_A"..Check_A)
	local CheckFaild = Percentage_Random ( Check_A )
	if State100 == 10 then 
		if Baoshi_NeedLv < 8 then
			CheckFaild = 1	
		CALCULATE_FORGE_LUA_000025 = GetResString("CALCULATE_FORGE_LUA_000025")
		SystemNotice( role , CALCULATE_FORGE_LUA_000025)	
		end
	end
	
	if State100 == 11 then 
		if Baoshi_NeedLv > 7 then
			CheckFaild = 1	
		CALCULATE_FORGE_LUA_000025 = GetResString("CALCULATE_FORGE_LUA_000025")
		SystemNotice( role , CALCULATE_FORGE_LUA_000025)	
		end
	end	
	
	if Baoshi_NeedLv < 6 then
		CheckFaild = 1
	end
	
	local ItemID_Stone1 = GetItemID ( Item_Stone1 )
	local ItemID_Stone2 = GetItemID ( Item_Stone2 )

	local Stone1_Lv = Get_StoneLv ( Item_Stone1 )
	local Stone2_Lv = Get_StoneLv ( Item_Stone2 )
	local Jinglianshi_Lv = 0
	local Jinglian_Lv = GetItem_JinglianLv ( Item_Jinglian )
	if Stone1_Lv > Stone2_Lv then
		Jinglianshi_Lv = Stone1_Lv
	else
		Jinglianshi_Lv = Stone2_Lv
	end



	local R1 = 0
	local R2 = 0
	
	
	if CheckFaild == 1 then
		Check_Jinglian_Item = Jinglian_Item ( Item_Jinglian , Item_Stone1 , Item_Stone2 )
		SynChaKitbag(role,13)
		R1 = RemoveChaItem ( role , ItemID_Stone1 , 1 , 2 , ItemBag [1] , 2 , 1 , 0 )		--ÒƳý±¦Ê¯1
		R2 = RemoveChaItem ( role , ItemID_Stone2 , 1 , 2 , ItemBag [2] , 2 , 1 , 0 )		--ÒƳý±¦Ê¯2
		if R1 == 0 or R2 == 0 then
			CALCULATE_FORGE_LUA_000026 = GetResString("CALCULATE_FORGE_LUA_000026")
			LG( "Jinglian" , CALCULATE_FORGE_LUA_000026 )
		end		
		ReSetForgeAttr ( Item_Jinglian )	
		--	Notice("¾«Á¶½áÊø")
		local cha_name = GetChaDefaultName ( role )
		local Item_Jinglian_name = GetItemName ( ItemID_Jinglian )
		CALCULATE_FORGE_LUA_000027 = GetResString("CALCULATE_FORGE_LUA_000027")
		CALCULATE_EXP_AND_LEVEL_LUA_000040 = GetResString("CALCULATE_EXP_AND_LEVEL_LUA_000040")
		LG( "JingLian_ShiBai" , CALCULATE_EXP_AND_LEVEL_LUA_000040..cha_name..CALCULATE_FORGE_LUA_000027..Item_Jinglian_name )
		return 1
	else
		local cha_name = GetChaDefaultName ( role )
		local Item_Jinglian_name = GetItemName ( ItemID_Jinglian )
		CALCULATE_FORGE_LUA_000028 = GetResString("CALCULATE_FORGE_LUA_000028")
		CALCULATE_EXP_AND_LEVEL_LUA_000040 = GetResString("CALCULATE_EXP_AND_LEVEL_LUA_000040")
		LG( "JingLian_ShiBai" , CALCULATE_EXP_AND_LEVEL_LUA_000040..cha_name..CALCULATE_FORGE_LUA_000028..Item_Jinglian_name )
		CALCULATE_FORGE_LUA_000029 = GetResString("CALCULATE_FORGE_LUA_000029")
		SystemNotice ( role , CALCULATE_FORGE_LUA_000029 )
		R1 = RemoveChaItem ( role , ItemID_Stone1 , 1 , 2 , ItemBag [1] , 2 , 1 , 0 )		--ÒƳý±¦Ê¯1
		R2 = RemoveChaItem ( role , ItemID_Stone2 , 1 , 2 , ItemBag [2] , 2 , 1 , 0 )		--ÒƳý±¦Ê¯2
		if R2 == 0 then
			CALCULATE_FORGE_LUA_000026 = GetResString("CALCULATE_FORGE_LUA_000026")
			LG( "Jinglian" , CALCULATE_FORGE_LUA_000026 )
		end
		ReSetForgeAttr ( Item_Jinglian )		
		return 2
	end
------------------

 

Share this post


Link to post
Share on other sites

Hello @habs8024!

 

File forge.lua, function begin_forge_item(...): try to delete the next code

	local Sklv = 1
	local StateLv = GetChaStateLv ( role , STATE_JLGLJB )
	
	Sklv = Sklv + StateLv

	local Check_A = math.max ( 0.02 , math.min ( 1 , ( 1 - Baoshi_NeedLv * 0.1 + Sklv * 0.15 - 0.3 ) ) )
	local CheckFaild = Percentage_Random ( Check_A )
	
	if Baoshi_NeedLv < 4 then
		CheckFaild = 1
	end

	if CheckFaild == 1 then
		Check_Jinglian_Item = Jinglian_Item ( Item_Jinglian , Item_Stone1 , Item_Stone2 )
	else
		local cha_name = GetChaDefaultName ( role )
		local Item_Jinglian_name = GetItemName ( ItemID_Jinglian )
		LG( "JingLian_ShiBai" , "Player"..cha_name.."Forging of equipment failed. Equipment is not damaged"..Item_Jinglian_name )
		SystemNotice ( role , "Sorry, forging has failed. Luckily equipment is not damage" )
	end

then

	if CheckFaild == 0 then
		return 2
	end

and

	local a = 0.75
	local b = Check_CG_Jinglian ( Jinglian_Lv , Jinglianshi_Lv , Sklv )
	if b == 0 then
		i = RemoveChaItem ( role , ItemID_Jinglian , 1 , 2 , ItemBag [0] , 2 , 1 , 0)		--移除宝石	
		if i == 0 then
			LG( "Hecheng_BS" , "Delete item failed" )
		end
		local cha_name = GetChaDefaultName ( role )
		local Item_Jinglian_name = GetItemName ( ItemID_Jinglian )
		LG( "JingLian_ShiBai" , "Player"..cha_name.."Forging of equipment failed"..Item_Jinglian_name )
		SystemNotice( role , "Very sorry! Forging has failed. Item was destroyed…")
		return 2	
	end

 


Share this post


Link to post
Share on other sites
11 час назад, habs8024 сказал:

not quite sure i understand what to delete? the 1st code you showed me isnt the one i use, should i delete everything i sent?

You should delete similar code as I've posted. I've taken it from 1.38 files


Share this post


Link to post
Share on other sites
4 hours ago, BugsBunny said:

Hmm, how do i set up my own Forge rate? 

For example 100% from lv1 to lv3 , 90% , lv4 to lv6 , 50% lv7 , 40% lv8 , 30% lv9?

        if Baoshi_NeedLv < 4 then	--Lv1-3 = 100% 
                Check_A = 1
                CheckFaild = Percentage_Random ( Check_A )

        elseif Baoshi_NeedLv == 4 then	--Lv4 = 90%
                Check_A = 0.9
                CheckFaild = Percentage_Random ( Check_A )
                
        elseif Baoshi_NeedLv == 5 then	--Lv5 = 70%
                Check_A = 0.7
                CheckFaild = Percentage_Random ( Check_A )
                                
        elseif Baoshi_NeedLv == 6 then	--Lv6 = 50%
                Check_A = 0.5
                CheckFaild = Percentage_Random ( Check_A )              
                
        elseif Baoshi_NeedLv == 7 then --Lv7 = 30%
                Check_A = 0.3
                CheckFaild = Percentage_Random ( Check_A )      
                
        elseif Baoshi_NeedLv == 8 then --Lv8 = 20%
                Check_A = 0.2
                CheckFaild = Percentage_Random ( Check_A )      
                
        elseif Baoshi_NeedLv == 9 then --Lv9 = 10%
                Check_A = 0.1
                CheckFaild = Percentage_Random ( Check_A )      
                
        end

Edit to your own liking. Good luck

If you want to be 100%, just do:

        if Baoshi_NeedLv < 10 then	--Lv1-9 = 100% 
                Check_A = 1
                CheckFaild = Percentage_Random ( Check_A )
        end

 

  • Like 1

Share this post


Link to post
Share on other sites
On 1/7/2018 at 2:12 AM, DangThao said:

        if Baoshi_NeedLv < 4 then	--Lv1-3 = 100% 
                Check_A = 1
                CheckFaild = Percentage_Random ( Check_A )

        elseif Baoshi_NeedLv == 4 then	--Lv4 = 90%
                Check_A = 0.9
                CheckFaild = Percentage_Random ( Check_A )
                
        elseif Baoshi_NeedLv == 5 then	--Lv5 = 70%
                Check_A = 0.7
                CheckFaild = Percentage_Random ( Check_A )
                                
        elseif Baoshi_NeedLv == 6 then	--Lv6 = 50%
                Check_A = 0.5
                CheckFaild = Percentage_Random ( Check_A )              
                
        elseif Baoshi_NeedLv == 7 then --Lv7 = 30%
                Check_A = 0.3
                CheckFaild = Percentage_Random ( Check_A )      
                
        elseif Baoshi_NeedLv == 8 then --Lv8 = 20%
                Check_A = 0.2
                CheckFaild = Percentage_Random ( Check_A )      
                
        elseif Baoshi_NeedLv == 9 then --Lv9 = 10%
                Check_A = 0.1
                CheckFaild = Percentage_Random ( Check_A )      
                
        end

Edit to your own liking. Good luck

If you want to be 100%, just do:


        if Baoshi_NeedLv < 10 then	--Lv1-9 = 100% 
                Check_A = 1
                CheckFaild = Percentage_Random ( Check_A )
        end

 

Thank you very much mate ! <3 


proxy-image (2).jpg

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