• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Talkaction give skills in percent

gmstrikker

Well-Known Member
Joined
Jul 30, 2014
Messages
458
Solutions
1
Reaction score
50
I wanted a base command for me to use for other things
Fuction give skills in percents

!givemeskills

sorcerer/druid
10% ML , 10%shield

paladin
10% distance, 10%shield

knight
10% your biggest skill, ie if the player has 80 axe and the other 60, he gains skill in axe
10% de shield
 
This should get you 10% of a skill... hard to try it on my test server since skills work a bit differently but it should work. (0.4/0.3?)
Code:
local skillTriesNeeded = getPlayerRequiredSkillTries(cid, SKILL_DISTANCE, getPlayerSkillLevel(cid, SKILL_DISTANCE))
doPlayerAddSkillTry(cid, SKILL_DISTANCE, math.ceil(skillTriesNeeded*0.1), false)

Should be pretty easy to get which skill is highest on a knight... just getPlayerSkillLevel for each of the 3 and compare, take the highest and do the same thing as I did for distance.

Magic level is a bit different.
You will use this instead:
Code:
local skillTriesNeeded = getPlayerRequiredMana(cid, getPlayerMagLevel(cid))
doPlayerAddSpentMana(cid, math.ceil(skillTriesNeeded*0.1), false)
 
Back
Top