• 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!

CreatureEvent TFS 1.1 ModalWindow Skill Point System

I don't know where in sources it's multiplied by ml rate and why. If you tested my formula try it again using math.floor instead of math.ceil.

I will give it another try, if you noticed though, like I said, magic level wasn't the only thing having problems, the skill's formula has problems if the multiplier isn't set in a certain range in vocations.xml, and that formula was pulled straight from the add_skill talkaction for 1.1. I will try it out though and let you know the results....
 
Try getting required skill tries / skill rate as my ml formula
 
Try getting required skill tries / skill rate as my ml formula

Skill rate is 1 so any number divided by 1 = that number like x/1 = x still... So that number can't be interfering with the formula, it has to be the method :getRequiredSkillTries(), I posted this information on github, still waiting for them to take it seriously... But like I said, the formula works perfectly, if the multiplier for that skill is set to 1.1 in that vocations xml....
 
Tried everything with that magic level, nothing works. It adds 370 magic levels, tried all formulas and codes, nothing works =(
Actually got it to work now haha, was a bug in my config.

Thanks alot for the code @Codinablack!
 
Just gonna through it out there... but with the god command "add_skill" cant this script be used for this aswell? I'll have a look when i get home but just wanted to get it out there.
 
I don't really understand what you mean. That command won't add skill points, but it will add the skills... Not sure what you are asking, or if you are talking about the talkaction from the first post on this thread...
 
Just gonna through it out there... but with the god command "add_skill" cant this script be used for this aswell? I'll have a look when i get home but just wanted to get it out there.
This function comes from add_skill.lua
Code:
local function addSkills(player, skillId)
    player:addSkillTries(skillId, player:getVocation():getRequiredSkillTries(skillId, player:getSkillLevel(skillId) + 1) - player:getSkillTries(skillId))
return false
end
The only thing that has changed is target has been replaced with player.
I've tested this code and player:getSkillTries(skillId) always 100% of the time returns 0, this is in 1.1.

Try getting required skill tries / skill rate as my ml formula
Your formula is bugged too it works upto a certain point and then doesn't work anymore, just like the skills.. the problem isn't necessarily with the lua it is with the sources.

On a final note if you notice this thread has gotten over 1,449 views and 48 responses and not 1 of those responses has come from an admin or staff member which means they are aware of this problem and don't have a solution for it, ignoring the issue is an easier solution then actually fixing it.
 
Last edited by a moderator:
player.cpp
Code:
void Player::addManaSpent(uint64_t amount)
{
if (hasFlag(PlayerFlag_NotGainMana)) {
return;
}
uint64_t currReqMana = vocation->getReqMana(magLevel);
uint64_t nextReqMana = vocation->getReqMana(magLevel + 1);
if (currReqMana >= nextReqMana) {
//player has reached max magic level
return;
}

display of skills level is limited by client to 255
amount of mana needed to advance is in uint64_t, which means it can't be larger than 2^64 - 1

my formula isn't bugged, it just adds one magic level and keeps progress a player made himself

possible solutions:
a) including rate magic from config during calculation of amount of mana required to advance
b) changing data type to allow bigger numbers
c) get vocation and config rates and calculate it manually in your script by copying the way it's done in sources which won't help you much because adding tries/manaspent is limited to uint64_t anyway
 
Last edited:
I ran some testing on the needed skill tries per level at 1.0 and this is what I get back
Code:
-- at 1.0 modifier these are amount of tries per level regardless of stats level or vocation
Fist : 50
Club : 50
Sword : 50
Axe : 50
Distance : 30
Shielding : 100
Fishing : 20

Still working on the magic level tries

Edit: My bad... still testing
 
Last edited by a moderator:
Make sure you check correct vocation, there is such thing as promotion
 
Make sure you check correct vocation, there is such thing as promotion
Yeah I thought I was testing the knight and it was an elite knight lol

Ok now that I am using the correct vocation the mana multiplier returns 400 mana required per level at 1.0, using this formula it returns 134
Code:
player:addManaSpent(math.ceil((player:getVocation():getRequiredManaSpent(player:getBaseMagicLevel() + 1)) / configManager.getNumber(configKeys.RATE_MAGIC)))
It doesn't seem to add tries if you set it to 1.0.

I think the cap is 3.5ish the higher you put the modifier the more mana you need for the next level.

Actually I am not too sure how this works because when I lower it to 0.1 the requirement is high but then trickles down. Maybe I need to rethink how this is suppose to work..

These multipliers are really a deterrent, and have no real impact on how skills are added.

I figured out how to fix this skill point system :)

I thought assigning 1 voc all the modifiers and then referencing that vocation for all others would resolve this issue but that is just not the case because skill / mana tries still revert back to the original vocation...scratches head...

Like this, instead of calling getVocation on player call Voc(0), where 0 is another vocation with the ideal modifiers doesn't work, because at some point down the road Voc(0) doesn't return enough tries to cover the needed amount.

But also I am still getting a return of 0 of the current amount of tries from getSkillTries..

I'll keep working on working on it to see how I can over come this issue.
 
Last edited by a moderator:
I thought assigning 1 voc all the modifiers and then referencing that vocation for all others would resolve this issue but that is just not the case because skill / mana tries still revert back to the original vocation...scratches head...

Like this, instead of calling getVocation on player call Voc(0), where 0 is another vocation with the ideal modifiers doesn't work, because at some point down the road Voc(0) doesn't return enough tries to cover the needed amount.

But also I am still getting a return of 0 of the current amount of tries from getSkillTries..

I'll keep working on working on it to see how I can over come this issue.

I was printing the results of getSkillTries method, and it doesn't return correct value. I believe this is a problem in the source, and the problem with this formula... Must be a work-around, I'm thinking maybe we could query that field from the database for the correct value... idk, at school, I will investigate more when I get home...
 
I see why now it is returning 0 for mana / skills spent because it is going by the current amount of tries per lvl rather than the total from 1 - current lvl total tries, also want to note the higher the number the less required per lvl.. that means the mages got it bad when it comes to gaining ml

A knight's modifier is 3.0 and a mage is 1.1 which means although the knight has less mana they have an easier time getting to the next ml than that of a mage.
 
I see why now it is returning 0 for mana / skills spent because it is going by the current amount of tries per lvl rather than the total from 1 - current lvl total tries, also want to note the higher the number the less required per lvl.. that means the mages got it bad when it comes to gaining ml

A knight's modifier is 3.0 and a mage is 1.1 which means although the knight has less mana they have an easier time getting to the next ml than that of a mage.

Now we just need to create a script that generates this information in a way we can use it to report it on github and be taken seriously....
 
It's a good system, but pretty useless on high rates.
Spending points on extra hp/mp/cap should be easier to do and more useful.
 
I agree with zbizu maybe we can spend points on things like Cap, mana, hp, regen, walking speed etc
 
hmmm... been playing around a bit... what if instead of adding "mana required for level" we can just add a set amount of mana as a %? so they can pay 10 skill points and recieve 50% mana. I'll try write it up.
 
Works perfectly so far, thank you.
Well done, will use it on all my servers.

Kind Regards,
Eldin.
 
Works perfectly so far, thank you.
Well done, will use it on all my servers.

Kind Regards,
Eldin.

EldiN!!! please be carefull as the forumla does not work quite right yet.. it bugs and can add way more skills then it should or it wont add them at all.
 
Back
Top