• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.
Resource icon

Simple talents with modalwindow TFS 1.4.2

No permission to download

MyksaND

Just DO ITTT!
Joined
Mar 5, 2020
Messages
31
Reaction score
12
I had a problem when formulating how to add the magiclevel skill, "SKILL_MAGICLEVEL" changed to "SKILL_MAGLEVEL", it did not give the corresponding skill.
 
if using oens upgrade system or any item that changes maxHealth of player its good to note that it will increase the hp by amount+ Items maxhp increment! so best is to either make player unequip all items or something same issue on 0.4 engines there is no BonusHealth attribute on player so it directly increments maxhealth
 
Have you tried it with that system?

So far it hasn't failed me in terms of increasing life, and I haven't seen any conflicts, but of course I don't use those systems. If you've tried it and it works like that, good advice.
 
Have you tried it with that system?

So far it hasn't failed me in terms of increasing life, and I haven't seen any conflicts, but of course I don't use those systems. If you've tried it and it works like that, good advice.
just add item in items.xml with MaxHealthpoints flag and test
 
A direct query must be made to the database, so that there is no problem with the items, it could be a possible solution.
Or another simpler solution is to not put life or mana increasing talents at a certain level, so that there are no conflicts with hp or mana items.
I'll try to fix that
Post automatically merged:

Something like that, right? I think I'll try to see if it works.


Code:
local function executeSQLQuery(query)
    db.query(query)
end


local function updatePlayerStatsInDatabase(player, effect, amount)
    local playerId = player:getId()
  
    if effect == "hp" or effect == "hp2" or effect == "hp3" then
        local query = string.format("UPDATE players SET healthmax = healthmax + %d WHERE id = %d", amount, playerId)
        executeSQLQuery(query)
    elseif effect == "mana" or effect == "mana2" or effect == "mana3" then
        local query = string.format("UPDATE players SET manamax = manamax + %d WHERE id = %d", amount, playerId)
        executeSQLQuery(query)
    end
end
 
Last edited:
A direct query must be made to the database, so that there is no problem with the items, it could be a possible solution.
Or another simpler solution is to not put life or mana increasing talents at a certain level, so that there are no conflicts with hp or mana items.
I'll try to fix that
Post automatically merged:

Something like that, right? I think I'll try to see if it works.


Code:
local function executeSQLQuery(query)
    db.query(query)
end


local function updatePlayerStatsInDatabase(player, effect, amount)
    local playerId = player:getId()
 
    if effect == "hp" or effect == "hp2" or effect == "hp3" then
        local query = string.format("UPDATE players SET healthmax = healthmax + %d WHERE id = %d", amount, playerId)
        executeSQLQuery(query)
    elseif effect == "mana" or effect == "mana2" or effect == "mana3" then
        local query = string.format("UPDATE players SET manamax = manamax + %d WHERE id = %d", amount, playerId)
        executeSQLQuery(query)
    end
end
will be laggy though repeated queries for 100+ players all time?
easiest solution is to tell player to remove items from equipment completely before assigning points or better yet require them to do it in protection zone aswell! this way people have choice not to die on respawn but i guess if they know they need to deequip they will find safe spot but pkers can abuse it in party etc.
 
will be laggy though repeated queries for 100+ players all time?
easiest solution is to tell player to remove items from equipment completely before assigning points or better yet require them to do it in protection zone aswell! this way people have choice not to die on respawn but i guess if they know they need to deequip they will find safe spot but pkers can abuse it in party etc.
but it only happens with hp and mana? items with that condition right?
 
but it only happens with hp and mana? items with that condition right?
only items that change the basic stats of character yes. skills have additionalSkillBonus or some shi type of way
e.g axe ring etc all that stuff.
its only because mana and hp is done via movements instead of directly via additional database slot.
you could check players level and base it on that but then you have no record unless you make another storage for it of how much player put in already and then when you do that the items will have to be reequipped so you will lose health or mana in that scenario
Post automatically merged:

just found highsanta gems it has checker for equipment
 
Last edited:
I've tried it with magic level and skills and nothing happens, I think it's because of the set condition, it conflicts with something, because the addskill works fine


It conflicts with that system, right?
 
I've tried it with magic level and skills and nothing happens, I think it's because of the set condition, it conflicts with something, because the addskill works fine


It conflicts with that system, right?
no this system add mana /hp also but requires player to take off eq to use the gems
 
no this system add mana /hp also but requires player to take off eq to use the gems
It's strange, because this system goes directly to the player, it shouldn't conflict with items, I just tried it with everything except mana and hp, it works fine
 
i never said it conflicts with stats. i just said maxmana and hp.
Sure, so this script doesn't work well on servers that use items with bonuses like this, because they conflict unless someone knows how to solve this.
 
Sure, so this script doesn't work well on servers that use items with bonuses like this, because they conflict unless someone knows how to solve this.
you have to solve it via c++ or via the equipment check. there is outfit bonuses also for example which give you max mana etc so there is plenty of conflicts to have. perhaps you could take all eq unequip it when pressing button into some place in backpack if there is such place and then add the stats then re-equip
 
you have to solve it via c++ or via the equipment check. there is outfit bonuses also for example which give you max mana etc so there is plenty of conflicts to have. perhaps you could take all eq unequip it when pressing button into some place in backpack if there is such place and then add the stats then re-equip
As far as I know, the only way to give the player mana and hp is that way, if we try to make queries the server performance drops, the last thing left is to make a new function to deliver mana or hp, it's the only way I can think of, but I'm not an expert in the matter, I only dedicate myself to making scripts with some utility, but I wouldn't know how to make a crafting system with its professions, I'm trying but I have many problems.

I can read but not write, the AI writes for me xD
 
As far as I know, the only way to give the player mana and hp is that way, if we try to make queries the server performance drops, the last thing left is to make a new function to deliver mana or hp, it's the only way I can think of, but I'm not an expert in the matter, I only dedicate myself to making scripts with some utility, but I wouldn't know how to make a crafting system with its professions, I'm trying but I have many problems.

I can read but not write, the AI writes for me xD
you could query the slots for items and check if they have bonuses then do
de-equip all items while points are adding and re-equiping them automatically.
 
You can also change

player:getMaxHealth() and player:getMaxMana()

to

player:getBaseMaxHealth() and player:getBaseMaxMana()

So now it will just get the base health and mana poions, ignoring extra values applied by scripts. Seems to be working for me.
 
You can also change

player:getMaxHealth() and player:getMaxMana()

to

player:getBaseMaxHealth() and player:getBaseMaxMana()

So now it will just get the base health and mana poions, ignoring extra values applied by scripts. Seems to be working for me.
yes but when setting the new maxmana it will overload what the equipped items give ? and then when you unequip them you will lose significant portion of your health or die? since its gonna change current max mana/health unless you disable that in the script?
e.g
player has 180 mana
item gives 100 mana
player has 280 mana
the script checks base mana and adds 1
the player now has 181 mana and when unequipping the item he will have 81 mana
 
yes but when setting the new maxmana it will overload what the equipped items give ? and then when you unequip them you will lose significant portion of your health or die? since its gonna change current max mana/health unless you disable that in the script?
e.g
player has 180 mana
item gives 100 mana
player has 280 mana
the script checks base mana and adds 1
the player now has 181 mana and when unequipping the item he will have 81 mana
Nothing like that happens.

There was a commit after 1.4.2 that fixed some issues about equip/deequip, perhaps it has something to do with this.
talentsmp.gif
 
Back
Top