Jump to content
Sign in to follow this  
kekc161

Свадьба фей (Как сделать, чтоб удаляло лвл феи)

Recommended Posts

Здравствуйте, хотелось бы узнать, как сделать чтоб после свадьбы забрало более 4х и т.п лвл феи.

Например у меня когда я спариваю заберает всего лишь 4 лвл, не могу найти где мне это изменить?

Share this post


Link to post
Share on other sites
16 часов назад, NMS3RR сказал:

DelBagItem(role,ID,vaule)

Это удалит предметы с указанным ID из инвентаря.

 

@kekc161, ты можешь сюда скопировать скрипт свадьбы?


Share this post


Link to post
Share on other sites
On 04.02.2017 at 3:36 PM, kekc161 said:

Здравствуйте, хотелось бы узнать, как сделать чтоб после свадьбы забрало более 4х и т.п лвл феи.

Например у меня когда я спариваю заберает всего лишь 4 лвл, не могу найти где мне это изменить?

Для разборки функции спарки фей для начала разобьем ее на части

 Получаем данные про первую фею

local Num_JLone = GetItemForgeParam ( Item_JLone , 1 )

Разбиваем на части по параметрам

local Part1_JLone = GetNum_Part1 ( Num_JLone ) 
local Part2_JLone = GetNum_Part2 ( Num_JLone ) 
local Part3_JLone = GetNum_Part3 ( Num_JLone )
local Part4_JLone = GetNum_Part4 ( Num_JLone )
local Part5_JLone = GetNum_Part5 ( Num_JLone )
local Part6_JLone = GetNum_Part6 ( Num_JLone )
local Part7_JLone= GetNum_Part7 ( Num_JLone )

 

Аналогично 2я фея

    local Num_JLother = GetItemForgeParam ( Item_JLother , 1 )
    local Part1_JLother = GetNum_Part1 ( Num_JLother ) 
    local Part2_JLother = GetNum_Part2 ( Num_JLother ) 
    local Part3_JLother = GetNum_Part3 ( Num_JLother )
    local Part4_JLother = GetNum_Part4 ( Num_JLother )
    local Part5_JLother = GetNum_Part5 ( Num_JLother )
    local Part6_JLother = GetNum_Part6 ( Num_JLother )
    local Part7_JLother= GetNum_Part7 ( Num_JLother )

