Jump to content
Sign in to follow this  
kekc161

100% вставка и комбинка

Recommended Posts

Ребят, подскажите, где именно в функции изменить, чтоб до 5лвл комбинка и вставка была 100%?

Share this post


Link to post
Share on other sites
function Check_CG_HechengBS ( Item_Lv , Item_Type , Sklv )
	local a = 0
	local b = 0
	Item_Lv = Item_Lv - 1
	if Item_Type == 49 then
		a = math.max ( 0 , math.min ( 1 , ( 1 - Item_Lv * 0.10 + Sklv * 0.10 ) ) )		-- Шанс Комбинирования
		b = Percentage_Random ( a )
		if Item_Lv < 3 then
			b = 1
		end
		return b
	elseif Item_Type == 50 then
		a = math.max ( 0 , math.min ( 1 , ( 1 - Item_Lv * 0.05 + Sklv * 0.15 ) ) )
		b = Percentage_Random ( a )
		return b
	else
		LG( "Hecheng_BS","probability check determine item type is not a gem" )
		return 0
	end
end

if Item_Lv < 3 then измени 3 на 5

Share this post


Link to post
Share on other sites

Вставка в function begin_forge_item(...) 
if Baoshi_NeedLv < 4 then        -- Уровень гема который вставляется со 100% шансом
        CheckFaild = 1
    end

Share this post


Link to post
Share on other sites
В 31.03.2017 в 12:32, BETEP/macs509 сказал:

Вставка в function begin_forge_item(...) 
if Baoshi_NeedLv < 4 then        -- Уровень гема который вставляется со 100% шансом
        CheckFaild = 1
    end

Я менял, все равно почему то миссают(

Share this post


Link to post
Share on other sites
В 08.04.2017 в 13:37, kekc161 сказал:

ап, помогите плис

 

function Check_CG_HechengBS ( Item_Lv , Item_Type , Sklv )
	
	if (Item_Lv < 5) then
		return 1
	end
	
	local a = 0
	local b = 0
	
	Item_Lv = Item_Lv - 1
	if Item_Type == 49 then
		a = math.max ( 0 , math.min ( 1 , ( 1 - Item_Lv * 0.10 + Sklv * 0.10 ) ) )
		b = Percentage_Random ( a )
		if Item_Lv < 3 then
			b = 1
		end
		return b
	elseif Item_Type == 50 then
		a = math.max ( 0 , math.min ( 1 , ( 1 - Item_Lv * 0.05 + Sklv * 0.15 ) ) )
		b = Percentage_Random ( a )
		return b
	else
		LG("Hecheng_BS", "probability check determine item type is not a gem" )
		return 0
	end
	
end

То есть в начало функции необходимо добавить код:

	if (Item_Lv < 5) then
		return 1
	end

Что мы сделали: если уровень гема менее 5-го, то выходим из функции и возвращаем 1. Единица значит что гем не будет сломан.


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.

Sign in to follow this  

×
×
  • Create New...