Jump to content
Sign in to follow this  
nunb2560

Newbie Skill

Recommended Posts

Hi, i need some help. I have the newbie skill in my server files (skillinfo, skillefect.lua) and also have client (icon texture). But i dont  know how to activate it. I want the skill already activated when someone create a new char. 

Share this post


Link to post
Share on other sites

Maybe something like this? inside ur attrcalculate.lua


function CreatCha( role ) --[[´´½¨½ÇÉ«]]-- 
    --LuaPrint("Enter function CreatCha(role) --[[create character]]--".."\n") 
    local attr_ap = Attr_ap( role ) + 4 --[[£«5µã×ÔÓÉ·ÖÅäµãÊý]]--
    SetCharaAttr( attr_ap, role, ATTR_AP ) 
    AttrRecheck(role) 
    hp = GetChaAttr( role, ATTR_MXHP ) 
    sp = GetChaAttr( role, ATTR_MXSP ) 
    SetCharaAttr( hp, role, ATTR_HP ) 
    SetCharaAttr( sp, role, ATTR_SP ) 
    CreatChaSkill ( role ) 
    --LuaPrint("Out function CreatCha(role) --[[create character]]--".."\n") 
    AddChaSkill ( role , SKILL_NUM , 1 , 1 , 0 )
    --Replace SKILL_NUM to your newbie skill id in skillinfo.txt
    --SystemNotice ( role , "Learned skill '[Newbie Slash]'" )
end 

  • Like 1

Share this post


Link to post
Share on other sites
On 9/23/2018 at 12:42 AM, DangThao said:

Maybe something like this? inside ur attrcalculate.lua


function CreatCha( role ) --[[´´½¨½ÇÉ«]]-- 
    --LuaPrint("Enter function CreatCha(role) --[[create character]]--".."\n") 
    local attr_ap = Attr_ap( role ) + 4 --[[£«5µã×ÔÓÉ·ÖÅäµãÊý]]--
    SetCharaAttr( attr_ap, role, ATTR_AP ) 
    AttrRecheck(role) 
    hp = GetChaAttr( role, ATTR_MXHP ) 
    sp = GetChaAttr( role, ATTR_MXSP ) 
    SetCharaAttr( hp, role, ATTR_HP ) 
    SetCharaAttr( sp, role, ATTR_SP ) 
    CreatChaSkill ( role ) 
    --LuaPrint("Out function CreatCha(role) --[[create character]]--".."\n") 
    AddChaSkill ( role , SKILL_NUM , 1 , 1 , 0 )
    --Replace SKILL_NUM to your newbie skill id in skillinfo.txt
    --SystemNotice ( role , "Learned skill '[Newbie Slash]'" )
end 

Yes, thank you. But theres a mistake in your code. You need to change the order like this:

 

AddChaSkill ( role , SKILL_NUM , 1 , 1 , 0 )

CreatChaSkill ( role ) 

end

Share this post


Link to post
Share on other sites
5 hours ago, nunb2560 said:

Yes, thank you. But theres a mistake in your code. You need to change the order like this:

 

AddChaSkill ( role , SKILL_NUM , 1 , 1 , 0 )

CreatChaSkill ( role ) 

end

I didn't test so idk if it works. Hopefully it works for you though.

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