• 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] Skill Points, modalwindow

Status
Not open for further replies.
Works great man, thanks!
Another question, possible to add something to increase healthgain and managain? :)
 
It would be either non-effective or overpowered plus I'm tired of scripting regeneration, getting it to work is annoying.
 
It would be such a perfect addition to my server and I would kill to have it working. If you have any idea of what functions and codes I would need I could do my absolute best to add them myself.
 
See my item stat system. It has examples for everything.
 
It would be such a perfect addition to my server and I would kill to have it working. If you have any idea of what functions and codes I would need I could do my absolute best to add them myself.

If you really want to learn and try yourself, try reading code over and over, come back to code you didn't understand as you progress. If you do know any thing about doing good edits then here is how to make the regen in simple way. Use storage values, save the percent or level in storage values, find player.feed function in global.lua and alter it to check for a conditition you create globally, have the condition (regen) increase in how many points by the storage value and add the conditon to the player, as well as the the point increase thru a function you create (to be used on the modalwindow skillpoint system), then make sure the conditon used in player feed use same condition for regen, and make sure to have it count off the same condition that way it still determines the ticks and everything correctly when first creating the conditon object.
 
If you really want to learn and try yourself, try reading code over and over, come back to code you didn't understand as you progress. If you do know any thing about doing good edits then here is how to make the regen in simple way. Use storage values, save the percent or level in storage values, find player.feed function in global.lua and alter it to check for a conditition you create globally, have the condition (regen) increase in how many points by the storage value and add the conditon to the player, as well as the the point increase thru a function you create (to be used on the modalwindow skillpoint system), then make sure the conditon used in player feed use same condition for regen, and make sure to have it count off the same condition that way it still determines the ticks and everything correctly when first creating the conditon object.
m8 u rly salty sometimes. keep calm, smoke one and let them be them (i dont want to define "them")
 
hey man great stuff, thanks.
any way to add a couple of lines to check when the player levels up more than one level and add the points accordingly?
it would be greatly appreciated and pretty much the only thing that could be improved upon cause its perfect
 
Script wasn't meant to be used on high exp servers, but I'll check it.
 
Is it supposed to actually advance skills? When I have 10 skill and use a skill point, I still have 10 skill.
 
I found an interesting bug.

If I'm wearing items that give hp/mana bonus (I'm using your item stat system as well), when I add a point to hp or mana, it adds the entire bonus of the equipped items as well as the 10 I'm supposed to get. I'm wearing a ring and an amulet that give 200 mana each (value, not percent) and every time I add a skill point to mana, I gain 410 mana to my maximum, on top of the existing bonus of 400, so I end up with an additional 400 mana even if I unequip my items that give a bonus.

On another note, I got 3 levels at once and only gained points as if I'd levelled once. Will need to check the difference between new level and old level in the onadvance.
 
Last edited:
@RazorBlade I noticed that too, therefor I currently disabled the health and mana bonus on item bonus system :p
Also, would it be complicated change skillgain to be based on storages instead? Because I don't want players to gain skilltries and spent mana with this system, just the actual skill.
 
@calveron
I changed my health and mana to this instead. Feel free to use it, and clean it up a bit if you'd like :p
Code:
[1] = {'Health', function(player) return player:getMaxHealth() end, function(player) local gain = gainVoc[player:getBaseVocId()].health player:setMaxHealth(185 + (player:getVocation():getHealthGainAmount() * (player:getLevel() - 8)) + player:getStorageValue(321) + gain) player:setStorageValue(321, player:getStorageValue(321) + gain) return gain end, 10},
    [2] = {'Mana', function(player) return player:getMaxMana() end, function(player) local gain = gainVoc[player:getBaseVocId()].mana player:setMaxMana(40 + (player:getVocation():getManaGainAmount() * (player:getLevel() - 8)) + player:getStorageValue(322) + gain) player:setStorageValue(322, player:getStorageValue(322) + gain) return gain end, 10},

Why don't you want them to gain skilltries and spent mana? If you want it to add full skills, you can do this:
Code:
local xp = math.ceil(self:getVocation():getRequiredSkillTries(skill, self:getSkillLevel(skill) + 1))
            self:addSkillTries(skill, xp)

It seems that the engine determines the required skilltries using the multipliers in config.lua, so if you modify it a second time in the script as it currently works, you'll end up with a fraction of 1/skillmultiplier so you'll have to upgrade the stat "skillmultiplier " times in order to get one skill.

As far as I know, skills will not advance properly unless you add the tries. If you have skill 100 through something like database queries, but 0 tries, I don't believe you can advance to skill 101 until you get all skill tries required from 1-100 first. If you create a creaturescript of sorts, you could check skill and set their skilltries accordingly I guess, but that's just messy.

EDIT:

Add this to your login script where it checks for first login so that any player that logs in for the first time would have 0 added mana/hp otherwise when the script adds on, they'll start at -1 instead of 0 and their mana and hp will always be 1 behind :p
Code:
player:setStorageValue(321, 0)
        player:setStorageValue(322, 0)
 
@RazorBlade
I want them to have the same opportunity to train their skills on monks for example, even if they used skill points or not. Getting sword 50 with skill points and without training anything, I want players to spend just as much time training on monks to get sword 51 as it would to get sword 11 :p On top of that, I will add a feature where players can reset their skill points.
I have also changed the system in to 2 parts, attribute points & skill points. Attribute points will let you increase your health or mana and skill points to increase your skills.
That is why it would be cool to combine skills with storages if its possible, in that case, players wont lose their "monk-trained" skills if they reset their points.

And thanks for letting me use your health and mana system, really helps me out :)
 
Well I suppose you could do what I did with the health and mana. Just store the number of skill levels they gain as a storage value and when you reset, only remove that many. I'm not sure how you'd remove the skills though. I won't be much help there :p
 
You guys are having so many problems because you are still trying to actually use the real skills, it's so much simpler to just create the conditions and ties with them through storages, all can be handled through the creaturescripts and events, which means all could be handled in a global lib, so you can easily make the additions to this script, just make the additions in sp.lua and then find the appropriate scripts put in your code.

Why not go for the real fun and try to write your own from scratch? You can always use pieces of code from other scripts, but you learn so much more and have so much more fun and control doing it this way, naming your own variables, completely making it your own, only adding what you need and want.
 
I've basically been picking up whatever scripts look cool and trying them out to see which ones fit what I want for my server and which ones don't, and once I've figured out everything I want, I do plan to make my own versions to work exactly how I want them.
 
Status
Not open for further replies.
Back
Top