получаем параметры новой феи по формуле (новый параметр а = (параметр а первой феи+параметр а второй феи) *0.125

    local new_str = math.floor ((str_JLone+str_JLother)*0.125 )
    local new_con = math.floor ((con_JLone+con_JLother)*0.125 )
    local new_agi = math.floor ((agi_JLone+agi_JLother)*0.125 )
    local new_dex = math.floor ((dex_JLone+dex_JLother)*0.125 )
    local new_sta = math.floor ((sta_JLone+sta_JLother)*0.125 )

получаем уровень новой феи путем складываения полученых параметров новой феи

 

local new_lv = new_str + new_con + new_agi + new_dex + new_sta

далее мы получаем енергию(жизни) на сколько я понимаю новой феи

local new_MAXENERGY = 240 * ( new_lv + 1 )
    if new_MAXENERGY > 6480 then
        new_MAXENERGY = 6480
    end
    local new_MAXURE = 5000 + 1000*new_lv
    if new_MAXURE > 32000 then
        new_MAXURE = 32000
    end

далее забираем необходимые предметы для спарки и рандомим необходимую фею

if Item_EMstone_ID ==3925 then  --если камень Адский фрукт тайны
        local j1 = TakeItem( role, 0,1253, 10 )                
        local j2 = TakeItem( role, 0,3442, 10 )  --забираем    1253 и  3442 по 10 шт      
        if j1==0 or j2==0 then
            SystemNotice ( role ,"Deletion of pet fairy reborn tools failed")
            return
        end
        local rad = math.random ( 1, 100 )
        local r1 = 0
        local r2 = 0
        if Item_JLone_ID ==680 or Item_JLother_ID ==680 then   --проверяем наших морд
            if Item_JLone_ID==Item_JLother_ID then  --если морды 2 , тогда выполняем следуюющее
                r1,r2 =MakeItem ( role , 681  , 1 , 4 )
            elseif lv_JLone>=20 and lv_JLone<25 and lv_JLother >=20 and lv_JLother<25 and rad>=88 then  --12% Chance of Mordo JR
                r1,r2 =MakeItem ( role , 681  , 1 , 4 )
            elseif lv_JLone>=25 and lv_JLone<35 and lv_JLother >=25 and lv_JLother<35 and rad>=50 then  --50% Chance of Mordo JR
                r1,r2 =MakeItem ( role , 681  , 1 , 4 )
            elseif lv_JLone>=35 and lv_JLother >=35 and rad>=10 then    --90% Chance of Mordo JR
                r1,r2 =MakeItem ( role , 681  , 1 , 4 ) --Mordo JR     
            else
                r1,r2 =MakeItem ( role , 237  , 1 , 4 ) --Fairy of Evil
            end
        else
            r1,r2 =MakeItem ( role , 237 , 1 , 4 )  --Fairy of Evil
        end

 

узнаем какой предмет мы получили

local Item_newJL = GetChaItem ( role , 2 , r2 )  

узнаем все его параметры

local Num_newJL = GetItemForgeParam ( Item_newJL , 1 )

и разбиваем по частям как и раньше 

        local Part1_newJL = GetNum_Part1 ( Num_newJL )  
        local Part2_newJL = GetNum_Part2 ( Num_newJL ) 
        local Part3_newJL = GetNum_Part3 ( Num_newJL )
        local Part4_newJL = GetNum_Part4 ( Num_newJL )
        local Part5_newJL = GetNum_Part5 ( Num_newJL )
        local Part6_newJL = GetNum_Part6 ( Num_newJL )
        local Part7_newJL = GetNum_Part7 ( Num_newJL )

далле происходят проверки связанные с шансом выдачи владения фей

if lv_JLone>=20 and lv_JLother >=20 then
            Part2_newJL = 12                                                   
            Part3_newJL = 1                                                
        end
        if lv_JLone>=25 and lv_JLother >=25 then
            Part2_newJL = 12                                               
            Part3_newJL = 2                                            
        end
        if lv_JLone>=35 and lv_JLother >=35 then
            Part2_newJL = 12                                               
            Part3_newJL = 3                                            
        end

узнаем какое владение феей выдать

local rad1 = math.random ( 1, 100 )
        if Part3_newJL==3 then
            GiveItem ( role , 0 , 609  , 1 , 4 )    --Expert Fairy Possession
        end
        if Part3_newJL==2 then
            if rad1 <=95 then
                GiveItem ( role , 0 , 608  , 1 , 4 )    --Standard Fairy Possession
            elseif rad1 > 95 and rad1 <=100 then
                GiveItem ( role , 0 , 609  , 1 , 4 )    --Expert Fairy Possession
            end
        end
        if Part3_newJL==1 then
            if rad1 <=90 then
                GiveItem ( role , 0 , 239  , 1 , 4 )    --Novice Fairy Possession
            elseif rad1 > 90 and rad1 <=98 then
                GiveItem ( role , 0 , 608  , 1 , 4 )    --Standard Fairy Possession
            elseif rad1 > 98 and rad1 <=100 then
                GiveItem ( role , 0 , 609  , 1 , 4 )    --Expert Fairy Possession
            end
        end

переносим изменения на нашу фею

       Num_newJL = SetNum_Part1 ( Num_newJL , 1 )
        Num_newJL = SetNum_Part2 ( Num_newJL , Part2_newJL )
        Num_newJL = SetNum_Part3 ( Num_newJL , Part3_newJL )
        Num_newJL = SetNum_Part4 ( Num_newJL , Part4_newJL )
        Num_newJL = SetNum_Part5 ( Num_newJL , Part5_newJL )
        Num_newJL = SetNum_Part6 ( Num_newJL , Part6_newJL )
        Num_newJL = SetNum_Part7 ( Num_newJL , Part7_newJL )
        SetItemForgeParam ( Item_newJL , 1 , Num_newJL )
 
        SetItemAttr ( Item_newJL , ITEMATTR_VAL_STR , new_str )
        SetItemAttr ( Item_newJL , ITEMATTR_VAL_DEX , new_dex )  
        SetItemAttr ( Item_newJL , ITEMATTR_VAL_STA , new_sta )
        SetItemAttr ( Item_newJL , ITEMATTR_VAL_AGI , new_agi )
        SetItemAttr ( Item_newJL , ITEMATTR_VAL_CON , new_con )
        SetItemAttr ( Item_newJL , ITEMATTR_MAXENERGY , new_MAXENERGY )    
        SetItemAttr ( Item_newJL , ITEMATTR_MAXURE , new_MAXURE )  

следующее сбарасывает уровень наших фей

 Elf_Attr_cs ( role , Item_JLone , Item_JLother )

Это не вся функция, а лишь основные "куски", может быть что то упустил и не так понял, но думаю должно быть полезно.

Соответсвенно ищем функцию  Elf_Attr_cs в functions.lua, а именно строки 

    max_JLone_temp = max_JLone_temp - 4
    max_JLother_temp = max_JLother_temp - 4

На первый взгляд эта четверка  и похожа на значение уровней которое будет отниматься, проверить нет возможности, дерзайте!

Edited by mangojkee
  • Like 2

Share this post


Link to post
Share on other sites

Файл forge.lua, функция jlborn_item()

Просто из каждой функции для фрукта удаляем этот кусок кода

		Num_newJL = SetNum_Part1 ( Num_newJL , 1 )	 
		Num_newJL = SetNum_Part2 ( Num_newJL , Part2_newJL )
		Num_newJL = SetNum_Part3 ( Num_newJL , Part3_newJL )
		Num_newJL = SetNum_Part4 ( Num_newJL , Part4_newJL )
		Num_newJL = SetNum_Part5 ( Num_newJL , Part5_newJL )
		Num_newJL = SetNum_Part6 ( Num_newJL , Part6_newJL )
		Num_newJL = SetNum_Part7 ( Num_newJL , Part7_newJL )
		SetItemForgeParam ( Item_newJL , 1 , Num_newJL )
		
		SetItemAttr ( Item_newJL , ITEMATTR_VAL_STR , new_str )
		SetItemAttr( Item_newJL , ITEMATTR_VAL_DEX , new_dex )	 
		SetItemAttr ( Item_newJL , ITEMATTR_VAL_STA , new_sta )
		SetItemAttr( Item_newJL , ITEMATTR_VAL_AGI , new_agi )
		SetItemAttr ( Item_newJL , ITEMATTR_VAL_CON , new_con ) 
		SetItemAttr ( Item_newJL , ITEMATTR_MAXENERGY , new_MAXENERGY ) 	
		SetItemAttr ( Item_newJL , ITEMATTR_MAXURE , new_MAXURE ) 	

Фея так же будет спариваться, выдаваться, но необходимые атрибуты присваиваться уже не будут.

Edited by e1mer

Share this post


Link to post
Share on other sites
9 minutes ago, e1mer said:

Файл forge.lua, функция jlborn_item()

Просто из каждой функции для фрукта удаляем этот кусок кода


		Num_newJL = SetNum_Part1 ( Num_newJL , 1 )	 
		Num_newJL = SetNum_Part2 ( Num_newJL , Part2_newJL )
		Num_newJL = SetNum_Part3 ( Num_newJL , Part3_newJL )
		Num_newJL = SetNum_Part4 ( Num_newJL , Part4_newJL )
		Num_newJL = SetNum_Part5 ( Num_newJL , Part5_newJL )
		Num_newJL = SetNum_Part6 ( Num_newJL , Part6_newJL )
		Num_newJL = SetNum_Part7 ( Num_newJL , Part7_newJL )
		SetItemForgeParam ( Item_newJL , 1 , Num_newJL )
		
		SetItemAttr ( Item_newJL , ITEMATTR_VAL_STR , new_str )
		SetItemAttr( Item_newJL , ITEMATTR_VAL_DEX , new_dex )	 
		SetItemAttr ( Item_newJL , ITEMATTR_VAL_STA , new_sta )
		SetItemAttr( Item_newJL , ITEMATTR_VAL_AGI , new_agi )
		SetItemAttr ( Item_newJL , ITEMATTR_VAL_CON , new_con ) 
		SetItemAttr ( Item_newJL , ITEMATTR_MAXENERGY , new_MAXENERGY ) 	
		SetItemAttr ( Item_newJL , ITEMATTR_MAXURE , new_MAXURE ) 	

Фея так же будет спариваться, выдаваться, но необходимые атрибуты присваиваться уже не будут.

автору необходимо что бы забирало более 4х лвл при спарке

Share this post


Link to post
Share on other sites
5 часов назад, V3ct0r сказал:

Это удалит предметы с указанным ID из инвентаря.

 

@kekc161, ты можешь сюда скопировать скрипт свадьбы?

Что то я не то прочитал и не то написал :D
Я когда написал, подумал, что он хочет чтоб фею удалило из рюкзака.

Edited by NMS3RR

Делай добро и бросай его в воду

Share this post


Link to post
Share on other sites
18 часов назад, mangojkee сказал:

Для разборки функции спарки фей для начала разобьем ее на части

 Получаем данные про первую фею


local Num_JLone = GetItemForgeParam ( Item_JLone , 1 )

Разбиваем на части по параметрам


local Part1_JLone = GetNum_Part1 ( Num_JLone ) 
local Part2_JLone = GetNum_Part2 ( Num_JLone ) 
local Part3_JLone = GetNum_Part3 ( Num_JLone )
local Part4_JLone = GetNum_Part4 ( Num_JLone )
local Part5_JLone = GetNum_Part5 ( Num_JLone )
local Part6_JLone = GetNum_Part6 ( Num_JLone )
local Part7_JLone= GetNum_Part7 ( Num_JLone )

 

Аналогично 2я фея


    local Num_JLother = GetItemForgeParam ( Item_JLother , 1 )
    local Part1_JLother = GetNum_Part1 ( Num_JLother ) 
    local Part2_JLother = GetNum_Part2 ( Num_JLother ) 
    local Part3_JLother = GetNum_Part3 ( Num_JLother )
    local Part4_JLother = GetNum_Part4 ( Num_JLother )
    local Part5_JLother = GetNum_Part5 ( Num_JLother )
    local Part6_JLother = GetNum_Part6 ( Num_JLother )
    local Part7_JLother= GetNum_Part7 ( Num_JLother )

получаем параметры новой феи по формуле (новый параметр а = (параметр а первой феи+параметр а второй феи) *0.125


    local new_str = math.floor ((str_JLone+str_JLother)*0.125 )
    local new_con = math.floor ((con_JLone+con_JLother)*0.125 )
    local new_agi = math.floor ((agi_JLone+agi_JLother)*0.125 )
    local new_dex = math.floor ((dex_JLone+dex_JLother)*0.125 )
    local new_sta = math.floor ((sta_JLone+sta_JLother)*0.125 )

получаем уровень новой феи путем складываения полученых параметров новой феи

 


local new_lv = new_str + new_con + new_agi + new_dex + new_sta

далее мы получаем енергию(жизни) на сколько я понимаю новой феи


local new_MAXENERGY = 240 * ( new_lv + 1 )
    if new_MAXENERGY > 6480 then
        new_MAXENERGY = 6480
    end
    local new_MAXURE = 5000 + 1000*new_lv
    if new_MAXURE > 32000 then
        new_MAXURE = 32000
    end

далее забираем необходимые предметы для спарки и рандомим необходимую фею


if Item_EMstone_ID ==3925 then  --если камень Адский фрукт тайны
        local j1 = TakeItem( role, 0,1253, 10 )                
        local j2 = TakeItem( role, 0,3442, 10 )  --забираем    1253 и  3442 по 10 шт      
        if j1==0 or j2==0 then
            SystemNotice ( role ,"Deletion of pet fairy reborn tools failed")
            return
        end
        local rad = math.random ( 1, 100 )
        local r1 = 0
        local r2 = 0
        if Item_JLone_ID ==680 or Item_JLother_ID ==680 then   --проверяем наших морд
            if Item_JLone_ID==Item_JLother_ID then  --если морды 2 , тогда выполняем следуюющее
                r1,r2 =MakeItem ( role , 681  , 1 , 4 )
            elseif lv_JLone>=20 and lv_JLone<25 and lv_JLother >=20 and lv_JLother<25 and rad>=88 then  --12% Chance of Mordo JR
                r1,r2 =MakeItem ( role , 681  , 1 , 4 )
            elseif lv_JLone>=25 and lv_JLone<35 and lv_JLother >=25 and lv_JLother<35 and rad>=50 then  --50% Chance of Mordo JR
                r1,r2 =MakeItem ( role , 681  , 1 , 4 )
            elseif lv_JLone>=35 and lv_JLother >=35 and rad>=10 then    --90% Chance of Mordo JR
                r1,r2 =MakeItem ( role , 681  , 1 , 4 ) --Mordo JR     
            else
                r1,r2 =MakeItem ( role , 237  , 1 , 4 ) --Fairy of Evil
            end
        else
            r1,r2 =MakeItem ( role , 237 , 1 , 4 )  --Fairy of Evil
        end

 

узнаем какой предмет мы получили


local Item_newJL = GetChaItem ( role , 2 , r2 )  

узнаем все его параметры


local Num_newJL = GetItemForgeParam ( Item_newJL , 1 )

и разбиваем по частям как и раньше 


        local Part1_newJL = GetNum_Part1 ( Num_newJL )  
        local Part2_newJL = GetNum_Part2 ( Num_newJL ) 
        local Part3_newJL = GetNum_Part3 ( Num_newJL )
        local Part4_newJL = GetNum_Part4 ( Num_newJL )
        local Part5_newJL = GetNum_Part5 ( Num_newJL )
        local Part6_newJL = GetNum_Part6 ( Num_newJL )
        local Part7_newJL = GetNum_Part7 ( Num_newJL )

далле происходят проверки связанные с шансом выдачи владения фей


if lv_JLone>=20 and lv_JLother >=20 then
            Part2_newJL = 12                                                   
            Part3_newJL = 1                                                
        end
        if lv_JLone>=25 and lv_JLother >=25 then
            Part2_newJL = 12                                               
            Part3_newJL = 2                                            
        end
        if lv_JLone>=35 and lv_JLother >=35 then
            Part2_newJL = 12                                               
            Part3_newJL = 3                                            
        end

узнаем какое владение феей выдать


local rad1 = math.random ( 1, 100 )
        if Part3_newJL==3 then
            GiveItem ( role , 0 , 609  , 1 , 4 )    --Expert Fairy Possession
        end
        if Part3_newJL==2 then
            if rad1 <=95 then
                GiveItem ( role , 0 , 608  , 1 , 4 )    --Standard Fairy Possession
            elseif rad1 > 95 and rad1 <=100 then
                GiveItem ( role , 0 , 609  , 1 , 4 )    --Expert Fairy Possession
            end
        end
        if Part3_newJL==1 then
            if rad1 <=90 then
                GiveItem ( role , 0 , 239  , 1 , 4 )    --Novice Fairy Possession
            elseif rad1 > 90 and rad1 <=98 then
                GiveItem ( role , 0 , 608  , 1 , 4 )    --Standard Fairy Possession
            elseif rad1 > 98 and rad1 <=100 then
                GiveItem ( role , 0 , 609  , 1 , 4 )    --Expert Fairy Possession
            end
        end

переносим изменения на нашу фею


       Num_newJL = SetNum_Part1 ( Num_newJL , 1 )
        Num_newJL = SetNum_Part2 ( Num_newJL , Part2_newJL )
        Num_newJL = SetNum_Part3 ( Num_newJL , Part3_newJL )
        Num_newJL = SetNum_Part4 ( Num_newJL , Part4_newJL )
        Num_newJL = SetNum_Part5 ( Num_newJL , Part5_newJL )
        Num_newJL = SetNum_Part6 ( Num_newJL , Part6_newJL )
        Num_newJL = SetNum_Part7 ( Num_newJL , Part7_newJL )
        SetItemForgeParam ( Item_newJL , 1 , Num_newJL )
 
        SetItemAttr ( Item_newJL , ITEMATTR_VAL_STR , new_str )
        SetItemAttr ( Item_newJL , ITEMATTR_VAL_DEX , new_dex )  
        SetItemAttr ( Item_newJL , ITEMATTR_VAL_STA , new_sta )
        SetItemAttr ( Item_newJL , ITEMATTR_VAL_AGI , new_agi )
        SetItemAttr ( Item_newJL , ITEMATTR_VAL_CON , new_con )
        SetItemAttr ( Item_newJL , ITEMATTR_MAXENERGY , new_MAXENERGY )    
        SetItemAttr ( Item_newJL , ITEMATTR_MAXURE , new_MAXURE )  

следующее сбарасывает уровень наших фей


 Elf_Attr_cs ( role , Item_JLone , Item_JLother )

Это не вся функция, а лишь основные "куски", может быть что то упустил и не так понял, но думаю должно быть полезно.

Соответсвенно ищем функцию  Elf_Attr_cs в functions.lua, а именно строки 


    max_JLone_temp = max_JLone_temp - 4
    max_JLother_temp = max_JLother_temp - 4

На первый взгляд эта четверка  и похожа на значение уровней которое будет отниматься, проверить нет возможности, дерзайте!

Вот я так и думал, что за отбор лвл функция находится не в forge, спасибо щас все попробую.

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