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

exp for players

ZiumZium

Member
Joined
Sep 27, 2024
Messages
106
Solutions
1
Reaction score
11
Hi :) I have a PvP server, but I would like to give a "symbolic" EXP reward for players. Where could I change this? Unfortunately, I don't have it in config.lua :)

TFS 1.4.2

worldType = "pvp"
hotkeyAimbotEnabled = true
protectionLevel = 1
killsToRedSkull = 4
killsToBlackSkull = 8
pzLocked = 60000
removeChargesFromRunes = true
removeChargesFromPotions = true
removeWeaponAmmunition = true
removeWeaponCharges = true
timeToDecreaseFrags = 8 * 60 * 60
whiteSkullTime = 15 * 60
stairJumpExhaustion = 100
experienceByKillingPlayers = true
expFromPlayersLevelRange = 75
 
Solution
I added everything that River KA wrote and compiled. However, in the game at this point you don't get any EXP for killing a player
config
LUA:
experienceByKillingPlayers = true
expFromPlayersLevelRange = 600
expFromPlayersRatioPercent = 25
expFromPlayersLevelRange //This means that if a player at level 100 kills a player at level 700, he will get experience. If he is above 700, he will not get experience because I have set the difference at 600
If all of this does not work for you, you can control the experience from the source without having to add it in config from this line in player.cpp
Reduce 75
C++:
return std::max<uint64_t>(0, std::floor(getLostExperience() * getDamageRatio(attacker) * 0.75));
Player.cpp in sources or creaturescript on Death.
I can't find it. I see formulas everywhere for loss but not gain of exp in on Death 🤔

By the way. Is it possible to somehow output it to .lua so that I don't have to compile it every now and then and just change it in config.lua?
 
I can't find it. I see formulas everywhere for loss but not gain of exp in on Death 🤔

By the way. Is it possible to somehow output it to .lua so that I don't have to compile it every now and then and just change it in config.lua?
Everything in sources can be ported to a LUA configuration. Take inspiration from the other things that's already in the LUA config and backtrack them to the relevant .cpp files and try make something similar.
 
 
I did it but it doesn't work :/

It doesn't matter if I put it in config.lua


expFromPlayersRatioPercent = 5
or

expFromPlayersRatioPercent = 95


Gives the same amount of exp :/

I made all the changes and gave compilations. There are 0 errors in CMD
 
I did it but it doesn't work :/

It doesn't matter if I put it in config.lua


expFromPlayersRatioPercent = 5
or

expFromPlayersRatioPercent = 95


Gives the same amount of exp :/

I made all the changes and gave compilations. There are 0 errors in CMD
Everything works fine for me in tfs 1.2 and 1.5 you can check the codes again
 
Hmm... So it should also work on 1.4.2. I'll check again
Post automatically merged:

Everything works fine for me in tfs 1.2 and 1.5 you can check the codes again
Wait, because I can see out of one eye today :D and I have to work :D Have you changed anything in the player.cpp (what is the link to it)?
 
Last edited:
Just like the link
 
I added everything that River KA wrote and compiled. However, in the game at this point you don't get any EXP for killing a player
 
I added everything that River KA wrote and compiled. However, in the game at this point you don't get any EXP for killing a player
config
LUA:
experienceByKillingPlayers = true
expFromPlayersLevelRange = 600
expFromPlayersRatioPercent = 25
expFromPlayersLevelRange //This means that if a player at level 100 kills a player at level 700, he will get experience. If he is above 700, he will not get experience because I have set the difference at 600
If all of this does not work for you, you can control the experience from the source without having to add it in config from this line in player.cpp
Reduce 75
C++:
return std::max<uint64_t>(0, std::floor(getLostExperience() * getDamageRatio(attacker) * 0.75));
 
Solution
Back
Top