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

TFS 1.X+ death lose levels

hello friends how can i downgrade a player if he reaches 1600 level i want, when he dies he drops 100 levels how do i do that?
hello!
the mostly "simple" way to adjust your deaths depending of your engine and what parameters have in your config.lua that you can set a constant value for.. referring about this parameter, you can find something like:
LUA:
-- Deaths
-- NOTE: Leave deathLosePercent as -1 if you want to use the default
-- death penalty formula. For the old formula, set it to 10. For
-- no skill/experience loss, set it to 0.
deathLosePercent = 5

changing this value of deathLosePercent you will see a good variations in the lost and with few tests probably you gonna find a good value to adapt for the deaths.

if you want a specific behavior for players level 1600+ i think you must create a script for those.
 
hello!
the mostly "simple" way to adjust your deaths depending of your engine and what parameters have in your config.lua that you can set a constant value for.. referring about this parameter, you can find something like:
LUA:
-- Deaths
-- NOTE: Leave deathLosePercent as -1 if you want to use the default
-- death penalty formula. For the old formula, set it to 10. For
-- no skill/experience loss, set it to 0.
deathLosePercent = 5

changing this value of deathLosePercent you will see a good variations in the lost and with few tests probably you gonna find a good value to adapt for the deaths.

if you want a specific behavior for players level 1600+ i think you must create a script for those.

Yes, I want specific behavior for 1600+ level players and how do I make a WHERE SETTER script? Is there another way from the source?
 
Well, I'm using TSF 0.3 and if I try to do this I would write a script for 'login.lua'.

I don't know if you have any idea how it works, but you must create a new script in the paste 'creaturescripts > scripts' along with other scripts... Also you must register your new script in 'login.lua' and 'creaturescripts.xml'.

Then you start your 'death_script.lua' with

LUA:
--basically you'll only use cid
--i dont know if this will works, but it must be something like this...
--also, this is for TSF 0.3, i'm not used to write in 1.3
function onDeath(cid, corpse, lasthitkiller, mostdamagekiller, lasthitunjustified, mostdamageunjustified)
local player_exp = getPlayerExperience(cid)
local amount = 15694800 -- experience required for lv.100
local min_exp = 68011119800 -- experience for lv. 1600

if player_exp > min_exp then
doPlayerAddExperience(cid, -player_exp)
doPlayerAddExperience(cid, amount)
end

return True
end

In 'login.lua' you must register your event with

LUA:
registerCreatureEvent(cid, "Death Player")

Finally, in 'creaturescripts.xml'...

XML:
<event type="death" name="Death Player" event="script" value="death_script.lua"/>

Hope it works, please commend me if this help you!
 
Well, I'm using TSF 0.3 and if I try to do this I would write a script for 'login.lua'.

I don't know if you have any idea how it works, but you must create a new script in the paste 'creaturescripts > scripts' along with other scripts... Also you must register your new script in 'login.lua' and 'creaturescripts.xml'.

Then you start your 'death_script.lua' with

LUA:
--basically you'll only use cid
--i dont know if this will works, but it must be something like this...
--also, this is for TSF 0.3, i'm not used to write in 1.3
function onDeath(cid, corpse, lasthitkiller, mostdamagekiller, lasthitunjustified, mostdamageunjustified)
local player_exp = getPlayerExperience(cid)
local amount = 15694800 -- experience required for lv.100
local min_exp = 68011119800 -- experience for lv. 1600

if player_exp > min_exp then
doPlayerAddExperience(cid, -player_exp)
doPlayerAddExperience(cid, amount)
end

return True
end

In 'login.lua' you must register your event with

LUA:
registerCreatureEvent(cid, "Death Player")

Finally, in 'creaturescripts.xml'...

XML:
<event type="death" name="Death Player" event="script" value="death_script.lua"/>

Hope it works, please commend me if this help you!
You are using tfs 0.3, it is impossible to work in tfs 1.2, it needs to be modified
Anyway thank you
Actually I didn't test it because I solved this from the source pllayer.cpp
 
Back
Top