Jump to content
Sign in to follow this  
WVWMK

Создаем книгу навыков

Recommended Posts

В ItemEffect.lua ..\resource\script\calculate создаем функцию с префиксом Sk_Script

function Sk_Script_Functionname(role, Item)


end

 

Затем пользуемся шаблоном:

 

function Sk_Script_Functionname ( role , Item )                                            

    local sk_add = SK_NAME

    local form_sklv = GetSkillLv( role , sk_add )


    if form_sklv ~= 0  then

        UseItemFailed ( role )  

        return

    end

    a = AddChaSkill ( role , sk_add, 1 , 1 , 1 )

    if a== 0 then

        UseItemFailed ( role )  

        return

    end

end

 

SK_NAME - это переменная, которая находится в variable.lua
В ней содержится ID скилла.
Например Берсерк (SK_KB):

...

SK_JJSL     =   67          --Мастер большого меча               

SK_KB         =   84      --Берсерк       

SK_FSZ      =   109     --Рубка двумя мечами           

SK_XZFY     =   104     --Печать старейшины

...        

 

Меняем SK_NAME на своё.

 

 

Если мы хотим сделать так чтоб скилл не тратил очки умений или сразу создавался 10 уровня:

AddChaSkill(role, SK_SYZY, 1, 1, 1)

Первый параметр - userdata
Второй параметр- айди скилла
Третий параметр- на сколько повысится уровень скилла
Пятый параметр- кол-во отнимаемых очков

 

Edited by NMS3RR

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

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