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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×